@polkadot/types-create 14.0.1 → 14.2.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/cjs/bundle.d.ts +3 -0
- package/cjs/create/class.d.ts +5 -0
- package/cjs/create/index.d.ts +2 -0
- package/cjs/create/type.d.ts +3 -0
- package/cjs/exports.d.ts +2 -0
- package/cjs/index.d.ts +2 -0
- package/cjs/packageDetect.d.ts +1 -0
- package/cjs/packageInfo.d.ts +6 -0
- package/cjs/packageInfo.js +1 -1
- package/cjs/types/augmentRegistry.d.ts +11 -0
- package/cjs/types/index.d.ts +4 -0
- package/cjs/types/lookup.d.ts +14 -0
- package/cjs/types/types.d.ts +43 -0
- package/cjs/util/encodeTypes.d.ts +11 -0
- package/cjs/util/getTypeDef.d.ts +8 -0
- package/cjs/util/index.d.ts +4 -0
- package/cjs/util/typeSplit.d.ts +1 -0
- package/cjs/util/xcm.d.ts +2 -0
- package/package.json +220 -76
- package/packageInfo.js +1 -1
package/cjs/bundle.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Codec, CodecClass, Registry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { TypeDef } from '../types/index.js';
|
|
3
|
+
export declare function constructTypeClass<T extends Codec = Codec>(registry: Registry, typeDef: TypeDef): CodecClass<T>;
|
|
4
|
+
export declare function getTypeClass<T extends Codec = Codec>(registry: Registry, typeDef: TypeDef): CodecClass<T>;
|
|
5
|
+
export declare function createClassUnsafe<T extends Codec = Codec, K extends string = string>(registry: Registry, type: K): CodecClass<T>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Codec, Registry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { CreateOptions } from '../types/index.js';
|
|
3
|
+
export declare function createTypeUnsafe<T extends Codec = Codec, K extends string = string>(registry: Registry, type: K, params?: unknown[], options?: CreateOptions): T;
|
package/cjs/exports.d.ts
ADDED
package/cjs/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/cjs/packageInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.packageInfo = void 0;
|
|
4
|
-
exports.packageInfo = { name: '@polkadot/types-create', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.
|
|
4
|
+
exports.packageInfo = { name: '@polkadot/types-create', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.2.1' };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import '@polkadot/types-codec/types/registry';
|
|
2
|
+
import type { Codec, CodecClass, ICompact, INumber, LookupString } from '@polkadot/types-codec/types';
|
|
3
|
+
import type { ILookup, TypeDef } from '@polkadot/types-create/types';
|
|
4
|
+
declare module '@polkadot/types-codec/types/registry' {
|
|
5
|
+
interface Registry {
|
|
6
|
+
readonly lookup: ILookup;
|
|
7
|
+
createLookupType(lookupId: ICompact<INumber> | number): LookupString;
|
|
8
|
+
getUnsafe<T extends Codec = Codec, K extends string = string>(name: K, withUnknown?: boolean, knownTypeDef?: TypeDef): CodecClass<T> | undefined;
|
|
9
|
+
setLookup(lookup: ILookup): void;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Option, Text } from '@polkadot/types-codec';
|
|
2
|
+
import type { ICompact, INumber, LookupString } from '@polkadot/types-codec/types';
|
|
3
|
+
import type { TypeDef } from './types.js';
|
|
4
|
+
interface SiTypeBase {
|
|
5
|
+
def: {
|
|
6
|
+
asTuple: ICompact<INumber>[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface ILookup {
|
|
10
|
+
getSiType(lookupId: ICompact<INumber> | LookupString | number): SiTypeBase;
|
|
11
|
+
getTypeDef(lookupId: ICompact<INumber> | LookupString | number): TypeDef;
|
|
12
|
+
sanitizeField(name: Option<Text>): [string | null, string | null];
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare enum TypeDefInfo {
|
|
2
|
+
BTreeMap = 0,
|
|
3
|
+
BTreeSet = 1,
|
|
4
|
+
Compact = 2,
|
|
5
|
+
DoNotConstruct = 3,
|
|
6
|
+
Enum = 4,
|
|
7
|
+
HashMap = 5,
|
|
8
|
+
Int = 6,
|
|
9
|
+
Linkage = 7,
|
|
10
|
+
Null = 8,
|
|
11
|
+
Option = 9,
|
|
12
|
+
Plain = 10,
|
|
13
|
+
Range = 11,
|
|
14
|
+
RangeInclusive = 12,
|
|
15
|
+
Result = 13,
|
|
16
|
+
Set = 14,
|
|
17
|
+
Si = 15,
|
|
18
|
+
Struct = 16,
|
|
19
|
+
Tuple = 17,
|
|
20
|
+
UInt = 18,
|
|
21
|
+
Vec = 19,
|
|
22
|
+
VecFixed = 20,
|
|
23
|
+
WrapperKeepOpaque = 21,
|
|
24
|
+
WrapperOpaque = 22
|
|
25
|
+
}
|
|
26
|
+
export interface TypeDef {
|
|
27
|
+
alias?: Map<string, string> | undefined;
|
|
28
|
+
displayName?: string | undefined;
|
|
29
|
+
docs?: string[] | undefined;
|
|
30
|
+
fallbackType?: string | undefined;
|
|
31
|
+
info: TypeDefInfo;
|
|
32
|
+
index?: number;
|
|
33
|
+
isFromSi?: boolean;
|
|
34
|
+
length?: number;
|
|
35
|
+
lookupIndex?: number;
|
|
36
|
+
lookupName?: string | undefined;
|
|
37
|
+
lookupNameRoot?: string | undefined;
|
|
38
|
+
name?: string | undefined;
|
|
39
|
+
namespace?: string | undefined;
|
|
40
|
+
sub?: TypeDef | TypeDef[];
|
|
41
|
+
type: string;
|
|
42
|
+
typeName?: string | undefined;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Registry } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { TypeDef } from '@polkadot/types-create/types';
|
|
3
|
+
interface ToString {
|
|
4
|
+
toString: () => string;
|
|
5
|
+
}
|
|
6
|
+
export declare function paramsNotation<T extends ToString>(outer: string, inner?: T | T[], transform?: (_: T) => string): string;
|
|
7
|
+
export declare function encodeTypeDef(registry: Registry, typeDef: TypeDef): string;
|
|
8
|
+
export declare function withTypeString(registry: Registry, typeDef: Omit<TypeDef, 'type'> & {
|
|
9
|
+
type?: string;
|
|
10
|
+
}): TypeDef;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyString } from '@polkadot/types-codec/types';
|
|
2
|
+
import type { TypeDef } from '@polkadot/types-create/types';
|
|
3
|
+
interface TypeDefOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
displayName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function getTypeDef(_type: AnyString, { displayName, name }?: TypeDefOptions, count?: number): TypeDef;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function typeSplit(type: string): string[];
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./cjs/packageDetect.js"
|
|
19
19
|
],
|
|
20
20
|
"type": "module",
|
|
21
|
-
"version": "14.
|
|
21
|
+
"version": "14.2.1",
|
|
22
22
|
"main": "./cjs/index.js",
|
|
23
23
|
"module": "./index.js",
|
|
24
24
|
"types": "./index.d.ts",
|
|
@@ -26,121 +26,265 @@
|
|
|
26
26
|
"./cjs/package.json": "./cjs/package.json",
|
|
27
27
|
"./cjs/*": "./cjs/*.js",
|
|
28
28
|
".": {
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
"module": {
|
|
30
|
+
"types": "./index.d.ts",
|
|
31
|
+
"default": "./index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./cjs/index.d.ts",
|
|
35
|
+
"default": "./cjs/index.js"
|
|
36
|
+
},
|
|
37
|
+
"default": {
|
|
38
|
+
"types": "./index.d.ts",
|
|
39
|
+
"default": "./index.js"
|
|
40
|
+
}
|
|
33
41
|
},
|
|
34
42
|
"./bundle": {
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
"module": {
|
|
44
|
+
"types": "./bundle.d.ts",
|
|
45
|
+
"default": "./bundle.js"
|
|
46
|
+
},
|
|
47
|
+
"require": {
|
|
48
|
+
"types": "./cjs/bundle.d.ts",
|
|
49
|
+
"default": "./cjs/bundle.js"
|
|
50
|
+
},
|
|
51
|
+
"default": {
|
|
52
|
+
"types": "./bundle.d.ts",
|
|
53
|
+
"default": "./bundle.js"
|
|
54
|
+
}
|
|
39
55
|
},
|
|
40
56
|
"./create": {
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
"module": {
|
|
58
|
+
"types": "./create/index.d.ts",
|
|
59
|
+
"default": "./create/index.js"
|
|
60
|
+
},
|
|
61
|
+
"require": {
|
|
62
|
+
"types": "./cjs/create/index.d.ts",
|
|
63
|
+
"default": "./cjs/create/index.js"
|
|
64
|
+
},
|
|
65
|
+
"default": {
|
|
66
|
+
"types": "./create/index.d.ts",
|
|
67
|
+
"default": "./create/index.js"
|
|
68
|
+
}
|
|
45
69
|
},
|
|
46
70
|
"./create/class": {
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
71
|
+
"module": {
|
|
72
|
+
"types": "./create/class.d.ts",
|
|
73
|
+
"default": "./create/class.js"
|
|
74
|
+
},
|
|
75
|
+
"require": {
|
|
76
|
+
"types": "./cjs/create/class.d.ts",
|
|
77
|
+
"default": "./cjs/create/class.js"
|
|
78
|
+
},
|
|
79
|
+
"default": {
|
|
80
|
+
"types": "./create/class.d.ts",
|
|
81
|
+
"default": "./create/class.js"
|
|
82
|
+
}
|
|
51
83
|
},
|
|
52
84
|
"./create/type": {
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
85
|
+
"module": {
|
|
86
|
+
"types": "./create/type.d.ts",
|
|
87
|
+
"default": "./create/type.js"
|
|
88
|
+
},
|
|
89
|
+
"require": {
|
|
90
|
+
"types": "./cjs/create/type.d.ts",
|
|
91
|
+
"default": "./cjs/create/type.js"
|
|
92
|
+
},
|
|
93
|
+
"default": {
|
|
94
|
+
"types": "./create/type.d.ts",
|
|
95
|
+
"default": "./create/type.js"
|
|
96
|
+
}
|
|
57
97
|
},
|
|
58
98
|
"./exports": {
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
99
|
+
"module": {
|
|
100
|
+
"types": "./exports.d.ts",
|
|
101
|
+
"default": "./exports.js"
|
|
102
|
+
},
|
|
103
|
+
"require": {
|
|
104
|
+
"types": "./cjs/exports.d.ts",
|
|
105
|
+
"default": "./cjs/exports.js"
|
|
106
|
+
},
|
|
107
|
+
"default": {
|
|
108
|
+
"types": "./exports.d.ts",
|
|
109
|
+
"default": "./exports.js"
|
|
110
|
+
}
|
|
63
111
|
},
|
|
64
112
|
"./package.json": {
|
|
65
113
|
"require": "./cjs/package.json",
|
|
66
114
|
"default": "./package.json"
|
|
67
115
|
},
|
|
68
116
|
"./packageDetect": {
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
117
|
+
"module": {
|
|
118
|
+
"types": "./packageDetect.d.ts",
|
|
119
|
+
"default": "./packageDetect.js"
|
|
120
|
+
},
|
|
121
|
+
"require": {
|
|
122
|
+
"types": "./cjs/packageDetect.d.ts",
|
|
123
|
+
"default": "./cjs/packageDetect.js"
|
|
124
|
+
},
|
|
125
|
+
"default": {
|
|
126
|
+
"types": "./packageDetect.d.ts",
|
|
127
|
+
"default": "./packageDetect.js"
|
|
128
|
+
}
|
|
73
129
|
},
|
|
74
130
|
"./packageInfo.js": {
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
131
|
+
"module": {
|
|
132
|
+
"types": "./packageInfo.d.ts",
|
|
133
|
+
"default": "./packageInfo.js"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./cjs/packageInfo.d.ts",
|
|
137
|
+
"default": "./cjs/packageInfo.js"
|
|
138
|
+
},
|
|
139
|
+
"default": {
|
|
140
|
+
"types": "./packageInfo.d.ts",
|
|
141
|
+
"default": "./packageInfo.js"
|
|
142
|
+
}
|
|
79
143
|
},
|
|
80
144
|
"./packageInfo": {
|
|
81
|
-
"
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
145
|
+
"module": {
|
|
146
|
+
"types": "./packageInfo.d.ts",
|
|
147
|
+
"default": "./packageInfo.js"
|
|
148
|
+
},
|
|
149
|
+
"require": {
|
|
150
|
+
"types": "./cjs/packageInfo.d.ts",
|
|
151
|
+
"default": "./cjs/packageInfo.js"
|
|
152
|
+
},
|
|
153
|
+
"default": {
|
|
154
|
+
"types": "./packageInfo.d.ts",
|
|
155
|
+
"default": "./packageInfo.js"
|
|
156
|
+
}
|
|
85
157
|
},
|
|
86
158
|
"./types": {
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
159
|
+
"module": {
|
|
160
|
+
"types": "./types/index.d.ts",
|
|
161
|
+
"default": "./types/index.js"
|
|
162
|
+
},
|
|
163
|
+
"require": {
|
|
164
|
+
"types": "./cjs/types/index.d.ts",
|
|
165
|
+
"default": "./cjs/types/index.js"
|
|
166
|
+
},
|
|
167
|
+
"default": {
|
|
168
|
+
"types": "./types/index.d.ts",
|
|
169
|
+
"default": "./types/index.js"
|
|
170
|
+
}
|
|
91
171
|
},
|
|
92
172
|
"./types/augmentRegistry": {
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
173
|
+
"module": {
|
|
174
|
+
"types": "./types/augmentRegistry.d.ts",
|
|
175
|
+
"default": "./types/augmentRegistry.js"
|
|
176
|
+
},
|
|
177
|
+
"require": {
|
|
178
|
+
"types": "./cjs/types/augmentRegistry.d.ts",
|
|
179
|
+
"default": "./cjs/types/augmentRegistry.js"
|
|
180
|
+
},
|
|
181
|
+
"default": {
|
|
182
|
+
"types": "./types/augmentRegistry.d.ts",
|
|
183
|
+
"default": "./types/augmentRegistry.js"
|
|
184
|
+
}
|
|
97
185
|
},
|
|
98
186
|
"./types/lookup": {
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
187
|
+
"module": {
|
|
188
|
+
"types": "./types/lookup.d.ts",
|
|
189
|
+
"default": "./types/lookup.js"
|
|
190
|
+
},
|
|
191
|
+
"require": {
|
|
192
|
+
"types": "./cjs/types/lookup.d.ts",
|
|
193
|
+
"default": "./cjs/types/lookup.js"
|
|
194
|
+
},
|
|
195
|
+
"default": {
|
|
196
|
+
"types": "./types/lookup.d.ts",
|
|
197
|
+
"default": "./types/lookup.js"
|
|
198
|
+
}
|
|
103
199
|
},
|
|
104
200
|
"./types/types": {
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
201
|
+
"module": {
|
|
202
|
+
"types": "./types/types.d.ts",
|
|
203
|
+
"default": "./types/types.js"
|
|
204
|
+
},
|
|
205
|
+
"require": {
|
|
206
|
+
"types": "./cjs/types/types.d.ts",
|
|
207
|
+
"default": "./cjs/types/types.js"
|
|
208
|
+
},
|
|
209
|
+
"default": {
|
|
210
|
+
"types": "./types/types.d.ts",
|
|
211
|
+
"default": "./types/types.js"
|
|
212
|
+
}
|
|
109
213
|
},
|
|
110
214
|
"./util": {
|
|
111
|
-
"
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
215
|
+
"module": {
|
|
216
|
+
"types": "./util/index.d.ts",
|
|
217
|
+
"default": "./util/index.js"
|
|
218
|
+
},
|
|
219
|
+
"require": {
|
|
220
|
+
"types": "./cjs/util/index.d.ts",
|
|
221
|
+
"default": "./cjs/util/index.js"
|
|
222
|
+
},
|
|
223
|
+
"default": {
|
|
224
|
+
"types": "./util/index.d.ts",
|
|
225
|
+
"default": "./util/index.js"
|
|
226
|
+
}
|
|
115
227
|
},
|
|
116
228
|
"./util/encodeTypes": {
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
229
|
+
"module": {
|
|
230
|
+
"types": "./util/encodeTypes.d.ts",
|
|
231
|
+
"default": "./util/encodeTypes.js"
|
|
232
|
+
},
|
|
233
|
+
"require": {
|
|
234
|
+
"types": "./cjs/util/encodeTypes.d.ts",
|
|
235
|
+
"default": "./cjs/util/encodeTypes.js"
|
|
236
|
+
},
|
|
237
|
+
"default": {
|
|
238
|
+
"types": "./util/encodeTypes.d.ts",
|
|
239
|
+
"default": "./util/encodeTypes.js"
|
|
240
|
+
}
|
|
121
241
|
},
|
|
122
242
|
"./util/getTypeDef": {
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
243
|
+
"module": {
|
|
244
|
+
"types": "./util/getTypeDef.d.ts",
|
|
245
|
+
"default": "./util/getTypeDef.js"
|
|
246
|
+
},
|
|
247
|
+
"require": {
|
|
248
|
+
"types": "./cjs/util/getTypeDef.d.ts",
|
|
249
|
+
"default": "./cjs/util/getTypeDef.js"
|
|
250
|
+
},
|
|
251
|
+
"default": {
|
|
252
|
+
"types": "./util/getTypeDef.d.ts",
|
|
253
|
+
"default": "./util/getTypeDef.js"
|
|
254
|
+
}
|
|
127
255
|
},
|
|
128
256
|
"./util/typeSplit": {
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
257
|
+
"module": {
|
|
258
|
+
"types": "./util/typeSplit.d.ts",
|
|
259
|
+
"default": "./util/typeSplit.js"
|
|
260
|
+
},
|
|
261
|
+
"require": {
|
|
262
|
+
"types": "./cjs/util/typeSplit.d.ts",
|
|
263
|
+
"default": "./cjs/util/typeSplit.js"
|
|
264
|
+
},
|
|
265
|
+
"default": {
|
|
266
|
+
"types": "./util/typeSplit.d.ts",
|
|
267
|
+
"default": "./util/typeSplit.js"
|
|
268
|
+
}
|
|
133
269
|
},
|
|
134
270
|
"./util/xcm": {
|
|
135
|
-
"
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
271
|
+
"module": {
|
|
272
|
+
"types": "./util/xcm.d.ts",
|
|
273
|
+
"default": "./util/xcm.js"
|
|
274
|
+
},
|
|
275
|
+
"require": {
|
|
276
|
+
"types": "./cjs/util/xcm.d.ts",
|
|
277
|
+
"default": "./cjs/util/xcm.js"
|
|
278
|
+
},
|
|
279
|
+
"default": {
|
|
280
|
+
"types": "./util/xcm.d.ts",
|
|
281
|
+
"default": "./util/xcm.js"
|
|
282
|
+
}
|
|
139
283
|
}
|
|
140
284
|
},
|
|
141
285
|
"dependencies": {
|
|
142
|
-
"@polkadot/types-codec": "14.
|
|
143
|
-
"@polkadot/util": "^13.
|
|
144
|
-
"tslib": "^2.
|
|
286
|
+
"@polkadot/types-codec": "14.2.1",
|
|
287
|
+
"@polkadot/util": "^13.2.2",
|
|
288
|
+
"tslib": "^2.8.0"
|
|
145
289
|
}
|
|
146
290
|
}
|
package/packageInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageInfo = { name: '@polkadot/types-create', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.
|
|
1
|
+
export const packageInfo = { name: '@polkadot/types-create', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.2.1' };
|