@talismn/scale 0.0.2 → 0.1.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.
- package/dist/declarations/src/index.d.ts +2 -3
- package/dist/declarations/src/papito.d.ts +6 -0
- package/dist/declarations/src/util/compactMetadata.d.ts +24 -0
- package/dist/declarations/src/util/decodeMetadata.d.ts +13 -0
- package/dist/declarations/src/util/decodeScale.d.ts +4 -0
- package/dist/declarations/src/util/encodeMetadata.d.ts +8 -0
- package/dist/declarations/src/util/encodeStateKey.d.ts +4 -0
- package/dist/declarations/src/util/getMetadataVersion.d.ts +6 -0
- package/dist/declarations/src/util/index.d.ts +7 -0
- package/dist/declarations/src/util/serdePapi.d.ts +30 -0
- package/dist/talismn-scale.cjs.dev.js +338 -1691
- package/dist/talismn-scale.cjs.prod.js +338 -1691
- package/dist/talismn-scale.esm.js +305 -1618
- package/package.json +16 -20
- package/CHANGELOG.md +0 -15
- package/dist/declarations/src/capi/crypto/base58.d.ts +0 -18
- package/dist/declarations/src/capi/crypto/hashers.d.ts +0 -67
- package/dist/declarations/src/capi/crypto/index.d.ts +0 -3
- package/dist/declarations/src/capi/crypto/ss58.d.ts +0 -16
- package/dist/declarations/src/capi/crypto/util/index.d.ts +0 -4
- package/dist/declarations/src/capi/crypto/util/nosimd.d.ts +0 -19
- package/dist/declarations/src/capi/crypto/util/simd.d.ts +0 -1
- package/dist/declarations/src/capi/frame_metadata/Extrinsic.d.ts +0 -50
- package/dist/declarations/src/capi/frame_metadata/FrameMetadata.d.ts +0 -61
- package/dist/declarations/src/capi/frame_metadata/decodeMetadata.d.ts +0 -312
- package/dist/declarations/src/capi/frame_metadata/index.d.ts +0 -4
- package/dist/declarations/src/capi/frame_metadata/key_codecs.d.ts +0 -27
- package/dist/declarations/src/capi/frame_metadata/raw/v14.d.ts +0 -312
- package/dist/declarations/src/capi/index.d.ts +0 -4
- package/dist/declarations/src/capi/scale_info/index.d.ts +0 -4
- package/dist/declarations/src/capi/scale_info/overrides/ChainError.d.ts +0 -26
- package/dist/declarations/src/capi/scale_info/overrides/Era.d.ts +0 -33
- package/dist/declarations/src/capi/scale_info/overrides/index.d.ts +0 -1
- package/dist/declarations/src/capi/scale_info/overrides/overrides.d.ts +0 -23
- package/dist/declarations/src/capi/scale_info/raw/Ty.d.ts +0 -313
- package/dist/declarations/src/capi/scale_info/transformTys.d.ts +0 -34
- package/dist/declarations/src/capi/util/index.d.ts +0 -3
- package/dist/declarations/src/capi/util/key.d.ts +0 -22
- package/dist/declarations/src/capi/util/normalize.d.ts +0 -25
- package/dist/declarations/src/capi/util/state.d.ts +0 -25
- package/dist/declarations/src/metadata/index.d.ts +0 -2
- package/dist/declarations/src/metadata/util.d.ts +0 -10
- package/dist/declarations/src/storage/getShape.d.ts +0 -15
- package/dist/declarations/src/storage/getTypeName.d.ts +0 -25
- package/dist/declarations/src/storage/index.d.ts +0 -11
- package/dist/declarations/src/suppressPortableRegistryConsoleWarnings.d.ts +0 -1
- package/dist/nosimd-18c022ec.cjs.dev.js +0 -46
- package/dist/nosimd-8c31fb2d.esm.js +0 -43
- package/dist/nosimd-b32b4901.cjs.prod.js +0 -46
- package/dist/simd-133b8f48.cjs.prod.js +0 -14
- package/dist/simd-2ddb8d7c.cjs.dev.js +0 -14
- package/dist/simd-b794dbff.esm.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/scale",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -20,35 +20,31 @@
|
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "jest",
|
|
25
|
-
"lint": "eslint src --max-warnings 0",
|
|
26
|
-
"clean": "rm -rf dist && rm -rf .turbo rm -rf node_modules"
|
|
27
|
-
},
|
|
28
23
|
"dependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
24
|
+
"@polkadot-api/metadata-builders": "0.10.2",
|
|
25
|
+
"@polkadot-api/substrate-bindings": "0.11.1",
|
|
26
|
+
"@polkadot-api/utils": "0.1.2",
|
|
31
27
|
"anylogger": "^1.0.11",
|
|
32
|
-
"
|
|
33
|
-
"wat-the-crypto": "^0.0.3"
|
|
28
|
+
"scale-ts": "^1.6.1"
|
|
34
29
|
},
|
|
35
30
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"@talismn/tsconfig": "0.0.2",
|
|
39
|
-
"@types/jest": "^27.5.1",
|
|
40
|
-
"eslint": "^8.52.0",
|
|
31
|
+
"@types/jest": "^29.5.14",
|
|
32
|
+
"eslint": "^8.57.1",
|
|
41
33
|
"jest": "^29.7",
|
|
42
|
-
"ts-jest": "^29.
|
|
43
|
-
"typescript": "^5.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"@polkadot/util-crypto": "12.x"
|
|
34
|
+
"ts-jest": "^29.2.5",
|
|
35
|
+
"typescript": "^5.6.3",
|
|
36
|
+
"@talismn/eslint-config": "0.0.3",
|
|
37
|
+
"@talismn/tsconfig": "0.0.2"
|
|
47
38
|
},
|
|
48
39
|
"eslintConfig": {
|
|
49
40
|
"root": true,
|
|
50
41
|
"extends": [
|
|
51
42
|
"@talismn/eslint-config/base"
|
|
52
43
|
]
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"test": "jest",
|
|
47
|
+
"lint": "eslint src --max-warnings 0",
|
|
48
|
+
"clean": "rm -rf dist .turbo node_modules"
|
|
53
49
|
}
|
|
54
50
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# @talismn/scale
|
|
2
|
-
|
|
3
|
-
## 0.0.2
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- c4d5967: bump typescript version
|
|
8
|
-
- 620b7eb: Dependency updates
|
|
9
|
-
- 5aadf99: feat: native token balances on custom networks
|
|
10
|
-
- a6c1b2a: fix: workaround for devices with no wasm simd support
|
|
11
|
-
- Updated dependencies [372f995]
|
|
12
|
-
- Updated dependencies [c4d5967]
|
|
13
|
-
- Updated dependencies [e0eb84a]
|
|
14
|
-
- Updated dependencies [620b7eb]
|
|
15
|
-
- @talismn/util@0.2.1
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Encodes a given Uint8Array, ArrayBuffer or string into draft-mspotny-base58-03 RFC base58 representation:
|
|
3
|
-
* https://tools.ietf.org/id/draft-msporny-base58-01.html#rfc.section.1
|
|
4
|
-
*
|
|
5
|
-
* @param data
|
|
6
|
-
*
|
|
7
|
-
* @returns Encoded value
|
|
8
|
-
*/
|
|
9
|
-
export declare function encode(data: ArrayBuffer | string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Decodes a given b58 string according to draft-mspotny-base58-03 RFC base58 representation:
|
|
12
|
-
* https://tools.ietf.org/id/draft-msporny-base58-01.html#rfc.section.1
|
|
13
|
-
*
|
|
14
|
-
* @param b58
|
|
15
|
-
*
|
|
16
|
-
* @returns Decoded value
|
|
17
|
-
*/
|
|
18
|
-
export declare function decode(b58: string): Uint8Array;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from https://github.com/paritytech/capi-old copyright Parity Technologies (APACHE License 2.0)
|
|
3
|
-
* Changes August 19th 2023 :
|
|
4
|
-
* - updated to use subshape for scale decoding
|
|
5
|
-
* - adapted from deno to typescript
|
|
6
|
-
*
|
|
7
|
-
Copyright 2023 Parity Technologies
|
|
8
|
-
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
you may not use this file except in compliance with the License.
|
|
11
|
-
You may obtain a copy of the License at
|
|
12
|
-
|
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
See the License for the specific language governing permissions and
|
|
19
|
-
limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
import * as $ from "@talismn/subshape-fork";
|
|
22
|
-
export declare abstract class Hasher {
|
|
23
|
-
abstract create(): Hashing;
|
|
24
|
-
abstract digestLength: number;
|
|
25
|
-
abstract concat: boolean;
|
|
26
|
-
$hash<I, O>($inner: $.Shape<I, O>): $.Shape<I, O>;
|
|
27
|
-
hash(data: Uint8Array): Uint8Array;
|
|
28
|
-
}
|
|
29
|
-
export declare function $hash<I, O>(hasher: Hasher, $inner: $.Shape<I, O>): $.Shape<I, O>;
|
|
30
|
-
export declare class Blake2Hasher extends Hasher {
|
|
31
|
-
concat: boolean;
|
|
32
|
-
digestLength: number;
|
|
33
|
-
constructor(size: 64 | 128 | 256 | 512, concat: boolean);
|
|
34
|
-
create(): Hashing;
|
|
35
|
-
}
|
|
36
|
-
export declare class IdentityHasher extends Hasher {
|
|
37
|
-
digestLength: number;
|
|
38
|
-
concat: boolean;
|
|
39
|
-
create(): Hashing;
|
|
40
|
-
$hash<I, O>($inner: $.Shape<I, O>): $.Shape<I, O>;
|
|
41
|
-
hash(data: Uint8Array): Uint8Array;
|
|
42
|
-
}
|
|
43
|
-
export declare class TwoxHasher extends Hasher {
|
|
44
|
-
concat: boolean;
|
|
45
|
-
digestLength: number;
|
|
46
|
-
rounds: number;
|
|
47
|
-
constructor(size: 64 | 128 | 256, concat: boolean);
|
|
48
|
-
create(): Hashing;
|
|
49
|
-
}
|
|
50
|
-
export interface Hashing {
|
|
51
|
-
update(data: Uint8Array): void;
|
|
52
|
-
digestInto(array: Uint8Array): void;
|
|
53
|
-
dispose?(): void;
|
|
54
|
-
}
|
|
55
|
-
export declare const blake2_64: Blake2Hasher;
|
|
56
|
-
export declare const blake2_128: Blake2Hasher;
|
|
57
|
-
export declare const blake2_128Concat: Blake2Hasher;
|
|
58
|
-
export declare const blake2_256: Blake2Hasher;
|
|
59
|
-
export declare const blake2_512: Blake2Hasher;
|
|
60
|
-
export declare const identity: IdentityHasher;
|
|
61
|
-
export declare const twox64: TwoxHasher;
|
|
62
|
-
export declare const twox128: TwoxHasher;
|
|
63
|
-
export declare const twox256: TwoxHasher;
|
|
64
|
-
export declare const twox64Concat: TwoxHasher;
|
|
65
|
-
export declare class DecodeNonTransparentKeyError extends Error {
|
|
66
|
-
readonly name = "DecodeNonTransparentKeyError";
|
|
67
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare function encode(prefix: number, payload: Uint8Array, checksumLength?: number): string;
|
|
2
|
-
export declare function encodeRaw(prefix: number, payload: Uint8Array, checksumLength?: number): Uint8Array;
|
|
3
|
-
export type EncodeError = InvalidPayloadLengthError;
|
|
4
|
-
export declare class InvalidPayloadLengthError extends Error {
|
|
5
|
-
readonly name = "InvalidPayloadLengthError";
|
|
6
|
-
}
|
|
7
|
-
export type DecodeResult = [prefix: number, pubKey: Uint8Array];
|
|
8
|
-
export declare function decode(address: string): DecodeResult;
|
|
9
|
-
export declare function decodeRaw(address: Uint8Array): DecodeResult;
|
|
10
|
-
export type DecodeError = InvalidAddressLengthError | InvalidAddressChecksumError;
|
|
11
|
-
export declare class InvalidAddressLengthError extends Error {
|
|
12
|
-
readonly name = "InvalidAddressError";
|
|
13
|
-
}
|
|
14
|
-
export declare class InvalidAddressChecksumError extends Error {
|
|
15
|
-
readonly name = "InvalidAddressChecksumError";
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Hasher } from "wat-the-crypto/types/common/hasher";
|
|
2
|
-
export declare class Xxhash implements Hasher {
|
|
3
|
-
rounds: number;
|
|
4
|
-
input: Uint8Array;
|
|
5
|
-
constructor(rounds: number);
|
|
6
|
-
update(input: Uint8Array): void;
|
|
7
|
-
digest(): Uint8Array;
|
|
8
|
-
digestInto(digest: Uint8Array): void;
|
|
9
|
-
dispose(): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class Blake2b implements Hasher {
|
|
12
|
-
digestSize: number;
|
|
13
|
-
input: Uint8Array;
|
|
14
|
-
constructor(digestSize?: number);
|
|
15
|
-
update(input: Uint8Array): void;
|
|
16
|
-
digest(): Uint8Array;
|
|
17
|
-
digestInto(digest: Uint8Array): void;
|
|
18
|
-
dispose(): void;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Blake2b, Xxhash } from "wat-the-crypto";
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from https://github.com/paritytech/capi-old copyright Parity Technologies (APACHE License 2.0)
|
|
3
|
-
* Changes August 19th 2023 :
|
|
4
|
-
* - updated to use subshape for scale decoding
|
|
5
|
-
* - adapted from deno to typescript
|
|
6
|
-
*
|
|
7
|
-
Copyright 2023 Parity Technologies
|
|
8
|
-
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
you may not use this file except in compliance with the License.
|
|
11
|
-
You may obtain a copy of the License at
|
|
12
|
-
|
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
See the License for the specific language governing permissions and
|
|
19
|
-
limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
import * as $ from "@talismn/subshape-fork";
|
|
22
|
-
import { FrameMetadata } from "./FrameMetadata";
|
|
23
|
-
export interface Extrinsic<M extends FrameMetadata> {
|
|
24
|
-
protocolVersion: number;
|
|
25
|
-
signature?: {
|
|
26
|
-
sender: {
|
|
27
|
-
address: $.Output<M["extrinsic"]["address"]>;
|
|
28
|
-
sign: Signer<M>;
|
|
29
|
-
};
|
|
30
|
-
extra: $.Output<M["extrinsic"]["extra"]>;
|
|
31
|
-
additional: $.Output<M["extrinsic"]["additional"]>;
|
|
32
|
-
sig?: never;
|
|
33
|
-
} | {
|
|
34
|
-
sender: {
|
|
35
|
-
address: $.Output<M["extrinsic"]["address"]>;
|
|
36
|
-
sign?: Signer<M>;
|
|
37
|
-
};
|
|
38
|
-
extra: $.Output<M["extrinsic"]["extra"]>;
|
|
39
|
-
additional?: never;
|
|
40
|
-
sig: $.Output<M["extrinsic"]["signature"]>;
|
|
41
|
-
};
|
|
42
|
-
call: $.Output<M["extrinsic"]["call"]>;
|
|
43
|
-
}
|
|
44
|
-
export type Signer<M extends FrameMetadata> = (message: Uint8Array, fullData: Uint8Array) => $.Output<M["extrinsic"]["signature"]> | Promise<$.Output<M["extrinsic"]["signature"]>>;
|
|
45
|
-
export declare function $extrinsic<M extends FrameMetadata>(metadata: M): $.Shape<Extrinsic<M>>;
|
|
46
|
-
export declare class SignerError extends Error {
|
|
47
|
-
readonly inner: unknown;
|
|
48
|
-
readonly name = "SignerError";
|
|
49
|
-
constructor(inner: unknown);
|
|
50
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from https://github.com/paritytech/capi-old copyright Parity Technologies (APACHE License 2.0)
|
|
3
|
-
* Changes August 19th 2023 :
|
|
4
|
-
* - updated to use subshape for scale decoding
|
|
5
|
-
* - adapted from deno to typescript
|
|
6
|
-
*
|
|
7
|
-
Copyright 2023 Parity Technologies
|
|
8
|
-
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
you may not use this file except in compliance with the License.
|
|
11
|
-
You may obtain a copy of the License at
|
|
12
|
-
|
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
See the License for the specific language governing permissions and
|
|
19
|
-
limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
import * as $ from "@talismn/subshape-fork";
|
|
22
|
-
export interface FrameMetadata {
|
|
23
|
-
types: Record<string, $.AnyShape>;
|
|
24
|
-
paths: Record<string, $.AnyShape>;
|
|
25
|
-
pallets: Record<string, Pallet>;
|
|
26
|
-
extrinsic: {
|
|
27
|
-
call: $.AnyShape;
|
|
28
|
-
signature: $.AnyShape;
|
|
29
|
-
address: $.AnyShape;
|
|
30
|
-
extra: $.AnyShape;
|
|
31
|
-
additional: $.AnyShape;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface Pallet {
|
|
35
|
-
id: number;
|
|
36
|
-
name: string;
|
|
37
|
-
storagePrefix: string;
|
|
38
|
-
storage: Record<string, StorageEntry>;
|
|
39
|
-
constants: Record<string, Constant>;
|
|
40
|
-
types: {
|
|
41
|
-
call?: $.AnyShape;
|
|
42
|
-
event?: $.AnyShape;
|
|
43
|
-
error?: $.AnyShape;
|
|
44
|
-
};
|
|
45
|
-
docs: string;
|
|
46
|
-
}
|
|
47
|
-
export interface StorageEntry {
|
|
48
|
-
singular: boolean;
|
|
49
|
-
name: string;
|
|
50
|
-
key: $.AnyShape;
|
|
51
|
-
partialKey: $.AnyShape;
|
|
52
|
-
value: $.AnyShape;
|
|
53
|
-
default?: Uint8Array;
|
|
54
|
-
docs: string;
|
|
55
|
-
}
|
|
56
|
-
export interface Constant {
|
|
57
|
-
name: string;
|
|
58
|
-
codec: $.AnyShape;
|
|
59
|
-
value: Uint8Array;
|
|
60
|
-
docs: string;
|
|
61
|
-
}
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from https://github.com/paritytech/capi-old copyright Parity Technologies (APACHE License 2.0)
|
|
3
|
-
* Changes August 19th 2023 :
|
|
4
|
-
* - updated to use subshape for scale decoding
|
|
5
|
-
* - adapted from deno to typescript
|
|
6
|
-
*
|
|
7
|
-
Copyright 2023 Parity Technologies
|
|
8
|
-
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
you may not use this file except in compliance with the License.
|
|
11
|
-
You may obtain a copy of the License at
|
|
12
|
-
|
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
See the License for the specific language governing permissions and
|
|
19
|
-
limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
import * as $ from "@talismn/subshape-fork";
|
|
22
|
-
export declare function decodeMetadata(encoded: Uint8Array): import("./FrameMetadata").FrameMetadata;
|
|
23
|
-
export declare const $metadataV14: $.Shape<{
|
|
24
|
-
readonly magicNumber: 1635018093;
|
|
25
|
-
readonly version: 14;
|
|
26
|
-
readonly tys: readonly ({
|
|
27
|
-
readonly id: number;
|
|
28
|
-
readonly path: readonly string[];
|
|
29
|
-
readonly params: readonly {
|
|
30
|
-
readonly name: string;
|
|
31
|
-
readonly ty?: number | undefined;
|
|
32
|
-
}[];
|
|
33
|
-
readonly type: "Struct";
|
|
34
|
-
readonly fields: readonly {
|
|
35
|
-
readonly name?: string | undefined;
|
|
36
|
-
readonly ty: number;
|
|
37
|
-
readonly typeName?: string | undefined;
|
|
38
|
-
readonly docs: readonly string[];
|
|
39
|
-
}[];
|
|
40
|
-
readonly docs: readonly string[];
|
|
41
|
-
} | {
|
|
42
|
-
readonly id: number;
|
|
43
|
-
readonly path: readonly string[];
|
|
44
|
-
readonly params: readonly {
|
|
45
|
-
readonly name: string;
|
|
46
|
-
readonly ty?: number | undefined;
|
|
47
|
-
}[];
|
|
48
|
-
readonly type: "Union";
|
|
49
|
-
readonly members: readonly {
|
|
50
|
-
readonly name: string;
|
|
51
|
-
readonly fields: readonly {
|
|
52
|
-
readonly name?: string | undefined;
|
|
53
|
-
readonly ty: number;
|
|
54
|
-
readonly typeName?: string | undefined;
|
|
55
|
-
readonly docs: readonly string[];
|
|
56
|
-
}[];
|
|
57
|
-
readonly index: number;
|
|
58
|
-
readonly docs: readonly string[];
|
|
59
|
-
}[];
|
|
60
|
-
readonly docs: readonly string[];
|
|
61
|
-
} | {
|
|
62
|
-
readonly id: number;
|
|
63
|
-
readonly path: readonly string[];
|
|
64
|
-
readonly params: readonly {
|
|
65
|
-
readonly name: string;
|
|
66
|
-
readonly ty?: number | undefined;
|
|
67
|
-
}[];
|
|
68
|
-
readonly type: "Sequence";
|
|
69
|
-
readonly typeParam: number;
|
|
70
|
-
readonly docs: readonly string[];
|
|
71
|
-
} | {
|
|
72
|
-
readonly id: number;
|
|
73
|
-
readonly path: readonly string[];
|
|
74
|
-
readonly params: readonly {
|
|
75
|
-
readonly name: string;
|
|
76
|
-
readonly ty?: number | undefined;
|
|
77
|
-
}[];
|
|
78
|
-
readonly type: "SizedArray";
|
|
79
|
-
readonly len: number;
|
|
80
|
-
readonly typeParam: number;
|
|
81
|
-
readonly docs: readonly string[];
|
|
82
|
-
} | {
|
|
83
|
-
readonly id: number;
|
|
84
|
-
readonly path: readonly string[];
|
|
85
|
-
readonly params: readonly {
|
|
86
|
-
readonly name: string;
|
|
87
|
-
readonly ty?: number | undefined;
|
|
88
|
-
}[];
|
|
89
|
-
readonly type: "Tuple";
|
|
90
|
-
readonly fields: readonly number[];
|
|
91
|
-
readonly docs: readonly string[];
|
|
92
|
-
} | {
|
|
93
|
-
readonly id: number;
|
|
94
|
-
readonly path: readonly string[];
|
|
95
|
-
readonly params: readonly {
|
|
96
|
-
readonly name: string;
|
|
97
|
-
readonly ty?: number | undefined;
|
|
98
|
-
}[];
|
|
99
|
-
readonly type: "Primitive";
|
|
100
|
-
readonly kind: "bool" | "char" | "str" | "u8" | "u16" | "u32" | "u64" | "u128" | "u256" | "i8" | "i16" | "i32" | "i64" | "i128" | "i256";
|
|
101
|
-
readonly docs: readonly string[];
|
|
102
|
-
} | {
|
|
103
|
-
readonly id: number;
|
|
104
|
-
readonly path: readonly string[];
|
|
105
|
-
readonly params: readonly {
|
|
106
|
-
readonly name: string;
|
|
107
|
-
readonly ty?: number | undefined;
|
|
108
|
-
}[];
|
|
109
|
-
readonly type: "Compact";
|
|
110
|
-
readonly typeParam: number;
|
|
111
|
-
readonly docs: readonly string[];
|
|
112
|
-
} | {
|
|
113
|
-
readonly id: number;
|
|
114
|
-
readonly path: readonly string[];
|
|
115
|
-
readonly params: readonly {
|
|
116
|
-
readonly name: string;
|
|
117
|
-
readonly ty?: number | undefined;
|
|
118
|
-
}[];
|
|
119
|
-
readonly type: "BitSequence";
|
|
120
|
-
readonly bitOrderType: number;
|
|
121
|
-
readonly bitStoreType: number;
|
|
122
|
-
readonly docs: readonly string[];
|
|
123
|
-
})[];
|
|
124
|
-
readonly pallets: readonly {
|
|
125
|
-
readonly name: string;
|
|
126
|
-
readonly storage?: {
|
|
127
|
-
readonly prefix: string;
|
|
128
|
-
readonly entries: readonly ({
|
|
129
|
-
readonly name: string;
|
|
130
|
-
readonly modifier: string;
|
|
131
|
-
readonly type: "Plain";
|
|
132
|
-
readonly value: number;
|
|
133
|
-
readonly default: Uint8Array;
|
|
134
|
-
readonly docs: readonly string[];
|
|
135
|
-
} | {
|
|
136
|
-
readonly name: string;
|
|
137
|
-
readonly modifier: string;
|
|
138
|
-
readonly type: "Map";
|
|
139
|
-
readonly hashers: readonly ("blake2_128" | "blake2_256" | "blake2_128Concat" | "twox128" | "twox256" | "twox64Concat" | "identity")[];
|
|
140
|
-
readonly key: number;
|
|
141
|
-
readonly value: number;
|
|
142
|
-
readonly default: Uint8Array;
|
|
143
|
-
readonly docs: readonly string[];
|
|
144
|
-
})[];
|
|
145
|
-
} | undefined;
|
|
146
|
-
readonly calls?: number | undefined;
|
|
147
|
-
readonly event?: number | undefined;
|
|
148
|
-
readonly constants: readonly {
|
|
149
|
-
readonly name: string;
|
|
150
|
-
readonly ty: number;
|
|
151
|
-
readonly value: Uint8Array;
|
|
152
|
-
readonly docs: readonly string[];
|
|
153
|
-
}[];
|
|
154
|
-
readonly error?: number | undefined;
|
|
155
|
-
readonly id: number;
|
|
156
|
-
}[];
|
|
157
|
-
readonly extrinsic: {
|
|
158
|
-
readonly ty: number;
|
|
159
|
-
readonly version: number;
|
|
160
|
-
readonly signedExtensions: readonly {
|
|
161
|
-
readonly ident: string;
|
|
162
|
-
readonly ty: number;
|
|
163
|
-
readonly additionalSigned: number;
|
|
164
|
-
}[];
|
|
165
|
-
};
|
|
166
|
-
readonly runtime: number;
|
|
167
|
-
}, {
|
|
168
|
-
magicNumber: 1635018093;
|
|
169
|
-
version: 14;
|
|
170
|
-
tys: ({
|
|
171
|
-
id: number;
|
|
172
|
-
path: string[];
|
|
173
|
-
params: {
|
|
174
|
-
name: string;
|
|
175
|
-
ty?: number | undefined;
|
|
176
|
-
}[];
|
|
177
|
-
type: "Struct";
|
|
178
|
-
fields: {
|
|
179
|
-
name?: string | undefined;
|
|
180
|
-
ty: number;
|
|
181
|
-
typeName?: string | undefined;
|
|
182
|
-
docs: string[];
|
|
183
|
-
}[];
|
|
184
|
-
docs: string[];
|
|
185
|
-
} | {
|
|
186
|
-
id: number;
|
|
187
|
-
path: string[];
|
|
188
|
-
params: {
|
|
189
|
-
name: string;
|
|
190
|
-
ty?: number | undefined;
|
|
191
|
-
}[];
|
|
192
|
-
type: "Union";
|
|
193
|
-
members: {
|
|
194
|
-
name: string;
|
|
195
|
-
fields: {
|
|
196
|
-
name?: string | undefined;
|
|
197
|
-
ty: number;
|
|
198
|
-
typeName?: string | undefined;
|
|
199
|
-
docs: string[];
|
|
200
|
-
}[];
|
|
201
|
-
index: number;
|
|
202
|
-
docs: string[];
|
|
203
|
-
}[];
|
|
204
|
-
docs: string[];
|
|
205
|
-
} | {
|
|
206
|
-
id: number;
|
|
207
|
-
path: string[];
|
|
208
|
-
params: {
|
|
209
|
-
name: string;
|
|
210
|
-
ty?: number | undefined;
|
|
211
|
-
}[];
|
|
212
|
-
type: "Sequence";
|
|
213
|
-
typeParam: number;
|
|
214
|
-
docs: string[];
|
|
215
|
-
} | {
|
|
216
|
-
id: number;
|
|
217
|
-
path: string[];
|
|
218
|
-
params: {
|
|
219
|
-
name: string;
|
|
220
|
-
ty?: number | undefined;
|
|
221
|
-
}[];
|
|
222
|
-
type: "SizedArray";
|
|
223
|
-
len: number;
|
|
224
|
-
typeParam: number;
|
|
225
|
-
docs: string[];
|
|
226
|
-
} | {
|
|
227
|
-
id: number;
|
|
228
|
-
path: string[];
|
|
229
|
-
params: {
|
|
230
|
-
name: string;
|
|
231
|
-
ty?: number | undefined;
|
|
232
|
-
}[];
|
|
233
|
-
type: "Tuple";
|
|
234
|
-
fields: number[];
|
|
235
|
-
docs: string[];
|
|
236
|
-
} | {
|
|
237
|
-
id: number;
|
|
238
|
-
path: string[];
|
|
239
|
-
params: {
|
|
240
|
-
name: string;
|
|
241
|
-
ty?: number | undefined;
|
|
242
|
-
}[];
|
|
243
|
-
type: "Primitive";
|
|
244
|
-
kind: "bool" | "char" | "str" | "u8" | "u16" | "u32" | "u64" | "u128" | "u256" | "i8" | "i16" | "i32" | "i64" | "i128" | "i256";
|
|
245
|
-
docs: string[];
|
|
246
|
-
} | {
|
|
247
|
-
id: number;
|
|
248
|
-
path: string[];
|
|
249
|
-
params: {
|
|
250
|
-
name: string;
|
|
251
|
-
ty?: number | undefined;
|
|
252
|
-
}[];
|
|
253
|
-
type: "Compact";
|
|
254
|
-
typeParam: number;
|
|
255
|
-
docs: string[];
|
|
256
|
-
} | {
|
|
257
|
-
id: number;
|
|
258
|
-
path: string[];
|
|
259
|
-
params: {
|
|
260
|
-
name: string;
|
|
261
|
-
ty?: number | undefined;
|
|
262
|
-
}[];
|
|
263
|
-
type: "BitSequence";
|
|
264
|
-
bitOrderType: number;
|
|
265
|
-
bitStoreType: number;
|
|
266
|
-
docs: string[];
|
|
267
|
-
})[];
|
|
268
|
-
pallets: {
|
|
269
|
-
name: string;
|
|
270
|
-
storage?: {
|
|
271
|
-
prefix: string;
|
|
272
|
-
entries: ({
|
|
273
|
-
name: string;
|
|
274
|
-
modifier: string;
|
|
275
|
-
type: "Plain";
|
|
276
|
-
value: number;
|
|
277
|
-
default: Uint8Array;
|
|
278
|
-
docs: string[];
|
|
279
|
-
} | {
|
|
280
|
-
name: string;
|
|
281
|
-
modifier: string;
|
|
282
|
-
type: "Map";
|
|
283
|
-
hashers: ("blake2_128" | "blake2_256" | "blake2_128Concat" | "twox128" | "twox256" | "twox64Concat" | "identity")[];
|
|
284
|
-
key: number;
|
|
285
|
-
value: number;
|
|
286
|
-
default: Uint8Array;
|
|
287
|
-
docs: string[];
|
|
288
|
-
})[];
|
|
289
|
-
} | undefined;
|
|
290
|
-
calls?: number | undefined;
|
|
291
|
-
event?: number | undefined;
|
|
292
|
-
constants: {
|
|
293
|
-
name: string;
|
|
294
|
-
ty: number;
|
|
295
|
-
value: Uint8Array;
|
|
296
|
-
docs: string[];
|
|
297
|
-
}[];
|
|
298
|
-
error?: number | undefined;
|
|
299
|
-
id: number;
|
|
300
|
-
}[];
|
|
301
|
-
extrinsic: {
|
|
302
|
-
ty: number;
|
|
303
|
-
version: number;
|
|
304
|
-
signedExtensions: {
|
|
305
|
-
ident: string;
|
|
306
|
-
ty: number;
|
|
307
|
-
additionalSigned: number;
|
|
308
|
-
}[];
|
|
309
|
-
};
|
|
310
|
-
runtime: number;
|
|
311
|
-
}>;
|
|
312
|
-
export type MetadataV14 = $.Output<typeof $metadataV14>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Adapted from https://github.com/paritytech/capi-old copyright Parity Technologies (APACHE License 2.0)
|
|
3
|
-
* Changes August 19th 2023 :
|
|
4
|
-
* - updated to use subshape for scale decoding
|
|
5
|
-
* - adapted from deno to typescript
|
|
6
|
-
*
|
|
7
|
-
Copyright 2023 Parity Technologies
|
|
8
|
-
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
you may not use this file except in compliance with the License.
|
|
11
|
-
You may obtain a copy of the License at
|
|
12
|
-
|
|
13
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
|
|
15
|
-
Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
See the License for the specific language governing permissions and
|
|
19
|
-
limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
import * as $ from "@talismn/subshape-fork";
|
|
22
|
-
export declare function $storageKey<I, O>(palletName: string, entryName: string, $key: $.Shape<I, O>): $.Shape<I, O>;
|
|
23
|
-
export declare const $emptyKey: $.Shape<void, void>;
|
|
24
|
-
export declare const $partialEmptyKey: $.Shape<void | null, void | null>;
|
|
25
|
-
export declare function $partialSingleKey<I, O>($inner: $.Shape<I, O>): $.Shape<I | null, O | null>;
|
|
26
|
-
export type PartialMultiKey<T extends unknown[]> = T extends [...infer A, any] ? T | PartialMultiKey<A> : T | null;
|
|
27
|
-
export declare function $partialMultiKey<T extends $.AnyShape[]>(...keys: [...T]): $.Shape<PartialMultiKey<$.OutputTuple<T>>>;
|