@ledgerhq/revault-api 1.36.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-CG9mLS0l.d.mts → app-types-BiULyctM.d.mts} +1093 -106
- package/lib/fakes.d.mts +164 -21
- package/lib/fakes.mjs +178 -89
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +2662 -176
- 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,35 @@ 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),
|
|
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"),
|
|
513
556
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
514
|
-
}).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
|
+
]);
|
|
515
571
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
516
572
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
517
573
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
|
|
518
574
|
}).describe("Cardano-like send data");
|
|
519
575
|
var zCardanoStakingDelegateData = z7.object({
|
|
520
576
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
521
|
-
currency:
|
|
577
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
522
578
|
// TODO: strict literal or enum?
|
|
523
579
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
524
580
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -527,7 +583,7 @@ var zCardanoStakingDelegateData = z7.object({
|
|
|
527
583
|
}).describe("Cardano-like staking delegate");
|
|
528
584
|
var zCardanoStakingDeregisterData = z7.object({
|
|
529
585
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
530
|
-
currency:
|
|
586
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
531
587
|
// TODO: strict literal or enum?
|
|
532
588
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
533
589
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -536,7 +592,7 @@ var zCardanoStakingDeregisterData = z7.object({
|
|
|
536
592
|
}).describe("Cardano-like staking deregister data");
|
|
537
593
|
var zCardanoStakingRegisterData = z7.object({
|
|
538
594
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
539
|
-
currency:
|
|
595
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
540
596
|
// TODO: strict literal or enum?
|
|
541
597
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
542
598
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
@@ -545,13 +601,20 @@ var zCardanoStakingRegisterData = z7.object({
|
|
|
545
601
|
}).describe("Cardano-like staking register data");
|
|
546
602
|
var zCardanoStakingWithdrawData = z7.object({
|
|
547
603
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
548
|
-
currency:
|
|
604
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
549
605
|
// TODO: strict literal or enum?
|
|
550
606
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
551
607
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
552
608
|
// WITHDRAW doesn't have a recipient
|
|
553
609
|
amount: zUnsignedIntString.describe("Amount to withdraw")
|
|
554
610
|
}).describe("Cardano-like staking withdraw data");
|
|
611
|
+
var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
|
|
612
|
+
zCardanoSendData,
|
|
613
|
+
zCardanoStakingDelegateData,
|
|
614
|
+
zCardanoStakingDeregisterData,
|
|
615
|
+
zCardanoStakingRegisterData,
|
|
616
|
+
zCardanoStakingWithdrawData
|
|
617
|
+
]);
|
|
555
618
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
556
619
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
557
620
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
@@ -560,61 +623,50 @@ var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
|
560
623
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
561
624
|
feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
|
|
562
625
|
}).describe("Sui-like transfer token data");
|
|
626
|
+
var zSuiLikeTransactionData = z7.discriminatedUnion("type", [
|
|
627
|
+
zSuiLikeSendData,
|
|
628
|
+
zSuiLikeTransferTokenData
|
|
629
|
+
]);
|
|
563
630
|
var zGenericTransactionData = z7.object({
|
|
564
631
|
type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
565
|
-
currency:
|
|
632
|
+
currency: zCurrencyString.describe("Transaction currency"),
|
|
566
633
|
rawTx: z7.string().describe("Raw tx")
|
|
567
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
|
+
]);
|
|
568
647
|
var zTransactionData = z7.discriminatedUnion("type", [
|
|
569
648
|
// Bitcoin
|
|
570
649
|
zBitcoinLikeSendData,
|
|
571
650
|
// Cardano
|
|
572
|
-
|
|
573
|
-
zCardanoStakingDelegateData,
|
|
574
|
-
zCardanoStakingDeregisterData,
|
|
575
|
-
zCardanoStakingRegisterData,
|
|
576
|
-
zCardanoStakingWithdrawData,
|
|
651
|
+
...zCardanoLikeTransactionData.options,
|
|
577
652
|
// Ethereum
|
|
578
|
-
|
|
579
|
-
zEthereumLikeExecuteContractData,
|
|
580
|
-
zEthereumLikeSendData,
|
|
653
|
+
...zEthereumLikeTransactionData.options,
|
|
581
654
|
// Generic
|
|
582
655
|
zGenericTransactionData,
|
|
583
656
|
// Polkadot
|
|
584
|
-
|
|
585
|
-
zPolkadotLikeAnonymousProxyData,
|
|
586
|
-
zPolkadotLikeBondData,
|
|
587
|
-
zPolkadotLikeBondExtraData,
|
|
588
|
-
zPolkadotLikeChillData,
|
|
589
|
-
zPolkadotLikeKillAnonymousData,
|
|
590
|
-
zPolkadotLikeRebondData,
|
|
591
|
-
zPolkadotLikeRemoveProxyData,
|
|
592
|
-
zPolkadotLikeSendData,
|
|
593
|
-
zPolkadotLikeSetPayeeData,
|
|
594
|
-
zPolkadotLikeUnbondData,
|
|
595
|
-
zPolkadotLikeWithdrawUnbondedData,
|
|
657
|
+
...zPolkadotLikeTransactionData.options,
|
|
596
658
|
// Ripple
|
|
597
659
|
zRippleLikeSendData,
|
|
598
660
|
// Solana
|
|
599
|
-
|
|
600
|
-
zSolanaLikeDeactivateStakeData,
|
|
601
|
-
zSolanaLikeDelegateStakeData,
|
|
602
|
-
zSolanaLikeMergeStakeData,
|
|
603
|
-
zSolanaLikeSendData,
|
|
604
|
-
zSolanaLikeSplitDeactivateStakeData,
|
|
605
|
-
zSolanaLikeSplitStakeData,
|
|
606
|
-
zSolanaLikeWithdrawStakeData,
|
|
607
|
-
zSolanaLikeSendTokenData,
|
|
608
|
-
zSolanaLikeFundTokenData,
|
|
661
|
+
...zSolanaLikeTransactionData.options,
|
|
609
662
|
// Stellar
|
|
610
663
|
zStellarLikeSendData,
|
|
611
664
|
// Sui
|
|
612
|
-
|
|
613
|
-
zSuiLikeTransferTokenData,
|
|
665
|
+
...zSuiLikeTransactionData.options,
|
|
614
666
|
// Tezos
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
667
|
+
...zTezosLikeTransactionData.options,
|
|
668
|
+
// Tron
|
|
669
|
+
...zTronLikeTransactionData.options
|
|
618
670
|
]);
|
|
619
671
|
var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
|
|
620
672
|
zBitcoinLikeSendData,
|
|
@@ -792,6 +844,10 @@ var zTezosLikeAssetFields = z.object({
|
|
|
792
844
|
type: z.literal(AccountType.TEZOS_LIKE).describe("Account type"),
|
|
793
845
|
address: z.string().describe("Account address").nullable()
|
|
794
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");
|
|
795
851
|
var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
796
852
|
zBitcoinLikeAssetFields,
|
|
797
853
|
zCardanoLikeAssetFields,
|
|
@@ -804,7 +860,8 @@ var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
|
804
860
|
zSolanaLikeAssetFields,
|
|
805
861
|
zStellarLikeAssetFields,
|
|
806
862
|
zTezosLikeAssetFields,
|
|
807
|
-
zSuiLikeAssetFields
|
|
863
|
+
zSuiLikeAssetFields,
|
|
864
|
+
zTronLikeAssetFields
|
|
808
865
|
]).describe("Account asset fields");
|
|
809
866
|
var zReviewStepWithUsers = z.object({
|
|
810
867
|
quorum: z.number().min(0).describe("Number of required approvals for the step"),
|
|
@@ -872,7 +929,7 @@ var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
|
872
929
|
// src/tradelink/types.ts
|
|
873
930
|
var zTradelinkWhitelistAddress = z7.object({
|
|
874
931
|
name: z7.string().min(1),
|
|
875
|
-
currency:
|
|
932
|
+
currency: zCurrencyString,
|
|
876
933
|
address: z7.string().min(1)
|
|
877
934
|
});
|
|
878
935
|
z7.array(zTradelinkWhitelistAddress);
|
|
@@ -1145,7 +1202,8 @@ var zAccountCommonFields = z7.object({
|
|
|
1145
1202
|
id: z7.string().describe("Internal unique identifier"),
|
|
1146
1203
|
legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1147
1204
|
name: z7.string().describe("Name"),
|
|
1148
|
-
currency:
|
|
1205
|
+
currency: zCurrencyString,
|
|
1206
|
+
network: zNetwork,
|
|
1149
1207
|
contractAddress: z7.string().describe("Token contract address for Token account").nullable(),
|
|
1150
1208
|
index: z7.number().gte(0).describe("BIP44 account index"),
|
|
1151
1209
|
derivationPath: z7.string().describe("Derivation path"),
|
|
@@ -1178,7 +1236,7 @@ var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
|
1178
1236
|
var zCardanoLikeLiveData = zCommonLiveData.merge(zCardanoLikeStakingFields).describe("Cardano-like");
|
|
1179
1237
|
var zEthereumLikeLiveData = zCommonLiveData.merge(zEthereumLikeStakingFields).describe("Ethereum-like");
|
|
1180
1238
|
var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
|
|
1181
|
-
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE
|
|
1239
|
+
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).describe("Account type")
|
|
1182
1240
|
}).describe("Ethereum-like token");
|
|
1183
1241
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
1184
1242
|
type: z7.literal(AccountType.GENERIC_LIKE).describe("Account type")
|
|
@@ -1198,6 +1256,9 @@ var zSuiLikeLiveData = zCommonLiveData.extend({
|
|
|
1198
1256
|
type: z7.literal(AccountType.SUI_LIKE).describe("Account type")
|
|
1199
1257
|
}).describe("Sui-like");
|
|
1200
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");
|
|
1201
1262
|
z7.discriminatedUnion("type", [
|
|
1202
1263
|
zBitcoinLikeLiveData,
|
|
1203
1264
|
zCardanoLikeLiveData,
|
|
@@ -1210,12 +1271,17 @@ z7.discriminatedUnion("type", [
|
|
|
1210
1271
|
zSolanaLikeLiveData,
|
|
1211
1272
|
zStellarLikeLiveData,
|
|
1212
1273
|
zSuiLikeLiveData,
|
|
1213
|
-
zTezosLikeLiveData
|
|
1274
|
+
zTezosLikeLiveData,
|
|
1275
|
+
zTronLikeLiveData
|
|
1214
1276
|
]);
|
|
1215
1277
|
z7.object({
|
|
1216
1278
|
address: z7.string().describe("Address"),
|
|
1217
1279
|
derivationPath: z7.string().nullable().describe("Derivation path")
|
|
1218
1280
|
});
|
|
1281
|
+
z7.object({
|
|
1282
|
+
amount: zIntString.describe("Amount in the smallest unit of the currency"),
|
|
1283
|
+
currency: zCurrency
|
|
1284
|
+
});
|
|
1219
1285
|
|
|
1220
1286
|
// src/accounts/app-types.ts
|
|
1221
1287
|
z7.discriminatedUnion(
|
|
@@ -1230,7 +1296,7 @@ z7.discriminatedUnion(
|
|
|
1230
1296
|
);
|
|
1231
1297
|
var zWhitelistAddress = z7.object({
|
|
1232
1298
|
name: z7.string().min(1).max(50),
|
|
1233
|
-
currency:
|
|
1299
|
+
currency: zCurrencyString,
|
|
1234
1300
|
address: z7.string().min(1).max(200),
|
|
1235
1301
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1236
1302
|
// Empty array (or undefined) means no check on destination tag.
|
|
@@ -1294,20 +1360,20 @@ var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1294
1360
|
z7.object({
|
|
1295
1361
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1296
1362
|
policy: zAccountPolicyRequestData
|
|
1297
|
-
}),
|
|
1363
|
+
}).describe("Classic governance"),
|
|
1298
1364
|
z7.object({
|
|
1299
1365
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1300
1366
|
assetManagerId: z7.string(),
|
|
1301
1367
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1302
|
-
}),
|
|
1368
|
+
}).describe("Tradelink governance"),
|
|
1303
1369
|
z7.object({
|
|
1304
1370
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1305
1371
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1306
|
-
})
|
|
1307
|
-
]);
|
|
1372
|
+
}).describe("Raw signing governance")
|
|
1373
|
+
]).describe("Governance fields");
|
|
1308
1374
|
var zCreateAccountUserInputData = z7.object({
|
|
1309
1375
|
name: zAccountName,
|
|
1310
|
-
currency:
|
|
1376
|
+
currency: zCurrencyString,
|
|
1311
1377
|
// "bitcoin"
|
|
1312
1378
|
index: z7.number().nonnegative().optional().describe("Account index"),
|
|
1313
1379
|
contractAddress: z7.string().min(1).optional().describe("Account contract address"),
|
|
@@ -1323,16 +1389,16 @@ var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
|
1323
1389
|
z7.object({
|
|
1324
1390
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1325
1391
|
policy: zAccountPolicyRequestData
|
|
1326
|
-
}),
|
|
1392
|
+
}).describe("Classic governance"),
|
|
1327
1393
|
z7.object({
|
|
1328
1394
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1329
1395
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1330
|
-
}),
|
|
1396
|
+
}).describe("Tradelink governance"),
|
|
1331
1397
|
z7.object({
|
|
1332
1398
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1333
1399
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1334
|
-
})
|
|
1335
|
-
]);
|
|
1400
|
+
}).describe("Raw signing governance")
|
|
1401
|
+
]).describe("Governance fields");
|
|
1336
1402
|
var zEditAccountRequestData = z7.object({
|
|
1337
1403
|
name: zAccountName,
|
|
1338
1404
|
governance: zEditAccountGovernanceData
|
|
@@ -1401,6 +1467,11 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1401
1467
|
type: account.type,
|
|
1402
1468
|
address: account.address
|
|
1403
1469
|
};
|
|
1470
|
+
case AccountType.TRON_LIKE:
|
|
1471
|
+
return {
|
|
1472
|
+
type: account.type,
|
|
1473
|
+
address: account.address
|
|
1474
|
+
};
|
|
1404
1475
|
case AccountType.GENERIC_LIKE:
|
|
1405
1476
|
case AccountType.RAW_SIGNING:
|
|
1406
1477
|
return {
|
|
@@ -1437,6 +1508,7 @@ var serializeAccount = (account) => {
|
|
|
1437
1508
|
const governance = getAccountGovernanceFields(account);
|
|
1438
1509
|
const response = {
|
|
1439
1510
|
...account,
|
|
1511
|
+
network: account.currency,
|
|
1440
1512
|
legacyId: account.gateId,
|
|
1441
1513
|
governance,
|
|
1442
1514
|
asset
|
|
@@ -1830,6 +1902,11 @@ z7.object({
|
|
|
1830
1902
|
)
|
|
1831
1903
|
)
|
|
1832
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);
|
|
1833
1910
|
var zVaultRequestResponse = z7.discriminatedUnion(
|
|
1834
1911
|
"type",
|
|
1835
1912
|
ensureNonEmptyArray(
|
|
@@ -2108,6 +2185,17 @@ var genAssetFieldsForType = (type) => {
|
|
|
2108
2185
|
hsmXpub,
|
|
2109
2186
|
hsmChainCode
|
|
2110
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
|
+
};
|
|
2111
2199
|
case "SUI_LIKE":
|
|
2112
2200
|
return {
|
|
2113
2201
|
type,
|
|
@@ -2185,6 +2273,7 @@ var genAccount = (opts) => {
|
|
|
2185
2273
|
index: faker.number.int({ min: 0, max: 10 }),
|
|
2186
2274
|
gateId: fakeGateId(),
|
|
2187
2275
|
gateType: GateAccountType.Account,
|
|
2276
|
+
lesWalletId: faker.string.uuid(),
|
|
2188
2277
|
createdAt: faker.date.past(),
|
|
2189
2278
|
updatedAt: faker.date.past()
|
|
2190
2279
|
};
|