@polkadot/types-codec 10.1.2 → 10.1.4
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/abstract/Array.js +1 -1
- package/abstract/Base.js +1 -1
- package/abstract/Int.d.ts +2 -2
- package/abstract/Int.js +3 -5
- package/abstract/Object.js +1 -1
- package/abstract/index.js +1 -1
- package/base/Compact.d.ts +1 -1
- package/base/Compact.js +2 -3
- package/base/DoNotConstruct.js +1 -1
- package/base/Enum.js +1 -1
- package/base/Int.js +1 -1
- package/base/Null.d.ts +1 -1
- package/base/Null.js +2 -3
- package/base/Option.js +1 -1
- package/base/Result.js +1 -1
- package/base/Tuple.js +1 -1
- package/base/UInt.js +1 -1
- package/base/Vec.d.ts +1 -1
- package/base/Vec.js +6 -6
- package/base/VecAny.js +1 -1
- package/base/VecFixed.js +1 -1
- package/base/index.js +1 -1
- package/bundle.js +1 -1
- package/cjs/abstract/Array.js +1 -1
- package/cjs/abstract/Base.js +1 -1
- package/cjs/abstract/Int.js +3 -5
- package/cjs/abstract/Object.js +1 -1
- package/cjs/abstract/index.js +1 -1
- package/cjs/base/Compact.js +2 -3
- package/cjs/base/DoNotConstruct.js +1 -1
- package/cjs/base/Enum.js +1 -1
- package/cjs/base/Int.js +1 -1
- package/cjs/base/Null.js +2 -3
- package/cjs/base/Option.js +1 -1
- package/cjs/base/Result.js +1 -1
- package/cjs/base/Tuple.js +1 -1
- package/cjs/base/UInt.js +1 -1
- package/cjs/base/Vec.js +6 -6
- package/cjs/base/VecAny.js +1 -1
- package/cjs/base/VecFixed.js +1 -1
- package/cjs/base/index.js +1 -1
- package/cjs/bundle.js +1 -1
- package/cjs/detectOther.js +1 -1
- package/cjs/detectPackage.js +1 -1
- package/cjs/extended/BTreeMap.js +1 -1
- package/cjs/extended/BTreeSet.js +1 -1
- package/cjs/extended/BitVec.js +1 -1
- package/cjs/extended/Bytes.js +1 -1
- package/cjs/extended/HashMap.js +1 -1
- package/cjs/extended/Linkage.js +1 -1
- package/cjs/extended/Map.js +1 -1
- package/cjs/extended/OptionBool.js +1 -1
- package/cjs/extended/Range.js +1 -1
- package/cjs/extended/RangeInclusive.js +1 -1
- package/cjs/extended/Type.js +1 -1
- package/cjs/extended/U8aFixed.js +1 -1
- package/cjs/extended/WrapperKeepOpaque.js +1 -1
- package/cjs/extended/WrapperOpaque.js +1 -1
- package/cjs/extended/index.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/native/Bool.js +2 -3
- package/cjs/native/Date.js +2 -3
- package/cjs/native/Float.js +1 -1
- package/cjs/native/Json.js +2 -3
- package/cjs/native/Raw.js +2 -3
- package/cjs/native/Set.js +2 -3
- package/cjs/native/Struct.data.js +1 -1
- package/cjs/native/Struct.js +2 -2
- package/cjs/native/Text.js +1 -1
- package/cjs/native/index.js +1 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/primitive/F32.js +1 -1
- package/cjs/primitive/F64.js +1 -1
- package/cjs/primitive/I128.js +1 -1
- package/cjs/primitive/I16.js +1 -1
- package/cjs/primitive/I256.js +1 -1
- package/cjs/primitive/I32.js +1 -1
- package/cjs/primitive/I64.js +1 -1
- package/cjs/primitive/I8.js +1 -1
- package/cjs/primitive/U128.js +1 -1
- package/cjs/primitive/U16.js +1 -1
- package/cjs/primitive/U256.js +1 -1
- package/cjs/primitive/U32.js +1 -1
- package/cjs/primitive/U64.js +1 -1
- package/cjs/primitive/U8.js +1 -1
- package/cjs/primitive/USize.js +1 -1
- package/cjs/primitive/index.js +1 -1
- package/cjs/types/codec.js +1 -1
- package/cjs/types/helpers.js +1 -1
- package/cjs/types/index.js +1 -1
- package/cjs/types/interfaces.js +1 -1
- package/cjs/types/registry.js +1 -1
- package/cjs/utils/compareArray.js +1 -1
- package/cjs/utils/compareMap.js +1 -1
- package/cjs/utils/compareSet.js +1 -1
- package/cjs/utils/decodeU8a.js +2 -2
- package/cjs/utils/index.js +1 -1
- package/cjs/utils/mapToTypeMap.js +1 -1
- package/cjs/utils/sanitize.js +1 -1
- package/cjs/utils/sortValues.js +1 -1
- package/cjs/utils/typeToConstructor.js +1 -1
- package/cjs/utils/typesToMap.js +1 -1
- package/cjs/utils/util.js +1 -1
- package/detectOther.js +1 -1
- package/detectPackage.js +1 -1
- package/extended/BTreeMap.js +1 -1
- package/extended/BTreeSet.js +1 -1
- package/extended/BitVec.js +1 -1
- package/extended/Bytes.js +1 -1
- package/extended/HashMap.js +1 -1
- package/extended/Linkage.js +1 -1
- package/extended/Map.js +1 -1
- package/extended/OptionBool.js +1 -1
- package/extended/Range.js +1 -1
- package/extended/RangeInclusive.js +1 -1
- package/extended/Type.js +1 -1
- package/extended/U8aFixed.js +1 -1
- package/extended/WrapperKeepOpaque.js +1 -1
- package/extended/WrapperOpaque.js +1 -1
- package/extended/index.js +1 -1
- package/index.js +1 -1
- package/native/Bool.d.ts +1 -1
- package/native/Bool.js +2 -3
- package/native/Date.d.ts +1 -1
- package/native/Date.js +2 -3
- package/native/Float.js +1 -1
- package/native/Json.d.ts +1 -1
- package/native/Json.js +2 -3
- package/native/Raw.d.ts +1 -1
- package/native/Raw.js +2 -3
- package/native/Set.d.ts +1 -1
- package/native/Set.js +2 -3
- package/native/Struct.data.js +1 -1
- package/native/Struct.js +2 -2
- package/native/Text.js +1 -1
- package/native/index.js +1 -1
- package/package.json +4 -6
- package/packageInfo.js +1 -1
- package/primitive/F32.js +1 -1
- package/primitive/F64.js +1 -1
- package/primitive/I128.js +1 -1
- package/primitive/I16.js +1 -1
- package/primitive/I256.js +1 -1
- package/primitive/I32.js +1 -1
- package/primitive/I64.js +1 -1
- package/primitive/I8.js +1 -1
- package/primitive/U128.js +1 -1
- package/primitive/U16.js +1 -1
- package/primitive/U256.js +1 -1
- package/primitive/U32.js +1 -1
- package/primitive/U64.js +1 -1
- package/primitive/U8.js +1 -1
- package/primitive/USize.js +1 -1
- package/primitive/index.js +1 -1
- package/types/codec.js +1 -1
- package/types/helpers.js +1 -1
- package/types/index.js +1 -1
- package/types/interfaces.js +1 -1
- package/types/registry.js +1 -1
- package/utils/compareArray.js +1 -1
- package/utils/compareMap.js +1 -1
- package/utils/compareSet.js +1 -1
- package/utils/decodeU8a.js +2 -2
- package/utils/index.js +1 -1
- package/utils/mapToTypeMap.js +1 -1
- package/utils/sanitize.js +1 -1
- package/utils/sortValues.js +1 -1
- package/utils/typeToConstructor.js +1 -1
- package/utils/typesToMap.js +1 -1
- package/utils/util.js +1 -1
package/cjs/primitive/U32.js
CHANGED
package/cjs/primitive/U64.js
CHANGED
package/cjs/primitive/U8.js
CHANGED
package/cjs/primitive/USize.js
CHANGED
|
@@ -15,4 +15,4 @@ class usize extends U32_js_1.u32 {
|
|
|
15
15
|
throw new Error('The `usize` type should not be used. Since it is platform-specific, it creates incompatibilities between native (generally u64) and WASM (always u32) code. Use one of the `u32` or `u64` types explicitly.');
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
exports.usize = usize;
|
|
18
|
+
exports.usize = usize;
|
package/cjs/primitive/index.js
CHANGED
|
@@ -45,4 +45,4 @@ Object.defineProperty(exports, "u256", { enumerable: true, get: function () { re
|
|
|
45
45
|
Object.defineProperty(exports, "U256", { enumerable: true, get: function () { return U256_js_1.u256; } });
|
|
46
46
|
var USize_js_1 = require("./USize.js");
|
|
47
47
|
Object.defineProperty(exports, "usize", { enumerable: true, get: function () { return USize_js_1.usize; } });
|
|
48
|
-
Object.defineProperty(exports, "USize", { enumerable: true, get: function () { return USize_js_1.usize; } });
|
|
48
|
+
Object.defineProperty(exports, "USize", { enumerable: true, get: function () { return USize_js_1.usize; } });
|
package/cjs/types/codec.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/types/helpers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/types/index.js
CHANGED
|
@@ -4,4 +4,4 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
tslib_1.__exportStar(require("./codec.js"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./helpers.js"), exports);
|
|
6
6
|
tslib_1.__exportStar(require("./interfaces.js"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./registry.js"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./registry.js"), exports);
|
package/cjs/types/interfaces.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/types/registry.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/cjs/utils/compareMap.js
CHANGED
package/cjs/utils/compareSet.js
CHANGED
package/cjs/utils/decodeU8a.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.decodeU8aVec = exports.decodeU8aStruct = exports.decodeU8a = void 0;
|
|
4
4
|
const util_1 = require("@polkadot/util");
|
|
5
5
|
/** @internal */
|
|
6
|
-
function formatFailure(registry, fn,
|
|
6
|
+
function formatFailure(registry, fn, _result, { message }, u8a, i, count, Type, key) {
|
|
7
7
|
let type = '';
|
|
8
8
|
try {
|
|
9
9
|
type = `: ${new Type(registry).toRawType()}`;
|
|
@@ -91,4 +91,4 @@ function decodeU8aVec(registry, result, u8a, startAt, Type) {
|
|
|
91
91
|
}
|
|
92
92
|
return [offset, offset - startAt];
|
|
93
93
|
}
|
|
94
|
-
exports.decodeU8aVec = decodeU8aVec;
|
|
94
|
+
exports.decodeU8aVec = decodeU8aVec;
|
package/cjs/utils/index.js
CHANGED
|
@@ -22,4 +22,4 @@ Object.defineProperty(exports, "sortAsc", { enumerable: true, get: function () {
|
|
|
22
22
|
Object.defineProperty(exports, "sortSet", { enumerable: true, get: function () { return sortValues_js_1.sortSet; } });
|
|
23
23
|
Object.defineProperty(exports, "sortMap", { enumerable: true, get: function () { return sortValues_js_1.sortMap; } });
|
|
24
24
|
var typesToMap_js_1 = require("./typesToMap.js");
|
|
25
|
-
Object.defineProperty(exports, "typesToMap", { enumerable: true, get: function () { return typesToMap_js_1.typesToMap; } });
|
|
25
|
+
Object.defineProperty(exports, "typesToMap", { enumerable: true, get: function () { return typesToMap_js_1.typesToMap; } });
|
package/cjs/utils/sanitize.js
CHANGED
package/cjs/utils/sortValues.js
CHANGED
package/cjs/utils/typesToMap.js
CHANGED
package/cjs/utils/util.js
CHANGED
package/detectOther.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default [];
|
|
1
|
+
export default [];
|
package/detectPackage.js
CHANGED
package/extended/BTreeMap.js
CHANGED
package/extended/BTreeSet.js
CHANGED
package/extended/BitVec.js
CHANGED
|
@@ -78,4 +78,4 @@ export class BitVec extends Raw {
|
|
|
78
78
|
: u8aConcatStrict([compactToU8a(__classPrivateFieldGet(this, _BitVec_decodedLength, "f")), bitVec]);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
_BitVec_decodedLength = new WeakMap(), _BitVec_isMsb = new WeakMap();
|
|
81
|
+
_BitVec_decodedLength = new WeakMap(), _BitVec_isMsb = new WeakMap();
|
package/extended/Bytes.js
CHANGED
package/extended/HashMap.js
CHANGED
package/extended/Linkage.js
CHANGED
package/extended/Map.js
CHANGED
|
@@ -196,4 +196,4 @@ export class CodecMap extends Map {
|
|
|
196
196
|
return u8aConcatStrict(encoded);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
_CodecMap_KeyClass = new WeakMap(), _CodecMap_ValClass = new WeakMap(), _CodecMap_type = new WeakMap();
|
|
199
|
+
_CodecMap_KeyClass = new WeakMap(), _CodecMap_ValClass = new WeakMap(), _CodecMap_type = new WeakMap();
|
package/extended/OptionBool.js
CHANGED
package/extended/Range.js
CHANGED
package/extended/Type.js
CHANGED
package/extended/U8aFixed.js
CHANGED
|
@@ -99,4 +99,4 @@ export class WrapperKeepOpaque extends Bytes {
|
|
|
99
99
|
return __classPrivateFieldGet(this, _WrapperKeepOpaque_decoded, "f");
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
_WrapperKeepOpaque_Type = new WeakMap(), _WrapperKeepOpaque_decoded = new WeakMap(), _WrapperKeepOpaque_opaqueName = new WeakMap();
|
|
102
|
+
_WrapperKeepOpaque_Type = new WeakMap(), _WrapperKeepOpaque_decoded = new WeakMap(), _WrapperKeepOpaque_opaqueName = new WeakMap();
|
package/extended/index.js
CHANGED
|
@@ -11,4 +11,4 @@ export { RangeInclusive } from './RangeInclusive.js';
|
|
|
11
11
|
export { Type } from './Type.js';
|
|
12
12
|
export { U8aFixed } from './U8aFixed.js';
|
|
13
13
|
export { WrapperKeepOpaque } from './WrapperKeepOpaque.js';
|
|
14
|
-
export { WrapperOpaque } from './WrapperOpaque.js';
|
|
14
|
+
export { WrapperOpaque } from './WrapperOpaque.js';
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './detectPackage.js';
|
|
2
|
-
export * from './bundle.js';
|
|
2
|
+
export * from './bundle.js';
|
package/native/Bool.d.ts
CHANGED
|
@@ -68,5 +68,5 @@ export declare class bool extends Boolean implements Codec {
|
|
|
68
68
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
69
69
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
70
70
|
*/
|
|
71
|
-
toU8a(
|
|
71
|
+
toU8a(_isBare?: boolean): Uint8Array;
|
|
72
72
|
}
|
package/native/Bool.js
CHANGED
|
@@ -101,8 +101,7 @@ export class bool extends Boolean {
|
|
|
101
101
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
102
102
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
103
103
|
*/
|
|
104
|
-
|
|
105
|
-
toU8a(isBare) {
|
|
104
|
+
toU8a(_isBare) {
|
|
106
105
|
return new Uint8Array([this.valueOf() ? 1 : 0]);
|
|
107
106
|
}
|
|
108
|
-
}
|
|
107
|
+
}
|
package/native/Date.d.ts
CHANGED
|
@@ -82,5 +82,5 @@ export declare class CodecDate extends Date implements INumber {
|
|
|
82
82
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
83
83
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
84
84
|
*/
|
|
85
|
-
toU8a(
|
|
85
|
+
toU8a(_isBare?: boolean): Uint8Array;
|
|
86
86
|
}
|
package/native/Date.js
CHANGED
|
@@ -132,8 +132,7 @@ export class CodecDate extends Date {
|
|
|
132
132
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
133
133
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
134
134
|
*/
|
|
135
|
-
|
|
136
|
-
toU8a(isBare) {
|
|
135
|
+
toU8a(_isBare) {
|
|
137
136
|
return bnToU8a(this.toNumber(), U8A_OPTS);
|
|
138
137
|
}
|
|
139
|
-
}
|
|
138
|
+
}
|
package/native/Float.js
CHANGED
package/native/Json.d.ts
CHANGED
package/native/Json.js
CHANGED
|
@@ -107,8 +107,7 @@ export class Json extends Map {
|
|
|
107
107
|
/**
|
|
108
108
|
* @description Unimplemented, will throw
|
|
109
109
|
*/
|
|
110
|
-
|
|
111
|
-
toU8a(isBare) {
|
|
110
|
+
toU8a(_isBare) {
|
|
112
111
|
throw new Error('Unimplemented');
|
|
113
112
|
}
|
|
114
|
-
}
|
|
113
|
+
}
|
package/native/Raw.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ export declare class Raw extends Uint8Array implements IU8a {
|
|
|
80
80
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
81
81
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
82
82
|
*/
|
|
83
|
-
toU8a(
|
|
83
|
+
toU8a(_isBare?: boolean): Uint8Array;
|
|
84
84
|
/**
|
|
85
85
|
* @description Returns the wrapped data as a UTF-8 string
|
|
86
86
|
*/
|
package/native/Raw.js
CHANGED
|
@@ -122,8 +122,7 @@ export class Raw extends Uint8Array {
|
|
|
122
122
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
123
123
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
124
124
|
*/
|
|
125
|
-
|
|
126
|
-
toU8a(isBare) {
|
|
125
|
+
toU8a(_isBare) {
|
|
127
126
|
return Uint8Array.from(this);
|
|
128
127
|
}
|
|
129
128
|
/**
|
|
@@ -135,4 +134,4 @@ export class Raw extends Uint8Array {
|
|
|
135
134
|
}
|
|
136
135
|
return u8aToString(this);
|
|
137
136
|
}
|
|
138
|
-
}
|
|
137
|
+
}
|
package/native/Set.d.ts
CHANGED
|
@@ -81,6 +81,6 @@ export declare class CodecSet extends Set<string> implements ISet<string> {
|
|
|
81
81
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
82
82
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
83
83
|
*/
|
|
84
|
-
toU8a(
|
|
84
|
+
toU8a(_isBare?: boolean): Uint8Array;
|
|
85
85
|
}
|
|
86
86
|
export {};
|
package/native/Set.js
CHANGED
|
@@ -205,12 +205,11 @@ export class CodecSet extends Set {
|
|
|
205
205
|
* @description Encodes the value as a Uint8Array as per the SCALE specifications
|
|
206
206
|
* @param isBare true when the value has none of the type-specific prefixes (internal)
|
|
207
207
|
*/
|
|
208
|
-
|
|
209
|
-
toU8a(isBare) {
|
|
208
|
+
toU8a(_isBare) {
|
|
210
209
|
return bnToU8a(this.valueEncoded, {
|
|
211
210
|
bitLength: __classPrivateFieldGet(this, _CodecSet_byteLength, "f") * 8,
|
|
212
211
|
isLe: true
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
|
-
_CodecSet_allowed = new WeakMap(), _CodecSet_byteLength = new WeakMap();
|
|
215
|
+
_CodecSet_allowed = new WeakMap(), _CodecSet_byteLength = new WeakMap();
|