@ledgerhq/revault-api 1.36.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{app-types-CG9mLS0l.d.mts → app-types-BYRSuEx3.d.mts} +1123 -106
- package/lib/fakes.d.mts +169 -21
- package/lib/fakes.mjs +179 -89
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +2674 -180
- package/package.json +1 -1
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([
|
|
@@ -245,6 +251,7 @@ var zTezosLikeTransactionType = z7.enum([
|
|
|
245
251
|
]).describe("Tezos-like transaction type");
|
|
246
252
|
var zGenericTransactionType = z7.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
|
|
247
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,19 +273,23 @@ z7.discriminatedUnion("type", [
|
|
|
265
273
|
gasLimit: zIntString,
|
|
266
274
|
nonce: z7.string(),
|
|
267
275
|
priorityFees: zIntString
|
|
268
|
-
}),
|
|
276
|
+
}).describe("Ethereum-like fees"),
|
|
269
277
|
z7.object({
|
|
270
|
-
type: z7.literal("
|
|
278
|
+
type: z7.literal("RIPPLE_LIKE"),
|
|
271
279
|
fee: zIntString
|
|
272
|
-
}),
|
|
280
|
+
}).describe("Ripple-like fees"),
|
|
273
281
|
z7.object({
|
|
274
282
|
type: z7.literal("STELLAR_LIKE"),
|
|
275
283
|
fee: zIntString
|
|
276
|
-
}),
|
|
284
|
+
}).describe("Stellar-like fees"),
|
|
277
285
|
z7.object({
|
|
278
|
-
type: z7.literal("
|
|
286
|
+
type: z7.literal("SUI_LIKE"),
|
|
279
287
|
fee: zIntString
|
|
280
|
-
})
|
|
288
|
+
}).describe("Sui-like fees"),
|
|
289
|
+
z7.object({
|
|
290
|
+
type: z7.literal("TRON_LIKE"),
|
|
291
|
+
fee: zIntString
|
|
292
|
+
}).describe("Tron-like fees")
|
|
281
293
|
]);
|
|
282
294
|
var zMessageType = z7.enum(["EIP191", "EIP712"]);
|
|
283
295
|
var zMessage = z7.object({
|
|
@@ -292,8 +304,10 @@ if ("openapi" in zHexDataString) {
|
|
|
292
304
|
}
|
|
293
305
|
var zCommonTransactionData = z7.object({
|
|
294
306
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
295
|
-
currency:
|
|
296
|
-
|
|
307
|
+
currency: zCurrencyString.describe(
|
|
308
|
+
"Will be deprecated soon, use Account.network. Transaction currency"
|
|
309
|
+
),
|
|
310
|
+
// TODO: to remove, use account.network instead
|
|
297
311
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
298
312
|
recipient: z7.string().nonempty().describe("Transaction recipient")
|
|
299
313
|
});
|
|
@@ -337,6 +351,11 @@ var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
|
337
351
|
type: z7.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
338
352
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
339
353
|
}).describe("Ethereum-like send data");
|
|
354
|
+
var zEthereumLikeTransactionData = z7.discriminatedUnion("type", [
|
|
355
|
+
zEthereumLikeDeployContractData,
|
|
356
|
+
zEthereumLikeExecuteContractData,
|
|
357
|
+
zEthereumLikeSendData
|
|
358
|
+
]);
|
|
340
359
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
341
360
|
gasLimit: zUnsignedIntString.describe("Gas limit"),
|
|
342
361
|
storageLimit: zUnsignedIntString.nullable().describe("Storage limit")
|
|
@@ -348,7 +367,7 @@ var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
|
348
367
|
var zTezosLikeDelegateData = z7.object({
|
|
349
368
|
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
350
369
|
amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
|
|
351
|
-
currency:
|
|
370
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
352
371
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
353
372
|
recipient: z7.string().nonempty().describe("Transaction recipient"),
|
|
354
373
|
feeStrategy: zTezosLikeFeeStrategy
|
|
@@ -356,49 +375,54 @@ var zTezosLikeDelegateData = z7.object({
|
|
|
356
375
|
var zTezosLikeUndelegateData = z7.object({
|
|
357
376
|
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
358
377
|
amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
|
|
359
|
-
currency:
|
|
378
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
360
379
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
361
380
|
recipient: z7.string().nonempty().optional().describe("Deprecated: DO NOT USE!"),
|
|
362
381
|
feeStrategy: zTezosLikeFeeStrategy
|
|
363
382
|
}).describe("Tezos-like undelegate data");
|
|
383
|
+
var zTezosLikeTransactionData = z7.discriminatedUnion("type", [
|
|
384
|
+
zTezosLikeSendData,
|
|
385
|
+
zTezosLikeDelegateData,
|
|
386
|
+
zTezosLikeUndelegateData
|
|
387
|
+
]);
|
|
364
388
|
var zPolkadotRewardDestination = z7.enum(["Staked", "Stash"]);
|
|
365
389
|
var zPolkadotLikeAddProxyData = z7.object({
|
|
366
390
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
367
|
-
currency:
|
|
391
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
368
392
|
kind: z7.literal("Staking").describe("Proxy kind"),
|
|
369
393
|
proxy: z7.string().describe("Proxy address")
|
|
370
394
|
}).describe("Polkadot-like add proxy data");
|
|
371
395
|
var zPolkadotLikeAnonymousProxyData = z7.object({
|
|
372
396
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
373
|
-
currency:
|
|
397
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
374
398
|
}).describe("Polkadot-like anonymous proxy data");
|
|
375
399
|
var zPolkadotLikeBondData = z7.object({
|
|
376
400
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
377
|
-
currency:
|
|
401
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
378
402
|
payee: zPolkadotRewardDestination,
|
|
379
403
|
amount: zUnsignedIntString.describe("Amount")
|
|
380
404
|
}).describe("Polkadot-like bond data");
|
|
381
405
|
var zPolkadotLikeBondExtraData = z7.object({
|
|
382
406
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
383
|
-
currency:
|
|
407
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
384
408
|
amount: zUnsignedIntString.describe("Amount")
|
|
385
409
|
}).describe("Polkadot-like bond extra data");
|
|
386
410
|
var zPolkadotLikeChillData = z7.object({
|
|
387
411
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
388
|
-
currency:
|
|
412
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
389
413
|
}).describe("Polkadot-like chill data");
|
|
390
414
|
var zPolkadotLikeKillAnonymousData = z7.object({
|
|
391
415
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
392
|
-
currency:
|
|
416
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
393
417
|
}).describe("Polkadot-like kill anonymous data");
|
|
394
418
|
var zPolkadotLikeRebondData = z7.object({
|
|
395
419
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
396
|
-
currency:
|
|
420
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
397
421
|
amount: zUnsignedIntString.describe("Amount")
|
|
398
422
|
}).describe("Polkadot-like rebond data");
|
|
399
423
|
var zPolkadotLikeRemoveProxyData = z7.object({
|
|
400
424
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
401
|
-
currency:
|
|
425
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
402
426
|
kind: z7.literal("Staking"),
|
|
403
427
|
proxy: z7.string().describe("Proxy address")
|
|
404
428
|
}).describe("Polkadot-like remove proxy data");
|
|
@@ -407,18 +431,32 @@ var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
|
407
431
|
}).describe("Polkadot-like send data");
|
|
408
432
|
var zPolkadotLikeSetPayeeData = z7.object({
|
|
409
433
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
410
|
-
currency:
|
|
434
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
411
435
|
payee: zPolkadotRewardDestination
|
|
412
436
|
}).describe("Polkadot-like set payee data");
|
|
413
437
|
var zPolkadotLikeUnbondData = z7.object({
|
|
414
438
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
415
|
-
currency:
|
|
439
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
416
440
|
amount: zUnsignedIntString.describe("Amount")
|
|
417
441
|
}).describe("Polkadot-like unbond data");
|
|
418
442
|
var zPolkadotLikeWithdrawUnbondedData = z7.object({
|
|
419
443
|
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
420
|
-
currency:
|
|
444
|
+
currency: zCurrencyString.describe("Transaction currency")
|
|
421
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
|
+
]);
|
|
422
460
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
423
461
|
type: z7.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
424
462
|
destinationTag: zIntString.nullable().describe("Destination tag"),
|
|
@@ -449,7 +487,7 @@ var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
|
449
487
|
}).describe("Solana-like create delegate stake data");
|
|
450
488
|
var zSolanaLikeDeactivateStakeData = z7.object({
|
|
451
489
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
452
|
-
currency:
|
|
490
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
453
491
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
454
492
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
455
493
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -457,7 +495,7 @@ var zSolanaLikeDeactivateStakeData = z7.object({
|
|
|
457
495
|
}).describe("Solana-like deactivate stake data");
|
|
458
496
|
var zSolanaLikeDelegateStakeData = z7.object({
|
|
459
497
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
460
|
-
currency:
|
|
498
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
461
499
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
462
500
|
recipient: z7.string().describe("Delegated vote address"),
|
|
463
501
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
@@ -466,7 +504,7 @@ var zSolanaLikeDelegateStakeData = z7.object({
|
|
|
466
504
|
}).describe("Solana-like delegate stake data");
|
|
467
505
|
var zSolanaLikeMergeStakeData = z7.object({
|
|
468
506
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
469
|
-
currency:
|
|
507
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
470
508
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
471
509
|
mergeSrcAccount: z7.string().describe("Source stake address"),
|
|
472
510
|
mergeDstAccount: z7.string().describe("Destination stake address"),
|
|
@@ -480,7 +518,7 @@ var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
|
480
518
|
var zSolanaLikeSplitDeactivateStakeData = z7.object({
|
|
481
519
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
482
520
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
483
|
-
currency:
|
|
521
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
484
522
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
485
523
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
486
524
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -489,7 +527,7 @@ var zSolanaLikeSplitDeactivateStakeData = z7.object({
|
|
|
489
527
|
var zSolanaLikeSplitStakeData = z7.object({
|
|
490
528
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
491
529
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
492
|
-
currency:
|
|
530
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
493
531
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
494
532
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
495
533
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -498,7 +536,7 @@ var zSolanaLikeSplitStakeData = z7.object({
|
|
|
498
536
|
var zSolanaLikeWithdrawStakeData = z7.object({
|
|
499
537
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
500
538
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
501
|
-
currency:
|
|
539
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
502
540
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
503
541
|
stakeAccount: z7.string().describe("Stake account address"),
|
|
504
542
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
@@ -508,17 +546,36 @@ var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
|
508
546
|
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
509
547
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
510
548
|
}).describe("Solana-like send token data");
|
|
511
|
-
var
|
|
512
|
-
type: z7.literal(zSolanaLikeTransactionType.enum.
|
|
549
|
+
var zSolanaLikeFundAndSendTokenData = zCommonTransactionData.extend({
|
|
550
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_AND_SEND_TOKEN),
|
|
513
551
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
514
|
-
}).describe("Solana-like fund token data");
|
|
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"),
|
|
556
|
+
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
557
|
+
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
558
|
+
}).describe("Solana-like create token account");
|
|
559
|
+
var zSolanaLikeTransactionData = z7.discriminatedUnion("type", [
|
|
560
|
+
zSolanaLikeCreateDelegateStakeData,
|
|
561
|
+
zSolanaLikeDeactivateStakeData,
|
|
562
|
+
zSolanaLikeDelegateStakeData,
|
|
563
|
+
zSolanaLikeMergeStakeData,
|
|
564
|
+
zSolanaLikeSendData,
|
|
565
|
+
zSolanaLikeSplitDeactivateStakeData,
|
|
566
|
+
zSolanaLikeSplitStakeData,
|
|
567
|
+
zSolanaLikeWithdrawStakeData,
|
|
568
|
+
zSolanaLikeSendTokenData,
|
|
569
|
+
zSolanaLikeFundAndSendTokenData,
|
|
570
|
+
zSolanaLikeCreateTokenAccountData
|
|
571
|
+
]);
|
|
515
572
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
516
573
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
517
574
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
|
|
518
575
|
}).describe("Cardano-like send data");
|
|
519
576
|
var zCardanoStakingDelegateData = z7.object({
|
|
520
577
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
521
|
-
currency:
|
|
578
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
522
579
|
// TODO: strict literal or enum?
|
|
523
580
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
524
581
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -527,7 +584,7 @@ var zCardanoStakingDelegateData = z7.object({
|
|
|
527
584
|
}).describe("Cardano-like staking delegate");
|
|
528
585
|
var zCardanoStakingDeregisterData = z7.object({
|
|
529
586
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
530
|
-
currency:
|
|
587
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
531
588
|
// TODO: strict literal or enum?
|
|
532
589
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
533
590
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -536,7 +593,7 @@ var zCardanoStakingDeregisterData = z7.object({
|
|
|
536
593
|
}).describe("Cardano-like staking deregister data");
|
|
537
594
|
var zCardanoStakingRegisterData = z7.object({
|
|
538
595
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
539
|
-
currency:
|
|
596
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
540
597
|
// TODO: strict literal or enum?
|
|
541
598
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
542
599
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -545,13 +602,20 @@ var zCardanoStakingRegisterData = z7.object({
|
|
|
545
602
|
}).describe("Cardano-like staking register data");
|
|
546
603
|
var zCardanoStakingWithdrawData = z7.object({
|
|
547
604
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
548
|
-
currency:
|
|
605
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
549
606
|
// TODO: strict literal or enum?
|
|
550
607
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
551
608
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
552
609
|
// WITHDRAW doesn't have a recipient
|
|
553
610
|
amount: zUnsignedIntString.describe("Amount to withdraw")
|
|
554
611
|
}).describe("Cardano-like staking withdraw data");
|
|
612
|
+
var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
|
|
613
|
+
zCardanoSendData,
|
|
614
|
+
zCardanoStakingDelegateData,
|
|
615
|
+
zCardanoStakingDeregisterData,
|
|
616
|
+
zCardanoStakingRegisterData,
|
|
617
|
+
zCardanoStakingWithdrawData
|
|
618
|
+
]);
|
|
555
619
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
556
620
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
557
621
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
@@ -560,61 +624,50 @@ var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
|
560
624
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
561
625
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
562
626
|
}).describe("Sui-like transfer token data");
|
|
627
|
+
var zSuiLikeTransactionData = z7.discriminatedUnion("type", [
|
|
628
|
+
zSuiLikeSendData,
|
|
629
|
+
zSuiLikeTransferTokenData
|
|
630
|
+
]);
|
|
563
631
|
var zGenericTransactionData = z7.object({
|
|
564
632
|
type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
565
|
-
currency:
|
|
633
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
566
634
|
rawTx: z7.string().describe("Raw tx")
|
|
567
635
|
}).describe("Generic transaction data");
|
|
636
|
+
var zTronLikeSendData = zCommonTransactionData.extend({
|
|
637
|
+
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
|
|
638
|
+
feeStrategy: zFeeStrategy.describe("Tron-like fee strategy")
|
|
639
|
+
}).describe("Tron-like send data");
|
|
640
|
+
var zTronLikeSendTokenData = zCommonTransactionData.extend({
|
|
641
|
+
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
|
|
642
|
+
feeStrategy: zFeeStrategy.describe("Tron-like fee strategy")
|
|
643
|
+
}).describe("Tron-like send token data");
|
|
644
|
+
var zTronLikeTransactionData = z7.discriminatedUnion("type", [
|
|
645
|
+
zTronLikeSendData,
|
|
646
|
+
zTronLikeSendTokenData
|
|
647
|
+
]);
|
|
568
648
|
var zTransactionData = z7.discriminatedUnion("type", [
|
|
569
649
|
// Bitcoin
|
|
570
650
|
zBitcoinLikeSendData,
|
|
571
651
|
// Cardano
|
|
572
|
-
|
|
573
|
-
zCardanoStakingDelegateData,
|
|
574
|
-
zCardanoStakingDeregisterData,
|
|
575
|
-
zCardanoStakingRegisterData,
|
|
576
|
-
zCardanoStakingWithdrawData,
|
|
652
|
+
...zCardanoLikeTransactionData.options,
|
|
577
653
|
// Ethereum
|
|
578
|
-
|
|
579
|
-
zEthereumLikeExecuteContractData,
|
|
580
|
-
zEthereumLikeSendData,
|
|
654
|
+
...zEthereumLikeTransactionData.options,
|
|
581
655
|
// Generic
|
|
582
656
|
zGenericTransactionData,
|
|
583
657
|
// Polkadot
|
|
584
|
-
|
|
585
|
-
zPolkadotLikeAnonymousProxyData,
|
|
586
|
-
zPolkadotLikeBondData,
|
|
587
|
-
zPolkadotLikeBondExtraData,
|
|
588
|
-
zPolkadotLikeChillData,
|
|
589
|
-
zPolkadotLikeKillAnonymousData,
|
|
590
|
-
zPolkadotLikeRebondData,
|
|
591
|
-
zPolkadotLikeRemoveProxyData,
|
|
592
|
-
zPolkadotLikeSendData,
|
|
593
|
-
zPolkadotLikeSetPayeeData,
|
|
594
|
-
zPolkadotLikeUnbondData,
|
|
595
|
-
zPolkadotLikeWithdrawUnbondedData,
|
|
658
|
+
...zPolkadotLikeTransactionData.options,
|
|
596
659
|
// Ripple
|
|
597
660
|
zRippleLikeSendData,
|
|
598
661
|
// Solana
|
|
599
|
-
|
|
600
|
-
zSolanaLikeDeactivateStakeData,
|
|
601
|
-
zSolanaLikeDelegateStakeData,
|
|
602
|
-
zSolanaLikeMergeStakeData,
|
|
603
|
-
zSolanaLikeSendData,
|
|
604
|
-
zSolanaLikeSplitDeactivateStakeData,
|
|
605
|
-
zSolanaLikeSplitStakeData,
|
|
606
|
-
zSolanaLikeWithdrawStakeData,
|
|
607
|
-
zSolanaLikeSendTokenData,
|
|
608
|
-
zSolanaLikeFundTokenData,
|
|
662
|
+
...zSolanaLikeTransactionData.options,
|
|
609
663
|
// Stellar
|
|
610
664
|
zStellarLikeSendData,
|
|
611
665
|
// Sui
|
|
612
|
-
|
|
613
|
-
zSuiLikeTransferTokenData,
|
|
666
|
+
...zSuiLikeTransactionData.options,
|
|
614
667
|
// Tezos
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
668
|
+
...zTezosLikeTransactionData.options,
|
|
669
|
+
// Tron
|
|
670
|
+
...zTronLikeTransactionData.options
|
|
618
671
|
]);
|
|
619
672
|
var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
|
|
620
673
|
zBitcoinLikeSendData,
|
|
@@ -792,6 +845,10 @@ var zTezosLikeAssetFields = z.object({
|
|
|
792
845
|
type: z.literal(AccountType.TEZOS_LIKE).describe("Account type"),
|
|
793
846
|
address: z.string().describe("Account address").nullable()
|
|
794
847
|
}).describe("Tezos-like");
|
|
848
|
+
var zTronLikeAssetFields = z.object({
|
|
849
|
+
type: z.literal(AccountType.TRON_LIKE).describe("Account type"),
|
|
850
|
+
address: z.string().describe("Account address").nullable()
|
|
851
|
+
}).describe("Tron-like");
|
|
795
852
|
var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
796
853
|
zBitcoinLikeAssetFields,
|
|
797
854
|
zCardanoLikeAssetFields,
|
|
@@ -804,7 +861,8 @@ var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
|
804
861
|
zSolanaLikeAssetFields,
|
|
805
862
|
zStellarLikeAssetFields,
|
|
806
863
|
zTezosLikeAssetFields,
|
|
807
|
-
zSuiLikeAssetFields
|
|
864
|
+
zSuiLikeAssetFields,
|
|
865
|
+
zTronLikeAssetFields
|
|
808
866
|
]).describe("Account asset fields");
|
|
809
867
|
var zReviewStepWithUsers = z.object({
|
|
810
868
|
quorum: z.number().min(0).describe("Number of required approvals for the step"),
|
|
@@ -872,7 +930,7 @@ var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
|
872
930
|
// src/tradelink/types.ts
|
|
873
931
|
var zTradelinkWhitelistAddress = z7.object({
|
|
874
932
|
name: z7.string().min(1),
|
|
875
|
-
currency:
|
|
933
|
+
currency: zCurrencyString,
|
|
876
934
|
address: z7.string().min(1)
|
|
877
935
|
});
|
|
878
936
|
z7.array(zTradelinkWhitelistAddress);
|
|
@@ -1145,7 +1203,8 @@ var zAccountCommonFields = z7.object({
|
|
|
1145
1203
|
id: z7.string().describe("Internal unique identifier"),
|
|
1146
1204
|
legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1147
1205
|
name: z7.string().describe("Name"),
|
|
1148
|
-
currency:
|
|
1206
|
+
currency: zCurrencyString,
|
|
1207
|
+
network: zNetwork,
|
|
1149
1208
|
contractAddress: z7.string().describe("Token contract address for Token account").nullable(),
|
|
1150
1209
|
index: z7.number().gte(0).describe("BIP44 account index"),
|
|
1151
1210
|
derivationPath: z7.string().describe("Derivation path"),
|
|
@@ -1178,7 +1237,7 @@ var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
|
1178
1237
|
var zCardanoLikeLiveData = zCommonLiveData.merge(zCardanoLikeStakingFields).describe("Cardano-like");
|
|
1179
1238
|
var zEthereumLikeLiveData = zCommonLiveData.merge(zEthereumLikeStakingFields).describe("Ethereum-like");
|
|
1180
1239
|
var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
|
|
1181
|
-
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE
|
|
1240
|
+
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).describe("Account type")
|
|
1182
1241
|
}).describe("Ethereum-like token");
|
|
1183
1242
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
1184
1243
|
type: z7.literal(AccountType.GENERIC_LIKE).describe("Account type")
|
|
@@ -1198,6 +1257,9 @@ var zSuiLikeLiveData = zCommonLiveData.extend({
|
|
|
1198
1257
|
type: z7.literal(AccountType.SUI_LIKE).describe("Account type")
|
|
1199
1258
|
}).describe("Sui-like");
|
|
1200
1259
|
var zTezosLikeLiveData = zCommonLiveData.merge(zTezosLikeStakingFields).describe("Tezos-like");
|
|
1260
|
+
var zTronLikeLiveData = zCommonLiveData.extend({
|
|
1261
|
+
type: z7.enum([AccountType.TRON_LIKE, AccountType.TRC20_LIKE]).describe("Account type")
|
|
1262
|
+
}).describe("Tron-like");
|
|
1201
1263
|
z7.discriminatedUnion("type", [
|
|
1202
1264
|
zBitcoinLikeLiveData,
|
|
1203
1265
|
zCardanoLikeLiveData,
|
|
@@ -1210,12 +1272,17 @@ z7.discriminatedUnion("type", [
|
|
|
1210
1272
|
zSolanaLikeLiveData,
|
|
1211
1273
|
zStellarLikeLiveData,
|
|
1212
1274
|
zSuiLikeLiveData,
|
|
1213
|
-
zTezosLikeLiveData
|
|
1275
|
+
zTezosLikeLiveData,
|
|
1276
|
+
zTronLikeLiveData
|
|
1214
1277
|
]);
|
|
1215
1278
|
z7.object({
|
|
1216
1279
|
address: z7.string().describe("Address"),
|
|
1217
1280
|
derivationPath: z7.string().nullable().describe("Derivation path")
|
|
1218
1281
|
});
|
|
1282
|
+
z7.object({
|
|
1283
|
+
amount: zIntString.describe("Amount in the smallest unit of the currency"),
|
|
1284
|
+
currency: zCurrency
|
|
1285
|
+
});
|
|
1219
1286
|
|
|
1220
1287
|
// src/accounts/app-types.ts
|
|
1221
1288
|
z7.discriminatedUnion(
|
|
@@ -1230,7 +1297,7 @@ z7.discriminatedUnion(
|
|
|
1230
1297
|
);
|
|
1231
1298
|
var zWhitelistAddress = z7.object({
|
|
1232
1299
|
name: z7.string().min(1).max(50),
|
|
1233
|
-
currency:
|
|
1300
|
+
currency: zCurrencyString,
|
|
1234
1301
|
address: z7.string().min(1).max(200),
|
|
1235
1302
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1236
1303
|
// Empty array (or undefined) means no check on destination tag.
|
|
@@ -1294,20 +1361,20 @@ var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1294
1361
|
z7.object({
|
|
1295
1362
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1296
1363
|
policy: zAccountPolicyRequestData
|
|
1297
|
-
}),
|
|
1364
|
+
}).describe("Classic governance"),
|
|
1298
1365
|
z7.object({
|
|
1299
1366
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1300
1367
|
assetManagerId: z7.string(),
|
|
1301
1368
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1302
|
-
}),
|
|
1369
|
+
}).describe("Tradelink governance"),
|
|
1303
1370
|
z7.object({
|
|
1304
1371
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1305
1372
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1306
|
-
})
|
|
1307
|
-
]);
|
|
1373
|
+
}).describe("Raw signing governance")
|
|
1374
|
+
]).describe("Governance fields");
|
|
1308
1375
|
var zCreateAccountUserInputData = z7.object({
|
|
1309
1376
|
name: zAccountName,
|
|
1310
|
-
currency:
|
|
1377
|
+
currency: zCurrencyString,
|
|
1311
1378
|
// "bitcoin"
|
|
1312
1379
|
index: z7.number().nonnegative().optional().describe("Account index"),
|
|
1313
1380
|
contractAddress: z7.string().min(1).optional().describe("Account contract address"),
|
|
@@ -1323,16 +1390,16 @@ var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1323
1390
|
z7.object({
|
|
1324
1391
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1325
1392
|
policy: zAccountPolicyRequestData
|
|
1326
|
-
}),
|
|
1393
|
+
}).describe("Classic governance"),
|
|
1327
1394
|
z7.object({
|
|
1328
1395
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1329
1396
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1330
|
-
}),
|
|
1397
|
+
}).describe("Tradelink governance"),
|
|
1331
1398
|
z7.object({
|
|
1332
1399
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1333
1400
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1334
|
-
})
|
|
1335
|
-
]);
|
|
1401
|
+
}).describe("Raw signing governance")
|
|
1402
|
+
]).describe("Governance fields");
|
|
1336
1403
|
var zEditAccountRequestData = z7.object({
|
|
1337
1404
|
name: zAccountName,
|
|
1338
1405
|
governance: zEditAccountGovernanceData
|
|
@@ -1401,6 +1468,11 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1401
1468
|
type: account.type,
|
|
1402
1469
|
address: account.address
|
|
1403
1470
|
};
|
|
1471
|
+
case AccountType.TRON_LIKE:
|
|
1472
|
+
return {
|
|
1473
|
+
type: account.type,
|
|
1474
|
+
address: account.address
|
|
1475
|
+
};
|
|
1404
1476
|
case AccountType.GENERIC_LIKE:
|
|
1405
1477
|
case AccountType.RAW_SIGNING:
|
|
1406
1478
|
return {
|
|
@@ -1437,6 +1509,7 @@ var serializeAccount = (account) => {
|
|
|
1437
1509
|
const governance = getAccountGovernanceFields(account);
|
|
1438
1510
|
const response = {
|
|
1439
1511
|
...account,
|
|
1512
|
+
network: account.currency,
|
|
1440
1513
|
legacyId: account.gateId,
|
|
1441
1514
|
governance,
|
|
1442
1515
|
asset
|
|
@@ -1830,6 +1903,11 @@ z7.object({
|
|
|
1830
1903
|
)
|
|
1831
1904
|
)
|
|
1832
1905
|
});
|
|
1906
|
+
var generateNetworkSpecificTransactionRequestSchema = (transaction) => z7.object({
|
|
1907
|
+
accountId: z7.string().min(1).describe("Target account id"),
|
|
1908
|
+
transaction
|
|
1909
|
+
}).merge(zRequestCreationInputCommonMixin).describe("Transaction request data");
|
|
1910
|
+
generateNetworkSpecificTransactionRequestSchema(zSuiLikeTransactionData);
|
|
1833
1911
|
var zVaultRequestResponse = z7.discriminatedUnion(
|
|
1834
1912
|
"type",
|
|
1835
1913
|
ensureNonEmptyArray(
|
|
@@ -2108,6 +2186,17 @@ var genAssetFieldsForType = (type) => {
|
|
|
2108
2186
|
hsmXpub,
|
|
2109
2187
|
hsmChainCode
|
|
2110
2188
|
};
|
|
2189
|
+
case "TRON_LIKE":
|
|
2190
|
+
return {
|
|
2191
|
+
type,
|
|
2192
|
+
currency: faker.helpers.arrayElement(["tron"]),
|
|
2193
|
+
derivationPath: "44'/195'/0'",
|
|
2194
|
+
address: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2195
|
+
contractAddress: null,
|
|
2196
|
+
xpub: null,
|
|
2197
|
+
hsmXpub,
|
|
2198
|
+
hsmChainCode
|
|
2199
|
+
};
|
|
2111
2200
|
case "SUI_LIKE":
|
|
2112
2201
|
return {
|
|
2113
2202
|
type,
|
|
@@ -2185,6 +2274,7 @@ var genAccount = (opts) => {
|
|
|
2185
2274
|
index: faker.number.int({ min: 0, max: 10 }),
|
|
2186
2275
|
gateId: fakeGateId(),
|
|
2187
2276
|
gateType: GateAccountType.Account,
|
|
2277
|
+
lesWalletId: faker.string.uuid(),
|
|
2188
2278
|
createdAt: faker.date.past(),
|
|
2189
2279
|
updatedAt: faker.date.past()
|
|
2190
2280
|
};
|