@ledgerhq/revault-api 1.35.0 → 1.36.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/fakes.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { RequestType, VaultRequest, VaultRequestReview, Account } from '@prisma/client';
2
- import { y as UserChallenge, A as AccountResponse, u as VaultRequestResponse } from './app-types-DVWgnjvj.mjs';
2
+ import { B as UserChallenge, A as AccountResponse, v as VaultRequestResponse } from './app-types-CG9mLS0l.mjs';
3
3
  import z__default from 'zod';
4
4
 
5
5
  /**
@@ -1021,7 +1021,7 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
1021
1021
  maxFee: z__default.ZodNullable<z__default.ZodString>;
1022
1022
  recipient: z__default.ZodString;
1023
1023
  } & {
1024
- type: z__default.ZodLiteral<"SUI_LIKE_TRANSFER_TOKEN">;
1024
+ type: z__default.ZodLiteral<"SUI_LIKE_SEND_TOKEN">;
1025
1025
  feeStrategy: z__default.ZodObject<{
1026
1026
  type: z__default.ZodEnum<["SLOW", "NORMAL", "FAST"]>;
1027
1027
  }, "strip", z__default.ZodTypeAny, {
@@ -1030,7 +1030,7 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
1030
1030
  type: "FAST" | "NORMAL" | "SLOW";
1031
1031
  }>;
1032
1032
  }, "strip", z__default.ZodTypeAny, {
1033
- type: "SUI_LIKE_TRANSFER_TOKEN";
1033
+ type: "SUI_LIKE_SEND_TOKEN";
1034
1034
  currency: string;
1035
1035
  recipient: string;
1036
1036
  amount: string;
@@ -1039,7 +1039,7 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
1039
1039
  type: "FAST" | "NORMAL" | "SLOW";
1040
1040
  };
1041
1041
  }, {
1042
- type: "SUI_LIKE_TRANSFER_TOKEN";
1042
+ type: "SUI_LIKE_SEND_TOKEN";
1043
1043
  currency: string;
1044
1044
  recipient: string;
1045
1045
  amount: string;
@@ -1487,7 +1487,7 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
1487
1487
  type: "FAST" | "NORMAL" | "SLOW";
1488
1488
  };
1489
1489
  } | {
1490
- type: "SUI_LIKE_TRANSFER_TOKEN";
1490
+ type: "SUI_LIKE_SEND_TOKEN";
1491
1491
  currency: string;
1492
1492
  recipient: string;
1493
1493
  amount: string;
@@ -1812,7 +1812,7 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
1812
1812
  type: "FAST" | "NORMAL" | "SLOW";
1813
1813
  };
1814
1814
  } | {
1815
- type: "SUI_LIKE_TRANSFER_TOKEN";
1815
+ type: "SUI_LIKE_SEND_TOKEN";
1816
1816
  currency: string;
1817
1817
  recipient: string;
1818
1818
  amount: string;
package/lib/fakes.mjs CHANGED
@@ -244,7 +244,7 @@ var zTezosLikeTransactionType = z7.enum([
244
244
  "TEZOS_LIKE_UNDELEGATE"
245
245
  ]).describe("Tezos-like transaction type");
246
246
  var zGenericTransactionType = z7.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
247
- var zSuiLikeTransactionType = z7.enum(["SUI_LIKE_SEND", "SUI_LIKE_RECEIVE", "SUI_LIKE_TRANSFER_TOKEN"]).describe("Sui-like transaction type");
247
+ var zSuiLikeTransactionType = z7.enum(["SUI_LIKE_SEND", "SUI_LIKE_RECEIVE", "SUI_LIKE_SEND_TOKEN", "SUI_LIKE_RECEIVE_TOKEN"]).describe("Sui-like transaction type");
248
248
  z7.union([
249
249
  zBitcoinLikeTransactionType,
250
250
  zCardanoLikeTransactionType,
@@ -265,6 +265,18 @@ z7.discriminatedUnion("type", [
265
265
  gasLimit: zIntString,
266
266
  nonce: z7.string(),
267
267
  priorityFees: zIntString
268
+ }),
269
+ z7.object({
270
+ type: z7.literal("SUI_LIKE"),
271
+ fee: zIntString
272
+ }),
273
+ z7.object({
274
+ type: z7.literal("STELLAR_LIKE"),
275
+ fee: zIntString
276
+ }),
277
+ z7.object({
278
+ type: z7.literal("RIPPLE_LIKE"),
279
+ fee: zIntString
268
280
  })
269
281
  ]);
270
282
  var zMessageType = z7.enum(["EIP191", "EIP712"]);
@@ -545,7 +557,7 @@ var zSuiLikeSendData = zCommonTransactionData.extend({
545
557
  feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
546
558
  }).describe("Sui-like send data");
547
559
  var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
548
- type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_TRANSFER_TOKEN),
560
+ type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
549
561
  feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
550
562
  }).describe("Sui-like transfer token data");
551
563
  var zGenericTransactionData = z7.object({
@@ -682,6 +694,9 @@ var zSolanaLikeCoinFields = z7.object({
682
694
  var zStellarLikeCoinFields = z7.object({
683
695
  type: zStellarLikeTransactionType
684
696
  });
697
+ var zSuiLikeCoinFields = z7.object({
698
+ type: zSuiLikeTransactionType
699
+ });
685
700
  var zTezosLikeCoinFields = z7.object({
686
701
  type: zTezosLikeTransactionType
687
702
  });
@@ -709,6 +724,7 @@ var zRippleLikeTransactionResponse = zCommonTransactionResponse.merge(zRippleLik
709
724
  var zSolanaLikeTransactionResponse = zCommonTransactionResponse.merge(zSolanaLikeCoinFields).describe("Solana-like transaction");
710
725
  var zStellarLikeTransactionResponse = zCommonTransactionResponse.merge(zStellarLikeCoinFields).describe("Stellar-like transaction");
711
726
  var zTezosLikeTransactionResponse = zCommonTransactionResponse.merge(zTezosLikeCoinFields).describe("Tezos-like transaction");
727
+ var zSuiLikeTransactionResponse = zCommonTransactionResponse.merge(zSuiLikeCoinFields).describe("Sui-like transaction");
712
728
  var zTransactionResponse = z7.discriminatedUnion("type", [
713
729
  zBitcoinLikeTransactionResponse,
714
730
  zCardanoLikeTransactionResponse,
@@ -719,6 +735,7 @@ var zTransactionResponse = z7.discriminatedUnion("type", [
719
735
  zRippleLikeTransactionResponse,
720
736
  zSolanaLikeTransactionResponse,
721
737
  zStellarLikeTransactionResponse,
738
+ zSuiLikeTransactionResponse,
722
739
  zTezosLikeTransactionResponse
723
740
  ]);
724
741
  z7.discriminatedUnion(
@@ -742,7 +759,9 @@ var zEthereumLikeAssetFields = z.object({
742
759
  var zEthereumTokenLikeAssetFields = z.object({
743
760
  type: z.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE, AccountType.TRC20_LIKE]).describe("Account type"),
744
761
  address: z.string().describe("Account address").nullable(),
745
- contractAddress: z.string().describe("Token contract address")
762
+ contractAddress: z.string().describe(
763
+ "Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
764
+ ).optional()
746
765
  }).describe("Ethereum-like token");
747
766
  var zGenericLikeAssetFields = z.object({ type: z.literal(AccountType.GENERIC_LIKE).describe("Account type") }).describe("Generic-like");
748
767
  var zRawSigningAssetFields = z.object({ type: z.literal(AccountType.RAW_SIGNING).describe("Account type") }).describe("Raw signing account");
@@ -752,12 +771,14 @@ var zPolkadotLikeAssetFields = z.object({
752
771
  }).describe("Polkadot-like");
753
772
  var zRippleLikeAssetFields = z.object({
754
773
  type: z.literal(AccountType.RIPPLE_LIKE).describe("Account type"),
755
- xpub: z.string().describe("xpub (extended public key)")
774
+ address: z.string().describe("Account address").nullable()
756
775
  }).describe("Ripple-like");
757
776
  var zSolanaLikeAssetFields = z.object({
758
777
  type: z.literal(AccountType.SOLANA_LIKE).describe("Account type"),
759
778
  address: z.string().describe("Account address").nullable(),
760
- contractAddress: z.string().describe("Token contract address").nullable()
779
+ contractAddress: z.string().describe(
780
+ "Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
781
+ ).nullable().optional()
761
782
  }).describe("Solana-like");
762
783
  var zStellarLikeAssetFields = z.object({
763
784
  type: z.literal(AccountType.STELLAR_LIKE).describe("Account type"),
@@ -1125,6 +1146,7 @@ var zAccountCommonFields = z7.object({
1125
1146
  legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
1126
1147
  name: z7.string().describe("Name"),
1127
1148
  currency: zCurrency,
1149
+ contractAddress: z7.string().describe("Token contract address for Token account").nullable(),
1128
1150
  index: z7.number().gte(0).describe("BIP44 account index"),
1129
1151
  derivationPath: z7.string().describe("Derivation path"),
1130
1152
  status: z7.nativeEnum(ActivationStatus).describe("Status"),
@@ -1258,8 +1280,6 @@ var zEditPublicPolicyRequestData = z7.object({
1258
1280
  description: z7.string().nullable().describe("Description"),
1259
1281
  govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
1260
1282
  });
1261
-
1262
- // src/accounts/request-data.ts
1263
1283
  var zAccountName = z7.string().min(1).max(40).describe("Account name");
1264
1284
  var zSignDigestsGovRuleData = z7.object({
1265
1285
  operationType: z7.literal("SIGN_DIGESTS"),
@@ -1374,7 +1394,7 @@ var getAccountAssetStaticFields = (account) => {
1374
1394
  case AccountType.RIPPLE_LIKE:
1375
1395
  return {
1376
1396
  type: account.type,
1377
- xpub: account.xpub
1397
+ address: account.address
1378
1398
  };
1379
1399
  case AccountType.POLKADOT_LIKE:
1380
1400
  return {
@@ -1491,6 +1511,7 @@ var zCreateApiUserAccessRequestData = z7.object({
1491
1511
  z7.object({
1492
1512
  authUserId: z7.string().describe("Authentication broker ID")
1493
1513
  }).describe("Managed data for API user");
1514
+ var zRevokeUserRequestData = z7.object({});
1494
1515
  var zGroupName = z7.string().min(1).max(19).describe("Group name");
1495
1516
  var zCreateGroupRequestData = z7.object({
1496
1517
  name: zGroupName,
@@ -1581,7 +1602,8 @@ var zVaultRequestMixinsByType = {
1581
1602
  }),
1582
1603
  [RequestType.REVOKE_GROUP]: z7.object({
1583
1604
  type: z7.literal(RequestType.REVOKE_GROUP),
1584
- data: z7.object({})
1605
+ targetId: z7.string(),
1606
+ data: zRevokeUserRequestData
1585
1607
  }),
1586
1608
  // Whitelists
1587
1609
  [RequestType.CREATE_WHITELIST]: z7.object({
@@ -1621,7 +1643,8 @@ var zVaultRequestMixinsByType = {
1621
1643
  }),
1622
1644
  [RequestType.REVOKE_USER]: z7.object({
1623
1645
  type: z7.literal(RequestType.REVOKE_USER),
1624
- data: z7.object({})
1646
+ targetId: z7.string(),
1647
+ data: zRevokeUserRequestData
1625
1648
  }),
1626
1649
  // Admin gov rules
1627
1650
  [RequestType.CREATE_WORKSPACE_RULE]: z7.object({
@@ -1753,7 +1776,7 @@ var zVaultRequestCommonMixin = z7.object({
1753
1776
  createdById: z7.string().describe("ID of the user who created the request"),
1754
1777
  // `inflight` is fetched from ONGOING RequestSaga
1755
1778
  inflight: z7.object({
1756
- lastError: z7.string().describe("Error message from the last failure"),
1779
+ lastError: z7.string().nullable().describe("Error message from the last failure"),
1757
1780
  numFailed: z7.number().int().describe("Number of failures so far"),
1758
1781
  retryAfter: z7.coerce.date().describe("Date after which next retry is scheduled")
1759
1782
  }).optional().describe("Extra information if the request is currently being processed")
@@ -1790,7 +1813,8 @@ var allowedRequestCreationInputByType = {
1790
1813
  [RequestType.FORCE_UNPLEDGE]: zVaultRequestMixinsByType[RequestType.FORCE_UNPLEDGE],
1791
1814
  [RequestType.CREATE_SETTLEMENT]: zVaultRequestMixinsByType[RequestType.CREATE_SETTLEMENT],
1792
1815
  [RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
1793
- [RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE]
1816
+ [RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE],
1817
+ [RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER]
1794
1818
  };
1795
1819
  var zRequestCreationInputCommonMixin = z7.object({
1796
1820
  note: zNote.optional().describe("Optional request note")