@ledgerhq/vault-common 2.1.0 → 2.1.2

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 (70) hide show
  1. package/.turbo/turbo-build.log +30 -70
  2. package/CHANGELOG.md +13 -0
  3. package/lib/{chunk-N3BTCH3V.js → chunk-33OZ4G5P.js} +13 -13
  4. package/lib/{chunk-N3BTCH3V.js.map → chunk-33OZ4G5P.js.map} +1 -1
  5. package/lib/{chunk-54TW5QWG.js → chunk-FHIMXJ7N.js} +3 -3
  6. package/lib/{chunk-54TW5QWG.js.map → chunk-FHIMXJ7N.js.map} +1 -1
  7. package/lib/{chunk-XLTLYFIA.js → chunk-GAKIXPAF.js} +1 -1
  8. package/lib/chunk-GAKIXPAF.js.map +1 -0
  9. package/lib/{chunk-2JI4TYQ5.js → chunk-O535UIIL.js} +3 -3
  10. package/lib/{chunk-2JI4TYQ5.js.map → chunk-O535UIIL.js.map} +1 -1
  11. package/lib/{chunk-KDIUPKOI.js → chunk-ODU2VY2U.js} +21 -21
  12. package/lib/{chunk-KDIUPKOI.js.map → chunk-ODU2VY2U.js.map} +1 -1
  13. package/lib/{chunk-KTWGBZVH.js → chunk-TLTMGY3E.js} +12 -3
  14. package/lib/chunk-TLTMGY3E.js.map +1 -0
  15. package/lib/createHSMBridge.d.ts +1 -1
  16. package/lib/createHSMBridge.js +4 -4
  17. package/lib/{index-VARl4h9O.d.ts → index-Cm_O9VIx.d.ts} +9 -1
  18. package/lib/index.d.ts +9 -3
  19. package/lib/index.js +70 -65
  20. package/lib/index.js.map +1 -1
  21. package/lib/recipeManifest.d.ts +1 -1
  22. package/lib/recipeManifest.js +3 -3
  23. package/lib/reviewAPIRequest.d.ts +1 -1
  24. package/lib/reviewAPIRequest.js +4 -4
  25. package/lib/types/index.d.ts +1 -1
  26. package/lib/types/index.js +2 -2
  27. package/lib/utils.d.ts +1 -1
  28. package/lib/utils.js +2 -2
  29. package/package.json +11 -10
  30. package/tsup.config.ts +1 -1
  31. package/lib/chunk-7QMDKSJQ.mjs +0 -1252
  32. package/lib/chunk-7QMDKSJQ.mjs.map +0 -1
  33. package/lib/chunk-C5XQJPYC.mjs +0 -14
  34. package/lib/chunk-C5XQJPYC.mjs.map +0 -1
  35. package/lib/chunk-HU7O2ZFW.mjs +0 -249
  36. package/lib/chunk-HU7O2ZFW.mjs.map +0 -1
  37. package/lib/chunk-J5LGTIGS.mjs +0 -10
  38. package/lib/chunk-J5LGTIGS.mjs.map +0 -1
  39. package/lib/chunk-KTWGBZVH.js.map +0 -1
  40. package/lib/chunk-OKAHQ7XI.mjs +0 -97
  41. package/lib/chunk-OKAHQ7XI.mjs.map +0 -1
  42. package/lib/chunk-PG4G7C6U.mjs +0 -83
  43. package/lib/chunk-PG4G7C6U.mjs.map +0 -1
  44. package/lib/chunk-UF4TTNDL.mjs +0 -503
  45. package/lib/chunk-UF4TTNDL.mjs.map +0 -1
  46. package/lib/chunk-US3UTA6G.mjs +0 -1176
  47. package/lib/chunk-US3UTA6G.mjs.map +0 -1
  48. package/lib/chunk-XLTLYFIA.js.map +0 -1
  49. package/lib/createHSMBridge.d.mts +0 -27
  50. package/lib/createHSMBridge.mjs +0 -10
  51. package/lib/createHSMBridge.mjs.map +0 -1
  52. package/lib/crypto/utils.d.mts +0 -14
  53. package/lib/crypto/utils.mjs +0 -12
  54. package/lib/crypto/utils.mjs.map +0 -1
  55. package/lib/index-VARl4h9O.d.mts +0 -2002
  56. package/lib/index.d.mts +0 -155
  57. package/lib/index.mjs +0 -3247
  58. package/lib/index.mjs.map +0 -1
  59. package/lib/recipeManifest.d.mts +0 -6
  60. package/lib/recipeManifest.mjs +0 -11
  61. package/lib/recipeManifest.mjs.map +0 -1
  62. package/lib/reviewAPIRequest.d.mts +0 -20
  63. package/lib/reviewAPIRequest.mjs +0 -11
  64. package/lib/reviewAPIRequest.mjs.map +0 -1
  65. package/lib/types/index.d.mts +0 -6
  66. package/lib/types/index.mjs +0 -10
  67. package/lib/types/index.mjs.map +0 -1
  68. package/lib/utils.d.mts +0 -29
  69. package/lib/utils.mjs +0 -38
  70. package/lib/utils.mjs.map +0 -1
@@ -1,2002 +0,0 @@
1
- import { RecordStore } from '@ledgerhq/hw-transport-mocker';
2
- import { CryptoCurrency, TokenCurrency } from '@ledgerhq/types-cryptoassets';
3
- import { Logger } from '@ledgerhq/vault-utils';
4
- import { BigNumber } from 'bignumber.js';
5
- import { Socket } from 'socket.io-client';
6
-
7
- type Device = {
8
- authenticate: DeviceAuthenticate;
9
- getAttestationCertificate: DeviceGenAttestationCert;
10
- getPublicKey: DeviceGetPubKey;
11
- getUserID: DeviceGetUserID;
12
- register: DeviceRegister;
13
- registerData: DeviceRegisterData;
14
- switchDevice: (deviceIndex: number) => Promise<void>;
15
- initiatePairingHandshake: InitiatePairingHandshake;
16
- validateVaultOperation: DeviceValidateVaultOp;
17
- finalizePairingHandshake: FinalizePairingHandshake;
18
- startKpatternAsResponder: StartKPatternAsResponder;
19
- hasPartitionID: HasPartitionID;
20
- getConfidentialityKey: GetConfidentialityKey;
21
- updatePSDPartitionPairing: UpdatePSDPartitionPairing;
22
- };
23
- interface APIDevice extends Device {
24
- setSeed: (seed: string) => void;
25
- setSalt: (salt: string) => void;
26
- getPsdModel: () => PsdModel;
27
- setPsdModel: (psdModel: PsdModel) => void;
28
- }
29
- type DeviceGetUserID = () => Promise<string>;
30
- type DeviceAuthenticate = (transport: any, challenge: Buffer, application: string, keyHandle: Buffer, userName: string, role: string, workspace: string) => Promise<{
31
- userPresence: any;
32
- counter: any;
33
- signature: string;
34
- rawResponse: string;
35
- }>;
36
- type DeviceGenAttestationCert = (transport: any) => Promise<Buffer>;
37
- type DeviceGetPubKey = (transport: any, path: number[], secp256k1?: boolean) => Promise<{
38
- pubKey: string;
39
- signature: Buffer;
40
- }>;
41
- type DeviceRegister = (transport: any, challenge: Buffer, application: string, name: string, userRole: "shared_owner" | "admin" | "operator", registerData: string) => Promise<{
42
- rfu: any;
43
- pubKey: any;
44
- u2f_register: Buffer;
45
- keyHandle: Buffer;
46
- }>;
47
- type DeviceRegisterData = (transport: any, challenge: Buffer) => Promise<any>;
48
- type DeviceValidateVaultOp = (transport: any, path: number[], channel: {
49
- blob: string;
50
- w_actions: string[];
51
- }) => Promise<string>;
52
- type InitiatePairingHandshake = (transport: any) => Promise<{
53
- pubKey: string;
54
- attestation: string;
55
- }>;
56
- type FinalizePairingHandshake = (transport: any, handshake: string, ciphertext: string, handshakeAttestation: HsmCertificate) => Promise<string>;
57
- type StartKPatternAsResponder = (transport: any, scriptID: number, handshake: string, handshakeAttestation: {
58
- attestation_pub: string;
59
- certificate: string;
60
- code_hash: string;
61
- signature: string;
62
- }, partitionID: string) => Promise<string>;
63
- type HasPartitionID = (opts: {
64
- transport: any;
65
- }) => Promise<boolean>;
66
- type GetConfidentialityKey = (opts: {
67
- transport: any;
68
- }) => Promise<ConfidentialityKey>;
69
- type UpdatePSDPartitionPairing = (opts: {
70
- transport: any;
71
- pairingData: PairingData;
72
- }) => Promise<void>;
73
- type PairingData = {
74
- blob: string;
75
- };
76
- type ConfidentialityKey = {
77
- confidentiality_key_curve25519: string;
78
- confidentiality_key_signature: string;
79
- };
80
-
81
- type PrepareRequestArgs<S, T> = {
82
- type: S;
83
- data: T;
84
- };
85
- type GateCreateUserPayload = {
86
- type: "CREATE_ADMIN" | "CREATE_OPERATOR";
87
- username: string;
88
- user_id: string;
89
- is_api?: boolean;
90
- view_all_override?: boolean;
91
- };
92
- type GateCreateAPIUserPayload = {
93
- type: "CREATE_API_USER";
94
- user_data: {
95
- username: string;
96
- public_key: string;
97
- role: string;
98
- };
99
- };
100
- type GateCreateAPIV2UserAccessPayload = {
101
- type: "CREATE_API_USER_ACCESS";
102
- user_data: {
103
- username: string;
104
- };
105
- };
106
- type GateMigrateUserPayload = {
107
- type: "MIGRATE_ADMIN" | "MIGRATE_OPERATOR";
108
- id: number;
109
- };
110
- type GateCreateGroupPayload = {
111
- type: "CREATE_GROUP";
112
- name: string;
113
- description: string;
114
- members: number[];
115
- };
116
- type GateMigrateGroupPayload = {
117
- type: "MIGRATE_GROUP";
118
- group_id: number;
119
- migration_data: {
120
- members: number[];
121
- };
122
- };
123
- type GateCreateLamUserPayload = {
124
- type: "CREATE_OPERATOR";
125
- username: string;
126
- user_id: number;
127
- };
128
- type GateCreateAccountTradelinkPayload = {
129
- currency: string;
130
- custodian: number;
131
- asset_manager: number;
132
- exchanges: Array<{
133
- id: number;
134
- auto_repledge_enabled: boolean;
135
- requires_pre_approval: boolean;
136
- }>;
137
- };
138
- type GateCreateAccountPayload = {
139
- type: "CREATE_ACCOUNT";
140
- index?: number;
141
- account_type: string;
142
- account_data: {
143
- name: string;
144
- derivation_mode?: "standard" | "native_segwit";
145
- parent_account?: {
146
- id: number;
147
- } | {
148
- name: string;
149
- };
150
- currency?: {
151
- name: string;
152
- };
153
- governance_rules?: WeirdGateGovernanceRulesSet[];
154
- token?: WeirdGateTokenCurrency;
155
- erc20?: WeirdGateERC20Token;
156
- };
157
- tradelink_data?: GateCreateAccountTradelinkPayload;
158
- };
159
- type GateEditAccountPayload = {
160
- type: "EDIT_ACCOUNT";
161
- account_id: number;
162
- edit_data: {
163
- erc20?: WeirdGateERC20Token;
164
- token?: WeirdGateTokenCurrency;
165
- governance_rules?: WeirdGateGovernanceRulesSet[];
166
- name: string;
167
- };
168
- };
169
- type GateCreateVaultEntityPayload = {
170
- type: "CREATE_ENTITY";
171
- name: string;
172
- accounts: number[];
173
- };
174
- type GateEditVaultEntityPayload = {
175
- type: "EDIT_ENTITY";
176
- entity_id: number;
177
- edit_data: {
178
- name: string;
179
- accounts: number[];
180
- };
181
- };
182
- type GateMigrateAccountPayload = {
183
- type: "MIGRATE_ACCOUNT";
184
- account_id: number;
185
- migration_data: {
186
- currency?: string;
187
- derivation_mode?: "STANDARD" | "NATIVE_SEGWIT";
188
- governance_rules: WeirdGateGovernanceRulesSet[];
189
- name: string;
190
- };
191
- };
192
- type GateEditGroupPayload = {
193
- type: "EDIT_GROUP";
194
- group_id: number;
195
- edit_data: {
196
- name: string;
197
- members: number[];
198
- };
199
- };
200
- type GateAddressPayload = {
201
- name: string;
202
- currency: string;
203
- address: string;
204
- };
205
- type GateCreateWhitelistPayload = {
206
- type: "CREATE_WHITELIST";
207
- name: string;
208
- whitelist_type?: "TRANSACTION" | "SMART_CONTRACT";
209
- description: string;
210
- addresses: GateAddressPayload[];
211
- };
212
- type GateMigrateWhitelistPayload = {
213
- type: "MIGRATE_WHITELIST";
214
- whitelist_id: number;
215
- };
216
- type GateEditWhitelistPayload = {
217
- type: "EDIT_WHITELIST";
218
- whitelist_id: number;
219
- edit_data: {
220
- name: string;
221
- addresses: GateAddressPayload[];
222
- };
223
- };
224
- type GateCreateExchangePayload = {
225
- type: "IMPORT_EXCHANGE";
226
- exchange_data: {
227
- name: string;
228
- platform: string;
229
- governance_rules: WeirdGateGovernanceRulesSet[] | null;
230
- credentials: {
231
- apiKey: string;
232
- secret: string;
233
- };
234
- };
235
- };
236
- type GateCreatePolicyPayload = {
237
- type: "CREATE_POLICY";
238
- policy_data: {
239
- name: string;
240
- currency?: {
241
- name: string;
242
- };
243
- governance_rules: WeirdGateGovernanceRulesSet[];
244
- };
245
- };
246
- type UsersByDevice = Record<number, GateUser>;
247
- type UsersByName = Record<string, GateUser>;
248
- type IDByName = {
249
- [_: string]: number;
250
- };
251
- type DataGroup = {
252
- group: ManifestGroup;
253
- usersByDevice: UsersByDevice;
254
- usersByName: UsersByName;
255
- existingGroup?: GateGroup;
256
- };
257
- type DataWhitelist = {
258
- whitelist: ManifestWhitelist;
259
- existingWhitelist?: GateWhitelist;
260
- };
261
- type DataExchange = {
262
- exchange: ManifestExchange;
263
- usersByDevice: UsersByDevice;
264
- usersByName: UsersByName;
265
- groupsIDsByName: Record<string, number>;
266
- existingExchange: GateExchange | void;
267
- };
268
- type DataPolicy = {
269
- policy: ManifestPolicy;
270
- usersByDevice: UsersByDevice;
271
- whitelistsIDsByName: IDByName;
272
- usersByName: UsersByName;
273
- groupsIDsByName: Record<string, number>;
274
- existingPolicy: GatePolicy | void;
275
- };
276
- type DataAccount = {
277
- account: ManifestAccount;
278
- existingAccount?: GateAccount;
279
- usersByDevice: UsersByDevice;
280
- usersByName: UsersByName;
281
- groupsIDsByName: IDByName;
282
- whitelistsIDsByName: IDByName;
283
- hsmAssetManagersIDsByName: IDByName;
284
- hsmExchangesIDsByName: IDByName;
285
- hsmCustodiansIDsByName: IDByName;
286
- accountsByName: {
287
- [key: string]: GateAccount;
288
- };
289
- tokens: GateTokenCurrency[];
290
- };
291
- type DataVaultEntity = {
292
- vaultEntity: ManifestVaultEntity;
293
- existingVaultEntity?: GateVaultEntity;
294
- accountsByName: {
295
- [key: string]: GateAccount;
296
- };
297
- };
298
- type DataUser = {
299
- userID: string;
300
- name: string;
301
- role: "operator" | "admin";
302
- };
303
- type DataAPIUser = {
304
- name: string;
305
- publicKey: string;
306
- role: string;
307
- };
308
- type DataAPIUserAccess = {
309
- name: string;
310
- };
311
- type EditGroupInput = PrepareRequestArgs<"EDIT_GROUP", DataGroup>;
312
- type CreateGroupInput = PrepareRequestArgs<"CREATE_GROUP", DataGroup>;
313
- type EditWhitelistInput = PrepareRequestArgs<"EDIT_WHITELIST", DataWhitelist>;
314
- type CreateWhitelistInput = PrepareRequestArgs<"CREATE_WHITELIST", DataWhitelist>;
315
- type CreateUserInput = PrepareRequestArgs<"CREATE_ADMIN" | "CREATE_OPERATOR", DataUser>;
316
- type CreateAPIUserInput = PrepareRequestArgs<"CREATE_API_USER", DataAPIUser>;
317
- type CreateAPIUserAccessInput = PrepareRequestArgs<"CREATE_API_USER_ACCESS", DataAPIUserAccess>;
318
- type CreateAccountInput = PrepareRequestArgs<"CREATE_ACCOUNT", DataAccount>;
319
- type EditAccountInput = PrepareRequestArgs<"EDIT_ACCOUNT", DataAccount>;
320
- type CreateVaultEntityInput = PrepareRequestArgs<"CREATE_ENTITY", DataVaultEntity>;
321
- type EditVaultEntityInput = PrepareRequestArgs<"EDIT_ENTITY", DataVaultEntity>;
322
- type CreateExchangeInput = PrepareRequestArgs<"IMPORT_EXCHANGE", DataExchange>;
323
- type CreatePolicyInput = PrepareRequestArgs<"CREATE_POLICY", DataPolicy>;
324
- type DataQuorum = {
325
- quorum: number;
326
- };
327
- type EditQuorumInput = PrepareRequestArgs<"UPDATE_QUORUM", DataQuorum>;
328
- type GateEditQuorumPayload = {
329
- type: "UPDATE_QUORUM";
330
- quorum: number;
331
- };
332
- type GateEditWorkspaceRulePayload = {
333
- type: "EDIT_WORKSPACE_RULE";
334
- permission: GateWorkspacePermission;
335
- edit_data: {
336
- steps: GateWorkspaceRuleStep[];
337
- };
338
- };
339
- type Input = EditQuorumInput | CreateAPIUserInput | CreateUserInput | CreateAPIUserAccessInput | CreateGroupInput | EditGroupInput | CreateWhitelistInput | EditWhitelistInput | CreateExchangeInput | CreatePolicyInput | CreateAccountInput | EditAccountInput | CreateVaultEntityInput | EditVaultEntityInput;
340
- type Output = GateEditQuorumPayload | GateEditWorkspaceRulePayload | GateCreateAPIUserPayload | GateCreateAPIV2UserAccessPayload | GateCreateUserPayload | GateMigrateUserPayload | GateCreateGroupPayload | GateMigrateGroupPayload | GateEditGroupPayload | GateEditWhitelistPayload | GateCreateWhitelistPayload | GateMigrateWhitelistPayload | GateCreateExchangePayload | GateCreatePolicyPayload | GateCreateAccountPayload | GateCreateLamUserPayload | GateEditAccountPayload | GateMigrateAccountPayload | GateCreateVaultEntityPayload | GateEditVaultEntityPayload;
341
- declare const prepareRequest: (data: Input) => Output;
342
- declare const performRequest: <T>(payload: Output, pool: DevicesPool, options?: {
343
- existingRequest?: GateGenericRequest | null;
344
- noApproval?: boolean;
345
- withoutHSM?: boolean;
346
- twoStepsRequest?: boolean;
347
- }) => Promise<T>;
348
-
349
- declare const getDeviceIndex: (index: number) => number;
350
- type GateGroupsByName = Record<string, GateGroup>;
351
- type GateWhitelistsByName = Record<string, GateWhitelist>;
352
- type GateAccountsByName = Record<string, GateAccount>;
353
- type GateVaultEntitiesByName = Record<string, GateVaultEntity>;
354
- type GateExchangesByName = Record<string, GateExchange>;
355
- type GatePoliciesByName = Record<string, GatePolicy>;
356
- type GateTradelinkCustodianByName = Record<string, GateTradelinkEntity<"CUSTODIAN">>;
357
- type GateTradelinkHSMCustodianByName = Record<string, GateTradelink>;
358
- type GateTradelinkExchangeByName = Record<string, GateTradelinkEntity<"EXCHANGE">>;
359
- type GateTradelinkHSMExchangeByName = Record<string, GateTradelinkExchange>;
360
- type GateTradelinkHSMAssetManagerByName = Record<string, GateTradelinkAssetManager>;
361
- type GateTradelinkAssetManagerByName = Record<string, GateTradelinkEntity<"ASSET_MANAGER">>;
362
- type RecipeRawData = {
363
- pendingUserRequests: GateUserRequest[];
364
- groupsByName: GateGroupsByName;
365
- whitelistsByName: GateWhitelistsByName;
366
- accountsByName: GateAccountsByName;
367
- vaultEntitiesByName: GateVaultEntitiesByName;
368
- exchangesByName: GateExchangesByName;
369
- policiesByName: GatePoliciesByName;
370
- usersWithDevice: UserWithDevice[];
371
- usersWithoutDevice: UserWithoutDevice[];
372
- tradelinkCustodiansByName: GateTradelinkCustodianByName;
373
- tradelinkHSMCustodiansByName: GateTradelinkHSMCustodianByName;
374
- tradelinkExchangesByName: GateTradelinkExchangeByName;
375
- tradelinkHSMExchangesByName: GateTradelinkHSMExchangeByName;
376
- tradelinkHSMAssetManagersByName: GateTradelinkHSMAssetManagerByName;
377
- tradelinkAssetManagersByName: GateTradelinkAssetManagerByName;
378
- tradelinkNetwork: GateTradelinkNetwork;
379
- tradelinkOnboardingStatus: GateTradelinkOnboardingStatus;
380
- };
381
- type RecipeManifestResult = {
382
- manifest: Manifest;
383
- rawData: RecipeRawData;
384
- };
385
- type RecipeManifestOptions = {
386
- saveAccountsIndexes?: boolean;
387
- saveAccountsTypes?: boolean;
388
- };
389
- declare function recipeManifest(pool: DevicesPool, options?: RecipeManifestOptions): Promise<RecipeManifestResult>;
390
-
391
- type CardanoBalances = {
392
- available: number;
393
- pending: number;
394
- pending_rewards: number;
395
- stake_deposit: number;
396
- total: number;
397
- total_rewards: number;
398
- total_staking: number;
399
- withdrawable: number;
400
- };
401
-
402
- type PolkadotUnbond = {
403
- id: string;
404
- waiting_time: number;
405
- amount: BigNumber;
406
- };
407
- type PolkadotAnonymous = {
408
- address: string;
409
- balances: PolkadotAnonymousBalance;
410
- created_at: string;
411
- is_controller: boolean;
412
- is_main: boolean;
413
- };
414
- type PolkadotAnonymousBalance = {
415
- reserved: BigNumber;
416
- free: BigNumber;
417
- total: BigNumber;
418
- };
419
- type PolkadotBalance = {
420
- reserved: BigNumber;
421
- available: BigNumber;
422
- bonded: BigNumber;
423
- total: BigNumber;
424
- total_unbonded: BigNumber;
425
- total_unbonding: BigNumber;
426
- unbonding: PolkadotUnbond[];
427
- unbonded: PolkadotUnbond[];
428
- };
429
- type PolkadotProxy = {
430
- id: number;
431
- address: string;
432
- };
433
- type PolkadotStaking = {
434
- controller_address?: string | null;
435
- proxies: PolkadotProxy[];
436
- rewards_destination: PolkadotRewardDestination;
437
- };
438
- type PolkadotAccountData = {
439
- anonymous_proxy?: PolkadotAnonymous;
440
- balances: PolkadotBalance;
441
- staking: PolkadotStaking;
442
- total_rewards: BigNumber;
443
- };
444
- type PolkadotRewardDestination = "Staked" | "Stash";
445
-
446
- type UserContext = {
447
- network: Network;
448
- getToken: () => string | null;
449
- run: (interactions: Interaction<any>[], data: any) => Promise<any>;
450
- get: <T>(url: string, requestOptions?: any) => Promise<T>;
451
- post: <T>(url: string, payload: any) => Promise<T>;
452
- approveRequest: (payload: any) => Promise<any>;
453
- approveRequestWithoutHSM: (payload: any) => Promise<any>;
454
- rejectRequest: (requestID: number) => Promise<any>;
455
- connectSocket: () => Promise<typeof Socket>;
456
- onEvent: (cb: (event: VaultEvent) => void) => void;
457
- };
458
- type RawUser = {
459
- entityType: "USER";
460
- name: string;
461
- role: "admin" | "operator";
462
- device: number;
463
- };
464
- type RawGroup = {
465
- entityType: "GROUP";
466
- name: string;
467
- users: number[];
468
- description?: string;
469
- };
470
- type RawAccount = {
471
- entityType: "ACCOUNT";
472
- name: string;
473
- currency: string;
474
- derivationMode?: string;
475
- };
476
- type RawWhiteList = {
477
- entityType: "WHITELIST";
478
- name: string;
479
- description?: string;
480
- addresses: string[];
481
- };
482
- type RawEntity = RawUser | RawAccount | RawGroup | RawWhiteList;
483
- type EntityType = "USER" | "GROUP" | "ACCOUNT" | "WHITELIST" | "TRANSACTION" | "EXCHANGE" | "POLICY" | "VAULT_ENTITY";
484
- type TransportType = "software" | "speculos-web" | "nodehid" | "nodehid-replayer";
485
- type DevicesPoolOptions = {
486
- salt?: string;
487
- gate: string;
488
- apiGateway?: string;
489
- overrideSeeds?: string[];
490
- deviceAPIURL?: string;
491
- notifierURL?: string;
492
- readOnlyUser?: string;
493
- transport?: TransportType;
494
- recordStore?: RecordStore | null;
495
- psdModel?: PsdModel;
496
- deviceAPISessionID?: string;
497
- };
498
- type LamOptions = {
499
- lamURL?: string;
500
- lamAPIKey?: string;
501
- };
502
- type CliOptions = {
503
- networkDelay?: number;
504
- };
505
- type PoolOptions = DevicesPoolOptions & LamOptions & CliOptions;
506
- type UserContextRunnable = (context: UserContext) => any;
507
- type DeployOptions = {
508
- remoteURL?: string;
509
- name: string;
510
- owner: string;
511
- preset?: string;
512
- expireOn?: Date;
513
- values?: HelmValues;
514
- watchTimeoutMinutes?: number;
515
- useDedicatedHSMSimu?: boolean;
516
- useHTTPPolling?: boolean;
517
- };
518
- type UpgradeOptions = {
519
- remoteURL?: string;
520
- name: string;
521
- preset?: string;
522
- values?: HelmValues;
523
- watchTimeoutMinutes?: number;
524
- };
525
- type DestroyOptions = {
526
- remoteURL?: string;
527
- name: string;
528
- wait?: boolean;
529
- };
530
- type HelmValue = string | number | boolean | undefined | null | Array<HelmValue> | HelmValues;
531
- interface HelmValues {
532
- [x: string]: HelmValue;
533
- }
534
- type DevicesPool = {
535
- getRevaultCompatOptions: () => {
536
- workspace: string;
537
- deviceApiUrl: string;
538
- salt: string;
539
- };
540
- workspace: string;
541
- gate: string;
542
- apiGateway: string | undefined;
543
- network: Network;
544
- psdModel: PsdModel;
545
- login: (deviceIndex: number | string) => Promise<UserContext>;
546
- getUserID: (deviceIndex: number) => Promise<string>;
547
- bruteforceDeviceIndex: (userID: string) => Promise<number>;
548
- setSalt: (salt: string) => void;
549
- registerDevice: (deviceIndex: number, request: any) => Promise<any>;
550
- lamAPI: {
551
- createInvitation: (invitationID: string) => Promise<{
552
- device_id: string;
553
- }>;
554
- registerUser: (name: string, uuid: string) => Promise<void>;
555
- };
556
- runWithDevice: (deviceIndex: number, interactions: Interaction<any>[], data: any) => Promise<any>;
557
- runWithQuorum: (iteratee: UserContextRunnable) => Promise<any>;
558
- device: Device;
559
- interactions: Interactions;
560
- getOnboardingAdminDevices: () => Promise<AdminDevice[]>;
561
- };
562
- type ConnectionEdge<T> = {
563
- cursor: number;
564
- node: T;
565
- };
566
- type Connection<T> = {
567
- edges: ConnectionEdge<T>[];
568
- pageInfo: {
569
- hasNextPage: boolean;
570
- count: number;
571
- };
572
- };
573
- type GateEntityWithRequest = Extract<GateEntity, {
574
- last_request?: any;
575
- }>;
576
- interface GateEditWorkspaceRuleRequest extends GateGenericRequest {
577
- type: "EDIT_WORKSPACE_RULE";
578
- target_type: "WORKSPACE_RULE";
579
- workspace_rule: GateWorkspaceRule;
580
- request_data: {
581
- steps: GateWorkspaceRuleStep[];
582
- };
583
- }
584
- type GateRequest = NonNullable<GateEntityWithRequest["last_request"]> | GateAPIV2UserAccessRequest | GateEditWorkspaceRuleRequest | GateOrganizationRequest | GateActivateRequest;
585
- type GateRequestType = GateRequest["type"];
586
- type GateEntity = GateAPIKey | GateAccount | GateExchange | GateExchange | GateGroup | GateMessage | GatePolicy | GateSCIConfig | GateTransaction | GateUser | GateVaultEntity | GateWhitelist | GatePledgeIncrement | GateWorkspaceRule | GateRepledge | GateForcedUnpledge | GateDigestGroup | GateTransfer | GateTradelink | GateTradelinkExchange | GateTradelinkAssetManager;
587
- type GatePledgeIncrement = {
588
- id: number;
589
- status: "PENDING" | "SUBMITTED";
590
- account_id: number;
591
- data: {
592
- amount: string;
593
- };
594
- last_request?: GatePledgeIncrementRequest;
595
- };
596
- type GateRepledge = {
597
- id: number;
598
- status: "PENDING" | "SUBMITTED";
599
- account_id: number;
600
- data: {
601
- pledge_id: number;
602
- settlement_id: string;
603
- account_name: string;
604
- exchange_name: string;
605
- amount: string;
606
- currency: string;
607
- };
608
- last_request?: GateRepledgeRequest;
609
- };
610
- type GateForcedUnpledge = {
611
- id: number;
612
- status: "PENDING" | "SUBMITTED";
613
- account_id: number;
614
- data: {
615
- pledge_id: number;
616
- account_name: string;
617
- currency: string;
618
- exchange_name: string;
619
- };
620
- pledge_id: string;
621
- last_request?: GateForcedUnpledgeRequest;
622
- };
623
- type TradelinkNetwork = {
624
- id: string;
625
- custodian: GateTradelinkThirdParty<"CUSTODIAN">;
626
- asset_managers: GateTradelinkThirdParty<"ASSET_MANAGER">[];
627
- exchanges: GateTradelinkThirdParty<"EXCHANGE">[];
628
- };
629
- type GateTradelink = {
630
- id: number;
631
- status: "PENDING" | "SUBMITTED" | "ACTIVE" | "ABORTED";
632
- hsm_groups: {
633
- arbitration_groups: GateGroup[];
634
- settlement_groups: GateGroup[];
635
- withdraw_groups: GateGroup[];
636
- };
637
- network: TradelinkNetwork;
638
- last_request?: GateTradelinkRequest;
639
- };
640
- type TradelinkInternalGroup = {
641
- quorum: number;
642
- users: Array<{
643
- id: number;
644
- pub_key: string;
645
- username: string;
646
- }>;
647
- };
648
- type TradelinkInternalWhitelist = {
649
- id: number;
650
- addresses: Array<Omit<GateAddress, "id">>;
651
- };
652
- type GateTradelinkExchange = {
653
- id: number;
654
- status: "PENDING" | "SUBMITTED" | "ACTIVE" | "ABORTED";
655
- last_request?: GateTradelinkExchangeRequest;
656
- is_under_edit: boolean;
657
- network: TradelinkNetwork;
658
- network_data: TradelinkNetwork["exchanges"][number];
659
- front_data: {
660
- pledge_approval_group: TradelinkInternalGroup;
661
- settlement_creator_group: TradelinkInternalGroup;
662
- whitelist: TradelinkInternalWhitelist;
663
- };
664
- hsm_data: {
665
- name: string;
666
- pledge_approval_group: {
667
- id: number;
668
- quorum: number;
669
- users: string[];
670
- };
671
- settlement_creator_group: {
672
- id: number;
673
- quorum: number;
674
- users: string[];
675
- };
676
- };
677
- };
678
- type GateTradelinkAssetManager = {
679
- id: number;
680
- status: "PENDING" | "SUBMITTED" | "ACTIVE" | "ABORTED";
681
- last_request?: GateTradelinkAssetManagerRequest;
682
- is_under_edit: boolean;
683
- network: TradelinkNetwork;
684
- network_data: TradelinkNetwork["asset_managers"][number];
685
- front_data: {
686
- pledge_creator_group: TradelinkInternalGroup;
687
- settlement_approval_group: TradelinkInternalGroup;
688
- whitelist: TradelinkInternalWhitelist;
689
- };
690
- hsm_data: {
691
- name: string;
692
- pledge_creator_group: {
693
- id: number;
694
- quorum: number;
695
- users: string[];
696
- };
697
- settlement_approval_group: {
698
- id: number;
699
- quorum: number;
700
- users: string[];
701
- };
702
- };
703
- };
704
- type GateDeviceType = "API" | "PSD" | "SOFT_PSD";
705
- type GateUser = {
706
- id: number;
707
- entityType: "USER";
708
- is_api?: boolean;
709
- view_all_override?: boolean;
710
- pub_key: string;
711
- username: string;
712
- user_id: string;
713
- picture?: string;
714
- created_on: string;
715
- status: string;
716
- email?: string;
717
- role: "ADMIN" | "OPERATOR";
718
- last_request?: GateUserRequest;
719
- device_type: GateDeviceType;
720
- app_version?: string;
721
- };
722
- type GateAPIKey = {
723
- id: number;
724
- secret?: string;
725
- entityType: "VAULT_API_KEY";
726
- name: string;
727
- created_on: string;
728
- updated_on: string;
729
- status: "PENDING_APPROVAL" | "APPROVED" | "ACTIVE" | "SUSPENDED" | "PENDING_REVOCATION" | "REVOKED" | "ABORTED";
730
- entities: GateVaultEntity[];
731
- scopes: Record<string, any>;
732
- identifier: string;
733
- last_request?: GateAPIKeyRequest;
734
- };
735
- type GateTransfer = {
736
- id: number;
737
- amount: string;
738
- network: string | null;
739
- recipient: string;
740
- status: "PENDING" | "APPROVED" | "SUBMITTED" | "ABORTED";
741
- last_request: GateTransferRequest;
742
- };
743
- type GateSCIConfig = {
744
- id: number;
745
- entityType: "SCI_CONFIG";
746
- account: Omit<GateAccount, "sci_config">;
747
- sciconfig: {
748
- dapps: string[];
749
- custom_contract_call_enabled: boolean;
750
- };
751
- status: "PENDING" | "ACTIVE";
752
- last_request?: GateSCIConfigRequest;
753
- };
754
- type MessageType = "EIP191" | "EIP712";
755
- type GateMessage = {
756
- account_id: number;
757
- data: string | Record<string, any>;
758
- id: number;
759
- message_type: MessageType;
760
- signature: string | null;
761
- der_signature: string | null;
762
- status: "PENDING_APPROVAL" | "APPROVED" | "SIGNED" | "ABORTED";
763
- type: "MESSAGE_SIGNING_ALLOWED";
764
- entityType: "MESSAGE_SIGNING";
765
- created_on?: string;
766
- notes: GateTransactionNote[];
767
- last_request?: GateMessageRequest;
768
- };
769
- type AdminDevice = [username: string, index: number];
770
- type GateGroup = {
771
- id: number;
772
- name: string;
773
- entityType: "GROUP";
774
- created_on: string;
775
- created_by: GateUser;
776
- description?: string;
777
- status: "ACTIVE" | "PENDING" | "REVOKED" | "ABORTED" | "TO_MIGRATE";
778
- is_internal: boolean;
779
- members: GateUser[];
780
- is_under_edit: boolean;
781
- last_request?: GateGroupRequest;
782
- is_tradelink?: boolean;
783
- };
784
- type GateDigestSignature = {
785
- der: string;
786
- r: number;
787
- s: number;
788
- v: number | null;
789
- pub_key: string;
790
- };
791
- type GateDigest = {
792
- digest: string;
793
- derivation_path: string;
794
- signature?: GateDigestSignature;
795
- index?: number;
796
- };
797
- type GateDigestGroup = {
798
- id: number;
799
- last_request?: GateDigestsRequest;
800
- account_id: number;
801
- created_by: GateUser;
802
- created_on: string;
803
- digests_data: GateDigest[];
804
- status: "PENDING_APPROVAL" | "APPROVED";
805
- };
806
- type UTXOsPickingStrategy = "MERGE_OUTPUTS" | "DEEP_OUTPUTS_FIRST" | "OPTIMIZE_SIZE";
807
- type GateFees = {
808
- gas_price: string;
809
- gas_limit: string;
810
- fees_per_byte: string;
811
- fees: string;
812
- utxo_picking_strategy?: UTXOsPickingStrategy;
813
- storage_limit?: number;
814
- };
815
- type GateFeesEIP1559 = {
816
- base_fees: string;
817
- gas_limit: string;
818
- max_fees: string;
819
- max_fees_buffer_factor: string;
820
- priority_fees: string;
821
- };
822
- type AccountType = "Ethereum" | "Bitcoin" | "Erc20" | "Bep20" | "Ripple" | "Stellar" | "Tezos" | "Solana" | "Cardano" | "Polkadot" | "Tron";
823
- type AccountStatus = "PENDING_CREATE_IN_HSM" | "PENDING" | "APPROVED" | "PENDING_VIEW_ONLY" | "ACTIVE" | "VIEW_ONLY" | "PENDING_ACTIVATION" | "ABORTED" | "ACTIVATION_ABORTED";
824
- type Unit = {
825
- name: string;
826
- code: string;
827
- magnitude: number;
828
- };
829
- type AccountSettings = {
830
- id: number;
831
- fiat: string;
832
- currency_unit: Unit;
833
- unitIndex: number;
834
- blockchain_explorer: string;
835
- };
836
- type GateRuleMultiAuthStep = {
837
- quorum: number;
838
- group: GateGroup;
839
- };
840
- type GateRuleMultiAuth = {
841
- type: "MULTI_AUTHORIZATIONS";
842
- data: GateRuleMultiAuthStep[];
843
- };
844
- type GateRuleThreshold = {
845
- type: "THRESHOLD";
846
- data: [
847
- {
848
- currency_type: "CRYPTO";
849
- max: string | null;
850
- min: string | null;
851
- }
852
- ];
853
- };
854
- type GateRuleWhitelist = {
855
- type: "WHITELIST";
856
- data: GateWhitelist[];
857
- };
858
- type GateRuleSCI = {
859
- type: "SMART_CONTRACT_INTERACTION";
860
- data: [{
861
- enabled: boolean;
862
- }];
863
- };
864
- type GateRuleTransactionFilterPreset = "TEZOS_DELEGATION" | "POLKADOT_STAKING" | "DEPLOY_CONTRACT" | "SOLANA_STAKING" | "CARDANO_STAKING" | "RAW_SIGNING" | "SEND" | "MESSAGE_SIGNING" | "CREATE_SPL_TOKEN_ACCOUNT" | "TRANSFER_SPL_TOKEN" | "STAKE";
865
- type GateRuleTransactionFilter = {
866
- type: "TRANSACTION_FILTER";
867
- data: {
868
- preset: Exclude<GateRuleTransactionFilterPreset, "TRANSFER_SPL_TOKEN">;
869
- } | {
870
- preset: "TRANSFER_SPL_TOKEN";
871
- contract_address: string;
872
- };
873
- };
874
- type GateGovernanceRule = GateRuleMultiAuth | GateRuleThreshold | GateRuleWhitelist | GateRuleSCI | GateRuleTransactionFilter;
875
- type GateGovernanceRulesSet = {
876
- name: string;
877
- rules: GateGovernanceRule[];
878
- };
879
- type WeirdGateRuleMultiAuthStep = {
880
- quorum: number;
881
- group_id: number;
882
- } | {
883
- quorum: number;
884
- users: number[];
885
- };
886
- type WeirdGateRuleMultiAuth = {
887
- type: "MULTI_AUTHORIZATIONS";
888
- data: WeirdGateRuleMultiAuthStep[];
889
- };
890
- type WeirdGateRuleThreshold = {
891
- type: "THRESHOLD";
892
- data: [
893
- {
894
- currency_type: "CRYPTO";
895
- max?: string;
896
- min: string | null;
897
- }
898
- ];
899
- };
900
- type WeirdGateRuleWhitelist = {
901
- type: "WHITELIST";
902
- data: number[];
903
- };
904
- type WeirdGateGovernanceRule = WeirdGateRuleMultiAuth | WeirdGateRuleThreshold | GateRuleSCI | GateRuleTransactionFilter | WeirdGateRuleWhitelist;
905
- type WeirdGateGovernanceRulesSet = {
906
- name: string;
907
- rules: WeirdGateGovernanceRule[];
908
- };
909
- type GateLabel = {
910
- id: number;
911
- name: string;
912
- info: {
913
- color: string;
914
- description: string;
915
- };
916
- };
917
- type GateAccountCommon = {
918
- id: number;
919
- account_type: AccountType;
920
- entityType: "ACCOUNT";
921
- address?: string;
922
- contract_address: string;
923
- name: string;
924
- settings: AccountSettings;
925
- balance: any;
926
- available_balance: any;
927
- currency: string;
928
- parent_balance?: any;
929
- has_access_to_parent: boolean | null;
930
- created_on: string;
931
- governance_rules: GateGovernanceRulesSet[] | null;
932
- next_governance_rules: GateGovernanceRulesSet[] | null;
933
- fresh_addresses: any;
934
- nfts_gallery_enabled?: boolean;
935
- is_hsm_coin_app_updated: boolean;
936
- is_under_edit: boolean;
937
- index: number;
938
- status: AccountStatus;
939
- xpub: string;
940
- parent: number | null;
941
- derivation_path: string;
942
- labels: GateLabel[];
943
- extended_public_key: {
944
- public_key: string;
945
- chain_code: string;
946
- };
947
- derivation_mode: "STANDARD" | "NATIVE_SEGWIT";
948
- entity_id?: number;
949
- last_request?: GateAccountRequest;
950
- is_tradelink?: boolean;
951
- tradelink_data?: GateAccountTradelinkData;
952
- synced_on: string | null;
953
- last_sync_requested_at: string | null;
954
- policy?: GatePolicy;
955
- is_raw_signing_account?: boolean;
956
- };
957
- interface GateAccountExchangeOptions {
958
- auto_repledge_enabled: boolean;
959
- requires_pre_approval: boolean;
960
- }
961
- interface GateAccountTradelinkData {
962
- asset_manager: GateTradelinkAssetManager;
963
- custodian: GateTradelinkThirdParty<"CUSTODIAN">;
964
- exchanges: Array<GateTradelinkExchange & GateAccountExchangeOptions>;
965
- total_repledge: string;
966
- }
967
- interface GateAccountEthereum extends GateAccountCommon {
968
- account_type: "Ethereum";
969
- sci_config: GateSCIConfig | null;
970
- ethereum_data?: {
971
- staking?: {
972
- total_staking: string;
973
- total_rewards: string;
974
- available_rewards: string;
975
- network_apy: string;
976
- };
977
- };
978
- }
979
- interface GateTradelinkThirdParty<T extends "CUSTODIAN" | "ASSET_MANAGER" | "EXCHANGE"> {
980
- code: string;
981
- id: string;
982
- logo_url: string | null;
983
- name: string;
984
- role: T;
985
- }
986
- interface GateTradelinkRequest extends GateGenericRequest {
987
- tradelink: GateTradelink;
988
- type: "CREATE_TRADELINK" | "EDIT_TRADELINK";
989
- target_type: "TRADELINK";
990
- edit_data?: {
991
- operators: string[];
992
- };
993
- }
994
- interface GateTradelinkExchangeRequest extends GateGenericRequest {
995
- tradelink: GateTradelinkExchange;
996
- type: "CREATE_TRADELINK_EXCHANGE" | "EDIT_TRADELINK_EXCHANGE";
997
- target_type: "TRADELINK_EXCHANGE";
998
- tradelink_exchange: GateTradelinkExchange;
999
- edit_data?: {
1000
- operators: string[];
1001
- addresses: Array<Omit<GateAddress, "id">>;
1002
- };
1003
- }
1004
- interface GateTradelinkAssetManagerRequest extends GateGenericRequest {
1005
- tradelink: GateTradelinkAssetManager;
1006
- type: "CREATE_TRADELINK_ASSET_MANAGER" | "EDIT_TRADELINK_ASSET_MANAGER";
1007
- target_type: "TRADELINK_ASSET_MANAGER";
1008
- tradelink_asset_manager: GateTradelinkAssetManager;
1009
- edit_data?: {
1010
- operators: string[];
1011
- addresses: Array<Omit<GateAddress, "id">>;
1012
- };
1013
- }
1014
- type SPLToken = {
1015
- token_name: string;
1016
- associated_token_account: string;
1017
- account_name: string;
1018
- contract_address: string;
1019
- available: string;
1020
- pending: string;
1021
- status: "ACTIVE" | "INACTIVE" | "VIEW_ONLY";
1022
- ticker: string;
1023
- creation_transaction_hash: string;
1024
- parent_id: number;
1025
- };
1026
- interface GateAccountBitcoin extends GateAccountCommon {
1027
- account_type: "Bitcoin";
1028
- }
1029
- interface GateAccountERC20 extends GateAccountCommon {
1030
- account_type: "Erc20";
1031
- parent_available_balance: BigNumber;
1032
- }
1033
- interface GateAccountRipple extends GateAccountCommon {
1034
- account_type: "Ripple";
1035
- }
1036
- interface GateAccountStellar extends GateAccountCommon {
1037
- account_type: "Stellar";
1038
- }
1039
- interface GateAccountTezos extends GateAccountCommon {
1040
- account_type: "Tezos";
1041
- }
1042
- interface GateAccountSolana extends GateAccountCommon {
1043
- account_type: "Solana";
1044
- solana_data?: {
1045
- tokens?: SPLToken[];
1046
- can_create_spl_token_accounts: boolean;
1047
- };
1048
- }
1049
- interface GateAccountCardano extends GateAccountCommon {
1050
- account_type: "Cardano";
1051
- cardano_data: {
1052
- balances: CardanoBalances;
1053
- };
1054
- }
1055
- interface GateAccountTron extends GateAccountCommon {
1056
- account_type: "Tron";
1057
- }
1058
- interface GateAccountPolkadot extends GateAccountCommon {
1059
- account_type: "Polkadot";
1060
- polkadot_data: PolkadotAccountData;
1061
- }
1062
- type GateAccount = GateAccountEthereum | GateAccountBitcoin | GateAccountERC20 | GateAccountStellar | GateAccountTezos | GateAccountSolana | GateAccountPolkadot | GateAccountRipple | GateAccountCardano | GateAccountTron;
1063
- type GateVaultEntityStatus = "PENDING" | "ACTIVE" | "ABORTED" | "REVOKED" | "TO_MIGRATE";
1064
- type GateWorkspacePermission = "ROOT" | "CREATE_ACCOUNT_WITH_POLICY";
1065
- type GateWorkspaceRuleStep = {
1066
- quorum: number;
1067
- users: string[];
1068
- };
1069
- type GateWorkspaceRule = {
1070
- id: number;
1071
- permission: GateWorkspacePermission;
1072
- status: "ACTIVE";
1073
- steps: GateWorkspaceRuleStep[];
1074
- last_request: null;
1075
- };
1076
- type GateExchange = {
1077
- id: number;
1078
- entityType: "EXCHANGE";
1079
- created_by: GateUser;
1080
- created_on: string;
1081
- balances: {
1082
- available: string;
1083
- locked: string;
1084
- total: string;
1085
- };
1086
- governance_rules: GateGovernanceRulesSet[] | null;
1087
- last_request: GateExchangeRequest;
1088
- name: string;
1089
- platform: string;
1090
- status: "PENDING" | "ACTIVE" | "ABORTED";
1091
- };
1092
- type GatePolicy = {
1093
- id: number;
1094
- entityType: "POLICY";
1095
- created_by: GateUser;
1096
- created_on: string;
1097
- last_request: GatePolicyRequest;
1098
- name: string;
1099
- currency: string;
1100
- description: string | null;
1101
- governance_rules: GateGovernanceRulesSet[];
1102
- account_ids: GateAccount["id"][];
1103
- status: "PENDING" | "ACTIVE" | "ABORTED";
1104
- };
1105
- type GateTradelinkEntity<T extends "CUSTODIAN" | "ASSET_MANAGER" | "EXCHANGE"> = Omit<GateTradelinkThirdParty<T>, "role">;
1106
- type GateTradelinkNetwork = {
1107
- id: string;
1108
- asset_managers: GateTradelinkEntity<"ASSET_MANAGER">[];
1109
- custodian: GateTradelinkEntity<"CUSTODIAN">;
1110
- exchanges: GateTradelinkEntity<"EXCHANGE">[];
1111
- };
1112
- type GateTradelinkOnboardingStatus = {
1113
- status: "NOT_READY" | "READY_TO_ONBOARD" | "CUSTODIAN_ONBOARDED" | "EXCHANGE_ONBOARDED" | "HSM_READY";
1114
- };
1115
- type GateVaultEntity = {
1116
- id: number;
1117
- entityType: "VAULT_ENTITY";
1118
- name: string;
1119
- accounts: GateAccount[];
1120
- status: GateVaultEntityStatus;
1121
- created_on: string;
1122
- last_request?: GateVaultEntityRequest;
1123
- };
1124
- type WhitelistType = "TRANSACTION" | "SMART_CONTRACT";
1125
- type GateWhitelist = {
1126
- id: number;
1127
- name: string;
1128
- entityType: "WHITELIST";
1129
- description: string;
1130
- addresses: GateAddress[];
1131
- created_on: string;
1132
- created_by: GateUser;
1133
- approvals: Approval[];
1134
- status: "ACTIVE" | "PENDING" | "ABORTED" | "REVOKED" | "TO_MIGRATE";
1135
- last_request?: GateWhitelistRequest;
1136
- whitelist_type?: WhitelistType;
1137
- is_tradelink?: boolean;
1138
- };
1139
- type GateTransactionNote = {
1140
- title: string;
1141
- content: string;
1142
- };
1143
- type GateTransactionType = "SEND" | "RECEIVE" | "PREBURN" | "BURN" | "MINT" | "DELEGATE" | "UNDELEGATE" | "DELEGATE_VOTE_TO_DREP" | "STAKING_REGISTER" | "STAKING_DEREGISTER" | "STAKING_DELEGATE" | "STAKING_WITHDRAW" | "CREATE_SPL_TOKEN_ACCOUNT";
1144
- type CardanoVoteDelegationDrep = "ALWAYS ABSTAIN" | null;
1145
- type GateTransaction = {
1146
- id: number;
1147
- account_id: number;
1148
- recipient: string;
1149
- type: GateTransactionType;
1150
- created_on: string;
1151
- created_by: GateUser;
1152
- labels: GateLabel[];
1153
- tx_hash: string;
1154
- status: "ABORTED" | "APPROVED" | "CONFIRMED" | "DROPPED" | "FAILED" | "FAILED_TO_BROADCAST" | "PENDING_APPROVAL" | "PENDING_CREATE_IN_HSM" | "SIGNED" | "SUBMITTED";
1155
- amount: string;
1156
- max_fees?: string;
1157
- notes: GateTransactionNote[];
1158
- last_request?: GateTransactionRequest;
1159
- failure_reason?: string | null;
1160
- tx_parameters?: {
1161
- drep?: CardanoVoteDelegationDrep;
1162
- tradelink?: {
1163
- type: "SETTLEMENT";
1164
- settlement_id: string;
1165
- pledge_id: string;
1166
- };
1167
- token_address?: string;
1168
- };
1169
- };
1170
- type Approval = {
1171
- created_on: string;
1172
- created_by: GateUser;
1173
- type: "APPROVE" | "ABORT";
1174
- };
1175
- type GateAddress = {
1176
- id: number;
1177
- currency: string;
1178
- address: string;
1179
- name: string;
1180
- destination_tags?: number[] | null;
1181
- };
1182
- type GateGenericRequest = {
1183
- entityType: "REQUEST";
1184
- created_by: GateUser | null;
1185
- created_on: string;
1186
- id: number;
1187
- status: string;
1188
- type: string;
1189
- approvals?: RequestApproval[];
1190
- approvals_steps: Array<{
1191
- group: GateGroup;
1192
- quorum: number;
1193
- }>;
1194
- current_step: number;
1195
- target_id: number;
1196
- target_type: string;
1197
- quorum?: number;
1198
- organization?: Organization;
1199
- expired_at: Date;
1200
- edit_data?: any;
1201
- };
1202
- interface GateAccountRequest extends GateGenericRequest {
1203
- account: GateAccount;
1204
- target_type: "BITCOIN_ACCOUNT" | "ETHEREUM_ACCOUNT" | "RIPPLE_ACCOUNT" | "TEZOS_ACCOUNT" | "POLKADOT_ACCOUNT" | "ERC20_ACCOUNT" | "STELLAR_ACCOUNT" | "SOLANA_ACCOUNT" | "CARDANO_ACCOUNT" | "TRON_ACCOUNT";
1205
- type: "CREATE_ACCOUNT" | "EDIT_ACCOUNT" | "REVOKE_ACCOUNT" | "EDIT_TOKEN_RULE" | "MIGRATE_ACCOUNT";
1206
- request_data: Partial<{
1207
- currency: {
1208
- name: string;
1209
- };
1210
- derivation_mode: string;
1211
- entity_id: number | null;
1212
- governance_rules: GateGovernanceRulesSet[];
1213
- name: string;
1214
- }>;
1215
- }
1216
- interface GateSPLTokenAccountRequest extends GateGenericRequest {
1217
- account: GateAccount;
1218
- target_type: "SOLANA_ACCOUNT";
1219
- type: "EDIT_TOKEN_RULE";
1220
- target_id: number;
1221
- edit_data: {
1222
- governance_rules: GateGovernanceRulesSet[];
1223
- };
1224
- request_data: Partial<{
1225
- governance_rules: GateGovernanceRulesSet[];
1226
- }>;
1227
- contract_address: string;
1228
- }
1229
- interface GateActivateRequest extends GateGenericRequest {
1230
- target_type: GateAccountRequest["target_type"];
1231
- target_id: number;
1232
- target: GateAccount;
1233
- type: "ACTIVATE";
1234
- }
1235
- interface GateRepledgeRequest extends GateGenericRequest {
1236
- repledge: GateRepledge;
1237
- target_type: "REPLEDGE";
1238
- type: "CREATE_REPLEDGE";
1239
- }
1240
- interface GatePledgeIncrementRequest extends GateGenericRequest {
1241
- pledge_increment: GatePledgeIncrement;
1242
- target_type: "PLEDGE_INCREMENT";
1243
- type: "CREATE_PLEDGE_INCREMENT";
1244
- }
1245
- interface GateForcedUnpledgeRequest extends GateGenericRequest {
1246
- forced_unpledge: GateForcedUnpledge;
1247
- target_type: "FORCED_UNPLEDGE";
1248
- type: "CREATE_FORCED_UNPLEDGE";
1249
- }
1250
- interface GateUserRequest extends GateGenericRequest {
1251
- url_id: string;
1252
- user: GateUser;
1253
- target_type: "PERSON";
1254
- type: "REVOKE_USER" | "CREATE_ADMIN" | "CREATE_OPERATOR" | "CREATE_API_USER" | "CREATE_API_USER_ACCESS" | "MIGRATE_ADMIN" | "MIGRATE_OPERATOR";
1255
- }
1256
- interface GateAPIV2UserAccessRequest extends GateGenericRequest {
1257
- username: string;
1258
- user: GateUser;
1259
- api_key_id: string;
1260
- api_key_secret: string;
1261
- target_type: "PERSON";
1262
- type: "CREATE_API_USER" | "CREATE_API_USER_ACCESS";
1263
- }
1264
- interface GateSCIConfigRequest extends GateGenericRequest {
1265
- sciconfig: GateSCIConfig;
1266
- target_type: "SCI_CONFIG";
1267
- type: "CREATE_SCICONFIG" | "EDIT_SCICONFIG";
1268
- edit_data?: {
1269
- custom_contract_call_enabled: boolean;
1270
- dapps: string[];
1271
- };
1272
- request_data?: {
1273
- custom_contract_call_enabled: boolean;
1274
- dapps: string[];
1275
- };
1276
- }
1277
- interface GateMessageRequest extends GateGenericRequest {
1278
- target_type: "MESSAGE";
1279
- message: GateMessage;
1280
- type: "MESSAGE_SIGNING";
1281
- }
1282
- interface GateWhitelistRequest extends GateGenericRequest {
1283
- whitelist: GateWhitelist;
1284
- target_type: "WHITELIST";
1285
- type: "CREATE_WHITELIST" | "EDIT_WHITELIST" | "MIGRATE_WHITELIST";
1286
- edit_data?: {
1287
- name?: string;
1288
- addresses: GateAddress[];
1289
- };
1290
- }
1291
- interface GateExchangeRequest extends GateGenericRequest {
1292
- exchange: GateExchange;
1293
- target_type: "EXCHANGE";
1294
- type: "IMPORT_EXCHANGE" | "EDIT_EXCHANGE" | "EDIT_EXCHANGE_CREDENTIALS" | "REVOKE_EXCHANGE";
1295
- }
1296
- interface GateTransactionRequest extends GateGenericRequest {
1297
- transaction: GateTransaction;
1298
- target_type: "BITCOIN_LIKE_TRANSACTION" | "ETHEREUM_LIKE_TRANSACTION" | "RIPPLE_LIKE_TRANSACTION" | "POLKADOT_LIKE_TRANSACTION" | "TEZOS_LIKE_TRANSACTION" | "STELLAR_LIKE_TRANSACTION" | "CARDANO_LIKE_TRANSACTION";
1299
- type: "CREATE_TRANSACTION";
1300
- }
1301
- declare const GateGroupRequestTypeDefs: readonly ["CREATE_GROUP", "EDIT_GROUP", "REVOKE_GROUP", "MIGRATE_GROUP"];
1302
- interface GateGroupRequest extends GateGenericRequest {
1303
- group: GateGroup;
1304
- target_type: "GROUP";
1305
- type: (typeof GateGroupRequestTypeDefs)[number];
1306
- }
1307
- interface GateDigestsRequest extends GateGenericRequest {
1308
- digests: GateDigestGroup;
1309
- target_type: "DIGESTS";
1310
- type: "SIGN_DIGESTS";
1311
- }
1312
- interface GateOrganizationRequest extends GateGenericRequest {
1313
- organization: Organization;
1314
- target_type: "ORGANIZATION";
1315
- type: "UPDATE_QUORUM";
1316
- }
1317
- interface GateAPIKeyRequest extends GateGenericRequest {
1318
- api_key: GateAPIKey;
1319
- target_type: "VAULT_API_KEY";
1320
- type: "CREATE_API_KEY" | "EDIT_API_KEY" | "REVOKE_API_KEY";
1321
- }
1322
- interface GateTransferRequest extends GateGenericRequest {
1323
- transfer: GateTransfer;
1324
- target_type: "TRANSFER";
1325
- type: "CREATE_TRANSFER";
1326
- }
1327
- interface GateVaultEntityRequest extends GateGenericRequest {
1328
- vaultEntity: GateVaultEntity;
1329
- target_type: "ENTITY";
1330
- type: "CREATE_ENTITY" | "EDIT_ENTITY" | "REVOKE_ENTITY";
1331
- edit_data?: {
1332
- name: string;
1333
- accounts: number[];
1334
- };
1335
- }
1336
- interface GatePolicyRequest extends GateGenericRequest {
1337
- policy: GatePolicy;
1338
- target_type: "POLICY";
1339
- type: "CREATE_POLICY" | "EDIT_POLICY";
1340
- }
1341
- type Organization = {
1342
- name: string;
1343
- domain_name: string;
1344
- workspace: string;
1345
- number_of_admins: number;
1346
- quorum: number;
1347
- };
1348
- type RequestApproval = {
1349
- created_by: GateUser;
1350
- created_on: string;
1351
- type: string;
1352
- step: number;
1353
- };
1354
- type UserDevice = number | string;
1355
- type ManifestGroup = {
1356
- name: string;
1357
- users: UserDevice[];
1358
- description?: string;
1359
- status?: "PENDING" | "ACTIVE" | "ABORTED";
1360
- };
1361
- type ManifestAccountRuleMultiAuthStep = {
1362
- quorum: number;
1363
- users: UserDevice[];
1364
- } | {
1365
- quorum: number;
1366
- group: string;
1367
- };
1368
- type ManifestAccountRuleMultiAuth = {
1369
- type: "MULTI_AUTHORIZATIONS";
1370
- steps: ManifestAccountRuleMultiAuthStep[];
1371
- };
1372
- type ManifestAccountRuleSCI = {
1373
- type: "SMART_CONTRACT_INTERACTION";
1374
- enabled: boolean;
1375
- };
1376
- type ManifestAccountRuleTezosDelegation = {
1377
- type: "TEZOS_DELEGATION";
1378
- };
1379
- type ManifestAccountRulePolkadotStaking = {
1380
- type: "POLKADOT_STAKING";
1381
- };
1382
- type ManifestAccountRuleDeployContract = {
1383
- type: "DEPLOY_CONTRACT";
1384
- };
1385
- type ManifestAccountRuleSolanaStaking = {
1386
- type: "SOLANA_STAKING";
1387
- };
1388
- type ManifestAccountRuleCardanoStaking = {
1389
- type: "CARDANO_STAKING";
1390
- };
1391
- type ManifestAccountRuleRawSigning = {
1392
- type: "RAW_SIGNING";
1393
- };
1394
- type ManifestAccountRuleSend = {
1395
- type: "SEND";
1396
- };
1397
- type ManifestAccountRuleStake = {
1398
- type: "STAKE";
1399
- };
1400
- type ManifestAccountRuleMessageSigning = {
1401
- type: "MESSAGE_SIGNING";
1402
- };
1403
- type ManifestAccountRuleCreateSplTokenAccount = {
1404
- type: "CREATE_SPL_TOKEN_ACCOUNT";
1405
- };
1406
- type ManifestAccountRuleTransferSplToken = {
1407
- type: "TRANSFER_SPL_TOKEN";
1408
- contractAddress: string;
1409
- };
1410
- type ManifestAccountRuleWhitelist = {
1411
- type: "WHITELIST";
1412
- whitelists: string[];
1413
- };
1414
- type ManifestAccountRuleThreshold = {
1415
- type: "THRESHOLD";
1416
- min?: number;
1417
- max?: number;
1418
- };
1419
- type ManifestAccountRule = ManifestAccountRuleMultiAuth | ManifestAccountRuleWhitelist | ManifestAccountRuleSCI | ManifestAccountRuleDeployContract | ManifestAccountRuleThreshold | ManifestAccountRulePolkadotStaking | ManifestAccountRuleSolanaStaking | ManifestAccountRuleCardanoStaking | ManifestAccountRuleRawSigning | ManifestAccountRuleTezosDelegation | ManifestAccountRuleSend | ManifestAccountRuleMessageSigning | ManifestAccountRuleCreateSplTokenAccount | ManifestAccountRuleTransferSplToken | ManifestAccountRuleStake;
1420
- type ManifestAccountConfig = {
1421
- nftGallery?: boolean;
1422
- };
1423
- type ManifestTradelinkOrg = {
1424
- name: string;
1425
- };
1426
- type AccountTradelinkExchangeData = {
1427
- name: string;
1428
- requires_pre_approval: boolean;
1429
- auto_repledge_enabled: boolean;
1430
- };
1431
- type ManifestAccountTradelinkData = {
1432
- currency: string;
1433
- custodian: ManifestTradelinkOrg;
1434
- asset_manager: ManifestTradelinkOrg;
1435
- exchanges: AccountTradelinkExchangeData[];
1436
- };
1437
- type ManifestCryptoAccount = {
1438
- name: string;
1439
- currency: string;
1440
- accountType?: string;
1441
- derivationMode?: string;
1442
- rules?: Array<ManifestAccountRule[]>;
1443
- status?: "PENDING" | "ABORTED" | "ACTIVE";
1444
- index?: number;
1445
- readOnly?: {
1446
- xpub: string;
1447
- publicKey: string;
1448
- chainCode: string;
1449
- address?: string;
1450
- };
1451
- tradelink_data?: ManifestAccountTradelinkData;
1452
- config?: ManifestAccountConfig;
1453
- };
1454
- type ManifestERC20Account = {
1455
- name: string;
1456
- contractAddress: string;
1457
- parentAccount?: string;
1458
- rules?: Array<ManifestAccountRule[]>;
1459
- status?: "PENDING" | "ABORTED" | "ACTIVE";
1460
- index?: number;
1461
- tradelink_data?: ManifestAccountTradelinkData;
1462
- };
1463
- type ManifestAccount = ManifestCryptoAccount | ManifestERC20Account;
1464
- type ManifestVaultEntity = {
1465
- name: string;
1466
- accounts?: string[];
1467
- status?: "PENDING" | "ACTIVE" | "ABORTED";
1468
- };
1469
- type ManifestWhitelistAddress = {
1470
- currency: string;
1471
- name?: string;
1472
- address: string;
1473
- destination_tags?: number[] | null;
1474
- };
1475
- type ManifestWhitelist = {
1476
- name: string;
1477
- addresses: ManifestWhitelistAddress[];
1478
- description?: string;
1479
- status?: "PENDING" | "ABORTED";
1480
- type?: WhitelistType;
1481
- };
1482
- type ManifestUser = {
1483
- device: number;
1484
- };
1485
- type ManifestAPIUser = {
1486
- name: string;
1487
- viewAll?: boolean;
1488
- };
1489
- type ManifestAPIV2User = {
1490
- name: string;
1491
- role: string;
1492
- publicKey?: string;
1493
- viewAll?: boolean;
1494
- };
1495
- type ManifestExchange = {
1496
- name: string;
1497
- platform: string;
1498
- rules?: Array<ManifestAccountRule[]>;
1499
- status?: "PENDING" | "ACTIVE" | "ABORTED";
1500
- configuration: {
1501
- apiKey: string;
1502
- apiSecret: string;
1503
- };
1504
- };
1505
- type ManifestPolicy = {
1506
- name: string;
1507
- currency: string;
1508
- rules: Array<ManifestAccountRule[]>;
1509
- status?: "PENDING" | "ACTIVE" | "ABORTED";
1510
- };
1511
- type ManifestWorkspaceRuleStep = {
1512
- quorum: number;
1513
- users: string[];
1514
- };
1515
- type ManifestWorkspaceRule = {
1516
- permission: Exclude<GateWorkspacePermission, "ROOT">;
1517
- steps: ManifestWorkspaceRuleStep[];
1518
- };
1519
- interface ManifestCommon {
1520
- salt?: string;
1521
- quorum?: number;
1522
- customUsernames?: Record<string, string>;
1523
- groups?: ManifestGroup[];
1524
- accounts?: ManifestAccount[];
1525
- entities?: ManifestVaultEntity[];
1526
- whitelists?: ManifestWhitelist[];
1527
- exchanges?: ManifestExchange[];
1528
- policies?: ManifestPolicy[];
1529
- tradelink?: ManifestTradelink;
1530
- contractApprovals?: ManifestContractApproval[];
1531
- workspaceRules?: ManifestWorkspaceRule[];
1532
- }
1533
- type ManifestTradelink = {
1534
- onboarded: boolean;
1535
- exchanges: ManifestTradelinkEntityWithAddresses[];
1536
- assetManagers: ManifestTradelinkEntityWithAddresses[];
1537
- custodians: ManifestTradelinkEntity[];
1538
- };
1539
- type ManifestTradelinkEntity = {
1540
- id: string;
1541
- name: string;
1542
- logoUrl: string;
1543
- code: string;
1544
- users: {
1545
- operators?: number[];
1546
- apiV2?: string[];
1547
- };
1548
- };
1549
- type ManifestTradelinkEntityWithAddresses = {
1550
- id: string;
1551
- name: string;
1552
- logoUrl: string;
1553
- code: string;
1554
- users: {
1555
- operators?: number[];
1556
- apiV2: string[];
1557
- };
1558
- addresses: ManifestWhitelistAddress[];
1559
- };
1560
- type ManifestContractApproval = {
1561
- user: number;
1562
- contractNames: string[];
1563
- };
1564
- interface Manifest extends ManifestCommon {
1565
- users?: {
1566
- operators?: Array<number | ManifestUser>;
1567
- admins?: Array<number | ManifestUser>;
1568
- api?: Array<string | ManifestAPIUser>;
1569
- apiV2?: Array<ManifestAPIV2User>;
1570
- };
1571
- }
1572
- interface DeserializedManifest extends ManifestCommon {
1573
- users?: {
1574
- operators?: ManifestUser[];
1575
- admins?: ManifestUser[];
1576
- api?: ManifestAPIUser[];
1577
- apiV2?: ManifestAPIV2User[];
1578
- };
1579
- }
1580
- declare const feesLevels: readonly ["SLOW", "NORMAL", "FAST", "CUSTOM"];
1581
- type FeesLevel = (typeof feesLevels)[number];
1582
- type ManifestTransaction = {
1583
- account: string;
1584
- recipient: string;
1585
- amount: string | number;
1586
- utxosPickingStrategy?: UTXOsPickingStrategy;
1587
- contractPayload?: string;
1588
- transactionType?: GateTransactionType;
1589
- feesLevel?: FeesLevel;
1590
- gasPrice?: string;
1591
- gasLimit?: string;
1592
- title?: string;
1593
- comment?: string;
1594
- maxFees?: string;
1595
- baseFees?: string;
1596
- maxFeesBufferFactor?: string;
1597
- priorityFees?: string;
1598
- };
1599
- type OnboardingContext = {
1600
- pool: DevicesPool;
1601
- getState: () => Promise<any>;
1602
- getChallenge: () => Promise<any>;
1603
- next: (data?: any) => Promise<void>;
1604
- collectMasterSeedFragment: (challenge: any, deviceIndex: number) => Promise<void>;
1605
- validateSO: (challenge: any, deviceIndex: number) => Promise<void>;
1606
- registerAdmin: (data: any, deviceIndex: number) => Promise<void>;
1607
- registerSO: (data: any, deviceIndex: number) => Promise<void>;
1608
- registerWrappingKey: (challenge: any, deviceIndex: number) => Promise<void>;
1609
- };
1610
- type OnboardingStep = "WRAPPING_KEYS_REGISTRATION" | "ADMINS_REGISTRATION" | "QUORUM_SETTINGS" | "SHARED_OWNERS_REGISTRATION" | "ADMIN_APPROVALS" | "MASTER_SEED_GENERATION";
1611
- interface RecordLogger extends Logger {
1612
- logs: string[];
1613
- reset: () => void;
1614
- expect: (s: string) => void;
1615
- }
1616
- type RunnableOptions = {
1617
- logger?: Logger;
1618
- };
1619
- type MockNetworkResponse = [
1620
- string,
1621
- string,
1622
- number,
1623
- any?,
1624
- any?,
1625
- any?,
1626
- any?
1627
- ];
1628
- type LegacyERC20Token = {
1629
- blockchain_name: "foundation" | "ropsten" | "goerli";
1630
- contract_address: string;
1631
- decimals: number;
1632
- hsm_account_parameters: string;
1633
- hsm_signature: string;
1634
- name: string;
1635
- ticker: string;
1636
- };
1637
- type GateCoinCapabilities = {
1638
- signer: {
1639
- raw_signing_supported: boolean;
1640
- send_clear_signing_supported: boolean;
1641
- stake_clear_signing_supported: boolean;
1642
- };
1643
- wallet: {
1644
- balance_supported: boolean;
1645
- broadcast_supported: boolean;
1646
- crafting_supported: boolean;
1647
- tx_history_supported: boolean;
1648
- };
1649
- };
1650
- type GateTokenCurrency = {
1651
- contract_address: string;
1652
- family: "ethereum";
1653
- name: string;
1654
- parent_currency: "ethereum" | "ethereum_ropsten" | "ethereum_goerli" | "bsc";
1655
- ticker: string;
1656
- token_type: "erc20" | "stablecoin" | "bep20";
1657
- units: [Unit];
1658
- delisted?: boolean;
1659
- disable_countervalue?: boolean;
1660
- capabilities?: GateCoinCapabilities;
1661
- __legacy_hsm_account_parameters?: string;
1662
- __legacy_hsm_signature?: string;
1663
- };
1664
- type GateCurrency = {
1665
- name: string;
1666
- type: "CRYPTO";
1667
- family: string;
1668
- confirmations_needed: number;
1669
- units: Unit[];
1670
- capabilities?: GateCoinCapabilities;
1671
- };
1672
- type WeirdGateERC20Token = {
1673
- ticker: string;
1674
- address: string;
1675
- decimals: number;
1676
- hsm_signature: string;
1677
- hsm_account_parameters: string;
1678
- };
1679
- type WeirdGateTokenCurrency = {
1680
- type: "erc20" | "stablecoin";
1681
- address: string;
1682
- };
1683
- type DaemonAddress = {
1684
- address: string;
1685
- derivation_path: string;
1686
- };
1687
- type VaultEvent = Ev<"ACCOUNT_UPDATED", GateAccount> | Ev<"REQUEST_CREATED", GateRequest> | Ev<"REQUEST_ABORTED", GateRequest> | Ev<"REQUEST_APPROVAL", GateRequest> | Ev<"REQUEST_APPROVED", GateRequest> | Ev<"TRANSACTION_BROADCASTED", GateTransaction> | Ev<"TRANSACTION_RECEIVED", GateTransaction> | Ev<"TRANSACTION_FAILED", GateTransaction> | Ev<"USER_REGISTERED", GateUser> | Ev<"USER_SUSPENDED", GateUser>;
1688
- type Ev<T, P> = {
1689
- type: T;
1690
- payload: P;
1691
- };
1692
-
1693
- type UserWithDevice = {
1694
- deviceIndex: number;
1695
- user: GateUser;
1696
- };
1697
- type UserWithoutDevice = {
1698
- username: string;
1699
- user: GateUser;
1700
- };
1701
- type CurrencyOrToken = CryptoCurrency | TokenCurrency;
1702
- type Network = <T>(method: "POST" | "PUT" | "GET" | "DELETE", url: string, data?: any, requestOptions?: any) => Promise<T>;
1703
- type WipeOptions = {
1704
- gate: string;
1705
- lam?: string;
1706
- lamAPIKey?: string;
1707
- hsmCompartmentID: number;
1708
- hsmEndpoint: string;
1709
- hsmCert: Buffer;
1710
- hsmCertKey: Buffer;
1711
- monotonicCountersSize?: number;
1712
- fileSystemSize?: number;
1713
- };
1714
- interface BakeManifestOptions extends RunnableOptions {
1715
- noApproval?: boolean;
1716
- runner?: ManifestRunner;
1717
- untilStep?: OnboardingStep;
1718
- twoStepsRequest?: boolean;
1719
- waitForActive?: boolean;
1720
- revaultOnboarding?: {
1721
- compartmentId: number;
1722
- hsmScriptsVersion: string;
1723
- revaultApiUrl: string;
1724
- revaultRootAuthToken: string;
1725
- };
1726
- }
1727
- type MRAction<P, R> = (params: P) => Promise<R>;
1728
- type MRCreateUserParams = {
1729
- role: "admin" | "operator";
1730
- userID: string;
1731
- name: string;
1732
- device: number;
1733
- };
1734
- type MRCreateAPIUserParams = {
1735
- user: ManifestAPIUser;
1736
- userID: string;
1737
- name: string;
1738
- };
1739
- type MRCreateAPIV2UserParams = {
1740
- user: ManifestAPIV2User;
1741
- publicKey: string;
1742
- role: string;
1743
- name: string;
1744
- };
1745
- type MRBakeGroupParams = {
1746
- group: ManifestGroup;
1747
- data: DataGroup;
1748
- existingRequest: GateGroupRequest | null;
1749
- noApproval: boolean;
1750
- twoStepsRequest?: boolean;
1751
- };
1752
- type MRBakeAccountParams = {
1753
- account: ManifestAccount;
1754
- data: DataAccount;
1755
- existingRequest: GateAccountRequest | null;
1756
- noApproval: boolean;
1757
- twoStepsRequest?: boolean;
1758
- waitForActive?: boolean;
1759
- tradelinkAM?: ManifestAPIV2User;
1760
- };
1761
- type MRBakeVaultEntityParams = {
1762
- vaultEntity: ManifestVaultEntity;
1763
- data: DataVaultEntity;
1764
- existingRequest: GateVaultEntityRequest | null;
1765
- noApproval: boolean;
1766
- };
1767
- type MRBakeWhitelistParams = {
1768
- whitelist: ManifestWhitelist;
1769
- data: DataWhitelist;
1770
- existingRequest: GateWhitelistRequest | null;
1771
- noApproval: boolean;
1772
- twoStepsRequest?: boolean;
1773
- };
1774
- type MRBakeExchangeParams = {
1775
- exchange: ManifestExchange;
1776
- data: DataExchange;
1777
- existingRequest: GateExchangeRequest | null;
1778
- noApproval: boolean;
1779
- twoStepsRequest?: boolean;
1780
- };
1781
- type MRBakePolicyParams = {
1782
- policy: ManifestPolicy;
1783
- data: DataPolicy;
1784
- existingRequest: GatePolicyRequest | null;
1785
- noApproval: boolean;
1786
- twoStepsRequest?: boolean;
1787
- };
1788
- type MRBakeTradelinkOnboardingParams = {
1789
- type: "CREATE_TRADELINK";
1790
- operators: string[];
1791
- };
1792
- type MREditQuorumParams = {
1793
- quorum: number;
1794
- };
1795
- type MREditWorkspaceRuleParams = {
1796
- rule: ManifestWorkspaceRule;
1797
- usersByName: Record<string, GateUser>;
1798
- };
1799
- type MBRBakeTradelinkEntityWithAddresses = {
1800
- operators: string[];
1801
- addresses: ManifestWhitelistAddress[];
1802
- name: string;
1803
- };
1804
- type MRBakeTradelinkEntityParams = {
1805
- tradelinkEntity: ManifestTradelinkEntity | ManifestTradelinkEntityWithAddresses;
1806
- type: "asset_managers" | "exchanges" | "custodians";
1807
- };
1808
- type MRBakeTradelinkEntityOnboardingParams = {
1809
- tradelinkEntity: MBRBakeTradelinkEntityWithAddresses;
1810
- type: "asset_managers" | "exchanges";
1811
- tradelinkEntityApprover: ManifestAPIV2User;
1812
- };
1813
- type MRBakeTradelinkNetworkParams = {
1814
- custodians: DataTradelinkNetworkEntity<"CUSTODIAN">[];
1815
- exchanges: DataTradelinkNetworkEntity<"EXCHANGE">[];
1816
- assetManagers: DataTradelinkNetworkEntity<"ASSET_MANAGER">[];
1817
- };
1818
- type DataTradelinkNetworkEntity<T extends "CUSTODIAN" | "EXCHANGE" | "ASSET_MANAGER"> = Pick<GateTradelinkThirdParty<T>, "id" | "name">;
1819
- type ManifestRunner = {
1820
- editQuorum: (params: MREditQuorumParams) => Promise<void>;
1821
- editWorkspaceRule: (params: MREditWorkspaceRuleParams) => Promise<void>;
1822
- createUser: MRAction<MRCreateUserParams, GateUserRequest>;
1823
- createAPIUser: (params: MRCreateAPIUserParams, r: RecipeManifestResult) => Promise<GateUserRequest>;
1824
- createAPIV2User: MRAction<MRCreateAPIV2UserParams, GateUserRequest>;
1825
- createAPIV2UserAccess: MRAction<MRCreateAPIV2UserParams, GateAPIV2UserAccessRequest>;
1826
- createGroup: MRAction<MRBakeGroupParams, GateGroupRequest>;
1827
- editGroup: MRAction<MRBakeGroupParams, GateGroupRequest>;
1828
- createAccount: MRAction<MRBakeAccountParams, GateAccountRequest>;
1829
- editAccount: MRAction<MRBakeAccountParams, GateAccountRequest>;
1830
- createVaultEntity: MRAction<MRBakeVaultEntityParams, GateVaultEntityRequest>;
1831
- editVaultEntity: MRAction<MRBakeVaultEntityParams, GateVaultEntityRequest>;
1832
- createWhitelist: MRAction<MRBakeWhitelistParams, GateWhitelistRequest>;
1833
- editWhitelist: MRAction<MRBakeWhitelistParams, GateWhitelistRequest>;
1834
- createExchange: MRAction<MRBakeExchangeParams, GateExchangeRequest>;
1835
- editExchange: MRAction<MRBakeExchangeParams, GateExchangeRequest>;
1836
- createPolicy: MRAction<MRBakePolicyParams, GatePolicyRequest>;
1837
- createTradelink: MRAction<MRBakeTradelinkOnboardingParams, GateTradelinkRequest>;
1838
- createTradelinkEntity: <T extends "ASSET_MANAGER" | "EXCHANGE" | "CUSTODIAN">(params: MRBakeTradelinkEntityParams) => Promise<GateTradelinkEntity<T>>;
1839
- onboardTradelinkEntity: MRAction<MRBakeTradelinkEntityOnboardingParams, GateTradelinkExchangeRequest | GateTradelinkAssetManagerRequest>;
1840
- createTradelinkNetwork: MRAction<MRBakeTradelinkNetworkParams, GateTradelinkNetwork>;
1841
- };
1842
- type HsmCertificate = {
1843
- attestation_pub: string;
1844
- certificate: string;
1845
- code_hash: string;
1846
- signature: string;
1847
- };
1848
- type SecureChannel = {
1849
- request_id: string;
1850
- handshake: string;
1851
- ciphertext: string;
1852
- challenge: string;
1853
- u2f_register_data: string;
1854
- handshake_attestation?: HsmCertificate;
1855
- };
1856
- type DeploymentStepID = "checkConnectivity" | "createNamespace" | "installNamespace" | "setupFeatureFlagsProvider" | "waitPods" | "success";
1857
- type DeploymentStep = {
1858
- key: DeploymentStepID;
1859
- labelWaiting: string;
1860
- labelCurrent: string;
1861
- labelSuccess: string;
1862
- };
1863
- type MVInstanceDeploymentFF = {
1864
- key: string;
1865
- set: boolean;
1866
- };
1867
- type MVInstanceDeployment = {
1868
- id: string;
1869
- startedOn: Date;
1870
- finishedOn: Date | null;
1871
- status: "BUSY" | "SUCCESS" | "ERROR";
1872
- steps: DeploymentStep[];
1873
- currentStep: DeploymentStepID;
1874
- instance: MVInstance;
1875
- flags: Array<MVInstanceDeploymentFF>;
1876
- error: Error | null;
1877
- spawnFailTimeout?: ReturnType<typeof setTimeout>;
1878
- };
1879
- type MVPod = {
1880
- name: string;
1881
- podName: string;
1882
- status: "BUSY" | "HEALTHY" | "ERROR" | "EVICTED";
1883
- };
1884
- type MVInstance = {
1885
- name: string;
1886
- status: string;
1887
- host: string;
1888
- pods: MVPod[];
1889
- };
1890
- type InteractionResponses = {
1891
- network: Network;
1892
- transport: any;
1893
- secure_channel: any;
1894
- pairing_payload: any;
1895
- blob: any;
1896
- confidentiality_key: any;
1897
- attestation: any;
1898
- u2f_key: any;
1899
- onboardingRegisterChallenge: any;
1900
- role: any;
1901
- username: any;
1902
- register_data: any;
1903
- validation_key: any;
1904
- u2f_register: any;
1905
- validate_device: any;
1906
- attested_handshake: any;
1907
- };
1908
- type Interaction<T> = {
1909
- responseKey: string;
1910
- action: (responses: InteractionResponses) => Promise<T>;
1911
- device?: boolean;
1912
- };
1913
- type GetU2FPubKeyInteraction = Interaction<{
1914
- pubKey: string;
1915
- signature: Buffer;
1916
- }>;
1917
- type Interactions = {
1918
- approveFlow: Interaction<any>[];
1919
- approveFlowWithoutHSM: Interaction<any>[];
1920
- doStartKpatternAsResponder: Interaction<any>;
1921
- validateDevice: Interaction<any>;
1922
- validatePayload: Interaction<any>;
1923
- postApproval: Interaction<any>;
1924
- postSimpleApproval: Interaction<any>;
1925
- ensurePartitionPairing: Interaction<any>;
1926
- finalizePairing: Interaction<any>;
1927
- getAttestation: Interaction<{
1928
- attestation: Buffer;
1929
- }>;
1930
- getConfidentialityPublicKey: Interaction<any>;
1931
- getSecureChannel: Interaction<any>;
1932
- getU2FChallenge: Interaction<any>;
1933
- getU2FPublicKey: GetU2FPubKeyInteraction;
1934
- getValidationPublicKey: Interaction<any>;
1935
- initPairing: Interaction<any>;
1936
- loginFlow: Interaction<any>[];
1937
- operatorGetChallenge: Interaction<any>;
1938
- postU2FSignature: Interaction<any>;
1939
- postUserRegistration: Interaction<any>;
1940
- readOnlyLoginFlow: (userName: string) => Interaction<any>[];
1941
- registerUserFlow: Interaction<any>[];
1942
- u2fAuthenticate: Interaction<any>;
1943
- validateOperation: Interaction<any>[];
1944
- };
1945
- type APIBearerTokenResponse = {
1946
- access_token: string;
1947
- expires_in: number;
1948
- refresh_token: string;
1949
- session_state: string;
1950
- token_type: string;
1951
- };
1952
- type APIGetChallengeResponse = {
1953
- challenge: string;
1954
- id: number;
1955
- };
1956
- type APIRequestResponse = {
1957
- id: number;
1958
- status: "PENDING_APPROVAL" | "APPROVED" | "SUBMITTED" | "ABORTED";
1959
- };
1960
- type APICreateTransactionRequest = {
1961
- data: APIBitcoinLikeSend | APIEthereumLikeSend;
1962
- note?: {
1963
- content: string;
1964
- title: string;
1965
- };
1966
- type: "CREATE_TRANSACTION";
1967
- };
1968
- type APIGenericSend = {
1969
- account_id: number;
1970
- fees_strategy: GenericFeesStrategy;
1971
- transaction_data: {
1972
- account_name: string;
1973
- amount: string;
1974
- max_fees: string;
1975
- recipient: string;
1976
- };
1977
- };
1978
- type APIBitcoinLikeSend = APIGenericSend & {
1979
- transaction_data: {
1980
- currency: "bitcoin" | "bitcoin_testnet";
1981
- };
1982
- transaction_type: "BITCOIN_LIKE_SEND";
1983
- };
1984
- type APIEthereumLikeSend = APIGenericSend & {
1985
- transaction_data: {
1986
- currency: "ethereum" | "ethereum_sepolia" | "polygon" | "ethereum_holesky";
1987
- contract_address?: string;
1988
- };
1989
- transaction_type: "ETHEREUM_LIKE_SEND";
1990
- };
1991
- type GenericFeesStrategy = {
1992
- type: "SPEED";
1993
- data: {
1994
- speed: "FAST" | "NORMAL" | "SLOW";
1995
- };
1996
- };
1997
- type APIEstimateFeesResponse = {
1998
- max_fees: string;
1999
- };
2000
- type PsdModel = "BLUE" | "STAX";
2001
-
2002
- export { type TradelinkNetwork as $, type APIBearerTokenResponse as A, type BakeManifestOptions as B, type CliOptions as C, type DevicesPool as D, type EntityType as E, type UserContextRunnable as F, type GateAccount as G, type HelmValue as H, type Interactions as I, type HelmValues as J, type ConnectionEdge as K, type LamOptions as L, type Manifest as M, type Network as N, type Connection as O, type PoolOptions as P, type GateEditWorkspaceRuleRequest as Q, type RunnableOptions as R, type GateRequest as S, type TransportType as T, type UserContext as U, type GateRequestType as V, type WipeOptions as W, type GateEntity as X, type GatePledgeIncrement as Y, type GateRepledge as Z, type GateForcedUnpledge as _, type ManifestAccount as a, type GateGenericRequest as a$, type GateTradelink as a0, type GateTradelinkExchange as a1, type GateTradelinkAssetManager as a2, type GateDeviceType as a3, type GateUser as a4, type GateAPIKey as a5, type GateTransfer as a6, type GateSCIConfig as a7, type GateMessage as a8, type AdminDevice as a9, type GateTradelinkThirdParty as aA, type GateTradelinkRequest as aB, type GateTradelinkExchangeRequest as aC, type GateTradelinkAssetManagerRequest as aD, type SPLToken as aE, type GateAccountBitcoin as aF, type GateAccountERC20 as aG, type GateAccountRipple as aH, type GateAccountStellar as aI, type GateAccountTezos as aJ, type GateAccountSolana as aK, type GateAccountCardano as aL, type GateAccountTron as aM, type GateAccountPolkadot as aN, type GateVaultEntityStatus as aO, type GateWorkspacePermission as aP, type GateWorkspaceRuleStep as aQ, type GateWorkspaceRule as aR, type GateExchange as aS, type GatePolicy as aT, type GateTradelinkEntity as aU, type GateTradelinkNetwork as aV, type GateTradelinkOnboardingStatus as aW, type GateVaultEntity as aX, type GateTransactionType as aY, type CardanoVoteDelegationDrep as aZ, type GateAddress as a_, type GateGroup as aa, type GateDigestGroup as ab, type GateFees as ac, type GateFeesEIP1559 as ad, type AccountType as ae, type AccountStatus as af, type Unit as ag, type GateRuleMultiAuthStep as ah, type GateRuleMultiAuth as ai, type GateRuleThreshold as aj, type GateRuleWhitelist as ak, type GateRuleSCI as al, type GateRuleTransactionFilter as am, type GateGovernanceRule as an, type GateGovernanceRulesSet as ao, type WeirdGateRuleMultiAuthStep as ap, type WeirdGateRuleMultiAuth as aq, type WeirdGateRuleThreshold as ar, type WeirdGateRuleWhitelist as as, type WeirdGateGovernanceRule as at, type WeirdGateGovernanceRulesSet as au, type GateLabel as av, type GateAccountCommon as aw, type GateAccountExchangeOptions as ax, type GateAccountTradelinkData as ay, type GateAccountEthereum as az, type ManifestAPIV2User as b, type GateCoinCapabilities as b$, type GateAccountRequest as b0, type GateSPLTokenAccountRequest as b1, type GateActivateRequest as b2, type GateRepledgeRequest as b3, type GatePledgeIncrementRequest as b4, type GateForcedUnpledgeRequest as b5, type GateUserRequest as b6, type GateAPIV2UserAccessRequest as b7, type GateSCIConfigRequest as b8, type GateMessageRequest as b9, type ManifestAccountRuleTransferSplToken as bA, type ManifestAccountRuleWhitelist as bB, type ManifestAccountRuleThreshold as bC, type ManifestAccountRule as bD, type ManifestAccountConfig as bE, type ManifestAccountTradelinkData as bF, type ManifestVaultEntity as bG, type ManifestWhitelistAddress as bH, type ManifestWhitelist as bI, type ManifestUser as bJ, type ManifestAPIUser as bK, type ManifestExchange as bL, type ManifestPolicy as bM, type ManifestWorkspaceRuleStep as bN, type ManifestWorkspaceRule as bO, type ManifestTradelink as bP, type ManifestTradelinkEntity as bQ, type ManifestTradelinkEntityWithAddresses as bR, type ManifestContractApproval as bS, type DeserializedManifest as bT, feesLevels as bU, type FeesLevel as bV, type OnboardingContext as bW, type OnboardingStep as bX, type RecordLogger as bY, type MockNetworkResponse as bZ, type LegacyERC20Token as b_, type GateWhitelistRequest as ba, type GateExchangeRequest as bb, type GateTransactionRequest as bc, GateGroupRequestTypeDefs as bd, type GateGroupRequest as be, type GateDigestsRequest as bf, type GateOrganizationRequest as bg, type GateAPIKeyRequest as bh, type GateTransferRequest as bi, type GateVaultEntityRequest as bj, type GatePolicyRequest as bk, type Organization as bl, type UserDevice as bm, type ManifestAccountRuleMultiAuthStep as bn, type ManifestAccountRuleMultiAuth as bo, type ManifestAccountRuleSCI as bp, type ManifestAccountRuleTezosDelegation as bq, type ManifestAccountRulePolkadotStaking as br, type ManifestAccountRuleDeployContract as bs, type ManifestAccountRuleSolanaStaking as bt, type ManifestAccountRuleCardanoStaking as bu, type ManifestAccountRuleRawSigning as bv, type ManifestAccountRuleSend as bw, type ManifestAccountRuleStake as bx, type ManifestAccountRuleMessageSigning as by, type ManifestAccountRuleCreateSplTokenAccount as bz, type APIRequestResponse as c, type GateCurrency as c0, type WeirdGateERC20Token as c1, type WeirdGateTokenCurrency as c2, type DaemonAddress as c3, type VaultEvent as c4, type UserWithDevice as c5, type UserWithoutDevice as c6, type CurrencyOrToken as c7, type MRCreateUserParams as c8, type MRCreateAPIUserParams as c9, type APICreateTransactionRequest as cA, type APIGenericSend as cB, type APIBitcoinLikeSend as cC, type APIEthereumLikeSend as cD, type APIEstimateFeesResponse as cE, getDeviceIndex as cF, type GateGroupsByName as cG, type GateWhitelistsByName as cH, type GateAccountsByName as cI, type GateVaultEntitiesByName as cJ, type GateExchangesByName as cK, type GatePoliciesByName as cL, type GateTradelinkCustodianByName as cM, type GateTradelinkHSMCustodianByName as cN, type GateTradelinkExchangeByName as cO, type GateTradelinkHSMExchangeByName as cP, type GateTradelinkHSMAssetManagerByName as cQ, type GateTradelinkAssetManagerByName as cR, type RecipeRawData as cS, type RecipeManifestResult as cT, type RecipeManifestOptions as cU, type MRCreateAPIV2UserParams as ca, type MRBakeGroupParams as cb, type MRBakeAccountParams as cc, type MRBakeVaultEntityParams as cd, type MRBakeWhitelistParams as ce, type MRBakeExchangeParams as cf, type MRBakePolicyParams as cg, type MRBakeTradelinkOnboardingParams as ch, type MREditQuorumParams as ci, type MREditWorkspaceRuleParams as cj, type MBRBakeTradelinkEntityWithAddresses as ck, type MRBakeTradelinkEntityParams as cl, type MRBakeTradelinkEntityOnboardingParams as cm, type MRBakeTradelinkNetworkParams as cn, type DataTradelinkNetworkEntity as co, type ManifestRunner as cp, type HsmCertificate as cq, type SecureChannel as cr, type DeploymentStepID as cs, type DeploymentStep as ct, type MVInstanceDeploymentFF as cu, type MVInstanceDeployment as cv, type MVPod as cw, type InteractionResponses as cx, type GetU2FPubKeyInteraction as cy, type APIGetChallengeResponse as cz, type DeployOptions as d, type DestroyOptions as e, type PsdModel as f, type APIDevice as g, type Device as h, type GateTokenCurrency as i, type MVInstance as j, type ManifestTransaction as k, type ManifestGroup as l, type GateWhitelist as m, type UTXOsPickingStrategy as n, type GateTransaction as o, type UpgradeOptions as p, type Interaction as q, prepareRequest as r, performRequest as s, recipeManifest as t, type RawUser as u, type RawGroup as v, type RawAccount as w, type RawWhiteList as x, type RawEntity as y, type DevicesPoolOptions as z };