@ckb-ccc/core 0.0.11-alpha.3 → 0.0.12-alpha.1
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/dist/address/index.d.ts.map +1 -1
- package/dist/ckb/script.d.ts +1 -5
- package/dist/ckb/script.d.ts.map +1 -1
- package/dist/ckb/transaction.d.ts +21 -39
- package/dist/ckb/transaction.d.ts.map +1 -1
- package/dist/ckb/transaction.js +28 -3
- package/dist/client/client.advanced.d.ts.map +1 -1
- package/dist/client/client.d.ts +1 -0
- package/dist/client/client.d.ts.map +1 -1
- package/dist/client/client.js +1 -0
- package/dist/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicMainnet.advanced.js +29 -0
- package/dist/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist/client/clientPublicTestnet.advanced.js +29 -0
- package/dist/client/jsonRpc/index.d.ts.map +1 -1
- package/dist/fixedPoint/index.d.ts +2 -2
- package/dist/fixedPoint/index.d.ts.map +1 -1
- package/dist/hasher/hasher.d.ts +32 -0
- package/dist/hasher/hasher.d.ts.map +1 -0
- package/dist/hasher/hasher.js +1 -0
- package/dist/hasher/hasherCkb.d.ts +68 -0
- package/dist/hasher/hasherCkb.d.ts.map +1 -0
- package/dist/hasher/hasherCkb.js +83 -0
- package/dist/hasher/hasherKeecak256.d.ts +38 -0
- package/dist/hasher/hasherKeecak256.d.ts.map +1 -0
- package/dist/hasher/hasherKeecak256.js +43 -0
- package/dist/hasher/index.d.ts +3 -66
- package/dist/hasher/index.d.ts.map +1 -1
- package/dist/hasher/index.js +3 -79
- package/dist/keystore/index.d.ts +2 -2
- package/dist/keystore/index.d.ts.map +1 -1
- package/dist/signer/evm/signerEvm.d.ts +13 -4
- package/dist/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist/signer/evm/signerEvm.js +63 -11
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist.commonjs/address/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/script.d.ts +1 -5
- package/dist.commonjs/ckb/script.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.d.ts +21 -39
- package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
- package/dist.commonjs/ckb/transaction.js +27 -2
- package/dist.commonjs/client/client.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/client.d.ts +1 -0
- package/dist.commonjs/client/client.d.ts.map +1 -1
- package/dist.commonjs/client/client.js +1 -0
- package/dist.commonjs/client/clientPublicMainnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +29 -0
- package/dist.commonjs/client/clientPublicTestnet.advanced.d.ts.map +1 -1
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +29 -0
- package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -1
- package/dist.commonjs/fixedPoint/index.d.ts +2 -2
- package/dist.commonjs/fixedPoint/index.d.ts.map +1 -1
- package/dist.commonjs/hasher/hasher.d.ts +32 -0
- package/dist.commonjs/hasher/hasher.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasher.js +2 -0
- package/dist.commonjs/hasher/hasherCkb.d.ts +68 -0
- package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasherCkb.js +89 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts +38 -0
- package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -0
- package/dist.commonjs/hasher/hasherKeecak256.js +47 -0
- package/dist.commonjs/hasher/index.d.ts +3 -66
- package/dist.commonjs/hasher/index.d.ts.map +1 -1
- package/dist.commonjs/hasher/index.js +16 -85
- package/dist.commonjs/keystore/index.d.ts +2 -2
- package/dist.commonjs/keystore/index.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvm.d.ts +13 -4
- package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -1
- package/dist.commonjs/signer/evm/signerEvm.js +72 -20
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/utils/index.d.ts +1 -1
- package/dist.commonjs/utils/index.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/address/index.ts +1 -1
- package/src/ckb/script.ts +1 -1
- package/src/ckb/transaction.ts +43 -9
- package/src/client/client.advanced.ts +1 -1
- package/src/client/client.ts +1 -0
- package/src/client/clientPublicMainnet.advanced.ts +33 -0
- package/src/client/clientPublicTestnet.advanced.ts +33 -0
- package/src/client/jsonRpc/index.ts +3 -3
- package/src/fixedPoint/index.ts +2 -2
- package/src/hasher/hasher.ts +35 -0
- package/src/hasher/hasherCkb.ts +102 -0
- package/src/hasher/hasherKeecak256.ts +52 -0
- package/src/hasher/index.ts +3 -103
- package/src/keystore/index.ts +19 -1
- package/src/signer/evm/signerEvm.ts +131 -24
- package/src/signer/signer/index.ts +1 -1
- package/src/utils/index.ts +2 -2
|
@@ -862,10 +862,9 @@ class Transaction {
|
|
|
862
862
|
* }
|
|
863
863
|
* ```
|
|
864
864
|
*/
|
|
865
|
-
async getSignHashInfo(scriptLike, client) {
|
|
865
|
+
async getSignHashInfo(scriptLike, client, hasher = new index_js_3.HasherCkb()) {
|
|
866
866
|
const script = script_js_1.Script.from(scriptLike);
|
|
867
867
|
let position = -1;
|
|
868
|
-
const hasher = new index_js_3.Hasher();
|
|
869
868
|
hasher.update(this.hash());
|
|
870
869
|
for (let i = 0; i < this.witnesses.length; i += 1) {
|
|
871
870
|
const input = this.inputs[i];
|
|
@@ -894,6 +893,32 @@ class Transaction {
|
|
|
894
893
|
position,
|
|
895
894
|
};
|
|
896
895
|
}
|
|
896
|
+
/**
|
|
897
|
+
* Find the first occurrence of a input with the specified lock id
|
|
898
|
+
*
|
|
899
|
+
* @param scriptIdLike - The script associated with the transaction, represented as a ScriptLike object without args.
|
|
900
|
+
* @param client - The client for complete extra infos in the transaction.
|
|
901
|
+
* @returns A promise that resolves to the found index
|
|
902
|
+
*
|
|
903
|
+
* @example
|
|
904
|
+
* ```typescript
|
|
905
|
+
* const index = await tx.findInputIndexByLockId(scriptIdLike, client);
|
|
906
|
+
* ```
|
|
907
|
+
*/
|
|
908
|
+
async findInputIndexByLockId(scriptLike, client) {
|
|
909
|
+
const script = script_js_1.Script.from({ ...scriptLike, args: "0x" });
|
|
910
|
+
for (let i = 0; i < this.inputs.length; i += 1) {
|
|
911
|
+
const input = this.inputs[i];
|
|
912
|
+
await input.completeExtraInfos(client);
|
|
913
|
+
if (!input.cellOutput) {
|
|
914
|
+
throw new Error("Unable to complete input");
|
|
915
|
+
}
|
|
916
|
+
if (script.codeHash === input.cellOutput.lock.codeHash &&
|
|
917
|
+
script.hashType === input.cellOutput.lock.hashType) {
|
|
918
|
+
return i;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
897
922
|
/**
|
|
898
923
|
* Find the first occurrence of a input with the specified lock
|
|
899
924
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.advanced.d.ts","sourceRoot":"","sources":["../../src/client/client.advanced.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAU,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,8BAA8B,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,UAAU,CACxB,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,GAAG,SAAS,EAC/B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GACzC,OAAO,CAgBT;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,UAAU,GAAG,SAAS,EACjC,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GACzC,OAAO,CAkBT;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"client.advanced.d.ts","sourceRoot":"","sources":["../../src/client/client.advanced.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,QAAQ,EAAU,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AACnD,OAAO,EACL,8BAA8B,EAE/B,MAAM,2BAA2B,CAAC;AAGnC,wBAAgB,UAAU,CACxB,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,OAAO,GAAG,SAAS,EAC/B,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GACzC,OAAO,CAgBT;AAED,wBAAgB,YAAY,CAC1B,SAAS,EAAE,UAAU,GAAG,SAAS,EACjC,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,UAAU,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GACzC,OAAO,CAkBT;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,SAAS,GACpC,OAAO,CAQT;AAED,wBAAgB,sBAAsB,CACpC,SAAS,CAAC,EAAE,UAAU,EACtB,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,GAClC,OAAO,CAYT;AAED,wBAAgB,UAAU,CACxB,aAAa,EAAE,8BAA8B,EAC7C,QAAQ,EAAE,QAAQ,GACjB,OAAO,CA4CT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,OAAO,EACP,WAAW,EACX,QAAQ,EAER,YAA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,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAC3D;IAsBD,QAAQ,CAAC,gBAAgB,CAAC,GAAG,EAAE,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC;IAElE,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAYhD,UAAU,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAQ7C,eAAe,CACnB,WAAW,EAAE,eAAe,EAC5B,SAAS,CAAC,EAAE,gBAAgB,GAC3B,OAAO,CAAC,GAAG,CAAC;IAwBT,cAAc,CAClB,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;CAiBlD"}
|
|
@@ -17,6 +17,7 @@ var KnownScript;
|
|
|
17
17
|
KnownScript["XUdt"] = "XUdt";
|
|
18
18
|
KnownScript["JoyId"] = "JoyId";
|
|
19
19
|
KnownScript["COTA"] = "COTA";
|
|
20
|
+
KnownScript["PWLock"] = "PWLock";
|
|
20
21
|
KnownScript["OmniLock"] = "OmniLock";
|
|
21
22
|
KnownScript["NostrLock"] = "NostrLock";
|
|
22
23
|
KnownScript["UniqueType"] = "UniqueType";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPublicMainnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicMainnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,WAAW,EACT,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC,GACzE,SAAS,
|
|
1
|
+
{"version":3,"file":"clientPublicMainnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicMainnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,WAAW,EACT,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC,GACzE,SAAS,CA0PX,CAAC"}
|
|
@@ -98,6 +98,35 @@ exports.MAINNET_SCRIPTS = Object.freeze({
|
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
100
|
},
|
|
101
|
+
[client_js_1.KnownScript.PWLock]: {
|
|
102
|
+
codeHash: "0xbf43c3602455798c1a61a596e0d95278864c552fafe231c063b3fabf97a8febc",
|
|
103
|
+
hashType: "type",
|
|
104
|
+
cellDeps: [
|
|
105
|
+
{
|
|
106
|
+
cellDep: {
|
|
107
|
+
outPoint: {
|
|
108
|
+
txHash: "0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c",
|
|
109
|
+
index: 0,
|
|
110
|
+
},
|
|
111
|
+
depType: "depGroup",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
cellDep: {
|
|
116
|
+
outPoint: {
|
|
117
|
+
txHash: "0x1d60cb8f4666e039f418ea94730b1a8c5aa0bf2f7781474406387462924d15d4",
|
|
118
|
+
index: 0,
|
|
119
|
+
},
|
|
120
|
+
depType: "code",
|
|
121
|
+
},
|
|
122
|
+
type: {
|
|
123
|
+
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
124
|
+
hashType: "type",
|
|
125
|
+
args: "0x42ade2f25eb938b5dbfd3d8f07b8b07aa593d848e7ff14bdfbbea5aeb6175261",
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
101
130
|
[client_js_1.KnownScript.OmniLock]: {
|
|
102
131
|
codeHash: "0x9b819793a64463aed77c615d6cb226eea5487ccfc0783043a587254cda2b6f26",
|
|
103
132
|
hashType: "type",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clientPublicTestnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,WAAW,EACX,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"clientPublicTestnet.advanced.d.ts","sourceRoot":"","sources":["../../src/client/clientPublicTestnet.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,WAAW,EACX,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,eAAe,EAAE,CAAA;CAAE,CAsQvE,CAAC"}
|
|
@@ -103,6 +103,35 @@ exports.TESTNET_SCRIPTS = Object.freeze({
|
|
|
103
103
|
},
|
|
104
104
|
],
|
|
105
105
|
},
|
|
106
|
+
[client_js_1.KnownScript.PWLock]: {
|
|
107
|
+
codeHash: "0x58c5f491aba6d61678b7cf7edf4910b1f5e00ec0cde2f42e0abb4fd9aff25a63",
|
|
108
|
+
hashType: "type",
|
|
109
|
+
cellDeps: [
|
|
110
|
+
{
|
|
111
|
+
cellDep: {
|
|
112
|
+
outPoint: {
|
|
113
|
+
txHash: "0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37",
|
|
114
|
+
index: 0,
|
|
115
|
+
},
|
|
116
|
+
depType: "depGroup",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
cellDep: {
|
|
121
|
+
outPoint: {
|
|
122
|
+
txHash: "0x57a62003daeab9d54aa29b944fc3b451213a5ebdf2e232216a3cfed0dde61b38",
|
|
123
|
+
index: 0,
|
|
124
|
+
},
|
|
125
|
+
depType: "code",
|
|
126
|
+
},
|
|
127
|
+
type: {
|
|
128
|
+
codeHash: "0x00000000000000000000000000000000000000000000000000545950455f4944",
|
|
129
|
+
hashType: "type",
|
|
130
|
+
args: "0xf6d90bfe3041d0fd7e01c45770241697f5f837974bd6ae1672a7ec0f9f523268",
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
106
135
|
[client_js_1.KnownScript.OmniLock]: {
|
|
107
136
|
codeHash: "0xf329effd1c475a2978453c8600e1eaf0bc2087ee093c3ee64cc96ec6847752cb",
|
|
108
137
|
hashType: "type",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/jsonRpc/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AA0BpE;;;GAGG;AAEH,8BAAsB,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OAKG;IAEH,qBAAqB,WAIP,OAAO,KAAK,QAAQ,yBAAyB,GAAG,SAAS,CAAC,CAAC;IAEzE;;;;;;;;OAQG;IAEH,qBAAqB,QASd,0BAA0B,UACvB,KAAK,GAAG,MAAM,UACd,OAAO,UACP,MAAM,KACX,QAAQ,uBAAuB,CAAC,CAAC;IAEtC;;;;;;;;OAQG;IAEH,qBAAqB;;;;;;;;MAQgB;IAErC;;;;;OAKG;IAEH,gBAAgB,QAIL,0BAA0B,KAAK,QAAQ,GAAG,CAAC,CAAC;IAEvD;;;;;;;OAOG;IAEH,WAAW,CACT,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC,EAAE,EACrD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,OAAO,GACnC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC;IAmB1C;;;;;;;OAOG;IAEG,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IA4BrD;;;;;;OAMG;IAEH,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,cAAc;CAQpE"}
|
|
@@ -40,10 +40,10 @@ export declare function fixedPointFrom(val: FixedPointLike, decimals?: number):
|
|
|
40
40
|
/**
|
|
41
41
|
* Represents the fixed point value of zero as a bigint.
|
|
42
42
|
*/
|
|
43
|
-
export declare const Zero
|
|
43
|
+
export declare const Zero: FixedPoint;
|
|
44
44
|
/**
|
|
45
45
|
* Represents the fixed point value of one as a FixedPoint (bigint).
|
|
46
46
|
* Equivalent to 1 in fixed-point representation with default decimals (8).
|
|
47
47
|
*/
|
|
48
|
-
export declare const One:
|
|
48
|
+
export declare const One: FixedPoint;
|
|
49
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAa5E;AAED;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAc5E;AAED;;GAEG;AAEH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAa5E;AAED;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAc5E;AAED;;GAEG;AAEH,eAAO,MAAM,IAAI,EAAE,UAAe,CAAC;AAEnC;;;GAGG;AAEH,eAAO,MAAM,GAAG,EAAE,UAAgC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BytesLike } from "../bytes/index.js";
|
|
2
|
+
import { Hex } from "../hex/index.js";
|
|
3
|
+
export interface Hasher {
|
|
4
|
+
/**
|
|
5
|
+
* Updates the hash with the given data.
|
|
6
|
+
*
|
|
7
|
+
* @param data - The data to update the hash with.
|
|
8
|
+
* @returns The current Hasher instance for chaining.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const hasher = new Hasher();
|
|
13
|
+
* hasher.update("some data").update("more data");
|
|
14
|
+
* const hash = hasher.digest();
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
update(data: BytesLike): Hasher;
|
|
18
|
+
/**
|
|
19
|
+
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
20
|
+
*
|
|
21
|
+
* @returns The hexadecimal string representation of the hash.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const hasher = new Hasher();
|
|
26
|
+
* hasher.update("some data");
|
|
27
|
+
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
digest(): Hex;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=hasher.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BytesLike } from "../bytes/index.js";
|
|
2
|
+
import { CellInputLike } from "../ckb/index.js";
|
|
3
|
+
import { Hex } from "../hex/index.js";
|
|
4
|
+
import { NumLike } from "../num/index.js";
|
|
5
|
+
import { Hasher } from "./hasher.js";
|
|
6
|
+
export declare class HasherCkb implements Hasher {
|
|
7
|
+
private readonly hasher;
|
|
8
|
+
/**
|
|
9
|
+
* Creates an instance of Hasher.
|
|
10
|
+
*
|
|
11
|
+
* @param outLength - The output length of the hash in bytes. Default is 32.
|
|
12
|
+
* @param personal - The personal string for the Blake2b algorithm. Default is CKB_BLAKE2B_PERSONAL.
|
|
13
|
+
*/
|
|
14
|
+
constructor(outLength?: number, personal?: string);
|
|
15
|
+
/**
|
|
16
|
+
* Updates the hash with the given data.
|
|
17
|
+
*
|
|
18
|
+
* @param data - The data to update the hash with.
|
|
19
|
+
* @returns The current Hasher instance for chaining.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const hasher = new Hasher();
|
|
24
|
+
* hasher.update("some data").update("more data");
|
|
25
|
+
* const hash = hasher.digest();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
update(data: BytesLike): HasherCkb;
|
|
29
|
+
/**
|
|
30
|
+
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
31
|
+
*
|
|
32
|
+
* @returns The hexadecimal string representation of the hash.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const hasher = new Hasher();
|
|
37
|
+
* hasher.update("some data");
|
|
38
|
+
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
digest(): Hex;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
45
|
+
*
|
|
46
|
+
* @param data - The data to hash.
|
|
47
|
+
* @returns The hexadecimal string representation of the hash.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* const hash = hashCkb("some data"); // Outputs something like "0x..."
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function hashCkb(...data: BytesLike[]): Hex;
|
|
55
|
+
/**
|
|
56
|
+
* Computes the Type ID hash of the given data.
|
|
57
|
+
*
|
|
58
|
+
* @param cellInput - The first cell input of the transaction.
|
|
59
|
+
* @param outputIndex - The output index of the Type ID cell.
|
|
60
|
+
* @returns The hexadecimal string representation of the hash.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const hash = hashTypeId(cellInput, outputIndex); // Outputs something like "0x..."
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export declare function hashTypeId(cellInputLike: CellInputLike, outputIndex: NumLike): Hex;
|
|
68
|
+
//# sourceMappingURL=hasherCkb.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;GAUG;AAEH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,CAIjD;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,UAAU,CACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,OAAO,GACnB,GAAG,CAKL"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashTypeId = exports.hashCkb = exports.HasherCkb = void 0;
|
|
4
|
+
const blake2b_1 = require("@noble/hashes/blake2b");
|
|
5
|
+
const index_js_1 = require("../bytes/index.js");
|
|
6
|
+
const index_js_2 = require("../ckb/index.js");
|
|
7
|
+
const index_js_3 = require("../hex/index.js");
|
|
8
|
+
const index_js_4 = require("../num/index.js");
|
|
9
|
+
const advanced_js_1 = require("./advanced.js");
|
|
10
|
+
class HasherCkb {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of Hasher.
|
|
13
|
+
*
|
|
14
|
+
* @param outLength - The output length of the hash in bytes. Default is 32.
|
|
15
|
+
* @param personal - The personal string for the Blake2b algorithm. Default is CKB_BLAKE2B_PERSONAL.
|
|
16
|
+
*/
|
|
17
|
+
constructor(outLength = 32, personal = advanced_js_1.CKB_BLAKE2B_PERSONAL) {
|
|
18
|
+
this.hasher = blake2b_1.blake2b.create({
|
|
19
|
+
personalization: personal,
|
|
20
|
+
dkLen: outLength,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Updates the hash with the given data.
|
|
25
|
+
*
|
|
26
|
+
* @param data - The data to update the hash with.
|
|
27
|
+
* @returns The current Hasher instance for chaining.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const hasher = new Hasher();
|
|
32
|
+
* hasher.update("some data").update("more data");
|
|
33
|
+
* const hash = hasher.digest();
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
update(data) {
|
|
37
|
+
this.hasher.update((0, index_js_1.bytesFrom)(data));
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
42
|
+
*
|
|
43
|
+
* @returns The hexadecimal string representation of the hash.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const hasher = new Hasher();
|
|
48
|
+
* hasher.update("some data");
|
|
49
|
+
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
digest() {
|
|
53
|
+
return (0, index_js_3.hexFrom)(this.hasher.digest());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.HasherCkb = HasherCkb;
|
|
57
|
+
/**
|
|
58
|
+
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
59
|
+
*
|
|
60
|
+
* @param data - The data to hash.
|
|
61
|
+
* @returns The hexadecimal string representation of the hash.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```typescript
|
|
65
|
+
* const hash = hashCkb("some data"); // Outputs something like "0x..."
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
function hashCkb(...data) {
|
|
69
|
+
const hasher = new HasherCkb();
|
|
70
|
+
data.forEach((d) => hasher.update(d));
|
|
71
|
+
return hasher.digest();
|
|
72
|
+
}
|
|
73
|
+
exports.hashCkb = hashCkb;
|
|
74
|
+
/**
|
|
75
|
+
* Computes the Type ID hash of the given data.
|
|
76
|
+
*
|
|
77
|
+
* @param cellInput - The first cell input of the transaction.
|
|
78
|
+
* @param outputIndex - The output index of the Type ID cell.
|
|
79
|
+
* @returns The hexadecimal string representation of the hash.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const hash = hashTypeId(cellInput, outputIndex); // Outputs something like "0x..."
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
function hashTypeId(cellInputLike, outputIndex) {
|
|
87
|
+
return hashCkb(index_js_2.CellInput.from(cellInputLike).toBytes(), (0, index_js_4.numLeToBytes)(outputIndex, 8));
|
|
88
|
+
}
|
|
89
|
+
exports.hashTypeId = hashTypeId;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BytesLike } from "../bytes/index.js";
|
|
2
|
+
import { Hex } from "../hex/index.js";
|
|
3
|
+
import { Hasher } from "./hasher.js";
|
|
4
|
+
export declare class HasherKeecak256 implements Hasher {
|
|
5
|
+
private readonly hasher;
|
|
6
|
+
/**
|
|
7
|
+
* Creates an instance of Hasher.
|
|
8
|
+
*/
|
|
9
|
+
constructor();
|
|
10
|
+
/**
|
|
11
|
+
* Updates the hash with the given data.
|
|
12
|
+
*
|
|
13
|
+
* @param data - The data to update the hash with.
|
|
14
|
+
* @returns The current Hasher instance for chaining.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const hasher = new Hasher();
|
|
19
|
+
* hasher.update("some data").update("more data");
|
|
20
|
+
* const hash = hasher.digest();
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
update(data: BytesLike): HasherKeecak256;
|
|
24
|
+
/**
|
|
25
|
+
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
26
|
+
*
|
|
27
|
+
* @returns The hexadecimal string representation of the hash.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const hasher = new Hasher();
|
|
32
|
+
* hasher.update("some data");
|
|
33
|
+
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
digest(): Hex;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=hasherKeecak256.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasherKeecak256 = void 0;
|
|
4
|
+
const sha3_1 = require("@noble/hashes/sha3");
|
|
5
|
+
const index_js_1 = require("../bytes/index.js");
|
|
6
|
+
const index_js_2 = require("../hex/index.js");
|
|
7
|
+
class HasherKeecak256 {
|
|
8
|
+
/**
|
|
9
|
+
* Creates an instance of Hasher.
|
|
10
|
+
*/
|
|
11
|
+
constructor() {
|
|
12
|
+
this.hasher = sha3_1.keccak_256.create();
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Updates the hash with the given data.
|
|
16
|
+
*
|
|
17
|
+
* @param data - The data to update the hash with.
|
|
18
|
+
* @returns The current Hasher instance for chaining.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const hasher = new Hasher();
|
|
23
|
+
* hasher.update("some data").update("more data");
|
|
24
|
+
* const hash = hasher.digest();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
update(data) {
|
|
28
|
+
this.hasher.update((0, index_js_1.bytesFrom)(data));
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
33
|
+
*
|
|
34
|
+
* @returns The hexadecimal string representation of the hash.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const hasher = new Hasher();
|
|
39
|
+
* hasher.update("some data");
|
|
40
|
+
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
digest() {
|
|
44
|
+
return (0, index_js_2.hexFrom)(this.hasher.digest());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.HasherKeecak256 = HasherKeecak256;
|
|
@@ -1,67 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { NumLike } from "../num/index.js";
|
|
5
|
-
export declare class Hasher {
|
|
6
|
-
private readonly hasher;
|
|
7
|
-
/**
|
|
8
|
-
* Creates an instance of Hasher.
|
|
9
|
-
*
|
|
10
|
-
* @param outLength - The output length of the hash in bytes. Default is 32.
|
|
11
|
-
* @param personal - The personal string for the Blake2b algorithm. Default is CKB_BLAKE2B_PERSONAL.
|
|
12
|
-
*/
|
|
13
|
-
constructor(outLength?: number, personal?: string);
|
|
14
|
-
/**
|
|
15
|
-
* Updates the hash with the given data.
|
|
16
|
-
*
|
|
17
|
-
* @param data - The data to update the hash with.
|
|
18
|
-
* @returns The current Hasher instance for chaining.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* const hasher = new Hasher();
|
|
23
|
-
* hasher.update("some data").update("more data");
|
|
24
|
-
* const hash = hasher.digest();
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
update(data: BytesLike): Hasher;
|
|
28
|
-
/**
|
|
29
|
-
* Finalizes the hash and returns the digest as a hexadecimal string.
|
|
30
|
-
*
|
|
31
|
-
* @returns The hexadecimal string representation of the hash.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* ```typescript
|
|
35
|
-
* const hasher = new Hasher();
|
|
36
|
-
* hasher.update("some data");
|
|
37
|
-
* const hash = hasher.digest(); // Outputs something like "0x..."
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
digest(): Hex;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
44
|
-
*
|
|
45
|
-
* @param data - The data to hash.
|
|
46
|
-
* @returns The hexadecimal string representation of the hash.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const hash = hashCkb("some data"); // Outputs something like "0x..."
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
export declare function hashCkb(...data: BytesLike[]): Hex;
|
|
54
|
-
/**
|
|
55
|
-
* Computes the Type ID hash of the given data.
|
|
56
|
-
*
|
|
57
|
-
* @param cellInput - The first cell input of the transaction.
|
|
58
|
-
* @param outputIndex - The output index of the Type ID cell.
|
|
59
|
-
* @returns The hexadecimal string representation of the hash.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* const hash = hashTypeId(cellInput, outputIndex); // Outputs something like "0x..."
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function hashTypeId(cellInputLike: CellInputLike, outputIndex: NumLike): Hex;
|
|
1
|
+
export * from "./hasher.js";
|
|
2
|
+
export * from "./hasherCkb.js";
|
|
3
|
+
export * from "./hasherKeecak256.js";
|
|
67
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hasher/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hasher/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
|