@polkadot/types-create 7.2.2-3 → 7.2.2-7
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/create/class.cjs +1 -0
- package/create/class.js +2 -1
- package/detectOther.cjs +1 -1
- package/detectOther.d.ts +2 -0
- package/detectOther.js +1 -1
- package/detectPackage.cjs +1 -3
- package/detectPackage.js +1 -2
- package/package.json +9 -10
- package/packageInfo.cjs +3 -1
- package/packageInfo.d.ts +2 -0
- package/packageInfo.js +3 -1
- package/types.cjs +2 -1
- package/types.d.ts +2 -1
- package/types.js +2 -1
- package/util/encodeTypes.cjs +2 -0
- package/util/encodeTypes.js +2 -0
- package/util/getTypeDef.cjs +1 -1
- package/util/getTypeDef.js +1 -1
- package/cjs/dirname.d.ts +0 -8
- package/cjs/dirname.js +0 -8
- package/cjs/package.json +0 -3
package/create/class.cjs
CHANGED
|
@@ -155,6 +155,7 @@ const infoMapping = {
|
|
|
155
155
|
(0, _util.assert)(sub && (0, _util.isNumber)(length) && !Array.isArray(sub), 'Expected length & type information for fixed vector');
|
|
156
156
|
return sub.type === 'u8' ? _typesCodec.U8aFixed.with(length * 8, displayName) : _typesCodec.VecFixed.with(getTypeDefType(sub), length);
|
|
157
157
|
},
|
|
158
|
+
[_types.TypeDefInfo.WrapperKeepOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperKeepOpaque, value),
|
|
158
159
|
[_types.TypeDefInfo.WrapperOpaque]: (registry, value) => createWithSub(_typesCodec.WrapperOpaque, value)
|
|
159
160
|
};
|
|
160
161
|
|
package/create/class.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperOpaque } from '@polkadot/types-codec';
|
|
3
|
+
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
|
|
4
4
|
import { assert, isNumber, stringify } from '@polkadot/util';
|
|
5
5
|
import { TypeDefInfo } from "../types.js";
|
|
6
6
|
import { getTypeDef } from "../util/getTypeDef.js";
|
|
@@ -133,6 +133,7 @@ const infoMapping = {
|
|
|
133
133
|
assert(sub && isNumber(length) && !Array.isArray(sub), 'Expected length & type information for fixed vector');
|
|
134
134
|
return sub.type === 'u8' ? U8aFixed.with(length * 8, displayName) : VecFixed.with(getTypeDefType(sub), length);
|
|
135
135
|
},
|
|
136
|
+
[TypeDefInfo.WrapperKeepOpaque]: (registry, value) => createWithSub(WrapperKeepOpaque, value),
|
|
136
137
|
[TypeDefInfo.WrapperOpaque]: (registry, value) => createWithSub(WrapperOpaque, value)
|
|
137
138
|
};
|
|
138
139
|
export function constructTypeClass(registry, typeDef) {
|
package/detectOther.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _packageInfo = require("@polkadot/types-codec/packageInfo");
|
|
8
|
+
var _packageInfo = require("@polkadot/types-codec/packageInfo.cjs");
|
|
9
9
|
|
|
10
10
|
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
package/detectOther.d.ts
CHANGED
package/detectOther.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { packageInfo as codecInfo } from '@polkadot/types-codec/packageInfo';
|
|
3
|
+
import { packageInfo as codecInfo } from '@polkadot/types-codec/packageInfo.js';
|
|
4
4
|
export default [codecInfo];
|
package/detectPackage.cjs
CHANGED
|
@@ -4,8 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
|
|
5
5
|
var _util = require("@polkadot/util");
|
|
6
6
|
|
|
7
|
-
var _dirname = _interopRequireDefault(require("./cjs/dirname"));
|
|
8
|
-
|
|
9
7
|
var _detectOther = _interopRequireDefault(require("./detectOther.cjs"));
|
|
10
8
|
|
|
11
9
|
var _packageInfo = require("./packageInfo.cjs");
|
|
@@ -13,4 +11,4 @@ var _packageInfo = require("./packageInfo.cjs");
|
|
|
13
11
|
// Copyright 2017-2022 @polkadot/types-create authors & contributors
|
|
14
12
|
// SPDX-License-Identifier: Apache-2.0
|
|
15
13
|
// Do not edit, auto-generated by @polkadot/dev
|
|
16
|
-
(0, _util.detectPackage)(_packageInfo.packageInfo,
|
|
14
|
+
(0, _util.detectPackage)(_packageInfo.packageInfo, _packageInfo.packageInfo.path, _detectOther.default);
|
package/detectPackage.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
// Do not edit, auto-generated by @polkadot/dev
|
|
4
4
|
import { detectPackage } from '@polkadot/util';
|
|
5
|
-
import dirname from "./cjs/dirname.js";
|
|
6
5
|
import others from "./detectOther.js";
|
|
7
6
|
import { packageInfo } from "./packageInfo.js";
|
|
8
|
-
detectPackage(packageInfo,
|
|
7
|
+
detectPackage(packageInfo, packageInfo.path, others);
|
package/package.json
CHANGED
|
@@ -20,16 +20,18 @@
|
|
|
20
20
|
"./detectPackage.cjs"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "7.2.2-
|
|
24
|
-
"main": "index.
|
|
23
|
+
"version": "7.2.2-7",
|
|
24
|
+
"main": "index.cjs",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.16.7",
|
|
27
|
-
"@polkadot/types-codec": "7.2.2-
|
|
28
|
-
"@polkadot/util": "^8.2.
|
|
27
|
+
"@polkadot/types-codec": "7.2.2-7",
|
|
28
|
+
"@polkadot/util": "^8.2.3-29"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@polkadot/types": "7.2.2-
|
|
31
|
+
"@polkadot/types": "7.2.2-7"
|
|
32
32
|
},
|
|
33
|
+
"module": "index.js",
|
|
34
|
+
"types": "index.d.ts",
|
|
33
35
|
"exports": {
|
|
34
36
|
".": {
|
|
35
37
|
"types": "./index.d.ts",
|
|
@@ -41,11 +43,6 @@
|
|
|
41
43
|
"require": "./bundle.cjs",
|
|
42
44
|
"default": "./bundle.js"
|
|
43
45
|
},
|
|
44
|
-
"./cjs/dirname": {
|
|
45
|
-
"types": "./cjs/dirname.d.ts",
|
|
46
|
-
"default": "./cjs/dirname.js"
|
|
47
|
-
},
|
|
48
|
-
"./cjs/package.json": "./cjs/package.json",
|
|
49
46
|
"./create": {
|
|
50
47
|
"types": "./create/index.d.ts",
|
|
51
48
|
"require": "./create/index.cjs",
|
|
@@ -72,6 +69,8 @@
|
|
|
72
69
|
"default": "./detectPackage.js"
|
|
73
70
|
},
|
|
74
71
|
"./package.json": "./package.json",
|
|
72
|
+
"./packageInfo.cjs": "./packageInfo.cjs",
|
|
73
|
+
"./packageInfo.js": "./packageInfo.js",
|
|
75
74
|
"./packageInfo": {
|
|
76
75
|
"types": "./packageInfo.d.ts",
|
|
77
76
|
"require": "./packageInfo.cjs",
|
package/packageInfo.cjs
CHANGED
|
@@ -9,6 +9,8 @@ exports.packageInfo = void 0;
|
|
|
9
9
|
// Do not edit, auto-generated by @polkadot/dev
|
|
10
10
|
const packageInfo = {
|
|
11
11
|
name: '@polkadot/types-create',
|
|
12
|
-
|
|
12
|
+
path: typeof __dirname === 'string' ? __dirname : 'auto',
|
|
13
|
+
type: 'cjs',
|
|
14
|
+
version: '7.2.2-7'
|
|
13
15
|
};
|
|
14
16
|
exports.packageInfo = packageInfo;
|
package/packageInfo.d.ts
CHANGED
package/packageInfo.js
CHANGED
package/types.cjs
CHANGED
|
@@ -30,5 +30,6 @@ exports.TypeDefInfo = TypeDefInfo;
|
|
|
30
30
|
TypeDefInfo[TypeDefInfo["UInt"] = 17] = "UInt";
|
|
31
31
|
TypeDefInfo[TypeDefInfo["Vec"] = 18] = "Vec";
|
|
32
32
|
TypeDefInfo[TypeDefInfo["VecFixed"] = 19] = "VecFixed";
|
|
33
|
-
TypeDefInfo[TypeDefInfo["
|
|
33
|
+
TypeDefInfo[TypeDefInfo["WrapperKeepOpaque"] = 20] = "WrapperKeepOpaque";
|
|
34
|
+
TypeDefInfo[TypeDefInfo["WrapperOpaque"] = 21] = "WrapperOpaque";
|
|
34
35
|
})(TypeDefInfo || (exports.TypeDefInfo = TypeDefInfo = {}));
|
package/types.d.ts
CHANGED
package/types.js
CHANGED
|
@@ -23,5 +23,6 @@ export let TypeDefInfo;
|
|
|
23
23
|
TypeDefInfo[TypeDefInfo["UInt"] = 17] = "UInt";
|
|
24
24
|
TypeDefInfo[TypeDefInfo["Vec"] = 18] = "Vec";
|
|
25
25
|
TypeDefInfo[TypeDefInfo["VecFixed"] = 19] = "VecFixed";
|
|
26
|
-
TypeDefInfo[TypeDefInfo["
|
|
26
|
+
TypeDefInfo[TypeDefInfo["WrapperKeepOpaque"] = 20] = "WrapperKeepOpaque";
|
|
27
|
+
TypeDefInfo[TypeDefInfo["WrapperOpaque"] = 21] = "WrapperOpaque";
|
|
27
28
|
})(TypeDefInfo || (TypeDefInfo = {}));
|
package/util/encodeTypes.cjs
CHANGED
|
@@ -37,6 +37,7 @@ function encodeWithParams(CodecRegistry, typeDef, outer) {
|
|
|
37
37
|
case _types.TypeDefInfo.Option:
|
|
38
38
|
case _types.TypeDefInfo.Result:
|
|
39
39
|
case _types.TypeDefInfo.Vec:
|
|
40
|
+
case _types.TypeDefInfo.WrapperKeepOpaque:
|
|
40
41
|
case _types.TypeDefInfo.WrapperOpaque:
|
|
41
42
|
return paramsNotation(outer, sub, p => encodeTypeDef(CodecRegistry, p));
|
|
42
43
|
}
|
|
@@ -186,6 +187,7 @@ const encoders = {
|
|
|
186
187
|
(0, _util.assert)((0, _util.isNumber)(length) && !(0, _util.isUndefined)(sub) && !Array.isArray(sub), 'Unable to encode VecFixed type');
|
|
187
188
|
return `[${sub.type};${length}]`;
|
|
188
189
|
},
|
|
190
|
+
[_types.TypeDefInfo.WrapperKeepOpaque]: (CodecRegistry, typeDef) => encodeWithParams(CodecRegistry, typeDef, 'WrapperKeepOpaque'),
|
|
189
191
|
[_types.TypeDefInfo.WrapperOpaque]: (CodecRegistry, typeDef) => encodeWithParams(CodecRegistry, typeDef, 'WrapperOpaque')
|
|
190
192
|
};
|
|
191
193
|
|
package/util/encodeTypes.js
CHANGED
|
@@ -25,6 +25,7 @@ function encodeWithParams(CodecRegistry, typeDef, outer) {
|
|
|
25
25
|
case TypeDefInfo.Option:
|
|
26
26
|
case TypeDefInfo.Result:
|
|
27
27
|
case TypeDefInfo.Vec:
|
|
28
|
+
case TypeDefInfo.WrapperKeepOpaque:
|
|
28
29
|
case TypeDefInfo.WrapperOpaque:
|
|
29
30
|
return paramsNotation(outer, sub, p => encodeTypeDef(CodecRegistry, p));
|
|
30
31
|
}
|
|
@@ -139,6 +140,7 @@ const encoders = {
|
|
|
139
140
|
assert(isNumber(length) && !isUndefined(sub) && !Array.isArray(sub), 'Unable to encode VecFixed type');
|
|
140
141
|
return `[${sub.type};${length}]`;
|
|
141
142
|
},
|
|
143
|
+
[TypeDefInfo.WrapperKeepOpaque]: (CodecRegistry, typeDef) => encodeWithParams(CodecRegistry, typeDef, 'WrapperKeepOpaque'),
|
|
142
144
|
[TypeDefInfo.WrapperOpaque]: (CodecRegistry, typeDef) => encodeWithParams(CodecRegistry, typeDef, 'WrapperOpaque')
|
|
143
145
|
};
|
|
144
146
|
|
package/util/getTypeDef.cjs
CHANGED
|
@@ -187,7 +187,7 @@ function hasWrapper(type, _ref5) {
|
|
|
187
187
|
const nestedExtraction = [['[', ']', _types.TypeDefInfo.VecFixed, _decodeFixedVec], ['{', '}', _types.TypeDefInfo.Struct, _decodeStruct], ['(', ')', _types.TypeDefInfo.Tuple, _decodeTuple], // the inner for these are the same as tuple, multiple values
|
|
188
188
|
['BTreeMap<', '>', _types.TypeDefInfo.BTreeMap, _decodeTuple], ['HashMap<', '>', _types.TypeDefInfo.HashMap, _decodeTuple], ['Int<', '>', _types.TypeDefInfo.Int, _decodeInt], // Not sure about these, have a specific implementation?
|
|
189
189
|
['Range<', '>', _types.TypeDefInfo.Tuple, _decodeRange], ['RangeInclusive<', '>', _types.TypeDefInfo.Tuple, _decodeRange], ['Result<', '>', _types.TypeDefInfo.Result, _decodeTuple], ['UInt<', '>', _types.TypeDefInfo.UInt, _decodeUInt], ['DoNotConstruct<', '>', _types.TypeDefInfo.DoNotConstruct, _decodeDoNotConstruct]];
|
|
190
|
-
const wrappedExtraction = [['BTreeSet<', '>', _types.TypeDefInfo.BTreeSet], ['Compact<', '>', _types.TypeDefInfo.Compact], ['Linkage<', '>', _types.TypeDefInfo.Linkage], ['Option<', '>', _types.TypeDefInfo.Option], ['Vec<', '>', _types.TypeDefInfo.Vec], ['WrapperOpaque<', '>', _types.TypeDefInfo.WrapperOpaque]];
|
|
190
|
+
const wrappedExtraction = [['BTreeSet<', '>', _types.TypeDefInfo.BTreeSet], ['Compact<', '>', _types.TypeDefInfo.Compact], ['Linkage<', '>', _types.TypeDefInfo.Linkage], ['Option<', '>', _types.TypeDefInfo.Option], ['Vec<', '>', _types.TypeDefInfo.Vec], ['WrapperKeepOpaque<', '>', _types.TypeDefInfo.WrapperKeepOpaque], ['WrapperOpaque<', '>', _types.TypeDefInfo.WrapperOpaque]];
|
|
191
191
|
|
|
192
192
|
function extractSubType(type, _ref6) {
|
|
193
193
|
let [start, end] = _ref6;
|
package/util/getTypeDef.js
CHANGED
|
@@ -163,7 +163,7 @@ function hasWrapper(type, [start, end]) {
|
|
|
163
163
|
const nestedExtraction = [['[', ']', TypeDefInfo.VecFixed, _decodeFixedVec], ['{', '}', TypeDefInfo.Struct, _decodeStruct], ['(', ')', TypeDefInfo.Tuple, _decodeTuple], // the inner for these are the same as tuple, multiple values
|
|
164
164
|
['BTreeMap<', '>', TypeDefInfo.BTreeMap, _decodeTuple], ['HashMap<', '>', TypeDefInfo.HashMap, _decodeTuple], ['Int<', '>', TypeDefInfo.Int, _decodeInt], // Not sure about these, have a specific implementation?
|
|
165
165
|
['Range<', '>', TypeDefInfo.Tuple, _decodeRange], ['RangeInclusive<', '>', TypeDefInfo.Tuple, _decodeRange], ['Result<', '>', TypeDefInfo.Result, _decodeTuple], ['UInt<', '>', TypeDefInfo.UInt, _decodeUInt], ['DoNotConstruct<', '>', TypeDefInfo.DoNotConstruct, _decodeDoNotConstruct]];
|
|
166
|
-
const wrappedExtraction = [['BTreeSet<', '>', TypeDefInfo.BTreeSet], ['Compact<', '>', TypeDefInfo.Compact], ['Linkage<', '>', TypeDefInfo.Linkage], ['Option<', '>', TypeDefInfo.Option], ['Vec<', '>', TypeDefInfo.Vec], ['WrapperOpaque<', '>', TypeDefInfo.WrapperOpaque]];
|
|
166
|
+
const wrappedExtraction = [['BTreeSet<', '>', TypeDefInfo.BTreeSet], ['Compact<', '>', TypeDefInfo.Compact], ['Linkage<', '>', TypeDefInfo.Linkage], ['Option<', '>', TypeDefInfo.Option], ['Vec<', '>', TypeDefInfo.Vec], ['WrapperKeepOpaque<', '>', TypeDefInfo.WrapperKeepOpaque], ['WrapperOpaque<', '>', TypeDefInfo.WrapperOpaque]];
|
|
167
167
|
|
|
168
168
|
function extractSubType(type, [start, end]) {
|
|
169
169
|
return type.substr(start.length, type.length - start.length - end.length);
|
package/cjs/dirname.d.ts
DELETED
package/cjs/dirname.js
DELETED
package/cjs/package.json
DELETED