Skip to content
This repository was archived by the owner on May 27, 2025. It is now read-only.

Commit cd3f618

Browse files
committed
chore: Upgrade ckb-sdk-js
1 parent 37636bd commit cd3f618

File tree

24 files changed

+99
-112
lines changed

24 files changed

+99
-112
lines changed

.github/workflows/snapshot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
push:
88
branches:
99
- develop
10+
- ref/support-esm
1011

1112
concurrency: ${{ github.workflow }}-${{ github.ref }}
1213

examples/rgbpp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:fix": "tsc && eslint --fix --ext .js,.ts . && prettier --write '**/*.{js,ts}'"
1111
},
1212
"dependencies": {
13-
"@nervosnetwork/ckb-sdk-utils": "^0.109.1",
13+
"@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1",
1414
"rgbpp": "^0.4.0"
1515
},
1616
"devDependencies": {

examples/xudt-on-ckb/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:fix": "tsc && eslint --fix --ext .ts . && prettier --write '**/*.ts'"
1111
},
1212
"dependencies": {
13-
"@nervosnetwork/ckb-sdk-utils": "^0.109.1",
13+
"@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1",
1414
"rgbpp": "^0.4.0"
1515
},
1616
"devDependencies": {

packages/btc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@bitcoinerlab/secp256k1": "^1.1.1",
3232
"@ckb-lumos/codec": "0.22.2",
33-
"@nervosnetwork/ckb-types": "^0.109.1",
33+
"@nervosnetwork/ckb-types": "0.109.2-alpha.1",
3434
"@rgbpp-sdk/ckb": "workspace:^",
3535
"@rgbpp-sdk/service": "workspace:^",
3636
"bip32": "^4.0.0",

packages/ckb/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
"@ckb-lumos/base": "^0.22.2",
3333
"@ckb-lumos/codec": "^0.22.2",
3434
"@spore-sdk/core": "^0.2.0-beta.6",
35-
"@nervosnetwork/ckb-sdk-core": "^0.109.1",
36-
"@nervosnetwork/ckb-sdk-utils": "^0.109.1",
37-
"@nervosnetwork/ckb-types": "^0.109.1",
35+
"@nervosnetwork/ckb-sdk-core": "0.109.2-alpha.1",
36+
"@nervosnetwork/ckb-sdk-utils": "0.109.2-alpha.1",
37+
"@nervosnetwork/ckb-types": "0.109.2-alpha.1",
3838
"@rgbpp-sdk/service": "workspace:^",
3939
"@exact-realty/multipart-parser": "^1.0.13",
4040
"axios": "^1.6.8",

packages/ckb/src/collector/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ export class Collector {
168168

169169
async getLiveCells(outPoints: CKBComponents.OutPoint[], withData = false): Promise<CKBComponents.LiveCell[]> {
170170
const ckb = new CKB(this.ckbNodeUrl);
171-
/* @ts-expect-error The parameters data types of batch request don't support boolean */
172171
const batch = ckb.rpc.createBatchRequest(outPoints.map((outPoint) => ['getLiveCell', outPoint, withData]));
173172
return batch.exec().then((liveCells) => liveCells.map((liveCell) => liveCell.cell));
174173
}

packages/ckb/src/paymaster/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import { ConstructPaymasterParams } from '../types/rgbpp';
22
import { NoLiveCellError } from '../error';
33
import { CKB_UNIT, MAX_FEE, SECP256K1_WITNESS_LOCK_SIZE, getSecp256k1CellDep } from '../constants';
4-
import {
5-
append0x,
6-
calculateTransactionFee,
7-
AddressPrefix,
8-
addressToScript,
9-
getTransactionSize,
10-
privateKeyToAddress,
11-
} from '../utils';
4+
import { append0x, calculateTransactionFee } from '../utils';
5+
import { AddressPrefix, addressToScript, getTransactionSize, privateKeyToAddress } from '@nervosnetwork/ckb-sdk-utils';
126

137
const SECP256K1_MIN_CAPACITY = BigInt(61) * CKB_UNIT;
148

packages/ckb/src/rgbpp/btc-jump-ckb.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import {
1010
isScriptEqual,
1111
isUDTTypeSupported,
1212
u128ToLe,
13-
addressToScript,
14-
getTransactionSize,
1513
buildPreLockArgs,
1614
calculateCommitment,
1715
throwErrorWhenTxInputsExceeded,
@@ -25,6 +23,7 @@ import {
2523
} from '../utils';
2624
import { Hex, IndexerCell } from '../types';
2725
import { RGBPP_WITNESS_PLACEHOLDER, getSecp256k1CellDep } from '../constants';
26+
import { addressToScript, getTransactionSize } from '@nervosnetwork/ckb-sdk-utils';
2827

2928
/**
3029
* Generate the virtual ckb transaction for the jumping tx from BTC to CKB

packages/ckb/src/rgbpp/btc-time.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
import {
2+
addressToScript,
3+
bytesToHex,
4+
getTransactionSize,
5+
rawTransactionToHash,
6+
scriptToHash,
7+
serializeOutPoint,
8+
serializeWitnessArgs,
9+
} from '@nervosnetwork/ckb-sdk-utils';
110
import {
211
BTC_JUMP_CONFIRMATION_BLOCKS,
312
SECP256K1_WITNESS_LOCK_SIZE,
@@ -15,13 +24,6 @@ import {
1524
genBtcTimeLockArgs,
1625
lockScriptFromBtcTimeLockArgs,
1726
transformSpvProof,
18-
addressToScript,
19-
bytesToHex,
20-
getTransactionSize,
21-
rawTransactionToHash,
22-
scriptToHash,
23-
serializeOutPoint,
24-
serializeWitnessArgs,
2527
buildSpvClientCellDep,
2628
blockchain,
2729
signWitnesses,

packages/ckb/src/rgbpp/btc-transfer.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ import {
1616
isScriptEqual,
1717
isUDTTypeSupported,
1818
u128ToLe,
19-
addressToScript,
20-
getTransactionSize,
21-
rawTransactionToHash,
22-
scriptToHash,
23-
serializeWitnessArgs,
2419
buildPreLockArgs,
2520
calculateCommitment,
2621
compareInputs,
@@ -41,6 +36,13 @@ import {
4136
getRgbppLockScript,
4237
getSecp256k1CellDep,
4338
} from '../constants';
39+
import {
40+
addressToScript,
41+
getTransactionSize,
42+
rawTransactionToHash,
43+
scriptToHash,
44+
serializeWitnessArgs,
45+
} from '@nervosnetwork/ckb-sdk-utils';
4446

4547
/**
4648
* Generate the virtual ckb transaction for the btc transfer tx

0 commit comments

Comments
 (0)