@ckb-ccc/core 0.0.12-alpha.0 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +5 -5
- package/dist/address/index.d.ts +4 -0
- package/dist/address/index.d.ts.map +1 -1
- package/dist/address/index.js +1 -0
- package/dist/advancedBarrel.d.ts +1 -0
- package/dist/advancedBarrel.d.ts.map +1 -1
- package/dist/advancedBarrel.js +1 -0
- package/dist/bytes/advanced.d.ts +1 -0
- package/dist/bytes/advanced.d.ts.map +1 -1
- package/dist/bytes/index.d.ts +9 -0
- package/dist/bytes/index.d.ts.map +1 -1
- package/dist/bytes/index.js +3 -0
- package/dist/ckb/index.d.ts +1 -0
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +1 -0
- package/dist/ckb/script.d.ts +15 -0
- package/dist/ckb/script.d.ts.map +1 -1
- package/dist/ckb/script.js +6 -0
- package/dist/ckb/transaction.d.ts +65 -11
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +41 -14
- package/dist/ckb/transactionLumos.d.ts +29 -0
- package/dist/ckb/transactionLumos.d.ts.map +1 -0
- package/dist/ckb/transactionLumos.js +1 -0
- package/dist/client/client.d.ts +13 -1
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +10 -1
- package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.advanced.js +9 -0
- package/dist/client/clientPublicMainnet.d.ts +3 -0
- package/dist/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.js +3 -0
- package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.advanced.js +9 -0
- package/dist/client/clientPublicTestnet.d.ts +3 -0
- package/dist/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.js +3 -0
- package/dist/client/clientTypes.d.ts +45 -0
- package/dist/client/clientTypes.d.ts.map +1 -1
- package/dist/client/clientTypes.js +9 -0
- package/dist/client/jsonRpc/index.d.ts +6 -6
- package/dist/client/jsonRpc/index.d.ts.map +1 -1
- package/dist/client/jsonRpc/index.js +3 -3
- package/dist/fixedPoint/index.d.ts +6 -0
- package/dist/fixedPoint/index.d.ts.map +1 -1
- package/dist/fixedPoint/index.js +5 -0
- package/dist/hasher/hasher.d.ts +3 -0
- package/dist/hasher/hasher.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.d.ts +6 -1
- package/dist/hasher/hasherCkb.d.ts.map +1 -1
- package/dist/hasher/hasherCkb.js +6 -1
- package/dist/hasher/hasherKeecak256.d.ts +3 -0
- package/dist/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist/hasher/hasherKeecak256.js +3 -0
- package/dist/hex/index.d.ts +3 -0
- package/dist/hex/index.d.ts.map +1 -1
- package/dist/hex/index.js +1 -0
- package/dist/keystore/index.d.ts +6 -0
- package/dist/keystore/index.d.ts.map +1 -1
- package/dist/keystore/index.js +6 -0
- package/dist/num/index.d.ts +11 -0
- package/dist/num/index.d.ts.map +1 -1
- package/dist/num/index.js +9 -0
- package/dist/package.json +1 -1
- package/dist/signer/btc/signerBtc.d.ts +1 -0
- package/dist/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist/signer/btc/signerBtc.js +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist/signer/btc/verify.d.ts +3 -0
- package/dist/signer/btc/verify.d.ts.map +1 -1
- package/dist/signer/btc/verify.js +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist/signer/ckb/verifyJoyId.js +3 -0
- package/dist/signer/dummy/alwaysError.d.ts +3 -0
- package/dist/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist/signer/dummy/alwaysError.js +3 -0
- package/dist/signer/dummy/dummy.d.ts +3 -0
- package/dist/signer/dummy/dummy.d.ts.map +1 -1
- package/dist/signer/dummy/dummy.js +3 -0
- package/dist/signer/dummy/openLink.d.ts +3 -0
- package/dist/signer/dummy/openLink.d.ts.map +1 -1
- package/dist/signer/dummy/openLink.js +3 -0
- package/dist/signer/evm/signerEvm.d.ts +1 -0
- package/dist/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist/signer/evm/signerEvm.js +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist/signer/evm/verify.d.ts +3 -0
- package/dist/signer/evm/verify.d.ts.map +1 -1
- package/dist/signer/evm/verify.js +3 -0
- package/dist/signer/nostr/signerNostr.d.ts +6 -0
- package/dist/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist/signer/nostr/signerNostr.js +3 -0
- package/dist/signer/nostr/verify.d.ts +3 -0
- package/dist/signer/nostr/verify.d.ts.map +1 -1
- package/dist/signer/nostr/verify.js +3 -0
- package/dist/signer/signer/index.d.ts +26 -3
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/signer/signer/index.js +12 -3
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +13 -0
- package/dist.commonjs/address/index.d.ts +4 -0
- package/dist.commonjs/address/index.d.ts.map +1 -1
- package/dist.commonjs/address/index.js +1 -0
- package/dist.commonjs/advancedBarrel.d.ts +1 -0
- package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
- package/dist.commonjs/advancedBarrel.js +1 -0
- package/dist.commonjs/bytes/advanced.d.ts +1 -0
- package/dist.commonjs/bytes/advanced.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.d.ts +9 -0
- package/dist.commonjs/bytes/index.d.ts.map +1 -1
- package/dist.commonjs/bytes/index.js +3 -0
- package/dist.commonjs/ckb/index.d.ts +1 -0
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +1 -0
- package/dist.commonjs/ckb/script.d.ts +15 -0
- package/dist.commonjs/ckb/script.d.ts.map +1 -1
- package/dist.commonjs/ckb/script.js +6 -0
- package/dist.commonjs/ckb/transaction.d.ts +65 -11
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +41 -14
- package/dist.commonjs/ckb/transactionLumos.d.ts +29 -0
- package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -0
- package/dist.commonjs/ckb/transactionLumos.js +2 -0
- package/dist.commonjs/client/client.d.ts +13 -1
- package/dist.commonjs/client/client.d.ts.map +1 -1
- package/dist.commonjs/client/client.js +10 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +9 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.js +3 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +9 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts +3 -0
- package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.js +3 -0
- package/dist.commonjs/client/clientTypes.d.ts +45 -0
- package/dist.commonjs/client/clientTypes.d.ts.map +1 -1
- package/dist.commonjs/client/clientTypes.js +9 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts +6 -6
- package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -1
- package/dist.commonjs/client/jsonRpc/index.js +3 -3
- package/dist.commonjs/fixedPoint/index.d.ts +6 -0
- package/dist.commonjs/fixedPoint/index.d.ts.map +1 -1
- package/dist.commonjs/fixedPoint/index.js +5 -0
- package/dist.commonjs/hasher/hasher.d.ts +3 -0
- package/dist.commonjs/hasher/hasher.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts +6 -1
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherCkb.js +6 -1
- package/dist.commonjs/hasher/hasherKeecak256.d.ts +3 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasherKeecak256.js +3 -0
- package/dist.commonjs/hex/index.d.ts +3 -0
- package/dist.commonjs/hex/index.d.ts.map +1 -1
- package/dist.commonjs/hex/index.js +1 -0
- package/dist.commonjs/keystore/index.d.ts +6 -0
- package/dist.commonjs/keystore/index.d.ts.map +1 -1
- package/dist.commonjs/keystore/index.js +6 -0
- package/dist.commonjs/num/index.d.ts +11 -0
- package/dist.commonjs/num/index.d.ts.map +1 -1
- package/dist.commonjs/num/index.js +9 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtc.js +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
- package/dist.commonjs/signer/btc/verify.d.ts +3 -0
- package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/verify.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +3 -0
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +3 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +1 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +6 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +3 -0
- package/dist.commonjs/signer/ckb/verifyJoyId.d.ts.map +1 -1
- package/dist.commonjs/signer/ckb/verifyJoyId.js +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts +3 -0
- package/dist.commonjs/signer/dummy/alwaysError.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/alwaysError.js +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts +3 -0
- package/dist.commonjs/signer/dummy/dummy.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/dummy.js +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts +3 -0
- package/dist.commonjs/signer/dummy/openLink.d.ts.map +1 -1
- package/dist.commonjs/signer/dummy/openLink.js +3 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvm.js +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +1 -0
- package/dist.commonjs/signer/evm/verify.d.ts +3 -0
- package/dist.commonjs/signer/evm/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/verify.js +3 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts +6 -0
- package/dist.commonjs/signer/nostr/signerNostr.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/signerNostr.js +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts +3 -0
- package/dist.commonjs/signer/nostr/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/verify.js +3 -0
- package/dist.commonjs/signer/signer/index.d.ts +26 -3
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/signer/index.js +12 -3
- package/dist.commonjs/utils/index.d.ts +12 -0
- package/dist.commonjs/utils/index.d.ts.map +1 -1
- package/dist.commonjs/utils/index.js +13 -0
- package/package.json +8 -10
- package/src/address/index.ts +4 -1
- package/src/advancedBarrel.ts +1 -0
- package/src/bytes/advanced.ts +1 -0
- package/src/bytes/index.ts +9 -0
- package/src/ckb/index.ts +1 -0
- package/src/ckb/script.ts +15 -0
- package/src/ckb/transaction.ts +72 -16
- package/src/ckb/transactionLumos.ts +26 -0
- package/src/client/client.ts +13 -1
- package/src/client/clientPublicMainnet.advanced.ts +10 -0
- package/src/client/clientPublicMainnet.ts +3 -0
- package/src/client/clientPublicTestnet.advanced.ts +10 -0
- package/src/client/clientPublicTestnet.ts +3 -0
- package/src/client/clientTypes.ts +45 -0
- package/src/client/jsonRpc/index.ts +5 -6
- package/src/fixedPoint/index.ts +6 -0
- package/src/hasher/hasher.ts +3 -0
- package/src/hasher/hasherCkb.ts +6 -1
- package/src/hasher/hasherKeecak256.ts +3 -0
- package/src/hex/index.ts +3 -0
- package/src/keystore/index.ts +6 -0
- package/src/num/index.ts +11 -0
- package/src/signer/btc/signerBtc.ts +1 -0
- package/src/signer/btc/signerBtcPublicKeyReadonly.ts +1 -0
- package/src/signer/btc/verify.ts +3 -0
- package/src/signer/ckb/signerCkbPrivateKey.ts +3 -0
- package/src/signer/ckb/signerCkbPublicKey.ts +3 -0
- package/src/signer/ckb/signerCkbScriptReadonly.ts +1 -0
- package/src/signer/ckb/verifyCkbSecp256k1.ts +6 -0
- package/src/signer/ckb/verifyJoyId.ts +3 -0
- package/src/signer/dummy/alwaysError.ts +3 -0
- package/src/signer/dummy/dummy.ts +3 -0
- package/src/signer/dummy/openLink.ts +3 -0
- package/src/signer/evm/signerEvm.ts +1 -0
- package/src/signer/evm/signerEvmAddressReadonly.ts +1 -0
- package/src/signer/evm/verify.ts +3 -0
- package/src/signer/nostr/signerNostr.ts +6 -0
- package/src/signer/nostr/verify.ts +3 -0
- package/src/signer/signer/index.ts +26 -14
- package/src/utils/index.ts +22 -0
- package/typedoc.json +6 -0
|
@@ -31,7 +31,7 @@ export class ClientJsonRpc extends Client {
|
|
|
31
31
|
/**
|
|
32
32
|
* Creates an instance of ClientJsonRpc.
|
|
33
33
|
*
|
|
34
|
-
* @param
|
|
34
|
+
* @param url_ - The URL of the JSON-RPC server.
|
|
35
35
|
* @param timeout - The timeout for requests in milliseconds, default is 30000.
|
|
36
36
|
*/
|
|
37
37
|
constructor(url_, timeout = 30000) {
|
|
@@ -49,7 +49,7 @@ export class ClientJsonRpc extends Client {
|
|
|
49
49
|
*
|
|
50
50
|
* @param blockNumber - The block number.
|
|
51
51
|
* @param verbosity - result format which allows 0 and 2. (Optional, the default is 2.)
|
|
52
|
-
* @param
|
|
52
|
+
* @param withCycles - whether the return cycles of block transactions. (Optional, default false.)
|
|
53
53
|
* @returns Block
|
|
54
54
|
*/
|
|
55
55
|
this.getBlockByNumber = this.buildSender("get_block_by_number", [(v) => numToHex(numFrom(v))], (b) => apply(JsonRpcTransformers.blockTo, b));
|
|
@@ -58,7 +58,7 @@ export class ClientJsonRpc extends Client {
|
|
|
58
58
|
*
|
|
59
59
|
* @param blockHash - The block hash.
|
|
60
60
|
* @param verbosity - result format which allows 0 and 2. (Optional, the default is 2.)
|
|
61
|
-
* @param
|
|
61
|
+
* @param withCycles - whether the return cycles of block transactions. (Optional, default false.)
|
|
62
62
|
* @returns Block
|
|
63
63
|
*/
|
|
64
64
|
this.getBlockByHash = this.buildSender("get_block", [hexFrom], (b) => apply(JsonRpcTransformers.blockTo, b));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents a fixed point value as a bigint.
|
|
3
|
+
* @public
|
|
3
4
|
*/
|
|
4
5
|
export type FixedPoint = bigint;
|
|
5
6
|
/**
|
|
6
7
|
* Represents a value that can be converted to a fixed point value.
|
|
7
8
|
* It can be a bigint, string, or number.
|
|
9
|
+
* @public
|
|
8
10
|
*/
|
|
9
11
|
export type FixedPointLike = bigint | string | number;
|
|
10
12
|
/**
|
|
11
13
|
* Converts a FixedPointLike value to its string representation with fixed-point decimals.
|
|
14
|
+
* @public
|
|
12
15
|
*
|
|
13
16
|
* @param val - The value to convert, which can be a bigint, string, or number.
|
|
14
17
|
* @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
|
|
@@ -24,6 +27,7 @@ export type FixedPointLike = bigint | string | number;
|
|
|
24
27
|
export declare function fixedPointToString(val: FixedPointLike, decimals?: number): string;
|
|
25
28
|
/**
|
|
26
29
|
* Converts a FixedPointLike value to a FixedPoint (bigint) with fixed-point decimals.
|
|
30
|
+
* @public
|
|
27
31
|
*
|
|
28
32
|
* @param val - The value to convert, which can be a bigint, string, or number.
|
|
29
33
|
* @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
|
|
@@ -39,11 +43,13 @@ export declare function fixedPointToString(val: FixedPointLike, decimals?: numbe
|
|
|
39
43
|
export declare function fixedPointFrom(val: FixedPointLike, decimals?: number): FixedPoint;
|
|
40
44
|
/**
|
|
41
45
|
* Represents the fixed point value of zero as a bigint.
|
|
46
|
+
* @public
|
|
42
47
|
*/
|
|
43
48
|
export declare const Zero: FixedPoint;
|
|
44
49
|
/**
|
|
45
50
|
* Represents the fixed point value of one as a FixedPoint (bigint).
|
|
46
51
|
* Equivalent to 1 in fixed-point representation with default decimals (8).
|
|
52
|
+
* @public
|
|
47
53
|
*/
|
|
48
54
|
export declare const One: FixedPoint;
|
|
49
55
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAa5E;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAc5E;AAED;;;GAGG;AAEH,eAAO,MAAM,IAAI,EAAE,UAAe,CAAC;AAEnC;;;;GAIG;AAEH,eAAO,MAAM,GAAG,EAAE,UAAgC,CAAC"}
|
package/dist/fixedPoint/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Represents a fixed point value as a bigint.
|
|
3
|
+
* @public
|
|
3
4
|
*/
|
|
4
5
|
/**
|
|
5
6
|
* Converts a FixedPointLike value to its string representation with fixed-point decimals.
|
|
7
|
+
* @public
|
|
6
8
|
*
|
|
7
9
|
* @param val - The value to convert, which can be a bigint, string, or number.
|
|
8
10
|
* @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
|
|
@@ -29,6 +31,7 @@ export function fixedPointToString(val, decimals = 8) {
|
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
31
33
|
* Converts a FixedPointLike value to a FixedPoint (bigint) with fixed-point decimals.
|
|
34
|
+
* @public
|
|
32
35
|
*
|
|
33
36
|
* @param val - The value to convert, which can be a bigint, string, or number.
|
|
34
37
|
* @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
|
|
@@ -54,10 +57,12 @@ export function fixedPointFrom(val, decimals = 8) {
|
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Represents the fixed point value of zero as a bigint.
|
|
60
|
+
* @public
|
|
57
61
|
*/
|
|
58
62
|
export const Zero = 0n;
|
|
59
63
|
/**
|
|
60
64
|
* Represents the fixed point value of one as a FixedPoint (bigint).
|
|
61
65
|
* Equivalent to 1 in fixed-point representation with default decimals (8).
|
|
66
|
+
* @public
|
|
62
67
|
*/
|
|
63
68
|
export const One = fixedPointFrom("1");
|
package/dist/hasher/hasher.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../src/hasher/hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAEhC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../src/hasher/hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAEhC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG,CAAC;CACf"}
|
|
@@ -3,6 +3,9 @@ import { CellInputLike } from "../ckb/index.js";
|
|
|
3
3
|
import { Hex } from "../hex/index.js";
|
|
4
4
|
import { NumLike } from "../num/index.js";
|
|
5
5
|
import { Hasher } from "./hasher.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export declare class HasherCkb implements Hasher {
|
|
7
10
|
private readonly hasher;
|
|
8
11
|
/**
|
|
@@ -42,6 +45,7 @@ export declare class HasherCkb implements Hasher {
|
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
47
|
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
48
|
+
* @public
|
|
45
49
|
*
|
|
46
50
|
* @param data - The data to hash.
|
|
47
51
|
* @returns The hexadecimal string representation of the hash.
|
|
@@ -54,8 +58,9 @@ export declare class HasherCkb implements Hasher {
|
|
|
54
58
|
export declare function hashCkb(...data: BytesLike[]): Hex;
|
|
55
59
|
/**
|
|
56
60
|
* Computes the Type ID hash of the given data.
|
|
61
|
+
* @public
|
|
57
62
|
*
|
|
58
|
-
* @param
|
|
63
|
+
* @param cellInputLike - The first cell input of the transaction.
|
|
59
64
|
* @param outputIndex - The output index of the Type ID cell.
|
|
60
65
|
* @returns The hexadecimal string representation of the hash.
|
|
61
66
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasherCkb.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherCkb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAa,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,SAAU,YAAW,MAAM;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE;;;;;OAKG;gBAES,SAAS,SAAK,EAAE,QAAQ,SAAuB;IAO3D;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAKlC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd;AAED
|
|
1
|
+
{"version":3,"file":"hasherCkb.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherCkb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAa,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,qBAAa,SAAU,YAAW,MAAM;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE;;;;;OAKG;gBAES,SAAS,SAAK,EAAE,QAAQ,SAAuB;IAO3D;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAKlC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,CAIjD;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,UAAU,CACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,OAAO,GACnB,GAAG,CAKL"}
|
package/dist/hasher/hasherCkb.js
CHANGED
|
@@ -4,6 +4,9 @@ import { CellInput } from "../ckb/index.js";
|
|
|
4
4
|
import { hexFrom } from "../hex/index.js";
|
|
5
5
|
import { numLeToBytes } from "../num/index.js";
|
|
6
6
|
import { CKB_BLAKE2B_PERSONAL } from "./advanced.js";
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
7
10
|
export class HasherCkb {
|
|
8
11
|
/**
|
|
9
12
|
* Creates an instance of Hasher.
|
|
@@ -52,6 +55,7 @@ export class HasherCkb {
|
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
57
|
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
58
|
+
* @public
|
|
55
59
|
*
|
|
56
60
|
* @param data - The data to hash.
|
|
57
61
|
* @returns The hexadecimal string representation of the hash.
|
|
@@ -68,8 +72,9 @@ export function hashCkb(...data) {
|
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
70
74
|
* Computes the Type ID hash of the given data.
|
|
75
|
+
* @public
|
|
71
76
|
*
|
|
72
|
-
* @param
|
|
77
|
+
* @param cellInputLike - The first cell input of the transaction.
|
|
73
78
|
* @param outputIndex - The output index of the Type ID cell.
|
|
74
79
|
* @returns The hexadecimal string representation of the hash.
|
|
75
80
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasherKeecak256.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherKeecak256.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,eAAgB,YAAW,MAAM;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAEnE;;OAEG;;IAMH;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe;IAKxC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd"}
|
|
1
|
+
{"version":3,"file":"hasherKeecak256.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherKeecak256.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,qBAAa,eAAgB,YAAW,MAAM;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAEnE;;OAEG;;IAMH;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe;IAKxC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd"}
|
package/dist/hex/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { BytesLike } from "../bytes/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Represents a hexadecimal string prefixed with "0x".
|
|
4
|
+
* @public
|
|
4
5
|
*/
|
|
5
6
|
export type Hex = `0x${string}`;
|
|
6
7
|
/**
|
|
7
8
|
* Represents a value that can be converted to a hexadecimal string.
|
|
8
9
|
* It extends the BytesLike type.
|
|
10
|
+
* @public
|
|
9
11
|
*/
|
|
10
12
|
export type HexLike = BytesLike;
|
|
11
13
|
/**
|
|
12
14
|
* Converts a HexLike value to a Hex string.
|
|
15
|
+
* @public
|
|
13
16
|
*
|
|
14
17
|
* @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
|
|
15
18
|
* @returns A Hex string representing the value.
|
package/dist/hex/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAEzC"}
|
package/dist/hex/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { bytesFrom, bytesTo } from "../bytes/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Converts a HexLike value to a Hex string.
|
|
4
|
+
* @public
|
|
4
5
|
*
|
|
5
6
|
* @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
|
|
6
7
|
* @returns A Hex string representing the value.
|
package/dist/keystore/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Bytes, BytesLike } from "../bytes/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
2
5
|
export declare function keystoreEncrypt(privateKeyLike: BytesLike, chainCodeLike: BytesLike, password: string): Promise<{
|
|
3
6
|
id: string;
|
|
4
7
|
crypto: {
|
|
@@ -18,6 +21,9 @@ export declare function keystoreEncrypt(privateKeyLike: BytesLike, chainCodeLike
|
|
|
18
21
|
mac: string;
|
|
19
22
|
};
|
|
20
23
|
}>;
|
|
24
|
+
/**
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
21
27
|
export declare function keystoreDecrypt(keystore: unknown, password: string): Promise<{
|
|
22
28
|
privateKey: Bytes;
|
|
23
29
|
chainCode: Bytes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keystore/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAgB7E,wBAAsB,eAAe,CACnC,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;SACZ,CAAC;QACF,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE;YACT,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC,CAqCD;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,UAAU,EAAE,KAAK,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC;CAClB,CAAC,CAoED"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keystore/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAgB7E;;GAEG;AACH,wBAAsB,eAAe,CACnC,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;SACZ,CAAC;QACF,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE;YACT,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,CAAC,EAAE,MAAM,CAAC;YACV,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC,CAqCD;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,UAAU,EAAE,KAAK,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC;CAClB,CAAC,CAoED"}
|
package/dist/keystore/index.js
CHANGED
|
@@ -13,6 +13,9 @@ const DEFAULT_SCRYPT_PARAM_N = 262144;
|
|
|
13
13
|
function mac(derivedKey, cipherText) {
|
|
14
14
|
return hexFrom(keccak_256(bytesConcat(derivedKey.slice(16, 32), cipherText))).slice(2);
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
16
19
|
export async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
|
|
17
20
|
const salt = randomBytes(32);
|
|
18
21
|
const iv = randomBytes(16);
|
|
@@ -45,6 +48,9 @@ export async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
|
|
|
45
48
|
},
|
|
46
49
|
};
|
|
47
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
48
54
|
export async function keystoreDecrypt(keystore, password) {
|
|
49
55
|
if (typeof keystore !== "object" ||
|
|
50
56
|
keystore === null ||
|
package/dist/num/index.d.ts
CHANGED
|
@@ -2,15 +2,18 @@ import { Bytes, BytesLike } from "../bytes/index.js";
|
|
|
2
2
|
import { Hex, HexLike } from "../hex/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Represents a numeric value as a bigint.
|
|
5
|
+
* @public
|
|
5
6
|
*/
|
|
6
7
|
export type Num = bigint;
|
|
7
8
|
/**
|
|
8
9
|
* Represents a value that can be converted to a numeric value.
|
|
9
10
|
* It can be a string, number, bigint, or HexLike.
|
|
11
|
+
* @public
|
|
10
12
|
*/
|
|
11
13
|
export type NumLike = string | number | bigint | HexLike;
|
|
12
14
|
/**
|
|
13
15
|
* Get the max among all numbers.
|
|
16
|
+
* @public
|
|
14
17
|
*
|
|
15
18
|
* @param numbers - numbers.
|
|
16
19
|
* @returns The max numbers among them.
|
|
@@ -23,6 +26,7 @@ export type NumLike = string | number | bigint | HexLike;
|
|
|
23
26
|
export declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
|
|
24
27
|
/**
|
|
25
28
|
* Converts a NumLike value to a Num (bigint).
|
|
29
|
+
* @public
|
|
26
30
|
*
|
|
27
31
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
28
32
|
* @returns A Num (bigint) representing the value.
|
|
@@ -36,6 +40,7 @@ export declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
|
|
|
36
40
|
export declare function numFrom(val: NumLike): Num;
|
|
37
41
|
/**
|
|
38
42
|
* Converts a NumLike value to a hexadecimal string.
|
|
43
|
+
* @public
|
|
39
44
|
*
|
|
40
45
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
41
46
|
* @returns A Hex string representing the numeric value.
|
|
@@ -48,6 +53,7 @@ export declare function numFrom(val: NumLike): Num;
|
|
|
48
53
|
export declare function numToHex(val: NumLike): Hex;
|
|
49
54
|
/**
|
|
50
55
|
* Converts a NumLike value to a byte array in little-endian order.
|
|
56
|
+
* @public
|
|
51
57
|
*
|
|
52
58
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
53
59
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -61,6 +67,7 @@ export declare function numToHex(val: NumLike): Hex;
|
|
|
61
67
|
export declare function numToBytes(val: NumLike, bytes?: number): Bytes;
|
|
62
68
|
/**
|
|
63
69
|
* Converts a NumLike value to a byte array in little-endian order.
|
|
70
|
+
* @public
|
|
64
71
|
*
|
|
65
72
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
66
73
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -74,6 +81,7 @@ export declare function numToBytes(val: NumLike, bytes?: number): Bytes;
|
|
|
74
81
|
export declare function numLeToBytes(val: NumLike, bytes?: number): Bytes;
|
|
75
82
|
/**
|
|
76
83
|
* Converts a NumLike value to a byte array in big-endian order.
|
|
84
|
+
* @public
|
|
77
85
|
*
|
|
78
86
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
79
87
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -87,6 +95,7 @@ export declare function numLeToBytes(val: NumLike, bytes?: number): Bytes;
|
|
|
87
95
|
export declare function numBeToBytes(val: NumLike, bytes?: number): Bytes;
|
|
88
96
|
/**
|
|
89
97
|
* Converts a byte array to a Num (bigint) assuming little-endian order.
|
|
98
|
+
* @public
|
|
90
99
|
*
|
|
91
100
|
* @param val - The byte array to convert.
|
|
92
101
|
* @returns A Num (bigint) representing the numeric value.
|
|
@@ -99,6 +108,7 @@ export declare function numBeToBytes(val: NumLike, bytes?: number): Bytes;
|
|
|
99
108
|
export declare function numFromBytes(val: BytesLike): Num;
|
|
100
109
|
/**
|
|
101
110
|
* Converts a byte array to a Num (bigint) assuming little-endian order.
|
|
111
|
+
* @public
|
|
102
112
|
*
|
|
103
113
|
* @param val - The byte array to convert.
|
|
104
114
|
* @returns A Num (bigint) representing the numeric value.
|
|
@@ -111,6 +121,7 @@ export declare function numFromBytes(val: BytesLike): Num;
|
|
|
111
121
|
export declare function numLeFromBytes(val: BytesLike): Num;
|
|
112
122
|
/**
|
|
113
123
|
* Converts a byte array to a Num (bigint) assuming big-endian order.
|
|
124
|
+
* @public
|
|
114
125
|
*
|
|
115
126
|
* @param val - The byte array to convert.
|
|
116
127
|
* @returns A Num (bigint) representing the numeric value.
|
package/dist/num/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/num/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/num/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AAExD;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,GAAG,CAS7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAUzC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAE1C;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAEhE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAUhE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAEhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAElD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAElD"}
|
package/dist/num/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { bytesConcat, bytesFrom } from "../bytes/index.js";
|
|
|
2
2
|
import { hexFrom } from "../hex/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Get the max among all numbers.
|
|
5
|
+
* @public
|
|
5
6
|
*
|
|
6
7
|
* @param numbers - numbers.
|
|
7
8
|
* @returns The max numbers among them.
|
|
@@ -23,6 +24,7 @@ export function numMax(a, ...numbers) {
|
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Converts a NumLike value to a Num (bigint).
|
|
27
|
+
* @public
|
|
26
28
|
*
|
|
27
29
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
28
30
|
* @returns A Num (bigint) representing the value.
|
|
@@ -44,6 +46,7 @@ export function numFrom(val) {
|
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Converts a NumLike value to a hexadecimal string.
|
|
49
|
+
* @public
|
|
47
50
|
*
|
|
48
51
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
49
52
|
* @returns A Hex string representing the numeric value.
|
|
@@ -58,6 +61,7 @@ export function numToHex(val) {
|
|
|
58
61
|
}
|
|
59
62
|
/**
|
|
60
63
|
* Converts a NumLike value to a byte array in little-endian order.
|
|
64
|
+
* @public
|
|
61
65
|
*
|
|
62
66
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
63
67
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -73,6 +77,7 @@ export function numToBytes(val, bytes) {
|
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
79
|
* Converts a NumLike value to a byte array in little-endian order.
|
|
80
|
+
* @public
|
|
76
81
|
*
|
|
77
82
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
78
83
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -88,6 +93,7 @@ export function numLeToBytes(val, bytes) {
|
|
|
88
93
|
}
|
|
89
94
|
/**
|
|
90
95
|
* Converts a NumLike value to a byte array in big-endian order.
|
|
96
|
+
* @public
|
|
91
97
|
*
|
|
92
98
|
* @param val - The value to convert, which can be a string, number, bigint, or HexLike.
|
|
93
99
|
* @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
|
|
@@ -107,6 +113,7 @@ export function numBeToBytes(val, bytes) {
|
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* Converts a byte array to a Num (bigint) assuming little-endian order.
|
|
116
|
+
* @public
|
|
110
117
|
*
|
|
111
118
|
* @param val - The byte array to convert.
|
|
112
119
|
* @returns A Num (bigint) representing the numeric value.
|
|
@@ -121,6 +128,7 @@ export function numFromBytes(val) {
|
|
|
121
128
|
}
|
|
122
129
|
/**
|
|
123
130
|
* Converts a byte array to a Num (bigint) assuming little-endian order.
|
|
131
|
+
* @public
|
|
124
132
|
*
|
|
125
133
|
* @param val - The byte array to convert.
|
|
126
134
|
* @returns A Num (bigint) representing the numeric value.
|
|
@@ -135,6 +143,7 @@ export function numLeFromBytes(val) {
|
|
|
135
143
|
}
|
|
136
144
|
/**
|
|
137
145
|
* Converts a byte array to a Num (bigint) assuming big-endian order.
|
|
146
|
+
* @public
|
|
138
147
|
*
|
|
139
148
|
* @param val - The byte array to convert.
|
|
140
149
|
* @returns A Num (bigint) representing the numeric value.
|
package/dist/package.json
CHANGED
|
@@ -6,6 +6,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
6
6
|
* An abstract class extending the Signer class for Bitcoin-like signing operations.
|
|
7
7
|
* This class provides methods to get Bitcoin account, public key, and internal address,
|
|
8
8
|
* as well as signing transactions.
|
|
9
|
+
* @public
|
|
9
10
|
*/
|
|
10
11
|
export declare abstract class SignerBtc extends Signer {
|
|
11
12
|
get type(): SignerType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerBtc.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"signerBtc.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;;GAKG;AACH,8BAAsB,SAAU,SAAQ,MAAM;IAC5C,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED;;;;OAIG;IACH,QAAQ,CAAC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAEzC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAE5C;;;;OAIG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAIpC;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAa1C;;;;;OAKG;IACG,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAQvE;;;;;OAKG;IACG,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CA+BzE"}
|
|
@@ -11,6 +11,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
11
11
|
* An abstract class extending the Signer class for Bitcoin-like signing operations.
|
|
12
12
|
* This class provides methods to get Bitcoin account, public key, and internal address,
|
|
13
13
|
* as well as signing transactions.
|
|
14
|
+
* @public
|
|
14
15
|
*/
|
|
15
16
|
export class SignerBtc extends Signer {
|
|
16
17
|
get type() {
|
|
@@ -4,6 +4,7 @@ import { SignerBtc } from "./signerBtc.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* A class extending SignerBtc that provides read-only access to a Bitcoin public key and account.
|
|
6
6
|
* This class does not support signing operations.
|
|
7
|
+
* @public
|
|
7
8
|
*/
|
|
8
9
|
export declare class SignerBtcPublicKeyReadonly extends SignerBtc {
|
|
9
10
|
private readonly account;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerBtcPublicKeyReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtcPublicKeyReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"signerBtcPublicKeyReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtcPublicKeyReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;IAYrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAM;IAEhC;;;;;;OAMG;gBAED,MAAM,EAAE,MAAM,EACG,OAAO,EAAE,MAAM,EAChC,SAAS,EAAE,OAAO;IAOpB;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;CAGtC"}
|
|
@@ -3,6 +3,7 @@ import { SignerBtc } from "./signerBtc.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* A class extending SignerBtc that provides read-only access to a Bitcoin public key and account.
|
|
5
5
|
* This class does not support signing operations.
|
|
6
|
+
* @public
|
|
6
7
|
*/
|
|
7
8
|
export class SignerBtcPublicKeyReadonly extends SignerBtc {
|
|
8
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAG5D,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAOT"}
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAG5D;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAOT"}
|
|
@@ -2,6 +2,9 @@ import { secp256k1 } from "@noble/curves/secp256k1";
|
|
|
2
2
|
import { magicHash } from "bitcoinjs-message";
|
|
3
3
|
import { bytesFrom } from "../../bytes/index.js";
|
|
4
4
|
import { hexFrom } from "../../hex/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
5
8
|
export function verifyMessageBtcEcdsa(message, signature, publicKey) {
|
|
6
9
|
const challenge = typeof message === "string" ? message : hexFrom(message).slice(2);
|
|
7
10
|
const [_, ...rawSign] = bytesFrom(signature, "base64");
|
|
@@ -3,6 +3,9 @@ import { Transaction, TransactionLike } from "../../ckb/index.js";
|
|
|
3
3
|
import { Client } from "../../client/index.js";
|
|
4
4
|
import { Hex, HexLike } from "../../hex/index.js";
|
|
5
5
|
import { SignerCkbPublicKey } from "./signerCkbPublicKey.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export declare class SignerCkbPrivateKey extends SignerCkbPublicKey {
|
|
7
10
|
readonly privateKey: Hex;
|
|
8
11
|
constructor(client: Client, privateKey: HexLike);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerCkbPrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPrivateKey.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,SAAgB,UAAU,EAAE,GAAG,CAAC;gBAEpB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;IAUzC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAezE"}
|
|
1
|
+
{"version":3,"file":"signerCkbPrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPrivateKey.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,SAAgB,UAAU,EAAE,GAAG,CAAC;gBAEpB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;IAUzC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAezE"}
|
|
@@ -5,6 +5,9 @@ import { hexFrom } from "../../hex/index.js";
|
|
|
5
5
|
import { numBeToBytes } from "../../num/index.js";
|
|
6
6
|
import { SignerCkbPublicKey } from "./signerCkbPublicKey.js";
|
|
7
7
|
import { messageHashCkbSecp256k1 } from "./verifyCkbSecp256k1.js";
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
8
11
|
export class SignerCkbPrivateKey extends SignerCkbPublicKey {
|
|
9
12
|
constructor(client, privateKey) {
|
|
10
13
|
const pk = hexFrom(privateKey);
|
|
@@ -3,6 +3,9 @@ import { Transaction, TransactionLike } from "../../ckb/index.js";
|
|
|
3
3
|
import { Client } from "../../client/index.js";
|
|
4
4
|
import { Hex, HexLike } from "../../hex/index.js";
|
|
5
5
|
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
6
9
|
export declare class SignerCkbPublicKey extends Signer {
|
|
7
10
|
get type(): SignerType;
|
|
8
11
|
get signType(): SignerSignType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerCkbPublicKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAe,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,SAAgB,SAAS,EAAE,GAAG,CAAC;gBAEnB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;IASxC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAExB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAUpC,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAUxE"}
|
|
1
|
+
{"version":3,"file":"signerCkbPublicKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAe,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,SAAgB,SAAS,EAAE,GAAG,CAAC;gBAEnB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO;IASxC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAExB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIrC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAUpC,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAUxE"}
|
|
@@ -5,6 +5,9 @@ import { KnownScript } from "../../client/index.js";
|
|
|
5
5
|
import { hashCkb } from "../../hasher/index.js";
|
|
6
6
|
import { hexFrom } from "../../hex/index.js";
|
|
7
7
|
import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
8
11
|
export class SignerCkbPublicKey extends Signer {
|
|
9
12
|
get type() {
|
|
10
13
|
return SignerType.CKB;
|
|
@@ -5,6 +5,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* A class extending Signer that provides read-only access to a CKB script.
|
|
7
7
|
* This class does not support signing operations.
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
10
|
export declare class SignerCkbScriptReadonly extends Signer {
|
|
10
11
|
get type(): SignerType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signerCkbScriptReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbScriptReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"signerCkbScriptReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbScriptReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,MAAM;IACjD,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAM9C;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;;;;;;OASG;IAEG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAG3C"}
|
|
@@ -4,6 +4,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* A class extending Signer that provides read-only access to a CKB script.
|
|
6
6
|
* This class does not support signing operations.
|
|
7
|
+
* @public
|
|
7
8
|
*/
|
|
8
9
|
export class SignerCkbScriptReadonly extends Signer {
|
|
9
10
|
get type() {
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { BytesLike } from "../../bytes/index.js";
|
|
2
2
|
import { Hex } from "../../hex/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
3
6
|
export declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
4
10
|
export declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
|
|
5
11
|
//# sourceMappingURL=verifyCkbSecp256k1.d.ts.map
|