@polkadot/types-codec 7.7.2-6 → 7.8.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.
Files changed (70) hide show
  1. package/abstract/AbstractArray.cjs +27 -1
  2. package/abstract/AbstractArray.d.ts +7 -1
  3. package/abstract/AbstractArray.js +27 -1
  4. package/abstract/AbstractInt.cjs +10 -0
  5. package/abstract/AbstractInt.d.ts +5 -1
  6. package/abstract/AbstractInt.js +10 -0
  7. package/base/Base.cjs +8 -0
  8. package/base/Base.d.ts +5 -1
  9. package/base/Base.js +8 -0
  10. package/base/Compact.cjs +10 -0
  11. package/base/Compact.d.ts +5 -1
  12. package/base/Compact.js +10 -0
  13. package/base/DoNotConstruct.cjs +4 -0
  14. package/base/DoNotConstruct.d.ts +2 -1
  15. package/base/DoNotConstruct.js +4 -0
  16. package/base/Enum.cjs +22 -0
  17. package/base/Enum.d.ts +5 -1
  18. package/base/Enum.js +21 -0
  19. package/base/Null.cjs +8 -0
  20. package/base/Null.d.ts +5 -1
  21. package/base/Null.js +8 -0
  22. package/base/Option.cjs +22 -0
  23. package/base/Option.d.ts +5 -1
  24. package/base/Option.js +21 -0
  25. package/base/Tuple.cjs +11 -7
  26. package/base/Tuple.d.ts +5 -1
  27. package/base/Tuple.js +11 -7
  28. package/base/VecFixed.cjs +11 -6
  29. package/base/VecFixed.d.ts +5 -1
  30. package/base/VecFixed.js +11 -6
  31. package/extended/BTreeSet.cjs +17 -0
  32. package/extended/BTreeSet.d.ts +5 -1
  33. package/extended/BTreeSet.js +17 -0
  34. package/extended/BitVec.cjs +10 -0
  35. package/extended/BitVec.d.ts +5 -1
  36. package/extended/BitVec.js +10 -0
  37. package/extended/Bytes.cjs +11 -0
  38. package/extended/Bytes.d.ts +5 -1
  39. package/extended/Bytes.js +11 -0
  40. package/extended/Map.cjs +19 -1
  41. package/extended/Map.d.ts +5 -1
  42. package/extended/Map.js +19 -1
  43. package/extended/WrapperKeepOpaque.cjs +13 -0
  44. package/extended/WrapperKeepOpaque.d.ts +5 -1
  45. package/extended/WrapperKeepOpaque.js +14 -1
  46. package/native/Bool.cjs +10 -0
  47. package/native/Bool.d.ts +5 -1
  48. package/native/Bool.js +10 -0
  49. package/native/Date.cjs +13 -3
  50. package/native/Date.d.ts +7 -3
  51. package/native/Date.js +13 -3
  52. package/native/Json.cjs +8 -0
  53. package/native/Json.d.ts +5 -1
  54. package/native/Json.js +8 -0
  55. package/native/Raw.cjs +10 -0
  56. package/native/Raw.d.ts +5 -1
  57. package/native/Raw.js +10 -0
  58. package/native/Set.cjs +10 -0
  59. package/native/Set.d.ts +5 -1
  60. package/native/Set.js +10 -0
  61. package/native/Struct.cjs +18 -0
  62. package/native/Struct.d.ts +5 -1
  63. package/native/Struct.js +18 -0
  64. package/native/Text.cjs +11 -0
  65. package/native/Text.d.ts +5 -1
  66. package/native/Text.js +12 -1
  67. package/package.json +3 -3
  68. package/packageInfo.cjs +1 -1
  69. package/packageInfo.js +1 -1
  70. package/types/codec.d.ts +6 -2
package/base/VecFixed.js CHANGED
@@ -63,16 +63,21 @@ export class VecFixed extends AbstractArray {
63
63
 
64
64
  return total;
65
65
  }
66
+ /**
67
+ * @description Returns a breakdown of the hex encoding for this Codec
68
+ */
69
+
70
+
71
+ inspect() {
72
+ return {
73
+ inner: this.inspectInner()
74
+ };
75
+ }
66
76
 
67
77
  toU8a() {
68
78
  // we override, we don't add the length prefix for ourselves, and at the same time we
69
79
  // ignore isBare on entries, since they should be properly encoded at all times
70
- const encoded = new Array(this.length);
71
-
72
- for (let i = 0; i < this.length; i++) {
73
- encoded[i] = this[i].toU8a();
74
- }
75
-
80
+ const encoded = this.toU8aInner();
76
81
  return encoded.length ? u8aConcat(...encoded) : new Uint8Array([]);
77
82
  }
78
83
  /**
@@ -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
+ outer: [(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
  */
@@ -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
  */
@@ -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
+ outer: [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
  */
@@ -69,6 +69,16 @@ 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
+ outer: [(0, _util.compactToU8a)((0, _classPrivateFieldLooseBase2.default)(this, _decodedLength)[_decodedLength]), super.toU8a()]
80
+ };
81
+ }
72
82
 
73
83
  toHuman() {
74
84
  return `0b${[...this.toU8a(true)].map(d => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
@@ -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
@@ -50,6 +50,16 @@ 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
+ outer: [compactToU8a(this.#decodedLength), super.toU8a()]
61
+ };
62
+ }
53
63
 
54
64
  toHuman() {
55
65
  return `0b${[...this.toU8a(true)].map(d => `00000000${d.toString(2)}`.slice(-8)).join('_')}`;
@@ -63,6 +63,17 @@ 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
+ const clength = (0, _util.compactToU8a)(this.length);
73
+ return {
74
+ outer: this.length ? [clength, super.toU8a()] : [clength]
75
+ };
76
+ }
66
77
  /**
67
78
  * @description Returns the base runtime type name for this instance
68
79
  */
@@ -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,17 @@ 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
+ const clength = compactToU8a(this.length);
64
+ return {
65
+ outer: this.length ? [clength, super.toU8a()] : [clength]
66
+ };
67
+ }
57
68
  /**
58
69
  * @description Returns the base runtime type name for this instance
59
70
  */
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 += v.encodedLength + k.encodedLength;
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
+ outer: [(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 += v.encodedLength + k.encodedLength;
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
+ outer: [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,19 @@ 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 (0, _classPrivateFieldLooseBase2.default)(this, _decoded)[_decoded] ? {
91
+ inner: [(0, _classPrivateFieldLooseBase2.default)(this, _decoded)[_decoded].inspect()],
92
+ outer: [(0, _util.compactToU8a)(this.length)]
93
+ } : {
94
+ outer: [(0, _util.compactToU8a)(this.length), this.toU8a(true)]
95
+ };
96
+ }
84
97
  /**
85
98
  * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
86
99
  */
@@ -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,19 @@ 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 this.#decoded ? {
60
+ inner: [this.#decoded.inspect()],
61
+ outer: [compactToU8a(this.length)]
62
+ } : {
63
+ outer: [compactToU8a(this.length), this.toU8a(true)]
64
+ };
65
+ }
53
66
  /**
54
67
  * @description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information
55
68
  */
package/native/Bool.cjs CHANGED
@@ -85,6 +85,16 @@ 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
+ outer: [this.toU8a()]
96
+ };
97
+ }
88
98
  /**
89
99
  * @description Returns a hex string representation of the value
90
100
  */
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,16 @@ 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
+ outer: [this.toU8a()]
85
+ };
86
+ }
77
87
  /**
78
88
  * @description Returns a hex string representation of the value
79
89
  */
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,14 @@ class CodecDate extends Date {
75
83
  return decodeDate(other).getTime() === this.getTime();
76
84
  }
77
85
  /**
78
- * @description Returns the number of bits in the value
86
+ * @description Returns a breakdown of the hex encoding for this Codec
79
87
  */
80
88
 
81
89
 
82
- bitLength() {
83
- return BITLENGTH;
90
+ inspect() {
91
+ return {
92
+ outer: [this.toU8a()]
93
+ };
84
94
  }
85
95
  /**
86
96
  * @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 the number of bits in the value
40
+ * @description Returns a breakdown of the hex encoding for this Codec
37
41
  */
38
- bitLength(): UIntBitLength;
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,14 @@ export class CodecDate extends Date {
64
72
  return decodeDate(other).getTime() === this.getTime();
65
73
  }
66
74
  /**
67
- * @description Returns the number of bits in the value
75
+ * @description Returns a breakdown of the hex encoding for this Codec
68
76
  */
69
77
 
70
78
 
71
- bitLength() {
72
- return BITLENGTH;
79
+ inspect() {
80
+ return {
81
+ outer: [this.toU8a()]
82
+ };
73
83
  }
74
84
  /**
75
85
  * @description Returns a BigInt representation of the number
package/native/Json.cjs CHANGED
@@ -79,6 +79,14 @@ class Json extends Map {
79
79
  */
80
80
 
81
81
 
82
+ inspect() {
83
+ throw new Error('Unimplemented');
84
+ }
85
+ /**
86
+ * @description Unimplemented, will throw
87
+ */
88
+
89
+
82
90
  toHex() {
83
91
  throw new Error('Unimplemented');
84
92
  }
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
@@ -65,6 +65,14 @@ export class Json extends Map {
65
65
  */
66
66
 
67
67
 
68
+ inspect() {
69
+ throw new Error('Unimplemented');
70
+ }
71
+ /**
72
+ * @description Unimplemented, will throw
73
+ */
74
+
75
+
68
76
  toHex() {
69
77
  throw new Error('Unimplemented');
70
78
  }
package/native/Raw.cjs CHANGED
@@ -97,6 +97,16 @@ 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
+ outer: [this.toU8a()]
108
+ };
109
+ }
100
110
  /**
101
111
  * @description Create a new slice from the actual buffer. (compat)
102
112
  * @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,16 @@ 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
+ outer: [this.toU8a()]
97
+ };
98
+ }
89
99
  /**
90
100
  * @description Create a new slice from the actual buffer. (compat)
91
101
  * @param start The position to start at
package/native/Set.cjs CHANGED
@@ -199,6 +199,16 @@ 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
+ outer: [this.toU8a()]
210
+ };
211
+ }
202
212
  /**
203
213
  * @description Returns a hex string representation of the value
204
214
  */
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,16 @@ 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
+ outer: [this.toU8a()]
181
+ };
182
+ }
173
183
  /**
174
184
  * @description Returns a hex string representation of the value
175
185
  */