@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.
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createClassUnsafe = exports.getTypeClass = exports.constructTypeClass = void 0;
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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTypeUnsafe = void 0;
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;
@@ -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: '12.4.2' };
4
+ exports.packageInfo = { name: '@polkadot/types-create', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '13.0.1' };
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withTypeString = exports.encodeTypeDef = exports.paramsNotation = void 0;
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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTypeDef = void 0;
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;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.typeSplit = void 0;
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.mapXcmTypes = exports.XCM_MAPPINGS = void 0;
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": "12.4.2",
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": "12.4.2",
142
+ "@polkadot/types-codec": "13.0.1",
143
143
  "@polkadot/util": "^13.0.2",
144
- "tslib": "^2.6.3"
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: '12.4.2' };
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' };