@polkadot/types-create 6.12.2-8 → 7.0.2-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/package.json CHANGED
@@ -20,11 +20,12 @@
20
20
  "./detectPackage.cjs"
21
21
  ],
22
22
  "type": "module",
23
- "version": "6.12.2-8",
23
+ "version": "7.0.2-1",
24
24
  "main": "index.js",
25
25
  "dependencies": {
26
- "@babel/runtime": "^7.16.3",
27
- "@polkadot/util": "^8.1.2"
26
+ "@babel/runtime": "^7.16.5",
27
+ "@polkadot/types-codec": "7.0.2-1",
28
+ "@polkadot/util": "^8.2.2"
28
29
  },
29
30
  "exports": {
30
31
  ".": {
@@ -87,6 +88,11 @@
87
88
  "require": "./util/typeSplit.cjs",
88
89
  "default": "./util/typeSplit.js"
89
90
  },
90
- "./util/typeSplit.d.ts": "./util/typeSplit.d.ts"
91
+ "./util/typeSplit.d.ts": "./util/typeSplit.d.ts",
92
+ "./util/xcm": {
93
+ "require": "./util/xcm.cjs",
94
+ "default": "./util/xcm.js"
95
+ },
96
+ "./util/xcm.d.ts": "./util/xcm.d.ts"
91
97
  }
92
98
  }
package/packageInfo.cjs CHANGED
@@ -9,6 +9,6 @@ exports.packageInfo = void 0;
9
9
  // Auto-generated by @polkadot/dev, do not edit
10
10
  const packageInfo = {
11
11
  name: '@polkadot/types-create',
12
- version: '6.12.2-8'
12
+ version: '7.0.2-1'
13
13
  };
14
14
  exports.packageInfo = packageInfo;
package/packageInfo.js CHANGED
@@ -3,5 +3,5 @@
3
3
  // Auto-generated by @polkadot/dev, do not edit
4
4
  export const packageInfo = {
5
5
  name: '@polkadot/types-create',
6
- version: '6.12.2-8'
6
+ version: '7.0.2-1'
7
7
  };
package/util/index.cjs CHANGED
@@ -41,4 +41,17 @@ Object.keys(_typeSplit).forEach(function (key) {
41
41
  return _typeSplit[key];
42
42
  }
43
43
  });
44
+ });
45
+
46
+ var _xcm = require("./xcm.cjs");
47
+
48
+ Object.keys(_xcm).forEach(function (key) {
49
+ if (key === "default" || key === "__esModule") return;
50
+ if (key in exports && exports[key] === _xcm[key]) return;
51
+ Object.defineProperty(exports, key, {
52
+ enumerable: true,
53
+ get: function () {
54
+ return _xcm[key];
55
+ }
56
+ });
44
57
  });
package/util/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './encodeTypes';
2
2
  export * from './getTypeDef';
3
3
  export * from './typeSplit';
4
+ export * from './xcm';
package/util/index.js CHANGED
@@ -2,4 +2,5 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export * from "./encodeTypes.js";
4
4
  export * from "./getTypeDef.js";
5
- export * from "./typeSplit.js";
5
+ export * from "./typeSplit.js";
6
+ export * from "./xcm.js";
package/util/xcm.cjs ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.XCM_MAPPINGS = void 0;
7
+ exports.mapXcmTypes = mapXcmTypes;
8
+
9
+ var _util = require("@polkadot/util");
10
+
11
+ // Copyright 2017-2021 @polkadot/types-create authors & contributors
12
+ // SPDX-License-Identifier: Apache-2.0
13
+ const XCM_MAPPINGS = ['AssetInstance', 'Fungibility', 'Junction', 'Junctions', 'MultiAsset', 'MultiAssetFilter', 'MultiLocation', 'Response', 'WildFungibility', 'WildMultiAsset', 'Xcm', 'XcmError', 'XcmOrder'];
14
+ exports.XCM_MAPPINGS = XCM_MAPPINGS;
15
+
16
+ function mapXcmTypes(version) {
17
+ return XCM_MAPPINGS.reduce((all, key) => (0, _util.objectSpread)(all, {
18
+ [key]: `${key}${version}`
19
+ }), {});
20
+ }
package/util/xcm.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const XCM_MAPPINGS: string[];
2
+ export declare function mapXcmTypes(version: 'V0' | 'V1' | 'V2'): Record<string, string>;
package/util/xcm.js ADDED
@@ -0,0 +1,9 @@
1
+ // Copyright 2017-2021 @polkadot/types-create authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { objectSpread } from '@polkadot/util';
4
+ export const XCM_MAPPINGS = ['AssetInstance', 'Fungibility', 'Junction', 'Junctions', 'MultiAsset', 'MultiAssetFilter', 'MultiLocation', 'Response', 'WildFungibility', 'WildMultiAsset', 'Xcm', 'XcmError', 'XcmOrder'];
5
+ export function mapXcmTypes(version) {
6
+ return XCM_MAPPINGS.reduce((all, key) => objectSpread(all, {
7
+ [key]: `${key}${version}`
8
+ }), {});
9
+ }