@ledgerhq/revault-api 1.49.0 → 1.51.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.
@@ -93,12 +93,6 @@ declare const zTransactionData: z__default.ZodDiscriminatedUnion<[z__default.Zod
93
93
  currency: z__default.ZodString;
94
94
  recipient: z__default.ZodString;
95
95
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
96
- }, z__default.core.$strip>, z__default.ZodObject<{
97
- amount: z__default.ZodString;
98
- currency: z__default.ZodString;
99
- maxFee: z__default.ZodNullable<z__default.ZodString>;
100
- recipient: z__default.ZodString;
101
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
102
96
  }, z__default.core.$strip>, z__default.ZodObject<{
103
97
  amount: z__default.ZodString;
104
98
  currency: z__default.ZodString;
@@ -683,7 +677,6 @@ declare const zTransactionResponse: z__default.ZodDiscriminatedUnion<[z__default
683
677
  CANTON_LIKE_WITHDRAW: "CANTON_LIKE_WITHDRAW";
684
678
  CANTON_LIKE_RECEIVE: "CANTON_LIKE_RECEIVE";
685
679
  CANTON_LIKE_PRE_APPROVAL: "CANTON_LIKE_PRE_APPROVAL";
686
- CANTON_LIKE_TAP: "CANTON_LIKE_TAP";
687
680
  }>;
688
681
  reason: z__default.ZodNullable<z__default.ZodString>;
689
682
  }, z__default.core.$strip>, z__default.ZodObject<{
@@ -798,6 +791,7 @@ declare const zTransactionResponse: z__default.ZodDiscriminatedUnion<[z__default
798
791
  HEDERA_LIKE_SEND_TOKEN: "HEDERA_LIKE_SEND_TOKEN";
799
792
  HEDERA_LIKE_RECEIVE_TOKEN: "HEDERA_LIKE_RECEIVE_TOKEN";
800
793
  HEDERA_LIKE_STAKE: "HEDERA_LIKE_STAKE";
794
+ HEDERA_LIKE_UNSTAKE: "HEDERA_LIKE_UNSTAKE";
801
795
  }>;
802
796
  }, z__default.core.$strip>, z__default.ZodObject<{
803
797
  id: z__default.ZodString;
@@ -1495,6 +1489,11 @@ declare const zChallenge: z.ZodDiscriminatedUnion<[z.ZodObject<{
1495
1489
  challengeType: z.ZodLiteral<"SOFT">;
1496
1490
  }, z.core.$strip>], "challengeType">;
1497
1491
  type Challenge = z.infer<typeof zChallenge>;
1492
+ declare const zEnsureNameAvailableOutput: z.ZodObject<{
1493
+ available: z.ZodBoolean;
1494
+ reason: z.ZodOptional<z.ZodString>;
1495
+ }, z.core.$strip>;
1496
+ type EnsureNameAvailableOutput = z.infer<typeof zEnsureNameAvailableOutput>;
1498
1497
 
1499
1498
  declare const zVaultRequestCreateInput: z__default.ZodObject<{
1500
1499
  request: z__default.ZodDiscriminatedUnion<[z__default.ZodObject<{
@@ -2244,12 +2243,6 @@ declare const zVaultRequestCreateInput: z__default.ZodObject<{
2244
2243
  currency: z__default.ZodString;
2245
2244
  recipient: z__default.ZodString;
2246
2245
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
2247
- }, z__default.core.$strip>, z__default.ZodObject<{
2248
- amount: z__default.ZodString;
2249
- currency: z__default.ZodString;
2250
- maxFee: z__default.ZodNullable<z__default.ZodString>;
2251
- recipient: z__default.ZodString;
2252
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
2253
2246
  }, z__default.core.$strip>, z__default.ZodObject<{
2254
2247
  amount: z__default.ZodString;
2255
2248
  currency: z__default.ZodString;
@@ -3918,12 +3911,6 @@ declare const zVaultRequestCreateInput: z__default.ZodObject<{
3918
3911
  currency: z__default.ZodString;
3919
3912
  recipient: z__default.ZodString;
3920
3913
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
3921
- }, z__default.core.$strip>, z__default.ZodObject<{
3922
- amount: z__default.ZodString;
3923
- currency: z__default.ZodString;
3924
- maxFee: z__default.ZodNullable<z__default.ZodString>;
3925
- recipient: z__default.ZodString;
3926
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
3927
3914
  }, z__default.core.$strip>, z__default.ZodObject<{
3928
3915
  amount: z__default.ZodString;
3929
3916
  currency: z__default.ZodString;
@@ -6193,12 +6180,6 @@ declare const zVaultRequestResponse: z__default.ZodDiscriminatedUnion<[z__defaul
6193
6180
  currency: z__default.ZodString;
6194
6181
  recipient: z__default.ZodString;
6195
6182
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
6196
- }, z__default.core.$strip>, z__default.ZodObject<{
6197
- amount: z__default.ZodString;
6198
- currency: z__default.ZodString;
6199
- maxFee: z__default.ZodNullable<z__default.ZodString>;
6200
- recipient: z__default.ZodString;
6201
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
6202
6183
  }, z__default.core.$strip>, z__default.ZodObject<{
6203
6184
  amount: z__default.ZodString;
6204
6185
  currency: z__default.ZodString;
@@ -9696,12 +9677,6 @@ declare const zVaultRequestResponse: z__default.ZodDiscriminatedUnion<[z__defaul
9696
9677
  currency: z__default.ZodString;
9697
9678
  recipient: z__default.ZodString;
9698
9679
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
9699
- }, z__default.core.$strip>, z__default.ZodObject<{
9700
- amount: z__default.ZodString;
9701
- currency: z__default.ZodString;
9702
- maxFee: z__default.ZodNullable<z__default.ZodString>;
9703
- recipient: z__default.ZodString;
9704
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
9705
9680
  }, z__default.core.$strip>, z__default.ZodObject<{
9706
9681
  amount: z__default.ZodString;
9707
9682
  currency: z__default.ZodString;
@@ -11970,6 +11945,17 @@ type ApproveVaultRequestInput = z__default.infer<typeof zApproveVaultRequestInpu
11970
11945
  declare const zRequestTaskResponse: z__default.ZodObject<{
11971
11946
  taskId: z__default.ZodString;
11972
11947
  }, z__default.core.$strip>;
11948
+ declare const zEnsureNameAvailableInput: z__default.ZodObject<{
11949
+ objectType: z__default.ZodEnum<{
11950
+ Account: "Account";
11951
+ Group: "Group";
11952
+ Policy: "Policy";
11953
+ Whitelist: "Whitelist";
11954
+ }>;
11955
+ name: z__default.ZodString;
11956
+ excludeId: z__default.ZodOptional<z__default.ZodString>;
11957
+ }, z__default.core.$strip>;
11958
+ type EnsureNameAvailableInput = z__default.infer<typeof zEnsureNameAvailableInput>;
11973
11959
 
11974
11960
  declare const zUserResponse: z__default.ZodObject<{
11975
11961
  id: z__default.ZodString;
@@ -12063,4 +12049,4 @@ declare const zWhitelistSortBy: z__default.ZodDefault<z__default.ZodEnum<{
12063
12049
  }>>;
12064
12050
  type WhitelistSortBy = z__default.infer<typeof zWhitelistSortBy>;
12065
12051
 
12066
- export { type AssetResponse as A, zChallengeResponse as B, type CurrencyResponse as C, type ChallengeResponse as D, genTransactionSchemas as E, zApproveVaultRequestInput as F, type GroupResponse as G, type ApproveVaultRequestInput as H, zRequestTaskResponse as I, type Challenge as J, zUserResponse as K, zAdminResponse as L, type AdminResponse as M, zUserSortBy as N, type UserSortBy as O, zWhitelistAddressResponse as P, zWhitelistResponse as Q, type RequestSortBy as R, type SoftChallenge as S, type TransactionResponse as T, type UserResponse as U, type VaultRequestCreateInput as V, type WhitelistResponse as W, zWhitelistSortBy as X, type WhitelistSortBy as Y, type TransactionData as Z, type AccountFreshAddress as a, type AccountLiveDataResponse as b, type AccountResponse as c, type AccountSortBy as d, zAccountLiveDataResponse as e, zAccountResponse as f, zAccountSortBy as g, zBalance as h, zStake as i, zStakeSortBy as j, zStakingValidator as k, zStakingValidatorSortBy as l, zEstimatedFees as m, type TokenResponse as n, zAssetCapabilitiesResponse as o, zAssetResponse as p, zCurrencyResponse as q, zTokenResponse as r, zGroupResponse as s, zGroupSortBy as t, type GroupSortBy as u, zVaultRequestCreateInput as v, zVaultRequestResponse as w, type VaultRequestResponse as x, zRequestSortBy as y, zAccountFreshAddress as z };
12052
+ export { zWhitelistSortBy as $, type AssetResponse as A, zChallengeResponse as B, type CurrencyResponse as C, type ChallengeResponse as D, genTransactionSchemas as E, zApproveVaultRequestInput as F, type GroupResponse as G, type ApproveVaultRequestInput as H, zRequestTaskResponse as I, zEnsureNameAvailableInput as J, type EnsureNameAvailableInput as K, type Challenge as L, type EnsureNameAvailableOutput as M, zEnsureNameAvailableOutput as N, zUserResponse as O, zAdminResponse as P, type AdminResponse as Q, type RequestSortBy as R, type SoftChallenge as S, type TransactionResponse as T, type UserResponse as U, type VaultRequestCreateInput as V, zUserSortBy as W, type UserSortBy as X, zWhitelistAddressResponse as Y, zWhitelistResponse as Z, type WhitelistResponse as _, type AccountFreshAddress as a, type WhitelistSortBy as a0, type TransactionData as a1, type AccountLiveDataResponse as b, type AccountResponse as c, type AccountSortBy as d, zAccountLiveDataResponse as e, zAccountResponse as f, zAccountSortBy as g, zBalance as h, zStake as i, zStakeSortBy as j, zStakingValidator as k, zStakingValidatorSortBy as l, zEstimatedFees as m, type TokenResponse as n, zAssetCapabilitiesResponse as o, zAssetResponse as p, zCurrencyResponse as q, zTokenResponse as r, zGroupResponse as s, zGroupSortBy as t, type GroupSortBy as u, zVaultRequestCreateInput as v, zVaultRequestResponse as w, type VaultRequestResponse as x, zRequestSortBy as y, zAccountFreshAddress as z };
package/lib/fakes.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AssetResponse, Z as TransactionData, J as Challenge, c as AccountResponse, G as GroupResponse, U as UserResponse, x as VaultRequestResponse, W as WhitelistResponse } from './app-types-CPQeirCC.mjs';
1
+ import { A as AssetResponse, a1 as TransactionData, L as Challenge, c as AccountResponse, G as GroupResponse, U as UserResponse, x as VaultRequestResponse, _ as WhitelistResponse } from './app-types-C_8ozawx.mjs';
2
2
  import { Group, User, RequestType, VaultRequestReview, VaultRequest, Account, Whitelist } from '@prisma/client';
3
3
  import z__default from 'zod';
4
4
 
@@ -72,12 +72,6 @@ declare const zCreateTransactionRequestData: z__default.ZodObject<{
72
72
  currency: z__default.ZodString;
73
73
  recipient: z__default.ZodString;
74
74
  type: z__default.ZodLiteral<"CANTON_LIKE_PRE_APPROVAL">;
75
- }, z__default.core.$strip>, z__default.ZodObject<{
76
- amount: z__default.ZodString;
77
- currency: z__default.ZodString;
78
- maxFee: z__default.ZodNullable<z__default.ZodString>;
79
- recipient: z__default.ZodString;
80
- type: z__default.ZodLiteral<"CANTON_LIKE_TAP">;
81
75
  }, z__default.core.$strip>, z__default.ZodObject<{
82
76
  amount: z__default.ZodString;
83
77
  currency: z__default.ZodString;
package/lib/fakes.mjs CHANGED
@@ -147,8 +147,7 @@ var zCantonLikeTransactionType = z14.enum([
147
147
  "CANTON_LIKE_SEND_TOKEN",
148
148
  "CANTON_LIKE_WITHDRAW",
149
149
  "CANTON_LIKE_RECEIVE",
150
- "CANTON_LIKE_PRE_APPROVAL",
151
- "CANTON_LIKE_TAP"
150
+ "CANTON_LIKE_PRE_APPROVAL"
152
151
  ]).meta({ description: "Canton-like transaction type" });
153
152
  var zExecuteBeforeSeconds = z14.number().int().positive().optional().meta({ description: "Execute before seconds" });
154
153
  var zCantonReason = z14.string().nullable().meta({ description: "Optional reason attached to the onchain operation" });
@@ -206,19 +205,12 @@ var zCantonLikePreApprovalData = z14.object({
206
205
  description: "Canton-like pre-approval data",
207
206
  id: "CantonLikePreApprovalData"
208
207
  });
209
- var zCantonLikeTapData = zCommonTransactionData.extend({
210
- type: z14.literal(zCantonLikeTransactionType.enum.CANTON_LIKE_TAP)
211
- }).meta({
212
- description: "Canton-like tap data",
213
- id: "CantonLikeTapData"
214
- });
215
208
  var zCantonLikeTransactionData = z14.discriminatedUnion("type", [
216
209
  zCantonLikeSendData,
217
210
  zCantonLikeSendTokenData,
218
211
  zCantonLikeWithdrawData,
219
212
  zCantonLikeReceiveData,
220
- zCantonLikePreApprovalData,
221
- zCantonLikeTapData
213
+ zCantonLikePreApprovalData
222
214
  ]);
223
215
  var zCantonLikeTransactionResponse = z14.discriminatedUnion("type", [
224
216
  zCommonTransactionResponse.extend({ type: zCantonLikeTransactionType, reason: zCantonReason }).meta({ description: "Canton-like transaction" })
@@ -508,7 +500,8 @@ var zHederaLikeTransactionType = z14.enum([
508
500
  "HEDERA_LIKE_RECEIVE",
509
501
  "HEDERA_LIKE_SEND_TOKEN",
510
502
  "HEDERA_LIKE_RECEIVE_TOKEN",
511
- "HEDERA_LIKE_STAKE"
503
+ "HEDERA_LIKE_STAKE",
504
+ "HEDERA_LIKE_UNSTAKE"
512
505
  ]).meta({ description: "Hedera-like transaction type" });
513
506
  var zHederaLikeStakingData = z14.object({
514
507
  totalStaked: z14.string().meta({ description: "Total staked amount" }),
@@ -2110,14 +2103,6 @@ var genCantonLikeTxData = (txType) => {
2110
2103
  currency: "canton_network",
2111
2104
  recipient: fakeCantonPartyId()
2112
2105
  };
2113
- case "CANTON_LIKE_TAP":
2114
- return {
2115
- type: txType,
2116
- currency: "canton_network",
2117
- amount: faker.number.bigInt({ min: 0 }).toString(),
2118
- maxFee: null,
2119
- recipient: fakeCantonPartyId()
2120
- };
2121
2106
  }
2122
2107
  };
2123
2108
  var mergeTransactionData = (defaults, custom) => {
@@ -2142,7 +2127,6 @@ var genCreateTransactionData = (opts) => {
2142
2127
  case "CANTON_LIKE_WITHDRAW":
2143
2128
  case "CANTON_LIKE_RECEIVE":
2144
2129
  case "CANTON_LIKE_PRE_APPROVAL":
2145
- case "CANTON_LIKE_TAP":
2146
2130
  transactionDefaults = genCantonLikeTxData(transactionType);
2147
2131
  break;
2148
2132
  case "CARDANO_LIKE_SEND":
@@ -2274,7 +2258,6 @@ var shouldHaveTargetId = (type) => {
2274
2258
  case RequestType.REVOKE_API_KEY:
2275
2259
  return false;
2276
2260
  case RequestType.CREATE_TRANSACTION:
2277
- // TODO: Check how to wire!
2278
2261
  case RequestType.SIGN_DIGESTS:
2279
2262
  case RequestType.UPDATE_QUORUM:
2280
2263
  case RequestType.CREATE_PSD_USER:
@@ -3865,14 +3848,10 @@ var zRequestReviewStep = z.object({
3865
3848
  quorum: z.int().min(1).meta({ description: "Quorum for the review step" })
3866
3849
  });
3867
3850
  var zRequestReviewSteps = z.array(zRequestReviewStep);
3868
- var zEntityName = z14.string().min(1).max(19).meta({ description: "Entity name" });
3869
- var zCreateEntityRequestData = z14.object({
3870
- name: zEntityName,
3871
- accountIds: z14.array(z14.string()).meta({ description: "List of Account IDs" }),
3872
- memberIds: z14.array(z14.string()).meta({ description: "List of User IDs" })
3851
+ z.object({
3852
+ available: z.boolean().meta({ description: "Whether the name is available" }),
3853
+ reason: z.string().optional().meta({ description: "Reason the name is unavailable" })
3873
3854
  });
3874
- var zEditEntityRequestData = zCreateEntityRequestData;
3875
- var zRevokeEntityRequestData = z14.object({});
3876
3855
  var zGroupName = z14.string().min(1).max(19).meta({ description: "Group name" });
3877
3856
  var zCreateGroupRequestData = z14.object({
3878
3857
  name: zGroupName,
@@ -3884,6 +3863,14 @@ var zEditGroupRequestData = z14.object({
3884
3863
  description: z14.string().nullable().meta({ description: "Group description" }),
3885
3864
  members: z14.array(z14.string()).meta({ description: "List of group members ids" })
3886
3865
  });
3866
+ var zEntityName = z14.string().min(1).max(19).meta({ description: "Entity name" });
3867
+ var zCreateEntityRequestData = z14.object({
3868
+ name: zEntityName,
3869
+ accountIds: z14.array(z14.string()).meta({ description: "List of Account IDs" }),
3870
+ memberIds: z14.array(z14.string()).meta({ description: "List of User IDs" })
3871
+ });
3872
+ var zEditEntityRequestData = zCreateEntityRequestData;
3873
+ var zRevokeEntityRequestData = z14.object({});
3887
3874
  var zApiKeyName = z14.string().min(1).max(19).meta({ description: "API key name" });
3888
3875
  var zCreateApiKeyRequestData = z14.object({
3889
3876
  name: zApiKeyName,
@@ -4157,6 +4144,12 @@ z14.object({
4157
4144
  z14.object({
4158
4145
  taskId: z14.string().meta({ description: "Task ID" })
4159
4146
  });
4147
+ var zObjectType = z14.enum(["Account", "Group", "Whitelist", "Policy"]);
4148
+ z14.object({
4149
+ objectType: zObjectType.meta({ description: "Type of object to check name for" }),
4150
+ name: z14.string().min(1).meta({ description: "Name to check availability for" }),
4151
+ excludeId: z14.string().optional().meta({ description: "Optional ID to exclude (for edit scenarios)" })
4152
+ });
4160
4153
 
4161
4154
  // src/requests/app-utils/index.ts
4162
4155
  function serializeVaultRequest(request) {