@talismn/scale 1.0.0 → 2.0.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/LICENSE +253 -674
- package/dist/index.d.mts +847 -842
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +847 -842
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +457 -469
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +329 -430
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,495 +1,483 @@
|
|
|
1
|
-
"
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
9
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"@polkadot-api/metadata-builders": "0.14.3",
|
|
104
|
-
"@polkadot-api/substrate-bindings": "0.20.3",
|
|
105
|
-
"@polkadot-api/utils": "0.4.0",
|
|
106
|
-
anylogger: "^1.0.11",
|
|
107
|
-
"scale-ts": "^1.6.1"
|
|
108
|
-
},
|
|
109
|
-
devDependencies: {
|
|
110
|
-
"@talismn/tsconfig": "workspace:*",
|
|
111
|
-
typescript: "^6.0.3"
|
|
112
|
-
},
|
|
113
|
-
types: "./dist/index.d.ts",
|
|
114
|
-
exports: {
|
|
115
|
-
".": {
|
|
116
|
-
"@talismn/source": "./src/index.ts",
|
|
117
|
-
import: {
|
|
118
|
-
types: "./dist/index.d.mts",
|
|
119
|
-
default: "./dist/index.mjs"
|
|
120
|
-
},
|
|
121
|
-
require: {
|
|
122
|
-
types: "./dist/index.d.ts",
|
|
123
|
-
default: "./dist/index.js"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
// src/log.ts
|
|
130
|
-
var log_default = (0, import_anylogger.default)(package_default.name);
|
|
131
|
-
|
|
132
|
-
// src/util/compactMetadata.ts
|
|
133
|
-
var compactMetadata = (anyMetadata, palletsAndItems = [], runtimeApisAndMethods = [], extraKeepTypes = []) => {
|
|
134
|
-
if (!isCompactableMetadata(anyMetadata))
|
|
135
|
-
throw new Error(`Metadata version ${anyMetadata.metadata.tag} not supported in compactMetadata`);
|
|
136
|
-
const metadata2 = anyMetadata.metadata.value;
|
|
137
|
-
metadata2.pallets = metadata2.pallets.filter(
|
|
138
|
-
(pallet) => (
|
|
139
|
-
// keep this pallet if it's listed in `palletsAndItems`
|
|
140
|
-
palletsAndItems.some(({ pallet: palletName }) => pallet.name === palletName)
|
|
141
|
-
)
|
|
142
|
-
);
|
|
143
|
-
const palletsKeepTypes = palletsAndItems.flatMap(
|
|
144
|
-
({ pallet: palletName, constants: constantNames, items: itemNames }) => {
|
|
145
|
-
const pallet = metadata2.pallets.find((pallet2) => pallet2.name === palletName);
|
|
146
|
-
if (!pallet) return [];
|
|
147
|
-
pallet.calls = void 0;
|
|
148
|
-
pallet.constants = constantNames ? pallet.constants.filter((constant) => constantNames.includes(constant.name)) : [];
|
|
149
|
-
if ("docs" in pallet) pallet.docs = [];
|
|
150
|
-
pallet.errors = void 0;
|
|
151
|
-
pallet.events = void 0;
|
|
152
|
-
if (!pallet.storage) return [];
|
|
153
|
-
pallet.storage.items = pallet.storage.items.filter(
|
|
154
|
-
(item) => itemNames.some((itemName) => item.name === itemName)
|
|
155
|
-
);
|
|
156
|
-
return [
|
|
157
|
-
...pallet.storage.items.flatMap((item) => [
|
|
158
|
-
// each type can be either "Plain" or "Map"
|
|
159
|
-
// if it's "Plain" we only need to get the value type
|
|
160
|
-
// if it's a "Map" we want to keep both the key AND the value types
|
|
161
|
-
item.type.tag === "plain" && item.type.value,
|
|
162
|
-
item.type.tag === "map" && item.type.value.key,
|
|
163
|
-
item.type.tag === "map" && item.type.value.value
|
|
164
|
-
]).filter((type) => typeof type === "number"),
|
|
165
|
-
...pallet.constants.flatMap((constant) => constant.type)
|
|
166
|
-
];
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
let runtimeApisKeepTypes = [];
|
|
170
|
-
if ("apis" in metadata2) {
|
|
171
|
-
metadata2.apis = metadata2.apis.filter(
|
|
172
|
-
(runtimeApi) => runtimeApisAndMethods.some(
|
|
173
|
-
({ runtimeApi: runtimeApiName }) => runtimeApi.name === runtimeApiName
|
|
174
|
-
)
|
|
175
|
-
);
|
|
176
|
-
runtimeApisKeepTypes = runtimeApisAndMethods.flatMap(
|
|
177
|
-
({ runtimeApi: runtimeApiName, methods: methodNames }) => {
|
|
178
|
-
const runtimeApi = metadata2.apis.find((runtimeApi2) => runtimeApi2.name === runtimeApiName);
|
|
179
|
-
if (!runtimeApi) return [];
|
|
180
|
-
runtimeApi.docs = [];
|
|
181
|
-
if (!runtimeApi.methods) return [];
|
|
182
|
-
runtimeApi.methods = runtimeApi.methods.filter(
|
|
183
|
-
(method) => methodNames.some((methodName) => method.name === methodName)
|
|
184
|
-
);
|
|
185
|
-
return runtimeApi.methods.flatMap((method) => [
|
|
186
|
-
// each method has an array of input types (for the params)
|
|
187
|
-
...method.inputs.map((input) => input.type),
|
|
188
|
-
// and one output type (for the result)
|
|
189
|
-
method.output
|
|
190
|
-
]);
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
const keepTypes = /* @__PURE__ */ new Set([...palletsKeepTypes, ...runtimeApisKeepTypes]);
|
|
195
|
-
extraKeepTypes?.forEach((type) => keepTypes.add(type));
|
|
196
|
-
const metadataTysMap = new Map(metadata2.lookup.map((ty) => [ty.id, ty]));
|
|
197
|
-
addDependentTypes(metadataTysMap, keepTypes, [...keepTypes]);
|
|
198
|
-
metadata2.lookup = metadata2.lookup.filter((type) => keepTypes.has(type.id));
|
|
199
|
-
const newTypeIds = /* @__PURE__ */ new Map();
|
|
200
|
-
metadata2.lookup.forEach((type, index) => newTypeIds.set(type.id, index));
|
|
201
|
-
const getNewTypeId = (oldTypeId) => {
|
|
202
|
-
const newTypeId = newTypeIds.get(oldTypeId);
|
|
203
|
-
if (typeof newTypeId !== "number") log_default.error(`Failed to find newTypeId for type ${oldTypeId}`);
|
|
204
|
-
return newTypeId ?? 0;
|
|
205
|
-
};
|
|
206
|
-
remapTypeIds(metadata2, getNewTypeId);
|
|
207
|
-
if ("address" in metadata2.extrinsic) metadata2.extrinsic.address = 0;
|
|
208
|
-
if ("call" in metadata2.extrinsic) metadata2.extrinsic.call = 0;
|
|
209
|
-
if ("signature" in metadata2.extrinsic) metadata2.extrinsic.signature = 0;
|
|
210
|
-
if ("extra" in metadata2.extrinsic) metadata2.extrinsic.extra = 0;
|
|
211
|
-
if ("signedExtensions" in metadata2.extrinsic) metadata2.extrinsic.signedExtensions = [];
|
|
212
|
-
if ("outerEnums" in metadata2) {
|
|
213
|
-
metadata2.outerEnums.call = 0;
|
|
214
|
-
metadata2.outerEnums.error = 0;
|
|
215
|
-
metadata2.outerEnums.event = 0;
|
|
216
|
-
}
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
//#endregion
|
|
24
|
+
let _polkadot_api_metadata_builders = require("@polkadot-api/metadata-builders");
|
|
25
|
+
let _polkadot_api_substrate_bindings = require("@polkadot-api/substrate-bindings");
|
|
26
|
+
let _polkadot_api_utils = require("@polkadot-api/utils");
|
|
27
|
+
let anylogger = require("anylogger");
|
|
28
|
+
anylogger = __toESM(anylogger);
|
|
29
|
+
let scale_ts = require("scale-ts");
|
|
30
|
+
//#region src/papito.ts
|
|
31
|
+
/** Constant: https://docs.substrate.io/build/application-development/#metadata-format */
|
|
32
|
+
const magicNumber = 1635018093;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/log.ts
|
|
35
|
+
var log_default = (0, anylogger.default)("@talismn/scale");
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/util/compactMetadata.ts
|
|
38
|
+
/**
|
|
39
|
+
* Converts a `Metadata` into a `MiniMetadata`.
|
|
40
|
+
*
|
|
41
|
+
* A `MiniMetadata` only contains the types inside of its `lookup` which are relevant for
|
|
42
|
+
* the storage queries specified in `palletsAndItems`.
|
|
43
|
+
*
|
|
44
|
+
* E.g. if `palletsAndItems` is `{ pallet: "System", items: ["Account"] }`, then only the
|
|
45
|
+
* types used in the `System.Account` storage query will remain inside of metadata.lookups.
|
|
46
|
+
*/
|
|
47
|
+
const compactMetadata = (anyMetadata, palletsAndItems = [], runtimeApisAndMethods = [], extraKeepTypes = []) => {
|
|
48
|
+
if (!isCompactableMetadata(anyMetadata)) throw new Error(`Metadata version ${anyMetadata.metadata.tag} not supported in compactMetadata`);
|
|
49
|
+
const metadata = anyMetadata.metadata.value;
|
|
50
|
+
metadata.pallets = metadata.pallets.filter((pallet) => palletsAndItems.some(({ pallet: palletName }) => pallet.name === palletName));
|
|
51
|
+
const palletsKeepTypes = palletsAndItems.flatMap(({ pallet: palletName, constants: constantNames, items: itemNames }) => {
|
|
52
|
+
const pallet = metadata.pallets.find((pallet) => pallet.name === palletName);
|
|
53
|
+
if (!pallet) return [];
|
|
54
|
+
pallet.calls = void 0;
|
|
55
|
+
pallet.constants = constantNames ? pallet.constants.filter((constant) => constantNames.includes(constant.name)) : [];
|
|
56
|
+
if ("docs" in pallet) pallet.docs = [];
|
|
57
|
+
pallet.errors = void 0;
|
|
58
|
+
pallet.events = void 0;
|
|
59
|
+
if (!pallet.storage) return [];
|
|
60
|
+
pallet.storage.items = pallet.storage.items.filter((item) => itemNames.some((itemName) => item.name === itemName));
|
|
61
|
+
return [...pallet.storage.items.flatMap((item) => [
|
|
62
|
+
item.type.tag === "plain" && item.type.value,
|
|
63
|
+
item.type.tag === "map" && item.type.value.key,
|
|
64
|
+
item.type.tag === "map" && item.type.value.value
|
|
65
|
+
]).filter((type) => typeof type === "number"), ...pallet.constants.flatMap((constant) => constant.type)];
|
|
66
|
+
});
|
|
67
|
+
let runtimeApisKeepTypes = [];
|
|
68
|
+
if ("apis" in metadata) {
|
|
69
|
+
metadata.apis = metadata.apis.filter((runtimeApi) => runtimeApisAndMethods.some(({ runtimeApi: runtimeApiName }) => runtimeApi.name === runtimeApiName));
|
|
70
|
+
runtimeApisKeepTypes = runtimeApisAndMethods.flatMap(({ runtimeApi: runtimeApiName, methods: methodNames }) => {
|
|
71
|
+
const runtimeApi = metadata.apis.find((runtimeApi) => runtimeApi.name === runtimeApiName);
|
|
72
|
+
if (!runtimeApi) return [];
|
|
73
|
+
runtimeApi.docs = [];
|
|
74
|
+
if (!runtimeApi.methods) return [];
|
|
75
|
+
runtimeApi.methods = runtimeApi.methods.filter((method) => methodNames.some((methodName) => method.name === methodName));
|
|
76
|
+
return runtimeApi.methods.flatMap((method) => [...method.inputs.map((input) => input.type), method.output]);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const keepTypes = /* @__PURE__ */ new Set([...palletsKeepTypes, ...runtimeApisKeepTypes]);
|
|
80
|
+
extraKeepTypes?.forEach((type) => keepTypes.add(type));
|
|
81
|
+
const metadataTysMap = new Map(metadata.lookup.map((ty) => [ty.id, ty]));
|
|
82
|
+
addDependentTypes(metadataTysMap, keepTypes, [...keepTypes]);
|
|
83
|
+
metadata.lookup = metadata.lookup.filter((type) => keepTypes.has(type.id));
|
|
84
|
+
const newTypeIds = /* @__PURE__ */ new Map();
|
|
85
|
+
metadata.lookup.forEach((type, index) => newTypeIds.set(type.id, index));
|
|
86
|
+
const getNewTypeId = (oldTypeId) => {
|
|
87
|
+
const newTypeId = newTypeIds.get(oldTypeId);
|
|
88
|
+
if (typeof newTypeId !== "number") log_default.error(`Failed to find newTypeId for type ${oldTypeId}`);
|
|
89
|
+
return newTypeId ?? 0;
|
|
90
|
+
};
|
|
91
|
+
remapTypeIds(metadata, getNewTypeId);
|
|
92
|
+
if ("address" in metadata.extrinsic) metadata.extrinsic.address = 0;
|
|
93
|
+
if ("call" in metadata.extrinsic) metadata.extrinsic.call = 0;
|
|
94
|
+
if ("signature" in metadata.extrinsic) metadata.extrinsic.signature = 0;
|
|
95
|
+
if ("extra" in metadata.extrinsic) metadata.extrinsic.extra = 0;
|
|
96
|
+
if ("signedExtensions" in metadata.extrinsic) metadata.extrinsic.signedExtensions = [];
|
|
97
|
+
if ("outerEnums" in metadata) {
|
|
98
|
+
metadata.outerEnums.call = 0;
|
|
99
|
+
metadata.outerEnums.error = 0;
|
|
100
|
+
metadata.outerEnums.event = 0;
|
|
101
|
+
}
|
|
217
102
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
103
|
+
const isCompactableMetadata = (metadata) => {
|
|
104
|
+
switch (metadata.metadata.tag) {
|
|
105
|
+
case "v14":
|
|
106
|
+
case "v15":
|
|
107
|
+
case "v16": return true;
|
|
108
|
+
default: return false;
|
|
109
|
+
}
|
|
227
110
|
};
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
);
|
|
270
|
-
break;
|
|
271
|
-
default: {
|
|
272
|
-
const exhaustiveCheck = type.def;
|
|
273
|
-
log_default.error(`Unhandled V15Type type ${exhaustiveCheck}`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
111
|
+
const addDependentTypes = (metadataTysMap, keepTypes, types, addedTypes = /* @__PURE__ */ new Set()) => {
|
|
112
|
+
const addDependentSubTypes = (subTypes) => addDependentTypes(metadataTysMap, keepTypes, subTypes, addedTypes);
|
|
113
|
+
for (const typeId of types) {
|
|
114
|
+
const type = metadataTysMap.get(typeId);
|
|
115
|
+
if (!type) {
|
|
116
|
+
log_default.warn(`Unable to find type with id ${typeId}`);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (addedTypes.has(type.id)) continue;
|
|
120
|
+
keepTypes.add(type.id);
|
|
121
|
+
addedTypes.add(type.id);
|
|
122
|
+
addDependentSubTypes(type.params.map((param) => param.type).filter((type) => typeof type === "number"));
|
|
123
|
+
switch (type.def.tag) {
|
|
124
|
+
case "array":
|
|
125
|
+
addDependentSubTypes([type.def.value.type]);
|
|
126
|
+
break;
|
|
127
|
+
case "bitSequence":
|
|
128
|
+
addDependentSubTypes([type.def.value.bitOrderType, type.def.value.bitStoreType]);
|
|
129
|
+
break;
|
|
130
|
+
case "compact":
|
|
131
|
+
addDependentSubTypes([type.def.value]);
|
|
132
|
+
break;
|
|
133
|
+
case "composite":
|
|
134
|
+
addDependentSubTypes(type.def.value.map((field) => field.type).filter((type) => typeof type === "number"));
|
|
135
|
+
break;
|
|
136
|
+
case "primitive": break;
|
|
137
|
+
case "sequence":
|
|
138
|
+
addDependentSubTypes([type.def.value]);
|
|
139
|
+
break;
|
|
140
|
+
case "tuple":
|
|
141
|
+
addDependentSubTypes(type.def.value.filter((type) => typeof type === "number"));
|
|
142
|
+
break;
|
|
143
|
+
case "variant":
|
|
144
|
+
addDependentSubTypes(type.def.value.flatMap((member) => member.fields.map((field) => field.type)).filter((type) => typeof type === "number"));
|
|
145
|
+
break;
|
|
146
|
+
default: {
|
|
147
|
+
const exhaustiveCheck = type.def;
|
|
148
|
+
log_default.error(`Unhandled V15Type type ${exhaustiveCheck}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
277
152
|
};
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
153
|
+
const remapTypeIds = (metadata, getNewTypeId) => {
|
|
154
|
+
remapLookupTypeIds(metadata, getNewTypeId);
|
|
155
|
+
remapStorageTypeIds(metadata, getNewTypeId);
|
|
156
|
+
remapRuntimeApisTypeIds(metadata, getNewTypeId);
|
|
282
157
|
};
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
158
|
+
const remapLookupTypeIds = (metadata, getNewTypeId) => {
|
|
159
|
+
for (const type of metadata.lookup) {
|
|
160
|
+
type.id = getNewTypeId(type.id);
|
|
161
|
+
for (const param of type.params) {
|
|
162
|
+
if (typeof param.type !== "number") continue;
|
|
163
|
+
param.type = getNewTypeId(param.type);
|
|
164
|
+
}
|
|
165
|
+
switch (type.def.tag) {
|
|
166
|
+
case "array":
|
|
167
|
+
type.def.value.type = getNewTypeId(type.def.value.type);
|
|
168
|
+
break;
|
|
169
|
+
case "bitSequence":
|
|
170
|
+
type.def.value.bitOrderType = getNewTypeId(type.def.value.bitOrderType);
|
|
171
|
+
type.def.value.bitStoreType = getNewTypeId(type.def.value.bitStoreType);
|
|
172
|
+
break;
|
|
173
|
+
case "compact":
|
|
174
|
+
type.def.value = getNewTypeId(type.def.value);
|
|
175
|
+
break;
|
|
176
|
+
case "composite":
|
|
177
|
+
for (const field of type.def.value) {
|
|
178
|
+
if (typeof field.type !== "number") continue;
|
|
179
|
+
field.type = getNewTypeId(field.type);
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
case "primitive": break;
|
|
183
|
+
case "sequence":
|
|
184
|
+
type.def.value = getNewTypeId(type.def.value);
|
|
185
|
+
break;
|
|
186
|
+
case "tuple":
|
|
187
|
+
type.def.value = type.def.value.map((type) => {
|
|
188
|
+
if (typeof type !== "number") return type;
|
|
189
|
+
return getNewTypeId(type);
|
|
190
|
+
});
|
|
191
|
+
break;
|
|
192
|
+
case "variant":
|
|
193
|
+
for (const member of type.def.value) for (const field of member.fields) {
|
|
194
|
+
if (typeof field.type !== "number") continue;
|
|
195
|
+
field.type = getNewTypeId(field.type);
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
default: {
|
|
199
|
+
const exhaustiveCheck = type.def;
|
|
200
|
+
log_default.error(`Unhandled V15Type type ${exhaustiveCheck}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
332
204
|
};
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
}
|
|
205
|
+
const remapStorageTypeIds = (metadata, getNewTypeId) => {
|
|
206
|
+
for (const pallet of metadata.pallets) {
|
|
207
|
+
for (const item of pallet.storage?.items ?? []) {
|
|
208
|
+
if (item.type.tag === "plain") item.type.value = getNewTypeId(item.type.value);
|
|
209
|
+
if (item.type.tag === "map") {
|
|
210
|
+
item.type.value.key = getNewTypeId(item.type.value.key);
|
|
211
|
+
item.type.value.value = getNewTypeId(item.type.value.value);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
for (const constant of pallet.constants ?? []) constant.type = getNewTypeId(constant.type);
|
|
215
|
+
}
|
|
346
216
|
};
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
method.output = getNewTypeId(method.output);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
217
|
+
const remapRuntimeApisTypeIds = (metadata, getNewTypeId) => {
|
|
218
|
+
for (const runtimeApi of metadata.apis) for (const method of runtimeApi.methods ?? []) {
|
|
219
|
+
for (const input of method.inputs) input.type = getNewTypeId(input.type);
|
|
220
|
+
method.output = getNewTypeId(method.output);
|
|
221
|
+
}
|
|
356
222
|
};
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/util/decodeScale.ts
|
|
225
|
+
const decodeScale = (scaleCoder, change, error) => {
|
|
226
|
+
if (change === null) return null;
|
|
227
|
+
try {
|
|
228
|
+
return scaleCoder?.value?.dec(change) ?? null;
|
|
229
|
+
} catch (cause) {
|
|
230
|
+
log_default.warn(error ?? `Failed to decode ${change}`, cause);
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
367
233
|
};
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/util/encodeMetadata.ts
|
|
236
|
+
const encodeMetadata = (metadata$1) => (0, _polkadot_api_utils.toHex)(_polkadot_api_substrate_bindings.metadata.enc(metadata$1));
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/util/encodeStateKey.ts
|
|
239
|
+
const encodeStateKey = (scaleCoder, error, ...args) => {
|
|
240
|
+
try {
|
|
241
|
+
return scaleCoder?.keys?.enc(...args);
|
|
242
|
+
} catch (cause) {
|
|
243
|
+
log_default.warn(error ?? `Failed to encode stateKey ${JSON.stringify(args)}`, cause);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
380
246
|
};
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/util/parseMetadataRpc.ts
|
|
249
|
+
const parseMetadataRpc = (metadataRpc) => {
|
|
250
|
+
const metadata = (0, _polkadot_api_substrate_bindings.decAnyMetadata)(metadataRpc);
|
|
251
|
+
const unifiedMetadata = (0, _polkadot_api_substrate_bindings.unifyMetadata)(metadata);
|
|
252
|
+
const lookupFn = (0, _polkadot_api_metadata_builders.getLookupFn)(unifiedMetadata);
|
|
253
|
+
return {
|
|
254
|
+
metadata,
|
|
255
|
+
unifiedMetadata,
|
|
256
|
+
lookupFn,
|
|
257
|
+
builder: (0, _polkadot_api_metadata_builders.getDynamicBuilder)(lookupFn)
|
|
258
|
+
};
|
|
391
259
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/util/getConstantValueFromMetadata.ts
|
|
262
|
+
const getConstantValueFromMetadata = (metadata, pallet, constant) => {
|
|
263
|
+
const { builder, unifiedMetadata } = typeof metadata === "string" ? parseMetadataRpc(metadata) : metadata;
|
|
264
|
+
return getConstantValueInner(builder, unifiedMetadata, pallet, constant);
|
|
397
265
|
};
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
266
|
+
const getConstantValueInner = (builder, unifiedMetadata, pallet, constant) => {
|
|
267
|
+
try {
|
|
268
|
+
const storageCodec = builder.buildConstant(pallet, constant);
|
|
269
|
+
const encodedValue = unifiedMetadata.pallets.find(({ name }) => name === pallet)?.constants.find(({ name }) => name === constant)?.value;
|
|
270
|
+
if (!encodedValue) throw new Error(`Constant ${pallet}.${constant} not found`);
|
|
271
|
+
return storageCodec.dec(encodedValue);
|
|
272
|
+
} catch (err) {
|
|
273
|
+
log_default.error("Failed to get constant value from metadata", {
|
|
274
|
+
err,
|
|
275
|
+
pallet,
|
|
276
|
+
constant
|
|
277
|
+
});
|
|
278
|
+
throw err;
|
|
279
|
+
}
|
|
412
280
|
};
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/util/getMetadataVersion.ts
|
|
283
|
+
/**
|
|
284
|
+
* Extracts the `version` u8 from a SCALE-encoded metadata blob and returns it as a `number`.
|
|
285
|
+
*
|
|
286
|
+
* Only reads the first 40 bytes of the blob.
|
|
287
|
+
*/
|
|
288
|
+
const getMetadataVersion = (metadataRpc) => {
|
|
289
|
+
try {
|
|
290
|
+
return (0, scale_ts.Struct)({
|
|
291
|
+
magicNumber: scale_ts.u32,
|
|
292
|
+
version: scale_ts.u8
|
|
293
|
+
}).dec(metadataRpc).version;
|
|
294
|
+
} catch {
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
425
297
|
};
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
combined.set(storageHash, palletHash.length);
|
|
436
|
-
return (0, import_utils2.toHex)(combined);
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/util/getStorageKeyPrefix.ts
|
|
300
|
+
const getStorageKeyPrefix = (palletName, storageName) => {
|
|
301
|
+
const palletHash = (0, _polkadot_api_substrate_bindings.Twox128)(new TextEncoder().encode(palletName));
|
|
302
|
+
const storageHash = (0, _polkadot_api_substrate_bindings.Twox128)(new TextEncoder().encode(storageName));
|
|
303
|
+
const combined = new Uint8Array(palletHash.length + storageHash.length);
|
|
304
|
+
combined.set(palletHash, 0);
|
|
305
|
+
combined.set(storageHash, palletHash.length);
|
|
306
|
+
return (0, _polkadot_api_utils.toHex)(combined);
|
|
437
307
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region src/util/serdePapi.ts
|
|
310
|
+
/**
|
|
311
|
+
* For the substrate-tokens (and other) modules, we configure the `onChainId` field in chaindata to tell the module how to query each token.
|
|
312
|
+
* These queries are made to the tokens pallet.
|
|
313
|
+
* E.g. api.query.Tokens.Account(accountAddress, papiParse(onChainId))
|
|
314
|
+
*
|
|
315
|
+
* The `onChainId` field on chaindata must be a JSON-parseable string, but a decoded papi value can
|
|
316
|
+
* contain types that plain JSON cannot represent. `papiStringify`/`papiParse` are inverse functions
|
|
317
|
+
* that serialise *any* decoded papi value to a deterministic string and back.
|
|
318
|
+
*
|
|
319
|
+
* Only two decoded types are not valid JSON, so only these get a tag — everything else (numbers,
|
|
320
|
+
* objects, and strings, including the `0x…` hex strings papi v2 decodes fixed-size `[u8; N]` fields
|
|
321
|
+
* into) is already JSON and is left untouched:
|
|
322
|
+
* - `bigint` → `bigint:<n>`
|
|
323
|
+
* - `Uint8Array` → `u8a:0x<hex>` (papi v2 decodes variable-length `Vec<u8>` to a `Uint8Array`)
|
|
324
|
+
*
|
|
325
|
+
* Note on polkadot-api v2 byte fields. The `Binary` class was removed and the SCALE codecs split
|
|
326
|
+
* byte decoding into two distinct JS types, which `papiParse` must reproduce exactly or the codec
|
|
327
|
+
* silently builds a garbage statekey (→ no balance):
|
|
328
|
+
* - fixed-size `[u8; N]` (`AccountId32`, `AccountKey20`, `GeneralKey.data`, Erc20 addresses,
|
|
329
|
+
* Stellar code/issuer, …) → a plain `0x` hex **string** (`SizedHex`). The codec's `.enc`
|
|
330
|
+
* expects that string. So a fixed-size field is just a JSON string: no tag, round-trips as-is.
|
|
331
|
+
* - variable-length `Vec<u8>` → a **`Uint8Array`**. The codec's `.enc` expects a `Uint8Array`,
|
|
332
|
+
* NOT a hex string. Hence the dedicated `u8a:` tag, which `papiParse` restores to a `Uint8Array`.
|
|
333
|
+
*
|
|
334
|
+
* `hex:` and `bin:` are legacy/authoring **input** forms still accepted by `papiParse` (some
|
|
335
|
+
* chaindata token templates are hand-written with them), but `papiStringify` never emits them — it
|
|
336
|
+
* normalises to the bare canonical form. So the canonical output is deterministic and idempotent:
|
|
337
|
+
* `papiStringify(papiParse(canonical)) === canonical`.
|
|
338
|
+
*
|
|
339
|
+
* Some examples (input string → papiParse value):
|
|
340
|
+
* Input: `5` → `5`
|
|
341
|
+
* Input: `{ type: "LiquidCrowdloan", value: 13 }` → `Enum("LiquidCrowdloan", 13)`
|
|
342
|
+
* Input: `{ type: "NativeToken", value: "bigint:2" }` → `Enum("NativeToken", 2n)`
|
|
343
|
+
* Input: `{ type: "Erc20", value: "0x07df…bce" }` → `Enum("Erc20", "0x07df…bce")` (fixed → string)
|
|
344
|
+
* Input: `{ type: "Erc20", value: "hex:0x07df…bce" }` → `Enum("Erc20", "0x07df…bce")` (legacy input)
|
|
345
|
+
* Input: `{ code: "bin:TZS" }` → `{ code: "0x545a53" }` (legacy input)
|
|
346
|
+
* Input: `"u8a:0xdeadbeef"` → `Uint8Array([0xde,0xad,0xbe,0xef])` (variable bytes)
|
|
347
|
+
*/
|
|
348
|
+
const papiParse = (text) => {
|
|
349
|
+
const reviver = (_key, value) => {
|
|
350
|
+
if (typeof value !== "string") return value;
|
|
351
|
+
if (value.startsWith("bigint:")) return BigInt(value.slice(7));
|
|
352
|
+
if (value.startsWith("u8a:")) return _polkadot_api_substrate_bindings.Binary.fromHex(value.slice(4));
|
|
353
|
+
if (value.startsWith("hex:")) return value.slice(4);
|
|
354
|
+
if (value.startsWith("bin:")) return _polkadot_api_substrate_bindings.Binary.toHex(_polkadot_api_substrate_bindings.Binary.fromText(value.slice(4)));
|
|
355
|
+
return value;
|
|
356
|
+
};
|
|
357
|
+
if (typeof text !== "string") return text;
|
|
358
|
+
return JSON.parse(text, reviver);
|
|
455
359
|
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
360
|
+
const papiStringify = (value, space) => {
|
|
361
|
+
const replacer = (_key, value) => {
|
|
362
|
+
if (typeof value === "bigint") return `bigint:${String(value)}`;
|
|
363
|
+
if (value instanceof Uint8Array) return `u8a:${_polkadot_api_substrate_bindings.Binary.toHex(value)}`;
|
|
364
|
+
return value;
|
|
365
|
+
};
|
|
366
|
+
return JSON.stringify(value, replacer, space);
|
|
463
367
|
};
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
Blake3256,
|
|
471
|
-
Blake3256Concat,
|
|
472
|
-
Twox128,
|
|
473
|
-
Twox256,
|
|
474
|
-
Twox64Concat,
|
|
475
|
-
compactMetadata,
|
|
476
|
-
decAnyMetadata,
|
|
477
|
-
decodeScale,
|
|
478
|
-
encodeMetadata,
|
|
479
|
-
encodeStateKey,
|
|
480
|
-
fromHex,
|
|
481
|
-
getConstantValueFromMetadata,
|
|
482
|
-
getDynamicBuilder,
|
|
483
|
-
getLookupFn,
|
|
484
|
-
getMetadataVersion,
|
|
485
|
-
getStorageKeyPrefix,
|
|
486
|
-
magicNumber,
|
|
487
|
-
mergeUint8,
|
|
488
|
-
metadata,
|
|
489
|
-
papiParse,
|
|
490
|
-
papiStringify,
|
|
491
|
-
parseMetadataRpc,
|
|
492
|
-
toHex,
|
|
493
|
-
unifyMetadata
|
|
368
|
+
//#endregion
|
|
369
|
+
Object.defineProperty(exports, "Binary", {
|
|
370
|
+
enumerable: true,
|
|
371
|
+
get: function() {
|
|
372
|
+
return _polkadot_api_substrate_bindings.Binary;
|
|
373
|
+
}
|
|
494
374
|
});
|
|
375
|
+
Object.defineProperty(exports, "Blake2128", {
|
|
376
|
+
enumerable: true,
|
|
377
|
+
get: function() {
|
|
378
|
+
return _polkadot_api_substrate_bindings.Blake2128;
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
Object.defineProperty(exports, "Blake2128Concat", {
|
|
382
|
+
enumerable: true,
|
|
383
|
+
get: function() {
|
|
384
|
+
return _polkadot_api_substrate_bindings.Blake2128Concat;
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
Object.defineProperty(exports, "Blake2256", {
|
|
388
|
+
enumerable: true,
|
|
389
|
+
get: function() {
|
|
390
|
+
return _polkadot_api_substrate_bindings.Blake2256;
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
Object.defineProperty(exports, "Blake3256", {
|
|
394
|
+
enumerable: true,
|
|
395
|
+
get: function() {
|
|
396
|
+
return _polkadot_api_substrate_bindings.Blake3256;
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
Object.defineProperty(exports, "Blake3256Concat", {
|
|
400
|
+
enumerable: true,
|
|
401
|
+
get: function() {
|
|
402
|
+
return _polkadot_api_substrate_bindings.Blake3256Concat;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
Object.defineProperty(exports, "Twox128", {
|
|
406
|
+
enumerable: true,
|
|
407
|
+
get: function() {
|
|
408
|
+
return _polkadot_api_substrate_bindings.Twox128;
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
Object.defineProperty(exports, "Twox256", {
|
|
412
|
+
enumerable: true,
|
|
413
|
+
get: function() {
|
|
414
|
+
return _polkadot_api_substrate_bindings.Twox256;
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
Object.defineProperty(exports, "Twox64Concat", {
|
|
418
|
+
enumerable: true,
|
|
419
|
+
get: function() {
|
|
420
|
+
return _polkadot_api_substrate_bindings.Twox64Concat;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
exports.compactMetadata = compactMetadata;
|
|
424
|
+
Object.defineProperty(exports, "decAnyMetadata", {
|
|
425
|
+
enumerable: true,
|
|
426
|
+
get: function() {
|
|
427
|
+
return _polkadot_api_substrate_bindings.decAnyMetadata;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
exports.decodeScale = decodeScale;
|
|
431
|
+
exports.encodeMetadata = encodeMetadata;
|
|
432
|
+
exports.encodeStateKey = encodeStateKey;
|
|
433
|
+
Object.defineProperty(exports, "fromHex", {
|
|
434
|
+
enumerable: true,
|
|
435
|
+
get: function() {
|
|
436
|
+
return _polkadot_api_utils.fromHex;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
exports.getConstantValueFromMetadata = getConstantValueFromMetadata;
|
|
440
|
+
Object.defineProperty(exports, "getDynamicBuilder", {
|
|
441
|
+
enumerable: true,
|
|
442
|
+
get: function() {
|
|
443
|
+
return _polkadot_api_metadata_builders.getDynamicBuilder;
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
Object.defineProperty(exports, "getLookupFn", {
|
|
447
|
+
enumerable: true,
|
|
448
|
+
get: function() {
|
|
449
|
+
return _polkadot_api_metadata_builders.getLookupFn;
|
|
450
|
+
}
|
|
451
|
+
});
|
|
452
|
+
exports.getMetadataVersion = getMetadataVersion;
|
|
453
|
+
exports.getStorageKeyPrefix = getStorageKeyPrefix;
|
|
454
|
+
exports.magicNumber = magicNumber;
|
|
455
|
+
Object.defineProperty(exports, "mergeUint8", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
get: function() {
|
|
458
|
+
return _polkadot_api_utils.mergeUint8;
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
Object.defineProperty(exports, "metadata", {
|
|
462
|
+
enumerable: true,
|
|
463
|
+
get: function() {
|
|
464
|
+
return _polkadot_api_substrate_bindings.metadata;
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
exports.papiParse = papiParse;
|
|
468
|
+
exports.papiStringify = papiStringify;
|
|
469
|
+
exports.parseMetadataRpc = parseMetadataRpc;
|
|
470
|
+
Object.defineProperty(exports, "toHex", {
|
|
471
|
+
enumerable: true,
|
|
472
|
+
get: function() {
|
|
473
|
+
return _polkadot_api_utils.toHex;
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
Object.defineProperty(exports, "unifyMetadata", {
|
|
477
|
+
enumerable: true,
|
|
478
|
+
get: function() {
|
|
479
|
+
return _polkadot_api_substrate_bindings.unifyMetadata;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
495
483
|
//# sourceMappingURL=index.js.map
|