@polkadot/types-create 12.4.2 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/create/class.js +3 -4
- package/cjs/create/type.js +1 -2
- package/cjs/packageInfo.js +1 -1
- package/cjs/util/encodeTypes.js +3 -4
- package/cjs/util/getTypeDef.js +1 -2
- package/cjs/util/typeSplit.js +1 -2
- package/cjs/util/xcm.js +2 -2
- package/package.json +3 -3
- package/packageInfo.js +1 -1
package/cjs/create/class.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.constructTypeClass = constructTypeClass;
|
|
4
|
+
exports.getTypeClass = getTypeClass;
|
|
5
|
+
exports.createClassUnsafe = createClassUnsafe;
|
|
4
6
|
const types_codec_1 = require("@polkadot/types-codec");
|
|
5
7
|
const util_1 = require("@polkadot/util");
|
|
6
8
|
const index_js_1 = require("../types/index.js");
|
|
@@ -149,11 +151,9 @@ function constructTypeClass(registry, typeDef) {
|
|
|
149
151
|
throw new Error(`Unable to construct class from ${(0, util_1.stringify)(typeDef)}: ${error.message}`);
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
|
-
exports.constructTypeClass = constructTypeClass;
|
|
153
154
|
function getTypeClass(registry, typeDef) {
|
|
154
155
|
return registry.getUnsafe(typeDef.type, false, typeDef);
|
|
155
156
|
}
|
|
156
|
-
exports.getTypeClass = getTypeClass;
|
|
157
157
|
function createClassUnsafe(registry, type) {
|
|
158
158
|
return (
|
|
159
159
|
// just retrieve via name, no creation via typeDef
|
|
@@ -163,4 +163,3 @@ function createClassUnsafe(registry, type) {
|
|
|
163
163
|
? registry.lookup.getTypeDef(type)
|
|
164
164
|
: (0, getTypeDef_js_1.getTypeDef)(type)));
|
|
165
165
|
}
|
|
166
|
-
exports.createClassUnsafe = createClassUnsafe;
|
package/cjs/create/type.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTypeUnsafe =
|
|
3
|
+
exports.createTypeUnsafe = createTypeUnsafe;
|
|
4
4
|
const types_codec_1 = require("@polkadot/types-codec");
|
|
5
5
|
const util_1 = require("@polkadot/util");
|
|
6
6
|
const class_js_1 = require("./class.js");
|
|
@@ -64,4 +64,3 @@ function createTypeUnsafe(registry, type, params = [], options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
throw firstError;
|
|
66
66
|
}
|
|
67
|
-
exports.createTypeUnsafe = createTypeUnsafe;
|
package/cjs/packageInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.packageInfo = void 0;
|
|
4
|
-
exports.packageInfo = { name: '@polkadot/types-create', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '
|
|
4
|
+
exports.packageInfo = { name: '@polkadot/types-create', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '13.0.1' };
|
package/cjs/util/encodeTypes.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.paramsNotation = paramsNotation;
|
|
4
|
+
exports.encodeTypeDef = encodeTypeDef;
|
|
5
|
+
exports.withTypeString = withTypeString;
|
|
4
6
|
const util_1 = require("@polkadot/util");
|
|
5
7
|
const index_js_1 = require("../types/index.js");
|
|
6
8
|
const stringIdentity = (value) => value.toString();
|
|
@@ -10,7 +12,6 @@ function paramsNotation(outer, inner, transform = stringIdentity) {
|
|
|
10
12
|
? `<${(Array.isArray(inner) ? inner : [inner]).map(transform).join(', ')}>`
|
|
11
13
|
: ''}`;
|
|
12
14
|
}
|
|
13
|
-
exports.paramsNotation = paramsNotation;
|
|
14
15
|
function encodeWithParams(registry, typeDef, outer) {
|
|
15
16
|
const { info, sub } = typeDef;
|
|
16
17
|
switch (info) {
|
|
@@ -120,10 +121,8 @@ function encodeTypeDef(registry, typeDef) {
|
|
|
120
121
|
? typeDef.displayName
|
|
121
122
|
: encodeType(registry, typeDef);
|
|
122
123
|
}
|
|
123
|
-
exports.encodeTypeDef = encodeTypeDef;
|
|
124
124
|
function withTypeString(registry, typeDef) {
|
|
125
125
|
return (0, util_1.objectSpread)({}, typeDef, {
|
|
126
126
|
type: encodeType(registry, typeDef, false)
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
exports.withTypeString = withTypeString;
|
package/cjs/util/getTypeDef.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTypeDef =
|
|
3
|
+
exports.getTypeDef = getTypeDef;
|
|
4
4
|
const types_codec_1 = require("@polkadot/types-codec");
|
|
5
5
|
const util_1 = require("@polkadot/util");
|
|
6
6
|
const index_js_1 = require("../types/index.js");
|
|
@@ -193,4 +193,3 @@ function getTypeDef(_type, { displayName, name } = {}, count = 0) {
|
|
|
193
193
|
}
|
|
194
194
|
return value;
|
|
195
195
|
}
|
|
196
|
-
exports.getTypeDef = getTypeDef;
|
package/cjs/util/typeSplit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.typeSplit =
|
|
3
|
+
exports.typeSplit = typeSplit;
|
|
4
4
|
function typeSplit(type) {
|
|
5
5
|
const result = [];
|
|
6
6
|
// these are the depths of the various tokens: <, [, {, (
|
|
@@ -58,4 +58,3 @@ function typeSplit(type) {
|
|
|
58
58
|
result.push(type.substring(start, type.length).trim());
|
|
59
59
|
return result;
|
|
60
60
|
}
|
|
61
|
-
exports.typeSplit = typeSplit;
|
package/cjs/util/xcm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.XCM_MAPPINGS = void 0;
|
|
4
|
+
exports.mapXcmTypes = mapXcmTypes;
|
|
4
5
|
const util_1 = require("@polkadot/util");
|
|
5
6
|
exports.XCM_MAPPINGS = ['AssetInstance', 'Fungibility', 'Junction', 'Junctions', 'MultiAsset', 'MultiAssetFilter', 'MultiLocation', 'Response', 'WildFungibility', 'WildMultiAsset', 'Xcm', 'XcmError', 'XcmOrder'];
|
|
6
7
|
function mapXcmTypes(version) {
|
|
7
8
|
return exports.XCM_MAPPINGS.reduce((all, key) => (0, util_1.objectSpread)(all, { [key]: `${key}${version}` }), {});
|
|
8
9
|
}
|
|
9
|
-
exports.mapXcmTypes = mapXcmTypes;
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./cjs/packageDetect.js"
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
|
-
"version": "
|
|
21
|
+
"version": "13.0.1",
|
|
22
22
|
"main": "./cjs/index.js",
|
|
23
23
|
"module": "./index.js",
|
|
24
24
|
"types": "./index.d.ts",
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
|
-
"@polkadot/types-codec": "
|
|
142
|
+
"@polkadot/types-codec": "13.0.1",
|
|
143
143
|
"@polkadot/util": "^13.0.2",
|
|
144
|
-
"tslib": "^2.
|
|
144
|
+
"tslib": "^2.7.0"
|
|
145
145
|
}
|
|
146
146
|
}
|
package/packageInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageInfo = { name: '@polkadot/types-create', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '
|
|
1
|
+
export const packageInfo = { name: '@polkadot/types-create', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '13.0.1' };
|