@subwallet/extension-base 0.3.6-1 → 0.4.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/LICENSE +201 -201
- package/README.md +10 -10
- package/background/KoniTypes.d.ts +590 -462
- package/background/KoniTypes.js +1 -0
- package/background/RequestBytesSign.d.ts +12 -12
- package/background/RequestExtrinsicSign.d.ts +12 -12
- package/background/handlers/Extension.d.ts +49 -49
- package/background/handlers/State.d.ts +87 -87
- package/background/handlers/Tabs.d.ts +24 -24
- package/background/handlers/helpers.d.ts +1 -1
- package/background/handlers/index.d.ts +3 -3
- package/background/handlers/subscriptions.d.ts +5 -4
- package/background/handlers/subscriptions.js +3 -0
- package/background/types.d.ts +345 -345
- package/bundle.d.ts +1 -1
- package/cjs/background/KoniTypes.js +1 -0
- package/cjs/background/handlers/subscriptions.js +5 -0
- package/cjs/packageInfo.js +1 -1
- package/cjs/page/PostMessageProvider.js +27 -27
- package/defaults.d.ts +10 -10
- package/detectOther.d.ts +7 -7
- package/detectPackage.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +4 -4
- package/packageInfo.d.ts +6 -6
- package/packageInfo.js +1 -1
- package/page/Accounts.d.ts +7 -7
- package/page/Injected.d.ts +13 -13
- package/page/Metadata.d.ts +7 -7
- package/page/PostMessageProvider.d.ts +62 -62
- package/page/PostMessageProvider.js +27 -27
- package/page/Signer.d.ts +8 -8
- package/page/index.d.ts +16 -16
- package/page/types.d.ts +6 -6
- package/stores/Accounts.d.ts +6 -6
- package/stores/Base.d.ts +10 -10
- package/stores/Metadata.d.ts +5 -5
- package/stores/index.d.ts +2 -2
- package/types.d.ts +9 -9
- package/utils/canDerive.d.ts +2 -2
- package/utils/getId.d.ts +1 -1
- package/utils/index.d.ts +1 -1
|
@@ -1,462 +1,590 @@
|
|
|
1
|
-
import { AuthUrls, Resolver } from '@subwallet/extension-base/background/handlers/State';
|
|
2
|
-
import { AccountJson, AuthorizeRequest, RequestAccountList, RequestAccountSubscribe, RequestAuthorizeReject, RequestAuthorizeSubscribe, RequestAuthorizeTab,
|
|
3
|
-
import { InjectedAccount, MetadataDefBase } from '@subwallet/extension-inject/types';
|
|
4
|
-
import { ApiPromise } from '@polkadot/api';
|
|
5
|
-
import { SubmittableExtrinsicFunction } from '@polkadot/api/promise/types';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
export interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
export interface
|
|
39
|
-
|
|
40
|
-
accounts: string[];
|
|
41
|
-
}
|
|
42
|
-
export interface
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
export interface
|
|
70
|
-
ready?: boolean;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
export declare enum
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
export interface
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
export interface
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
export interface
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
export interface
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
export interface
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
export interface
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
export interface
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
export
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
export
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
export interface
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
export
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
export
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
export
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
1
|
+
import { AuthUrls, Resolver } from '@subwallet/extension-base/background/handlers/State';
|
|
2
|
+
import { AccountJson, AuthorizeRequest, RequestAccountList, RequestAccountSubscribe, RequestAuthorizeReject, RequestAuthorizeSubscribe, RequestAuthorizeTab, RequestCurrentAccountAddress, ResponseAuthorizeList, ResponseJsonGetAccountInfo, SeedLengths } from '@subwallet/extension-base/background/types';
|
|
3
|
+
import { InjectedAccount, MetadataDefBase } from '@subwallet/extension-inject/types';
|
|
4
|
+
import { ApiPromise } from '@polkadot/api';
|
|
5
|
+
import { SubmittableExtrinsicFunction } from '@polkadot/api/promise/types';
|
|
6
|
+
import { KeyringPair$Json } from '@polkadot/keyring/types';
|
|
7
|
+
import { Registry } from '@polkadot/types/types';
|
|
8
|
+
import { Keyring } from '@polkadot/ui-keyring';
|
|
9
|
+
import { SingleAddress } from '@polkadot/ui-keyring/observable/types';
|
|
10
|
+
import { KeyringOptions } from '@polkadot/ui-keyring/options/types';
|
|
11
|
+
import { KeyringPairs$Json } from '@polkadot/ui-keyring/types';
|
|
12
|
+
import { BN } from '@polkadot/util';
|
|
13
|
+
import { KeypairType } from '@polkadot/util-crypto/types';
|
|
14
|
+
export declare enum ApiInitStatus {
|
|
15
|
+
SUCCESS = 0,
|
|
16
|
+
ALREADY_EXIST = 1,
|
|
17
|
+
NOT_SUPPORT = 2
|
|
18
|
+
}
|
|
19
|
+
export interface AuthRequestV2 extends Resolver<ResultResolver> {
|
|
20
|
+
id: string;
|
|
21
|
+
idStr: string;
|
|
22
|
+
request: RequestAuthorizeTab;
|
|
23
|
+
url: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RequestAuthorizeApproveV2 {
|
|
26
|
+
id: string;
|
|
27
|
+
accounts: string[];
|
|
28
|
+
}
|
|
29
|
+
export interface RequestAuthorizationAll {
|
|
30
|
+
connectValue: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface RequestAuthorization extends RequestAuthorizationAll {
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
export interface RequestAuthorizationPerAccount extends RequestAuthorization {
|
|
36
|
+
address: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ResultResolver {
|
|
39
|
+
result: boolean;
|
|
40
|
+
accounts: string[];
|
|
41
|
+
}
|
|
42
|
+
export interface RejectResolver {
|
|
43
|
+
error: Error;
|
|
44
|
+
accounts: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface RequestForgetSite {
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
export interface StakingRewardItem {
|
|
50
|
+
state: APIItemState;
|
|
51
|
+
name: string;
|
|
52
|
+
chainId: string;
|
|
53
|
+
latestReward?: string;
|
|
54
|
+
totalReward?: string;
|
|
55
|
+
totalSlash?: string;
|
|
56
|
+
smartContract?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface StakingRewardJson {
|
|
59
|
+
details: Array<StakingRewardItem>;
|
|
60
|
+
}
|
|
61
|
+
export interface StakingItem {
|
|
62
|
+
name: string;
|
|
63
|
+
chainId: string;
|
|
64
|
+
balance?: string;
|
|
65
|
+
nativeToken: string;
|
|
66
|
+
unit?: string;
|
|
67
|
+
state: APIItemState;
|
|
68
|
+
}
|
|
69
|
+
export interface StakingJson {
|
|
70
|
+
ready?: boolean;
|
|
71
|
+
details: Record<string, StakingItem>;
|
|
72
|
+
}
|
|
73
|
+
export interface PriceJson {
|
|
74
|
+
ready?: boolean;
|
|
75
|
+
currency: string;
|
|
76
|
+
priceMap: Record<string, number>;
|
|
77
|
+
tokenPriceMap: Record<string, number>;
|
|
78
|
+
}
|
|
79
|
+
export declare enum APIItemState {
|
|
80
|
+
PENDING = "pending",
|
|
81
|
+
READY = "ready",
|
|
82
|
+
CACHED = "cached",
|
|
83
|
+
ERROR = "error",
|
|
84
|
+
NOT_SUPPORT = "not_support"
|
|
85
|
+
}
|
|
86
|
+
export declare enum RMRK_VER {
|
|
87
|
+
VER_1 = "1.0.0",
|
|
88
|
+
VER_2 = "2.0.0"
|
|
89
|
+
}
|
|
90
|
+
export declare enum CrowdloanParaState {
|
|
91
|
+
ONGOING = "ongoing",
|
|
92
|
+
COMPLETED = "completed",
|
|
93
|
+
FAILED = "failed"
|
|
94
|
+
}
|
|
95
|
+
export interface NftTransferExtra {
|
|
96
|
+
cronUpdate: boolean;
|
|
97
|
+
forceUpdate: boolean;
|
|
98
|
+
selectedNftCollection?: NftCollection;
|
|
99
|
+
nftItems?: NftItem[];
|
|
100
|
+
}
|
|
101
|
+
export interface NftItem {
|
|
102
|
+
id?: string;
|
|
103
|
+
name?: string;
|
|
104
|
+
image?: string;
|
|
105
|
+
external_url?: string;
|
|
106
|
+
rarity?: string;
|
|
107
|
+
collectionId?: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
properties?: Record<any, any> | null;
|
|
110
|
+
chain?: string;
|
|
111
|
+
rmrk_ver?: RMRK_VER;
|
|
112
|
+
}
|
|
113
|
+
export interface NftCollection {
|
|
114
|
+
collectionId: string;
|
|
115
|
+
collectionName?: string;
|
|
116
|
+
image?: string;
|
|
117
|
+
chain?: string;
|
|
118
|
+
itemCount?: number;
|
|
119
|
+
}
|
|
120
|
+
export interface NftJson {
|
|
121
|
+
total: number;
|
|
122
|
+
nftList: Array<NftItem>;
|
|
123
|
+
}
|
|
124
|
+
export interface NftCollectionJson {
|
|
125
|
+
ready: boolean;
|
|
126
|
+
nftCollectionList: Array<NftCollection>;
|
|
127
|
+
}
|
|
128
|
+
export interface TokenBalanceRaw {
|
|
129
|
+
reserved: BN;
|
|
130
|
+
frozen: BN;
|
|
131
|
+
free: BN;
|
|
132
|
+
}
|
|
133
|
+
export interface BalanceChildItem {
|
|
134
|
+
reserved: string;
|
|
135
|
+
frozen: string;
|
|
136
|
+
free: string;
|
|
137
|
+
decimals: number;
|
|
138
|
+
}
|
|
139
|
+
export interface BalanceItem {
|
|
140
|
+
state: APIItemState;
|
|
141
|
+
free: string;
|
|
142
|
+
reserved: string;
|
|
143
|
+
miscFrozen: string;
|
|
144
|
+
feeFrozen: string;
|
|
145
|
+
children?: Record<string, BalanceChildItem>;
|
|
146
|
+
}
|
|
147
|
+
export interface BalanceJson {
|
|
148
|
+
details: Record<string, BalanceItem>;
|
|
149
|
+
}
|
|
150
|
+
export interface CrowdloanItem {
|
|
151
|
+
state: APIItemState;
|
|
152
|
+
paraState?: CrowdloanParaState;
|
|
153
|
+
contribute: string;
|
|
154
|
+
}
|
|
155
|
+
export interface CrowdloanJson {
|
|
156
|
+
details: Record<string, CrowdloanItem>;
|
|
157
|
+
}
|
|
158
|
+
export interface ChainRegistry {
|
|
159
|
+
chainDecimals: number[];
|
|
160
|
+
chainTokens: string[];
|
|
161
|
+
tokenMap: Record<string, TokenInfo>;
|
|
162
|
+
}
|
|
163
|
+
export interface DefaultFormatBalance {
|
|
164
|
+
decimals?: number[] | number;
|
|
165
|
+
unit?: string[] | string;
|
|
166
|
+
}
|
|
167
|
+
export interface ApiState {
|
|
168
|
+
apiDefaultTx: SubmittableExtrinsicFunction;
|
|
169
|
+
apiDefaultTxSudo: SubmittableExtrinsicFunction;
|
|
170
|
+
isApiReady: boolean;
|
|
171
|
+
isApiReadyOnce: boolean;
|
|
172
|
+
isDevelopment?: boolean;
|
|
173
|
+
isEthereum?: boolean;
|
|
174
|
+
specName: string;
|
|
175
|
+
specVersion: string;
|
|
176
|
+
systemChain: string;
|
|
177
|
+
systemName: string;
|
|
178
|
+
systemVersion: string;
|
|
179
|
+
registry: Registry;
|
|
180
|
+
defaultFormatBalance: DefaultFormatBalance;
|
|
181
|
+
}
|
|
182
|
+
export interface ApiProps extends ApiState {
|
|
183
|
+
api: ApiPromise;
|
|
184
|
+
apiError?: string;
|
|
185
|
+
apiUrl: string;
|
|
186
|
+
isNotSupport?: boolean;
|
|
187
|
+
isApiReadyOnce: boolean;
|
|
188
|
+
isApiConnected: boolean;
|
|
189
|
+
isEthereum: boolean;
|
|
190
|
+
isApiInitialized: boolean;
|
|
191
|
+
isReady: Promise<ApiProps>;
|
|
192
|
+
apiRetry?: number;
|
|
193
|
+
recoverConnect?: () => void;
|
|
194
|
+
useEvmAddress?: boolean;
|
|
195
|
+
}
|
|
196
|
+
export declare type NetWorkGroup = 'RELAY_CHAIN' | 'POLKADOT_PARACHAIN' | 'KUSAMA_PARACHAIN' | 'MAIN_NET' | 'TEST_NET' | 'UNKNOWN';
|
|
197
|
+
export interface NetWorkInfo {
|
|
198
|
+
chain: string;
|
|
199
|
+
genesisHash: string;
|
|
200
|
+
icon?: string;
|
|
201
|
+
ss58Format: number;
|
|
202
|
+
chainType?: 'substrate' | 'ethereum';
|
|
203
|
+
provider: string;
|
|
204
|
+
groups: NetWorkGroup[];
|
|
205
|
+
paraId?: number;
|
|
206
|
+
isEthereum?: boolean;
|
|
207
|
+
nativeToken?: string;
|
|
208
|
+
crowdloanUrl?: string;
|
|
209
|
+
decimals?: number;
|
|
210
|
+
}
|
|
211
|
+
export interface DonateInfo {
|
|
212
|
+
key: string;
|
|
213
|
+
name: string;
|
|
214
|
+
value: string;
|
|
215
|
+
icon: string;
|
|
216
|
+
link: string;
|
|
217
|
+
}
|
|
218
|
+
export interface DropdownOptionType {
|
|
219
|
+
text: string;
|
|
220
|
+
value: string;
|
|
221
|
+
}
|
|
222
|
+
export interface DropdownTransformOptionType {
|
|
223
|
+
label: string;
|
|
224
|
+
value: string;
|
|
225
|
+
}
|
|
226
|
+
export interface DropdownTransformGroupOptionType {
|
|
227
|
+
label: string;
|
|
228
|
+
options: DropdownTransformOptionType[];
|
|
229
|
+
}
|
|
230
|
+
export interface NetWorkMetadataDef extends MetadataDefBase {
|
|
231
|
+
networkKey: string;
|
|
232
|
+
groups: NetWorkGroup[];
|
|
233
|
+
isEthereum: boolean;
|
|
234
|
+
paraId?: number;
|
|
235
|
+
isAvailable: boolean;
|
|
236
|
+
}
|
|
237
|
+
export declare type CurrentNetworkInfo = {
|
|
238
|
+
networkKey: string;
|
|
239
|
+
networkPrefix: number;
|
|
240
|
+
icon: string;
|
|
241
|
+
genesisHash: string;
|
|
242
|
+
isEthereum: boolean;
|
|
243
|
+
isReady?: boolean;
|
|
244
|
+
};
|
|
245
|
+
export declare type TokenInfo = {
|
|
246
|
+
isMainToken: boolean;
|
|
247
|
+
symbol: string;
|
|
248
|
+
erc20Address?: string;
|
|
249
|
+
assetIndex?: number;
|
|
250
|
+
decimals: number;
|
|
251
|
+
name: string;
|
|
252
|
+
coinGeckoKey?: string;
|
|
253
|
+
specialOption?: object;
|
|
254
|
+
};
|
|
255
|
+
export interface AccountsWithCurrentAddress {
|
|
256
|
+
accounts: AccountJson[];
|
|
257
|
+
currentAddress?: string;
|
|
258
|
+
isShowBalance?: boolean;
|
|
259
|
+
allAccountLogo?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface OptionInputAddress {
|
|
262
|
+
options: KeyringOptions;
|
|
263
|
+
}
|
|
264
|
+
export interface CurrentAccountInfo {
|
|
265
|
+
address: string;
|
|
266
|
+
}
|
|
267
|
+
export interface RequestSettingsType {
|
|
268
|
+
isShowBalance: boolean;
|
|
269
|
+
accountAllLogo: string;
|
|
270
|
+
theme: ThemeTypes;
|
|
271
|
+
}
|
|
272
|
+
export interface ResponseSettingsType {
|
|
273
|
+
isShowBalance: boolean;
|
|
274
|
+
accountAllLogo: string;
|
|
275
|
+
theme: ThemeTypes;
|
|
276
|
+
}
|
|
277
|
+
export interface RandomTestRequest {
|
|
278
|
+
start: number;
|
|
279
|
+
end: number;
|
|
280
|
+
}
|
|
281
|
+
export declare type PdotApi = {
|
|
282
|
+
keyring: Keyring;
|
|
283
|
+
apisMap: Record<string, ApiProps>;
|
|
284
|
+
};
|
|
285
|
+
export interface BackgroundWindow extends Window {
|
|
286
|
+
pdotApi: PdotApi;
|
|
287
|
+
}
|
|
288
|
+
export interface TransactionHistoryItemType {
|
|
289
|
+
time: number;
|
|
290
|
+
networkKey: string;
|
|
291
|
+
change: string;
|
|
292
|
+
changeSymbol?: string;
|
|
293
|
+
fee?: string;
|
|
294
|
+
feeSymbol?: string;
|
|
295
|
+
isSuccess: boolean;
|
|
296
|
+
action: 'send' | 'received';
|
|
297
|
+
extrinsicHash: string;
|
|
298
|
+
}
|
|
299
|
+
export interface RequestTransactionHistoryGet {
|
|
300
|
+
address: string;
|
|
301
|
+
networkKey: string;
|
|
302
|
+
}
|
|
303
|
+
export interface RequestTransactionHistoryGetByMultiNetworks {
|
|
304
|
+
address: string;
|
|
305
|
+
networkKeys: string[];
|
|
306
|
+
}
|
|
307
|
+
export interface RequestTransactionHistoryAdd {
|
|
308
|
+
address: string;
|
|
309
|
+
networkKey: string;
|
|
310
|
+
item: TransactionHistoryItemType;
|
|
311
|
+
}
|
|
312
|
+
export interface RequestApi {
|
|
313
|
+
networkKey: string;
|
|
314
|
+
}
|
|
315
|
+
export interface RequestAccountExportPrivateKey {
|
|
316
|
+
address: string;
|
|
317
|
+
password: string;
|
|
318
|
+
}
|
|
319
|
+
export interface ResponseAccountExportPrivateKey {
|
|
320
|
+
privateKey: string;
|
|
321
|
+
}
|
|
322
|
+
export interface RequestSeedCreateV2 {
|
|
323
|
+
length?: SeedLengths;
|
|
324
|
+
seed?: string;
|
|
325
|
+
types?: Array<KeypairType>;
|
|
326
|
+
}
|
|
327
|
+
export interface RequestSeedValidateV2 {
|
|
328
|
+
suri: string;
|
|
329
|
+
types?: Array<KeypairType>;
|
|
330
|
+
}
|
|
331
|
+
export interface RequestAccountCreateSuriV2 {
|
|
332
|
+
name: string;
|
|
333
|
+
genesisHash?: string | null;
|
|
334
|
+
password: string;
|
|
335
|
+
suri: string;
|
|
336
|
+
types?: Array<KeypairType>;
|
|
337
|
+
isAllowed: boolean;
|
|
338
|
+
}
|
|
339
|
+
export interface RequestDeriveCreateV2 {
|
|
340
|
+
name: string;
|
|
341
|
+
genesisHash?: string | null;
|
|
342
|
+
suri: string;
|
|
343
|
+
parentAddress: string;
|
|
344
|
+
parentPassword: string;
|
|
345
|
+
password: string;
|
|
346
|
+
isAllowed: boolean;
|
|
347
|
+
}
|
|
348
|
+
export interface RequestJsonRestoreV2 {
|
|
349
|
+
file: KeyringPair$Json;
|
|
350
|
+
password: string;
|
|
351
|
+
address: string;
|
|
352
|
+
isAllowed: boolean;
|
|
353
|
+
}
|
|
354
|
+
export interface RequestBatchRestoreV2 {
|
|
355
|
+
file: KeyringPairs$Json;
|
|
356
|
+
password: string;
|
|
357
|
+
accountsInfo: ResponseJsonGetAccountInfo[];
|
|
358
|
+
isAllowed: boolean;
|
|
359
|
+
}
|
|
360
|
+
export interface ResponseSeedCreateV2 {
|
|
361
|
+
seed: string;
|
|
362
|
+
addressMap: Record<KeypairType, string>;
|
|
363
|
+
}
|
|
364
|
+
export interface RequestCheckTransfer {
|
|
365
|
+
networkKey: string;
|
|
366
|
+
from: string;
|
|
367
|
+
to: string;
|
|
368
|
+
value?: string;
|
|
369
|
+
transferAll?: boolean;
|
|
370
|
+
token?: string;
|
|
371
|
+
}
|
|
372
|
+
export interface RequestTransfer extends RequestCheckTransfer {
|
|
373
|
+
password: string;
|
|
374
|
+
}
|
|
375
|
+
export declare type ResponseSeedValidateV2 = ResponseSeedCreateV2;
|
|
376
|
+
export declare type ResponseAccountCreateSuriV2 = Record<KeypairType, string>;
|
|
377
|
+
export declare type AccountRef = Array<string>;
|
|
378
|
+
export declare type AccountRefMap = Record<string, AccountRef>;
|
|
379
|
+
export declare type RequestPrice = null;
|
|
380
|
+
export declare type RequestSubscribePrice = null;
|
|
381
|
+
export declare type RequestBalance = null;
|
|
382
|
+
export declare type RequestSubscribeBalance = null;
|
|
383
|
+
export declare type RequestSubscribeBalancesVisibility = null;
|
|
384
|
+
export declare type RequestCrowdloan = null;
|
|
385
|
+
export declare type RequestSubscribeCrowdloan = null;
|
|
386
|
+
export declare type RequestSubscribeNft = null;
|
|
387
|
+
export declare type RequestSubscribeStaking = null;
|
|
388
|
+
export declare type RequestSubscribeStakingReward = null;
|
|
389
|
+
export declare type ThemeTypes = 'light' | 'dark';
|
|
390
|
+
export declare type RequestNftForceUpdate = {
|
|
391
|
+
collectionId: string;
|
|
392
|
+
nft: NftItem;
|
|
393
|
+
isSendingSelf: boolean;
|
|
394
|
+
chain: string;
|
|
395
|
+
};
|
|
396
|
+
export declare enum TransferErrorCode {
|
|
397
|
+
INVALID_FROM_ADDRESS = "invalidFromAccount",
|
|
398
|
+
INVALID_TO_ADDRESS = "invalidToAccount",
|
|
399
|
+
NOT_ENOUGH_VALUE = "notEnoughValue",
|
|
400
|
+
INVALID_VALUE = "invalidValue",
|
|
401
|
+
INVALID_TOKEN = "invalidToken",
|
|
402
|
+
KEYRING_ERROR = "keyringError",
|
|
403
|
+
TRANSFER_ERROR = "transferError",
|
|
404
|
+
TIMEOUT = "timeout",
|
|
405
|
+
UNSUPPORTED = "unsupported"
|
|
406
|
+
}
|
|
407
|
+
export declare type TransferError = {
|
|
408
|
+
code: TransferErrorCode;
|
|
409
|
+
data?: object;
|
|
410
|
+
message: string;
|
|
411
|
+
};
|
|
412
|
+
export interface ResponseCheckTransfer {
|
|
413
|
+
errors?: Array<TransferError>;
|
|
414
|
+
fromAccountFree: string;
|
|
415
|
+
toAccountFree: string;
|
|
416
|
+
estimateFee?: string;
|
|
417
|
+
feeSymbol?: string;
|
|
418
|
+
}
|
|
419
|
+
export declare enum TransferStep {
|
|
420
|
+
READY = "ready",
|
|
421
|
+
START = "start",
|
|
422
|
+
PROCESSING = "processing",
|
|
423
|
+
SUCCESS = "success",
|
|
424
|
+
ERROR = "error"
|
|
425
|
+
}
|
|
426
|
+
declare type TxResultType = {
|
|
427
|
+
change: string;
|
|
428
|
+
changeSymbol?: string;
|
|
429
|
+
fee?: string;
|
|
430
|
+
feeSymbol?: string;
|
|
431
|
+
};
|
|
432
|
+
export interface ResponseTransfer {
|
|
433
|
+
step: TransferStep;
|
|
434
|
+
errors?: Array<TransferError>;
|
|
435
|
+
extrinsicHash?: string;
|
|
436
|
+
extrinsicStatus?: string;
|
|
437
|
+
data?: object;
|
|
438
|
+
txResult?: TxResultType;
|
|
439
|
+
isFinalized?: boolean;
|
|
440
|
+
}
|
|
441
|
+
export interface EvmNftTransactionRequest {
|
|
442
|
+
networkKey: string;
|
|
443
|
+
senderAddress: string;
|
|
444
|
+
recipientAddress: string;
|
|
445
|
+
params: Record<string, any>;
|
|
446
|
+
}
|
|
447
|
+
export interface EvmNftTransaction {
|
|
448
|
+
tx: Record<string, any> | null;
|
|
449
|
+
estimatedFee: string | null;
|
|
450
|
+
}
|
|
451
|
+
export interface EvmNftSubmitTransaction {
|
|
452
|
+
senderAddress: string;
|
|
453
|
+
password: string;
|
|
454
|
+
recipientAddress: string;
|
|
455
|
+
networkKey: string;
|
|
456
|
+
rawTransaction: Record<string, any>;
|
|
457
|
+
}
|
|
458
|
+
export interface EvmNftTransactionResponse {
|
|
459
|
+
passwordError?: string | null;
|
|
460
|
+
callHash?: string;
|
|
461
|
+
status?: boolean;
|
|
462
|
+
transactionHash?: string;
|
|
463
|
+
txError?: boolean;
|
|
464
|
+
isSendingSelf: boolean;
|
|
465
|
+
}
|
|
466
|
+
export interface CustomEvmToken {
|
|
467
|
+
name?: string;
|
|
468
|
+
smartContract: string;
|
|
469
|
+
symbol?: string;
|
|
470
|
+
decimals?: number;
|
|
471
|
+
chain: 'astarEvm' | 'moonbeam' | 'moonriver' | 'moonbase' | 'shidenEvm';
|
|
472
|
+
type: 'erc20' | 'erc721';
|
|
473
|
+
}
|
|
474
|
+
export interface EvmTokenJson {
|
|
475
|
+
erc20: CustomEvmToken[];
|
|
476
|
+
erc721: CustomEvmToken[];
|
|
477
|
+
}
|
|
478
|
+
export interface _ServiceInfo {
|
|
479
|
+
currentAccount: string;
|
|
480
|
+
chainRegistry: Record<string, ChainRegistry>;
|
|
481
|
+
customErc721Registry: CustomEvmToken[];
|
|
482
|
+
}
|
|
483
|
+
export interface DeleteEvmTokenParams {
|
|
484
|
+
smartContract: string;
|
|
485
|
+
chain: 'astarEvm' | 'moonbeam' | 'moonriver' | 'moonbase' | 'shidenEvm';
|
|
486
|
+
type: 'erc20' | 'erc721';
|
|
487
|
+
}
|
|
488
|
+
export interface ValidateEvmTokenRequest {
|
|
489
|
+
smartContract: string;
|
|
490
|
+
chain: 'astarEvm' | 'moonbeam' | 'moonriver' | 'moonbase' | 'shidenEvm';
|
|
491
|
+
type: 'erc20' | 'erc721';
|
|
492
|
+
}
|
|
493
|
+
export interface ValidateEvmTokenResponse {
|
|
494
|
+
name: string;
|
|
495
|
+
symbol: string;
|
|
496
|
+
decimals?: number;
|
|
497
|
+
isExist: boolean;
|
|
498
|
+
}
|
|
499
|
+
export interface SupportTransferResponse {
|
|
500
|
+
supportTransfer: boolean;
|
|
501
|
+
supportTransferAll: boolean;
|
|
502
|
+
}
|
|
503
|
+
export interface RequestFreeBalance {
|
|
504
|
+
address: string;
|
|
505
|
+
networkKey: string;
|
|
506
|
+
token?: string;
|
|
507
|
+
}
|
|
508
|
+
export interface RequestTransferCheckReferenceCount {
|
|
509
|
+
address: string;
|
|
510
|
+
networkKey: string;
|
|
511
|
+
}
|
|
512
|
+
export interface RequestTransferCheckSupporting {
|
|
513
|
+
networkKey: string;
|
|
514
|
+
token: string;
|
|
515
|
+
}
|
|
516
|
+
export interface RequestTransferExistentialDeposit {
|
|
517
|
+
networkKey: string;
|
|
518
|
+
token: string;
|
|
519
|
+
}
|
|
520
|
+
export interface RequestSaveRecentAccount {
|
|
521
|
+
accountId: string;
|
|
522
|
+
}
|
|
523
|
+
export interface KoniRequestSignatures {
|
|
524
|
+
'pri(evmTokenState.validateEvmToken)': [ValidateEvmTokenRequest, ValidateEvmTokenResponse];
|
|
525
|
+
'pri(evmTokenState.deleteMany)': [DeleteEvmTokenParams[], boolean];
|
|
526
|
+
'pri(evmTokenState.upsertEvmTokenState)': [CustomEvmToken, boolean];
|
|
527
|
+
'pri(evmTokenState.getEvmTokenState)': [null, EvmTokenJson];
|
|
528
|
+
'pri(evmTokenState.getSubscription)': [null, EvmTokenJson, EvmTokenJson];
|
|
529
|
+
'pri(evmNft.submitTransaction)': [EvmNftSubmitTransaction, EvmNftTransactionResponse, EvmNftTransactionResponse];
|
|
530
|
+
'pri(evmNft.getTransaction)': [EvmNftTransactionRequest, EvmNftTransaction];
|
|
531
|
+
'pri(nftTransfer.setNftTransfer)': [NftTransferExtra, boolean];
|
|
532
|
+
'pri(nftTransfer.getNftTransfer)': [null, NftTransferExtra];
|
|
533
|
+
'pri(nftTransfer.getSubscription)': [null, NftTransferExtra, NftTransferExtra];
|
|
534
|
+
'pri(nft.forceUpdate)': [RequestNftForceUpdate, boolean];
|
|
535
|
+
'pri(api.init)': [RequestApi, ApiInitStatus];
|
|
536
|
+
'pri(staking.getStaking)': [null, StakingJson];
|
|
537
|
+
'pri(staking.getSubscription)': [RequestSubscribeStaking, StakingJson, StakingJson];
|
|
538
|
+
'pri(stakingReward.getStakingReward)': [null, StakingRewardJson];
|
|
539
|
+
'pri(stakingReward.getSubscription)': [RequestSubscribeStakingReward, StakingRewardJson, StakingRewardJson];
|
|
540
|
+
'pri(nft.getNft)': [null, NftJson];
|
|
541
|
+
'pri(nft.getSubscription)': [RequestSubscribeNft, NftJson, NftJson];
|
|
542
|
+
'pri(nftCollection.getNftCollection)': [null, NftCollectionJson];
|
|
543
|
+
'pri(nftCollection.getSubscription)': [null, NftCollectionJson, NftCollectionJson];
|
|
544
|
+
'pri(price.getPrice)': [RequestPrice, PriceJson];
|
|
545
|
+
'pri(price.getSubscription)': [RequestSubscribePrice, PriceJson, PriceJson];
|
|
546
|
+
'pri(balance.getBalance)': [RequestBalance, BalanceJson];
|
|
547
|
+
'pri(balance.getSubscription)': [RequestSubscribeBalance, BalanceJson, BalanceJson];
|
|
548
|
+
'pri(crowdloan.getCrowdloan)': [RequestCrowdloan, CrowdloanJson];
|
|
549
|
+
'pri(crowdloan.getSubscription)': [RequestSubscribeCrowdloan, CrowdloanJson, CrowdloanJson];
|
|
550
|
+
'pri(authorize.listV2)': [null, ResponseAuthorizeList];
|
|
551
|
+
'pri(authorize.requestsV2)': [RequestAuthorizeSubscribe, boolean, AuthorizeRequest[]];
|
|
552
|
+
'pri(authorize.approveV2)': [RequestAuthorizeApproveV2, boolean];
|
|
553
|
+
'pri(authorize.changeSiteAll)': [RequestAuthorizationAll, boolean, AuthUrls];
|
|
554
|
+
'pri(authorize.changeSite)': [RequestAuthorization, boolean, AuthUrls];
|
|
555
|
+
'pri(authorize.changeSitePerAccount)': [RequestAuthorizationPerAccount, boolean, AuthUrls];
|
|
556
|
+
'pri(authorize.forgetSite)': [RequestForgetSite, boolean, AuthUrls];
|
|
557
|
+
'pri(authorize.forgetAllSite)': [null, boolean, AuthUrls];
|
|
558
|
+
'pri(authorize.rejectV2)': [RequestAuthorizeReject, boolean];
|
|
559
|
+
'pri(seed.createV2)': [RequestSeedCreateV2, ResponseSeedCreateV2];
|
|
560
|
+
'pri(seed.validateV2)': [RequestSeedValidateV2, ResponseSeedValidateV2];
|
|
561
|
+
'pri(accounts.create.suriV2)': [RequestAccountCreateSuriV2, ResponseAccountCreateSuriV2];
|
|
562
|
+
'pri(accounts.checkTransfer)': [RequestCheckTransfer, ResponseCheckTransfer];
|
|
563
|
+
'pri(accounts.transfer)': [RequestTransfer, Array<TransferError>, ResponseTransfer];
|
|
564
|
+
'pri(derivation.createV2)': [RequestDeriveCreateV2, boolean];
|
|
565
|
+
'pri(json.restoreV2)': [RequestJsonRestoreV2, void];
|
|
566
|
+
'pri(json.batchRestoreV2)': [RequestBatchRestoreV2, void];
|
|
567
|
+
'pri(accounts.exportPrivateKey)': [RequestAccountExportPrivateKey, ResponseAccountExportPrivateKey];
|
|
568
|
+
'pri(accounts.subscribeWithCurrentAddress)': [RequestAccountSubscribe, boolean, AccountsWithCurrentAddress];
|
|
569
|
+
'pri(accounts.subscribeAccountsInputAddress)': [RequestAccountSubscribe, string, OptionInputAddress];
|
|
570
|
+
'pri(accounts.saveRecent)': [RequestSaveRecentAccount, SingleAddress];
|
|
571
|
+
'pri(accounts.triggerSubscription)': [null, boolean];
|
|
572
|
+
'pri(currentAccount.saveAddress)': [RequestCurrentAccountAddress, boolean, CurrentAccountInfo];
|
|
573
|
+
'pri(currentAccount.changeBalancesVisibility)': [null, boolean, ResponseSettingsType];
|
|
574
|
+
'pri(currentAccount.subscribeSettings)': [null, ResponseSettingsType, ResponseSettingsType];
|
|
575
|
+
'pri(currentAccount.saveAccountAllLogo)': [string, boolean, ResponseSettingsType];
|
|
576
|
+
'pri(currentAccount.saveTheme)': [ThemeTypes, boolean, ResponseSettingsType];
|
|
577
|
+
'pri(networkMetadata.list)': [null, NetWorkMetadataDef[]];
|
|
578
|
+
'pri(chainRegistry.getSubscription)': [null, Record<string, ChainRegistry>, Record<string, ChainRegistry>];
|
|
579
|
+
'pri(transaction.history.getSubscription)': [null, Record<string, TransactionHistoryItemType[]>, Record<string, TransactionHistoryItemType[]>];
|
|
580
|
+
'pri(transaction.history.add)': [RequestTransactionHistoryAdd, boolean, TransactionHistoryItemType[]];
|
|
581
|
+
'pri(transfer.checkReferenceCount)': [RequestTransferCheckReferenceCount, boolean];
|
|
582
|
+
'pri(transfer.checkSupporting)': [RequestTransferCheckSupporting, SupportTransferResponse];
|
|
583
|
+
'pri(transfer.getExistentialDeposit)': [RequestTransferExistentialDeposit, string];
|
|
584
|
+
'pri(subscription.cancel)': [string, boolean];
|
|
585
|
+
'pri(freeBalance.subscribe)': [RequestFreeBalance, string, string];
|
|
586
|
+
'pub(utils.getRandom)': [RandomTestRequest, number];
|
|
587
|
+
'pub(accounts.listV2)': [RequestAccountList, InjectedAccount[]];
|
|
588
|
+
'pub(accounts.subscribeV2)': [RequestAccountSubscribe, boolean, InjectedAccount[]];
|
|
589
|
+
}
|
|
590
|
+
export {};
|