@polkadot/types-codec 7.7.2-1 → 7.7.2-10
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/AbstractArray.cjs +27 -1
- package/abstract/AbstractArray.d.ts +7 -1
- package/abstract/AbstractArray.js +27 -1
- package/abstract/AbstractInt.cjs +11 -0
- package/abstract/AbstractInt.d.ts +5 -1
- package/abstract/AbstractInt.js +11 -0
- package/base/Base.cjs +8 -0
- package/base/Base.d.ts +5 -1
- package/base/Base.js +8 -0
- package/base/Compact.cjs +11 -0
- package/base/Compact.d.ts +5 -1
- package/base/Compact.js +11 -0
- package/base/DoNotConstruct.cjs +4 -0
- package/base/DoNotConstruct.d.ts +2 -1
- package/base/DoNotConstruct.js +4 -0
- package/base/Enum.cjs +11 -0
- package/base/Enum.d.ts +5 -1
- package/base/Enum.js +11 -0
- package/base/Null.cjs +11 -0
- package/base/Null.d.ts +5 -1
- package/base/Null.js +11 -0
- package/base/Option.cjs +11 -0
- package/base/Option.d.ts +5 -1
- package/base/Option.js +11 -0
- package/base/Tuple.cjs +12 -7
- package/base/Tuple.d.ts +5 -1
- package/base/Tuple.js +12 -7
- package/base/VecFixed.cjs +12 -6
- package/base/VecFixed.d.ts +5 -1
- package/base/VecFixed.js +12 -6
- package/extended/BTreeSet.cjs +17 -0
- package/extended/BTreeSet.d.ts +5 -1
- package/extended/BTreeSet.js +17 -0
- package/extended/BitVec.cjs +14 -0
- package/extended/BitVec.d.ts +5 -1
- package/extended/BitVec.js +14 -0
- package/extended/Bytes.cjs +14 -0
- package/extended/Bytes.d.ts +5 -1
- package/extended/Bytes.js +14 -0
- package/extended/Map.cjs +19 -1
- package/extended/Map.d.ts +5 -1
- package/extended/Map.js +19 -1
- package/extended/WrapperKeepOpaque.cjs +14 -0
- package/extended/WrapperKeepOpaque.d.ts +5 -1
- package/extended/WrapperKeepOpaque.js +15 -1
- package/native/Bool.cjs +11 -0
- package/native/Bool.d.ts +5 -1
- package/native/Bool.js +11 -0
- package/native/Date.cjs +14 -3
- package/native/Date.d.ts +7 -3
- package/native/Date.js +14 -3
- package/native/Json.cjs +8 -0
- package/native/Json.d.ts +5 -1
- package/native/Json.js +8 -0
- package/native/Raw.cjs +11 -0
- package/native/Raw.d.ts +5 -1
- package/native/Raw.js +11 -0
- package/native/Set.cjs +11 -0
- package/native/Set.d.ts +5 -1
- package/native/Set.js +11 -0
- package/native/Struct.cjs +19 -0
- package/native/Struct.d.ts +5 -1
- package/native/Struct.js +19 -0
- package/native/Text.cjs +15 -0
- package/native/Text.d.ts +5 -1
- package/native/Text.js +16 -1
- package/package.json +3 -3
- package/packageInfo.cjs +1 -1
- package/packageInfo.js +1 -1
- package/types/codec.d.ts +9 -0
package/extended/BTreeSet.cjs
CHANGED
|
@@ -150,6 +150,23 @@ class BTreeSet extends Set {
|
|
|
150
150
|
eq(other) {
|
|
151
151
|
return (0, _index.compareSet)(this, other);
|
|
152
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
inspect() {
|
|
159
|
+
const inner = new Array();
|
|
160
|
+
|
|
161
|
+
for (const v of this.values()) {
|
|
162
|
+
inner.push(v.inspect());
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return {
|
|
166
|
+
inner,
|
|
167
|
+
value: (0, _util.compactToU8a)(this.size)
|
|
168
|
+
};
|
|
169
|
+
}
|
|
153
170
|
/**
|
|
154
171
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
155
172
|
*/
|
package/extended/BTreeSet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, Codec, CodecClass, ISet, IU8a, Registry } from '../types';
|
|
2
|
+
import type { AnyJson, Codec, CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
|
|
3
3
|
export declare class BTreeSet<V extends Codec = Codec> extends Set<V> implements ISet<V> {
|
|
4
4
|
#private;
|
|
5
5
|
readonly registry: Registry;
|
|
@@ -27,6 +27,10 @@ export declare class BTreeSet<V extends Codec = Codec> extends Set<V> implements
|
|
|
27
27
|
* @description Compares the value of the input to see if there is a match
|
|
28
28
|
*/
|
|
29
29
|
eq(other?: unknown): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
32
|
+
*/
|
|
33
|
+
inspect(): Inspect;
|
|
30
34
|
/**
|
|
31
35
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
32
36
|
*/
|
package/extended/BTreeSet.js
CHANGED
|
@@ -128,6 +128,23 @@ export class BTreeSet extends Set {
|
|
|
128
128
|
eq(other) {
|
|
129
129
|
return compareSet(this, other);
|
|
130
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
inspect() {
|
|
137
|
+
const inner = new Array();
|
|
138
|
+
|
|
139
|
+
for (const v of this.values()) {
|
|
140
|
+
inner.push(v.inspect());
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return {
|
|
144
|
+
inner,
|
|
145
|
+
value: compactToU8a(this.size)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
131
148
|
/**
|
|
132
149
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
133
150
|
*/
|
package/extended/BitVec.cjs
CHANGED
|
@@ -69,6 +69,20 @@ class BitVec extends _Raw.Raw {
|
|
|
69
69
|
get encodedLength() {
|
|
70
70
|
return this.length + (0, _util.compactToU8a)((0, _classPrivateFieldLooseBase2.default)(this, _decodedLength)[_decodedLength]).length;
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
inspect() {
|
|
78
|
+
return {
|
|
79
|
+
inner: [{
|
|
80
|
+
inner: [],
|
|
81
|
+
value: super.toU8a()
|
|
82
|
+
}],
|
|
83
|
+
value: (0, _util.compactToU8a)((0, _classPrivateFieldLooseBase2.default)(this, _decodedLength)[_decodedLength])
|
|
84
|
+
};
|
|
85
|
+
}
|
|
72
86
|
|
|
73
87
|
toHuman() {
|
|
74
88
|
return `0b${[...this.toU8a(true)].map(d => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
|
package/extended/BitVec.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyU8a, Registry } from '../types';
|
|
1
|
+
import type { AnyU8a, Inspect, Registry } from '../types';
|
|
2
2
|
import { Raw } from '../native/Raw';
|
|
3
3
|
/**
|
|
4
4
|
* @name BitVec
|
|
@@ -13,6 +13,10 @@ export declare class BitVec extends Raw {
|
|
|
13
13
|
* @description The length of the value when encoded as a Uint8Array
|
|
14
14
|
*/
|
|
15
15
|
get encodedLength(): number;
|
|
16
|
+
/**
|
|
17
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
18
|
+
*/
|
|
19
|
+
inspect(): Inspect;
|
|
16
20
|
toHuman(): string;
|
|
17
21
|
/**
|
|
18
22
|
* @description Returns the base runtime type name for this instance
|
package/extended/BitVec.js
CHANGED
|
@@ -50,6 +50,20 @@ export class BitVec extends Raw {
|
|
|
50
50
|
get encodedLength() {
|
|
51
51
|
return this.length + compactToU8a(this.#decodedLength).length;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
inspect() {
|
|
59
|
+
return {
|
|
60
|
+
inner: [{
|
|
61
|
+
inner: [],
|
|
62
|
+
value: super.toU8a()
|
|
63
|
+
}],
|
|
64
|
+
value: compactToU8a(this.#decodedLength)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
53
67
|
|
|
54
68
|
toHuman() {
|
|
55
69
|
return `0b${[...this.toU8a(true)].map(d => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
|
package/extended/Bytes.cjs
CHANGED
|
@@ -63,6 +63,20 @@ class Bytes extends _Raw.Raw {
|
|
|
63
63
|
get encodedLength() {
|
|
64
64
|
return this.length + (0, _util.compactToU8a)(this.length).length;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
inspect() {
|
|
72
|
+
return {
|
|
73
|
+
inner: [{
|
|
74
|
+
inner: [],
|
|
75
|
+
value: super.toU8a()
|
|
76
|
+
}],
|
|
77
|
+
value: (0, _util.compactToU8a)(this.length)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
66
80
|
/**
|
|
67
81
|
* @description Returns the base runtime type name for this instance
|
|
68
82
|
*/
|
package/extended/Bytes.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyU8a, Registry } from '../types';
|
|
1
|
+
import type { AnyU8a, Inspect, Registry } from '../types';
|
|
2
2
|
import { Raw } from '../native/Raw';
|
|
3
3
|
/**
|
|
4
4
|
* @name Bytes
|
|
@@ -13,6 +13,10 @@ export declare class Bytes extends Raw {
|
|
|
13
13
|
* @description The length of the value when encoded as a Uint8Array
|
|
14
14
|
*/
|
|
15
15
|
get encodedLength(): number;
|
|
16
|
+
/**
|
|
17
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
18
|
+
*/
|
|
19
|
+
inspect(): Inspect;
|
|
16
20
|
/**
|
|
17
21
|
* @description Returns the base runtime type name for this instance
|
|
18
22
|
*/
|
package/extended/Bytes.js
CHANGED
|
@@ -54,6 +54,20 @@ export class Bytes extends Raw {
|
|
|
54
54
|
get encodedLength() {
|
|
55
55
|
return this.length + compactToU8a(this.length).length;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
inspect() {
|
|
63
|
+
return {
|
|
64
|
+
inner: [{
|
|
65
|
+
inner: [],
|
|
66
|
+
value: super.toU8a()
|
|
67
|
+
}],
|
|
68
|
+
value: compactToU8a(this.length)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
57
71
|
/**
|
|
58
72
|
* @description Returns the base runtime type name for this instance
|
|
59
73
|
*/
|
package/extended/Map.cjs
CHANGED
|
@@ -138,7 +138,7 @@ class CodecMap extends Map {
|
|
|
138
138
|
let len = (0, _util.compactToU8a)(this.size).length;
|
|
139
139
|
|
|
140
140
|
for (const [k, v] of this.entries()) {
|
|
141
|
-
len +=
|
|
141
|
+
len += k.encodedLength + v.encodedLength;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
return len;
|
|
@@ -167,6 +167,24 @@ class CodecMap extends Map {
|
|
|
167
167
|
eq(other) {
|
|
168
168
|
return (0, _index.compareMap)(this, other);
|
|
169
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
inspect() {
|
|
176
|
+
const inner = new Array();
|
|
177
|
+
|
|
178
|
+
for (const [k, v] of this.entries()) {
|
|
179
|
+
inner.push(k.inspect());
|
|
180
|
+
inner.push(v.inspect());
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
inner,
|
|
185
|
+
value: (0, _util.compactToU8a)(this.size)
|
|
186
|
+
};
|
|
187
|
+
}
|
|
170
188
|
/**
|
|
171
189
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
172
190
|
*/
|
package/extended/Map.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, Codec, CodecClass, IMap, IU8a, Registry } from '../types';
|
|
2
|
+
import type { AnyJson, Codec, CodecClass, IMap, Inspect, IU8a, Registry } from '../types';
|
|
3
3
|
export declare class CodecMap<K extends Codec = Codec, V extends Codec = Codec> extends Map<K, V> implements IMap<K, V> {
|
|
4
4
|
#private;
|
|
5
5
|
readonly registry: Registry;
|
|
@@ -22,6 +22,10 @@ export declare class CodecMap<K extends Codec = Codec, V extends Codec = Codec>
|
|
|
22
22
|
* @description Compares the value of the input to see if there is a match
|
|
23
23
|
*/
|
|
24
24
|
eq(other?: unknown): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
27
|
+
*/
|
|
28
|
+
inspect(): Inspect;
|
|
25
29
|
/**
|
|
26
30
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
27
31
|
*/
|
package/extended/Map.js
CHANGED
|
@@ -102,7 +102,7 @@ export class CodecMap extends Map {
|
|
|
102
102
|
let len = compactToU8a(this.size).length;
|
|
103
103
|
|
|
104
104
|
for (const [k, v] of this.entries()) {
|
|
105
|
-
len +=
|
|
105
|
+
len += k.encodedLength + v.encodedLength;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
return len;
|
|
@@ -131,6 +131,24 @@ export class CodecMap extends Map {
|
|
|
131
131
|
eq(other) {
|
|
132
132
|
return compareMap(this, other);
|
|
133
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
136
|
+
*/
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
inspect() {
|
|
140
|
+
const inner = new Array();
|
|
141
|
+
|
|
142
|
+
for (const [k, v] of this.entries()) {
|
|
143
|
+
inner.push(k.inspect());
|
|
144
|
+
inner.push(v.inspect());
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
inner,
|
|
149
|
+
value: compactToU8a(this.size)
|
|
150
|
+
};
|
|
151
|
+
}
|
|
134
152
|
/**
|
|
135
153
|
* @description Returns a hex string representation of the value. isLe returns a LE (number-only) representation
|
|
136
154
|
*/
|
|
@@ -81,6 +81,20 @@ class WrapperKeepOpaque extends _Bytes.Bytes {
|
|
|
81
81
|
get isDecoded() {
|
|
82
82
|
return !!(0, _classPrivateFieldLooseBase2.default)(this, _decoded)[_decoded];
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
inspect() {
|
|
90
|
+
return {
|
|
91
|
+
inner: (0, _classPrivateFieldLooseBase2.default)(this, _decoded)[_decoded] ? [(0, _classPrivateFieldLooseBase2.default)(this, _decoded)[_decoded].inspect()] : [{
|
|
92
|
+
inner: [],
|
|
93
|
+
value: this.toU8a(true)
|
|
94
|
+
}],
|
|
95
|
+
value: (0, _util.compactToU8a)(this.length)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
84
98
|
/**
|
|
85
99
|
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
86
100
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyJson, Codec, CodecClass, Registry } from '../types';
|
|
1
|
+
import type { AnyJson, Codec, CodecClass, Inspect, Registry } from '../types';
|
|
2
2
|
import { Bytes } from './Bytes';
|
|
3
3
|
declare type OpaqueName = 'WrapperKeepOpaque' | 'WrapperOpaque';
|
|
4
4
|
export declare class WrapperKeepOpaque<T extends Codec> extends Bytes {
|
|
@@ -9,6 +9,10 @@ export declare class WrapperKeepOpaque<T extends Codec> extends Bytes {
|
|
|
9
9
|
* @description Checks if the wrapper is decodable
|
|
10
10
|
*/
|
|
11
11
|
get isDecoded(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
14
|
+
*/
|
|
15
|
+
inspect(): Inspect;
|
|
12
16
|
/**
|
|
13
17
|
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
14
18
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { assertReturn, compactAddLength, compactStripLength, isHex, isU8a } from '@polkadot/util';
|
|
3
|
+
import { assertReturn, compactAddLength, compactStripLength, compactToU8a, isHex, isU8a } from '@polkadot/util';
|
|
4
4
|
import { Raw } from "../native/Raw.js";
|
|
5
5
|
import { typeToConstructor } from "../utils/index.js";
|
|
6
6
|
import { Bytes } from "./Bytes.js";
|
|
@@ -50,6 +50,20 @@ export class WrapperKeepOpaque extends Bytes {
|
|
|
50
50
|
get isDecoded() {
|
|
51
51
|
return !!this.#decoded;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
inspect() {
|
|
59
|
+
return {
|
|
60
|
+
inner: this.#decoded ? [this.#decoded.inspect()] : [{
|
|
61
|
+
inner: [],
|
|
62
|
+
value: this.toU8a(true)
|
|
63
|
+
}],
|
|
64
|
+
value: compactToU8a(this.length)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
53
67
|
/**
|
|
54
68
|
* @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
|
|
55
69
|
*/
|
package/native/Bool.cjs
CHANGED
|
@@ -85,6 +85,17 @@ class bool extends Boolean {
|
|
|
85
85
|
eq(other) {
|
|
86
86
|
return this.valueOf() === (other instanceof Boolean ? other.valueOf() : other);
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
inspect() {
|
|
94
|
+
return {
|
|
95
|
+
inner: [],
|
|
96
|
+
value: this.toU8a()
|
|
97
|
+
};
|
|
98
|
+
}
|
|
88
99
|
/**
|
|
89
100
|
* @description Returns a hex string representation of the value
|
|
90
101
|
*/
|
package/native/Bool.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { Codec, IU8a, Registry } from '../types';
|
|
2
|
+
import type { Codec, Inspect, IU8a, Registry } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* @name bool
|
|
5
5
|
* @description
|
|
@@ -34,6 +34,10 @@ export declare class bool extends Boolean implements Codec {
|
|
|
34
34
|
* @description Compares the value of the input to see if there is a match
|
|
35
35
|
*/
|
|
36
36
|
eq(other?: unknown): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
39
|
+
*/
|
|
40
|
+
inspect(): Inspect;
|
|
37
41
|
/**
|
|
38
42
|
* @description Returns a hex string representation of the value
|
|
39
43
|
*/
|
package/native/Bool.js
CHANGED
|
@@ -74,6 +74,17 @@ export class bool extends Boolean {
|
|
|
74
74
|
eq(other) {
|
|
75
75
|
return this.valueOf() === (other instanceof Boolean ? other.valueOf() : other);
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
inspect() {
|
|
83
|
+
return {
|
|
84
|
+
inner: [],
|
|
85
|
+
value: this.toU8a()
|
|
86
|
+
};
|
|
87
|
+
}
|
|
77
88
|
/**
|
|
78
89
|
* @description Returns a hex string representation of the value
|
|
79
90
|
*/
|
package/native/Date.cjs
CHANGED
|
@@ -66,6 +66,14 @@ class CodecDate extends Date {
|
|
|
66
66
|
get isEmpty() {
|
|
67
67
|
return this.getTime() === 0;
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* @description Returns the number of bits in the value
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
bitLength() {
|
|
75
|
+
return BITLENGTH;
|
|
76
|
+
}
|
|
69
77
|
/**
|
|
70
78
|
* @description Compares the value of the input to see if there is a match
|
|
71
79
|
*/
|
|
@@ -75,12 +83,15 @@ class CodecDate extends Date {
|
|
|
75
83
|
return decodeDate(other).getTime() === this.getTime();
|
|
76
84
|
}
|
|
77
85
|
/**
|
|
78
|
-
* @description Returns
|
|
86
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
79
87
|
*/
|
|
80
88
|
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
return
|
|
90
|
+
inspect() {
|
|
91
|
+
return {
|
|
92
|
+
inner: [],
|
|
93
|
+
value: this.toU8a()
|
|
94
|
+
};
|
|
84
95
|
}
|
|
85
96
|
/**
|
|
86
97
|
* @description Returns a BigInt representation of the number
|
package/native/Date.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
|
3
|
+
import type { AnyNumber, Inspect, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
|
4
4
|
import { BN } from '@polkadot/util';
|
|
5
5
|
/**
|
|
6
6
|
* @name Date
|
|
@@ -28,14 +28,18 @@ export declare class CodecDate extends Date implements INumber {
|
|
|
28
28
|
* @description Checks if the value is an empty value
|
|
29
29
|
*/
|
|
30
30
|
get isEmpty(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @description Returns the number of bits in the value
|
|
33
|
+
*/
|
|
34
|
+
bitLength(): UIntBitLength;
|
|
31
35
|
/**
|
|
32
36
|
* @description Compares the value of the input to see if there is a match
|
|
33
37
|
*/
|
|
34
38
|
eq(other?: unknown): boolean;
|
|
35
39
|
/**
|
|
36
|
-
* @description Returns
|
|
40
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
37
41
|
*/
|
|
38
|
-
|
|
42
|
+
inspect(): Inspect;
|
|
39
43
|
/**
|
|
40
44
|
* @description Returns a BigInt representation of the number
|
|
41
45
|
*/
|
package/native/Date.js
CHANGED
|
@@ -55,6 +55,14 @@ export class CodecDate extends Date {
|
|
|
55
55
|
get isEmpty() {
|
|
56
56
|
return this.getTime() === 0;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @description Returns the number of bits in the value
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
bitLength() {
|
|
64
|
+
return BITLENGTH;
|
|
65
|
+
}
|
|
58
66
|
/**
|
|
59
67
|
* @description Compares the value of the input to see if there is a match
|
|
60
68
|
*/
|
|
@@ -64,12 +72,15 @@ export class CodecDate extends Date {
|
|
|
64
72
|
return decodeDate(other).getTime() === this.getTime();
|
|
65
73
|
}
|
|
66
74
|
/**
|
|
67
|
-
* @description Returns
|
|
75
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
68
76
|
*/
|
|
69
77
|
|
|
70
78
|
|
|
71
|
-
|
|
72
|
-
return
|
|
79
|
+
inspect() {
|
|
80
|
+
return {
|
|
81
|
+
inner: [],
|
|
82
|
+
value: this.toU8a()
|
|
83
|
+
};
|
|
73
84
|
}
|
|
74
85
|
/**
|
|
75
86
|
* @description Returns a BigInt representation of the number
|
package/native/Json.cjs
CHANGED
package/native/Json.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, Codec, IU8a, Registry } from '../types';
|
|
2
|
+
import type { AnyJson, Codec, Inspect, IU8a, Registry } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* @name Json
|
|
5
5
|
* @description
|
|
@@ -29,6 +29,10 @@ export declare class Json extends Map<string, any> implements Codec {
|
|
|
29
29
|
*/
|
|
30
30
|
eq(other?: unknown): boolean;
|
|
31
31
|
getT<T>(key: string): T;
|
|
32
|
+
/**
|
|
33
|
+
* @description Unimplemented, will throw
|
|
34
|
+
*/
|
|
35
|
+
inspect(): Inspect;
|
|
32
36
|
/**
|
|
33
37
|
* @description Unimplemented, will throw
|
|
34
38
|
*/
|
package/native/Json.js
CHANGED
package/native/Raw.cjs
CHANGED
|
@@ -97,6 +97,17 @@ class Raw extends Uint8Array {
|
|
|
97
97
|
|
|
98
98
|
return this.eq((0, _util.u8aToU8a)(other));
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
inspect() {
|
|
106
|
+
return {
|
|
107
|
+
inner: [],
|
|
108
|
+
value: this.toU8a()
|
|
109
|
+
};
|
|
110
|
+
}
|
|
100
111
|
/**
|
|
101
112
|
* @description Create a new slice from the actual buffer. (compat)
|
|
102
113
|
* @param start The position to start at
|
package/native/Raw.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
|
-
import type { AnyJson, AnyU8a, IU8a, Registry } from '../types';
|
|
2
|
+
import type { AnyJson, AnyU8a, Inspect, IU8a, Registry } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* @name Raw
|
|
5
5
|
* @description
|
|
@@ -46,6 +46,10 @@ export declare class Raw extends Uint8Array implements IU8a {
|
|
|
46
46
|
* @description Compares the value of the input to see if there is a match
|
|
47
47
|
*/
|
|
48
48
|
eq(other?: unknown): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
51
|
+
*/
|
|
52
|
+
inspect(): Inspect;
|
|
49
53
|
/**
|
|
50
54
|
* @description Create a new slice from the actual buffer. (compat)
|
|
51
55
|
* @param start The position to start at
|
package/native/Raw.js
CHANGED
|
@@ -86,6 +86,17 @@ export class Raw extends Uint8Array {
|
|
|
86
86
|
|
|
87
87
|
return this.eq(u8aToU8a(other));
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
inspect() {
|
|
95
|
+
return {
|
|
96
|
+
inner: [],
|
|
97
|
+
value: this.toU8a()
|
|
98
|
+
};
|
|
99
|
+
}
|
|
89
100
|
/**
|
|
90
101
|
* @description Create a new slice from the actual buffer. (compat)
|
|
91
102
|
* @param start The position to start at
|
package/native/Set.cjs
CHANGED
|
@@ -199,6 +199,17 @@ class CodecSet extends Set {
|
|
|
199
199
|
|
|
200
200
|
return false;
|
|
201
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
inspect() {
|
|
208
|
+
return {
|
|
209
|
+
inner: [],
|
|
210
|
+
value: this.toU8a()
|
|
211
|
+
};
|
|
212
|
+
}
|
|
202
213
|
/**
|
|
203
214
|
* @description Returns a hex string representation of the value
|
|
204
215
|
*/
|
package/native/Set.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="bn.js" />
|
|
2
2
|
import type { HexString } from '@polkadot/util/types';
|
|
3
|
-
import type { CodecClass, ISet, IU8a, Registry } from '../types';
|
|
3
|
+
import type { CodecClass, Inspect, ISet, IU8a, Registry } from '../types';
|
|
4
4
|
import { BN } from '@polkadot/util';
|
|
5
5
|
declare type SetValues = Record<string, number | BN>;
|
|
6
6
|
/**
|
|
@@ -43,6 +43,10 @@ export declare class CodecSet extends Set<string> implements ISet<string> {
|
|
|
43
43
|
* @description Compares the value of the input to see if there is a match
|
|
44
44
|
*/
|
|
45
45
|
eq(other?: unknown): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
48
|
+
*/
|
|
49
|
+
inspect(): Inspect;
|
|
46
50
|
/**
|
|
47
51
|
* @description Returns a hex string representation of the value
|
|
48
52
|
*/
|
package/native/Set.js
CHANGED
|
@@ -170,6 +170,17 @@ export class CodecSet extends Set {
|
|
|
170
170
|
|
|
171
171
|
return false;
|
|
172
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* @description Returns a breakdown of the hex encoding for this Codec
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
inspect() {
|
|
179
|
+
return {
|
|
180
|
+
inner: [],
|
|
181
|
+
value: this.toU8a()
|
|
182
|
+
};
|
|
183
|
+
}
|
|
173
184
|
/**
|
|
174
185
|
* @description Returns a hex string representation of the value
|
|
175
186
|
*/
|