@talismn/scale 0.0.2 → 0.1.0
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 +20 -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 +29 -0
- package/dist/talismn-scale.cjs.dev.js +299 -1648
- package/dist/talismn-scale.cjs.prod.js +299 -1648
- package/dist/talismn-scale.esm.js +265 -1574
- 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
|
@@ -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
|
-
import { FrameMetadata } from "../FrameMetadata";
|
|
23
|
-
export declare const $metadata: $.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 declare function transformMetadata(metadata: $.Output<typeof $metadata>): FrameMetadata;
|
|
@@ -1,26 +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
|
-
export declare class ChainError<T> extends Error {
|
|
22
|
-
value: T;
|
|
23
|
-
readonly name = "ChainError";
|
|
24
|
-
constructor(value: T);
|
|
25
|
-
static toArgs: <T_1>(x: ChainError<T_1>) => [T_1];
|
|
26
|
-
}
|
|
@@ -1,33 +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 type Era = {
|
|
23
|
-
type: "Immortal";
|
|
24
|
-
} | {
|
|
25
|
-
type: "Mortal";
|
|
26
|
-
period: bigint;
|
|
27
|
-
phase: bigint;
|
|
28
|
-
};
|
|
29
|
-
export declare namespace Era {
|
|
30
|
-
const Immortal: Era;
|
|
31
|
-
function Mortal(period: bigint, current: bigint): Era;
|
|
32
|
-
}
|
|
33
|
-
export declare const $era: $.Shape<Era>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Era";
|
|
@@ -1,23 +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 { Ty } from "../raw/Ty";
|
|
23
|
-
export declare const overrides: Record<string, (ty: Ty, visit: (i: number) => $.AnyShape) => $.AnyShape>;
|