@ledgerhq/revault-api 1.35.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{app-types-DVWgnjvj.d.mts → app-types-BiULyctM.d.mts} +2210 -1141
- package/lib/fakes.d.mts +169 -26
- package/lib/fakes.mjs +209 -96
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +3497 -727
- package/package.json +3 -3
package/lib/fakes.mjs
CHANGED
|
@@ -14,7 +14,12 @@ var __export = (target, all) => {
|
|
|
14
14
|
var zHexString = z.string().regex(/^[0-9a-fA-F]+$/);
|
|
15
15
|
var zIntString = z.string().nonempty().regex(/^(-?[1-9]\d*|0)$/);
|
|
16
16
|
var zUnsignedIntString = z.string().nonempty().regex(/^([1-9]\d*|0)$/);
|
|
17
|
-
var
|
|
17
|
+
var zCurrencyString = z.string().nonempty().max(40).regex(/^\w+$/).describe("Will be deprecated soon, use network instead. Currency");
|
|
18
|
+
var zNetwork = z.string().nonempty().max(40).regex(/^\w+$/).describe("Network (Same as currency for now)");
|
|
19
|
+
var zCurrency = z.object({
|
|
20
|
+
network: zNetwork,
|
|
21
|
+
contractAddress: z.string().nonempty().nullable().describe("Token contract address")
|
|
22
|
+
});
|
|
18
23
|
var zHsmObjectId = z.string().regex(/^[\w-]+$/).min(1);
|
|
19
24
|
|
|
20
25
|
// src/types/operation.ts
|
|
@@ -27,7 +32,7 @@ var zValueTransactionOperationType = z.enum([
|
|
|
27
32
|
]);
|
|
28
33
|
var zValueTransactionOperation = z.object({
|
|
29
34
|
type: zValueTransactionOperationType,
|
|
30
|
-
currency:
|
|
35
|
+
currency: zCurrencyString,
|
|
31
36
|
recipient: z.string().nonempty(),
|
|
32
37
|
destinationTag: z.string().nonempty().optional(),
|
|
33
38
|
value: zUnsignedIntString
|
|
@@ -233,7 +238,8 @@ var zSolanaLikeTransactionType = z7.enum([
|
|
|
233
238
|
"SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE",
|
|
234
239
|
"SOLANA_LIKE_MERGE_STAKE",
|
|
235
240
|
"SOLANA_LIKE_SEND_TOKEN",
|
|
236
|
-
"
|
|
241
|
+
"SOLANA_LIKE_FUND_AND_SEND_TOKEN",
|
|
242
|
+
"SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT"
|
|
237
243
|
]).describe("Solana-like transaction type");
|
|
238
244
|
var zStellarLikeTransactionType = z7.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).describe("Stellar-like transaction type");
|
|
239
245
|
var zTezosLikeTransactionType = z7.enum([
|
|
@@ -244,7 +250,8 @@ var zTezosLikeTransactionType = z7.enum([
|
|
|
244
250
|
"TEZOS_LIKE_UNDELEGATE"
|
|
245
251
|
]).describe("Tezos-like transaction type");
|
|
246
252
|
var zGenericTransactionType = z7.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
|
|
247
|
-
var zSuiLikeTransactionType = z7.enum(["SUI_LIKE_SEND", "SUI_LIKE_RECEIVE", "
|
|
253
|
+
var zSuiLikeTransactionType = z7.enum(["SUI_LIKE_SEND", "SUI_LIKE_RECEIVE", "SUI_LIKE_SEND_TOKEN", "SUI_LIKE_RECEIVE_TOKEN"]).describe("Sui-like transaction type");
|
|
254
|
+
var zTronLikeTransactionType = z7.enum(["TRON_LIKE_SEND", "TRON_LIKE_RECEIVE", "TRON_LIKE_SEND_TOKEN", "TRON_LIKE_RECEIVE_TOKEN"]).describe("Tron-like transaction type");
|
|
248
255
|
z7.union([
|
|
249
256
|
zBitcoinLikeTransactionType,
|
|
250
257
|
zCardanoLikeTransactionType,
|
|
@@ -256,7 +263,8 @@ z7.union([
|
|
|
256
263
|
zSolanaLikeTransactionType,
|
|
257
264
|
zStellarLikeTransactionType,
|
|
258
265
|
zSuiLikeTransactionType,
|
|
259
|
-
zTezosLikeTransactionType
|
|
266
|
+
zTezosLikeTransactionType,
|
|
267
|
+
zTronLikeTransactionType
|
|
260
268
|
]);
|
|
261
269
|
z7.discriminatedUnion("type", [
|
|
262
270
|
z7.object({
|
|
@@ -265,7 +273,23 @@ z7.discriminatedUnion("type", [
|
|
|
265
273
|
gasLimit: zIntString,
|
|
266
274
|
nonce: z7.string(),
|
|
267
275
|
priorityFees: zIntString
|
|
268
|
-
})
|
|
276
|
+
}).describe("Ethereum-like fees"),
|
|
277
|
+
z7.object({
|
|
278
|
+
type: z7.literal("RIPPLE_LIKE"),
|
|
279
|
+
fee: zIntString
|
|
280
|
+
}).describe("Ripple-like fees"),
|
|
281
|
+
z7.object({
|
|
282
|
+
type: z7.literal("STELLAR_LIKE"),
|
|
283
|
+
fee: zIntString
|
|
284
|
+
}).describe("Stellar-like fees"),
|
|
285
|
+
z7.object({
|
|
286
|
+
type: z7.literal("SUI_LIKE"),
|
|
287
|
+
fee: zIntString
|
|
288
|
+
}).describe("Sui-like fees"),
|
|
289
|
+
z7.object({
|
|
290
|
+
type: z7.literal("TRON_LIKE"),
|
|
291
|
+
fee: zIntString
|
|
292
|
+
}).describe("Tron-like fees")
|
|
269
293
|
]);
|
|
270
294
|
var zMessageType = z7.enum(["EIP191", "EIP712"]);
|
|
271
295
|
var zMessage = z7.object({
|
|
@@ -280,8 +304,10 @@ if ("openapi" in zHexDataString) {
|
|
|
280
304
|
}
|
|
281
305
|
var zCommonTransactionData = z7.object({
|
|
282
306
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
283
|
-
currency:
|
|
284
|
-
|
|
307
|
+
currency: zCurrencyString.describe(
|
|
308
|
+
"Will be deprecated soon, use Account.network. Transaction currency"
|
|
309
|
+
),
|
|
310
|
+
// TODO: to remove, use account.network instead
|
|
285
311
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
286
312
|
recipient: z7.string().nonempty().describe("Transaction recipient")
|
|
287
313
|
});
|
|
@@ -325,6 +351,11 @@ var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
|
325
351
|
type: z7.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
326
352
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
327
353
|
}).describe("Ethereum-like send data");
|
|
354
|
+
var zEthereumLikeTransactionData = z7.discriminatedUnion("type", [
|
|
355
|
+
zEthereumLikeDeployContractData,
|
|
356
|
+
zEthereumLikeExecuteContractData,
|
|
357
|
+
zEthereumLikeSendData
|
|
358
|
+
]);
|
|
328
359
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
329
360
|
gasLimit: zUnsignedIntString.describe("Gas limit"),
|
|
330
361
|
storageLimit: zUnsignedIntString.nullable().describe("Storage limit")
|
|
@@ -336,7 +367,7 @@ var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
|
336
367
|
var zTezosLikeDelegateData = z7.object({
|
|
337
368
|
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
338
369
|
amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
|
|
339
|
-
currency:
|
|
370
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
340
371
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
341
372
|
recipient: z7.string().nonempty().describe("Transaction recipient"),
|
|
342
373
|
feeStrategy: zTezosLikeFeeStrategy
|
|
@@ -344,49 +375,54 @@ var zTezosLikeDelegateData = z7.object({
|
|
|
344
375
|
var zTezosLikeUndelegateData = z7.object({
|
|
345
376
|
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
346
377
|
amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
|
|
347
|
-
currency:
|
|
378
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
348
379
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
349
380
|
recipient: z7.string().nonempty().optional().describe("Deprecated: DO NOT USE!"),
|
|
350
381
|
feeStrategy: zTezosLikeFeeStrategy
|
|
351
382
|
}).describe("Tezos-like undelegate data");
|
|
383
|
+
var zTezosLikeTransactionData = z7.discriminatedUnion("type", [
|
|
384
|
+
zTezosLikeSendData,
|
|
385
|
+
zTezosLikeDelegateData,
|
|
386
|
+
zTezosLikeUndelegateData
|
|
387
|
+
]);
|
|
352
388
|
var zPolkadotRewardDestination = z7.enum(["Staked", "Stash"]);
|
|
353
389
|
var zPolkadotLikeAddProxyData = z7.object({
|
|
354
390
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
355
|
-
currency:
|
|
391
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
356
392
|
kind: z7.literal("Staking").describe("Proxy kind"),
|
|
357
393
|
proxy: z7.string().describe("Proxy address")
|
|
358
394
|
}).describe("Polkadot-like add proxy data");
|
|
359
395
|
var zPolkadotLikeAnonymousProxyData = z7.object({
|
|
360
396
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
361
|
-
currency:
|
|
397
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
362
398
|
}).describe("Polkadot-like anonymous proxy data");
|
|
363
399
|
var zPolkadotLikeBondData = z7.object({
|
|
364
400
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
365
|
-
currency:
|
|
401
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
366
402
|
payee: zPolkadotRewardDestination,
|
|
367
403
|
amount: zUnsignedIntString.describe("Amount")
|
|
368
404
|
}).describe("Polkadot-like bond data");
|
|
369
405
|
var zPolkadotLikeBondExtraData = z7.object({
|
|
370
406
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
371
|
-
currency:
|
|
407
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
372
408
|
amount: zUnsignedIntString.describe("Amount")
|
|
373
409
|
}).describe("Polkadot-like bond extra data");
|
|
374
410
|
var zPolkadotLikeChillData = z7.object({
|
|
375
411
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
376
|
-
currency:
|
|
412
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
377
413
|
}).describe("Polkadot-like chill data");
|
|
378
414
|
var zPolkadotLikeKillAnonymousData = z7.object({
|
|
379
415
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
380
|
-
currency:
|
|
416
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
381
417
|
}).describe("Polkadot-like kill anonymous data");
|
|
382
418
|
var zPolkadotLikeRebondData = z7.object({
|
|
383
419
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
384
|
-
currency:
|
|
420
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
385
421
|
amount: zUnsignedIntString.describe("Amount")
|
|
386
422
|
}).describe("Polkadot-like rebond data");
|
|
387
423
|
var zPolkadotLikeRemoveProxyData = z7.object({
|
|
388
424
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
389
|
-
currency:
|
|
425
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
390
426
|
kind: z7.literal("Staking"),
|
|
391
427
|
proxy: z7.string().describe("Proxy address")
|
|
392
428
|
}).describe("Polkadot-like remove proxy data");
|
|
@@ -395,18 +431,32 @@ var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
|
395
431
|
}).describe("Polkadot-like send data");
|
|
396
432
|
var zPolkadotLikeSetPayeeData = z7.object({
|
|
397
433
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
398
|
-
currency:
|
|
434
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
399
435
|
payee: zPolkadotRewardDestination
|
|
400
436
|
}).describe("Polkadot-like set payee data");
|
|
401
437
|
var zPolkadotLikeUnbondData = z7.object({
|
|
402
438
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
403
|
-
currency:
|
|
439
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
404
440
|
amount: zUnsignedIntString.describe("Amount")
|
|
405
441
|
}).describe("Polkadot-like unbond data");
|
|
406
442
|
var zPolkadotLikeWithdrawUnbondedData = z7.object({
|
|
407
443
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
408
|
-
currency:
|
|
444
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
409
445
|
}).describe("Polkadot-like withdraw unbonded data");
|
|
446
|
+
var zPolkadotLikeTransactionData = z7.discriminatedUnion("type", [
|
|
447
|
+
zPolkadotLikeAddProxyData,
|
|
448
|
+
zPolkadotLikeAnonymousProxyData,
|
|
449
|
+
zPolkadotLikeBondData,
|
|
450
|
+
zPolkadotLikeBondExtraData,
|
|
451
|
+
zPolkadotLikeChillData,
|
|
452
|
+
zPolkadotLikeKillAnonymousData,
|
|
453
|
+
zPolkadotLikeRebondData,
|
|
454
|
+
zPolkadotLikeRemoveProxyData,
|
|
455
|
+
zPolkadotLikeSendData,
|
|
456
|
+
zPolkadotLikeSetPayeeData,
|
|
457
|
+
zPolkadotLikeUnbondData,
|
|
458
|
+
zPolkadotLikeWithdrawUnbondedData
|
|
459
|
+
]);
|
|
410
460
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
411
461
|
type: z7.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
412
462
|
destinationTag: zIntString.nullable().describe("Destination tag"),
|
|
@@ -437,7 +487,7 @@ var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
|
437
487
|
}).describe("Solana-like create delegate stake data");
|
|
438
488
|
var zSolanaLikeDeactivateStakeData = z7.object({
|
|
439
489
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
440
|
-
currency:
|
|
490
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
441
491
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
442
492
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
443
493
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -445,7 +495,7 @@ var zSolanaLikeDeactivateStakeData = z7.object({
|
|
|
445
495
|
}).describe("Solana-like deactivate stake data");
|
|
446
496
|
var zSolanaLikeDelegateStakeData = z7.object({
|
|
447
497
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
448
|
-
currency:
|
|
498
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
449
499
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
450
500
|
recipient: z7.string().describe("Delegated vote address"),
|
|
451
501
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
@@ -454,7 +504,7 @@ var zSolanaLikeDelegateStakeData = z7.object({
|
|
|
454
504
|
}).describe("Solana-like delegate stake data");
|
|
455
505
|
var zSolanaLikeMergeStakeData = z7.object({
|
|
456
506
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
457
|
-
currency:
|
|
507
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
458
508
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
459
509
|
mergeSrcAccount: z7.string().describe("Source stake address"),
|
|
460
510
|
mergeDstAccount: z7.string().describe("Destination stake address"),
|
|
@@ -468,7 +518,7 @@ var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
|
468
518
|
var zSolanaLikeSplitDeactivateStakeData = z7.object({
|
|
469
519
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
470
520
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
471
|
-
currency:
|
|
521
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
472
522
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
473
523
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
474
524
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -477,7 +527,7 @@ var zSolanaLikeSplitDeactivateStakeData = z7.object({
|
|
|
477
527
|
var zSolanaLikeSplitStakeData = z7.object({
|
|
478
528
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
479
529
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
480
|
-
currency:
|
|
530
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
481
531
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
482
532
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
483
533
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -486,7 +536,7 @@ var zSolanaLikeSplitStakeData = z7.object({
|
|
|
486
536
|
var zSolanaLikeWithdrawStakeData = z7.object({
|
|
487
537
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
488
538
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
489
|
-
currency:
|
|
539
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
490
540
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
491
541
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
492
542
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -496,17 +546,35 @@ var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
|
496
546
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
497
547
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
498
548
|
}).describe("Solana-like send token data");
|
|
499
|
-
var
|
|
500
|
-
type: z7.literal(zSolanaLikeTransactionType.enum.
|
|
549
|
+
var zSolanaLikeFundAndSendTokenData = zCommonTransactionData.extend({
|
|
550
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_AND_SEND_TOKEN),
|
|
551
|
+
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
552
|
+
}).describe("Solana-like fund token account and send token data");
|
|
553
|
+
var zSolanaLikeCreateTokenAccountData = z7.object({
|
|
554
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT),
|
|
555
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
501
556
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
502
|
-
}).describe("Solana-like
|
|
557
|
+
}).describe("Solana-like create token account");
|
|
558
|
+
var zSolanaLikeTransactionData = z7.discriminatedUnion("type", [
|
|
559
|
+
zSolanaLikeCreateDelegateStakeData,
|
|
560
|
+
zSolanaLikeDeactivateStakeData,
|
|
561
|
+
zSolanaLikeDelegateStakeData,
|
|
562
|
+
zSolanaLikeMergeStakeData,
|
|
563
|
+
zSolanaLikeSendData,
|
|
564
|
+
zSolanaLikeSplitDeactivateStakeData,
|
|
565
|
+
zSolanaLikeSplitStakeData,
|
|
566
|
+
zSolanaLikeWithdrawStakeData,
|
|
567
|
+
zSolanaLikeSendTokenData,
|
|
568
|
+
zSolanaLikeFundAndSendTokenData,
|
|
569
|
+
zSolanaLikeCreateTokenAccountData
|
|
570
|
+
]);
|
|
503
571
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
504
572
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
505
573
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
|
|
506
574
|
}).describe("Cardano-like send data");
|
|
507
575
|
var zCardanoStakingDelegateData = z7.object({
|
|
508
576
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
509
|
-
currency:
|
|
577
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
510
578
|
// TODO: strict literal or enum?
|
|
511
579
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
512
580
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -515,7 +583,7 @@ var zCardanoStakingDelegateData = z7.object({
|
|
|
515
583
|
}).describe("Cardano-like staking delegate");
|
|
516
584
|
var zCardanoStakingDeregisterData = z7.object({
|
|
517
585
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
518
|
-
currency:
|
|
586
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
519
587
|
// TODO: strict literal or enum?
|
|
520
588
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
521
589
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -524,7 +592,7 @@ var zCardanoStakingDeregisterData = z7.object({
|
|
|
524
592
|
}).describe("Cardano-like staking deregister data");
|
|
525
593
|
var zCardanoStakingRegisterData = z7.object({
|
|
526
594
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
527
|
-
currency:
|
|
595
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
528
596
|
// TODO: strict literal or enum?
|
|
529
597
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
530
598
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -533,76 +601,72 @@ var zCardanoStakingRegisterData = z7.object({
|
|
|
533
601
|
}).describe("Cardano-like staking register data");
|
|
534
602
|
var zCardanoStakingWithdrawData = z7.object({
|
|
535
603
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
536
|
-
currency:
|
|
604
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
537
605
|
// TODO: strict literal or enum?
|
|
538
606
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
539
607
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
540
608
|
// WITHDRAW doesn't have a recipient
|
|
541
609
|
amount: zUnsignedIntString.describe("Amount to withdraw")
|
|
542
610
|
}).describe("Cardano-like staking withdraw data");
|
|
611
|
+
var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
|
|
612
|
+
zCardanoSendData,
|
|
613
|
+
zCardanoStakingDelegateData,
|
|
614
|
+
zCardanoStakingDeregisterData,
|
|
615
|
+
zCardanoStakingRegisterData,
|
|
616
|
+
zCardanoStakingWithdrawData
|
|
617
|
+
]);
|
|
543
618
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
544
619
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
545
620
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
546
621
|
}).describe("Sui-like send data");
|
|
547
622
|
var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
548
|
-
type: z7.literal(zSuiLikeTransactionType.enum.
|
|
623
|
+
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
549
624
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
550
625
|
}).describe("Sui-like transfer token data");
|
|
626
|
+
var zSuiLikeTransactionData = z7.discriminatedUnion("type", [
|
|
627
|
+
zSuiLikeSendData,
|
|
628
|
+
zSuiLikeTransferTokenData
|
|
629
|
+
]);
|
|
551
630
|
var zGenericTransactionData = z7.object({
|
|
552
631
|
type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
553
|
-
currency:
|
|
632
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
554
633
|
rawTx: z7.string().describe("Raw tx")
|
|
555
634
|
}).describe("Generic transaction data");
|
|
635
|
+
var zTronLikeSendData = zCommonTransactionData.extend({
|
|
636
|
+
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
|
|
637
|
+
feeStrategy: zFeeStrategy.describe("Tron-like fee strategy")
|
|
638
|
+
}).describe("Tron-like send data");
|
|
639
|
+
var zTronLikeSendTokenData = zCommonTransactionData.extend({
|
|
640
|
+
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
|
|
641
|
+
feeStrategy: zFeeStrategy.describe("Tron-like fee strategy")
|
|
642
|
+
}).describe("Tron-like send token data");
|
|
643
|
+
var zTronLikeTransactionData = z7.discriminatedUnion("type", [
|
|
644
|
+
zTronLikeSendData,
|
|
645
|
+
zTronLikeSendTokenData
|
|
646
|
+
]);
|
|
556
647
|
var zTransactionData = z7.discriminatedUnion("type", [
|
|
557
648
|
// Bitcoin
|
|
558
649
|
zBitcoinLikeSendData,
|
|
559
650
|
// Cardano
|
|
560
|
-
|
|
561
|
-
zCardanoStakingDelegateData,
|
|
562
|
-
zCardanoStakingDeregisterData,
|
|
563
|
-
zCardanoStakingRegisterData,
|
|
564
|
-
zCardanoStakingWithdrawData,
|
|
651
|
+
...zCardanoLikeTransactionData.options,
|
|
565
652
|
// Ethereum
|
|
566
|
-
|
|
567
|
-
zEthereumLikeExecuteContractData,
|
|
568
|
-
zEthereumLikeSendData,
|
|
653
|
+
...zEthereumLikeTransactionData.options,
|
|
569
654
|
// Generic
|
|
570
655
|
zGenericTransactionData,
|
|
571
656
|
// Polkadot
|
|
572
|
-
|
|
573
|
-
zPolkadotLikeAnonymousProxyData,
|
|
574
|
-
zPolkadotLikeBondData,
|
|
575
|
-
zPolkadotLikeBondExtraData,
|
|
576
|
-
zPolkadotLikeChillData,
|
|
577
|
-
zPolkadotLikeKillAnonymousData,
|
|
578
|
-
zPolkadotLikeRebondData,
|
|
579
|
-
zPolkadotLikeRemoveProxyData,
|
|
580
|
-
zPolkadotLikeSendData,
|
|
581
|
-
zPolkadotLikeSetPayeeData,
|
|
582
|
-
zPolkadotLikeUnbondData,
|
|
583
|
-
zPolkadotLikeWithdrawUnbondedData,
|
|
657
|
+
...zPolkadotLikeTransactionData.options,
|
|
584
658
|
// Ripple
|
|
585
659
|
zRippleLikeSendData,
|
|
586
660
|
// Solana
|
|
587
|
-
|
|
588
|
-
zSolanaLikeDeactivateStakeData,
|
|
589
|
-
zSolanaLikeDelegateStakeData,
|
|
590
|
-
zSolanaLikeMergeStakeData,
|
|
591
|
-
zSolanaLikeSendData,
|
|
592
|
-
zSolanaLikeSplitDeactivateStakeData,
|
|
593
|
-
zSolanaLikeSplitStakeData,
|
|
594
|
-
zSolanaLikeWithdrawStakeData,
|
|
595
|
-
zSolanaLikeSendTokenData,
|
|
596
|
-
zSolanaLikeFundTokenData,
|
|
661
|
+
...zSolanaLikeTransactionData.options,
|
|
597
662
|
// Stellar
|
|
598
663
|
zStellarLikeSendData,
|
|
599
664
|
// Sui
|
|
600
|
-
|
|
601
|
-
zSuiLikeTransferTokenData,
|
|
665
|
+
...zSuiLikeTransactionData.options,
|
|
602
666
|
// Tezos
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
667
|
+
...zTezosLikeTransactionData.options,
|
|
668
|
+
// Tron
|
|
669
|
+
...zTronLikeTransactionData.options
|
|
606
670
|
]);
|
|
607
671
|
var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
|
|
608
672
|
zBitcoinLikeSendData,
|
|
@@ -682,6 +746,9 @@ var zSolanaLikeCoinFields = z7.object({
|
|
|
682
746
|
var zStellarLikeCoinFields = z7.object({
|
|
683
747
|
type: zStellarLikeTransactionType
|
|
684
748
|
});
|
|
749
|
+
var zSuiLikeCoinFields = z7.object({
|
|
750
|
+
type: zSuiLikeTransactionType
|
|
751
|
+
});
|
|
685
752
|
var zTezosLikeCoinFields = z7.object({
|
|
686
753
|
type: zTezosLikeTransactionType
|
|
687
754
|
});
|
|
@@ -709,6 +776,7 @@ var zRippleLikeTransactionResponse = zCommonTransactionResponse.merge(zRippleLik
|
|
|
709
776
|
var zSolanaLikeTransactionResponse = zCommonTransactionResponse.merge(zSolanaLikeCoinFields).describe("Solana-like transaction");
|
|
710
777
|
var zStellarLikeTransactionResponse = zCommonTransactionResponse.merge(zStellarLikeCoinFields).describe("Stellar-like transaction");
|
|
711
778
|
var zTezosLikeTransactionResponse = zCommonTransactionResponse.merge(zTezosLikeCoinFields).describe("Tezos-like transaction");
|
|
779
|
+
var zSuiLikeTransactionResponse = zCommonTransactionResponse.merge(zSuiLikeCoinFields).describe("Sui-like transaction");
|
|
712
780
|
var zTransactionResponse = z7.discriminatedUnion("type", [
|
|
713
781
|
zBitcoinLikeTransactionResponse,
|
|
714
782
|
zCardanoLikeTransactionResponse,
|
|
@@ -719,6 +787,7 @@ var zTransactionResponse = z7.discriminatedUnion("type", [
|
|
|
719
787
|
zRippleLikeTransactionResponse,
|
|
720
788
|
zSolanaLikeTransactionResponse,
|
|
721
789
|
zStellarLikeTransactionResponse,
|
|
790
|
+
zSuiLikeTransactionResponse,
|
|
722
791
|
zTezosLikeTransactionResponse
|
|
723
792
|
]);
|
|
724
793
|
z7.discriminatedUnion(
|
|
@@ -742,7 +811,9 @@ var zEthereumLikeAssetFields = z.object({
|
|
|
742
811
|
var zEthereumTokenLikeAssetFields = z.object({
|
|
743
812
|
type: z.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE, AccountType.TRC20_LIKE]).describe("Account type"),
|
|
744
813
|
address: z.string().describe("Account address").nullable(),
|
|
745
|
-
contractAddress: z.string().describe(
|
|
814
|
+
contractAddress: z.string().describe(
|
|
815
|
+
"Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
|
|
816
|
+
).optional()
|
|
746
817
|
}).describe("Ethereum-like token");
|
|
747
818
|
var zGenericLikeAssetFields = z.object({ type: z.literal(AccountType.GENERIC_LIKE).describe("Account type") }).describe("Generic-like");
|
|
748
819
|
var zRawSigningAssetFields = z.object({ type: z.literal(AccountType.RAW_SIGNING).describe("Account type") }).describe("Raw signing account");
|
|
@@ -752,12 +823,14 @@ var zPolkadotLikeAssetFields = z.object({
|
|
|
752
823
|
}).describe("Polkadot-like");
|
|
753
824
|
var zRippleLikeAssetFields = z.object({
|
|
754
825
|
type: z.literal(AccountType.RIPPLE_LIKE).describe("Account type"),
|
|
755
|
-
|
|
826
|
+
address: z.string().describe("Account address").nullable()
|
|
756
827
|
}).describe("Ripple-like");
|
|
757
828
|
var zSolanaLikeAssetFields = z.object({
|
|
758
829
|
type: z.literal(AccountType.SOLANA_LIKE).describe("Account type"),
|
|
759
830
|
address: z.string().describe("Account address").nullable(),
|
|
760
|
-
contractAddress: z.string().describe(
|
|
831
|
+
contractAddress: z.string().describe(
|
|
832
|
+
"Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
|
|
833
|
+
).nullable().optional()
|
|
761
834
|
}).describe("Solana-like");
|
|
762
835
|
var zStellarLikeAssetFields = z.object({
|
|
763
836
|
type: z.literal(AccountType.STELLAR_LIKE).describe("Account type"),
|
|
@@ -771,6 +844,10 @@ var zTezosLikeAssetFields = z.object({
|
|
|
771
844
|
type: z.literal(AccountType.TEZOS_LIKE).describe("Account type"),
|
|
772
845
|
address: z.string().describe("Account address").nullable()
|
|
773
846
|
}).describe("Tezos-like");
|
|
847
|
+
var zTronLikeAssetFields = z.object({
|
|
848
|
+
type: z.literal(AccountType.TRON_LIKE).describe("Account type"),
|
|
849
|
+
address: z.string().describe("Account address").nullable()
|
|
850
|
+
}).describe("Tron-like");
|
|
774
851
|
var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
775
852
|
zBitcoinLikeAssetFields,
|
|
776
853
|
zCardanoLikeAssetFields,
|
|
@@ -783,7 +860,8 @@ var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
|
783
860
|
zSolanaLikeAssetFields,
|
|
784
861
|
zStellarLikeAssetFields,
|
|
785
862
|
zTezosLikeAssetFields,
|
|
786
|
-
zSuiLikeAssetFields
|
|
863
|
+
zSuiLikeAssetFields,
|
|
864
|
+
zTronLikeAssetFields
|
|
787
865
|
]).describe("Account asset fields");
|
|
788
866
|
var zReviewStepWithUsers = z.object({
|
|
789
867
|
quorum: z.number().min(0).describe("Number of required approvals for the step"),
|
|
@@ -851,7 +929,7 @@ var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
|
851
929
|
// src/tradelink/types.ts
|
|
852
930
|
var zTradelinkWhitelistAddress = z7.object({
|
|
853
931
|
name: z7.string().min(1),
|
|
854
|
-
currency:
|
|
932
|
+
currency: zCurrencyString,
|
|
855
933
|
address: z7.string().min(1)
|
|
856
934
|
});
|
|
857
935
|
z7.array(zTradelinkWhitelistAddress);
|
|
@@ -1124,7 +1202,9 @@ var zAccountCommonFields = z7.object({
|
|
|
1124
1202
|
id: z7.string().describe("Internal unique identifier"),
|
|
1125
1203
|
legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1126
1204
|
name: z7.string().describe("Name"),
|
|
1127
|
-
currency:
|
|
1205
|
+
currency: zCurrencyString,
|
|
1206
|
+
network: zNetwork,
|
|
1207
|
+
contractAddress: z7.string().describe("Token contract address for Token account").nullable(),
|
|
1128
1208
|
index: z7.number().gte(0).describe("BIP44 account index"),
|
|
1129
1209
|
derivationPath: z7.string().describe("Derivation path"),
|
|
1130
1210
|
status: z7.nativeEnum(ActivationStatus).describe("Status"),
|
|
@@ -1156,7 +1236,7 @@ var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
|
1156
1236
|
var zCardanoLikeLiveData = zCommonLiveData.merge(zCardanoLikeStakingFields).describe("Cardano-like");
|
|
1157
1237
|
var zEthereumLikeLiveData = zCommonLiveData.merge(zEthereumLikeStakingFields).describe("Ethereum-like");
|
|
1158
1238
|
var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
|
|
1159
|
-
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE
|
|
1239
|
+
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).describe("Account type")
|
|
1160
1240
|
}).describe("Ethereum-like token");
|
|
1161
1241
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
1162
1242
|
type: z7.literal(AccountType.GENERIC_LIKE).describe("Account type")
|
|
@@ -1176,6 +1256,9 @@ var zSuiLikeLiveData = zCommonLiveData.extend({
|
|
|
1176
1256
|
type: z7.literal(AccountType.SUI_LIKE).describe("Account type")
|
|
1177
1257
|
}).describe("Sui-like");
|
|
1178
1258
|
var zTezosLikeLiveData = zCommonLiveData.merge(zTezosLikeStakingFields).describe("Tezos-like");
|
|
1259
|
+
var zTronLikeLiveData = zCommonLiveData.extend({
|
|
1260
|
+
type: z7.enum([AccountType.TRON_LIKE, AccountType.TRC20_LIKE]).describe("Account type")
|
|
1261
|
+
}).describe("Tron-like");
|
|
1179
1262
|
z7.discriminatedUnion("type", [
|
|
1180
1263
|
zBitcoinLikeLiveData,
|
|
1181
1264
|
zCardanoLikeLiveData,
|
|
@@ -1188,12 +1271,17 @@ z7.discriminatedUnion("type", [
|
|
|
1188
1271
|
zSolanaLikeLiveData,
|
|
1189
1272
|
zStellarLikeLiveData,
|
|
1190
1273
|
zSuiLikeLiveData,
|
|
1191
|
-
zTezosLikeLiveData
|
|
1274
|
+
zTezosLikeLiveData,
|
|
1275
|
+
zTronLikeLiveData
|
|
1192
1276
|
]);
|
|
1193
1277
|
z7.object({
|
|
1194
1278
|
address: z7.string().describe("Address"),
|
|
1195
1279
|
derivationPath: z7.string().nullable().describe("Derivation path")
|
|
1196
1280
|
});
|
|
1281
|
+
z7.object({
|
|
1282
|
+
amount: zIntString.describe("Amount in the smallest unit of the currency"),
|
|
1283
|
+
currency: zCurrency
|
|
1284
|
+
});
|
|
1197
1285
|
|
|
1198
1286
|
// src/accounts/app-types.ts
|
|
1199
1287
|
z7.discriminatedUnion(
|
|
@@ -1208,7 +1296,7 @@ z7.discriminatedUnion(
|
|
|
1208
1296
|
);
|
|
1209
1297
|
var zWhitelistAddress = z7.object({
|
|
1210
1298
|
name: z7.string().min(1).max(50),
|
|
1211
|
-
currency:
|
|
1299
|
+
currency: zCurrencyString,
|
|
1212
1300
|
address: z7.string().min(1).max(200),
|
|
1213
1301
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1214
1302
|
// Empty array (or undefined) means no check on destination tag.
|
|
@@ -1258,8 +1346,6 @@ var zEditPublicPolicyRequestData = z7.object({
|
|
|
1258
1346
|
description: z7.string().nullable().describe("Description"),
|
|
1259
1347
|
govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
|
|
1260
1348
|
});
|
|
1261
|
-
|
|
1262
|
-
// src/accounts/request-data.ts
|
|
1263
1349
|
var zAccountName = z7.string().min(1).max(40).describe("Account name");
|
|
1264
1350
|
var zSignDigestsGovRuleData = z7.object({
|
|
1265
1351
|
operationType: z7.literal("SIGN_DIGESTS"),
|
|
@@ -1274,20 +1360,20 @@ var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1274
1360
|
z7.object({
|
|
1275
1361
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1276
1362
|
policy: zAccountPolicyRequestData
|
|
1277
|
-
}),
|
|
1363
|
+
}).describe("Classic governance"),
|
|
1278
1364
|
z7.object({
|
|
1279
1365
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1280
1366
|
assetManagerId: z7.string(),
|
|
1281
1367
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1282
|
-
}),
|
|
1368
|
+
}).describe("Tradelink governance"),
|
|
1283
1369
|
z7.object({
|
|
1284
1370
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1285
1371
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1286
|
-
})
|
|
1287
|
-
]);
|
|
1372
|
+
}).describe("Raw signing governance")
|
|
1373
|
+
]).describe("Governance fields");
|
|
1288
1374
|
var zCreateAccountUserInputData = z7.object({
|
|
1289
1375
|
name: zAccountName,
|
|
1290
|
-
currency:
|
|
1376
|
+
currency: zCurrencyString,
|
|
1291
1377
|
// "bitcoin"
|
|
1292
1378
|
index: z7.number().nonnegative().optional().describe("Account index"),
|
|
1293
1379
|
contractAddress: z7.string().min(1).optional().describe("Account contract address"),
|
|
@@ -1303,16 +1389,16 @@ var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1303
1389
|
z7.object({
|
|
1304
1390
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1305
1391
|
policy: zAccountPolicyRequestData
|
|
1306
|
-
}),
|
|
1392
|
+
}).describe("Classic governance"),
|
|
1307
1393
|
z7.object({
|
|
1308
1394
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1309
1395
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1310
|
-
}),
|
|
1396
|
+
}).describe("Tradelink governance"),
|
|
1311
1397
|
z7.object({
|
|
1312
1398
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1313
1399
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1314
|
-
})
|
|
1315
|
-
]);
|
|
1400
|
+
}).describe("Raw signing governance")
|
|
1401
|
+
]).describe("Governance fields");
|
|
1316
1402
|
var zEditAccountRequestData = z7.object({
|
|
1317
1403
|
name: zAccountName,
|
|
1318
1404
|
governance: zEditAccountGovernanceData
|
|
@@ -1374,13 +1460,18 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1374
1460
|
case AccountType.RIPPLE_LIKE:
|
|
1375
1461
|
return {
|
|
1376
1462
|
type: account.type,
|
|
1377
|
-
|
|
1463
|
+
address: account.address
|
|
1378
1464
|
};
|
|
1379
1465
|
case AccountType.POLKADOT_LIKE:
|
|
1380
1466
|
return {
|
|
1381
1467
|
type: account.type,
|
|
1382
1468
|
address: account.address
|
|
1383
1469
|
};
|
|
1470
|
+
case AccountType.TRON_LIKE:
|
|
1471
|
+
return {
|
|
1472
|
+
type: account.type,
|
|
1473
|
+
address: account.address
|
|
1474
|
+
};
|
|
1384
1475
|
case AccountType.GENERIC_LIKE:
|
|
1385
1476
|
case AccountType.RAW_SIGNING:
|
|
1386
1477
|
return {
|
|
@@ -1417,6 +1508,7 @@ var serializeAccount = (account) => {
|
|
|
1417
1508
|
const governance = getAccountGovernanceFields(account);
|
|
1418
1509
|
const response = {
|
|
1419
1510
|
...account,
|
|
1511
|
+
network: account.currency,
|
|
1420
1512
|
legacyId: account.gateId,
|
|
1421
1513
|
governance,
|
|
1422
1514
|
asset
|
|
@@ -1491,6 +1583,7 @@ var zCreateApiUserAccessRequestData = z7.object({
|
|
|
1491
1583
|
z7.object({
|
|
1492
1584
|
authUserId: z7.string().describe("Authentication broker ID")
|
|
1493
1585
|
}).describe("Managed data for API user");
|
|
1586
|
+
var zRevokeUserRequestData = z7.object({});
|
|
1494
1587
|
var zGroupName = z7.string().min(1).max(19).describe("Group name");
|
|
1495
1588
|
var zCreateGroupRequestData = z7.object({
|
|
1496
1589
|
name: zGroupName,
|
|
@@ -1581,7 +1674,8 @@ var zVaultRequestMixinsByType = {
|
|
|
1581
1674
|
}),
|
|
1582
1675
|
[RequestType.REVOKE_GROUP]: z7.object({
|
|
1583
1676
|
type: z7.literal(RequestType.REVOKE_GROUP),
|
|
1584
|
-
|
|
1677
|
+
targetId: z7.string(),
|
|
1678
|
+
data: zRevokeUserRequestData
|
|
1585
1679
|
}),
|
|
1586
1680
|
// Whitelists
|
|
1587
1681
|
[RequestType.CREATE_WHITELIST]: z7.object({
|
|
@@ -1621,7 +1715,8 @@ var zVaultRequestMixinsByType = {
|
|
|
1621
1715
|
}),
|
|
1622
1716
|
[RequestType.REVOKE_USER]: z7.object({
|
|
1623
1717
|
type: z7.literal(RequestType.REVOKE_USER),
|
|
1624
|
-
|
|
1718
|
+
targetId: z7.string(),
|
|
1719
|
+
data: zRevokeUserRequestData
|
|
1625
1720
|
}),
|
|
1626
1721
|
// Admin gov rules
|
|
1627
1722
|
[RequestType.CREATE_WORKSPACE_RULE]: z7.object({
|
|
@@ -1753,7 +1848,7 @@ var zVaultRequestCommonMixin = z7.object({
|
|
|
1753
1848
|
createdById: z7.string().describe("ID of the user who created the request"),
|
|
1754
1849
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
1755
1850
|
inflight: z7.object({
|
|
1756
|
-
lastError: z7.string().describe("Error message from the last failure"),
|
|
1851
|
+
lastError: z7.string().nullable().describe("Error message from the last failure"),
|
|
1757
1852
|
numFailed: z7.number().int().describe("Number of failures so far"),
|
|
1758
1853
|
retryAfter: z7.coerce.date().describe("Date after which next retry is scheduled")
|
|
1759
1854
|
}).optional().describe("Extra information if the request is currently being processed")
|
|
@@ -1790,7 +1885,8 @@ var allowedRequestCreationInputByType = {
|
|
|
1790
1885
|
[RequestType.FORCE_UNPLEDGE]: zVaultRequestMixinsByType[RequestType.FORCE_UNPLEDGE],
|
|
1791
1886
|
[RequestType.CREATE_SETTLEMENT]: zVaultRequestMixinsByType[RequestType.CREATE_SETTLEMENT],
|
|
1792
1887
|
[RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
|
|
1793
|
-
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE]
|
|
1888
|
+
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE],
|
|
1889
|
+
[RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER]
|
|
1794
1890
|
};
|
|
1795
1891
|
var zRequestCreationInputCommonMixin = z7.object({
|
|
1796
1892
|
note: zNote.optional().describe("Optional request note")
|
|
@@ -1806,6 +1902,11 @@ z7.object({
|
|
|
1806
1902
|
)
|
|
1807
1903
|
)
|
|
1808
1904
|
});
|
|
1905
|
+
var generateNetworkSpecificTransactionRequestSchema = (transaction) => z7.object({
|
|
1906
|
+
accountId: z7.string().min(1).describe("Target account id"),
|
|
1907
|
+
transaction
|
|
1908
|
+
}).merge(zRequestCreationInputCommonMixin).describe("Transaction request data");
|
|
1909
|
+
generateNetworkSpecificTransactionRequestSchema(zSuiLikeTransactionData);
|
|
1809
1910
|
var zVaultRequestResponse = z7.discriminatedUnion(
|
|
1810
1911
|
"type",
|
|
1811
1912
|
ensureNonEmptyArray(
|
|
@@ -2084,6 +2185,17 @@ var genAssetFieldsForType = (type) => {
|
|
|
2084
2185
|
hsmXpub,
|
|
2085
2186
|
hsmChainCode
|
|
2086
2187
|
};
|
|
2188
|
+
case "TRON_LIKE":
|
|
2189
|
+
return {
|
|
2190
|
+
type,
|
|
2191
|
+
currency: faker.helpers.arrayElement(["tron"]),
|
|
2192
|
+
derivationPath: "44'/195'/0'",
|
|
2193
|
+
address: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2194
|
+
contractAddress: null,
|
|
2195
|
+
xpub: null,
|
|
2196
|
+
hsmXpub,
|
|
2197
|
+
hsmChainCode
|
|
2198
|
+
};
|
|
2087
2199
|
case "SUI_LIKE":
|
|
2088
2200
|
return {
|
|
2089
2201
|
type,
|
|
@@ -2161,6 +2273,7 @@ var genAccount = (opts) => {
|
|
|
2161
2273
|
index: faker.number.int({ min: 0, max: 10 }),
|
|
2162
2274
|
gateId: fakeGateId(),
|
|
2163
2275
|
gateType: GateAccountType.Account,
|
|
2276
|
+
lesWalletId: faker.string.uuid(),
|
|
2164
2277
|
createdAt: faker.date.past(),
|
|
2165
2278
|
updatedAt: faker.date.past()
|
|
2166
2279
|
};
|