@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.
Files changed (42) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +10 -10
  3. package/background/KoniTypes.d.ts +590 -462
  4. package/background/KoniTypes.js +1 -0
  5. package/background/RequestBytesSign.d.ts +12 -12
  6. package/background/RequestExtrinsicSign.d.ts +12 -12
  7. package/background/handlers/Extension.d.ts +49 -49
  8. package/background/handlers/State.d.ts +87 -87
  9. package/background/handlers/Tabs.d.ts +24 -24
  10. package/background/handlers/helpers.d.ts +1 -1
  11. package/background/handlers/index.d.ts +3 -3
  12. package/background/handlers/subscriptions.d.ts +5 -4
  13. package/background/handlers/subscriptions.js +3 -0
  14. package/background/types.d.ts +345 -345
  15. package/bundle.d.ts +1 -1
  16. package/cjs/background/KoniTypes.js +1 -0
  17. package/cjs/background/handlers/subscriptions.js +5 -0
  18. package/cjs/packageInfo.js +1 -1
  19. package/cjs/page/PostMessageProvider.js +27 -27
  20. package/defaults.d.ts +10 -10
  21. package/detectOther.d.ts +7 -7
  22. package/detectPackage.d.ts +1 -1
  23. package/index.d.ts +1 -1
  24. package/package.json +4 -4
  25. package/packageInfo.d.ts +6 -6
  26. package/packageInfo.js +1 -1
  27. package/page/Accounts.d.ts +7 -7
  28. package/page/Injected.d.ts +13 -13
  29. package/page/Metadata.d.ts +7 -7
  30. package/page/PostMessageProvider.d.ts +62 -62
  31. package/page/PostMessageProvider.js +27 -27
  32. package/page/Signer.d.ts +8 -8
  33. package/page/index.d.ts +16 -16
  34. package/page/types.d.ts +6 -6
  35. package/stores/Accounts.d.ts +6 -6
  36. package/stores/Base.d.ts +10 -10
  37. package/stores/Metadata.d.ts +5 -5
  38. package/stores/index.d.ts +2 -2
  39. package/types.d.ts +9 -9
  40. package/utils/canDerive.d.ts +2 -2
  41. package/utils/getId.d.ts +1 -1
  42. package/utils/index.d.ts +1 -1
@@ -1,345 +1,345 @@
1
- import type { InjectedAccount, InjectedMetadataKnown, MetadataDef, ProviderList, ProviderMeta } from '@subwallet/extension-inject/types';
2
- import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types';
3
- import type { JsonRpcResponse } from '@polkadot/rpc-provider/types';
4
- import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
5
- import type { KeyringPairs$Json } from '@polkadot/ui-keyring/types';
6
- import type { HexString } from '@polkadot/util/types';
7
- import type { KeypairType } from '@polkadot/util-crypto/types';
8
- import { CurrentNetworkInfo, KoniRequestSignatures } from '@subwallet/extension-base/background/KoniTypes';
9
- import { TypeRegistry } from '@polkadot/types';
10
- import { ALLOWED_PATH } from '../defaults';
11
- import { AuthUrls } from './handlers/State';
12
- declare type KeysWithDefinedValues<T> = {
13
- [K in keyof T]: T[K] extends undefined ? never : K;
14
- }[keyof T];
15
- declare type NoUndefinedValues<T> = {
16
- [K in KeysWithDefinedValues<T>]: T[K];
17
- };
18
- declare type IsNull<T, K extends keyof T> = {
19
- [K1 in Exclude<keyof T, K>]: T[K1];
20
- } & T[K] extends null ? K : never;
21
- declare type NullKeys<T> = {
22
- [K in keyof T]: IsNull<T, K>;
23
- }[keyof T];
24
- export declare type SeedLengths = 12 | 24;
25
- export interface AccountJson extends KeyringPair$Meta {
26
- address: string;
27
- genesisHash?: string | null;
28
- isExternal?: boolean;
29
- isHardware?: boolean;
30
- isHidden?: boolean;
31
- name?: string;
32
- parentAddress?: string;
33
- suri?: string;
34
- type?: KeypairType;
35
- whenCreated?: number;
36
- }
37
- export interface AccountsWithCurrentAddress {
38
- accounts: AccountJson[];
39
- currentAddress?: string;
40
- }
41
- export interface CurrentAccountInfo {
42
- address: string;
43
- }
44
- export declare type AccountWithChildren = AccountJson & {
45
- children?: AccountWithChildren[];
46
- };
47
- export declare type AccountsContext = {
48
- accounts: AccountJson[];
49
- hierarchy: AccountWithChildren[];
50
- master?: AccountJson;
51
- };
52
- export declare type CurrentAccContext = {
53
- currentAccount: AccountJson | null;
54
- setCurrentAccount: (account: AccountJson | null) => void;
55
- };
56
- export declare type AccNetworkContext = {
57
- network: CurrentNetworkInfo;
58
- setNetwork: (network: CurrentNetworkInfo) => void;
59
- };
60
- export interface AuthorizeRequest {
61
- id: string;
62
- request: RequestAuthorizeTab;
63
- url: string;
64
- }
65
- export interface MetadataRequest {
66
- id: string;
67
- request: MetadataDef;
68
- url: string;
69
- }
70
- export interface SigningRequest {
71
- account: AccountJson;
72
- id: string;
73
- request: RequestSign;
74
- url: string;
75
- }
76
- export interface RequestSignatures extends KoniRequestSignatures {
77
- 'pri(accounts.create.external)': [RequestAccountCreateExternal, boolean];
78
- 'pri(accounts.create.hardware)': [RequestAccountCreateHardware, boolean];
79
- 'pri(accounts.create.suri)': [RequestAccountCreateSuri, boolean];
80
- 'pri(accounts.edit)': [RequestAccountEdit, boolean];
81
- 'pri(accounts.export)': [RequestAccountExport, ResponseAccountExport];
82
- 'pri(accounts.batchExport)': [RequestAccountBatchExport, ResponseAccountsExport];
83
- 'pri(accounts.forget)': [RequestAccountForget, boolean];
84
- 'pri(accounts.show)': [RequestAccountShow, boolean];
85
- 'pri(accounts.tie)': [RequestAccountTie, boolean];
86
- 'pri(accounts.subscribe)': [RequestAccountSubscribe, boolean, AccountJson[]];
87
- 'pri(accounts.validate)': [RequestAccountValidate, boolean];
88
- 'pri(accounts.changePassword)': [RequestAccountChangePassword, boolean];
89
- 'pri(authorize.approve)': [RequestAuthorizeApprove, boolean];
90
- 'pri(authorize.list)': [null, ResponseAuthorizeList];
91
- 'pri(authorize.reject)': [RequestAuthorizeReject, boolean];
92
- 'pri(authorize.requests)': [RequestAuthorizeSubscribe, boolean, AuthorizeRequest[]];
93
- 'pri(authorize.toggle)': [string, ResponseAuthorizeList];
94
- 'pri(derivation.create)': [RequestDeriveCreate, boolean];
95
- 'pri(derivation.validate)': [RequestDeriveValidate, ResponseDeriveValidate];
96
- 'pri(json.restore)': [RequestJsonRestore, void];
97
- 'pri(json.batchRestore)': [RequestBatchRestore, void];
98
- 'pri(json.validate.password)': [];
99
- 'pri(json.account.info)': [KeyringPair$Json, ResponseJsonGetAccountInfo];
100
- 'pri(metadata.approve)': [RequestMetadataApprove, boolean];
101
- 'pri(metadata.get)': [string | null, MetadataDef | null];
102
- 'pri(metadata.reject)': [RequestMetadataReject, boolean];
103
- 'pri(metadata.requests)': [RequestMetadataSubscribe, boolean, MetadataRequest[]];
104
- 'pri(metadata.list)': [null, MetadataDef[]];
105
- 'pri(seed.create)': [RequestSeedCreate, ResponseSeedCreate];
106
- 'pri(seed.validate)': [RequestSeedValidate, ResponseSeedValidate];
107
- 'pri(settings.notification)': [string, boolean];
108
- 'pri(signing.approve.password)': [RequestSigningApprovePassword, boolean];
109
- 'pri(signing.approve.signature)': [RequestSigningApproveSignature, boolean];
110
- 'pri(signing.cancel)': [RequestSigningCancel, boolean];
111
- 'pri(signing.isLocked)': [RequestSigningIsLocked, ResponseSigningIsLocked];
112
- 'pri(signing.requests)': [RequestSigningSubscribe, boolean, SigningRequest[]];
113
- 'pri(window.open)': [AllowedPath, boolean];
114
- 'pub(accounts.list)': [RequestAccountList, InjectedAccount[]];
115
- 'pub(accounts.subscribe)': [RequestAccountSubscribe, boolean, InjectedAccount[]];
116
- 'pub(authorize.tab)': [RequestAuthorizeTab, null];
117
- 'pub(authorize.tabV2)': [RequestAuthorizeTab, null];
118
- 'pub(bytes.sign)': [SignerPayloadRaw, ResponseSigning];
119
- 'pub(extrinsic.sign)': [SignerPayloadJSON, ResponseSigning];
120
- 'pub(metadata.list)': [null, InjectedMetadataKnown[]];
121
- 'pub(metadata.provide)': [MetadataDef, boolean];
122
- 'pub(phishing.redirectIfDenied)': [null, boolean];
123
- 'pub(rpc.listProviders)': [void, ResponseRpcListProviders];
124
- 'pub(rpc.send)': [RequestRpcSend, JsonRpcResponse];
125
- 'pub(rpc.startProvider)': [string, ProviderMeta];
126
- 'pub(rpc.subscribe)': [RequestRpcSubscribe, number, JsonRpcResponse];
127
- 'pub(rpc.subscribeConnected)': [null, boolean, boolean];
128
- 'pub(rpc.unsubscribe)': [RequestRpcUnsubscribe, boolean];
129
- }
130
- export declare type MessageTypes = keyof RequestSignatures;
131
- export declare type RequestTypes = {
132
- [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][0];
133
- };
134
- export declare type MessageTypesWithNullRequest = NullKeys<RequestTypes>;
135
- export interface TransportRequestMessage<TMessageType extends MessageTypes> {
136
- id: string;
137
- message: TMessageType;
138
- origin: 'page' | 'extension' | string;
139
- request: RequestTypes[TMessageType];
140
- }
141
- export interface RequestAuthorizeTab {
142
- origin: string;
143
- }
144
- export interface RequestAuthorizeApprove {
145
- id: string;
146
- }
147
- export interface RequestAuthorizeReject {
148
- id: string;
149
- }
150
- export declare type RequestAuthorizeSubscribe = null;
151
- export interface RequestMetadataApprove {
152
- id: string;
153
- }
154
- export interface RequestCurrentAccountAddress {
155
- address: string;
156
- }
157
- export interface RequestMetadataReject {
158
- id: string;
159
- }
160
- export declare type RequestMetadataSubscribe = null;
161
- export interface RequestAccountCreateExternal {
162
- address: string;
163
- genesisHash?: string | null;
164
- name: string;
165
- }
166
- export interface RequestAccountCreateSuri {
167
- name: string;
168
- genesisHash?: string | null;
169
- password: string;
170
- suri: string;
171
- type?: KeypairType;
172
- }
173
- export interface RequestAccountCreateHardware {
174
- accountIndex: number;
175
- address: string;
176
- addressOffset: number;
177
- genesisHash: string;
178
- hardwareType: string;
179
- name: string;
180
- }
181
- export interface RequestAccountChangePassword {
182
- address: string;
183
- oldPass: string;
184
- newPass: string;
185
- }
186
- export interface RequestAccountEdit {
187
- address: string;
188
- genesisHash?: string | null;
189
- name: string;
190
- }
191
- export interface RequestAccountForget {
192
- address: string;
193
- }
194
- export interface RequestAccountShow {
195
- address: string;
196
- isShowing: boolean;
197
- }
198
- export interface RequestAccountTie {
199
- address: string;
200
- genesisHash: string | null;
201
- }
202
- export interface RequestAccountValidate {
203
- address: string;
204
- password: string;
205
- }
206
- export interface RequestDeriveCreate {
207
- name: string;
208
- genesisHash?: string | null;
209
- suri: string;
210
- parentAddress: string;
211
- parentPassword: string;
212
- password: string;
213
- }
214
- export interface RequestDeriveValidate {
215
- suri: string;
216
- parentAddress: string;
217
- parentPassword: string;
218
- }
219
- export interface RequestAccountExport {
220
- address: string;
221
- password: string;
222
- }
223
- export interface RequestAccountBatchExport {
224
- addresses: string[];
225
- password: string;
226
- }
227
- export interface RequestAccountList {
228
- anyType?: boolean;
229
- }
230
- export declare type RequestAccountSubscribe = null;
231
- export interface RequestRpcSend {
232
- method: string;
233
- params: unknown[];
234
- }
235
- export interface RequestRpcSubscribe extends RequestRpcSend {
236
- type: string;
237
- }
238
- export interface RequestRpcUnsubscribe {
239
- method: string;
240
- subscriptionId: number | string;
241
- type: string;
242
- }
243
- export interface RequestSigningApprovePassword {
244
- id: string;
245
- password?: string;
246
- savePass: boolean;
247
- }
248
- export interface RequestSigningApproveSignature {
249
- id: string;
250
- signature: HexString;
251
- }
252
- export interface RequestSigningCancel {
253
- id: string;
254
- }
255
- export interface RequestSigningIsLocked {
256
- id: string;
257
- }
258
- export interface ResponseSigningIsLocked {
259
- isLocked: boolean;
260
- remainingTime: number;
261
- }
262
- export declare type RequestSigningSubscribe = null;
263
- export interface RequestSeedCreate {
264
- length?: SeedLengths;
265
- seed?: string;
266
- type?: KeypairType;
267
- }
268
- export interface RequestSeedValidate {
269
- suri: string;
270
- type?: KeypairType;
271
- }
272
- export declare type ResponseTypes = {
273
- [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][1];
274
- };
275
- export declare type ResponseType<TMessageType extends keyof RequestSignatures> = RequestSignatures[TMessageType][1];
276
- interface TransportResponseMessageSub<TMessageType extends MessageTypesWithSubscriptions> {
277
- error?: string;
278
- id: string;
279
- response?: ResponseTypes[TMessageType];
280
- subscription?: SubscriptionMessageTypes[TMessageType];
281
- }
282
- interface TransportResponseMessageNoSub<TMessageType extends MessageTypesWithNoSubscriptions> {
283
- error?: string;
284
- id: string;
285
- response?: ResponseTypes[TMessageType];
286
- }
287
- export declare type TransportResponseMessage<TMessageType extends MessageTypes> = TMessageType extends MessageTypesWithNoSubscriptions ? TransportResponseMessageNoSub<TMessageType> : TMessageType extends MessageTypesWithSubscriptions ? TransportResponseMessageSub<TMessageType> : never;
288
- export interface ResponseSigning {
289
- id: string;
290
- signature: HexString;
291
- }
292
- export interface ResponseDeriveValidate {
293
- address: string;
294
- suri: string;
295
- }
296
- export interface ResponseSeedCreate {
297
- address: string;
298
- seed: string;
299
- }
300
- export interface ResponseSeedValidate {
301
- address: string;
302
- suri: string;
303
- }
304
- export interface ResponseAccountExport {
305
- exportedJson: KeyringPair$Json;
306
- }
307
- export interface ResponseAccountsExport {
308
- exportedJson: KeyringPairs$Json;
309
- }
310
- export declare type ResponseRpcListProviders = ProviderList;
311
- export declare type SubscriptionMessageTypes = NoUndefinedValues<{
312
- [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][2];
313
- }>;
314
- export declare type MessageTypesWithSubscriptions = keyof SubscriptionMessageTypes;
315
- export declare type MessageTypesWithNoSubscriptions = Exclude<MessageTypes, keyof SubscriptionMessageTypes>;
316
- export interface RequestSign {
317
- readonly payload: SignerPayloadJSON | SignerPayloadRaw;
318
- sign(registry: TypeRegistry, pair: KeyringPair): {
319
- signature: HexString;
320
- };
321
- }
322
- export interface RequestJsonRestore {
323
- file: KeyringPair$Json;
324
- password: string;
325
- address: string;
326
- }
327
- export interface RequestBatchRestore {
328
- file: KeyringPairs$Json;
329
- password: string;
330
- address: string;
331
- }
332
- export interface ResponseJsonRestore {
333
- error: string | null;
334
- }
335
- export declare type AllowedPath = typeof ALLOWED_PATH[number];
336
- export interface ResponseJsonGetAccountInfo {
337
- address: string;
338
- name: string;
339
- genesisHash: string;
340
- type: KeypairType;
341
- }
342
- export interface ResponseAuthorizeList {
343
- list: AuthUrls;
344
- }
345
- export {};
1
+ import type { InjectedAccount, InjectedMetadataKnown, MetadataDef, ProviderList, ProviderMeta } from '@subwallet/extension-inject/types';
2
+ import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types';
3
+ import type { JsonRpcResponse } from '@polkadot/rpc-provider/types';
4
+ import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
5
+ import type { KeyringPairs$Json } from '@polkadot/ui-keyring/types';
6
+ import type { HexString } from '@polkadot/util/types';
7
+ import type { KeypairType } from '@polkadot/util-crypto/types';
8
+ import { CurrentNetworkInfo, KoniRequestSignatures } from '@subwallet/extension-base/background/KoniTypes';
9
+ import { TypeRegistry } from '@polkadot/types';
10
+ import { ALLOWED_PATH } from '../defaults';
11
+ import { AuthUrls } from './handlers/State';
12
+ declare type KeysWithDefinedValues<T> = {
13
+ [K in keyof T]: T[K] extends undefined ? never : K;
14
+ }[keyof T];
15
+ declare type NoUndefinedValues<T> = {
16
+ [K in KeysWithDefinedValues<T>]: T[K];
17
+ };
18
+ declare type IsNull<T, K extends keyof T> = {
19
+ [K1 in Exclude<keyof T, K>]: T[K1];
20
+ } & T[K] extends null ? K : never;
21
+ declare type NullKeys<T> = {
22
+ [K in keyof T]: IsNull<T, K>;
23
+ }[keyof T];
24
+ export declare type SeedLengths = 12 | 24;
25
+ export interface AccountJson extends KeyringPair$Meta {
26
+ address: string;
27
+ genesisHash?: string | null;
28
+ isExternal?: boolean;
29
+ isHardware?: boolean;
30
+ isHidden?: boolean;
31
+ name?: string;
32
+ parentAddress?: string;
33
+ suri?: string;
34
+ type?: KeypairType;
35
+ whenCreated?: number;
36
+ }
37
+ export interface AccountsWithCurrentAddress {
38
+ accounts: AccountJson[];
39
+ currentAddress?: string;
40
+ }
41
+ export interface CurrentAccountInfo {
42
+ address: string;
43
+ }
44
+ export declare type AccountWithChildren = AccountJson & {
45
+ children?: AccountWithChildren[];
46
+ };
47
+ export declare type AccountsContext = {
48
+ accounts: AccountJson[];
49
+ hierarchy: AccountWithChildren[];
50
+ master?: AccountJson;
51
+ };
52
+ export declare type CurrentAccContext = {
53
+ currentAccount: AccountJson | null;
54
+ setCurrentAccount: (account: AccountJson | null) => void;
55
+ };
56
+ export declare type AccNetworkContext = {
57
+ network: CurrentNetworkInfo;
58
+ setNetwork: (network: CurrentNetworkInfo) => void;
59
+ };
60
+ export interface AuthorizeRequest {
61
+ id: string;
62
+ request: RequestAuthorizeTab;
63
+ url: string;
64
+ }
65
+ export interface MetadataRequest {
66
+ id: string;
67
+ request: MetadataDef;
68
+ url: string;
69
+ }
70
+ export interface SigningRequest {
71
+ account: AccountJson;
72
+ id: string;
73
+ request: RequestSign;
74
+ url: string;
75
+ }
76
+ export interface RequestSignatures extends KoniRequestSignatures {
77
+ 'pri(accounts.create.external)': [RequestAccountCreateExternal, boolean];
78
+ 'pri(accounts.create.hardware)': [RequestAccountCreateHardware, boolean];
79
+ 'pri(accounts.create.suri)': [RequestAccountCreateSuri, boolean];
80
+ 'pri(accounts.edit)': [RequestAccountEdit, boolean];
81
+ 'pri(accounts.export)': [RequestAccountExport, ResponseAccountExport];
82
+ 'pri(accounts.batchExport)': [RequestAccountBatchExport, ResponseAccountsExport];
83
+ 'pri(accounts.forget)': [RequestAccountForget, boolean];
84
+ 'pri(accounts.show)': [RequestAccountShow, boolean];
85
+ 'pri(accounts.tie)': [RequestAccountTie, boolean];
86
+ 'pri(accounts.subscribe)': [RequestAccountSubscribe, boolean, AccountJson[]];
87
+ 'pri(accounts.validate)': [RequestAccountValidate, boolean];
88
+ 'pri(accounts.changePassword)': [RequestAccountChangePassword, boolean];
89
+ 'pri(authorize.approve)': [RequestAuthorizeApprove, boolean];
90
+ 'pri(authorize.list)': [null, ResponseAuthorizeList];
91
+ 'pri(authorize.reject)': [RequestAuthorizeReject, boolean];
92
+ 'pri(authorize.requests)': [RequestAuthorizeSubscribe, boolean, AuthorizeRequest[]];
93
+ 'pri(authorize.toggle)': [string, ResponseAuthorizeList];
94
+ 'pri(derivation.create)': [RequestDeriveCreate, boolean];
95
+ 'pri(derivation.validate)': [RequestDeriveValidate, ResponseDeriveValidate];
96
+ 'pri(json.restore)': [RequestJsonRestore, void];
97
+ 'pri(json.batchRestore)': [RequestBatchRestore, void];
98
+ 'pri(json.validate.password)': [];
99
+ 'pri(json.account.info)': [KeyringPair$Json, ResponseJsonGetAccountInfo];
100
+ 'pri(metadata.approve)': [RequestMetadataApprove, boolean];
101
+ 'pri(metadata.get)': [string | null, MetadataDef | null];
102
+ 'pri(metadata.reject)': [RequestMetadataReject, boolean];
103
+ 'pri(metadata.requests)': [RequestMetadataSubscribe, boolean, MetadataRequest[]];
104
+ 'pri(metadata.list)': [null, MetadataDef[]];
105
+ 'pri(seed.create)': [RequestSeedCreate, ResponseSeedCreate];
106
+ 'pri(seed.validate)': [RequestSeedValidate, ResponseSeedValidate];
107
+ 'pri(settings.notification)': [string, boolean];
108
+ 'pri(signing.approve.password)': [RequestSigningApprovePassword, boolean];
109
+ 'pri(signing.approve.signature)': [RequestSigningApproveSignature, boolean];
110
+ 'pri(signing.cancel)': [RequestSigningCancel, boolean];
111
+ 'pri(signing.isLocked)': [RequestSigningIsLocked, ResponseSigningIsLocked];
112
+ 'pri(signing.requests)': [RequestSigningSubscribe, boolean, SigningRequest[]];
113
+ 'pri(window.open)': [AllowedPath, boolean];
114
+ 'pub(accounts.list)': [RequestAccountList, InjectedAccount[]];
115
+ 'pub(accounts.subscribe)': [RequestAccountSubscribe, boolean, InjectedAccount[]];
116
+ 'pub(authorize.tab)': [RequestAuthorizeTab, null];
117
+ 'pub(authorize.tabV2)': [RequestAuthorizeTab, null];
118
+ 'pub(bytes.sign)': [SignerPayloadRaw, ResponseSigning];
119
+ 'pub(extrinsic.sign)': [SignerPayloadJSON, ResponseSigning];
120
+ 'pub(metadata.list)': [null, InjectedMetadataKnown[]];
121
+ 'pub(metadata.provide)': [MetadataDef, boolean];
122
+ 'pub(phishing.redirectIfDenied)': [null, boolean];
123
+ 'pub(rpc.listProviders)': [void, ResponseRpcListProviders];
124
+ 'pub(rpc.send)': [RequestRpcSend, JsonRpcResponse];
125
+ 'pub(rpc.startProvider)': [string, ProviderMeta];
126
+ 'pub(rpc.subscribe)': [RequestRpcSubscribe, number, JsonRpcResponse];
127
+ 'pub(rpc.subscribeConnected)': [null, boolean, boolean];
128
+ 'pub(rpc.unsubscribe)': [RequestRpcUnsubscribe, boolean];
129
+ }
130
+ export declare type MessageTypes = keyof RequestSignatures;
131
+ export declare type RequestTypes = {
132
+ [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][0];
133
+ };
134
+ export declare type MessageTypesWithNullRequest = NullKeys<RequestTypes>;
135
+ export interface TransportRequestMessage<TMessageType extends MessageTypes> {
136
+ id: string;
137
+ message: TMessageType;
138
+ origin: 'page' | 'extension' | string;
139
+ request: RequestTypes[TMessageType];
140
+ }
141
+ export interface RequestAuthorizeTab {
142
+ origin: string;
143
+ }
144
+ export interface RequestAuthorizeApprove {
145
+ id: string;
146
+ }
147
+ export interface RequestAuthorizeReject {
148
+ id: string;
149
+ }
150
+ export declare type RequestAuthorizeSubscribe = null;
151
+ export interface RequestMetadataApprove {
152
+ id: string;
153
+ }
154
+ export interface RequestCurrentAccountAddress {
155
+ address: string;
156
+ }
157
+ export interface RequestMetadataReject {
158
+ id: string;
159
+ }
160
+ export declare type RequestMetadataSubscribe = null;
161
+ export interface RequestAccountCreateExternal {
162
+ address: string;
163
+ genesisHash?: string | null;
164
+ name: string;
165
+ }
166
+ export interface RequestAccountCreateSuri {
167
+ name: string;
168
+ genesisHash?: string | null;
169
+ password: string;
170
+ suri: string;
171
+ type?: KeypairType;
172
+ }
173
+ export interface RequestAccountCreateHardware {
174
+ accountIndex: number;
175
+ address: string;
176
+ addressOffset: number;
177
+ genesisHash: string;
178
+ hardwareType: string;
179
+ name: string;
180
+ }
181
+ export interface RequestAccountChangePassword {
182
+ address: string;
183
+ oldPass: string;
184
+ newPass: string;
185
+ }
186
+ export interface RequestAccountEdit {
187
+ address: string;
188
+ genesisHash?: string | null;
189
+ name: string;
190
+ }
191
+ export interface RequestAccountForget {
192
+ address: string;
193
+ }
194
+ export interface RequestAccountShow {
195
+ address: string;
196
+ isShowing: boolean;
197
+ }
198
+ export interface RequestAccountTie {
199
+ address: string;
200
+ genesisHash: string | null;
201
+ }
202
+ export interface RequestAccountValidate {
203
+ address: string;
204
+ password: string;
205
+ }
206
+ export interface RequestDeriveCreate {
207
+ name: string;
208
+ genesisHash?: string | null;
209
+ suri: string;
210
+ parentAddress: string;
211
+ parentPassword: string;
212
+ password: string;
213
+ }
214
+ export interface RequestDeriveValidate {
215
+ suri: string;
216
+ parentAddress: string;
217
+ parentPassword: string;
218
+ }
219
+ export interface RequestAccountExport {
220
+ address: string;
221
+ password: string;
222
+ }
223
+ export interface RequestAccountBatchExport {
224
+ addresses: string[];
225
+ password: string;
226
+ }
227
+ export interface RequestAccountList {
228
+ anyType?: boolean;
229
+ }
230
+ export declare type RequestAccountSubscribe = null;
231
+ export interface RequestRpcSend {
232
+ method: string;
233
+ params: unknown[];
234
+ }
235
+ export interface RequestRpcSubscribe extends RequestRpcSend {
236
+ type: string;
237
+ }
238
+ export interface RequestRpcUnsubscribe {
239
+ method: string;
240
+ subscriptionId: number | string;
241
+ type: string;
242
+ }
243
+ export interface RequestSigningApprovePassword {
244
+ id: string;
245
+ password?: string;
246
+ savePass: boolean;
247
+ }
248
+ export interface RequestSigningApproveSignature {
249
+ id: string;
250
+ signature: HexString;
251
+ }
252
+ export interface RequestSigningCancel {
253
+ id: string;
254
+ }
255
+ export interface RequestSigningIsLocked {
256
+ id: string;
257
+ }
258
+ export interface ResponseSigningIsLocked {
259
+ isLocked: boolean;
260
+ remainingTime: number;
261
+ }
262
+ export declare type RequestSigningSubscribe = null;
263
+ export interface RequestSeedCreate {
264
+ length?: SeedLengths;
265
+ seed?: string;
266
+ type?: KeypairType;
267
+ }
268
+ export interface RequestSeedValidate {
269
+ suri: string;
270
+ type?: KeypairType;
271
+ }
272
+ export declare type ResponseTypes = {
273
+ [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][1];
274
+ };
275
+ export declare type ResponseType<TMessageType extends keyof RequestSignatures> = RequestSignatures[TMessageType][1];
276
+ interface TransportResponseMessageSub<TMessageType extends MessageTypesWithSubscriptions> {
277
+ error?: string;
278
+ id: string;
279
+ response?: ResponseTypes[TMessageType];
280
+ subscription?: SubscriptionMessageTypes[TMessageType];
281
+ }
282
+ interface TransportResponseMessageNoSub<TMessageType extends MessageTypesWithNoSubscriptions> {
283
+ error?: string;
284
+ id: string;
285
+ response?: ResponseTypes[TMessageType];
286
+ }
287
+ export declare type TransportResponseMessage<TMessageType extends MessageTypes> = TMessageType extends MessageTypesWithNoSubscriptions ? TransportResponseMessageNoSub<TMessageType> : TMessageType extends MessageTypesWithSubscriptions ? TransportResponseMessageSub<TMessageType> : never;
288
+ export interface ResponseSigning {
289
+ id: string;
290
+ signature: HexString;
291
+ }
292
+ export interface ResponseDeriveValidate {
293
+ address: string;
294
+ suri: string;
295
+ }
296
+ export interface ResponseSeedCreate {
297
+ address: string;
298
+ seed: string;
299
+ }
300
+ export interface ResponseSeedValidate {
301
+ address: string;
302
+ suri: string;
303
+ }
304
+ export interface ResponseAccountExport {
305
+ exportedJson: KeyringPair$Json;
306
+ }
307
+ export interface ResponseAccountsExport {
308
+ exportedJson: KeyringPairs$Json;
309
+ }
310
+ export declare type ResponseRpcListProviders = ProviderList;
311
+ export declare type SubscriptionMessageTypes = NoUndefinedValues<{
312
+ [MessageType in keyof RequestSignatures]: RequestSignatures[MessageType][2];
313
+ }>;
314
+ export declare type MessageTypesWithSubscriptions = keyof SubscriptionMessageTypes;
315
+ export declare type MessageTypesWithNoSubscriptions = Exclude<MessageTypes, keyof SubscriptionMessageTypes>;
316
+ export interface RequestSign {
317
+ readonly payload: SignerPayloadJSON | SignerPayloadRaw;
318
+ sign(registry: TypeRegistry, pair: KeyringPair): {
319
+ signature: HexString;
320
+ };
321
+ }
322
+ export interface RequestJsonRestore {
323
+ file: KeyringPair$Json;
324
+ password: string;
325
+ address: string;
326
+ }
327
+ export interface RequestBatchRestore {
328
+ file: KeyringPairs$Json;
329
+ password: string;
330
+ address: string;
331
+ }
332
+ export interface ResponseJsonRestore {
333
+ error: string | null;
334
+ }
335
+ export declare type AllowedPath = typeof ALLOWED_PATH[number];
336
+ export interface ResponseJsonGetAccountInfo {
337
+ address: string;
338
+ name: string;
339
+ genesisHash: string;
340
+ type: KeypairType;
341
+ }
342
+ export interface ResponseAuthorizeList {
343
+ list: AuthUrls;
344
+ }
345
+ export {};