@ckb-ccc/core 0.1.0-alpha.6 → 0.1.0
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 +34 -0
- package/dist/barrel.d.ts +1 -0
- package/dist/barrel.d.ts.map +1 -1
- package/dist/barrel.js +1 -0
- package/dist/ckb/transactionLumos.d.ts +2 -1
- package/dist/ckb/transactionLumos.d.ts.map +1 -1
- package/dist/client/client.js +1 -1
- package/dist/molecule/codec.d.ts +118 -0
- package/dist/molecule/codec.d.ts.map +1 -0
- package/dist/molecule/codec.js +446 -0
- package/dist/molecule/index.d.ts +3 -0
- package/dist/molecule/index.d.ts.map +1 -0
- package/dist/molecule/index.js +2 -0
- package/dist/molecule/predefined.d.ts +52 -0
- package/dist/molecule/predefined.d.ts.map +1 -0
- package/dist/molecule/predefined.js +95 -0
- package/dist/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist/signer/btc/signerBtc.js +2 -3
- package/dist/signer/btc/verify.d.ts +14 -1
- package/dist/signer/btc/verify.d.ts.map +1 -1
- package/dist/signer/btc/verify.js +22 -1
- package/dist/signer/doge/index.d.ts +5 -0
- package/dist/signer/doge/index.d.ts.map +1 -0
- package/dist/signer/doge/index.js +4 -0
- package/dist/signer/doge/signerDoge.d.ts +52 -0
- package/dist/signer/doge/signerDoge.d.ts.map +1 -0
- package/dist/signer/doge/signerDoge.js +82 -0
- package/dist/signer/doge/signerDogeAddressReadonly.d.ts +41 -0
- package/dist/signer/doge/signerDogeAddressReadonly.d.ts.map +1 -0
- package/dist/signer/doge/signerDogeAddressReadonly.js +45 -0
- package/dist/signer/doge/signerDogePrivateKey.d.ts +52 -0
- package/dist/signer/doge/signerDogePrivateKey.d.ts.map +1 -0
- package/dist/signer/doge/signerDogePrivateKey.js +68 -0
- package/dist/signer/doge/verify.d.ts +6 -0
- package/dist/signer/doge/verify.d.ts.map +1 -0
- package/dist/signer/doge/verify.js +17 -0
- package/dist/signer/index.d.ts +1 -0
- package/dist/signer/index.d.ts.map +1 -1
- package/dist/signer/index.js +1 -0
- package/dist/signer/nostr/index.d.ts +1 -0
- package/dist/signer/nostr/index.d.ts.map +1 -1
- package/dist/signer/nostr/index.js +1 -0
- package/dist/signer/signer/index.d.ts +4 -2
- package/dist/signer/signer/index.d.ts.map +1 -1
- package/dist/signer/signer/index.js +5 -0
- package/dist.commonjs/address/address.advanced.js +23 -28
- package/dist.commonjs/address/advanced.js +1 -17
- package/dist.commonjs/address/index.js +11 -15
- package/dist.commonjs/advanced.js +2 -31
- package/dist.commonjs/advancedBarrel.js +5 -21
- package/dist.commonjs/barrel.d.ts +1 -0
- package/dist.commonjs/barrel.d.ts.map +1 -1
- package/dist.commonjs/barrel.js +12 -27
- package/dist.commonjs/bytes/advanced.js +1 -2
- package/dist.commonjs/bytes/index.js +7 -12
- package/dist.commonjs/ckb/advanced.js +3 -32
- package/dist.commonjs/ckb/index.js +3 -19
- package/dist.commonjs/ckb/molecule.advanced/generated.js +64 -131
- package/dist.commonjs/ckb/molecule.advanced/index.js +2 -19
- package/dist.commonjs/ckb/script.advanced.js +3 -6
- package/dist.commonjs/ckb/script.js +23 -53
- package/dist.commonjs/ckb/transaction.advanced.js +3 -6
- package/dist.commonjs/ckb/transaction.js +122 -163
- package/dist.commonjs/ckb/transactionLumos.d.ts +2 -1
- package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -1
- package/dist.commonjs/ckb/transactionLumos.js +1 -2
- package/dist.commonjs/client/advanced.js +6 -22
- package/dist.commonjs/client/cache/advanced.js +1 -17
- package/dist.commonjs/client/cache/cache.js +3 -7
- package/dist.commonjs/client/cache/index.js +2 -18
- package/dist.commonjs/client/cache/memory.advanced.js +21 -28
- package/dist.commonjs/client/cache/memory.js +19 -23
- package/dist.commonjs/client/client.js +22 -26
- package/dist.commonjs/client/clientPublicMainnet.advanced.js +22 -25
- package/dist.commonjs/client/clientPublicMainnet.js +8 -15
- package/dist.commonjs/client/clientPublicTestnet.advanced.js +22 -25
- package/dist.commonjs/client/clientPublicTestnet.js +8 -15
- package/dist.commonjs/client/clientTypes.advanced.js +3 -6
- package/dist.commonjs/client/clientTypes.js +29 -43
- package/dist.commonjs/client/index.js +6 -22
- package/dist.commonjs/client/jsonRpc/advanced.js +2 -18
- package/dist.commonjs/client/jsonRpc/index.js +37 -41
- package/dist.commonjs/client/jsonRpc/transformers.js +57 -61
- package/dist.commonjs/client/jsonRpc/types.js +1 -2
- package/dist.commonjs/client/transports/advanced.js +8 -25
- package/dist.commonjs/client/transports/http.js +1 -5
- package/dist.commonjs/client/transports/transport.js +1 -2
- package/dist.commonjs/client/transports/webSocket.js +3 -10
- package/dist.commonjs/fixedPoint/index.js +4 -9
- package/dist.commonjs/hasher/advanced.js +1 -4
- package/dist.commonjs/hasher/hasher.js +1 -2
- package/dist.commonjs/hasher/hasherCkb.js +14 -20
- package/dist.commonjs/hasher/hasherKeecak256.js +7 -11
- package/dist.commonjs/hasher/index.js +3 -19
- package/dist.commonjs/hex/index.js +3 -6
- package/dist.commonjs/index.js +2 -31
- package/dist.commonjs/keystore/index.js +21 -25
- package/dist.commonjs/molecule/codec.d.ts +118 -0
- package/dist.commonjs/molecule/codec.d.ts.map +1 -0
- package/dist.commonjs/molecule/codec.js +446 -0
- package/dist.commonjs/molecule/index.d.ts +3 -0
- package/dist.commonjs/molecule/index.d.ts.map +1 -0
- package/dist.commonjs/molecule/index.js +2 -0
- package/dist.commonjs/molecule/predefined.d.ts +52 -0
- package/dist.commonjs/molecule/predefined.d.ts.map +1 -0
- package/dist.commonjs/molecule/predefined.js +95 -0
- package/dist.commonjs/num/index.js +17 -29
- package/dist.commonjs/signer/btc/index.js +3 -19
- package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/signerBtc.js +20 -25
- package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +4 -8
- package/dist.commonjs/signer/btc/verify.d.ts +14 -1
- package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
- package/dist.commonjs/signer/btc/verify.js +29 -11
- package/dist.commonjs/signer/ckb/index.js +5 -21
- package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +16 -20
- package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +20 -24
- package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +8 -12
- package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +12 -16
- package/dist.commonjs/signer/ckb/verifyJoyId.js +5 -8
- package/dist.commonjs/signer/doge/index.d.ts +5 -0
- package/dist.commonjs/signer/doge/index.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/index.js +4 -0
- package/dist.commonjs/signer/doge/signerDoge.d.ts +52 -0
- package/dist.commonjs/signer/doge/signerDoge.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDoge.js +82 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.d.ts +41 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDogeAddressReadonly.js +45 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.d.ts +52 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/signerDogePrivateKey.js +68 -0
- package/dist.commonjs/signer/doge/verify.d.ts +6 -0
- package/dist.commonjs/signer/doge/verify.d.ts.map +1 -0
- package/dist.commonjs/signer/doge/verify.js +17 -0
- package/dist.commonjs/signer/dummy/alwaysError.js +2 -6
- package/dist.commonjs/signer/dummy/dummy.js +3 -7
- package/dist.commonjs/signer/dummy/index.js +3 -19
- package/dist.commonjs/signer/dummy/openLink.js +2 -6
- package/dist.commonjs/signer/evm/index.js +3 -19
- package/dist.commonjs/signer/evm/signerEvm.js +31 -35
- package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +4 -8
- package/dist.commonjs/signer/evm/verify.js +4 -7
- package/dist.commonjs/signer/index.d.ts +1 -0
- package/dist.commonjs/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/index.js +7 -22
- package/dist.commonjs/signer/nostr/index.d.ts +1 -0
- package/dist.commonjs/signer/nostr/index.d.ts.map +1 -1
- package/dist.commonjs/signer/nostr/index.js +2 -17
- package/dist.commonjs/signer/nostr/signerNostr.js +21 -25
- package/dist.commonjs/signer/nostr/verify.js +12 -16
- package/dist.commonjs/signer/signer/index.d.ts +4 -2
- package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
- package/dist.commonjs/signer/signer/index.js +22 -23
- package/dist.commonjs/utils/index.js +6 -12
- package/package.json +3 -1
- package/src/barrel.ts +1 -0
- package/src/ckb/transactionLumos.ts +2 -1
- package/src/client/client.ts +1 -1
- package/src/molecule/codec.ts +610 -0
- package/src/molecule/index.ts +2 -0
- package/src/molecule/predefined.ts +114 -0
- package/src/signer/btc/signerBtc.ts +2 -3
- package/src/signer/btc/verify.ts +31 -2
- package/src/signer/doge/index.ts +4 -0
- package/src/signer/doge/signerDoge.ts +116 -0
- package/src/signer/doge/signerDogeAddressReadonly.ts +52 -0
- package/src/signer/doge/signerDogePrivateKey.ts +97 -0
- package/src/signer/doge/verify.ts +38 -0
- package/src/signer/index.ts +1 -0
- package/src/signer/nostr/index.ts +1 -0
- package/src/signer/signer/index.ts +9 -0
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const index_js_1 = require("../bytes/index.js");
|
|
8
|
-
const index_js_2 = require("../ckb/index.js");
|
|
9
|
-
const index_js_3 = require("../hex/index.js");
|
|
10
|
-
const index_js_4 = require("../num/index.js");
|
|
11
|
-
const advanced_js_1 = require("./advanced.js");
|
|
1
|
+
import { blake2b } from "@noble/hashes/blake2b";
|
|
2
|
+
import { bytesFrom } from "../bytes/index.js";
|
|
3
|
+
import { CellInput } from "../ckb/index.js";
|
|
4
|
+
import { hexFrom } from "../hex/index.js";
|
|
5
|
+
import { numLeToBytes } from "../num/index.js";
|
|
6
|
+
import { CKB_BLAKE2B_PERSONAL } from "./advanced.js";
|
|
12
7
|
/**
|
|
13
8
|
* @public
|
|
14
9
|
*/
|
|
15
|
-
class HasherCkb {
|
|
10
|
+
export class HasherCkb {
|
|
16
11
|
/**
|
|
17
12
|
* Creates an instance of Hasher.
|
|
18
13
|
*
|
|
19
14
|
* @param outLength - The output length of the hash in bytes. Default is 32.
|
|
20
15
|
* @param personal - The personal string for the Blake2b algorithm. Default is CKB_BLAKE2B_PERSONAL.
|
|
21
16
|
*/
|
|
22
|
-
constructor(outLength = 32, personal =
|
|
23
|
-
this.hasher =
|
|
17
|
+
constructor(outLength = 32, personal = CKB_BLAKE2B_PERSONAL) {
|
|
18
|
+
this.hasher = blake2b.create({
|
|
24
19
|
personalization: personal,
|
|
25
20
|
dkLen: outLength,
|
|
26
21
|
});
|
|
@@ -39,7 +34,7 @@ class HasherCkb {
|
|
|
39
34
|
* ```
|
|
40
35
|
*/
|
|
41
36
|
update(data) {
|
|
42
|
-
this.hasher.update(
|
|
37
|
+
this.hasher.update(bytesFrom(data));
|
|
43
38
|
return this;
|
|
44
39
|
}
|
|
45
40
|
/**
|
|
@@ -55,10 +50,9 @@ class HasherCkb {
|
|
|
55
50
|
* ```
|
|
56
51
|
*/
|
|
57
52
|
digest() {
|
|
58
|
-
return
|
|
53
|
+
return hexFrom(this.hasher.digest());
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
|
-
exports.HasherCkb = HasherCkb;
|
|
62
56
|
/**
|
|
63
57
|
* Computes the CKB hash of the given data using the Blake2b algorithm.
|
|
64
58
|
* @public
|
|
@@ -71,7 +65,7 @@ exports.HasherCkb = HasherCkb;
|
|
|
71
65
|
* const hash = hashCkb("some data"); // Outputs something like "0x..."
|
|
72
66
|
* ```
|
|
73
67
|
*/
|
|
74
|
-
function hashCkb(...data) {
|
|
68
|
+
export function hashCkb(...data) {
|
|
75
69
|
const hasher = new HasherCkb();
|
|
76
70
|
data.forEach((d) => hasher.update(d));
|
|
77
71
|
return hasher.digest();
|
|
@@ -89,6 +83,6 @@ function hashCkb(...data) {
|
|
|
89
83
|
* const hash = hashTypeId(cellInput, outputIndex); // Outputs something like "0x..."
|
|
90
84
|
* ```
|
|
91
85
|
*/
|
|
92
|
-
function hashTypeId(cellInputLike, outputIndex) {
|
|
93
|
-
return hashCkb(
|
|
86
|
+
export function hashTypeId(cellInputLike, outputIndex) {
|
|
87
|
+
return hashCkb(CellInput.from(cellInputLike).toBytes(), numLeToBytes(outputIndex, 8));
|
|
94
88
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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");
|
|
1
|
+
import { keccak_256 } from "@noble/hashes/sha3";
|
|
2
|
+
import { bytesFrom } from "../bytes/index.js";
|
|
3
|
+
import { hexFrom } from "../hex/index.js";
|
|
7
4
|
/**
|
|
8
5
|
* @public
|
|
9
6
|
*/
|
|
10
|
-
class HasherKeecak256 {
|
|
7
|
+
export class HasherKeecak256 {
|
|
11
8
|
/**
|
|
12
9
|
* Creates an instance of Hasher.
|
|
13
10
|
*/
|
|
14
11
|
constructor() {
|
|
15
|
-
this.hasher =
|
|
12
|
+
this.hasher = keccak_256.create();
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Updates the hash with the given data.
|
|
@@ -28,7 +25,7 @@ class HasherKeecak256 {
|
|
|
28
25
|
* ```
|
|
29
26
|
*/
|
|
30
27
|
update(data) {
|
|
31
|
-
this.hasher.update(
|
|
28
|
+
this.hasher.update(bytesFrom(data));
|
|
32
29
|
return this;
|
|
33
30
|
}
|
|
34
31
|
/**
|
|
@@ -44,7 +41,6 @@ class HasherKeecak256 {
|
|
|
44
41
|
* ```
|
|
45
42
|
*/
|
|
46
43
|
digest() {
|
|
47
|
-
return
|
|
44
|
+
return hexFrom(this.hasher.digest());
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
exports.HasherKeecak256 = HasherKeecak256;
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./hasher.js"), exports);
|
|
18
|
-
__exportStar(require("./hasherCkb.js"), exports);
|
|
19
|
-
__exportStar(require("./hasherKeecak256.js"), exports);
|
|
1
|
+
export * from "./hasher.js";
|
|
2
|
+
export * from "./hasherCkb.js";
|
|
3
|
+
export * from "./hasherKeecak256.js";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hexFrom = hexFrom;
|
|
4
|
-
const index_js_1 = require("../bytes/index.js");
|
|
1
|
+
import { bytesFrom, bytesTo } from "../bytes/index.js";
|
|
5
2
|
/**
|
|
6
3
|
* Converts a HexLike value to a Hex string.
|
|
7
4
|
* @public
|
|
@@ -15,6 +12,6 @@ const index_js_1 = require("../bytes/index.js");
|
|
|
15
12
|
* const hexStringFromBytes = hexFrom(new Uint8Array([104, 101, 108, 108, 111])); // Outputs "0x68656c6c6f"
|
|
16
13
|
* ```
|
|
17
14
|
*/
|
|
18
|
-
function hexFrom(hex) {
|
|
19
|
-
return `0x${
|
|
15
|
+
export function hexFrom(hex) {
|
|
16
|
+
return `0x${bytesTo(bytesFrom(hex), "hex")}`;
|
|
20
17
|
}
|
package/dist.commonjs/index.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ccc = void 0;
|
|
30
|
-
__exportStar(require("./barrel.js"), exports);
|
|
31
|
-
exports.ccc = __importStar(require("./barrel.js"));
|
|
1
|
+
export * from "./barrel.js";
|
|
2
|
+
export * as ccc from "./barrel.js";
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const sha3_1 = require("@noble/hashes/sha3");
|
|
8
|
-
const utils_1 = require("@noble/hashes/utils");
|
|
9
|
-
const index_js_1 = require("../bytes/index.js");
|
|
10
|
-
const index_js_2 = require("../hex/index.js");
|
|
1
|
+
import { ctr } from "@noble/ciphers/aes";
|
|
2
|
+
import { scryptAsync } from "@noble/hashes/scrypt";
|
|
3
|
+
import { keccak_256 } from "@noble/hashes/sha3";
|
|
4
|
+
import { randomBytes } from "@noble/hashes/utils";
|
|
5
|
+
import { bytesConcat, bytesFrom } from "../bytes/index.js";
|
|
6
|
+
import { hexFrom } from "../hex/index.js";
|
|
11
7
|
// The parameter r ("blockSize")
|
|
12
8
|
const DEFAULT_SCRYPT_PARAM_R = 8;
|
|
13
9
|
// The parallelization parameter p
|
|
@@ -15,35 +11,35 @@ const DEFAULT_SCRYPT_PARAM_P = 1;
|
|
|
15
11
|
// The CPU/Memory cost parameter N
|
|
16
12
|
const DEFAULT_SCRYPT_PARAM_N = 262144;
|
|
17
13
|
function mac(derivedKey, cipherText) {
|
|
18
|
-
return
|
|
14
|
+
return hexFrom(keccak_256(bytesConcat(derivedKey.slice(16, 32), cipherText))).slice(2);
|
|
19
15
|
}
|
|
20
16
|
/**
|
|
21
17
|
* @public
|
|
22
18
|
*/
|
|
23
|
-
async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
|
|
24
|
-
const salt =
|
|
25
|
-
const iv =
|
|
19
|
+
export async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
|
|
20
|
+
const salt = randomBytes(32);
|
|
21
|
+
const iv = randomBytes(16);
|
|
26
22
|
const kdfparams = {
|
|
27
23
|
dklen: 32,
|
|
28
|
-
salt:
|
|
24
|
+
salt: hexFrom(salt).slice(2),
|
|
29
25
|
n: DEFAULT_SCRYPT_PARAM_N,
|
|
30
26
|
r: DEFAULT_SCRYPT_PARAM_R,
|
|
31
27
|
p: DEFAULT_SCRYPT_PARAM_P,
|
|
32
28
|
};
|
|
33
|
-
const derivedKey = await
|
|
29
|
+
const derivedKey = await scryptAsync(bytesFrom(password, "utf8"), salt, {
|
|
34
30
|
N: kdfparams.n,
|
|
35
31
|
r: kdfparams.r,
|
|
36
32
|
p: kdfparams.p,
|
|
37
33
|
dkLen: kdfparams.dklen,
|
|
38
34
|
});
|
|
39
|
-
const cipher =
|
|
40
|
-
const ciphertext = cipher.encrypt(
|
|
35
|
+
const cipher = ctr(derivedKey.slice(0, 16), iv.map((v) => v));
|
|
36
|
+
const ciphertext = cipher.encrypt(bytesConcat(bytesFrom(privateKeyLike), bytesFrom(chainCodeLike)));
|
|
41
37
|
return {
|
|
42
|
-
id:
|
|
38
|
+
id: hexFrom(randomBytes(16)).slice(2),
|
|
43
39
|
crypto: {
|
|
44
|
-
ciphertext:
|
|
40
|
+
ciphertext: hexFrom(ciphertext).slice(2),
|
|
45
41
|
cipherparams: {
|
|
46
|
-
iv:
|
|
42
|
+
iv: hexFrom(iv).slice(2),
|
|
47
43
|
},
|
|
48
44
|
cipher: "aes-128-ctr",
|
|
49
45
|
kdf: "scrypt",
|
|
@@ -55,7 +51,7 @@ async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
|
|
|
55
51
|
/**
|
|
56
52
|
* @public
|
|
57
53
|
*/
|
|
58
|
-
async function keystoreDecrypt(keystore, password) {
|
|
54
|
+
export async function keystoreDecrypt(keystore, password) {
|
|
59
55
|
if (typeof keystore !== "object" ||
|
|
60
56
|
keystore === null ||
|
|
61
57
|
!("crypto" in keystore)) {
|
|
@@ -91,17 +87,17 @@ async function keystoreDecrypt(keystore, password) {
|
|
|
91
87
|
typeof kdfparams.salt !== "string") {
|
|
92
88
|
throw Error("Invalid kdfparams");
|
|
93
89
|
}
|
|
94
|
-
const derivedKey = await
|
|
90
|
+
const derivedKey = await scryptAsync(bytesFrom(password, "utf8"), bytesFrom(kdfparams.salt), {
|
|
95
91
|
N: kdfparams.n,
|
|
96
92
|
r: kdfparams.r,
|
|
97
93
|
p: kdfparams.p,
|
|
98
94
|
dkLen: kdfparams.dklen,
|
|
99
95
|
});
|
|
100
|
-
const ciphertext =
|
|
96
|
+
const ciphertext = bytesFrom(crypto.ciphertext);
|
|
101
97
|
if (mac(derivedKey, ciphertext) !== crypto.mac) {
|
|
102
98
|
throw Error("Invalid password");
|
|
103
99
|
}
|
|
104
|
-
const cipher =
|
|
100
|
+
const cipher = ctr(derivedKey.slice(0, 16), bytesFrom(crypto.cipherparams.iv));
|
|
105
101
|
const result = cipher.decrypt(ciphertext);
|
|
106
102
|
return {
|
|
107
103
|
privateKey: result.slice(0, 32),
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Bytes, BytesLike } from "../bytes/index.js";
|
|
2
|
+
import { Num, NumLike } from "../num/index.js";
|
|
3
|
+
export type CodecLike<Encodable, Decoded = Encodable> = {
|
|
4
|
+
readonly encode: (encodable: Encodable) => Bytes;
|
|
5
|
+
readonly decode: (decodable: BytesLike) => Decoded;
|
|
6
|
+
readonly byteLength?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class Codec<Encodable, Decoded = Encodable> {
|
|
9
|
+
readonly encode: (encodable: Encodable) => Bytes;
|
|
10
|
+
readonly decode: (decodable: BytesLike) => Decoded;
|
|
11
|
+
readonly byteLength?: number | undefined;
|
|
12
|
+
constructor(encode: (encodable: Encodable) => Bytes, decode: (decodable: BytesLike) => Decoded, byteLength?: number | undefined);
|
|
13
|
+
static from<Encodable, Decoded = Encodable>({ encode, decode, byteLength, }: CodecLike<Encodable, Decoded>): Codec<Encodable, Decoded>;
|
|
14
|
+
map<NewEncodable = Encodable, NewDecoded = Decoded>({ inMap, outMap, }: {
|
|
15
|
+
inMap?: (encodable: NewEncodable) => Encodable;
|
|
16
|
+
outMap?: (decoded: Decoded) => NewDecoded;
|
|
17
|
+
}): Codec<NewEncodable, NewDecoded>;
|
|
18
|
+
}
|
|
19
|
+
export type EncodableType<T extends CodecLike<any, any>> = T extends CodecLike<infer Encodable, unknown> ? Encodable : never;
|
|
20
|
+
export type DecodedType<T extends CodecLike<any, any>> = T extends CodecLike<any, infer Decoded> ? Decoded : never;
|
|
21
|
+
/**
|
|
22
|
+
* Vector with fixed size item codec
|
|
23
|
+
* @param itemCodec fixed-size vector item codec
|
|
24
|
+
*/
|
|
25
|
+
export declare function fixedItemVec<Encodable, Decoded>(itemCodec: CodecLike<Encodable, Decoded>): Codec<Array<Encodable>, Array<Decoded>>;
|
|
26
|
+
/**
|
|
27
|
+
* Vector with dynamic size item codec, you can create a recursive vector with this function
|
|
28
|
+
* @param itemCodec the vector item codec. It can be fixed-size or dynamic-size.
|
|
29
|
+
*/
|
|
30
|
+
export declare function dynItemVec<Encodable, Decoded>(itemCodec: CodecLike<Encodable, Decoded>): Codec<Array<Encodable>, Array<Decoded>>;
|
|
31
|
+
/**
|
|
32
|
+
* General vector codec, if `itemCodec` is fixed size type, it will create a fixvec codec, otherwise a dynvec codec will be created.
|
|
33
|
+
* @param itemCodec
|
|
34
|
+
*/
|
|
35
|
+
export declare function vector<Encodable, Decoded>(itemCodec: CodecLike<Encodable, Decoded>): Codec<Array<Encodable>, Array<Decoded>>;
|
|
36
|
+
/**
|
|
37
|
+
* Option is a dynamic-size type.
|
|
38
|
+
* Serializing an option depends on whether it is empty or not:
|
|
39
|
+
* - if it's empty, there is zero bytes (the size is 0).
|
|
40
|
+
* - if it's not empty, just serialize the inner item (the size is same as the inner item's size).
|
|
41
|
+
* @param innerCodec
|
|
42
|
+
*/
|
|
43
|
+
export declare function option<Encodable, Decoded>(innerCodec: CodecLike<Encodable, Decoded>): Codec<Encodable | undefined | null, Decoded | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Wrap the encoded value with a fixed-length buffer
|
|
46
|
+
* @param codec
|
|
47
|
+
*/
|
|
48
|
+
export declare function byteVec<Encodable, Decoded>(codec: CodecLike<Encodable, Decoded>): Codec<Encodable, Decoded>;
|
|
49
|
+
export type EncodableRecordOptionalKeys<T extends Record<string, CodecLike<any, any>>> = {
|
|
50
|
+
[K in keyof T]: Extract<EncodableType<T[K]>, undefined> extends never ? never : K;
|
|
51
|
+
}[keyof T];
|
|
52
|
+
export type EncodableRecord<T extends Record<string, CodecLike<any, any>>> = {
|
|
53
|
+
[key in keyof Pick<T, EncodableRecordOptionalKeys<T>>]+?: EncodableType<T[key]>;
|
|
54
|
+
} & {
|
|
55
|
+
[key in keyof Omit<T, EncodableRecordOptionalKeys<T>>]: EncodableType<T[key]>;
|
|
56
|
+
};
|
|
57
|
+
export type DecodedRecordOptionalKeys<T extends Record<string, CodecLike<any, any>>> = {
|
|
58
|
+
[K in keyof T]: Extract<DecodedType<T[K]>, undefined> extends never ? never : K;
|
|
59
|
+
}[keyof T];
|
|
60
|
+
export type DecodedRecord<T extends Record<string, CodecLike<any, any>>> = {
|
|
61
|
+
[key in keyof Pick<T, DecodedRecordOptionalKeys<T>>]+?: DecodedType<T[key]>;
|
|
62
|
+
} & {
|
|
63
|
+
[key in keyof Omit<T, DecodedRecordOptionalKeys<T>>]: DecodedType<T[key]>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Table is a dynamic-size type. It can be considered as a dynvec but the length is fixed.
|
|
67
|
+
* @param codecLayout
|
|
68
|
+
*/
|
|
69
|
+
export declare function table<T extends Record<string, CodecLike<any, any>>, Encodable extends EncodableRecord<T>, Decoded extends DecodedRecord<T>>(codecLayout: T): Codec<Encodable, Decoded>;
|
|
70
|
+
type UnionEncodable<T extends Record<string, CodecLike<any, any>>, K extends keyof T = keyof T> = K extends unknown ? {
|
|
71
|
+
type: K;
|
|
72
|
+
value: EncodableType<T[K]>;
|
|
73
|
+
} : never;
|
|
74
|
+
type UnionDecoded<T extends Record<string, CodecLike<any, any>>, K extends keyof T = keyof T> = K extends unknown ? {
|
|
75
|
+
type: K;
|
|
76
|
+
value: DecodedType<T[K]>;
|
|
77
|
+
} : never;
|
|
78
|
+
/**
|
|
79
|
+
* Union is a dynamic-size type.
|
|
80
|
+
* Serializing a union has two steps:
|
|
81
|
+
* - Serialize an item type id in bytes as a 32 bit unsigned integer in little-endian. The item type id is the index of the inner items, and it's starting at 0.
|
|
82
|
+
* - Serialize the inner item.
|
|
83
|
+
* @param codecLayout the union item record
|
|
84
|
+
* @param fields the custom item type id record
|
|
85
|
+
* @example
|
|
86
|
+
* // without custom id
|
|
87
|
+
* union({ cafe: Uint8, bee: Uint8 })
|
|
88
|
+
* // with custom id
|
|
89
|
+
* union({ cafe: Uint8, bee: Uint8 }, { cafe: 0xcafe, bee: 0xbee })
|
|
90
|
+
*/
|
|
91
|
+
export declare function union<T extends Record<string, CodecLike<any, any>>>(codecLayout: T, fields?: Record<keyof T, number | undefined | null>): Codec<UnionEncodable<T>, UnionDecoded<T>>;
|
|
92
|
+
/**
|
|
93
|
+
* Struct is a fixed-size type: all fields in struct are fixed-size and it has a fixed quantity of fields.
|
|
94
|
+
* The size of a struct is the sum of all fields' size.
|
|
95
|
+
* @param codecLayout a object contains all fields' codec
|
|
96
|
+
*/
|
|
97
|
+
export declare function struct<T extends Record<string, CodecLike<any, any>>, Encodable extends EncodableRecord<T>, Decoded extends DecodedRecord<T>>(codecLayout: T): Codec<Encodable, Decoded>;
|
|
98
|
+
/**
|
|
99
|
+
* The array is a fixed-size type: it has a fixed-size inner type and a fixed length.
|
|
100
|
+
* The size of an array is the size of inner type times the length.
|
|
101
|
+
* @param itemCodec the fixed-size array item codec
|
|
102
|
+
* @param itemCount
|
|
103
|
+
*/
|
|
104
|
+
export declare function array<Encodable, Decoded>(itemCodec: CodecLike<Encodable, Decoded>, itemCount: number): Codec<Array<Encodable>, Array<Decoded>>;
|
|
105
|
+
/**
|
|
106
|
+
* Create a codec to deal with fixed LE or BE bytes.
|
|
107
|
+
* @param byteLength
|
|
108
|
+
* @param littleEndian
|
|
109
|
+
*/
|
|
110
|
+
export declare function uint(byteLength: number, littleEndian?: boolean): Codec<NumLike, Num>;
|
|
111
|
+
/**
|
|
112
|
+
* Create a codec to deal with fixed LE or BE bytes.
|
|
113
|
+
* @param byteLength
|
|
114
|
+
* @param littleEndian
|
|
115
|
+
*/
|
|
116
|
+
export declare function uintNumber(byteLength: number, littleEndian?: boolean): Codec<NumLike, number>;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/molecule/codec.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAA0B,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EACL,GAAG,EAIH,OAAO,EAER,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,SAAS,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,IAAI;IACtD,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,KAAK,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC;IACnD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AACF,qBAAa,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS;aAE7B,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,KAAK;aACvC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO;aACzC,UAAU,CAAC,EAAE,MAAM;gBAFnB,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,KAAK,EACvC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,EACzC,UAAU,CAAC,EAAE,MAAM,YAAA;IAGrC,MAAM,CA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