@ledgerhq/revault-api 1.37.1 → 1.39.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.mjs CHANGED
@@ -1,34 +1,36 @@
1
+ import { __export } from './chunk-J5LGTIGS.mjs';
1
2
  import { faker } from '@faker-js/faker';
2
- import { ChallengeType, PsdModel, AccountType, AccountGovernanceType, ActivationStatus, WhitelistType, UserRole, UserRegistrationState, AdminPermission, RequestType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
3
- import z7, { z } from 'zod';
3
+ import { AllowedAction, AccountType, ChallengeType, PsdModel, UserRole, UserRegistrationState, AdminPermission, RequestType, MessageType, AccountGovernanceType, ActivationStatus, WhitelistType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
4
+ import z10, { z } from 'zod';
4
5
  import 'axios';
5
6
  import invariant from 'invariant';
6
7
  import { omit, times, get, isPlainObject } from 'lodash';
7
- import { randomUUID } from 'crypto';
8
8
 
9
- var __defProp = Object.defineProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
9
  var zHexString = z.string().regex(/^[0-9a-fA-F]+$/);
15
10
  var zIntString = z.string().nonempty().regex(/^(-?[1-9]\d*|0)$/);
16
11
  var zUnsignedIntString = z.string().nonempty().regex(/^([1-9]\d*|0)$/);
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)");
12
+ var zCurrencyString = z.string().nonempty().max(40).regex(/^\w+$/).meta({ description: "Will be deprecated soon, use network instead. Currency" });
13
+ var zNetwork = z.string().nonempty().max(40).regex(/^\w+$/).meta({ description: "Network (Same as currency for now)" });
19
14
  var zCurrency = z.object({
20
15
  network: zNetwork,
21
- contractAddress: z.string().nonempty().nullable().describe("Token contract address")
16
+ contractAddress: z.string().nonempty().nullable().meta({ description: "Token contract address" })
17
+ });
18
+ z.string().regex(/^[\w-]+$/).nonempty();
19
+ var zHsmObjectId = z.string().regex(/^[\w-]+$/).nonempty();
20
+ z.codec(z.iso.datetime(), z.date(), {
21
+ decode: (isoString) => new Date(isoString),
22
+ // ISO string → Date
23
+ encode: (date) => date.toISOString()
24
+ // Date → ISO string
22
25
  });
23
- var zHsmObjectId = z.string().regex(/^[\w-]+$/).min(1);
24
26
 
25
27
  // src/types/operation.ts
26
28
  var zValueTransactionOperationType = z.enum([
27
- "SEND",
28
- "STAKE",
29
- "DEPLOY_CONTRACT",
30
- "EXECUTE_CONTRACT",
31
- "ACTIVATE_TOKEN"
29
+ AllowedAction.SEND,
30
+ AllowedAction.STAKE,
31
+ AllowedAction.DEPLOY_CONTRACT,
32
+ AllowedAction.EXECUTE_CONTRACT,
33
+ AllowedAction.ACTIVATE_TOKEN
32
34
  ]);
33
35
  var zValueTransactionOperation = z.object({
34
36
  type: zValueTransactionOperationType,
@@ -37,19 +39,19 @@ var zValueTransactionOperation = z.object({
37
39
  destinationTag: z.string().nonempty().optional(),
38
40
  value: zUnsignedIntString
39
41
  });
40
- var zSigningOperationType = z.enum(["SIGN_MESSAGE", "SIGN_DIGESTS"]);
42
+ var zSigningOperationType = z.enum([AllowedAction.SIGN_MESSAGE, AllowedAction.SIGN_DIGESTS]);
41
43
  var zSigningOperation = z.object({
42
44
  type: zSigningOperationType
43
45
  });
44
46
  var zClassicOperationType = z.enum([
45
- "SEND",
46
- "STAKE",
47
- "DEPLOY_CONTRACT",
48
- "EXECUTE_CONTRACT",
49
- "SIGN_MESSAGE",
50
- "ACTIVATE_TOKEN"
47
+ AllowedAction.SEND,
48
+ AllowedAction.STAKE,
49
+ AllowedAction.DEPLOY_CONTRACT,
50
+ AllowedAction.EXECUTE_CONTRACT,
51
+ AllowedAction.SIGN_MESSAGE,
52
+ AllowedAction.ACTIVATE_TOKEN
51
53
  ]);
52
- z.enum(["SIGN_DIGESTS"]);
54
+ z.enum([AllowedAction.SIGN_DIGESTS]);
53
55
  var zOperationType = z.enum([
54
56
  ...zValueTransactionOperationType.options,
55
57
  ...zSigningOperationType.options
@@ -58,9 +60,9 @@ z.discriminatedUnion("type", [
58
60
  zValueTransactionOperation,
59
61
  zSigningOperation
60
62
  ]);
61
- var zNote = z7.object({
62
- title: z7.string().describe("Note title"),
63
- content: z7.string().describe("Note content")
63
+ var zNote = z10.object({
64
+ title: z10.string().meta({ description: "Note title" }),
65
+ content: z10.string().meta({ description: "Note content" })
64
66
  });
65
67
 
66
68
  // src/errors.ts
@@ -88,123 +90,309 @@ var ensureNonEmptyArray = (values, message) => {
88
90
  function unreachable(value) {
89
91
  throw new Error(`Un-covered: ${value}`);
90
92
  }
91
- var zPubKey = zHexString.describe("Public key");
92
- var zHsmCertificate = z.object({
93
- codeHash: z.string().base64().describe("Hash of the executable that generated this certificate"),
94
- attestationPub: z.string().base64().describe("Attestation public key"),
95
- certificate: z.string().base64().describe("Certificate bytes"),
96
- signature: z.string().base64().describe("Certificate signature")
93
+ var NetworkFamily = omit(AccountType, ["RAW_SIGNING"]);
94
+ var zHexDataString = z10.codec(z10.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/), z10.string(), {
95
+ decode: (hex) => `0x${hex.toLowerCase().replace("0x", "")}`,
96
+ encode: (hex) => hex
97
+ });
98
+ var zCommonLiveData = z10.object({
99
+ id: z10.string().meta({ description: "Account internal unique identifier" }),
100
+ balance: z10.object({
101
+ total: z10.string().meta({ description: "Total balance" }),
102
+ pending: z10.string().meta({ description: "Pending balance" })
103
+ }).meta({ description: "Balance fields" })
104
+ });
105
+ var zCommonTransactionData = z10.object({
106
+ amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
107
+ currency: zCurrencyString.meta({
108
+ description: "Will be deprecated soon, use Account.network. Transaction currency"
109
+ }),
110
+ // TODO: to remove, use account.network instead
111
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
112
+ recipient: z10.string().nonempty().meta({ description: "Transaction recipient" })
113
+ });
114
+ var zFeeStrategyCustom = z10.object({
115
+ type: z10.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
116
+ });
117
+ var zFeeStrategy = z10.object({
118
+ type: z10.enum(["SLOW", "NORMAL", "FAST"])
119
+ });
120
+ var zTransactionStatus = z10.enum(["SUCCESSFUL", "FAILED"]);
121
+ var zCommonTransactionResponse = z10.object({
122
+ id: z10.string().meta({ description: "Internal unique identifier" }),
123
+ hash: z10.string().meta({ description: "Transaction hash" }),
124
+ block: z10.object({
125
+ height: z10.string().nullable().meta({ description: "Transaction block height" }),
126
+ time: z10.string().nullable().meta({ description: "Transaction block time" })
127
+ }),
128
+ status: zTransactionStatus.meta({ description: "Transaction status" }),
129
+ confirmations: z10.string().meta({ description: "Block confirmations" }),
130
+ amount: z10.string().meta({ description: "Transaction amount" }),
131
+ fee: z10.string().meta({ description: "Transaction fee" }),
132
+ senders: z10.array(z10.string()).meta({ description: "Senders (can be multiple for UTXOs-based accounts)" }),
133
+ recipients: z10.array(z10.string()).meta({ description: "Recipients (can be multiple for multi-output transactions)" })
97
134
  });
98
- var zBlob = z.string();
99
- var zPsdChallenge = z.object({
100
- challengeType: z.literal(ChallengeType.PSD),
101
- wActions: z.array(z.string()).describe("Wrapped blobs that describe the screens to display"),
102
- handshake: z.string().describe("Handshake for the HSM <-> PSD communication"),
103
- handshakeAttestation: zHsmCertificate.describe(
104
- "Handshake attestation to verify secure channel between HSM & PSD"
105
- ),
106
- partitionId: z.string().describe("HSM partition id (maybe not useful)")
135
+
136
+ // src/networks/bitcoin.ts
137
+ var zBitcoinLikeAssetFields = z10.object({
138
+ type: z10.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" }),
139
+ xpub: z10.string().meta({ description: "xpub (extended public key)" })
140
+ }).meta({ description: "Bitcoin-like" });
141
+ var zBitcoinLikeLiveData = zCommonLiveData.extend({
142
+ type: z10.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" })
143
+ }).meta({ description: "Bitcoin-like" });
144
+ var zBitcoinLikeTransactionType = z10.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).meta({ description: "Bitcoin-like transaction type" });
145
+ var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
146
+ // nullish is optional + nullable, it is easier to seed rather than just optional
147
+ feePerByte: zUnsignedIntString.nullish().meta({ description: "Fee per byte" })
148
+ }).meta({ description: "Bitcoin-like fee strategy" });
149
+ var zBitcoinLikeSendData = zCommonTransactionData.extend({
150
+ type: z10.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
151
+ feeStrategy: zBitcoinLikeFeeStrategy
152
+ }).meta({
153
+ description: "Bitcoin-like send data",
154
+ id: "BitcoinLikeSendData"
155
+ });
156
+ var zBitcoinLikeTransactionData = z10.discriminatedUnion("type", [zBitcoinLikeSendData]);
157
+ var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zBitcoinLikeTransactionType }).meta({ description: "Bitcoin-like transaction" });
158
+ var zCardanoLikeAssetFields = z10.object({
159
+ type: z10.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
160
+ address: z10.string().nullable().meta({ description: "Account address" })
161
+ }).meta({ description: "Cardano-like" });
162
+ var zCardanoLikeStakingData = z10.object({
163
+ staked: z10.string().meta({ description: "Staked balance" })
164
+ }).nullable().meta({ description: "Cardano-like staking data" });
165
+ var zCardanoLikeStakingFields = z10.object({
166
+ type: z10.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
167
+ staking: zCardanoLikeStakingData.optional()
107
168
  });
108
- var zApiChallenge = z.object({
109
- challengeType: z.literal(ChallengeType.API),
110
- payload: z.object({
111
- approve: z.string().describe("JSON payload to sign (as JWS) to approve"),
112
- reject: z.string().describe("JSON payload to sign (as JWS) to reject")
113
- }).describe("JSON payload to approve and to reject")
169
+ var zCardanoLikeLiveData = zCommonLiveData.extend(zCardanoLikeStakingFields.shape).meta({ description: "Cardano-like" });
170
+ var zCardanoLikeTransactionType = z10.enum([
171
+ "CARDANO_LIKE_SEND",
172
+ "CARDANO_LIKE_RECEIVE",
173
+ "CARDANO_LIKE_STAKING_REGISTER",
174
+ "CARDANO_LIKE_STAKING_DEREGISTER",
175
+ "CARDANO_LIKE_STAKING_DELEGATE",
176
+ "CARDANO_LIKE_STAKING_WITHDRAW"
177
+ ]).meta({ description: "Cardano-like transaction type" });
178
+ var zCardanoLikeSendData = zCommonTransactionData.extend({
179
+ type: z10.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
180
+ feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" })
181
+ }).meta({
182
+ description: "Cardano-like send data",
183
+ id: "CardanoSendData"
184
+ });
185
+ var zCardanoStakingDelegateData = z10.object({
186
+ type: z10.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
187
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
188
+ // TODO: strict literal or enum?
189
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
190
+ feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
191
+ // DELEGATE doesn't have neither amount nor recipient
192
+ stakePoolId: z10.string().min(1).max(100).meta({ description: "" })
193
+ }).meta({
194
+ description: "Cardano-like staking delegate",
195
+ id: "CardanoStakingDelegateData"
196
+ });
197
+ var zCardanoStakingDeregisterData = z10.object({
198
+ type: z10.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
199
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
200
+ // TODO: strict literal or enum?
201
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
202
+ feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
203
+ // DEREGISTER doesn't have a recipient
204
+ amount: zUnsignedIntString.meta({ description: "Amount to deregister" })
205
+ }).meta({
206
+ description: "Cardano-like staking deregister data",
207
+ id: "CardanoStakingDeregisterData"
208
+ });
209
+ var zCardanoStakingRegisterData = z10.object({
210
+ type: z10.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
211
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
212
+ // TODO: strict literal or enum?
213
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
214
+ feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
215
+ // REGISTER doesn't have a recipient
216
+ amount: zUnsignedIntString.meta({ description: "Amount to register" })
217
+ }).meta({
218
+ description: "Cardano-like staking register data",
219
+ id: "CardanoStakingRegisterData"
220
+ });
221
+ var zCardanoStakingWithdrawData = z10.object({
222
+ type: z10.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
223
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
224
+ // TODO: strict literal or enum?
225
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
226
+ feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
227
+ // WITHDRAW doesn't have a recipient
228
+ amount: zUnsignedIntString.meta({ description: "Amount to withdraw" })
229
+ }).meta({
230
+ description: "Cardano-like staking withdraw data",
231
+ id: "CardanoStakingWithdrawData"
114
232
  });
115
- var zUserChallenge = z.discriminatedUnion("challengeType", [
116
- zPsdChallenge.describe("Necessary data to approve on a PSD"),
117
- zApiChallenge.describe("Necessary data for approval by an API user")
233
+ var zCardanoLikeTransactionData = z10.discriminatedUnion("type", [
234
+ zCardanoLikeSendData,
235
+ zCardanoStakingDelegateData,
236
+ zCardanoStakingDeregisterData,
237
+ zCardanoStakingRegisterData,
238
+ zCardanoStakingWithdrawData
118
239
  ]);
119
- var zHsmChallengeGroup = z.record(zPubKey, zUserChallenge);
120
- var zHsmChallengeSteps = z.array(zHsmChallengeGroup);
121
- var zPsdSignature = z.string().min(1).describe("Signature from PSD");
122
- var zApiSignature = z.string().min(1).describe("Signature from API (JWS)");
123
- var zUserApproval = z.discriminatedUnion("challengeType", [
124
- z.object({
125
- challengeType: z.literal(ChallengeType.PSD),
126
- signature: zPsdSignature
127
- }),
128
- z.object({
129
- challengeType: z.literal(ChallengeType.API),
130
- signature: zApiSignature
131
- })
240
+ var zCardanoLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zCardanoLikeTransactionType }).meta({ description: "Cardano-like transaction" });
241
+ var zEthereumLikeAssetFields = z10.object({
242
+ type: z10.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
243
+ address: z10.string().nullable().meta({ description: "Account address" })
244
+ }).meta({ description: "Ethereum-like" });
245
+ var zEthereumTokenLikeAssetFields = z10.object({
246
+ type: z10.enum([NetworkFamily.ERC20_LIKE, NetworkFamily.BEP20_LIKE]).meta({ description: "Account type" }),
247
+ address: z10.string().nullable().meta({ description: "Account address" }),
248
+ contractAddress: z10.string().meta({
249
+ description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
250
+ }).optional()
251
+ }).meta({ description: "Ethereum-like token" });
252
+ var zEthereumLikeStakingData = z10.object({
253
+ totalStaking: z10.string().meta({ description: "Total staked amount" }),
254
+ totalRewards: z10.string().meta({ description: "Total of rewards" }),
255
+ availableRewards: z10.string().meta({ description: "Available rewards" }),
256
+ networkApy: z10.number().meta({ description: "Network APY" })
257
+ }).nullable().meta({ description: "Ethereum-like staking data" });
258
+ var zEthereumLikeStakingFields = z10.object({
259
+ type: z10.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
260
+ staking: zEthereumLikeStakingData.optional()
261
+ });
262
+ var zEthereumLikeLiveData = zCommonLiveData.extend(zEthereumLikeStakingFields.shape).meta({ description: "Ethereum-like" });
263
+ var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
264
+ type: z10.enum([NetworkFamily.ERC20_LIKE, NetworkFamily.BEP20_LIKE]).meta({ description: "Account type" })
265
+ }).meta({ description: "Ethereum-like token" });
266
+ var zEthereumLikeEstimatedFees = z10.object({
267
+ type: z10.literal(NetworkFamily.ETHEREUM_LIKE),
268
+ baseFees: zIntString,
269
+ gasLimit: zIntString,
270
+ nonce: z10.string(),
271
+ priorityFees: zIntString
272
+ }).meta({ description: "Ethereum-like fees" });
273
+ var zEthereumLikeTransferTransactionType = z10.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).meta({ description: "Ethereum-like transaction type" });
274
+ var zEthereumLikeContractTransactionType = z10.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).meta({ description: "Ethereum-like transaction type" });
275
+ var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
276
+ gasPrice: zUnsignedIntString.meta({ description: "Gas price" }),
277
+ gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
278
+ }).meta({ description: "Ethereum-like legacy fee strategy" });
279
+ var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
280
+ maxPriorityFeePerGas: zUnsignedIntString.meta({ description: "Maximum priority fee per gas" }),
281
+ maxFeePerGas: zUnsignedIntString.meta({ description: "Maximum fee per gas (base + priority)" }),
282
+ gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
283
+ }).meta({ description: "Ethereum-like EIP-1559 fee strategy" });
284
+ var zEthereumLikeFeeStrategy = z10.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).meta({
285
+ description: "Ethereum-like fee strategy",
286
+ id: "EthereumLikeFeeStrategy"
287
+ });
288
+ var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
289
+ type: z10.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
290
+ // force the recipient to be the zero address
291
+ recipient: z10.literal("0x0000000000000000000000000000000000000000"),
292
+ contractData: zHexDataString.meta({ description: "Contract data in hexadecimal format" }),
293
+ feeStrategy: zEthereumLikeFeeStrategy
294
+ }).meta({
295
+ description: "Ethereum-like deploy contract data",
296
+ id: "EthereumLikeDeployContractData"
297
+ });
298
+ var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
299
+ type: z10.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
300
+ contractData: zHexDataString.meta({ description: "Contract call data in hexadecimal format" }),
301
+ feeStrategy: zEthereumLikeFeeStrategy
302
+ }).meta({
303
+ description: "Ethereum-like execute contract data",
304
+ id: "EthereumLikeExecuteContractData"
305
+ });
306
+ var zEthereumLikeSendData = zCommonTransactionData.extend({
307
+ type: z10.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
308
+ feeStrategy: zEthereumLikeFeeStrategy
309
+ }).meta({
310
+ description: "Ethereum-like send data",
311
+ id: "EthereumLikeSendData"
312
+ });
313
+ var zEthereumLikeTransactionData = z10.discriminatedUnion("type", [
314
+ zEthereumLikeDeployContractData,
315
+ zEthereumLikeExecuteContractData,
316
+ zEthereumLikeSendData
132
317
  ]);
133
- var zHsmApprovalGroup = z.record(zPubKey, zUserApproval);
134
- z.array(zHsmApprovalGroup);
135
- z.object({
136
- stageName: z.string(),
137
- steps: zHsmChallengeSteps
318
+ var zEthereumLikeTransferCoinFields = z10.object({
319
+ type: zEthereumLikeTransferTransactionType,
320
+ gasPrice: z10.string(),
321
+ gasLimit: z10.string(),
322
+ nonce: z10.string()
138
323
  });
139
- z.object({
140
- name: z.string().describe("Name of the user to register"),
141
- psdModel: z.nativeEnum(PsdModel).describe("Device model"),
142
- pubKey: zPubKey.describe("Device public key"),
143
- confidentialityKey: zPubKey,
144
- psdEphemeralKey: zPubKey,
145
- psdEphemeralKeyAttestation: zHsmCertificate
146
- }).describe("Data generated by the PSD to register on HSM");
147
- z.object({
148
- challenge: z.string(),
149
- ephemeralPublicKey: zPubKey,
150
- ephemeralPublicKeyAttestation: zHsmCertificate,
151
- handshake: zHexString,
152
- handshakeAttestation: zHsmCertificate,
153
- u2fRegisterData: z.string(),
154
- ciphertext: z.string(),
155
- requestId: z.string()
156
- }).describe("Challenge generated by HSM\xA0using the PSD registration data");
157
- z.object({
158
- certificate: zHsmCertificate,
159
- u2fRegister: zHexString,
160
- u2fKeyHandle: zHexString,
161
- registerData: z.string(),
162
- validationKey: zPubKey,
163
- pairingPayload: z.string()
164
- }).describe("Final registration response from PSD to HSM");
165
- z.object({
166
- confidentialityKeyCurve25519: z.string(),
167
- confidentialityKeySignature: z.string()
324
+ var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
325
+ type: zEthereumLikeContractTransactionType,
326
+ contractData: z10.string().meta({ description: "Contract deployment or contract execution data" })
168
327
  });
169
- z.object({
170
- pairing: z.object({
171
- workspaceName: z.string(),
172
- partitionKey: z.string(),
173
- // TODO: Is this `zPubKey`?
174
- bootstrapEnabled: z.boolean()
328
+ var zEthereumLikeTransferTransactionResponse = zCommonTransactionResponse.extend(zEthereumLikeTransferCoinFields.shape).meta({ description: "Ethereum-like transfer transaction" });
329
+ var zEthereumLikeContractTransactionResponse = zCommonTransactionResponse.extend(zEthereumLikeContractCoinFields.shape).meta({ description: "Ethereum-like contract transaction" });
330
+ var zGenericLikeAssetFields = z10.object({ type: z10.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" }) }).meta({ description: "Generic-like" });
331
+ var zGenericLikeLiveData = zCommonLiveData.extend({
332
+ type: z10.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" })
333
+ }).meta({ description: "Generic-like" });
334
+ var zGenericTransactionType = z10.enum(["GENERIC_TRANSACTION"]).meta({ description: "Generic transaction type" });
335
+ var zGenericTransactionData = z10.object({
336
+ type: z10.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
337
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
338
+ rawTx: z10.string().meta({ description: "Raw tx" })
339
+ }).meta({
340
+ description: "Generic transaction data",
341
+ id: "GenericTransactionData"
342
+ });
343
+ var zGenericTransactionResponse = zCommonTransactionResponse.extend({ type: zGenericTransactionType }).meta({ description: "Generic transaction" });
344
+ var zPolkadotLikeAssetFields = z10.object({
345
+ type: z10.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
346
+ address: z10.string().nullable().meta({ description: "Account address" })
347
+ }).meta({ description: "Polkadot-like" });
348
+ var zPolkadotUnbondingAmount = z10.object({
349
+ amount: z10.string().meta({ description: "Amount" }),
350
+ waiting_time: z10.string().meta({ description: "Waiting time" })
351
+ });
352
+ var zPolkadotLikeStakingData = z10.object({
353
+ info: z10.object({
354
+ controllerAddress: z10.string().nullable().meta({ description: "Controller address" }),
355
+ rewardsDestination: z10.string().nullable().meta({ description: "Rewards destination" }),
356
+ proxies: z10.array(z10.string()).meta({ description: "Proxies" }),
357
+ legacyStaking: z10.boolean().meta({ description: "True if account uses legacy staking" }),
358
+ isNominator: z10.boolean().meta({ description: "True if is nominator" })
175
359
  }),
176
- // TODO: Is this `zHsmCertificate`?
177
- partitionKeyAttestation: z.object({
178
- codeHash: z.string(),
179
- attestationPub: z.string(),
180
- certificate: z.string(),
181
- signature: z.string()
360
+ balances: z10.object({
361
+ free: z10.string().meta({ description: "Free balance" }),
362
+ reserved: z10.string().meta({ description: "Reserved balance" }),
363
+ frozen: z10.string().meta({ description: "Frozen balance" }),
364
+ bonded: z10.string().meta({ description: "Bonded balance" }),
365
+ available: z10.string().meta({ description: "Available balance" }),
366
+ unbonding: z10.array(zPolkadotUnbondingAmount).meta({ description: "Unbonding balances" }),
367
+ unbonded: z10.array(zPolkadotUnbondingAmount).meta({ description: "Unbonded balances" }),
368
+ totalUnbonding: z10.string().meta({ description: "Total unbonding" }),
369
+ totalUnbonded: z10.string().meta({ description: "Total unbonded" })
182
370
  }),
183
- blob: zBlob
371
+ anonymousProxy: z10.object({
372
+ address: z10.string().meta({ description: "Address" }),
373
+ createdAt: z10.string().meta({ description: "Creation date" }),
374
+ isController: z10.boolean().meta({ description: "True if is controller" }),
375
+ isMain: z10.boolean().meta({ description: "True if is main" }),
376
+ balances: z10.object({
377
+ free: z10.string().meta({ description: "Anonymous proxy free balance" }),
378
+ reserved: z10.string().meta({ description: "Anonymous proxy reserved balance" }),
379
+ frozen: z10.string().meta({ description: "Anonymous proxy frozen balance" }),
380
+ bonded: z10.string().meta({ description: "Anonymous proxy bonded balance" }),
381
+ available: z10.string().meta({ description: "Anonymous proxy available balance" }),
382
+ total: z10.string().meta({ description: "Anonymous proxy total balance" })
383
+ }).nullable(),
384
+ blockHeight: z10.string().meta({ description: "Anonymous proxy block height" }),
385
+ extIndex: z10.string().meta({ description: "Ext index" }),
386
+ index: z10.string().meta({ description: "Index" }),
387
+ kind: z10.string().meta({ description: "Kind" })
388
+ }).nullable().meta({ description: "Anonymous proxy" })
389
+ }).nullable().meta({ description: "Polkadot-like staking data" });
390
+ var zPolkadotLikeStakingFields = z10.object({
391
+ type: z10.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
392
+ staking: zPolkadotLikeStakingData.optional()
184
393
  });
185
- var zHsmSignature = z.object({
186
- digest: z.string().nullable().describe("Signed digest"),
187
- derivationPath: z.string().nullable().describe("Derivation path used to sign the digest"),
188
- r: z.string().base64().describe("Base64 encoded signature r coordinate"),
189
- s: z.string().base64().describe("Base64 encoded signature s coordinate"),
190
- v: z.union([z.literal(0), z.literal(1)]).nullable().describe("Ecdsa only, signature recovery value"),
191
- der: zHexString.describe(
192
- "Hex string encoded DER signature format (for eddsa, concatenation of r & s)"
193
- ),
194
- pubkey: zHexString.nullable().describe("Public key for signature verification, 32 or 33 bytes")
195
- });
196
- var zBitcoinLikeTransactionType = z7.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).describe("Bitcoin-like transaction type");
197
- var zCardanoLikeTransactionType = z7.enum([
198
- "CARDANO_LIKE_SEND",
199
- "CARDANO_LIKE_RECEIVE",
200
- "CARDANO_LIKE_STAKING_REGISTER",
201
- "CARDANO_LIKE_STAKING_DEREGISTER",
202
- "CARDANO_LIKE_STAKING_DELEGATE",
203
- "CARDANO_LIKE_STAKING_WITHDRAW"
204
- ]).describe("Cardano-like transaction type");
205
- var zEthereumLikeTransferTransactionType = z7.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).describe("Ethereum-like transaction type");
206
- var zEthereumLikeContractTransactionType = z7.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).describe("Ethereum-like transaction type");
207
- var zPolkadotLikeTransactionType = z7.enum([
394
+ var zPolkadotLikeLiveData = zCommonLiveData.extend(zPolkadotLikeStakingFields.shape).meta({ description: "Polkadot-like" });
395
+ var zPolkadotLikeTransactionType = z10.enum([
208
396
  "POLKADOT_LIKE_SEND",
209
397
  "POLKADOT_LIKE_RECEIVE",
210
398
  "POLKADOT_LIKE_ADDPROXY",
@@ -225,225 +413,102 @@ var zPolkadotLikeTransactionType = z7.enum([
225
413
  "POLKADOT_LIKE_REWARD",
226
414
  "POLKADOT_LIKE_CHILL",
227
415
  "POLKADOT_LIKE_TRANSFERALL"
228
- ]).describe("Polkadot-like transaction type");
229
- var zRippleLikeTransactionType = z7.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).describe("Ripple-like transaction type");
230
- var zSolanaLikeTransactionType = z7.enum([
231
- "SOLANA_LIKE_SEND",
232
- "SOLANA_LIKE_RECEIVE",
233
- "SOLANA_LIKE_CREATE_DELEGATE_STAKE",
234
- "SOLANA_LIKE_DELEGATE_STAKE",
235
- "SOLANA_LIKE_WITHDRAW_STAKE",
236
- "SOLANA_LIKE_DEACTIVATE_STAKE",
237
- "SOLANA_LIKE_SPLIT_STAKE",
238
- "SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE",
239
- "SOLANA_LIKE_MERGE_STAKE",
240
- "SOLANA_LIKE_SEND_TOKEN",
241
- "SOLANA_LIKE_FUND_AND_SEND_TOKEN",
242
- "SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT"
243
- ]).describe("Solana-like transaction type");
244
- var zStellarLikeTransactionType = z7.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).describe("Stellar-like transaction type");
245
- var zTezosLikeTransactionType = z7.enum([
246
- "TEZOS_LIKE_SEND",
247
- "TEZOS_LIKE_RECEIVE",
248
- "TEZOS_LIKE_REVEAL",
249
- "TEZOS_LIKE_DELEGATE",
250
- "TEZOS_LIKE_UNDELEGATE"
251
- ]).describe("Tezos-like transaction type");
252
- var zGenericTransactionType = z7.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
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");
255
- z7.union([
256
- zBitcoinLikeTransactionType,
257
- zCardanoLikeTransactionType,
258
- zEthereumLikeTransferTransactionType,
259
- zEthereumLikeContractTransactionType,
260
- zGenericTransactionType,
261
- zPolkadotLikeTransactionType,
262
- zRippleLikeTransactionType,
263
- zSolanaLikeTransactionType,
264
- zStellarLikeTransactionType,
265
- zSuiLikeTransactionType,
266
- zTezosLikeTransactionType,
267
- zTronLikeTransactionType
268
- ]);
269
- z7.discriminatedUnion("type", [
270
- z7.object({
271
- type: z7.literal("ETHEREUM_LIKE"),
272
- baseFees: zIntString,
273
- gasLimit: zIntString,
274
- nonce: z7.string(),
275
- priorityFees: zIntString
276
- }).describe("Ethereum-like fees"),
277
- z7.object({
278
- type: z7.literal("RIPPLE_LIKE"),
279
- fee: zIntString
280
- }).describe("Ripple-like fees"),
281
- z7.object({
282
- type: z7.literal("STELLAR_LIKE"),
283
- fee: zIntString
284
- }).describe("Stellar-like fees"),
285
- z7.object({
286
- type: z7.literal("SUI_LIKE"),
287
- fee: zIntString
288
- }).describe("Sui-like fees"),
289
- z7.object({
290
- type: z7.literal("TRON_LIKE"),
291
- fee: zIntString
292
- }).describe("Tron-like fees")
293
- ]);
294
- var zMessageType = z7.enum(["EIP191", "EIP712"]);
295
- var zMessage = z7.object({
296
- type: zMessageType.describe("Type of the message to sign"),
297
- data: zHexString.nonempty().describe("Hex data to sign, either a json string for EIP712, or a raw string for EIP191")
298
- });
299
-
300
- // src/transactions/request-data.ts
301
- var zHexDataString = z7.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/).transform((hex) => `0x${hex.toLowerCase().replace("0x", "")}`);
302
- if ("openapi" in zHexDataString) {
303
- zHexDataString = zHexDataString.openapi?.({ effectType: "same" });
304
- }
305
- var zCommonTransactionData = z7.object({
306
- amount: zUnsignedIntString.describe("Transaction amount"),
307
- currency: zCurrencyString.describe(
308
- "Will be deprecated soon, use Account.network. Transaction currency"
309
- ),
310
- // TODO: to remove, use account.network instead
311
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
312
- recipient: z7.string().nonempty().describe("Transaction recipient")
313
- });
314
- var zFeeStrategyCustom = z7.object({
315
- type: z7.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
316
- });
317
- var zFeeStrategy = z7.object({
318
- type: z7.enum(["SLOW", "NORMAL", "FAST"])
319
- });
320
- var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
321
- // nullish is optional + nullable, it is easier to seed rather than just optional
322
- feePerByte: zUnsignedIntString.nullish().describe("Fee per byte")
323
- }).describe("Bitcoin-like fee strategy");
324
- var zBitcoinLikeSendData = zCommonTransactionData.extend({
325
- type: z7.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
326
- feeStrategy: zBitcoinLikeFeeStrategy
327
- }).describe("Bitcoin-like send data");
328
- var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
329
- gasPrice: zUnsignedIntString.describe("Gas price"),
330
- gasLimit: zUnsignedIntString.describe("Gas limit")
331
- }).describe("Ethereum-like legacy fee strategy");
332
- var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
333
- maxPriorityFeePerGas: zUnsignedIntString.describe("Maximum priority fee per gas"),
334
- maxFeePerGas: zUnsignedIntString.describe("Maximum fee per gas (base + priority)"),
335
- gasLimit: zUnsignedIntString.describe("Gas limit")
336
- }).describe("Ethereum-like EIP-1559 fee strategy");
337
- var zEthereumLikeFeeStrategy = z7.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).describe("Ethereum-like fee strategy");
338
- var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
339
- type: z7.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
340
- // force the recipient to be the zero address
341
- recipient: z7.literal("0x0000000000000000000000000000000000000000"),
342
- contractData: zHexDataString.describe("Contract data in hexadecimal format"),
343
- feeStrategy: zEthereumLikeFeeStrategy
344
- }).describe("Ethereum-like deploy contract data");
345
- var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
346
- type: z7.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
347
- contractData: zHexDataString.describe("Contract call data in hexadecimal format"),
348
- feeStrategy: zEthereumLikeFeeStrategy
349
- }).describe("Ethereum-like execute contract data");
350
- var zEthereumLikeSendData = zCommonTransactionData.extend({
351
- type: z7.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
352
- feeStrategy: zEthereumLikeFeeStrategy
353
- }).describe("Ethereum-like send data");
354
- var zEthereumLikeTransactionData = z7.discriminatedUnion("type", [
355
- zEthereumLikeDeployContractData,
356
- zEthereumLikeExecuteContractData,
357
- zEthereumLikeSendData
358
- ]);
359
- var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
360
- gasLimit: zUnsignedIntString.describe("Gas limit"),
361
- storageLimit: zUnsignedIntString.nullable().describe("Storage limit")
362
- }).describe("Tezos-like fee strategy");
363
- var zTezosLikeSendData = zCommonTransactionData.extend({
364
- type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
365
- feeStrategy: zTezosLikeFeeStrategy
366
- }).describe("Tezos-like send data");
367
- var zTezosLikeDelegateData = z7.object({
368
- type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
369
- amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
370
- currency: zCurrencyString.describe("Transaction currency"),
371
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
372
- recipient: z7.string().nonempty().describe("Transaction recipient"),
373
- feeStrategy: zTezosLikeFeeStrategy
374
- }).describe("Tezos-like delegate data");
375
- var zTezosLikeUndelegateData = z7.object({
376
- type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
377
- amount: zUnsignedIntString.optional().describe("Deprecated: DO NOT USE!"),
378
- currency: zCurrencyString.describe("Transaction currency"),
379
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
380
- recipient: z7.string().nonempty().optional().describe("Deprecated: DO NOT USE!"),
381
- feeStrategy: zTezosLikeFeeStrategy
382
- }).describe("Tezos-like undelegate data");
383
- var zTezosLikeTransactionData = z7.discriminatedUnion("type", [
384
- zTezosLikeSendData,
385
- zTezosLikeDelegateData,
386
- zTezosLikeUndelegateData
387
- ]);
388
- var zPolkadotRewardDestination = z7.enum(["Staked", "Stash"]);
389
- var zPolkadotLikeAddProxyData = z7.object({
390
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
391
- currency: zCurrencyString.describe("Transaction currency"),
392
- kind: z7.literal("Staking").describe("Proxy kind"),
393
- proxy: z7.string().describe("Proxy address")
394
- }).describe("Polkadot-like add proxy data");
395
- var zPolkadotLikeAnonymousProxyData = z7.object({
396
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
397
- currency: zCurrencyString.describe("Transaction currency")
398
- }).describe("Polkadot-like anonymous proxy data");
399
- var zPolkadotLikeBondData = z7.object({
400
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
401
- currency: zCurrencyString.describe("Transaction currency"),
416
+ ]).meta({ description: "Polkadot-like transaction type" });
417
+ var zPolkadotRewardDestination = z10.enum(["Staked", "Stash"]);
418
+ var zPolkadotLikeAddProxyData = z10.object({
419
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
420
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
421
+ kind: z10.literal("Staking").meta({ description: "Proxy kind" }),
422
+ proxy: z10.string().meta({ description: "Proxy address" })
423
+ }).meta({
424
+ description: "Polkadot-like add proxy data",
425
+ id: "PolkadotLikeAddProxyData"
426
+ });
427
+ var zPolkadotLikeAnonymousProxyData = z10.object({
428
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
429
+ currency: zCurrencyString.meta({ description: "Transaction currency" })
430
+ }).meta({
431
+ description: "Polkadot-like anonymous proxy data",
432
+ id: "PolkadotLikeAnonymousProxyData"
433
+ });
434
+ var zPolkadotLikeBondData = z10.object({
435
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
436
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
402
437
  payee: zPolkadotRewardDestination,
403
- amount: zUnsignedIntString.describe("Amount")
404
- }).describe("Polkadot-like bond data");
405
- var zPolkadotLikeBondExtraData = z7.object({
406
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
407
- currency: zCurrencyString.describe("Transaction currency"),
408
- amount: zUnsignedIntString.describe("Amount")
409
- }).describe("Polkadot-like bond extra data");
410
- var zPolkadotLikeChillData = z7.object({
411
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
412
- currency: zCurrencyString.describe("Transaction currency")
413
- }).describe("Polkadot-like chill data");
414
- var zPolkadotLikeKillAnonymousData = z7.object({
415
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
416
- currency: zCurrencyString.describe("Transaction currency")
417
- }).describe("Polkadot-like kill anonymous data");
418
- var zPolkadotLikeRebondData = z7.object({
419
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
420
- currency: zCurrencyString.describe("Transaction currency"),
421
- amount: zUnsignedIntString.describe("Amount")
422
- }).describe("Polkadot-like rebond data");
423
- var zPolkadotLikeRemoveProxyData = z7.object({
424
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
425
- currency: zCurrencyString.describe("Transaction currency"),
426
- kind: z7.literal("Staking"),
427
- proxy: z7.string().describe("Proxy address")
428
- }).describe("Polkadot-like remove proxy data");
438
+ amount: zUnsignedIntString.meta({ description: "Amount" })
439
+ }).meta({
440
+ description: "Polkadot-like bond data",
441
+ id: "PolkadotLikeBondData"
442
+ });
443
+ var zPolkadotLikeBondExtraData = z10.object({
444
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
445
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
446
+ amount: zUnsignedIntString.meta({ description: "Amount" })
447
+ }).meta({
448
+ description: "Polkadot-like bond extra data",
449
+ id: "PolkadotLikeBondExtraData"
450
+ });
451
+ var zPolkadotLikeChillData = z10.object({
452
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
453
+ currency: zCurrencyString.meta({ description: "Transaction currency" })
454
+ }).meta({
455
+ description: "Polkadot-like chill data",
456
+ id: "PolkadotLikeChillData"
457
+ });
458
+ var zPolkadotLikeKillAnonymousData = z10.object({
459
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
460
+ currency: zCurrencyString.meta({ description: "Transaction currency" })
461
+ }).meta({
462
+ description: "Polkadot-like kill anonymous data",
463
+ id: "PolkadotLikeKillAnonymousData"
464
+ });
465
+ var zPolkadotLikeRebondData = z10.object({
466
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
467
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
468
+ amount: zUnsignedIntString.meta({ description: "Amount" })
469
+ }).meta({
470
+ description: "Polkadot-like rebond data",
471
+ id: "PolkadotLikeRebondData"
472
+ });
473
+ var zPolkadotLikeRemoveProxyData = z10.object({
474
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
475
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
476
+ kind: z10.literal("Staking"),
477
+ proxy: z10.string().meta({ description: "Proxy address" })
478
+ }).meta({
479
+ description: "Polkadot-like remove proxy data",
480
+ id: "PolkadotLikeRemoveProxyData"
481
+ });
429
482
  var zPolkadotLikeSendData = zCommonTransactionData.extend({
430
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
431
- }).describe("Polkadot-like send data");
432
- var zPolkadotLikeSetPayeeData = z7.object({
433
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
434
- currency: zCurrencyString.describe("Transaction currency"),
483
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
484
+ }).meta({
485
+ description: "Polkadot-like send data",
486
+ id: "PolkadotLikeSendData"
487
+ });
488
+ var zPolkadotLikeSetPayeeData = z10.object({
489
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
490
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
435
491
  payee: zPolkadotRewardDestination
436
- }).describe("Polkadot-like set payee data");
437
- var zPolkadotLikeUnbondData = z7.object({
438
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
439
- currency: zCurrencyString.describe("Transaction currency"),
440
- amount: zUnsignedIntString.describe("Amount")
441
- }).describe("Polkadot-like unbond data");
442
- var zPolkadotLikeWithdrawUnbondedData = z7.object({
443
- type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
444
- currency: zCurrencyString.describe("Transaction currency")
445
- }).describe("Polkadot-like withdraw unbonded data");
446
- var zPolkadotLikeTransactionData = z7.discriminatedUnion("type", [
492
+ }).meta({
493
+ description: "Polkadot-like set payee data",
494
+ id: "PolkadotLikeSetPayeeData"
495
+ });
496
+ var zPolkadotLikeUnbondData = z10.object({
497
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
498
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
499
+ amount: zUnsignedIntString.meta({ description: "Amount" })
500
+ }).meta({
501
+ description: "Polkadot-like unbond data",
502
+ id: "PolkadotLikeUnbondData"
503
+ });
504
+ var zPolkadotLikeWithdrawUnbondedData = z10.object({
505
+ type: z10.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
506
+ currency: zCurrencyString.meta({ description: "Transaction currency" })
507
+ }).meta({
508
+ description: "Polkadot-like withdraw unbonded data",
509
+ id: "PolkadotLikeWithdrawUnbondedData"
510
+ });
511
+ var zPolkadotLikeTransactionData = z10.discriminatedUnion("type", [
447
512
  zPolkadotLikeAddProxyData,
448
513
  zPolkadotLikeAnonymousProxyData,
449
514
  zPolkadotLikeBondData,
@@ -457,106 +522,202 @@ var zPolkadotLikeTransactionData = z7.discriminatedUnion("type", [
457
522
  zPolkadotLikeUnbondData,
458
523
  zPolkadotLikeWithdrawUnbondedData
459
524
  ]);
525
+ var zPolkadotLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zPolkadotLikeTransactionType }).meta({ description: "Polkadot-like transaction" });
526
+ var zRippleLikeAssetFields = z10.object({
527
+ type: z10.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" }),
528
+ address: z10.string().nullable().meta({ description: "Account address" })
529
+ }).meta({ description: "Ripple-like" });
530
+ var zRippleLikeLiveData = zCommonLiveData.extend({
531
+ type: z10.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" })
532
+ }).meta({ description: "Ripple-like" });
533
+ var zRippleLikeEstimatedFees = z10.object({
534
+ type: z10.literal(NetworkFamily.RIPPLE_LIKE),
535
+ fee: zIntString
536
+ }).meta({ description: "Ripple-like fees" });
537
+ var zRippleLikeTransactionType = z10.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).meta({ description: "Ripple-like transaction type" });
460
538
  var zRippleLikeSendData = zCommonTransactionData.extend({
461
- type: z7.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
462
- destinationTag: zIntString.nullable().describe("Destination tag"),
463
- feeStrategy: zFeeStrategyCustom.describe("Ripple-like fee strategy")
464
- }).describe("Ripple-like send data");
465
- var zStellarMemo = z7.union([
466
- z7.object({ MEMO_TEXT: z7.string().max(28).describe("Text memo (at most a 28 bytes string)") }).describe("Text memo"),
467
- z7.object({ MEMO_ID: zIntString.describe("Id memo (unsigned 64 bits integer)") }).describe("Id memo"),
468
- z7.object({
469
- MEMO_HASH: z7.string().max(128).regex(/^[a-fA-F0-9]+$/).describe("Transaction hash memo (64 bytes hexadecimal string)")
470
- }).describe("Hash memo"),
471
- z7.object({
472
- MEMO_RETURN: z7.string().max(128).regex(/^[a-fA-F0-9]+$/).describe(
473
- "A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
474
- )
475
- }).describe("Return memo")
476
- ]);
477
- var zStellarLikeSendData = zCommonTransactionData.extend({
478
- type: z7.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
479
- memo: zStellarMemo.nullable().describe("Stellar memo"),
480
- feeStrategy: zFeeStrategy.describe("Stellar-like fee strategy")
481
- }).describe("Stellar-like send data");
539
+ type: z10.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
540
+ destinationTag: zIntString.nullable().meta({ description: "Destination tag" }),
541
+ feeStrategy: zFeeStrategyCustom.meta({ description: "Ripple-like fee strategy" })
542
+ }).meta({
543
+ description: "Ripple-like send data",
544
+ id: "RippleLikeSendData"
545
+ });
546
+ var zRippleLikeTransactionData = z10.discriminatedUnion("type", [zRippleLikeSendData]);
547
+ var zRippleLikeTransactionResponse = zCommonTransactionResponse.extend({
548
+ type: zRippleLikeTransactionType,
549
+ memos: z10.array(z10.string()),
550
+ destinationTag: z10.string()
551
+ }).meta({ description: "Ripple-like transaction" });
552
+ var zSolanaLikeAssetFields = z10.object({
553
+ type: z10.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
554
+ address: z10.string().nullable().meta({ description: "Account address" }),
555
+ contractAddress: z10.string().meta({
556
+ description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
557
+ }).nullable().optional()
558
+ }).meta({ description: "Solana-like" });
559
+ var zSolanaStakingAccountStatus = z10.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).meta({ description: "Staking account status" });
560
+ var zSolanaLikeStakingData = z10.object({
561
+ staked: z10.string().meta({ description: "Staked balance" }),
562
+ rewards: z10.object({
563
+ total: z10.string().meta({ description: "Total rewards" }),
564
+ last7: z10.string().meta({ description: "Rewards on last 7 days" }),
565
+ last30: z10.string().meta({ description: "Rewards on last 30 days" })
566
+ }),
567
+ stakes: z10.array(
568
+ z10.object({
569
+ uid: z10.string(),
570
+ baseAccountUid: z10.string(),
571
+ pubKey: z10.string().meta({ description: "Public key" }),
572
+ validatorPubKey: z10.string().nullable().meta({ description: "Validator public key" }),
573
+ initialAmount: z10.string().meta({ description: "Initial amount" }),
574
+ activeAmount: z10.string().meta({ description: "Active amount" }),
575
+ inactiveAmount: z10.string().meta({ description: "Inactive amount" }),
576
+ totalBalance: z10.string().meta({ description: "Total balance" }),
577
+ creationDate: z10.string().meta({ description: "Creation date" }),
578
+ activationEpoch: z10.string().nullable().meta({ description: "Activation epoch" }),
579
+ activationDate: z10.string().nullable().meta({ description: "Activation date" }),
580
+ deactivationEpoch: z10.string().nullable().meta({ description: "Deactivation epoch" }),
581
+ deactivationDate: z10.string().nullable().meta({ description: "Deactivation date" }),
582
+ status: zSolanaStakingAccountStatus,
583
+ rentExemptReserve: z10.string().meta({ description: "Rent exempt reserve" }),
584
+ withdrawableAmount: z10.string().meta({ description: "Withdrawable amount" }),
585
+ totalRewards: z10.string().meta({ description: "Total rewards" }),
586
+ creationTxHash: z10.string().nullable().meta({ description: "Creation transaction hash" }),
587
+ actionsTxHashes: z10.array(z10.string()).meta({ description: "Actions transactions hashes" })
588
+ })
589
+ )
590
+ }).nullable().meta({ description: "Solana-like staking data" });
591
+ var zSolanaLikeStakingFields = z10.object({
592
+ type: z10.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
593
+ staking: zSolanaLikeStakingData.optional()
594
+ });
595
+ var zSolanaLikeLiveData = zCommonLiveData.extend(zSolanaLikeStakingFields.shape).meta({ description: "Solana-like" });
596
+ var zSolanaLikeTransactionType = z10.enum([
597
+ "SOLANA_LIKE_SEND",
598
+ "SOLANA_LIKE_RECEIVE",
599
+ "SOLANA_LIKE_CREATE_DELEGATE_STAKE",
600
+ "SOLANA_LIKE_DELEGATE_STAKE",
601
+ "SOLANA_LIKE_WITHDRAW_STAKE",
602
+ "SOLANA_LIKE_DEACTIVATE_STAKE",
603
+ "SOLANA_LIKE_SPLIT_STAKE",
604
+ "SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE",
605
+ "SOLANA_LIKE_MERGE_STAKE",
606
+ "SOLANA_LIKE_SEND_TOKEN",
607
+ "SOLANA_LIKE_FUND_AND_SEND_TOKEN",
608
+ "SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT"
609
+ ]).meta({ description: "Solana-like transaction type" });
482
610
  var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
483
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
484
- recipient: z7.string().describe("Delegated vote address"),
611
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
612
+ recipient: z10.string().meta({ description: "Delegated vote address" }),
485
613
  // Re-described
486
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
487
- }).describe("Solana-like create delegate stake data");
488
- var zSolanaLikeDeactivateStakeData = z7.object({
489
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
490
- currency: zCurrencyString.describe("Transaction currency"),
491
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
492
- stakeAccount: z7.string().describe("Stake account address"),
493
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
614
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
615
+ }).meta({
616
+ description: "Solana-like create delegate stake data",
617
+ id: "SolanaLikeCreateDelegateStakeData"
618
+ });
619
+ var zSolanaLikeDeactivateStakeData = z10.object({
620
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
621
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
622
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
623
+ stakeAccount: z10.string().meta({ description: "Stake account address" }),
624
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
494
625
  // No recipient, no amount
495
- }).describe("Solana-like deactivate stake data");
496
- var zSolanaLikeDelegateStakeData = z7.object({
497
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
498
- currency: zCurrencyString.describe("Transaction currency"),
499
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
500
- recipient: z7.string().describe("Delegated vote address"),
501
- stakeAccount: z7.string().describe("Stake account address"),
502
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
626
+ }).meta({
627
+ description: "Solana-like deactivate stake data",
628
+ id: "SolanaLikeDeactivateStakeData"
629
+ });
630
+ var zSolanaLikeDelegateStakeData = z10.object({
631
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
632
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
633
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
634
+ recipient: z10.string().meta({ description: "Delegated vote address" }),
635
+ stakeAccount: z10.string().meta({ description: "Stake account address" }),
636
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
503
637
  // No amount
504
- }).describe("Solana-like delegate stake data");
505
- var zSolanaLikeMergeStakeData = z7.object({
506
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
507
- currency: zCurrencyString.describe("Transaction currency"),
508
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
509
- mergeSrcAccount: z7.string().describe("Source stake address"),
510
- mergeDstAccount: z7.string().describe("Destination stake address"),
511
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
638
+ }).meta({
639
+ description: "Solana-like delegate stake data",
640
+ id: "SolanaLikeDelegateStakeData"
641
+ });
642
+ var zSolanaLikeMergeStakeData = z10.object({
643
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
644
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
645
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
646
+ mergeSrcAccount: z10.string().meta({ description: "Source stake address" }),
647
+ mergeDstAccount: z10.string().meta({ description: "Destination stake address" }),
648
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
512
649
  // No recipient, no amount
513
- }).describe("Solana-like merge stake data");
650
+ }).meta({
651
+ description: "Solana-like merge stake data",
652
+ id: "SolanaLikeMergeStakeData"
653
+ });
514
654
  var zSolanaLikeSendData = zCommonTransactionData.extend({
515
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
516
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
517
- }).describe("Solana-like send data");
518
- var zSolanaLikeSplitDeactivateStakeData = z7.object({
519
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
520
- amount: zUnsignedIntString.describe("Transaction amount"),
521
- currency: zCurrencyString.describe("Transaction currency"),
522
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
523
- stakeAccount: z7.string().describe("Stake account address"),
524
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
655
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
656
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
657
+ }).meta({
658
+ description: "Solana-like send data",
659
+ id: "SolanaLikeSendData"
660
+ });
661
+ var zSolanaLikeSplitDeactivateStakeData = z10.object({
662
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
663
+ amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
664
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
665
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
666
+ stakeAccount: z10.string().meta({ description: "Stake account address" }),
667
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
525
668
  // No recipient
526
- }).describe("Solana-like split deactivate stake data");
527
- var zSolanaLikeSplitStakeData = z7.object({
528
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
529
- amount: zUnsignedIntString.describe("Transaction amount"),
530
- currency: zCurrencyString.describe("Transaction currency"),
531
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
532
- stakeAccount: z7.string().describe("Stake account address"),
533
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
669
+ }).meta({
670
+ description: "Solana-like split deactivate stake data",
671
+ id: "SolanaLikeSplitDeactivateStakeData"
672
+ });
673
+ var zSolanaLikeSplitStakeData = z10.object({
674
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
675
+ amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
676
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
677
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
678
+ stakeAccount: z10.string().meta({ description: "Stake account address" }),
679
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
534
680
  // No recipient
535
- }).describe("Solana-like split stake data");
536
- var zSolanaLikeWithdrawStakeData = z7.object({
537
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
538
- amount: zUnsignedIntString.describe("Transaction amount"),
539
- currency: zCurrencyString.describe("Transaction currency"),
540
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
541
- stakeAccount: z7.string().describe("Stake account address"),
542
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
681
+ }).meta({
682
+ description: "Solana-like split stake data",
683
+ id: "SolanaLikeSplitStakeData"
684
+ });
685
+ var zSolanaLikeWithdrawStakeData = z10.object({
686
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
687
+ amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
688
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
689
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
690
+ stakeAccount: z10.string().meta({ description: "Stake account address" }),
691
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
543
692
  // No recipient
544
- }).describe("Solana-like delegate stake data");
693
+ }).meta({
694
+ description: "Solana-like withdraw stake data",
695
+ id: "SolanaLikeWithdrawStakeData"
696
+ });
545
697
  var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
546
- type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
547
- feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
548
- }).describe("Solana-like send token data");
698
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
699
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
700
+ }).meta({
701
+ description: "Solana-like send token data",
702
+ id: "SolanaLikeSendTokenData"
703
+ });
549
704
  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"),
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", [
705
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_AND_SEND_TOKEN),
706
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
707
+ }).meta({
708
+ description: "Solana-like fund token account and send token data",
709
+ id: "SolanaLikeFundAndSendTokenData"
710
+ });
711
+ var zSolanaLikeCreateTokenAccountData = z10.object({
712
+ type: z10.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT),
713
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
714
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
715
+ feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
716
+ }).meta({
717
+ description: "Solana-like create token account",
718
+ id: "SolanaLikeCreateTokenAccountData"
719
+ });
720
+ var zSolanaLikeTransactionData = z10.discriminatedUnion("type", [
560
721
  zSolanaLikeCreateDelegateStakeData,
561
722
  zSolanaLikeDeactivateStakeData,
562
723
  zSolanaLikeDelegateStakeData,
@@ -569,109 +730,318 @@ var zSolanaLikeTransactionData = z7.discriminatedUnion("type", [
569
730
  zSolanaLikeFundAndSendTokenData,
570
731
  zSolanaLikeCreateTokenAccountData
571
732
  ]);
572
- var zCardanoSendData = zCommonTransactionData.extend({
573
- type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
574
- feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
575
- }).describe("Cardano-like send data");
576
- var zCardanoStakingDelegateData = z7.object({
577
- type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
578
- currency: zCurrencyString.describe("Transaction currency"),
579
- // TODO: strict literal or enum?
580
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
581
- feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
582
- // DELEGATE doesn't have neither amount nor recipient
583
- stakePoolId: z7.string().min(1).max(100).describe("")
584
- }).describe("Cardano-like staking delegate");
585
- var zCardanoStakingDeregisterData = z7.object({
586
- type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
587
- currency: zCurrencyString.describe("Transaction currency"),
588
- // TODO: strict literal or enum?
589
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
590
- feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
591
- // DEREGISTER doesn't have a recipient
592
- amount: zUnsignedIntString.describe("Amount to deregister")
593
- }).describe("Cardano-like staking deregister data");
594
- var zCardanoStakingRegisterData = z7.object({
595
- type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
596
- currency: zCurrencyString.describe("Transaction currency"),
597
- // TODO: strict literal or enum?
598
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
599
- feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
600
- // REGISTER doesn't have a recipient
601
- amount: zUnsignedIntString.describe("Amount to register")
602
- }).describe("Cardano-like staking register data");
603
- var zCardanoStakingWithdrawData = z7.object({
604
- type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
605
- currency: zCurrencyString.describe("Transaction currency"),
606
- // TODO: strict literal or enum?
607
- maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
608
- feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
609
- // WITHDRAW doesn't have a recipient
610
- amount: zUnsignedIntString.describe("Amount to withdraw")
611
- }).describe("Cardano-like staking withdraw data");
612
- var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
613
- zCardanoSendData,
614
- zCardanoStakingDelegateData,
615
- zCardanoStakingDeregisterData,
616
- zCardanoStakingRegisterData,
617
- zCardanoStakingWithdrawData
733
+ var zSolanaLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zSolanaLikeTransactionType }).meta({ description: "Solana-like transaction" });
734
+ var zStellarLikeAssetFields = z10.object({
735
+ type: z10.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" }),
736
+ address: z10.string().nullable().meta({ description: "Account address" })
737
+ }).meta({ description: "Stellar-like" });
738
+ var zStellarLikeLiveData = zCommonLiveData.extend({
739
+ type: z10.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" })
740
+ }).meta({ description: "Stellar-like" });
741
+ var zStellarLikeEstimatedFees = z10.object({
742
+ type: z10.literal(NetworkFamily.STELLAR_LIKE),
743
+ fee: zIntString
744
+ }).meta({ description: "Stellar-like fees" });
745
+ var zStellarLikeTransactionType = z10.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).meta({ description: "Stellar-like transaction type" });
746
+ var zStellarMemo = z10.union([
747
+ z10.object({
748
+ MEMO_TEXT: z10.string().max(28).meta({ description: "Text memo (at most a 28 bytes string)" })
749
+ }).meta({ description: "Text memo" }),
750
+ z10.object({ MEMO_ID: zIntString.meta({ description: "Id memo (unsigned 64 bits integer)" }) }).meta({ description: "Id memo" }),
751
+ z10.object({
752
+ MEMO_HASH: z10.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({ description: "Transaction hash memo (64 bytes hexadecimal string)" })
753
+ }).meta({ description: "Hash memo" }),
754
+ z10.object({
755
+ MEMO_RETURN: z10.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({
756
+ description: "A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
757
+ })
758
+ }).meta({ description: "Return memo" })
618
759
  ]);
760
+ var zStellarLikeSendData = zCommonTransactionData.extend({
761
+ type: z10.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
762
+ memo: zStellarMemo.nullable().meta({ description: "Stellar memo" }),
763
+ feeStrategy: zFeeStrategy.meta({ description: "Stellar-like fee strategy" })
764
+ }).meta({
765
+ description: "Stellar-like send data",
766
+ id: "StellarLikeSendData"
767
+ });
768
+ var zStellarLikeTransactionData = z10.discriminatedUnion("type", [zStellarLikeSendData]);
769
+ var zStellarLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zStellarLikeTransactionType }).meta({ description: "Stellar-like transaction" });
770
+ var zSuiLikeAssetFields = z10.object({
771
+ type: z10.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
772
+ address: z10.string().nullable().meta({ description: "Account address" })
773
+ }).meta({ description: "Sui-like" });
774
+ var zSuiLikeStakingData = z10.object({
775
+ totalStaked: z10.string().meta({ description: "Total staked amount" }),
776
+ totalRewards: z10.string().meta({ description: "Total of rewards" })
777
+ }).nullable().meta({ description: "Sui-like staking data" });
778
+ var zSuiLikeStakingFields = z10.object({
779
+ type: z10.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
780
+ staking: zSuiLikeStakingData.optional()
781
+ });
782
+ var zSuiLikeLiveData = zCommonLiveData.extend(zSuiLikeStakingFields.shape).meta({ description: "Sui-like" });
783
+ var zSuiLikeEstimatedFees = z10.object({
784
+ type: z10.literal(NetworkFamily.SUI_LIKE),
785
+ fee: zIntString
786
+ }).meta({ description: "Sui-like fees" });
787
+ var zSuiLikeTransactionType = z10.enum([
788
+ "SUI_LIKE_SEND",
789
+ "SUI_LIKE_RECEIVE",
790
+ "SUI_LIKE_SEND_TOKEN",
791
+ "SUI_LIKE_RECEIVE_TOKEN",
792
+ "SUI_LIKE_STAKE",
793
+ "SUI_LIKE_UNSTAKE"
794
+ ]).meta({ description: "Sui-like transaction type" });
619
795
  var zSuiLikeSendData = zCommonTransactionData.extend({
620
- type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
621
- feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
622
- }).describe("Sui-like send data");
796
+ type: z10.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
797
+ feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
798
+ }).meta({
799
+ description: "Sui-like send data",
800
+ id: "SuiLikeSendData"
801
+ });
623
802
  var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
624
- type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
625
- feeStrategy: zFeeStrategy.describe("Sui-like fee strategy")
626
- }).describe("Sui-like transfer token data");
627
- var zSuiLikeTransactionData = z7.discriminatedUnion("type", [
803
+ type: z10.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
804
+ feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
805
+ }).meta({
806
+ description: "Sui-like transfer token data",
807
+ id: "SuiLikeTransferTokenData"
808
+ });
809
+ var zSuiLikeStakeData = z10.object({
810
+ type: z10.literal(zSuiLikeTransactionType.enum.SUI_LIKE_STAKE),
811
+ feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
812
+ amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
813
+ currency: zCurrencyString.meta({
814
+ description: "Will be deprecated soon, use Account.network. Transaction currency"
815
+ }),
816
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
817
+ // DELEGATE does not have recipient, but has validator instead
818
+ validator: z10.string().nonempty().meta({ description: "Validator address" })
819
+ }).meta({
820
+ description: "Sui-like stake data",
821
+ id: "SuiLikeStakeData"
822
+ });
823
+ var zSuiLikeUnstakeData = z10.object({
824
+ type: z10.literal(zSuiLikeTransactionType.enum.SUI_LIKE_UNSTAKE),
825
+ feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
826
+ currency: zCurrencyString.meta({
827
+ description: "Will be deprecated soon, use Account.network. Transaction currency"
828
+ }),
829
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
830
+ stakedSuiId: z10.string().nonempty().meta({ description: "Staked object to (partially?) unstake" }),
831
+ amount: zUnsignedIntString.meta({ description: "Amount to unstake from the position" }),
832
+ useAllAmount: z10.boolean().meta({
833
+ description: "Whether to unstake the full amount (triggers different sets of transaction commands)"
834
+ })
835
+ }).meta({
836
+ description: "Sui-like unstake data",
837
+ id: "SuiLikeUnstakeData"
838
+ });
839
+ var zSuiLikeTransactionData = z10.discriminatedUnion("type", [
628
840
  zSuiLikeSendData,
629
- zSuiLikeTransferTokenData
841
+ zSuiLikeTransferTokenData,
842
+ zSuiLikeStakeData,
843
+ zSuiLikeUnstakeData
844
+ ]);
845
+ var zSuiLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zSuiLikeTransactionType }).meta({ description: "Sui-like transaction" });
846
+ var zTezosLikeAssetFields = z10.object({
847
+ type: z10.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
848
+ address: z10.string().nullable().meta({ description: "Account address" })
849
+ }).meta({ description: "Tezos-like" });
850
+ var zTezosLikeStakingData = z10.object({
851
+ delegations: z10.array(
852
+ z10.object({
853
+ address: z10.string()
854
+ })
855
+ )
856
+ }).nullable().meta({ description: "Tezos-like staking data" });
857
+ var zTezosLikeStakingFields = z10.object({
858
+ type: z10.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
859
+ staking: zTezosLikeStakingData.optional()
860
+ });
861
+ var zTezosLikeLiveData = zCommonLiveData.extend(zTezosLikeStakingFields.shape).meta({ description: "Tezos-like" });
862
+ var zTezosLikeEstimatedFees = z10.object({
863
+ type: z10.literal(NetworkFamily.TEZOS_LIKE),
864
+ fee: zIntString
865
+ }).describe("Tezos-like fees");
866
+ var zTezosLikeTransactionType = z10.enum([
867
+ "TEZOS_LIKE_SEND",
868
+ "TEZOS_LIKE_RECEIVE",
869
+ "TEZOS_LIKE_REVEAL",
870
+ "TEZOS_LIKE_DELEGATE",
871
+ "TEZOS_LIKE_UNDELEGATE"
872
+ ]).meta({ description: "Tezos-like transaction type" });
873
+ var zTezosLikeFeeStrategy = zFeeStrategyCustom.meta({ description: "Tezos-like fee strategy" });
874
+ var zTezosLikeSendData = zCommonTransactionData.extend({
875
+ type: z10.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
876
+ feeStrategy: zTezosLikeFeeStrategy
877
+ }).meta({
878
+ description: "Tezos-like send data",
879
+ id: "TezosLikeSendData"
880
+ });
881
+ var zTezosLikeDelegateData = z10.object({
882
+ type: z10.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
883
+ amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
884
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
885
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
886
+ recipient: z10.string().nonempty().meta({ description: "Transaction recipient" }),
887
+ feeStrategy: zTezosLikeFeeStrategy
888
+ }).meta({
889
+ description: "Tezos-like delegate data",
890
+ id: "TezosLikeDelegateData"
891
+ });
892
+ var zTezosLikeUndelegateData = z10.object({
893
+ type: z10.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
894
+ amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
895
+ currency: zCurrencyString.meta({ description: "Transaction currency" }),
896
+ maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
897
+ recipient: z10.string().nonempty().optional().meta({ description: "Deprecated: DO NOT USE!" }),
898
+ feeStrategy: zTezosLikeFeeStrategy
899
+ }).meta({
900
+ description: "Tezos-like undelegate data",
901
+ id: "TezosLikeUndelegateData"
902
+ });
903
+ var zTezosLikeTransactionData = z10.discriminatedUnion("type", [
904
+ zTezosLikeSendData,
905
+ zTezosLikeDelegateData,
906
+ zTezosLikeUndelegateData
630
907
  ]);
631
- var zGenericTransactionData = z7.object({
632
- type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
633
- currency: zCurrencyString.describe("Transaction currency"),
634
- rawTx: z7.string().describe("Raw tx")
635
- }).describe("Generic transaction data");
908
+ var zTezosLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zTezosLikeTransactionType }).meta({ description: "Tezos-like transaction" });
909
+ var zTronLikeAssetFields = z10.object({
910
+ type: z10.literal(NetworkFamily.TRON_LIKE).meta({ description: "Account type" }),
911
+ address: z10.string().nullable().meta({ description: "Account address" })
912
+ }).meta({ description: "Tron-like" });
913
+ var zTrc20LikeAssetFields = z10.object({
914
+ type: z10.literal(NetworkFamily.TRC20_LIKE).meta({ description: "Account type" }),
915
+ address: z10.string().nullable().meta({ description: "Account address" }),
916
+ contractAddress: z10.string().meta({
917
+ description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
918
+ }).optional()
919
+ }).meta({ description: "Tron-like token" });
920
+ var zTronLikeLiveData = zCommonLiveData.extend({
921
+ type: z10.enum([NetworkFamily.TRON_LIKE, NetworkFamily.TRC20_LIKE]).meta({ description: "Account type" })
922
+ }).meta({ description: "Tron-like" });
923
+ var zTronLikeEstimatedFees = z10.object({
924
+ type: z10.literal(NetworkFamily.TRON_LIKE),
925
+ fee: zIntString
926
+ }).meta({ description: "Tron-like fees" });
927
+ var zTronLikeTransactionType = z10.enum(["TRON_LIKE_SEND", "TRON_LIKE_RECEIVE", "TRON_LIKE_SEND_TOKEN", "TRON_LIKE_RECEIVE_TOKEN"]).meta({ description: "Tron-like transaction type" });
636
928
  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");
929
+ type: z10.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
930
+ feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
931
+ }).meta({
932
+ description: "Tron-like send data",
933
+ id: "TronLikeSendData"
934
+ });
640
935
  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", [
936
+ type: z10.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
937
+ feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
938
+ }).meta({
939
+ description: "Tron-like send token data",
940
+ id: "TronLikeSendTokenData"
941
+ });
942
+ var zTronLikeTransactionData = z10.discriminatedUnion("type", [
645
943
  zTronLikeSendData,
646
944
  zTronLikeSendTokenData
647
945
  ]);
648
- var zTransactionData = z7.discriminatedUnion("type", [
649
- // Bitcoin
650
- zBitcoinLikeSendData,
651
- // Cardano
946
+
947
+ // src/networks/index.ts
948
+ var zNetworkAssetFields = z10.discriminatedUnion("type", [
949
+ zBitcoinLikeAssetFields,
950
+ zCardanoLikeAssetFields,
951
+ zEthereumLikeAssetFields,
952
+ zEthereumTokenLikeAssetFields,
953
+ zGenericLikeAssetFields,
954
+ zPolkadotLikeAssetFields,
955
+ zRippleLikeAssetFields,
956
+ zSolanaLikeAssetFields,
957
+ zStellarLikeAssetFields,
958
+ zTezosLikeAssetFields,
959
+ zSuiLikeAssetFields,
960
+ zTronLikeAssetFields,
961
+ zTrc20LikeAssetFields
962
+ ]).meta({ description: "Network asset fields" });
963
+ var zAccountLiveData = z10.discriminatedUnion("type", [
964
+ zBitcoinLikeLiveData,
965
+ zCardanoLikeLiveData,
966
+ zEthereumLikeLiveData,
967
+ zEthereumTokenLikeLiveData,
968
+ zGenericLikeLiveData,
969
+ zPolkadotLikeLiveData,
970
+ zRippleLikeLiveData,
971
+ zSolanaLikeLiveData,
972
+ zStellarLikeLiveData,
973
+ zSuiLikeLiveData,
974
+ zTezosLikeLiveData,
975
+ zTronLikeLiveData
976
+ ]);
977
+ z10.discriminatedUnion("type", [
978
+ zCardanoLikeStakingFields,
979
+ zEthereumLikeStakingFields,
980
+ zPolkadotLikeStakingFields,
981
+ zSolanaLikeStakingFields,
982
+ zSuiLikeStakingFields,
983
+ zTezosLikeStakingFields
984
+ ]);
985
+ z10.discriminatedUnion("type", [
986
+ zEthereumLikeEstimatedFees,
987
+ zRippleLikeEstimatedFees,
988
+ zStellarLikeEstimatedFees,
989
+ zSuiLikeEstimatedFees,
990
+ zTezosLikeEstimatedFees,
991
+ zTronLikeEstimatedFees
992
+ ]);
993
+ z10.union([
994
+ zBitcoinLikeTransactionType,
995
+ zCardanoLikeTransactionType,
996
+ zEthereumLikeTransferTransactionType,
997
+ zEthereumLikeContractTransactionType,
998
+ zGenericTransactionType,
999
+ zPolkadotLikeTransactionType,
1000
+ zRippleLikeTransactionType,
1001
+ zSolanaLikeTransactionType,
1002
+ zStellarLikeTransactionType,
1003
+ zSuiLikeTransactionType,
1004
+ zTezosLikeTransactionType,
1005
+ zTronLikeTransactionType
1006
+ ]);
1007
+ ({
1008
+ ...zBitcoinLikeTransactionType.enum,
1009
+ ...zCardanoLikeTransactionType.enum,
1010
+ ...zEthereumLikeTransferTransactionType.enum,
1011
+ ...zEthereumLikeContractTransactionType.enum,
1012
+ ...zGenericTransactionType.enum,
1013
+ ...zPolkadotLikeTransactionType.enum,
1014
+ ...zRippleLikeTransactionType.enum,
1015
+ ...zSolanaLikeTransactionType.enum,
1016
+ ...zStellarLikeTransactionType.enum,
1017
+ ...zSuiLikeTransactionType.enum,
1018
+ ...zTezosLikeTransactionType.enum,
1019
+ ...zTronLikeTransactionType.enum
1020
+ });
1021
+ ({
1022
+ ...NetworkFamily,
1023
+ // TODO: Sometimes `NetworkFamily` is not a `TransactionType` prefix - but why?
1024
+ [NetworkFamily.ERC20_LIKE]: "ETHEREUM_LIKE",
1025
+ [NetworkFamily.BEP20_LIKE]: "ETHEREUM_LIKE",
1026
+ [NetworkFamily.TRC20_LIKE]: "TRON_LIKE",
1027
+ [NetworkFamily.GENERIC_LIKE]: "GENERIC"
1028
+ });
1029
+ var zTransactionData = z10.discriminatedUnion("type", [
1030
+ ...zBitcoinLikeTransactionData.options,
652
1031
  ...zCardanoLikeTransactionData.options,
653
- // Ethereum
654
1032
  ...zEthereumLikeTransactionData.options,
655
- // Generic
656
- zGenericTransactionData,
657
- // Polkadot
658
1033
  ...zPolkadotLikeTransactionData.options,
659
- // Ripple
660
- zRippleLikeSendData,
661
- // Solana
1034
+ ...zRippleLikeTransactionData.options,
662
1035
  ...zSolanaLikeTransactionData.options,
663
- // Stellar
664
- zStellarLikeSendData,
665
- // Sui
1036
+ ...zStellarLikeTransactionData.options,
666
1037
  ...zSuiLikeTransactionData.options,
667
- // Tezos
668
1038
  ...zTezosLikeTransactionData.options,
669
- // Tron
670
- ...zTronLikeTransactionData.options
1039
+ ...zTronLikeTransactionData.options,
1040
+ zGenericTransactionData
671
1041
  ]);
672
- var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
1042
+ var zSendOnlyTransactionData = z10.discriminatedUnion("type", [
673
1043
  zBitcoinLikeSendData,
674
- zCardanoSendData,
1044
+ zCardanoLikeSendData,
675
1045
  zEthereumLikeSendData,
676
1046
  zPolkadotLikeSendData,
677
1047
  zRippleLikeSendData,
@@ -680,105 +1050,7 @@ var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
680
1050
  zSuiLikeSendData,
681
1051
  zTezosLikeSendData
682
1052
  ]);
683
- var zCreateTransactionRequestData = z7.object({
684
- accountId: z7.string().min(1).describe("Target account id"),
685
- transaction: zTransactionData
686
- });
687
- var zSignMessageRequestData = z7.object({
688
- message: zMessage.describe("Message to sign"),
689
- accountId: z7.string().min(1).describe("Target account id"),
690
- address: z7.string().nonempty().describe("Address with which to sign the message"),
691
- derivationPath: z7.string().nonempty().describe("Derivation path of the signing address")
692
- });
693
- var zSignMessageUserInputData = zSignMessageRequestData.partial({
694
- address: true,
695
- derivationPath: true
696
- });
697
- z7.object({
698
- // Populated after input data is validated.
699
- govRuleHsmId: zHsmObjectId.optional(),
700
- // Populated after request is executed -- it holds the message-signing result.
701
- signature: zHsmSignature.optional()
702
- });
703
- var zDigestData = z7.object({
704
- digest: zHexString.describe("The hex string digest to sign"),
705
- derivationPath: z7.string().nonempty().describe("The derivation path with which to sign the digest")
706
- });
707
- var zSignDigestsRequestData = z7.object({
708
- accountId: z7.string().min(1).describe("Target account id"),
709
- digests: z7.array(zDigestData).describe("The digests to sign")
710
- });
711
- z7.object({
712
- signatures: z7.array(zHsmSignature)
713
- });
714
-
715
- // src/accounts/clients/types.ts
716
- var zTransactionStatus = z7.enum(["SUCCESSFUL", "FAILED"]);
717
- var zBitcoinLikeCoinFields = z7.object({
718
- type: zBitcoinLikeTransactionType
719
- });
720
- var zCardanoLikeCoinFields = z7.object({
721
- type: zCardanoLikeTransactionType
722
- });
723
- var zEthereumLikeTransferCoinFields = z7.object({
724
- type: zEthereumLikeTransferTransactionType,
725
- gasPrice: z7.string(),
726
- gasLimit: z7.string(),
727
- nonce: z7.string()
728
- });
729
- var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
730
- type: zEthereumLikeContractTransactionType,
731
- contractData: z7.string().describe("Contract deployment or contract execution data")
732
- });
733
- var zGenericCoinFields = z7.object({
734
- type: zGenericTransactionType
735
- });
736
- var zPolkadotLikeCoinFields = z7.object({
737
- type: zPolkadotLikeTransactionType
738
- });
739
- var zRippleLikeCoinFields = z7.object({
740
- type: zRippleLikeTransactionType,
741
- memos: z7.array(z7.string()),
742
- destinationTag: z7.string()
743
- });
744
- var zSolanaLikeCoinFields = z7.object({
745
- type: zSolanaLikeTransactionType
746
- });
747
- var zStellarLikeCoinFields = z7.object({
748
- type: zStellarLikeTransactionType
749
- });
750
- var zSuiLikeCoinFields = z7.object({
751
- type: zSuiLikeTransactionType
752
- });
753
- var zTezosLikeCoinFields = z7.object({
754
- type: zTezosLikeTransactionType
755
- });
756
- var zCommonTransactionResponse = z7.object({
757
- id: z7.string().describe("Internal unique identifier"),
758
- hash: z7.string().describe("Transaction hash"),
759
- block: z7.object({
760
- height: z7.string().nullable().describe("Transaction block height"),
761
- time: z7.string().nullable().describe("Transaction block time")
762
- }),
763
- status: zTransactionStatus.describe("Transaction status"),
764
- confirmations: z7.string().describe("Block confirmations"),
765
- amount: z7.string().describe("Transaction amount"),
766
- fee: z7.string().describe("Transaction fee"),
767
- senders: z7.array(z7.string()).describe("Senders (can be multiple for UTXOs-based accounts)"),
768
- recipients: z7.array(z7.string()).describe("Recipients (can be multiple for multi-output transactions)")
769
- });
770
- var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.merge(zBitcoinLikeCoinFields).describe("Bitcoin-like transaction");
771
- var zCardanoLikeTransactionResponse = zCommonTransactionResponse.merge(zCardanoLikeCoinFields).describe("Cardano-like transaction");
772
- var zEthereumLikeTransferTransactionResponse = zCommonTransactionResponse.merge(zEthereumLikeTransferCoinFields).describe("Ethereum-like transfer transaction");
773
- var zEthereumLikeContractTransactionResponse = zCommonTransactionResponse.merge(zEthereumLikeContractCoinFields).describe("Ethereum-like contract transaction");
774
- var zGenericTransactionResponse = zCommonTransactionResponse.merge(zGenericCoinFields).describe("Generic transaction");
775
- var zPolkadotLikeTransactionResponse = zCommonTransactionResponse.merge(zPolkadotLikeCoinFields).describe("Polkadot-like transaction");
776
- var zRippleLikeTransactionResponse = zCommonTransactionResponse.merge(zRippleLikeCoinFields).describe("Ripple-like transaction");
777
- var zSolanaLikeTransactionResponse = zCommonTransactionResponse.merge(zSolanaLikeCoinFields).describe("Solana-like transaction");
778
- var zStellarLikeTransactionResponse = zCommonTransactionResponse.merge(zStellarLikeCoinFields).describe("Stellar-like transaction");
779
- var zTezosLikeTransactionResponse = zCommonTransactionResponse.merge(zTezosLikeCoinFields).describe("Tezos-like transaction");
780
- var zSuiLikeTransactionResponse = zCommonTransactionResponse.merge(zSuiLikeCoinFields).describe("Sui-like transaction");
781
- var zTransactionResponse = z7.discriminatedUnion("type", [
1053
+ var zTransactionResponse = z10.discriminatedUnion("type", [
782
1054
  zBitcoinLikeTransactionResponse,
783
1055
  zCardanoLikeTransactionResponse,
784
1056
  zEthereumLikeTransferTransactionResponse,
@@ -791,94 +1063,29 @@ var zTransactionResponse = z7.discriminatedUnion("type", [
791
1063
  zSuiLikeTransactionResponse,
792
1064
  zTezosLikeTransactionResponse
793
1065
  ]);
794
- z7.discriminatedUnion(
795
- zTransactionResponse.discriminator,
1066
+
1067
+ // src/accounts/clients/types.ts
1068
+ z10.discriminatedUnion(
1069
+ zTransactionResponse._zod.def.discriminator,
796
1070
  ensureNonEmptyArray(
797
1071
  zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
798
1072
  )
799
1073
  );
800
- var zBitcoinLikeAssetFields = z.object({
801
- type: z.literal(AccountType.BITCOIN_LIKE).describe("Account type"),
802
- xpub: z.string().describe("xpub (extended public key)")
803
- }).describe("Bitcoin-like");
804
- var zCardanoLikeAssetFields = z.object({
805
- type: z.literal(AccountType.CARDANO_LIKE).describe("Account type"),
806
- address: z.string().describe("Account address").nullable()
807
- }).describe("Cardano-like");
808
- var zEthereumLikeAssetFields = z.object({
809
- type: z.literal(AccountType.ETHEREUM_LIKE).describe("Account type"),
810
- address: z.string().describe("Account address").nullable()
811
- }).describe("Ethereum-like");
812
- var zEthereumTokenLikeAssetFields = z.object({
813
- type: z.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE, AccountType.TRC20_LIKE]).describe("Account type"),
814
- address: z.string().describe("Account address").nullable(),
815
- contractAddress: z.string().describe(
816
- "Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
817
- ).optional()
818
- }).describe("Ethereum-like token");
819
- var zGenericLikeAssetFields = z.object({ type: z.literal(AccountType.GENERIC_LIKE).describe("Account type") }).describe("Generic-like");
820
- var zRawSigningAssetFields = z.object({ type: z.literal(AccountType.RAW_SIGNING).describe("Account type") }).describe("Raw signing account");
821
- var zPolkadotLikeAssetFields = z.object({
822
- type: z.literal(AccountType.POLKADOT_LIKE).describe("Account type"),
823
- address: z.string().describe("Account address").nullable()
824
- }).describe("Polkadot-like");
825
- var zRippleLikeAssetFields = z.object({
826
- type: z.literal(AccountType.RIPPLE_LIKE).describe("Account type"),
827
- address: z.string().describe("Account address").nullable()
828
- }).describe("Ripple-like");
829
- var zSolanaLikeAssetFields = z.object({
830
- type: z.literal(AccountType.SOLANA_LIKE).describe("Account type"),
831
- address: z.string().describe("Account address").nullable(),
832
- contractAddress: z.string().describe(
833
- "Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
834
- ).nullable().optional()
835
- }).describe("Solana-like");
836
- var zStellarLikeAssetFields = z.object({
837
- type: z.literal(AccountType.STELLAR_LIKE).describe("Account type"),
838
- address: z.string().describe("Account address").nullable()
839
- }).describe("Stellar-like");
840
- var zSuiLikeAssetFields = z.object({
841
- type: z.literal(AccountType.SUI_LIKE).describe("Account type"),
842
- address: z.string().describe("Account address").nullable()
843
- }).describe("Sui-like");
844
- var zTezosLikeAssetFields = z.object({
845
- type: z.literal(AccountType.TEZOS_LIKE).describe("Account type"),
846
- address: z.string().describe("Account address").nullable()
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");
852
- var zAccountAssetStaticFields = z.discriminatedUnion("type", [
853
- zBitcoinLikeAssetFields,
854
- zCardanoLikeAssetFields,
855
- zEthereumLikeAssetFields,
856
- zEthereumTokenLikeAssetFields,
857
- zGenericLikeAssetFields,
858
- zPolkadotLikeAssetFields,
859
- zRawSigningAssetFields,
860
- zRippleLikeAssetFields,
861
- zSolanaLikeAssetFields,
862
- zStellarLikeAssetFields,
863
- zTezosLikeAssetFields,
864
- zSuiLikeAssetFields,
865
- zTronLikeAssetFields
866
- ]).describe("Account asset fields");
867
1074
  var zReviewStepWithUsers = z.object({
868
- quorum: z.number().min(0).describe("Number of required approvals for the step"),
869
- userIds: z.array(z.string().min(1)).describe("User ids in the step")
1075
+ quorum: z.number().min(0).meta({ description: "Number of required approvals for the step" }),
1076
+ userIds: z.array(z.string().min(1)).meta({ description: "User ids in the step" })
870
1077
  // PKs to `User` model
871
- }).describe("Review step with users");
1078
+ }).meta({ description: "Review step with users" });
872
1079
  var zReviewStepWithUsersArray = z.array(zReviewStepWithUsers);
873
1080
  var zReviewStepData = z.union([
874
1081
  zReviewStepWithUsers,
875
1082
  z.object({
876
- quorum: z.number().min(0).describe("Number of required approvals for the step"),
877
- groupId: z.string().min(1).describe("Group id in the step")
1083
+ quorum: z.number().min(0).meta({ description: "Number of required approvals for the step" }),
1084
+ groupId: z.string().min(1).meta({ description: "Group id in the step" })
878
1085
  // PKs to `Group` model
879
- }).describe("Review step with group")
1086
+ }).meta({ description: "Review step with group" })
880
1087
  ]);
881
- var zReviewStepsArray = z.array(zReviewStepData).min(1).describe("Review steps");
1088
+ var zReviewStepsArray = z.array(zReviewStepData).min(1).meta({ description: "Review steps" });
882
1089
 
883
1090
  // src/prisma-utils/policy.ts
884
1091
  var policy_exports = {};
@@ -890,21 +1097,21 @@ __export(policy_exports, {
890
1097
  zWhitelistIds: () => zWhitelistIds
891
1098
  });
892
1099
  var zThreshold = z.object({
893
- min: zUnsignedIntString.nullable().describe("Minimum transaction amount"),
894
- max: zUnsignedIntString.nullable().describe("Maximum transaction amount")
895
- }).describe("Threshold for the transaction value");
896
- var zWhitelistIds = z.array(z.string().min(1)).describe("IDs of whitelists for the recipient address");
1100
+ min: zUnsignedIntString.nullable().meta({ description: "Minimum transaction amount" }),
1101
+ max: zUnsignedIntString.nullable().meta({ description: "Maximum transaction amount" })
1102
+ }).meta({ description: "Threshold for the transaction value" });
1103
+ var zWhitelistIds = z.array(z.string().min(1)).meta({ description: "IDs of whitelists for the recipient address" });
897
1104
  var zGovRuleJsonObject = z.object({
898
1105
  // Required.
899
- operationType: zOperationType.describe("Allowed operation type"),
1106
+ operationType: zOperationType.meta({ description: "Allowed operation type" }),
900
1107
  // Optional threshold on transaction value: null `min` = 0, null `max` = +inf
901
1108
  threshold: zThreshold,
902
1109
  // Optional whitelist on transaction recipient: Empty list means no whitelist.
903
1110
  whitelistIds: zWhitelistIds,
904
- reviewConfigId: z.string().min(1).describe("Id of ReviewConfig"),
1111
+ reviewConfigId: z.string().min(1).meta({ description: "Id of ReviewConfig" }),
905
1112
  // HSM id for the rule
906
1113
  hsmId: zHsmObjectId
907
- }).describe("INTERNAL: Governance rule JSON representation in DB");
1114
+ }).meta({ description: "INTERNAL: Governance rule JSON representation in DB" });
908
1115
  var zGovRulesJsonArray = z.array(zGovRuleJsonObject);
909
1116
  var parseFields = (policy) => {
910
1117
  const rulesJsonArray = zGovRulesJsonArray.parse(policy.rulesJsonArray);
@@ -922,60 +1129,201 @@ var INCLUDE_MEMBERS = {
922
1129
  include: { members: true }
923
1130
  }
924
1131
  };
925
- var zUpdateQuorumRequestData = z7.object({
926
- quorum: z7.number().int().min(2).describe("Workspace quorum")
1132
+ var zPubKey = zHexString.meta({ description: "Public key" });
1133
+ var zHsmCertificate = z.object({
1134
+ codeHash: z.base64().meta({ description: "Hash of the executable that generated this certificate" }),
1135
+ attestationPub: z.base64().meta({ description: "Attestation public key" }),
1136
+ certificate: z.base64().meta({ description: "Certificate bytes" }),
1137
+ signature: z.base64().meta({ description: "Certificate signature" })
1138
+ });
1139
+ var zBlob = z.string();
1140
+ var zPsdChallenge = z.object({
1141
+ challengeType: z.literal(ChallengeType.PSD),
1142
+ wActions: z.array(z.string()).meta({ description: "Wrapped blobs that describe the screens to display" }),
1143
+ handshake: z.string().meta({ description: "Handshake for the HSM <-> PSD communication" }),
1144
+ handshakeAttestation: zHsmCertificate.meta({
1145
+ description: "Handshake attestation to verify secure channel between HSM & PSD"
1146
+ }),
1147
+ partitionId: z.string().meta({ description: "HSM partition id (maybe not useful)" })
1148
+ });
1149
+ var zApiChallenge = z.object({
1150
+ challengeType: z.literal(ChallengeType.API),
1151
+ payload: z.object({
1152
+ approve: z.string().meta({ description: "JSON payload to sign (as JWS) to approve" }),
1153
+ reject: z.string().meta({ description: "JSON payload to sign (as JWS) to reject" })
1154
+ }).meta({ description: "JSON payload to approve and to reject" })
1155
+ });
1156
+ var zUserChallenge = z.discriminatedUnion("challengeType", [
1157
+ zPsdChallenge.meta({ description: "Necessary data to approve on a PSD" }),
1158
+ zApiChallenge.meta({ description: "Necessary data for approval by an API user" })
1159
+ ]);
1160
+ var zHsmChallengeGroup = z.record(zPubKey, zUserChallenge);
1161
+ var zHsmChallengeSteps = z.array(zHsmChallengeGroup);
1162
+ var zPsdSignature = z.string().min(1).meta({ description: "Signature from PSD" });
1163
+ var zApiSignature = z.string().min(1).meta({ description: "Signature from API (JWS)" });
1164
+ var zUserApproval = z.discriminatedUnion("challengeType", [
1165
+ z.object({
1166
+ challengeType: z.literal(ChallengeType.PSD),
1167
+ signature: zPsdSignature
1168
+ }),
1169
+ z.object({
1170
+ challengeType: z.literal(ChallengeType.API),
1171
+ signature: zApiSignature
1172
+ })
1173
+ ]);
1174
+ var zHsmApprovalGroup = z.record(zPubKey, zUserApproval);
1175
+ z.array(zHsmApprovalGroup);
1176
+ z.object({
1177
+ stageName: z.string(),
1178
+ steps: zHsmChallengeSteps
1179
+ });
1180
+ z.object({
1181
+ name: z.string().meta({ description: "Name of the user to register" }),
1182
+ psdModel: z.enum(PsdModel).meta({ description: "Device model" }),
1183
+ pubKey: zPubKey.meta({ description: "Device public key" }),
1184
+ confidentialityKey: zPubKey,
1185
+ psdEphemeralKey: zPubKey,
1186
+ psdEphemeralKeyAttestation: zHsmCertificate
1187
+ }).meta({ description: "Data generated by the PSD to register on HSM" });
1188
+ z.object({
1189
+ challenge: z.string(),
1190
+ ephemeralPublicKey: zPubKey,
1191
+ ephemeralPublicKeyAttestation: zHsmCertificate,
1192
+ handshake: zHexString,
1193
+ handshakeAttestation: zHsmCertificate,
1194
+ u2fRegisterData: z.string(),
1195
+ ciphertext: z.string(),
1196
+ requestId: z.string()
1197
+ }).meta({ description: "Challenge generated by HSM\xA0using the PSD registration data" });
1198
+ z.object({
1199
+ certificate: zHsmCertificate,
1200
+ u2fRegister: zHexString,
1201
+ u2fKeyHandle: zHexString,
1202
+ registerData: z.string(),
1203
+ validationKey: zPubKey,
1204
+ pairingPayload: z.string()
1205
+ }).meta({ description: "Final registration response from PSD to HSM" });
1206
+ z.object({
1207
+ confidentialityKeyCurve25519: z.string(),
1208
+ confidentialityKeySignature: z.string()
1209
+ });
1210
+ z.object({
1211
+ pairing: z.object({
1212
+ workspaceName: z.string(),
1213
+ partitionKey: z.string(),
1214
+ // TODO: Is this `zPubKey`?
1215
+ bootstrapEnabled: z.boolean()
1216
+ }),
1217
+ // TODO: Is this `zHsmCertificate`?
1218
+ partitionKeyAttestation: z.object({
1219
+ codeHash: z.string(),
1220
+ attestationPub: z.string(),
1221
+ certificate: z.string(),
1222
+ signature: z.string()
1223
+ }),
1224
+ blob: zBlob
1225
+ });
1226
+ var zHsmSignature = z.object({
1227
+ digest: z.string().nullable().meta({ description: "Signed digest" }),
1228
+ derivationPath: z.string().nullable().meta({ description: "Derivation path used to sign the digest" }),
1229
+ r: z.base64().meta({ description: "Base64 encoded signature r coordinate" }),
1230
+ s: z.base64().meta({ description: "Base64 encoded signature s coordinate" }),
1231
+ v: z.union([z.literal(0), z.literal(1)]).nullable().meta({ description: "Ecdsa only, signature recovery value" }),
1232
+ der: zHexString.meta({
1233
+ description: "Hex string encoded DER signature format (for eddsa, concatenation of r & s)"
1234
+ }),
1235
+ pubkey: zHexString.nullable().meta({ description: "Public key for signature verification, 32 or 33 bytes" })
1236
+ });
1237
+ var zWorkspaceName = z10.string().min(1).max(20).regex(/^[a-z0-9]+$/);
1238
+ var zUserName = z.string().min(1).max(19).meta({ description: "User name" });
1239
+ var zUserRegistrationCreateInput = z.object({
1240
+ name: zUserName,
1241
+ role: z.enum([UserRole.ADMIN, UserRole.OPERATOR]).meta({ description: "User role" }),
1242
+ psdModel: z.enum(PsdModel).meta({ description: "PSD model" }),
1243
+ deviceUserId: z.string().meta({ description: "Device user ID" })
1244
+ });
1245
+ zUserRegistrationCreateInput.extend({
1246
+ id: z.string().meta({ description: "User registration ID" }),
1247
+ workspaceName: z.string().meta({ description: "Workspace name" }),
1248
+ state: z.enum(UserRegistrationState).meta({ description: "User registration state" }),
1249
+ isLocked: z.boolean().meta({ description: "Whether the registration is locked by a request" })
927
1250
  });
928
- var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
929
1251
 
930
- // src/tradelink/types.ts
931
- var zTradelinkWhitelistAddress = z7.object({
932
- name: z7.string().min(1),
1252
+ // src/users/request-data.ts
1253
+ var zCreatePsdUserRequestData = z10.object({
1254
+ registrationId: z10.string().meta({ description: "User registration ID" })
1255
+ });
1256
+ var zCreateApiUserRequestData = z10.object({
1257
+ name: zUserName,
1258
+ pubKey: z10.string().meta({ description: "Public key" }),
1259
+ role: z10.enum(["ADMIN", "OPERATOR"]).meta({ description: "User role" }),
1260
+ viewAll: z10.boolean().meta({ description: "View all data" }).optional()
1261
+ }).meta({ description: "Create API user request data" });
1262
+ var zCreateApiUserAccessRequestData = z10.object({
1263
+ name: zUserName
1264
+ }).meta({ description: "Create API user credential request data" });
1265
+ z10.object({
1266
+ authUserId: z10.string().meta({ description: "Authentication broker ID" })
1267
+ }).meta({ description: "Managed data for API user" });
1268
+ var zRevokeUserRequestData = z10.object({});
1269
+ var zUpdateQuorumRequestData = z10.object({
1270
+ quorum: z10.number().int().min(2).meta({ description: "Workspace quorum" })
1271
+ });
1272
+ var NonRootAdminPermission = omit(AdminPermission, "ROOT");
1273
+ var zWorkspaceRuleRequestData = z10.object({
1274
+ permission: z10.enum(NonRootAdminPermission).meta({ description: "Granted permissions" }),
1275
+ reviewConfig: zReviewStepWithUsersArray.meta({ description: "List of admin review steps" })
1276
+ });
1277
+ var zTradelinkWhitelistAddress = z10.object({
1278
+ name: z10.string().min(1),
933
1279
  currency: zCurrencyString,
934
- address: z7.string().min(1)
1280
+ address: z10.string().min(1)
935
1281
  });
936
- z7.array(zTradelinkWhitelistAddress);
937
- var zTradelinkId = z7.string().describe("Unique identifier in Tradelink service");
938
- var zTradelinkOrgEntityResponse = z7.object({
1282
+ z10.array(zTradelinkWhitelistAddress);
1283
+ var zTradelinkId = z10.string().meta({ description: "Unique identifier in Tradelink service" });
1284
+ var zTradelinkOrgEntityResponse = z10.object({
939
1285
  tradelinkId: zTradelinkId,
940
- name: z7.string().describe("Name"),
941
- code: z7.string().describe("Code"),
942
- logoUrl: z7.string().describe("Logo URL")
1286
+ name: z10.string().meta({ description: "Name" }),
1287
+ code: z10.string().meta({ description: "Code" }),
1288
+ logoUrl: z10.string().meta({ description: "Logo URL" })
943
1289
  });
944
1290
  zTradelinkOrgEntityResponse.omit({
945
1291
  tradelinkId: true
946
1292
  });
947
- z7.object({
1293
+ z10.object({
948
1294
  tradelinkId: zTradelinkId
949
1295
  });
950
- var zTradelinkExchangeConfig = z7.object({
951
- exchangeId: z7.string().describe("Tradelink exchange id"),
952
- repledgeAuthorized: z7.boolean().describe("Determines whether this exchange is authorized to repledge on this account"),
953
- needsAssetManagerApprovalForSettlements: z7.boolean().describe(
954
- 'Determines whether asset manager will "pre-approve" the settlement requests on this account'
955
- )
1296
+ var zTradelinkExchangeConfig = z10.object({
1297
+ exchangeId: z10.string().meta({ description: "Tradelink exchange id" }),
1298
+ repledgeAuthorized: z10.boolean().meta({
1299
+ description: "Determines whether this exchange is authorized to repledge on this account"
1300
+ }),
1301
+ needsAssetManagerApprovalForSettlements: z10.boolean().meta({
1302
+ description: 'Determines whether asset manager will "pre-approve" the settlement requests on this account'
1303
+ })
956
1304
  });
957
- var zTradelinkExchangeConfigs = z7.array(zTradelinkExchangeConfig);
958
- z7.object({
1305
+ var zTradelinkExchangeConfigs = z10.array(zTradelinkExchangeConfig);
1306
+ z10.object({
959
1307
  workspaceName: zWorkspaceName,
960
- custodian: z7.object({ name: z7.string() }),
961
- assetManagers: z7.array(z7.object({ name: z7.string() })),
962
- exchanges: z7.array(z7.object({ name: z7.string() }))
1308
+ custodian: z10.object({ name: z10.string() }),
1309
+ assetManagers: z10.array(z10.object({ name: z10.string() })),
1310
+ exchanges: z10.array(z10.object({ name: z10.string() }))
963
1311
  });
964
- z7.object({
965
- tradelinkId: z7.string(),
1312
+ z10.object({
1313
+ tradelinkId: z10.string(),
966
1314
  workspaceName: zWorkspaceName,
967
1315
  custodian: zTradelinkOrgEntityResponse,
968
- assetManagers: z7.array(zTradelinkOrgEntityResponse),
969
- exchanges: z7.array(zTradelinkOrgEntityResponse)
1316
+ assetManagers: z10.array(zTradelinkOrgEntityResponse),
1317
+ exchanges: z10.array(zTradelinkOrgEntityResponse)
970
1318
  });
971
- var zTradelinkAsset = z7.object({
972
- name: z7.string(),
973
- magnitude: z7.number().int().nonnegative()
1319
+ var zTradelinkAsset = z10.object({
1320
+ name: z10.string(),
1321
+ magnitude: z10.number().int().nonnegative()
974
1322
  });
975
- z7.object({
1323
+ z10.object({
976
1324
  tradelinkId: zTradelinkId,
977
1325
  asset: zTradelinkAsset,
978
- state: z7.enum([
1326
+ state: z10.enum([
979
1327
  "PLEDGE_READY",
980
1328
  "PLEDGE_INCREMENT_PENDING_APPROVAL",
981
1329
  "PLEDGE_APPROVED",
@@ -992,28 +1340,28 @@ z7.object({
992
1340
  "RECOVERING_FROM_FAILURE",
993
1341
  "PLEDGE_CONSUMED"
994
1342
  ]),
995
- isLocked: z7.boolean(),
996
- amount: z7.string().describe("Currently pledged amount"),
997
- pending: z7.string().describe("Requested pledge increment, not yet approved"),
998
- repledge: z7.string().describe("TODO: describe this field"),
999
- exchangeTradelinkId: z7.string(),
1000
- accountId: z7.string()
1001
- });
1002
- z7.object({
1003
- workspaceName: z7.string(),
1004
- clientAccountId: z7.string().describe("Account ID from the client side"),
1343
+ isLocked: z10.boolean(),
1344
+ amount: z10.string().meta({ description: "Currently pledged amount" }),
1345
+ pending: z10.string().meta({ description: "Requested pledge increment, not yet approved" }),
1346
+ repledge: z10.string().meta({ description: "TODO: describe this field" }),
1347
+ exchangeTradelinkId: z10.string(),
1348
+ accountId: z10.string()
1349
+ });
1350
+ z10.object({
1351
+ workspaceName: z10.string(),
1352
+ clientAccountId: z10.string().meta({ description: "Account ID from the client side" }),
1005
1353
  exchangeTradelinkId: zTradelinkId,
1006
1354
  asset: zTradelinkAsset
1007
1355
  });
1008
- z7.object({
1356
+ z10.object({
1009
1357
  pledgeTradelinkId: zTradelinkId,
1010
1358
  amount: zUnsignedIntString,
1011
1359
  asset: zTradelinkAsset
1012
1360
  });
1013
- z7.object({
1014
- tradelinkId: z7.string(),
1015
- pledgeTradelinkId: z7.string(),
1016
- state: z7.enum([
1361
+ z10.object({
1362
+ tradelinkId: z10.string(),
1363
+ pledgeTradelinkId: z10.string(),
1364
+ state: z10.enum([
1017
1365
  "REGISTERED",
1018
1366
  "PENDING_REPLEDGE_CREATION_APPROVAL",
1019
1367
  "PENDING_REPLEDGE_APPROVAL",
@@ -1027,297 +1375,272 @@ z7.object({
1027
1375
  "CANCELED"
1028
1376
  ]),
1029
1377
  // For now we only consider the outbound settlement
1030
- outboundTransactionHash: z7.string().nullable()
1378
+ outboundTransactionHash: z10.string().nullable()
1031
1379
  });
1032
1380
 
1033
1381
  // src/tradelink/request-data.ts
1034
- var zCustodianRequestData = z7.object({
1035
- settlement: zReviewStepWithUsersArray.describe("List of settlement review steps"),
1036
- withdraw: zReviewStepWithUsersArray.describe("List of withdraw review steps"),
1037
- arbitration: zReviewStepWithUsersArray.describe("List of arbitration review steps")
1038
- });
1039
- var zTradelinkEntityRequestData = z7.object({
1040
- tradelinkId: z7.string().min(1),
1041
- groups: zReviewStepWithUsersArray.describe("List of asset manager review groups"),
1042
- whitelist: z7.array(zTradelinkWhitelistAddress).describe("List of asset manager whitelisted addresses")
1043
- });
1044
- var zAdjustPledgeRequestData = z7.object({
1045
- accountId: z7.string().describe("Account id"),
1046
- exchangeId: z7.string().describe("Exchange id"),
1047
- amount: zIntString.describe("Amount to add to pledge")
1048
- });
1049
- var zRepledgeRequestData = z7.object({
1050
- accountId: z7.string().describe("Account id"),
1051
- exchangeId: z7.string().describe("Exchange id"),
1052
- amount: zIntString.describe("Amount to add to pledge")
1053
- });
1054
- var zCreateSettlementRequestData = z7.object({
1055
- accountId: z7.string().describe("Account id"),
1056
- exchangeId: z7.string().describe("Exchange id"),
1382
+ var zTradelinkActivateAccountRequestData = z10.null();
1383
+ var zTradelinkCustodianRequestData = z10.object({
1384
+ settlement: zReviewStepWithUsersArray.meta({ description: "List of settlement review steps" }),
1385
+ withdraw: zReviewStepWithUsersArray.meta({ description: "List of withdraw review steps" }),
1386
+ arbitration: zReviewStepWithUsersArray.meta({ description: "List of arbitration review steps" })
1387
+ });
1388
+ var zTradelinkEntityRequestData = z10.object({
1389
+ tradelinkId: z10.string().min(1),
1390
+ groups: zReviewStepWithUsersArray.meta({ description: "List of asset manager review groups" }),
1391
+ whitelist: z10.array(zTradelinkWhitelistAddress).meta({ description: "List of asset manager whitelisted addresses" })
1392
+ });
1393
+ var zTradelinkAdjustPledgeRequestData = z10.object({
1394
+ accountId: z10.string().meta({ description: "Account id" }),
1395
+ exchangeId: z10.string().meta({ description: "Exchange id" }),
1396
+ amount: zIntString.meta({ description: "Amount to add to pledge" })
1397
+ });
1398
+ var zTradelinkRepledgeRequestData = z10.object({
1399
+ accountId: z10.string().meta({ description: "Account id" }),
1400
+ exchangeId: z10.string().meta({ description: "Exchange id" }),
1401
+ amount: zIntString.meta({ description: "Amount to add to pledge" })
1402
+ });
1403
+ var zTradelinkCreateSettlementRequestData = z10.object({
1404
+ accountId: z10.string().meta({ description: "Account id" }),
1405
+ exchangeId: z10.string().meta({ description: "Exchange id" }),
1057
1406
  transaction: zSendOnlyTransactionData
1058
1407
  });
1059
- var zForceUnpledgeRequestData = z7.object({
1060
- accountId: z7.string().describe("Account id"),
1061
- exchangeId: z7.string().describe("Exchange id")
1408
+ var zTradelinkForceUnpledgeRequestData = z10.object({
1409
+ accountId: z10.string().meta({ description: "Account id" }),
1410
+ exchangeId: z10.string().meta({ description: "Exchange id" })
1062
1411
  });
1063
- var zTradelinkWithdrawRequestData = z7.object({
1064
- accountId: z7.string().describe("Account id"),
1412
+ var zTradelinkWithdrawRequestData = z10.object({
1413
+ accountId: z10.string().meta({ description: "Account id" }),
1065
1414
  transaction: zSendOnlyTransactionData
1066
1415
  });
1067
- var zTradelinkArbitrationRequestData = z7.object({
1068
- accountId: z7.string().describe("Account id"),
1416
+ var zTradelinkArbitrationRequestData = z10.object({
1417
+ accountId: z10.string().meta({ description: "Account id" }),
1069
1418
  transaction: zSendOnlyTransactionData
1070
1419
  });
1071
-
1072
- // src/accounts/account-governance-fields.ts
1073
- var zClassicAccountGovernanceFields = z.object({
1074
- type: z.literal(AccountGovernanceType.CLASSIC).describe("Classic account governance"),
1075
- policyId: z.string().describe("Identifier of corresponding governance policy")
1076
- }).describe("Classic");
1077
- var zTradelinkAccountGovernanceFields = z.object({
1078
- type: z.literal(AccountGovernanceType.TRADELINK).describe("Tradelink account governance"),
1079
- assetManagerId: z.string().describe("Identifier of corresponding asset manager"),
1080
- exchangeConfigs: zTradelinkExchangeConfigs.describe("Tradelink exchange configurations")
1081
- }).describe("Tradelink");
1082
- var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).describe("Governance fields");
1083
- var zCardanoLikeStakingData = z7.object({
1084
- staked: z7.string().describe("Staked balance")
1085
- }).nullable().describe("Cardano-like staking data");
1086
- var zCardanoLikeStakingFields = z7.object({
1087
- type: z7.literal(AccountType.CARDANO_LIKE).describe("Account type"),
1088
- staking: zCardanoLikeStakingData.optional()
1089
- });
1090
- var zEthereumLikeStakingData = z7.object({
1091
- totalStaking: z7.string().describe("Total staked amount"),
1092
- totalRewards: z7.string().describe("Total of rewards"),
1093
- availableRewards: z7.string().describe("Available rewards"),
1094
- networkApy: z7.number().describe("Network APY")
1095
- }).nullable().describe("Ethereum-like staking data");
1096
- var zEthereumLikeStakingFields = z7.object({
1097
- type: z7.literal(AccountType.ETHEREUM_LIKE).describe("Account type"),
1098
- staking: zEthereumLikeStakingData.optional()
1099
- });
1100
- var zPolkadotUnbondingAmount = z7.object({
1101
- amount: z7.string().describe("Amount"),
1102
- waiting_time: z7.string().describe("Waiting time")
1103
- });
1104
- var zPolkadotLikeStakingData = z7.object({
1105
- info: z7.object({
1106
- controllerAddress: z7.string().nullable().describe("Controller address"),
1107
- rewardsDestination: z7.string().nullable().describe("Rewards destination"),
1108
- proxies: z7.array(z7.string()).describe("Proxies"),
1109
- legacyStaking: z7.boolean().describe("True if account uses legacy staking"),
1110
- isNominator: z7.boolean().describe("True if is nominator")
1420
+ var zTradelinkRequestMixinsByType = {
1421
+ [RequestType.TRADELINK_ACTIVATE_ACCOUNT]: z10.object({
1422
+ type: z10.literal(RequestType.TRADELINK_ACTIVATE_ACCOUNT),
1423
+ targetId: z10.string(),
1424
+ data: zTradelinkActivateAccountRequestData
1111
1425
  }),
1112
- balances: z7.object({
1113
- free: z7.string().describe("Free balance"),
1114
- reserved: z7.string().describe("Reserved balance"),
1115
- frozen: z7.string().describe("Frozen balance"),
1116
- bonded: z7.string().describe("Bonded balance"),
1117
- available: z7.string().describe("Available balance"),
1118
- unbonding: z7.array(zPolkadotUnbondingAmount).describe("Unbonding balances"),
1119
- unbonded: z7.array(zPolkadotUnbondingAmount).describe("Unbonded balances"),
1120
- totalUnbonding: z7.string().describe("Total unbonding"),
1121
- totalUnbonded: z7.string().describe("Total unbonded")
1426
+ [RequestType.TRADELINK_CREATE_CUSTODIAN]: z10.object({
1427
+ type: z10.literal(RequestType.TRADELINK_CREATE_CUSTODIAN),
1428
+ data: zTradelinkCustodianRequestData
1122
1429
  }),
1123
- anonymousProxy: z7.object({
1124
- address: z7.string().describe("Address"),
1125
- createdAt: z7.string().describe("Creation date"),
1126
- isController: z7.boolean().describe("True if is controller"),
1127
- isMain: z7.boolean().describe("True if is main"),
1128
- balances: z7.object({
1129
- free: z7.string().describe("Anonymous proxy free balance"),
1130
- reserved: z7.string().describe("Anonymous proxy reserved balance"),
1131
- frozen: z7.string().describe("Anonymous proxy frozen balance"),
1132
- bonded: z7.string().describe("Anonymous proxy bonded balance"),
1133
- available: z7.string().describe("Anonymous proxy available balance"),
1134
- total: z7.string().describe("Anonymous proxy total balance")
1135
- }).nullable(),
1136
- blockHeight: z7.string().describe("Anonymous proxy block height"),
1137
- extIndex: z7.string().describe("Ext index"),
1138
- index: z7.string().describe("Index"),
1139
- kind: z7.string().describe("Kind")
1140
- }).nullable().describe("Anonymous proxy")
1141
- }).nullable().describe("Polkadot-like staking data");
1142
- var zPolkadotLikeStakingFields = z7.object({
1143
- type: z7.literal(AccountType.POLKADOT_LIKE).describe("Account type"),
1144
- staking: zPolkadotLikeStakingData.optional()
1145
- });
1146
- var zSolanaStakingAccountStatus = z7.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).describe("Staking account status");
1147
- var zSolanaLikeStakingData = z7.object({
1148
- staked: z7.string().describe("Staked balance"),
1149
- rewards: z7.object({
1150
- total: z7.string().describe("Total rewards"),
1151
- last7: z7.string().describe("Rewards on last 7 days"),
1152
- last30: z7.string().describe("Rewards on last 30 days")
1430
+ [RequestType.TRADELINK_EDIT_CUSTODIAN]: z10.object({
1431
+ type: z10.literal(RequestType.TRADELINK_EDIT_CUSTODIAN),
1432
+ targetId: z10.string(),
1433
+ data: zTradelinkCustodianRequestData
1153
1434
  }),
1154
- stakes: z7.array(
1155
- z7.object({
1156
- uid: z7.string(),
1157
- baseAccountUid: z7.string(),
1158
- pubKey: z7.string().describe("Public key"),
1159
- validatorPubKey: z7.string().nullable().describe("Validator public key"),
1160
- initialAmount: z7.string().describe("Initial amount"),
1161
- activeAmount: z7.string().describe("Active amount"),
1162
- inactiveAmount: z7.string().describe("Inactive amount"),
1163
- totalBalance: z7.string().describe("Total balance"),
1164
- creationDate: z7.string().describe("Creation date"),
1165
- activationEpoch: z7.string().nullable().describe("Activation epoch"),
1166
- activationDate: z7.string().nullable().describe("Activation date"),
1167
- deactivationEpoch: z7.string().nullable().describe("Deactivation epoch"),
1168
- deactivationDate: z7.string().nullable().describe("Deactivation date"),
1169
- status: zSolanaStakingAccountStatus,
1170
- rentExemptReserve: z7.string().describe("Rent exempt reserve"),
1171
- withdrawableAmount: z7.string().describe("Withdrawable amount"),
1172
- totalRewards: z7.string().describe("Total rewards"),
1173
- creationTxHash: z7.string().nullable().describe("Creation transaction hash"),
1174
- actionsTxHashes: z7.array(z7.string()).describe("Actions transactions hashes")
1175
- })
1176
- )
1177
- }).nullable().describe("Solana-like staking data");
1178
- var zSolanaLikeStakingFields = z7.object({
1179
- type: z7.literal(AccountType.SOLANA_LIKE).describe("Account type"),
1180
- staking: zSolanaLikeStakingData.optional()
1435
+ [RequestType.TRADELINK_CREATE_EXCHANGE]: z10.object({
1436
+ type: z10.literal(RequestType.TRADELINK_CREATE_EXCHANGE),
1437
+ data: zTradelinkEntityRequestData
1438
+ }),
1439
+ [RequestType.TRADELINK_EDIT_EXCHANGE]: z10.object({
1440
+ type: z10.literal(RequestType.TRADELINK_EDIT_EXCHANGE),
1441
+ targetId: z10.string(),
1442
+ data: zTradelinkEntityRequestData
1443
+ }),
1444
+ [RequestType.TRADELINK_CREATE_ASSET_MANAGER]: z10.object({
1445
+ type: z10.literal(RequestType.TRADELINK_CREATE_ASSET_MANAGER),
1446
+ data: zTradelinkEntityRequestData
1447
+ }),
1448
+ [RequestType.TRADELINK_EDIT_ASSET_MANAGER]: z10.object({
1449
+ type: z10.literal(RequestType.TRADELINK_EDIT_ASSET_MANAGER),
1450
+ targetId: z10.string(),
1451
+ data: zTradelinkEntityRequestData
1452
+ }),
1453
+ [RequestType.TRADELINK_ADJUST_PLEDGE]: z10.object({
1454
+ type: z10.literal(RequestType.TRADELINK_ADJUST_PLEDGE),
1455
+ data: zTradelinkAdjustPledgeRequestData
1456
+ }),
1457
+ [RequestType.TRADELINK_REPLEDGE]: z10.object({
1458
+ type: z10.literal(RequestType.TRADELINK_REPLEDGE),
1459
+ data: zTradelinkRepledgeRequestData
1460
+ }),
1461
+ [RequestType.TRADELINK_CREATE_SETTLEMENT]: z10.object({
1462
+ type: z10.literal(RequestType.TRADELINK_CREATE_SETTLEMENT),
1463
+ data: zTradelinkCreateSettlementRequestData,
1464
+ meta: z10.object({
1465
+ hash: z10.string().nullable()
1466
+ }).optional().nullable()
1467
+ }),
1468
+ [RequestType.TRADELINK_FORCE_UNPLEDGE]: z10.object({
1469
+ type: z10.literal(RequestType.TRADELINK_FORCE_UNPLEDGE),
1470
+ data: zTradelinkForceUnpledgeRequestData
1471
+ }),
1472
+ [RequestType.TRADELINK_WITHDRAW]: z10.object({
1473
+ type: z10.literal(RequestType.TRADELINK_WITHDRAW),
1474
+ data: zTradelinkWithdrawRequestData,
1475
+ meta: z10.object({
1476
+ hash: z10.string().nullable()
1477
+ }).optional().nullable()
1478
+ }),
1479
+ [RequestType.TRADELINK_ARBITRATE]: z10.object({
1480
+ type: z10.literal(RequestType.TRADELINK_ARBITRATE),
1481
+ data: zTradelinkArbitrationRequestData,
1482
+ meta: z10.object({
1483
+ hash: z10.string().nullable()
1484
+ }).optional().nullable()
1485
+ })
1486
+ };
1487
+ var zMessageType = z10.enum(MessageType).meta({ description: "Type of the message to sign" });
1488
+ var zMessageData = zHexString.nonempty().meta({
1489
+ description: "Hex data to sign, either a json string for EIP712, or a raw string for EIP191"
1490
+ });
1491
+ var zMessage = z10.object({
1492
+ type: zMessageType,
1493
+ data: zMessageData
1494
+ });
1495
+ z10.object({
1496
+ id: z10.string().meta({ description: "Unique identifier" }),
1497
+ type: zMessageType,
1498
+ data: zMessageData,
1499
+ address: z10.string().meta({ description: "Address of the signing key" }),
1500
+ derivationPath: z10.string().meta({ description: "Derivation path of the signing key" }),
1501
+ signature: zHsmSignature.meta({ description: "Signature of the message" }),
1502
+ createdById: z10.string().meta({ description: "ID of the creator" }),
1503
+ createdAt: z10.coerce.date().meta({ description: "Creation timestamp" })
1504
+ }).meta({ description: "Signed message", id: "SignedMessageResponse" });
1505
+ var zCreateTransactionRequestData = z10.object({
1506
+ accountId: z10.string().min(1).meta({ description: "Target account id" }),
1507
+ transaction: zTransactionData
1508
+ }).meta({
1509
+ description: "Create transaction request data",
1510
+ id: "CreateTransactionRequestData"
1181
1511
  });
1182
- var zTezosLikeStakingData = z7.object({
1183
- delegations: z7.array(
1184
- z7.object({
1185
- address: z7.string()
1186
- })
1187
- )
1188
- }).nullable().describe("Tezos-like staking data");
1189
- var zTezosLikeStakingFields = z7.object({
1190
- type: z7.literal(AccountType.TEZOS_LIKE).describe("Account type"),
1191
- staking: zTezosLikeStakingData.optional()
1512
+ var zSignMessageRequestData = z10.object({
1513
+ message: zMessage.meta({ description: "Message to sign" }),
1514
+ accountId: z10.string().min(1).meta({ description: "Target account id" }),
1515
+ address: z10.string().nonempty().meta({ description: "Address with which to sign the message" }),
1516
+ derivationPath: z10.string().nonempty().meta({ description: "Derivation path of the signing address" })
1192
1517
  });
1193
- z7.discriminatedUnion("type", [
1194
- zCardanoLikeStakingFields,
1195
- zEthereumLikeStakingFields,
1196
- zPolkadotLikeStakingFields,
1197
- zSolanaLikeStakingFields,
1198
- zTezosLikeStakingFields
1199
- ]);
1518
+ var zSignMessageUserInputData = zSignMessageRequestData.partial({
1519
+ address: true,
1520
+ derivationPath: true
1521
+ });
1522
+ var zDigestData = z10.object({
1523
+ digest: zHexString.meta({ description: "The hex string digest to sign" }),
1524
+ derivationPath: z10.string().nonempty().meta({ description: "The derivation path with which to sign the digest" })
1525
+ });
1526
+ var zSignDigestsRequestData = z10.object({
1527
+ accountId: z10.string().min(1).meta({ description: "Target account id" }),
1528
+ digests: z10.array(zDigestData).meta({ description: "The digests to sign" })
1529
+ });
1530
+ z10.object({
1531
+ signatures: z10.array(zHsmSignature)
1532
+ });
1533
+
1534
+ // src/accounts/account-governance-fields.ts
1535
+ var zClassicAccountGovernanceFields = z.object({
1536
+ type: z.literal(AccountGovernanceType.CLASSIC).meta({ description: "Classic account governance" }),
1537
+ policyId: z.string().meta({ description: "Identifier of corresponding governance policy" })
1538
+ }).meta({ description: "Classic" });
1539
+ var zTradelinkAccountGovernanceFields = z.object({
1540
+ type: z.literal(AccountGovernanceType.TRADELINK).meta({ description: "Tradelink account governance" }),
1541
+ assetManagerId: z.string().meta({ description: "Identifier of corresponding asset manager" }),
1542
+ exchangeConfigs: zTradelinkExchangeConfigs.meta({
1543
+ description: "Tradelink exchange configurations"
1544
+ })
1545
+ }).meta({ description: "Tradelink" });
1546
+ var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).meta({ description: "Governance fields" });
1200
1547
 
1201
1548
  // src/accounts/types.ts
1202
- var zAccountCommonFields = z7.object({
1203
- id: z7.string().describe("Internal unique identifier"),
1204
- legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
1205
- name: z7.string().describe("Name"),
1549
+ var zAccountCommonFields = z10.object({
1550
+ id: z10.string().meta({ description: "Internal unique identifier" }),
1551
+ legacyId: z10.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
1552
+ name: z10.string().meta({ description: "Name" }),
1206
1553
  currency: zCurrencyString,
1207
1554
  network: zNetwork,
1208
- contractAddress: z7.string().describe("Token contract address for Token account").nullable(),
1209
- index: z7.number().gte(0).describe("BIP44 account index"),
1210
- derivationPath: z7.string().describe("Derivation path"),
1211
- status: z7.nativeEnum(ActivationStatus).describe("Status"),
1212
- createdAt: z7.coerce.date().describe("Creation timestamp"),
1213
- updatedAt: z7.coerce.date().describe("Last modification timestamp")
1214
- });
1215
- var zAccountBalanceFields = z7.object({
1216
- total: z7.string().describe("Total balance"),
1217
- pending: z7.string().describe("Pending balance")
1218
- }).describe("Balance fields");
1555
+ contractAddress: z10.string().nullable().meta({ description: "Token contract address for Token account" }),
1556
+ index: z10.number().gte(0).meta({ description: "BIP44 account index" }),
1557
+ derivationPath: z10.string().meta({ description: "Derivation path" }),
1558
+ status: z10.enum(ActivationStatus).meta({ description: "Status" }),
1559
+ createdAt: z10.coerce.date().meta({ description: "Creation timestamp" }),
1560
+ updatedAt: z10.coerce.date().meta({ description: "Last modification timestamp" })
1561
+ });
1562
+ var zRawSigningAssetFields = z10.object({ type: z10.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" }) }).meta({ description: "Raw signing account" });
1563
+ var zAccountAssetFields = z10.discriminatedUnion("type", [zRawSigningAssetFields, ...zNetworkAssetFields.options]).meta({ description: "Account asset fields" });
1219
1564
  var zAccountResponse = zAccountCommonFields.extend({
1220
- asset: zAccountAssetStaticFields,
1565
+ asset: zAccountAssetFields,
1221
1566
  governance: zAccountGovernanceFields
1222
1567
  });
1223
- z7.enum([
1568
+ z10.enum([
1224
1569
  "name",
1225
1570
  "currency",
1226
1571
  "index",
1227
1572
  "createdAt",
1228
1573
  "updatedAt"
1229
1574
  ]).default("createdAt");
1230
- var zCommonLiveData = z7.object({
1231
- id: z7.string().describe("Account internal unique identifier"),
1232
- balance: zAccountBalanceFields
1233
- });
1234
- var zBitcoinLikeLiveData = zCommonLiveData.extend({
1235
- type: z7.literal(AccountType.BITCOIN_LIKE).describe("Account type")
1236
- }).describe("Bitcoin-like");
1237
- var zCardanoLikeLiveData = zCommonLiveData.merge(zCardanoLikeStakingFields).describe("Cardano-like");
1238
- var zEthereumLikeLiveData = zCommonLiveData.merge(zEthereumLikeStakingFields).describe("Ethereum-like");
1239
- var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
1240
- type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).describe("Account type")
1241
- }).describe("Ethereum-like token");
1242
- var zGenericLikeLiveData = zCommonLiveData.extend({
1243
- type: z7.literal(AccountType.GENERIC_LIKE).describe("Account type")
1244
- }).describe("Generic-like");
1245
- var zPolkadotLikeLiveData = zCommonLiveData.merge(zPolkadotLikeStakingFields).describe("Polkadot-like");
1246
1575
  var zRawSigningLiveData = zCommonLiveData.extend({
1247
- type: z7.literal(AccountType.RAW_SIGNING).describe("Account type")
1248
- }).describe("Raw signing account");
1249
- var zRippleLikeLiveData = zCommonLiveData.extend({
1250
- type: z7.literal(AccountType.RIPPLE_LIKE).describe("Account type")
1251
- }).describe("Ripple-like");
1252
- var zSolanaLikeLiveData = zCommonLiveData.merge(zSolanaLikeStakingFields).describe("Solana-like");
1253
- var zStellarLikeLiveData = zCommonLiveData.extend({
1254
- type: z7.literal(AccountType.STELLAR_LIKE).describe("Account type")
1255
- }).describe("Stellar-like");
1256
- var zSuiLikeLiveData = zCommonLiveData.extend({
1257
- type: z7.literal(AccountType.SUI_LIKE).describe("Account type")
1258
- }).describe("Sui-like");
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");
1263
- z7.discriminatedUnion("type", [
1264
- zBitcoinLikeLiveData,
1265
- zCardanoLikeLiveData,
1266
- zEthereumLikeLiveData,
1267
- zEthereumTokenLikeLiveData,
1268
- zGenericLikeLiveData,
1269
- zPolkadotLikeLiveData,
1576
+ type: z10.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" })
1577
+ }).meta({ description: "Raw signing account" });
1578
+ z10.discriminatedUnion("type", [
1270
1579
  zRawSigningLiveData,
1271
- zRippleLikeLiveData,
1272
- zSolanaLikeLiveData,
1273
- zStellarLikeLiveData,
1274
- zSuiLikeLiveData,
1275
- zTezosLikeLiveData,
1276
- zTronLikeLiveData
1580
+ ...zAccountLiveData.options
1277
1581
  ]);
1278
- z7.object({
1279
- address: z7.string().describe("Address"),
1280
- derivationPath: z7.string().nullable().describe("Derivation path")
1582
+ z10.object({
1583
+ address: z10.string().meta({ description: "Address" }),
1584
+ derivationPath: z10.string().nullable().meta({ description: "Derivation path" })
1281
1585
  });
1282
- z7.object({
1283
- amount: zIntString.describe("Amount in the smallest unit of the currency"),
1586
+ z10.object({
1587
+ amount: zIntString.meta({ description: "Amount in the smallest unit of the currency" }),
1284
1588
  currency: zCurrency
1285
1589
  });
1590
+ z10.object({
1591
+ id: z10.string().nonempty().meta({ description: "Staking position ID (if applicable)" }),
1592
+ validator: z10.string().nonempty().meta({ description: "Validator address" }),
1593
+ state: z10.enum(["ACTIVE", "INACTIVE", "ACTIVATING", "DEACTIVATING", "UNKNOWN"]).meta({ description: "Stake state" }),
1594
+ staked: z10.string().meta({ description: "Staked amount" }),
1595
+ rewards: z10.object({
1596
+ total: z10.string().meta({ description: "Total rewards" })
1597
+ })
1598
+ });
1599
+ z10.object({
1600
+ address: z10.string().meta({ description: "Validator address" }),
1601
+ apy: z10.string().nullable().meta({ description: "Validator APY" }),
1602
+ balance: z10.string().nullable().meta({ description: "Validator balance" }),
1603
+ commissionRate: z10.string().nullable().meta({ description: "Validator commission rate" }),
1604
+ description: z10.string().nullable().meta({ description: "Description" }),
1605
+ logo: z10.string().nullable().meta({ description: "Logo URL" }),
1606
+ name: z10.string().nullable().meta({ description: "Validator name" }),
1607
+ url: z10.string().nullable().meta({ description: "Validator URL" })
1608
+ });
1286
1609
 
1287
1610
  // src/accounts/app-types.ts
1288
- z7.discriminatedUnion(
1289
- zTransactionResponse.discriminator,
1611
+ z10.discriminatedUnion(
1612
+ zTransactionResponse._zod.def.discriminator,
1290
1613
  ensureNonEmptyArray(
1291
1614
  zTransactionResponse.options.map(
1292
1615
  (_) => _.extend({
1293
- note: zNote.nullable().describe("Optional transaction note")
1616
+ note: zNote.nullable().meta({ description: "Optional transaction note" })
1294
1617
  })
1295
1618
  )
1296
1619
  )
1297
1620
  );
1298
- var zWhitelistAddress = z7.object({
1299
- name: z7.string().min(1).max(50),
1621
+ var zWhitelistAddress = z10.object({
1622
+ name: z10.string().min(1).max(50),
1300
1623
  currency: zCurrencyString,
1301
- address: z7.string().min(1).max(200),
1624
+ address: z10.string().min(1).max(200),
1302
1625
  // Destination tags are numeric-only or alpha-numeric.
1303
1626
  // Empty array (or undefined) means no check on destination tag.
1304
- destinationTags: z7.array(z7.string().min(1).regex(/^\w+$/)).optional()
1627
+ destinationTags: z10.array(z10.string().min(1).regex(/^\w+$/)).optional()
1305
1628
  });
1306
- var zWhitelistAddresses = z7.array(zWhitelistAddress);
1307
- var zWhitelistName = z7.string().min(1).max(45).describe("Whitelist name");
1308
- var zCreateWhitelistRequestData = z7.object({
1629
+ var zWhitelistAddresses = z10.array(zWhitelistAddress);
1630
+ var zWhitelistName = z10.string().min(1).max(45).meta({ description: "Whitelist name" });
1631
+ var zCreateWhitelistRequestData = z10.object({
1309
1632
  name: zWhitelistName,
1310
- description: z7.string().nullable(),
1633
+ description: z10.string().nullable(),
1311
1634
  addresses: zWhitelistAddresses,
1312
- type: z7.nativeEnum(WhitelistType)
1635
+ type: z10.enum(WhitelistType)
1313
1636
  });
1314
- var zEditWhitelistRequestData = z7.object({
1637
+ var zEditWhitelistRequestData = z10.object({
1315
1638
  name: zWhitelistName,
1316
1639
  addresses: zWhitelistAddresses
1317
1640
  });
1318
1641
 
1319
1642
  // src/policies/db-utils.ts
1320
- var zBaseGovRuleData = z7.object({
1643
+ var zBaseGovRuleData = z10.object({
1321
1644
  // Steps of users that will need to review operations
1322
1645
  reviewSteps: zReviewStepsArray,
1323
1646
  // Optional threshold on transaction value: null `min` = 0, null `max` = +inf
@@ -1326,93 +1649,98 @@ var zBaseGovRuleData = z7.object({
1326
1649
  whitelistIds: policy_exports.zWhitelistIds.optional()
1327
1650
  });
1328
1651
  var zClassicGovRuleData = zBaseGovRuleData.extend({
1329
- operationType: zClassicOperationType.describe("Allowed operation type")
1330
- }).describe("Account governance rule");
1652
+ operationType: zClassicOperationType.meta({ description: "Allowed operation type" })
1653
+ }).meta({ description: "Account governance rule", id: "ClassicGovRuleData" });
1331
1654
  zBaseGovRuleData.extend({
1332
- operationType: zOperationType.describe("Allowed operation type")
1333
- }).describe("Governance rule");
1655
+ operationType: zOperationType.meta({ description: "Allowed operation type" })
1656
+ }).meta({ description: "Governance rule", id: "GovRuleResponse" });
1334
1657
  ({
1335
1658
  reviewConfigs: { include: review_config_exports.INCLUDE_MEMBERS }
1336
1659
  });
1337
- var zPolicyName = z7.string().min(1).max(19).describe("Policy name");
1338
- var zCurrency2 = z7.string().min(1).max(40).regex(/^\w+$/).describe("Currency");
1339
- var zCreatePublicPolicyRequestData = z7.object({
1660
+ var zPolicyName = z10.string().min(1).max(19).meta({ description: "Policy name" });
1661
+ var zCurrency2 = z10.string().min(1).max(40).regex(/^\w+$/).meta({ description: "Currency" });
1662
+ var zCreatePublicPolicyRequestData = z10.object({
1340
1663
  name: zPolicyName,
1341
- description: z7.string().nullable().describe("Description"),
1664
+ description: z10.string().nullable().meta({ description: "Description" }),
1342
1665
  currency: zCurrency2.nullable(),
1343
- govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
1666
+ govRules: z10.array(zClassicGovRuleData).meta({ description: "Governance rules" })
1344
1667
  });
1345
- var zEditPublicPolicyRequestData = z7.object({
1668
+ var zEditPublicPolicyRequestData = z10.object({
1346
1669
  name: zPolicyName,
1347
- description: z7.string().nullable().describe("Description"),
1348
- govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
1670
+ description: z10.string().nullable().meta({ description: "Description" }),
1671
+ govRules: z10.array(zClassicGovRuleData).meta({ description: "Governance rules" })
1349
1672
  });
1350
- var zAccountName = z7.string().min(1).max(40).describe("Account name");
1351
- var zSignDigestsGovRuleData = z7.object({
1352
- operationType: z7.literal("SIGN_DIGESTS"),
1673
+ var zAccountName = z10.string().min(1).max(40).meta({ description: "Account name" });
1674
+ var zSignDigestsGovRuleData = z10.object({
1675
+ operationType: z10.literal("SIGN_DIGESTS"),
1353
1676
  reviewSteps: zReviewStepWithUsersArray
1354
1677
  // we need to control for API users only
1355
- }).describe("Digest signing rule");
1356
- var zAccountPolicyRequestData = z7.union([
1357
- z7.object({ policyId: z7.string() }).describe("Account policy"),
1358
- z7.object({ rules: z7.array(zClassicGovRuleData) }).describe("Account governance rules")
1359
- ]).describe("Account policy or governance rules");
1360
- var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
1361
- z7.object({
1362
- type: z7.literal(AccountGovernanceType.CLASSIC),
1678
+ }).meta({ description: "Digest signing rule" });
1679
+ var zAccountPolicyRequestData = z10.union([
1680
+ z10.object({ policyId: z10.string() }).meta({ description: "Account policy" }),
1681
+ z10.object({ rules: z10.array(zClassicGovRuleData) }).meta({ description: "Account governance rules" })
1682
+ ]).meta({ description: "Account policy or governance rules" });
1683
+ var zCreateAccountGovernanceData = z10.discriminatedUnion("type", [
1684
+ z10.object({
1685
+ type: z10.literal(AccountGovernanceType.CLASSIC),
1363
1686
  policy: zAccountPolicyRequestData
1364
- }).describe("Classic governance"),
1365
- z7.object({
1366
- type: z7.literal(AccountGovernanceType.TRADELINK),
1367
- assetManagerId: z7.string(),
1687
+ }).meta({ description: "Classic governance" }),
1688
+ z10.object({
1689
+ type: z10.literal(AccountGovernanceType.TRADELINK),
1690
+ assetManagerId: z10.string(),
1368
1691
  exchangeConfigs: zTradelinkExchangeConfigs
1369
- }).describe("Tradelink governance"),
1370
- z7.object({
1371
- type: z7.literal(AccountGovernanceType.RAW_SIGNING),
1372
- policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
1373
- }).describe("Raw signing governance")
1374
- ]).describe("Governance fields");
1375
- var zCreateAccountUserInputData = z7.object({
1692
+ }).meta({ description: "Tradelink governance" }),
1693
+ z10.object({
1694
+ type: z10.literal(AccountGovernanceType.RAW_SIGNING),
1695
+ policy: z10.object({ rules: z10.array(zSignDigestsGovRuleData) })
1696
+ }).meta({ description: "Raw signing governance" })
1697
+ ]).meta({ description: "Governance fields" });
1698
+ var zCreateAccountUserInputData = z10.object({
1376
1699
  name: zAccountName,
1377
1700
  currency: zCurrencyString,
1378
1701
  // "bitcoin"
1379
- index: z7.number().nonnegative().optional().describe("Account index"),
1380
- contractAddress: z7.string().min(1).optional().describe("Account contract address"),
1702
+ index: z10.number().nonnegative().optional().meta({ description: "Account index" }),
1703
+ contractAddress: z10.string().min(1).optional().meta({ description: "Account contract address" }),
1381
1704
  governance: zCreateAccountGovernanceData
1382
1705
  });
1383
1706
  var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
1384
- index: z7.number().nonnegative().describe("Account index"),
1385
- derivationPath: z7.string().describe("Account bip44 derivation path"),
1386
- type: z7.nativeEnum(AccountType)
1707
+ index: z10.number().nonnegative().meta({ description: "Account index" }),
1708
+ derivationPath: z10.string().meta({ description: "Account bip44 derivation path" }),
1709
+ type: z10.enum(AccountType)
1387
1710
  // "BITCOIN_LIKE"
1711
+ }).meta({
1712
+ description: "Create account request data",
1713
+ id: "CreateAccountRequestData"
1388
1714
  });
1389
- var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
1390
- z7.object({
1391
- type: z7.literal(AccountGovernanceType.CLASSIC),
1715
+ var zEditAccountGovernanceData = z10.discriminatedUnion("type", [
1716
+ z10.object({
1717
+ type: z10.literal(AccountGovernanceType.CLASSIC),
1392
1718
  policy: zAccountPolicyRequestData
1393
- }).describe("Classic governance"),
1394
- z7.object({
1395
- type: z7.literal(AccountGovernanceType.TRADELINK),
1719
+ }).meta({ description: "Classic governance" }),
1720
+ z10.object({
1721
+ type: z10.literal(AccountGovernanceType.TRADELINK),
1396
1722
  exchangeConfigs: zTradelinkExchangeConfigs
1397
- }).describe("Tradelink governance"),
1398
- z7.object({
1399
- type: z7.literal(AccountGovernanceType.RAW_SIGNING),
1400
- policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
1401
- }).describe("Raw signing governance")
1402
- ]).describe("Governance fields");
1403
- var zEditAccountRequestData = z7.object({
1723
+ }).meta({ description: "Tradelink governance" }),
1724
+ z10.object({
1725
+ type: z10.literal(AccountGovernanceType.RAW_SIGNING),
1726
+ policy: z10.object({ rules: z10.array(zSignDigestsGovRuleData) })
1727
+ }).meta({ description: "Raw signing governance" })
1728
+ ]).meta({ description: "Governance fields" });
1729
+ var zEditAccountRequestData = z10.object({
1404
1730
  name: zAccountName,
1405
1731
  governance: zEditAccountGovernanceData
1732
+ }).meta({
1733
+ description: "Edit account request data",
1734
+ id: "EditAccountRequestData"
1406
1735
  });
1407
- var zActivateAccountRequestData = z7.object({});
1408
- var zEditTokenRuleRequestData = z7.object({
1409
- parentAccountId: z7.string().min(1).describe("Parent account unique ID"),
1410
- contractAddress: z7.string().min(1).describe("Token contract address"),
1411
- rules: z7.array(zClassicGovRuleData).describe("Account governance rules")
1736
+ var zEditTokenRuleRequestData = z10.object({
1737
+ parentAccountId: z10.string().min(1).meta({ description: "Parent account unique ID" }),
1738
+ contractAddress: z10.string().min(1).meta({ description: "Token contract address" }),
1739
+ rules: z10.array(zClassicGovRuleData).meta({ description: "Account governance rules" })
1412
1740
  });
1413
1741
 
1414
1742
  // src/accounts/app-utils.ts
1415
- var getAccountAssetStaticFields = (account) => {
1743
+ var getAccountAssetFields = (account) => {
1416
1744
  switch (account.type) {
1417
1745
  case AccountType.BITCOIN_LIKE:
1418
1746
  return {
@@ -1505,7 +1833,7 @@ var getAccountGovernanceFields = (account) => {
1505
1833
  }
1506
1834
  };
1507
1835
  var serializeAccount = (account) => {
1508
- const asset = getAccountAssetStaticFields(account);
1836
+ const asset = getAccountAssetFields(account);
1509
1837
  const governance = getAccountGovernanceFields(account);
1510
1838
  const response = {
1511
1839
  ...account,
@@ -1538,321 +1866,217 @@ var patchTezosRequestData = (data) => {
1538
1866
  }
1539
1867
  return data;
1540
1868
  };
1541
- var zSciConfigData = z7.object({
1542
- dapps: z7.array(z7.string()).nullable().describe("Allowed DApps, null allows all"),
1543
- customContractCallEnabled: z7.boolean().describe("Allow non-DApp SCI")
1869
+ var zSciConfigData = z10.object({
1870
+ dapps: z10.array(z10.string()).nullable().meta({ description: "Allowed DApps, null allows all" }),
1871
+ customContractCallEnabled: z10.boolean().meta({ description: "Allow non-DApp SCI" })
1544
1872
  });
1545
- var zCreateSciConfigRequestData = z7.object({
1546
- account: z7.string().describe("Account UUID"),
1873
+ var zCreateSciConfigRequestData = z10.object({
1874
+ account: z10.string().meta({ description: "Account UUID" }),
1547
1875
  config: zSciConfigData
1548
1876
  });
1549
- var zEditSciConfigRequestData = z7.object({
1877
+ var zEditSciConfigRequestData = z10.object({
1550
1878
  config: zSciConfigData
1551
1879
  });
1552
1880
  var zRequestReviewStep = z.object({
1553
- stageName: z.string().regex(/^\w+$/).describe("The review stage name"),
1554
- quorum: z.number().int().min(1).describe("Quorum for the review step")
1881
+ stageName: z.string().regex(/^\w+$/).meta({ description: "The review stage name" }),
1882
+ quorum: z.int().min(1).meta({ description: "Quorum for the review step" })
1555
1883
  });
1556
1884
  var zRequestReviewSteps = z.array(zRequestReviewStep);
1557
- var zUserName = z.string().min(1).max(19).describe("User name");
1558
- var zUserRegistrationCreateInput = z.object({
1559
- name: zUserName,
1560
- role: z.enum([UserRole.ADMIN, UserRole.OPERATOR]).describe("User role"),
1561
- psdModel: z.nativeEnum(PsdModel).describe("PSD model"),
1562
- deviceUserId: z.string().describe("Device user ID")
1563
- });
1564
- zUserRegistrationCreateInput.extend({
1565
- id: z.string().describe("User registration ID"),
1566
- workspaceName: z.string().describe("Workspace name"),
1567
- state: z.nativeEnum(UserRegistrationState).describe("User registration state"),
1568
- isLocked: z.boolean().describe("Whether the registration is locked by a request")
1569
- });
1570
-
1571
- // src/users/request-data.ts
1572
- var zCreatePsdUserRequestData = z7.object({
1573
- registrationId: z7.string().describe("User registration ID")
1574
- });
1575
- var zCreateApiUserRequestData = z7.object({
1576
- name: zUserName,
1577
- pubKey: z7.string().describe("Public key"),
1578
- role: z7.enum(["ADMIN", "OPERATOR"]).describe("User role"),
1579
- viewAll: z7.boolean().describe("View all data").default(false).optional()
1580
- }).describe("Create API user request data");
1581
- var zCreateApiUserAccessRequestData = z7.object({
1582
- name: zUserName
1583
- }).describe("Create API user credential request data");
1584
- z7.object({
1585
- authUserId: z7.string().describe("Authentication broker ID")
1586
- }).describe("Managed data for API user");
1587
- var zRevokeUserRequestData = z7.object({});
1588
- var zGroupName = z7.string().min(1).max(19).describe("Group name");
1589
- var zCreateGroupRequestData = z7.object({
1885
+ var zGroupName = z10.string().min(1).max(19).meta({ description: "Group name" });
1886
+ var zCreateGroupRequestData = z10.object({
1590
1887
  name: zGroupName,
1591
- description: z7.string().nullable().describe("Group description"),
1592
- members: z7.array(z7.string()).describe("List of group members ids")
1888
+ description: z10.string().nullable().meta({ description: "Group description" }),
1889
+ members: z10.array(z10.string()).meta({ description: "List of group members ids" })
1593
1890
  });
1594
- var zEditGroupRequestData = z7.object({
1891
+ var zEditGroupRequestData = z10.object({
1595
1892
  name: zGroupName,
1596
- description: z7.string().nullable().describe("Group description"),
1597
- members: z7.array(z7.string()).describe("List of group members ids")
1893
+ description: z10.string().nullable().meta({ description: "Group description" }),
1894
+ members: z10.array(z10.string()).meta({ description: "List of group members ids" })
1598
1895
  });
1599
- var zApiKeyName = z7.string().min(1).max(19).describe("API key name");
1600
- var zCreateApiKeyRequestData = z7.object({
1896
+ var zApiKeyName = z10.string().min(1).max(19).meta({ description: "API key name" });
1897
+ var zCreateApiKeyRequestData = z10.object({
1601
1898
  name: zApiKeyName,
1602
- entities: z7.array(z7.string()).describe("List of related entities ids"),
1603
- scopes: z7.object({}).describe("FIXME to be precised")
1604
- }).describe("Create read-only API key request data");
1605
- var zEditApiKeyRequestData = zCreateApiKeyRequestData.describe(
1606
- "Edit read-only API key request data"
1607
- );
1608
- var zEntityName = z7.string().min(1).max(19).describe("Entity name");
1609
- var zCreateEntityRequestData = z7.object({
1899
+ entities: z10.array(z10.string()).meta({ description: "List of related entities ids" }),
1900
+ scopes: z10.object({}).meta({ description: "FIXME to be precised" })
1901
+ }).meta({ description: "Create read-only API key request data" });
1902
+ var zEditApiKeyRequestData = zCreateApiKeyRequestData.meta({
1903
+ description: "Edit read-only API key request data"
1904
+ });
1905
+ var zEntityName = z10.string().min(1).max(19).meta({ description: "Entity name" });
1906
+ var zCreateEntityRequestData = z10.object({
1610
1907
  name: zEntityName,
1611
- accounts: z7.array(z7.string())
1908
+ accounts: z10.array(z10.string())
1612
1909
  });
1613
- var zEditEntityRequestData = z7.object({
1910
+ var zEditEntityRequestData = z10.object({
1614
1911
  name: zEntityName,
1615
- accounts: z7.array(z7.string())
1616
- });
1617
- var NonRootAdminPermission = omit(AdminPermission, "ROOT");
1618
- var zWorkspaceRuleRequestData = z7.object({
1619
- permission: z7.nativeEnum(NonRootAdminPermission).describe("Granted permissions"),
1620
- reviewConfig: zReviewStepWithUsersArray.describe("List of admin review steps")
1912
+ accounts: z10.array(z10.string())
1621
1913
  });
1622
1914
 
1623
1915
  // src/requests/request-data.ts
1624
1916
  var zVaultRequestMixinsByType = {
1625
1917
  // Workspaces
1626
- [RequestType.UPDATE_QUORUM]: z7.object({
1627
- type: z7.literal(RequestType.UPDATE_QUORUM),
1918
+ [RequestType.UPDATE_QUORUM]: z10.object({
1919
+ type: z10.literal(RequestType.UPDATE_QUORUM),
1628
1920
  data: zUpdateQuorumRequestData
1629
1921
  }),
1630
1922
  // Operator requests
1631
- [RequestType.CREATE_TRANSACTION]: z7.object({
1632
- type: z7.literal(RequestType.CREATE_TRANSACTION),
1923
+ [RequestType.CREATE_TRANSACTION]: z10.object({
1924
+ type: z10.literal(RequestType.CREATE_TRANSACTION),
1633
1925
  data: zCreateTransactionRequestData,
1634
- meta: z7.object({
1635
- hash: z7.string().nullable()
1926
+ meta: z10.object({
1927
+ hash: z10.string().nullable()
1636
1928
  }).optional().nullable()
1637
1929
  }),
1638
- [RequestType.SIGN_MESSAGE]: z7.object({
1639
- type: z7.literal(RequestType.SIGN_MESSAGE),
1930
+ [RequestType.SIGN_MESSAGE]: z10.object({
1931
+ type: z10.literal(RequestType.SIGN_MESSAGE),
1640
1932
  data: zSignMessageRequestData
1641
1933
  }),
1642
- [RequestType.SIGN_DIGESTS]: z7.object({
1643
- type: z7.literal(RequestType.SIGN_DIGESTS),
1934
+ [RequestType.SIGN_DIGESTS]: z10.object({
1935
+ type: z10.literal(RequestType.SIGN_DIGESTS),
1644
1936
  data: zSignDigestsRequestData
1645
1937
  }),
1646
1938
  // Accounts
1647
- [RequestType.CREATE_ACCOUNT]: z7.object({
1648
- type: z7.literal(RequestType.CREATE_ACCOUNT),
1939
+ [RequestType.CREATE_ACCOUNT]: z10.object({
1940
+ type: z10.literal(RequestType.CREATE_ACCOUNT),
1649
1941
  data: zCreateAccountRequestData
1650
1942
  }),
1651
- [RequestType.EDIT_ACCOUNT]: z7.object({
1652
- type: z7.literal(RequestType.EDIT_ACCOUNT),
1653
- targetId: z7.string(),
1943
+ [RequestType.EDIT_ACCOUNT]: z10.object({
1944
+ type: z10.literal(RequestType.EDIT_ACCOUNT),
1945
+ targetId: z10.string(),
1654
1946
  data: zEditAccountRequestData
1655
1947
  }),
1656
- [RequestType.ACTIVATE_TRADELINK_ACCOUNT]: z7.object({
1657
- type: z7.literal(RequestType.ACTIVATE_TRADELINK_ACCOUNT),
1658
- targetId: z7.string(),
1659
- data: zActivateAccountRequestData
1660
- }),
1661
- [RequestType.EDIT_TOKEN_RULE]: z7.object({
1662
- type: z7.literal(RequestType.EDIT_TOKEN_RULE),
1663
- targetId: z7.string(),
1948
+ [RequestType.EDIT_TOKEN_RULE]: z10.object({
1949
+ type: z10.literal(RequestType.EDIT_TOKEN_RULE),
1950
+ targetId: z10.string(),
1664
1951
  data: zEditTokenRuleRequestData
1665
1952
  }),
1666
1953
  // Groups
1667
- [RequestType.CREATE_GROUP]: z7.object({
1668
- type: z7.literal(RequestType.CREATE_GROUP),
1954
+ [RequestType.CREATE_GROUP]: z10.object({
1955
+ type: z10.literal(RequestType.CREATE_GROUP),
1669
1956
  data: zCreateGroupRequestData
1670
1957
  }),
1671
- [RequestType.EDIT_GROUP]: z7.object({
1672
- type: z7.literal(RequestType.EDIT_GROUP),
1673
- targetId: z7.string(),
1958
+ [RequestType.EDIT_GROUP]: z10.object({
1959
+ type: z10.literal(RequestType.EDIT_GROUP),
1960
+ targetId: z10.string(),
1674
1961
  data: zEditGroupRequestData
1675
1962
  }),
1676
- [RequestType.REVOKE_GROUP]: z7.object({
1677
- type: z7.literal(RequestType.REVOKE_GROUP),
1678
- targetId: z7.string(),
1963
+ [RequestType.REVOKE_GROUP]: z10.object({
1964
+ type: z10.literal(RequestType.REVOKE_GROUP),
1965
+ targetId: z10.string(),
1679
1966
  data: zRevokeUserRequestData
1680
1967
  }),
1681
1968
  // Whitelists
1682
- [RequestType.CREATE_WHITELIST]: z7.object({
1683
- type: z7.literal(RequestType.CREATE_WHITELIST),
1969
+ [RequestType.CREATE_WHITELIST]: z10.object({
1970
+ type: z10.literal(RequestType.CREATE_WHITELIST),
1684
1971
  data: zCreateWhitelistRequestData
1685
1972
  }),
1686
- [RequestType.EDIT_WHITELIST]: z7.object({
1687
- type: z7.literal(RequestType.EDIT_WHITELIST),
1688
- targetId: z7.string(),
1973
+ [RequestType.EDIT_WHITELIST]: z10.object({
1974
+ type: z10.literal(RequestType.EDIT_WHITELIST),
1975
+ targetId: z10.string(),
1689
1976
  data: zEditWhitelistRequestData
1690
1977
  }),
1691
1978
  // Entities
1692
- [RequestType.CREATE_ENTITY]: z7.object({
1693
- type: z7.literal(RequestType.CREATE_ENTITY),
1979
+ [RequestType.CREATE_ENTITY]: z10.object({
1980
+ type: z10.literal(RequestType.CREATE_ENTITY),
1694
1981
  data: zCreateEntityRequestData
1695
1982
  }),
1696
- [RequestType.EDIT_ENTITY]: z7.object({
1697
- type: z7.literal(RequestType.EDIT_ENTITY),
1983
+ [RequestType.EDIT_ENTITY]: z10.object({
1984
+ type: z10.literal(RequestType.EDIT_ENTITY),
1698
1985
  data: zEditEntityRequestData
1699
1986
  }),
1700
- [RequestType.REVOKE_ENTITY]: z7.object({
1701
- type: z7.literal(RequestType.REVOKE_ENTITY),
1702
- data: z7.object({})
1987
+ [RequestType.REVOKE_ENTITY]: z10.object({
1988
+ type: z10.literal(RequestType.REVOKE_ENTITY),
1989
+ data: z10.object({})
1703
1990
  }),
1704
1991
  // Users
1705
- [RequestType.CREATE_PSD_USER]: z7.object({
1706
- type: z7.literal(RequestType.CREATE_PSD_USER),
1992
+ [RequestType.CREATE_PSD_USER]: z10.object({
1993
+ type: z10.literal(RequestType.CREATE_PSD_USER),
1707
1994
  data: zCreatePsdUserRequestData
1708
1995
  }),
1709
- [RequestType.CREATE_API_USER]: z7.object({
1710
- type: z7.literal(RequestType.CREATE_API_USER),
1996
+ [RequestType.CREATE_API_USER]: z10.object({
1997
+ type: z10.literal(RequestType.CREATE_API_USER),
1711
1998
  data: zCreateApiUserRequestData
1712
1999
  }),
1713
- [RequestType.CREATE_API_USER_ACCESS]: z7.object({
1714
- type: z7.literal(RequestType.CREATE_API_USER_ACCESS),
2000
+ [RequestType.CREATE_API_USER_ACCESS]: z10.object({
2001
+ type: z10.literal(RequestType.CREATE_API_USER_ACCESS),
1715
2002
  data: zCreateApiUserAccessRequestData
1716
2003
  }),
1717
- [RequestType.REVOKE_USER]: z7.object({
1718
- type: z7.literal(RequestType.REVOKE_USER),
1719
- targetId: z7.string(),
2004
+ [RequestType.REVOKE_USER]: z10.object({
2005
+ type: z10.literal(RequestType.REVOKE_USER),
2006
+ targetId: z10.string(),
1720
2007
  data: zRevokeUserRequestData
1721
2008
  }),
1722
2009
  // Admin gov rules
1723
- [RequestType.CREATE_WORKSPACE_RULE]: z7.object({
1724
- type: z7.literal(RequestType.CREATE_WORKSPACE_RULE),
1725
- data: zWorkspaceRuleRequestData
1726
- }),
1727
- [RequestType.EDIT_WORKSPACE_RULE]: z7.object({
1728
- type: z7.literal(RequestType.EDIT_WORKSPACE_RULE),
2010
+ [RequestType.EDIT_WORKSPACE_RULE]: z10.object({
2011
+ type: z10.literal(RequestType.EDIT_WORKSPACE_RULE),
1729
2012
  data: zWorkspaceRuleRequestData
1730
2013
  }),
1731
2014
  // SCI configs
1732
- [RequestType.CREATE_SCICONFIG]: z7.object({
1733
- type: z7.literal(RequestType.CREATE_SCICONFIG),
2015
+ [RequestType.CREATE_SCICONFIG]: z10.object({
2016
+ type: z10.literal(RequestType.CREATE_SCICONFIG),
1734
2017
  data: zCreateSciConfigRequestData
1735
2018
  }),
1736
- [RequestType.EDIT_SCICONFIG]: z7.object({
1737
- type: z7.literal(RequestType.EDIT_SCICONFIG),
2019
+ [RequestType.EDIT_SCICONFIG]: z10.object({
2020
+ type: z10.literal(RequestType.EDIT_SCICONFIG),
1738
2021
  data: zEditSciConfigRequestData
1739
2022
  }),
1740
2023
  // API keys
1741
- [RequestType.CREATE_API_KEY]: z7.object({
1742
- type: z7.literal(RequestType.CREATE_API_KEY),
2024
+ [RequestType.CREATE_API_KEY]: z10.object({
2025
+ type: z10.literal(RequestType.CREATE_API_KEY),
1743
2026
  data: zCreateApiKeyRequestData
1744
2027
  }),
1745
- [RequestType.EDIT_API_KEY]: z7.object({
1746
- type: z7.literal(RequestType.EDIT_API_KEY),
2028
+ [RequestType.EDIT_API_KEY]: z10.object({
2029
+ type: z10.literal(RequestType.EDIT_API_KEY),
1747
2030
  data: zEditApiKeyRequestData
1748
2031
  }),
1749
- [RequestType.REVOKE_API_KEY]: z7.object({
1750
- type: z7.literal(RequestType.REVOKE_API_KEY),
1751
- data: z7.object({})
2032
+ [RequestType.REVOKE_API_KEY]: z10.object({
2033
+ type: z10.literal(RequestType.REVOKE_API_KEY),
2034
+ data: z10.object({})
1752
2035
  }),
1753
2036
  // Policies
1754
- [RequestType.CREATE_POLICY]: z7.object({
1755
- type: z7.literal(RequestType.CREATE_POLICY),
2037
+ [RequestType.CREATE_POLICY]: z10.object({
2038
+ type: z10.literal(RequestType.CREATE_POLICY),
1756
2039
  data: zCreatePublicPolicyRequestData
1757
2040
  }),
1758
- [RequestType.EDIT_POLICY]: z7.object({
1759
- type: z7.literal(RequestType.EDIT_POLICY),
1760
- targetId: z7.string(),
2041
+ [RequestType.EDIT_POLICY]: z10.object({
2042
+ type: z10.literal(RequestType.EDIT_POLICY),
2043
+ targetId: z10.string(),
1761
2044
  data: zEditPublicPolicyRequestData
1762
2045
  }),
1763
- // Tradelink
1764
- [RequestType.CREATE_TRADELINK_CUSTODIAN]: z7.object({
1765
- type: z7.literal(RequestType.CREATE_TRADELINK_CUSTODIAN),
1766
- data: zCustodianRequestData
1767
- }),
1768
- [RequestType.EDIT_TRADELINK_CUSTODIAN]: z7.object({
1769
- type: z7.literal(RequestType.EDIT_TRADELINK_CUSTODIAN),
1770
- targetId: z7.string(),
1771
- data: zCustodianRequestData
1772
- }),
1773
- [RequestType.CREATE_TRADELINK_EXCHANGE]: z7.object({
1774
- type: z7.literal(RequestType.CREATE_TRADELINK_EXCHANGE),
1775
- data: zTradelinkEntityRequestData
1776
- }),
1777
- [RequestType.EDIT_TRADELINK_EXCHANGE]: z7.object({
1778
- type: z7.literal(RequestType.EDIT_TRADELINK_EXCHANGE),
1779
- targetId: z7.string(),
1780
- data: zTradelinkEntityRequestData
1781
- }),
1782
- [RequestType.CREATE_TRADELINK_ASSET_MANAGER]: z7.object({
1783
- type: z7.literal(RequestType.CREATE_TRADELINK_ASSET_MANAGER),
1784
- data: zTradelinkEntityRequestData
1785
- }),
1786
- [RequestType.EDIT_TRADELINK_ASSET_MANAGER]: z7.object({
1787
- type: z7.literal(RequestType.EDIT_TRADELINK_ASSET_MANAGER),
1788
- targetId: z7.string(),
1789
- data: zTradelinkEntityRequestData
1790
- }),
1791
- [RequestType.ADJUST_PLEDGE]: z7.object({
1792
- type: z7.literal(RequestType.ADJUST_PLEDGE),
1793
- data: zAdjustPledgeRequestData
1794
- }),
1795
- [RequestType.TRADELINK_REPLEDGE]: z7.object({
1796
- type: z7.literal(RequestType.TRADELINK_REPLEDGE),
1797
- data: zRepledgeRequestData
1798
- }),
1799
- [RequestType.CREATE_SETTLEMENT]: z7.object({
1800
- type: z7.literal(RequestType.CREATE_SETTLEMENT),
1801
- data: zCreateSettlementRequestData,
1802
- meta: z7.object({
1803
- hash: z7.string().nullable()
1804
- }).optional().nullable()
1805
- }),
1806
- [RequestType.FORCE_UNPLEDGE]: z7.object({
1807
- type: z7.literal(RequestType.FORCE_UNPLEDGE),
1808
- data: zForceUnpledgeRequestData
1809
- }),
1810
- [RequestType.TRADELINK_WITHDRAW]: z7.object({
1811
- type: z7.literal(RequestType.TRADELINK_WITHDRAW),
1812
- data: zTradelinkWithdrawRequestData,
1813
- meta: z7.object({
1814
- hash: z7.string().nullable()
1815
- }).optional().nullable()
1816
- }),
1817
- [RequestType.TRADELINK_ARBITRATE]: z7.object({
1818
- type: z7.literal(RequestType.TRADELINK_ARBITRATE),
1819
- data: zTradelinkArbitrationRequestData,
1820
- meta: z7.object({
1821
- hash: z7.string().nullable()
1822
- }).optional().nullable()
1823
- })
2046
+ // Tradelink-related requests
2047
+ ...zTradelinkRequestMixinsByType
1824
2048
  };
1825
2049
 
1826
2050
  // src/requests/app-types.ts
1827
- var zRequestReviewResponse = z7.object({
2051
+ var zRequestReviewResponse = z10.object({
1828
2052
  // Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
1829
- stepIndex: z7.number().int().describe("Index of the governance step in the request workflow"),
1830
- userId: z7.string().describe("Reviewer id"),
1831
- status: z7.nativeEnum(RequestReviewStatus).describe("Review status"),
1832
- createdAt: z7.coerce.date().describe("Created date"),
1833
- updatedAt: z7.coerce.date().describe("Updated date")
1834
- });
1835
- var zVaultRequestCommonMixin = z7.object({
1836
- id: z7.string().describe("Request unique identifier"),
1837
- legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
1838
- state: z7.nativeEnum(RequestState).describe("Request state"),
1839
- reviewSteps: zRequestReviewSteps.describe("Request review steps"),
1840
- currentStepIndex: z7.number().int().min(0).describe("Index of the current approval step"),
1841
- expiresAt: z7.coerce.date().describe("Request expiration date"),
1842
- expiredAt: z7.coerce.date().optional().describe("Deprecated: use expiresAt"),
1843
- targetId: z7.string().nullable().describe("Optional ID of the target object"),
1844
- note: zNote.nullable().describe("Optional request note"),
1845
- reviews: z7.array(zRequestReviewResponse).describe("Requests reviews"),
2053
+ stepIndex: z10.number().int().meta({ description: "Index of the governance step in the request workflow" }),
2054
+ userId: z10.string().meta({ description: "Reviewer id" }),
2055
+ status: z10.enum(RequestReviewStatus).meta({ description: "Review status" }),
2056
+ createdAt: z10.coerce.date().meta({ description: "Created date" }),
2057
+ updatedAt: z10.coerce.date().meta({ description: "Updated date" })
2058
+ });
2059
+ var zVaultRequestCommonMixin = z10.object({
2060
+ id: z10.string().meta({ description: "Request unique identifier" }),
2061
+ legacyId: z10.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
2062
+ state: z10.enum(RequestState).meta({ description: "Request state" }),
2063
+ reviewSteps: zRequestReviewSteps.meta({ description: "Request review steps" }),
2064
+ currentStepIndex: z10.number().int().min(0).meta({ description: "Index of the current approval step" }),
2065
+ expiresAt: z10.coerce.date().meta({ description: "Request expiration date" }),
2066
+ expiredAt: z10.coerce.date().optional().meta({ description: "Deprecated: use expiresAt" }),
2067
+ targetId: z10.string().nullable().meta({ description: "Optional ID of the target object" }),
2068
+ note: zNote.nullable().meta({ description: "Optional request note" }),
2069
+ reviews: z10.array(zRequestReviewResponse).meta({ description: "Requests reviews" }),
1846
2070
  // `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
1847
- createdAt: z7.coerce.date().describe("Creation timestamp"),
1848
- updatedAt: z7.coerce.date().describe("Last modification timestamp"),
1849
- createdById: z7.string().describe("ID of the user who created the request"),
2071
+ createdAt: z10.coerce.date().meta({ description: "Creation timestamp" }),
2072
+ updatedAt: z10.coerce.date().meta({ description: "Last modification timestamp" }),
2073
+ createdById: z10.string().meta({ description: "ID of the user who created the request" }),
1850
2074
  // `inflight` is fetched from ONGOING RequestSaga
1851
- inflight: z7.object({
1852
- lastError: z7.string().nullable().describe("Error message from the last failure"),
1853
- numFailed: z7.number().int().describe("Number of failures so far"),
1854
- retryAfter: z7.coerce.date().describe("Date after which next retry is scheduled")
1855
- }).optional().describe("Extra information if the request is currently being processed")
2075
+ inflight: z10.object({
2076
+ lastError: z10.string().nullable().meta({ description: "Error message from the last failure" }),
2077
+ numFailed: z10.number().int().meta({ description: "Number of failures so far" }),
2078
+ retryAfter: z10.coerce.date().meta({ description: "Date after which next retry is scheduled" })
2079
+ }).optional().meta({ description: "Extra information if the request is currently being processed" })
1856
2080
  });
1857
2081
  var allowedRequestCreationInputByType = {
1858
2082
  [RequestType.UPDATE_QUORUM]: zVaultRequestMixinsByType[RequestType.UPDATE_QUORUM],
@@ -1863,69 +2087,74 @@ var allowedRequestCreationInputByType = {
1863
2087
  [RequestType.CREATE_WHITELIST]: zVaultRequestMixinsByType[RequestType.CREATE_WHITELIST],
1864
2088
  [RequestType.EDIT_WHITELIST]: zVaultRequestMixinsByType[RequestType.EDIT_WHITELIST],
1865
2089
  [RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
1866
- [RequestType.SIGN_MESSAGE]: z7.object({
1867
- type: z7.literal(RequestType.SIGN_MESSAGE),
2090
+ [RequestType.SIGN_MESSAGE]: z10.object({
2091
+ type: z10.literal(RequestType.SIGN_MESSAGE),
1868
2092
  data: zSignMessageUserInputData
1869
2093
  }),
1870
2094
  [RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
1871
2095
  [RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
1872
- [RequestType.CREATE_ACCOUNT]: z7.object({
1873
- type: z7.literal(RequestType.CREATE_ACCOUNT),
2096
+ [RequestType.CREATE_ACCOUNT]: z10.object({
2097
+ type: z10.literal(RequestType.CREATE_ACCOUNT),
1874
2098
  data: zCreateAccountUserInputData
1875
2099
  }),
1876
2100
  [RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
1877
- [RequestType.ACTIVATE_TRADELINK_ACCOUNT]: zVaultRequestMixinsByType[RequestType.ACTIVATE_TRADELINK_ACCOUNT],
1878
- [RequestType.CREATE_TRADELINK_CUSTODIAN]: zVaultRequestMixinsByType[RequestType.CREATE_TRADELINK_CUSTODIAN],
1879
- [RequestType.EDIT_TRADELINK_CUSTODIAN]: zVaultRequestMixinsByType[RequestType.EDIT_TRADELINK_CUSTODIAN],
1880
- [RequestType.CREATE_TRADELINK_EXCHANGE]: zVaultRequestMixinsByType[RequestType.CREATE_TRADELINK_EXCHANGE],
1881
- [RequestType.EDIT_TRADELINK_EXCHANGE]: zVaultRequestMixinsByType[RequestType.EDIT_TRADELINK_EXCHANGE],
1882
- [RequestType.CREATE_TRADELINK_ASSET_MANAGER]: zVaultRequestMixinsByType[RequestType.CREATE_TRADELINK_ASSET_MANAGER],
1883
- [RequestType.EDIT_TRADELINK_ASSET_MANAGER]: zVaultRequestMixinsByType[RequestType.EDIT_TRADELINK_ASSET_MANAGER],
1884
- [RequestType.ADJUST_PLEDGE]: zVaultRequestMixinsByType[RequestType.ADJUST_PLEDGE],
2101
+ [RequestType.TRADELINK_ACTIVATE_ACCOUNT]: zVaultRequestMixinsByType[RequestType.TRADELINK_ACTIVATE_ACCOUNT],
2102
+ [RequestType.TRADELINK_CREATE_CUSTODIAN]: zVaultRequestMixinsByType[RequestType.TRADELINK_CREATE_CUSTODIAN],
2103
+ [RequestType.TRADELINK_EDIT_CUSTODIAN]: zVaultRequestMixinsByType[RequestType.TRADELINK_EDIT_CUSTODIAN],
2104
+ [RequestType.TRADELINK_CREATE_EXCHANGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_CREATE_EXCHANGE],
2105
+ [RequestType.TRADELINK_EDIT_EXCHANGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_EDIT_EXCHANGE],
2106
+ [RequestType.TRADELINK_CREATE_ASSET_MANAGER]: zVaultRequestMixinsByType[RequestType.TRADELINK_CREATE_ASSET_MANAGER],
2107
+ [RequestType.TRADELINK_EDIT_ASSET_MANAGER]: zVaultRequestMixinsByType[RequestType.TRADELINK_EDIT_ASSET_MANAGER],
2108
+ [RequestType.TRADELINK_ADJUST_PLEDGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ADJUST_PLEDGE],
1885
2109
  [RequestType.TRADELINK_REPLEDGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_REPLEDGE],
1886
- [RequestType.FORCE_UNPLEDGE]: zVaultRequestMixinsByType[RequestType.FORCE_UNPLEDGE],
1887
- [RequestType.CREATE_SETTLEMENT]: zVaultRequestMixinsByType[RequestType.CREATE_SETTLEMENT],
2110
+ [RequestType.TRADELINK_FORCE_UNPLEDGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_FORCE_UNPLEDGE],
2111
+ [RequestType.TRADELINK_CREATE_SETTLEMENT]: zVaultRequestMixinsByType[RequestType.TRADELINK_CREATE_SETTLEMENT],
1888
2112
  [RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
1889
2113
  [RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE],
1890
- [RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER]
2114
+ [RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER],
2115
+ [RequestType.EDIT_WORKSPACE_RULE]: zVaultRequestMixinsByType[RequestType.EDIT_WORKSPACE_RULE]
1891
2116
  };
1892
- var zRequestCreationInputCommonMixin = z7.object({
1893
- note: zNote.optional().describe("Optional request note")
2117
+ var zRequestCreationInputCommonMixin = z10.object({
2118
+ note: zNote.optional().meta({ description: "Optional request note" })
1894
2119
  });
1895
- z7.object({
1896
- request: z7.discriminatedUnion(
2120
+ z10.object({
2121
+ request: z10.discriminatedUnion(
1897
2122
  "type",
1898
2123
  ensureNonEmptyArray(
1899
2124
  Object.values(allowedRequestCreationInputByType).map((_) => {
1900
- const requestType = _.shape.type._def.value;
1901
- return _.merge(zRequestCreationInputCommonMixin).describe(`${requestType} request data`);
2125
+ const requestType = _.shape.type.value;
2126
+ return _.extend(zRequestCreationInputCommonMixin.shape).meta({
2127
+ description: `${requestType} request data`
2128
+ });
1902
2129
  })
1903
2130
  )
1904
2131
  )
1905
2132
  });
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);
1911
- var zVaultRequestResponse = z7.discriminatedUnion(
2133
+ var zVaultRequestResponse = z10.discriminatedUnion(
1912
2134
  "type",
1913
2135
  ensureNonEmptyArray(
1914
2136
  Object.values(zVaultRequestMixinsByType).map((_) => {
1915
- const requestType = _.shape.type._def.value;
1916
- return _.merge(zVaultRequestCommonMixin).describe(`${requestType} request`);
2137
+ const requestType = _.shape.type.value;
2138
+ return _.extend(zVaultRequestCommonMixin.shape).meta({
2139
+ description: `${requestType} request`
2140
+ });
1917
2141
  })
1918
2142
  )
1919
- );
1920
- z7.enum([
2143
+ ).meta({
2144
+ description: "Vault request response data",
2145
+ id: "VaultRequestResponse"
2146
+ });
2147
+ z10.enum([
1921
2148
  "state",
1922
2149
  "expiresAt",
1923
2150
  "createdAt",
1924
2151
  "updatedAt"
1925
2152
  ]).default("createdAt");
1926
- z7.object({
1927
- pubKey: z7.string().describe("Public key of the current user"),
1928
- challenge: zUserChallenge.describe("Challenge data to sign with the user's private key")
2153
+ z10.object({
2154
+ pubKey: z10.string().meta({ description: "Public key of the current user" }),
2155
+ challenge: zUserChallenge.meta({
2156
+ description: "Challenge data to sign with the user's private key"
2157
+ })
1929
2158
  });
1930
2159
  var shouldHaveTargetHsmId = (request) => {
1931
2160
  switch (request.type) {
@@ -1937,7 +2166,6 @@ var shouldHaveTargetHsmId = (request) => {
1937
2166
  case RequestType.CREATE_API_KEY:
1938
2167
  case RequestType.EDIT_API_KEY:
1939
2168
  case RequestType.REVOKE_API_KEY:
1940
- case RequestType.CREATE_WORKSPACE_RULE:
1941
2169
  case RequestType.EDIT_WORKSPACE_RULE:
1942
2170
  case RequestType.UPDATE_QUORUM:
1943
2171
  return false;
@@ -1951,7 +2179,7 @@ var shouldHaveTargetHsmId = (request) => {
1951
2179
  case RequestType.SIGN_DIGESTS:
1952
2180
  case RequestType.CREATE_ACCOUNT:
1953
2181
  case RequestType.EDIT_ACCOUNT:
1954
- case RequestType.ACTIVATE_TRADELINK_ACCOUNT:
2182
+ case RequestType.TRADELINK_ACTIVATE_ACCOUNT:
1955
2183
  case RequestType.CREATE_GROUP:
1956
2184
  case RequestType.EDIT_GROUP:
1957
2185
  case RequestType.REVOKE_GROUP:
@@ -1959,12 +2187,12 @@ var shouldHaveTargetHsmId = (request) => {
1959
2187
  case RequestType.EDIT_WHITELIST:
1960
2188
  case RequestType.CREATE_POLICY:
1961
2189
  case RequestType.EDIT_POLICY:
1962
- case RequestType.CREATE_TRADELINK_CUSTODIAN:
1963
- case RequestType.EDIT_TRADELINK_CUSTODIAN:
1964
- case RequestType.CREATE_TRADELINK_EXCHANGE:
1965
- case RequestType.EDIT_TRADELINK_EXCHANGE:
1966
- case RequestType.CREATE_TRADELINK_ASSET_MANAGER:
1967
- case RequestType.EDIT_TRADELINK_ASSET_MANAGER:
2190
+ case RequestType.TRADELINK_CREATE_CUSTODIAN:
2191
+ case RequestType.TRADELINK_EDIT_CUSTODIAN:
2192
+ case RequestType.TRADELINK_CREATE_EXCHANGE:
2193
+ case RequestType.TRADELINK_EDIT_EXCHANGE:
2194
+ case RequestType.TRADELINK_CREATE_ASSET_MANAGER:
2195
+ case RequestType.TRADELINK_EDIT_ASSET_MANAGER:
1968
2196
  return request.state !== RequestState.INITIAL;
1969
2197
  case RequestType.EDIT_TOKEN_RULE:
1970
2198
  return true;
@@ -1977,26 +2205,25 @@ var shouldHaveTargetId = (request) => {
1977
2205
  case RequestType.REVOKE_API_KEY:
1978
2206
  return false;
1979
2207
  case RequestType.CREATE_TRANSACTION:
1980
- case RequestType.SIGN_MESSAGE:
1981
2208
  case RequestType.SIGN_DIGESTS:
1982
2209
  return false;
1983
2210
  case RequestType.UPDATE_QUORUM:
1984
2211
  case RequestType.CREATE_PSD_USER:
1985
2212
  case RequestType.CREATE_API_USER:
1986
- case RequestType.CREATE_WORKSPACE_RULE:
1987
2213
  case RequestType.CREATE_ACCOUNT:
1988
2214
  case RequestType.CREATE_GROUP:
1989
2215
  case RequestType.CREATE_WHITELIST:
1990
2216
  case RequestType.CREATE_ENTITY:
1991
2217
  case RequestType.CREATE_SCICONFIG:
1992
2218
  case RequestType.CREATE_POLICY:
1993
- case RequestType.CREATE_TRADELINK_CUSTODIAN:
1994
- case RequestType.CREATE_TRADELINK_EXCHANGE:
1995
- case RequestType.CREATE_TRADELINK_ASSET_MANAGER:
2219
+ case RequestType.SIGN_MESSAGE:
2220
+ case RequestType.TRADELINK_CREATE_CUSTODIAN:
2221
+ case RequestType.TRADELINK_CREATE_EXCHANGE:
2222
+ case RequestType.TRADELINK_CREATE_ASSET_MANAGER:
1996
2223
  return request.state === RequestState.EXECUTED;
1997
2224
  case RequestType.EDIT_WORKSPACE_RULE:
1998
2225
  case RequestType.EDIT_ACCOUNT:
1999
- case RequestType.ACTIVATE_TRADELINK_ACCOUNT:
2226
+ case RequestType.TRADELINK_ACTIVATE_ACCOUNT:
2000
2227
  case RequestType.EDIT_TOKEN_RULE:
2001
2228
  // EDIT_TOKEN_RULE targetId is the parent account which must always exist, even when creating new token rule.
2002
2229
  case RequestType.EDIT_GROUP:
@@ -2008,13 +2235,13 @@ var shouldHaveTargetId = (request) => {
2008
2235
  case RequestType.REVOKE_USER:
2009
2236
  case RequestType.EDIT_SCICONFIG:
2010
2237
  case RequestType.EDIT_POLICY:
2011
- case RequestType.EDIT_TRADELINK_CUSTODIAN:
2012
- case RequestType.EDIT_TRADELINK_EXCHANGE:
2013
- case RequestType.EDIT_TRADELINK_ASSET_MANAGER:
2014
- case RequestType.ADJUST_PLEDGE:
2238
+ case RequestType.TRADELINK_EDIT_CUSTODIAN:
2239
+ case RequestType.TRADELINK_EDIT_EXCHANGE:
2240
+ case RequestType.TRADELINK_EDIT_ASSET_MANAGER:
2241
+ case RequestType.TRADELINK_ADJUST_PLEDGE:
2015
2242
  case RequestType.TRADELINK_REPLEDGE:
2016
- case RequestType.CREATE_SETTLEMENT:
2017
- case RequestType.FORCE_UNPLEDGE:
2243
+ case RequestType.TRADELINK_CREATE_SETTLEMENT:
2244
+ case RequestType.TRADELINK_FORCE_UNPLEDGE:
2018
2245
  case RequestType.TRADELINK_WITHDRAW:
2019
2246
  case RequestType.TRADELINK_ARBITRATE:
2020
2247
  return true;
@@ -2031,7 +2258,7 @@ function serializeVaultRequest(request) {
2031
2258
  case "CREATE_TRANSACTION":
2032
2259
  case "TRADELINK_WITHDRAW":
2033
2260
  case "TRADELINK_ARBITRATE":
2034
- case "CREATE_SETTLEMENT":
2261
+ case "TRADELINK_CREATE_SETTLEMENT":
2035
2262
  Object.assign(serialized, {
2036
2263
  meta: {
2037
2264
  hash: request.transactionMeta?.hash ?? null
@@ -2044,7 +2271,7 @@ function serializeVaultRequest(request) {
2044
2271
  patched = patchTezosRequestData(patched);
2045
2272
  return patched;
2046
2273
  }
2047
- var fakeUniqueName = (length) => randomUUID().replace(/-/g, "").slice(0, 20);
2274
+ var fakeUniqueName = (length = 20) => faker.string.alphanumeric({ length, casing: "lower" });
2048
2275
  var fakeHexString = (length, casing = "upper") => faker.string.hexadecimal({ prefix: "", casing, length });
2049
2276
  var fakePubKey = () => fakeHexString(130);
2050
2277
  var fakeIntegerId = () => faker.number.int({ min: 1, max: 2e9 });