@polkadot/types-codec 8.8.3-4 → 8.8.3-5
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.d.ts → Array.d.ts} +0 -0
- package/abstract/{AbstractArray.js → Array.js} +0 -0
- package/{base → abstract}/Base.d.ts +1 -1
- package/{base → abstract}/Base.js +1 -1
- package/abstract/{AbstractInt.d.ts → Int.d.ts} +0 -0
- package/abstract/{AbstractInt.js → Int.js} +0 -0
- package/abstract/index.d.ts +3 -2
- package/abstract/index.js +3 -2
- package/base/Int.d.ts +1 -1
- package/base/Int.js +1 -1
- package/base/Tuple.d.ts +1 -1
- package/base/Tuple.js +1 -1
- package/base/UInt.d.ts +1 -1
- package/base/UInt.js +1 -1
- package/base/Vec.d.ts +1 -1
- package/base/Vec.js +1 -1
- package/base/VecAny.d.ts +1 -1
- package/base/VecAny.js +1 -1
- package/base/VecFixed.d.ts +1 -1
- package/base/VecFixed.js +1 -1
- package/base/index.d.ts +0 -1
- package/base/index.js +0 -1
- package/cjs/abstract/{AbstractArray.js → Array.js} +0 -0
- package/cjs/{base → abstract}/Base.js +3 -3
- package/cjs/abstract/{AbstractInt.js → Int.js} +0 -0
- package/cjs/abstract/index.js +12 -4
- package/cjs/base/Int.js +2 -2
- package/cjs/base/Tuple.js +2 -2
- package/cjs/base/UInt.js +2 -2
- package/cjs/base/Vec.js +2 -2
- package/cjs/base/VecAny.js +2 -2
- package/cjs/base/VecFixed.js +2 -2
- package/cjs/base/index.js +0 -8
- package/cjs/extended/Map.js +2 -2
- package/cjs/packageInfo.js +1 -1
- package/extended/Map.js +1 -1
- package/package.json +14 -14
- package/packageInfo.js +1 -1
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ import type { AnyJson, BareOpts, Codec, Inspect, IU8a, Registry } from '../types
|
|
|
4
4
|
* @name Base
|
|
5
5
|
* @description A type extends the Base class, when it holds a value
|
|
6
6
|
*/
|
|
7
|
-
export declare abstract class
|
|
7
|
+
export declare abstract class AbstractBase<T extends Codec> implements Codec {
|
|
8
8
|
#private;
|
|
9
9
|
createdAtHash?: IU8a;
|
|
10
10
|
readonly initialU8aLength?: number;
|
|
File without changes
|
|
File without changes
|
package/abstract/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { AbstractArray } from './
|
|
2
|
-
export {
|
|
1
|
+
export { AbstractArray } from './Array';
|
|
2
|
+
export { AbstractBase } from './Base';
|
|
3
|
+
export { AbstractInt } from './Int';
|
package/abstract/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export { AbstractArray } from "./
|
|
4
|
-
export {
|
|
3
|
+
export { AbstractArray } from "./Array.js";
|
|
4
|
+
export { AbstractBase } from "./Base.js";
|
|
5
|
+
export { AbstractInt } from "./Int.js";
|
package/base/Int.d.ts
CHANGED
package/base/Int.js
CHANGED
package/base/Tuple.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnyTupleValue, Codec, CodecClass, Inspect, ITuple, Registry } from '../types';
|
|
2
|
-
import { AbstractArray } from '../abstract/
|
|
2
|
+
import { AbstractArray } from '../abstract/Array';
|
|
3
3
|
declare type TupleType = (CodecClass | string);
|
|
4
4
|
declare type TupleTypes = TupleType[] | {
|
|
5
5
|
[index: string]: CodecClass | string;
|
package/base/Tuple.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { isFunction, isHex, isString, isU8a, stringify, u8aConcatStrict, u8aToU8a } from '@polkadot/util';
|
|
4
|
-
import { AbstractArray } from "../abstract/
|
|
4
|
+
import { AbstractArray } from "../abstract/Array.js";
|
|
5
5
|
import { decodeU8a, mapToTypeMap, typeToConstructor } from "../utils/index.js";
|
|
6
6
|
|
|
7
7
|
function noopSetDefinition(d) {
|
package/base/UInt.d.ts
CHANGED
package/base/UInt.js
CHANGED
package/base/Vec.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
2
|
import type { Codec, CodecClass, Registry } from '../types';
|
|
3
|
-
import { AbstractArray } from '../abstract/
|
|
3
|
+
import { AbstractArray } from '../abstract/Array';
|
|
4
4
|
interface Options<T> {
|
|
5
5
|
definition?: CodecClass<T>;
|
|
6
6
|
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
package/base/Vec.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { assert, compactFromU8aLim, isU8a, logger, u8aToU8a } from '@polkadot/util';
|
|
4
|
-
import { AbstractArray } from "../abstract/
|
|
4
|
+
import { AbstractArray } from "../abstract/Array.js";
|
|
5
5
|
import { decodeU8aVec, typeToConstructor } from "../utils/index.js";
|
|
6
6
|
const MAX_LENGTH = 64 * 1024;
|
|
7
7
|
const l = logger('Vec');
|
package/base/VecAny.d.ts
CHANGED
package/base/VecAny.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { AbstractArray } from "../abstract/
|
|
3
|
+
import { AbstractArray } from "../abstract/Array.js";
|
|
4
4
|
/**
|
|
5
5
|
* @name VecAny
|
|
6
6
|
* @description
|
package/base/VecFixed.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { HexString } from '@polkadot/util/types';
|
|
2
2
|
import type { Codec, CodecClass, Inspect, Registry } from '../types';
|
|
3
|
-
import { AbstractArray } from '../abstract/
|
|
3
|
+
import { AbstractArray } from '../abstract/Array';
|
|
4
4
|
interface Options<T> {
|
|
5
5
|
definition?: CodecClass<T>;
|
|
6
6
|
setDefinition?: (d: CodecClass<T>) => CodecClass<T>;
|
package/base/VecFixed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { isU8a, u8aConcatStrict } from '@polkadot/util';
|
|
4
|
-
import { AbstractArray } from "../abstract/
|
|
4
|
+
import { AbstractArray } from "../abstract/Array.js";
|
|
5
5
|
import { decodeU8aVec, typeToConstructor } from "../utils/index.js";
|
|
6
6
|
import { decodeVec } from "./Vec.js";
|
|
7
7
|
|
package/base/index.d.ts
CHANGED
package/base/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
export { Base } from "./Base.js";
|
|
4
3
|
export { Compact } from "./Compact.js";
|
|
5
4
|
export { DoNotConstruct } from "./DoNotConstruct.js";
|
|
6
5
|
export { Enum } from "./Enum.js";
|
|
File without changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.AbstractBase = void 0;
|
|
7
7
|
|
|
8
8
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
9
9
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -12,7 +12,7 @@ exports.Base = void 0;
|
|
|
12
12
|
* @name Base
|
|
13
13
|
* @description A type extends the Base class, when it holds a value
|
|
14
14
|
*/
|
|
15
|
-
class
|
|
15
|
+
class AbstractBase {
|
|
16
16
|
#raw;
|
|
17
17
|
|
|
18
18
|
constructor(registry, value, initialU8aLength) {
|
|
@@ -120,4 +120,4 @@ class Base {
|
|
|
120
120
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
exports.
|
|
123
|
+
exports.AbstractBase = AbstractBase;
|
|
File without changes
|
package/cjs/abstract/index.js
CHANGED
|
@@ -6,16 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "AbstractArray", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _Array.AbstractArray;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AbstractBase", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Base.AbstractBase;
|
|
10
16
|
}
|
|
11
17
|
});
|
|
12
18
|
Object.defineProperty(exports, "AbstractInt", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function () {
|
|
15
|
-
return
|
|
21
|
+
return _Int.AbstractInt;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
24
|
|
|
19
|
-
var
|
|
25
|
+
var _Array = require("./Array");
|
|
26
|
+
|
|
27
|
+
var _Base = require("./Base");
|
|
20
28
|
|
|
21
|
-
var
|
|
29
|
+
var _Int = require("./Int");
|
package/cjs/base/Int.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Int = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _Int = require("../abstract/Int");
|
|
9
9
|
|
|
10
10
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -20,7 +20,7 @@ var _AbstractInt = require("../abstract/AbstractInt");
|
|
|
20
20
|
* is available here.
|
|
21
21
|
* @noInheritDoc
|
|
22
22
|
*/
|
|
23
|
-
class Int extends
|
|
23
|
+
class Int extends _Int.AbstractInt {
|
|
24
24
|
constructor(registry) {
|
|
25
25
|
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
26
26
|
let bitLength = arguments.length > 2 ? arguments[2] : undefined;
|
package/cjs/base/Tuple.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.Tuple = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _util = require("@polkadot/util");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _Array = require("../abstract/Array");
|
|
11
11
|
|
|
12
12
|
var _utils = require("../utils");
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ function decodeTuple(registry, result, value, Classes) {
|
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
class Tuple extends
|
|
48
|
+
class Tuple extends _Array.AbstractArray {
|
|
49
49
|
#Types;
|
|
50
50
|
|
|
51
51
|
constructor(registry, Types, value) {
|
package/cjs/base/UInt.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.UInt = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _Int = require("../abstract/Int");
|
|
9
9
|
|
|
10
10
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -20,7 +20,7 @@ var _AbstractInt = require("../abstract/AbstractInt");
|
|
|
20
20
|
* is available here.
|
|
21
21
|
* @noInheritDoc
|
|
22
22
|
*/
|
|
23
|
-
class UInt extends
|
|
23
|
+
class UInt extends _Int.AbstractInt {
|
|
24
24
|
static with(bitLength, typeName) {
|
|
25
25
|
return class extends UInt {
|
|
26
26
|
constructor(registry, value) {
|
package/cjs/base/Vec.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.decodeVec = decodeVec;
|
|
|
8
8
|
|
|
9
9
|
var _util = require("@polkadot/util");
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _Array = require("../abstract/Array");
|
|
12
12
|
|
|
13
13
|
var _utils = require("../utils");
|
|
14
14
|
|
|
@@ -61,7 +61,7 @@ function decodeVec(registry, result, value, startAt, Type) {
|
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
class Vec extends
|
|
64
|
+
class Vec extends _Array.AbstractArray {
|
|
65
65
|
#Type;
|
|
66
66
|
|
|
67
67
|
constructor(registry, Type) {
|
package/cjs/base/VecAny.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.VecAny = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _Array = require("../abstract/Array");
|
|
9
9
|
|
|
10
10
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
11
11
|
// SPDX-License-Identifier: Apache-2.0
|
|
@@ -17,7 +17,7 @@ var _AbstractArray = require("../abstract/AbstractArray");
|
|
|
17
17
|
* a vector, this can be used to manage array-like structures with variable arguments of
|
|
18
18
|
* any types
|
|
19
19
|
*/
|
|
20
|
-
class VecAny extends
|
|
20
|
+
class VecAny extends _Array.AbstractArray {
|
|
21
21
|
/**
|
|
22
22
|
* @description Returns the base runtime type name for this instance
|
|
23
23
|
*/
|
package/cjs/base/VecFixed.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.VecFixed = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _util = require("@polkadot/util");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _Array = require("../abstract/Array");
|
|
11
11
|
|
|
12
12
|
var _utils = require("../utils");
|
|
13
13
|
|
|
@@ -25,7 +25,7 @@ function noopSetDefinition(d) {
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
class VecFixed extends
|
|
28
|
+
class VecFixed extends _Array.AbstractArray {
|
|
29
29
|
#Type;
|
|
30
30
|
|
|
31
31
|
constructor(registry, Type, length) {
|
package/cjs/base/index.js
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "Base", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Base.Base;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "Compact", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function () {
|
|
@@ -82,8 +76,6 @@ Object.defineProperty(exports, "VecFixed", {
|
|
|
82
76
|
}
|
|
83
77
|
});
|
|
84
78
|
|
|
85
|
-
var _Base = require("./Base");
|
|
86
|
-
|
|
87
79
|
var _Compact = require("./Compact");
|
|
88
80
|
|
|
89
81
|
var _DoNotConstruct = require("./DoNotConstruct");
|
package/cjs/extended/Map.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.CodecMap = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _util = require("@polkadot/util");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _Array = require("../abstract/Array");
|
|
11
11
|
|
|
12
12
|
var _Enum = require("../base/Enum");
|
|
13
13
|
|
|
@@ -44,7 +44,7 @@ function decodeMapFromMap(registry, KeyClass, ValClass, value) {
|
|
|
44
44
|
const output = new Map();
|
|
45
45
|
|
|
46
46
|
for (const [key, val] of value.entries()) {
|
|
47
|
-
const isComplex = KeyClass.prototype instanceof
|
|
47
|
+
const isComplex = KeyClass.prototype instanceof _Array.AbstractArray || KeyClass.prototype instanceof _Struct.Struct || KeyClass.prototype instanceof _Enum.Enum;
|
|
48
48
|
|
|
49
49
|
try {
|
|
50
50
|
output.set(key instanceof KeyClass ? key : new KeyClass(registry, isComplex ? JSON.parse(key) : key), val instanceof ValClass ? val : new ValClass(registry, val));
|
package/cjs/packageInfo.js
CHANGED
package/extended/Map.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { compactFromU8aLim, compactToU8a, isHex, isObject, isU8a, logger, stringify, u8aConcatStrict, u8aToHex, u8aToU8a } from '@polkadot/util';
|
|
4
|
-
import { AbstractArray } from "../abstract/
|
|
4
|
+
import { AbstractArray } from "../abstract/Array.js";
|
|
5
5
|
import { Enum } from "../base/Enum.js";
|
|
6
6
|
import { Struct } from "../native/Struct.js";
|
|
7
7
|
import { compareMap, decodeU8a, sortMap, typeToConstructor } from "../utils/index.js";
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./cjs/detectPackage.js"
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
|
-
"version": "8.8.3-
|
|
23
|
+
"version": "8.8.3-5",
|
|
24
24
|
"main": "./cjs/index.js",
|
|
25
25
|
"module": "./index.js",
|
|
26
26
|
"types": "./index.d.ts",
|
|
@@ -37,26 +37,26 @@
|
|
|
37
37
|
"require": "./cjs/abstract/index.js",
|
|
38
38
|
"default": "./abstract/index.js"
|
|
39
39
|
},
|
|
40
|
-
"./abstract/
|
|
41
|
-
"types": "./abstract/
|
|
42
|
-
"require": "./cjs/abstract/
|
|
43
|
-
"default": "./abstract/
|
|
40
|
+
"./abstract/Array": {
|
|
41
|
+
"types": "./abstract/Array.d.ts",
|
|
42
|
+
"require": "./cjs/abstract/Array.js",
|
|
43
|
+
"default": "./abstract/Array.js"
|
|
44
44
|
},
|
|
45
|
-
"./abstract/
|
|
46
|
-
"types": "./abstract/
|
|
47
|
-
"require": "./cjs/abstract/
|
|
48
|
-
"default": "./abstract/
|
|
45
|
+
"./abstract/Base": {
|
|
46
|
+
"types": "./abstract/Base.d.ts",
|
|
47
|
+
"require": "./cjs/abstract/Base.js",
|
|
48
|
+
"default": "./abstract/Base.js"
|
|
49
|
+
},
|
|
50
|
+
"./abstract/Int": {
|
|
51
|
+
"types": "./abstract/Int.d.ts",
|
|
52
|
+
"require": "./cjs/abstract/Int.js",
|
|
53
|
+
"default": "./abstract/Int.js"
|
|
49
54
|
},
|
|
50
55
|
"./base": {
|
|
51
56
|
"types": "./base/index.d.ts",
|
|
52
57
|
"require": "./cjs/base/index.js",
|
|
53
58
|
"default": "./base/index.js"
|
|
54
59
|
},
|
|
55
|
-
"./base/Base": {
|
|
56
|
-
"types": "./base/Base.d.ts",
|
|
57
|
-
"require": "./cjs/base/Base.js",
|
|
58
|
-
"default": "./base/Base.js"
|
|
59
|
-
},
|
|
60
60
|
"./base/Compact": {
|
|
61
61
|
"types": "./base/Compact.d.ts",
|
|
62
62
|
"require": "./cjs/base/Compact.js",
|
package/packageInfo.js
CHANGED
|
@@ -5,5 +5,5 @@ export const packageInfo = {
|
|
|
5
5
|
name: '@polkadot/types-codec',
|
|
6
6
|
path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
|
|
7
7
|
type: 'esm',
|
|
8
|
-
version: '8.8.3-
|
|
8
|
+
version: '8.8.3-5'
|
|
9
9
|
};
|