@acala-network/chopsticks-core 1.5.2 → 1.6.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/dist/cjs/api.js +6 -15
- package/dist/cjs/blockchain/block-builder.js +3 -1
- package/dist/cjs/blockchain/block.js +5 -12
- package/dist/cjs/blockchain/head-state.js +4 -9
- package/dist/cjs/blockchain/index.js +6 -15
- package/dist/cjs/blockchain/storage-layer.js +5 -12
- package/dist/cjs/blockchain/txpool.js +17 -17
- package/dist/cjs/chopsticks-provider.js +5 -12
- package/dist/cjs/env.d.ts +25 -47
- package/dist/cjs/env.js +8 -19
- package/dist/cjs/genesis-provider.js +5 -12
- package/dist/cjs/logger.d.ts +3 -2
- package/dist/cjs/offchain.js +1 -3
- package/dist/cjs/rpc/dev/new-block.d.ts +9 -53
- package/dist/cjs/rpc/dev/set-head.d.ts +1 -1
- package/dist/cjs/rpc/index.d.ts +1 -1
- package/dist/cjs/rpc/rpc-spec/chainHead_v1.js +33 -7
- package/dist/cjs/rpc/rpc-spec/index.d.ts +1 -1
- package/dist/cjs/rpc/rpc-spec/index.js +8 -19
- package/dist/cjs/rpc/shared.d.ts +2 -2
- package/dist/cjs/rpc/shared.js +1 -3
- package/dist/cjs/rpc/substrate/index.d.ts +1 -6
- package/dist/cjs/rpc/substrate/index.js +8 -19
- package/dist/cjs/rpc/substrate/payment.js +7 -4
- package/dist/cjs/schema/index.d.ts +6 -52
- package/dist/cjs/schema/index.js +1 -1
- package/dist/cjs/utils/index.d.ts +5 -0
- package/dist/cjs/utils/index.js +9 -0
- package/dist/cjs/utils/key-cache.js +1 -3
- package/dist/cjs/wasm-executor/browser-wasm-executor.js +8 -19
- package/dist/cjs/wasm-executor/index.js +8 -19
- package/dist/cjs/wasm-executor/node-wasm-executor.js +8 -19
- package/dist/esm/blockchain/block-builder.js +4 -2
- package/dist/esm/blockchain/txpool.js +12 -3
- package/dist/esm/env.d.ts +25 -47
- package/dist/esm/logger.d.ts +3 -2
- package/dist/esm/rpc/dev/new-block.d.ts +9 -53
- package/dist/esm/rpc/dev/set-head.d.ts +1 -1
- package/dist/esm/rpc/index.d.ts +1 -1
- package/dist/esm/rpc/index.js +1 -1
- package/dist/esm/rpc/rpc-spec/chainHead_v1.js +33 -7
- package/dist/esm/rpc/rpc-spec/index.d.ts +1 -1
- package/dist/esm/rpc/rpc-spec/index.js +1 -1
- package/dist/esm/rpc/shared.d.ts +2 -2
- package/dist/esm/rpc/substrate/index.d.ts +1 -6
- package/dist/esm/rpc/substrate/index.js +1 -6
- package/dist/esm/rpc/substrate/payment.js +8 -5
- package/dist/esm/schema/index.d.ts +6 -52
- package/dist/esm/schema/index.js +1 -1
- package/dist/esm/utils/index.d.ts +5 -0
- package/dist/esm/utils/index.js +10 -1
- package/package.json +65 -61
package/dist/cjs/api.js
CHANGED
|
@@ -17,15 +17,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
20
|
-
if (descriptor.get)
|
|
21
|
-
return descriptor.get.call(receiver);
|
|
22
|
-
}
|
|
20
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
23
21
|
return descriptor.value;
|
|
24
22
|
}
|
|
25
23
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
26
|
-
if (descriptor.set)
|
|
27
|
-
|
|
28
|
-
} else {
|
|
24
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
25
|
+
else {
|
|
29
26
|
if (!descriptor.writable) {
|
|
30
27
|
throw new TypeError("attempted to set read only private field");
|
|
31
28
|
}
|
|
@@ -33,9 +30,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
36
|
-
if (!privateMap.has(receiver))
|
|
37
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
38
|
-
}
|
|
33
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
39
34
|
return privateMap.get(receiver);
|
|
40
35
|
}
|
|
41
36
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -52,9 +47,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
52
47
|
return value;
|
|
53
48
|
}
|
|
54
49
|
function _class_private_method_get(receiver, privateSet, fn) {
|
|
55
|
-
if (!privateSet.has(receiver))
|
|
56
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
57
|
-
}
|
|
50
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
58
51
|
return fn;
|
|
59
52
|
}
|
|
60
53
|
function _class_private_method_init(obj, privateSet) {
|
|
@@ -69,9 +62,7 @@ function _define_property(obj, key, value) {
|
|
|
69
62
|
configurable: true,
|
|
70
63
|
writable: true
|
|
71
64
|
});
|
|
72
|
-
} else
|
|
73
|
-
obj[key] = value;
|
|
74
|
-
}
|
|
65
|
+
} else obj[key] = value;
|
|
75
66
|
return obj;
|
|
76
67
|
}
|
|
77
68
|
function _interop_require_default(obj) {
|
|
@@ -435,7 +435,9 @@ const dryRunExtrinsic = async (head, inherentProviders, extrinsic, params)=>{
|
|
|
435
435
|
generic.toHex()
|
|
436
436
|
]);
|
|
437
437
|
}
|
|
438
|
-
logger.debug({
|
|
438
|
+
logger.debug((0, _index.isGeneralExtrinsic)(extrinsic) ? {
|
|
439
|
+
extrinsic: (0, _logger.truncate)(extrinsic)
|
|
440
|
+
} : {
|
|
439
441
|
call: registry.createType('GenericExtrinsic', (0, _util.hexToU8a)(extrinsic)).toJSON()
|
|
440
442
|
}, 'dry_run_extrinsic');
|
|
441
443
|
return newBlock.call('BlockBuilder_apply_extrinsic', [
|
|
@@ -20,15 +20,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
23
|
-
if (descriptor.get)
|
|
24
|
-
return descriptor.get.call(receiver);
|
|
25
|
-
}
|
|
23
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
26
24
|
return descriptor.value;
|
|
27
25
|
}
|
|
28
26
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
29
|
-
if (descriptor.set)
|
|
30
|
-
|
|
31
|
-
} else {
|
|
27
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
28
|
+
else {
|
|
32
29
|
if (!descriptor.writable) {
|
|
33
30
|
throw new TypeError("attempted to set read only private field");
|
|
34
31
|
}
|
|
@@ -36,9 +33,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
39
|
-
if (!privateMap.has(receiver))
|
|
40
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
41
|
-
}
|
|
36
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
42
37
|
return privateMap.get(receiver);
|
|
43
38
|
}
|
|
44
39
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -62,9 +57,7 @@ function _define_property(obj, key, value) {
|
|
|
62
57
|
configurable: true,
|
|
63
58
|
writable: true
|
|
64
59
|
});
|
|
65
|
-
} else
|
|
66
|
-
obj[key] = value;
|
|
67
|
-
}
|
|
60
|
+
} else obj[key] = value;
|
|
68
61
|
return obj;
|
|
69
62
|
}
|
|
70
63
|
var _chain = /*#__PURE__*/ new WeakMap(), _header = /*#__PURE__*/ new WeakMap(), _parentBlock = /*#__PURE__*/ new WeakMap(), _extrinsics = /*#__PURE__*/ new WeakMap(), _wasm = /*#__PURE__*/ new WeakMap(), _runtimeVersion = /*#__PURE__*/ new WeakMap(), _metadata1 = /*#__PURE__*/ new WeakMap(), _registry = /*#__PURE__*/ new WeakMap(), _meta = /*#__PURE__*/ new WeakMap(), _baseStorage = /*#__PURE__*/ new WeakMap(), _storages = /*#__PURE__*/ new WeakMap();
|
|
@@ -23,15 +23,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
26
|
-
if (descriptor.get)
|
|
27
|
-
return descriptor.get.call(receiver);
|
|
28
|
-
}
|
|
26
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
29
27
|
return descriptor.value;
|
|
30
28
|
}
|
|
31
29
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
32
|
-
if (descriptor.set)
|
|
33
|
-
|
|
34
|
-
} else {
|
|
30
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
31
|
+
else {
|
|
35
32
|
if (!descriptor.writable) {
|
|
36
33
|
throw new TypeError("attempted to set read only private field");
|
|
37
34
|
}
|
|
@@ -39,9 +36,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
42
|
-
if (!privateMap.has(receiver))
|
|
43
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
44
|
-
}
|
|
39
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
45
40
|
return privateMap.get(receiver);
|
|
46
41
|
}
|
|
47
42
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -26,15 +26,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
29
|
-
if (descriptor.get)
|
|
30
|
-
return descriptor.get.call(receiver);
|
|
31
|
-
}
|
|
29
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
32
30
|
return descriptor.value;
|
|
33
31
|
}
|
|
34
32
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
35
|
-
if (descriptor.set)
|
|
36
|
-
|
|
37
|
-
} else {
|
|
33
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
34
|
+
else {
|
|
38
35
|
if (!descriptor.writable) {
|
|
39
36
|
throw new TypeError("attempted to set read only private field");
|
|
40
37
|
}
|
|
@@ -42,9 +39,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
45
|
-
if (!privateMap.has(receiver))
|
|
46
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
47
|
-
}
|
|
42
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
48
43
|
return privateMap.get(receiver);
|
|
49
44
|
}
|
|
50
45
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -61,9 +56,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
61
56
|
return value;
|
|
62
57
|
}
|
|
63
58
|
function _class_private_method_get(receiver, privateSet, fn) {
|
|
64
|
-
if (!privateSet.has(receiver))
|
|
65
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
66
|
-
}
|
|
59
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
67
60
|
return fn;
|
|
68
61
|
}
|
|
69
62
|
function _class_private_method_init(obj, privateSet) {
|
|
@@ -78,9 +71,7 @@ function _define_property(obj, key, value) {
|
|
|
78
71
|
configurable: true,
|
|
79
72
|
writable: true
|
|
80
73
|
});
|
|
81
|
-
} else
|
|
82
|
-
obj[key] = value;
|
|
83
|
-
}
|
|
74
|
+
} else obj[key] = value;
|
|
84
75
|
return obj;
|
|
85
76
|
}
|
|
86
77
|
function _interop_require_default(obj) {
|
|
@@ -29,15 +29,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
32
|
-
if (descriptor.get)
|
|
33
|
-
return descriptor.get.call(receiver);
|
|
34
|
-
}
|
|
32
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
35
33
|
return descriptor.value;
|
|
36
34
|
}
|
|
37
35
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
38
|
-
if (descriptor.set)
|
|
39
|
-
|
|
40
|
-
} else {
|
|
36
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
37
|
+
else {
|
|
41
38
|
if (!descriptor.writable) {
|
|
42
39
|
throw new TypeError("attempted to set read only private field");
|
|
43
40
|
}
|
|
@@ -45,9 +42,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
48
|
-
if (!privateMap.has(receiver))
|
|
49
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
50
|
-
}
|
|
45
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
51
46
|
return privateMap.get(receiver);
|
|
52
47
|
}
|
|
53
48
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -64,9 +59,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
64
59
|
return value;
|
|
65
60
|
}
|
|
66
61
|
function _class_private_method_get(receiver, privateSet, fn) {
|
|
67
|
-
if (!privateSet.has(receiver))
|
|
68
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
69
|
-
}
|
|
62
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
70
63
|
return fn;
|
|
71
64
|
}
|
|
72
65
|
function _class_private_method_init(obj, privateSet) {
|
|
@@ -31,15 +31,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
34
|
-
if (descriptor.get)
|
|
35
|
-
return descriptor.get.call(receiver);
|
|
36
|
-
}
|
|
34
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
37
35
|
return descriptor.value;
|
|
38
36
|
}
|
|
39
37
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
40
|
-
if (descriptor.set)
|
|
41
|
-
|
|
42
|
-
} else {
|
|
38
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
39
|
+
else {
|
|
43
40
|
if (!descriptor.writable) {
|
|
44
41
|
throw new TypeError("attempted to set read only private field");
|
|
45
42
|
}
|
|
@@ -47,9 +44,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
50
|
-
if (!privateMap.has(receiver))
|
|
51
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
52
|
-
}
|
|
47
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
53
48
|
return privateMap.get(receiver);
|
|
54
49
|
}
|
|
55
50
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -66,9 +61,7 @@ function _class_private_field_set(receiver, privateMap, value) {
|
|
|
66
61
|
return value;
|
|
67
62
|
}
|
|
68
63
|
function _class_private_method_get(receiver, privateSet, fn) {
|
|
69
|
-
if (!privateSet.has(receiver))
|
|
70
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
71
|
-
}
|
|
64
|
+
if (!privateSet.has(receiver)) throw new TypeError("attempted to get private field on non-instance");
|
|
72
65
|
return fn;
|
|
73
66
|
}
|
|
74
67
|
function _class_private_method_init(obj, privateSet) {
|
|
@@ -83,9 +76,7 @@ function _define_property(obj, key, value) {
|
|
|
83
76
|
configurable: true,
|
|
84
77
|
writable: true
|
|
85
78
|
});
|
|
86
|
-
} else
|
|
87
|
-
obj[key] = value;
|
|
88
|
-
}
|
|
79
|
+
} else obj[key] = value;
|
|
89
80
|
return obj;
|
|
90
81
|
}
|
|
91
82
|
function _interop_require_default(obj) {
|
|
@@ -305,8 +296,17 @@ class TxPool {
|
|
|
305
296
|
}
|
|
306
297
|
async function getSigner(extrinsic) {
|
|
307
298
|
const registry = await _class_private_field_get(this, _chain).head.registry;
|
|
308
|
-
|
|
309
|
-
|
|
299
|
+
if (!(0, _index.isGeneralExtrinsic)(extrinsic)) {
|
|
300
|
+
return registry.createType('GenericExtrinsic', extrinsic).signer.toString();
|
|
301
|
+
}
|
|
302
|
+
// A general (v5) extrinsic has no signer field, and `signer` throws for it. Its account, if any, is the one
|
|
303
|
+
// frame_system's CheckNonce tags it with: `provides: [(account, nonce)]`.
|
|
304
|
+
const validity = await _class_private_field_get(this, _chain).validateExtrinsic(extrinsic);
|
|
305
|
+
if (!validity.isOk) return undefined;
|
|
306
|
+
const length = registry.createType('AccountId').encodedLength + registry.createType('Index').encodedLength;
|
|
307
|
+
const tags = validity.asOk.provides.filter((tag)=>tag.length === length);
|
|
308
|
+
if (tags.length !== 1) return undefined;
|
|
309
|
+
return registry.createType('(AccountId, Index)', tags[0].toU8a(true))[0].toString();
|
|
310
310
|
}
|
|
311
311
|
function maybeBuildBlock() {
|
|
312
312
|
switch(_class_private_field_get(this, _mode)){
|
|
@@ -18,15 +18,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
21
|
-
if (descriptor.get)
|
|
22
|
-
return descriptor.get.call(receiver);
|
|
23
|
-
}
|
|
21
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
24
22
|
return descriptor.value;
|
|
25
23
|
}
|
|
26
24
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
27
|
-
if (descriptor.set)
|
|
28
|
-
|
|
29
|
-
} else {
|
|
25
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
26
|
+
else {
|
|
30
27
|
if (!descriptor.writable) {
|
|
31
28
|
throw new TypeError("attempted to set read only private field");
|
|
32
29
|
}
|
|
@@ -34,9 +31,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
37
|
-
if (!privateMap.has(receiver))
|
|
38
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
39
|
-
}
|
|
34
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
40
35
|
return privateMap.get(receiver);
|
|
41
36
|
}
|
|
42
37
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -60,9 +55,7 @@ function _define_property(obj, key, value) {
|
|
|
60
55
|
configurable: true,
|
|
61
56
|
writable: true
|
|
62
57
|
});
|
|
63
|
-
} else
|
|
64
|
-
obj[key] = value;
|
|
65
|
-
}
|
|
58
|
+
} else obj[key] = value;
|
|
66
59
|
return obj;
|
|
67
60
|
}
|
|
68
61
|
const providerHandlers = {
|
package/dist/cjs/env.d.ts
CHANGED
|
@@ -1,57 +1,35 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
export declare const environmentSchema: z.ZodObject<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Set port for Chopsticks to listen on, default is `8000`.
|
|
9
|
-
*/
|
|
3
|
+
DISABLE_AUTO_HRMP: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
4
|
+
true: "true";
|
|
5
|
+
false: "false";
|
|
6
|
+
}>>, z.ZodTransform<boolean, "true" | "false">>;
|
|
10
7
|
PORT: z.ZodOptional<z.ZodString>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
DISABLE_PLUGINS: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
true: "true";
|
|
10
|
+
false: "false";
|
|
11
|
+
}>>, z.ZodTransform<boolean, "true" | "false">>;
|
|
15
12
|
HTTP_PROXY: z.ZodOptional<z.ZodString>;
|
|
16
13
|
http_proxy: z.ZodOptional<z.ZodString>;
|
|
17
14
|
HTTPS_PROXY: z.ZodOptional<z.ZodString>;
|
|
18
15
|
https_proxy: z.ZodOptional<z.ZodString>;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
VERBOSE_LOG: z.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
LOG_COMPACT: z.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
VERBOSE_LOG: boolean;
|
|
37
|
-
LOG_COMPACT: boolean;
|
|
38
|
-
PORT?: string | undefined;
|
|
39
|
-
HTTP_PROXY?: string | undefined;
|
|
40
|
-
http_proxy?: string | undefined;
|
|
41
|
-
HTTPS_PROXY?: string | undefined;
|
|
42
|
-
https_proxy?: string | undefined;
|
|
43
|
-
}, {
|
|
44
|
-
DISABLE_AUTO_HRMP?: "true" | "false" | undefined;
|
|
45
|
-
PORT?: string | undefined;
|
|
46
|
-
DISABLE_PLUGINS?: "true" | "false" | undefined;
|
|
47
|
-
HTTP_PROXY?: string | undefined;
|
|
48
|
-
http_proxy?: string | undefined;
|
|
49
|
-
HTTPS_PROXY?: string | undefined;
|
|
50
|
-
https_proxy?: string | undefined;
|
|
51
|
-
LOG_LEVEL?: "fatal" | "error" | "warn" | "info" | "debug" | "trace" | undefined;
|
|
52
|
-
VERBOSE_LOG?: "true" | "false" | undefined;
|
|
53
|
-
LOG_COMPACT?: "true" | "false" | undefined;
|
|
54
|
-
}>;
|
|
16
|
+
LOG_LEVEL: z.ZodDefault<z.ZodEnum<{
|
|
17
|
+
fatal: "fatal";
|
|
18
|
+
error: "error";
|
|
19
|
+
warn: "warn";
|
|
20
|
+
info: "info";
|
|
21
|
+
debug: "debug";
|
|
22
|
+
trace: "trace";
|
|
23
|
+
}>>;
|
|
24
|
+
VERBOSE_LOG: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
25
|
+
true: "true";
|
|
26
|
+
false: "false";
|
|
27
|
+
}>>, z.ZodTransform<boolean, "true" | "false">>;
|
|
28
|
+
LOG_COMPACT: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
|
|
29
|
+
true: "true";
|
|
30
|
+
false: "false";
|
|
31
|
+
}>>, z.ZodTransform<boolean, "true" | "false">>;
|
|
32
|
+
}, z.core.$strip>;
|
|
55
33
|
/**
|
|
56
34
|
* Environment variables available for users
|
|
57
35
|
*/
|
package/dist/cjs/env.js
CHANGED
|
@@ -26,18 +26,12 @@ function _getRequireWildcardCache(nodeInterop) {
|
|
|
26
26
|
})(nodeInterop);
|
|
27
27
|
}
|
|
28
28
|
function _interop_require_wildcard(obj, nodeInterop) {
|
|
29
|
-
if (!nodeInterop && obj && obj.__esModule)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
default: obj
|
|
35
|
-
};
|
|
36
|
-
}
|
|
29
|
+
if (!nodeInterop && obj && obj.__esModule) return obj;
|
|
30
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") return {
|
|
31
|
+
default: obj
|
|
32
|
+
};
|
|
37
33
|
var cache = _getRequireWildcardCache(nodeInterop);
|
|
38
|
-
if (cache && cache.has(obj))
|
|
39
|
-
return cache.get(obj);
|
|
40
|
-
}
|
|
34
|
+
if (cache && cache.has(obj)) return cache.get(obj);
|
|
41
35
|
var newObj = {
|
|
42
36
|
__proto__: null
|
|
43
37
|
};
|
|
@@ -45,17 +39,12 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
45
39
|
for(var key in obj){
|
|
46
40
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
47
41
|
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
48
|
-
if (desc && (desc.get || desc.set))
|
|
49
|
-
|
|
50
|
-
} else {
|
|
51
|
-
newObj[key] = obj[key];
|
|
52
|
-
}
|
|
42
|
+
if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);
|
|
43
|
+
else newObj[key] = obj[key];
|
|
53
44
|
}
|
|
54
45
|
}
|
|
55
46
|
newObj.default = obj;
|
|
56
|
-
if (cache)
|
|
57
|
-
cache.set(obj, newObj);
|
|
58
|
-
}
|
|
47
|
+
if (cache) cache.set(obj, newObj);
|
|
59
48
|
return newObj;
|
|
60
49
|
}
|
|
61
50
|
const environmentSchema = _zod.object({
|
|
@@ -18,15 +18,12 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
21
|
-
if (descriptor.get)
|
|
22
|
-
return descriptor.get.call(receiver);
|
|
23
|
-
}
|
|
21
|
+
if (descriptor.get) return descriptor.get.call(receiver);
|
|
24
22
|
return descriptor.value;
|
|
25
23
|
}
|
|
26
24
|
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
27
|
-
if (descriptor.set)
|
|
28
|
-
|
|
29
|
-
} else {
|
|
25
|
+
if (descriptor.set) descriptor.set.call(receiver, value);
|
|
26
|
+
else {
|
|
30
27
|
if (!descriptor.writable) {
|
|
31
28
|
throw new TypeError("attempted to set read only private field");
|
|
32
29
|
}
|
|
@@ -34,9 +31,7 @@ function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
37
|
-
if (!privateMap.has(receiver))
|
|
38
|
-
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
39
|
-
}
|
|
34
|
+
if (!privateMap.has(receiver)) throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
40
35
|
return privateMap.get(receiver);
|
|
41
36
|
}
|
|
42
37
|
function _class_private_field_get(receiver, privateMap) {
|
|
@@ -60,9 +55,7 @@ function _define_property(obj, key, value) {
|
|
|
60
55
|
configurable: true,
|
|
61
56
|
writable: true
|
|
62
57
|
});
|
|
63
|
-
} else
|
|
64
|
-
obj[key] = value;
|
|
65
|
-
}
|
|
58
|
+
} else obj[key] = value;
|
|
66
59
|
return obj;
|
|
67
60
|
}
|
|
68
61
|
var _isConnected = /*#__PURE__*/ new WeakMap(), _eventemitter = /*#__PURE__*/ new WeakMap(), _isReadyPromise = /*#__PURE__*/ new WeakMap(), _genesis = /*#__PURE__*/ new WeakMap(), _stateRoot = /*#__PURE__*/ new WeakMap();
|
package/dist/cjs/logger.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
import { pino } from 'pino';
|
|
2
|
+
export declare const pinoLogger: pino.Logger<never, boolean>;
|
|
3
|
+
export declare const defaultLogger: pino.Logger<never, boolean>;
|
|
3
4
|
export declare const truncate: (val: any) => any;
|
package/dist/cjs/offchain.js
CHANGED
|
@@ -5,62 +5,18 @@ declare const schema: z.ZodObject<{
|
|
|
5
5
|
to: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
dmp: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7
7
|
sentAt: z.ZodNumber;
|
|
8
|
-
msg: z.
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, {
|
|
13
|
-
msg: `0x${string}`;
|
|
14
|
-
sentAt: number;
|
|
15
|
-
}>, "many">>;
|
|
16
|
-
ump: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>>;
|
|
17
|
-
hrmp: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodArray<z.ZodObject<{
|
|
8
|
+
msg: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
9
|
+
}, z.core.$strip>>>;
|
|
10
|
+
ump: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>>>;
|
|
11
|
+
hrmp: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodArray<z.ZodObject<{
|
|
18
12
|
sentAt: z.ZodNumber;
|
|
19
|
-
data: z.
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
sentAt: number;
|
|
23
|
-
}, {
|
|
24
|
-
data: `0x${string}`;
|
|
25
|
-
sentAt: number;
|
|
26
|
-
}>, "many">>>;
|
|
27
|
-
transactions: z.ZodOptional<z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>;
|
|
13
|
+
data: z.ZodCustom<`0x${string}`, `0x${string}`>;
|
|
14
|
+
}, z.core.$strip>>>>;
|
|
15
|
+
transactions: z.ZodOptional<z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
|
|
28
16
|
unsafeBlockHeight: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
relayChainStateOverrides: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.
|
|
17
|
+
relayChainStateOverrides: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodCustom<`0x${string}`, `0x${string}`>, z.ZodUnion<readonly [z.ZodCustom<`0x${string}`, `0x${string}`>, z.ZodNull]>], null>>>;
|
|
30
18
|
relayParentNumber: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
},
|
|
32
|
-
transactions?: `0x${string}`[] | undefined;
|
|
33
|
-
unsafeBlockHeight?: number | undefined;
|
|
34
|
-
relayChainStateOverrides?: [`0x${string}`, `0x${string}` | null][] | undefined;
|
|
35
|
-
relayParentNumber?: number | undefined;
|
|
36
|
-
ump?: Record<number, `0x${string}`[]> | undefined;
|
|
37
|
-
dmp?: {
|
|
38
|
-
msg: `0x${string}`;
|
|
39
|
-
sentAt: number;
|
|
40
|
-
}[] | undefined;
|
|
41
|
-
hrmp?: Record<string | number, {
|
|
42
|
-
data: `0x${string}`;
|
|
43
|
-
sentAt: number;
|
|
44
|
-
}[]> | undefined;
|
|
45
|
-
count?: number | undefined;
|
|
46
|
-
to?: number | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
transactions?: `0x${string}`[] | undefined;
|
|
49
|
-
unsafeBlockHeight?: number | undefined;
|
|
50
|
-
relayChainStateOverrides?: [`0x${string}`, `0x${string}` | null][] | undefined;
|
|
51
|
-
relayParentNumber?: number | undefined;
|
|
52
|
-
ump?: Record<number, `0x${string}`[]> | undefined;
|
|
53
|
-
dmp?: {
|
|
54
|
-
msg: `0x${string}`;
|
|
55
|
-
sentAt: number;
|
|
56
|
-
}[] | undefined;
|
|
57
|
-
hrmp?: Record<string | number, {
|
|
58
|
-
data: `0x${string}`;
|
|
59
|
-
sentAt: number;
|
|
60
|
-
}[]> | undefined;
|
|
61
|
-
count?: number | undefined;
|
|
62
|
-
to?: number | undefined;
|
|
63
|
-
}>;
|
|
19
|
+
}, z.core.$strip>;
|
|
64
20
|
type Params = z.infer<typeof schema>;
|
|
65
21
|
export interface NewBlockParams {
|
|
66
22
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type Context } from '../shared.js';
|
|
3
|
-
declare const schema: z.ZodUnion<[z.ZodIntersection<z.ZodString, z.
|
|
3
|
+
declare const schema: z.ZodUnion<[z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>, z.ZodNumber]>;
|
|
4
4
|
type Params = z.infer<typeof schema>;
|
|
5
5
|
/**
|
|
6
6
|
* Set head.
|
package/dist/cjs/rpc/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import dev from './dev/index.js';
|
|
|
2
2
|
import type { Handlers } from './shared.js';
|
|
3
3
|
import substrate from './substrate/index.js';
|
|
4
4
|
export declare const allHandlers: Handlers;
|
|
5
|
-
export { substrate, dev };
|
|
6
5
|
export type { Context, Handler, Handlers, SubscriptionManager } from './shared.js';
|
|
7
6
|
export { ResponseError } from './shared.js';
|
|
7
|
+
export { dev, substrate };
|