@ledgerhq/revault-api 1.30.0 → 1.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{app-types-BYy5kDRL.d.mts → app-types--WzpkjcT.d.mts} +9229 -8033
- package/lib/fakes.d.mts +1 -1
- package/lib/fakes.mjs +609 -604
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +3110 -3017
- package/package.json +1 -1
package/lib/fakes.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { faker } from '@faker-js/faker';
|
|
2
2
|
import { ChallengeType, PsdModel, AccountType, AccountGovernanceType, ActivationStatus, WhitelistType, UserRole, UserRegistrationState, AdminPermission, RequestType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
|
|
3
|
-
import
|
|
3
|
+
import z7, { z } from 'zod';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import invariant from 'invariant';
|
|
6
6
|
import { omit, times } from 'lodash';
|
|
@@ -11,6 +11,52 @@ var __export = (target, all) => {
|
|
|
11
11
|
for (var name in all)
|
|
12
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
13
|
};
|
|
14
|
+
var zHexString = z.string().regex(/^[0-9a-fA-F]+$/);
|
|
15
|
+
var zIntString = z.string().nonempty().regex(/^(-?[1-9]\d*|0)$/);
|
|
16
|
+
var zUnsignedIntString = z.string().nonempty().regex(/^([1-9]\d*|0)$/);
|
|
17
|
+
var zCurrency = z.string().nonempty().max(40).regex(/^\w+$/).describe("Currency");
|
|
18
|
+
var zHsmObjectId = z.string().regex(/^[\w-]+$/).min(1);
|
|
19
|
+
|
|
20
|
+
// src/types/operation.ts
|
|
21
|
+
var zValueTransactionOperationType = z.enum([
|
|
22
|
+
"SEND",
|
|
23
|
+
"STAKE",
|
|
24
|
+
"DEPLOY_CONTRACT",
|
|
25
|
+
"EXECUTE_CONTRACT",
|
|
26
|
+
"ACTIVATE_TOKEN"
|
|
27
|
+
]);
|
|
28
|
+
var zValueTransactionOperation = z.object({
|
|
29
|
+
type: zValueTransactionOperationType,
|
|
30
|
+
currency: zCurrency,
|
|
31
|
+
recipient: z.string().nonempty(),
|
|
32
|
+
destinationTag: z.string().nonempty().optional(),
|
|
33
|
+
value: zUnsignedIntString
|
|
34
|
+
});
|
|
35
|
+
var zSigningOperationType = z.enum(["SIGN_MESSAGE", "SIGN_DIGESTS"]);
|
|
36
|
+
var zSigningOperation = z.object({
|
|
37
|
+
type: zSigningOperationType
|
|
38
|
+
});
|
|
39
|
+
var zClassicOperationType = z.enum([
|
|
40
|
+
"SEND",
|
|
41
|
+
"STAKE",
|
|
42
|
+
"DEPLOY_CONTRACT",
|
|
43
|
+
"EXECUTE_CONTRACT",
|
|
44
|
+
"SIGN_MESSAGE",
|
|
45
|
+
"ACTIVATE_TOKEN"
|
|
46
|
+
]);
|
|
47
|
+
z.enum(["SIGN_DIGESTS"]);
|
|
48
|
+
var zOperationType = z.enum([
|
|
49
|
+
...zValueTransactionOperationType.options,
|
|
50
|
+
...zSigningOperationType.options
|
|
51
|
+
]);
|
|
52
|
+
z.discriminatedUnion("type", [
|
|
53
|
+
zValueTransactionOperation,
|
|
54
|
+
zSigningOperation
|
|
55
|
+
]);
|
|
56
|
+
var zNote = z7.object({
|
|
57
|
+
title: z7.string().describe("Note title"),
|
|
58
|
+
content: z7.string().describe("Note content")
|
|
59
|
+
});
|
|
14
60
|
|
|
15
61
|
// src/errors.ts
|
|
16
62
|
var ValidationError = class extends Error {
|
|
@@ -36,11 +82,6 @@ var ensureNonEmptyArray = (values, message) => {
|
|
|
36
82
|
function unreachable(value) {
|
|
37
83
|
throw new Error(`Un-covered: ${value}`);
|
|
38
84
|
}
|
|
39
|
-
var zHexString = z.string().regex(/^[0-9a-fA-F]+$/);
|
|
40
|
-
var zIntString = z.string().nonempty().regex(/^(-?[1-9]\d*|0)$/);
|
|
41
|
-
var zUnsignedIntString = z.string().nonempty().regex(/^([1-9]\d*|0)$/);
|
|
42
|
-
var zCurrency = z.string().nonempty().max(40).regex(/^\w+$/).describe("Currency");
|
|
43
|
-
var zHsmObjectId = z.string().regex(/^[\w-]+$/).min(1);
|
|
44
85
|
var zPubKey = zHexString.describe("Public key");
|
|
45
86
|
var zHsmCertificate = z.object({
|
|
46
87
|
codeHash: z.string().base64().describe("Hash of the executable that generated this certificate"),
|
|
@@ -146,8 +187,8 @@ var zHsmSignature = z.object({
|
|
|
146
187
|
),
|
|
147
188
|
pubkey: zHexString.nullable().describe("Public key for signature verification, 32 or 33 bytes")
|
|
148
189
|
});
|
|
149
|
-
var zBitcoinLikeTransactionType =
|
|
150
|
-
var zCardanoLikeTransactionType =
|
|
190
|
+
var zBitcoinLikeTransactionType = z7.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).describe("Bitcoin-like transaction type");
|
|
191
|
+
var zCardanoLikeTransactionType = z7.enum([
|
|
151
192
|
"CARDANO_LIKE_SEND",
|
|
152
193
|
"CARDANO_LIKE_RECEIVE",
|
|
153
194
|
"CARDANO_LIKE_STAKING_REGISTER",
|
|
@@ -155,9 +196,9 @@ var zCardanoLikeTransactionType = z5.enum([
|
|
|
155
196
|
"CARDANO_LIKE_STAKING_DELEGATE",
|
|
156
197
|
"CARDANO_LIKE_STAKING_WITHDRAW"
|
|
157
198
|
]).describe("Cardano-like transaction type");
|
|
158
|
-
var zEthereumLikeTransferTransactionType =
|
|
159
|
-
var zEthereumLikeContractTransactionType =
|
|
160
|
-
var zPolkadotLikeTransactionType =
|
|
199
|
+
var zEthereumLikeTransferTransactionType = z7.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).describe("Ethereum-like transaction type");
|
|
200
|
+
var zEthereumLikeContractTransactionType = z7.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).describe("Ethereum-like transaction type");
|
|
201
|
+
var zPolkadotLikeTransactionType = z7.enum([
|
|
161
202
|
"POLKADOT_LIKE_SEND",
|
|
162
203
|
"POLKADOT_LIKE_RECEIVE",
|
|
163
204
|
"POLKADOT_LIKE_ADDPROXY",
|
|
@@ -179,8 +220,8 @@ var zPolkadotLikeTransactionType = z5.enum([
|
|
|
179
220
|
"POLKADOT_LIKE_CHILL",
|
|
180
221
|
"POLKADOT_LIKE_TRANSFERALL"
|
|
181
222
|
]).describe("Polkadot-like transaction type");
|
|
182
|
-
var zRippleLikeTransactionType =
|
|
183
|
-
var zSolanaLikeTransactionType =
|
|
223
|
+
var zRippleLikeTransactionType = z7.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).describe("Ripple-like transaction type");
|
|
224
|
+
var zSolanaLikeTransactionType = z7.enum([
|
|
184
225
|
"SOLANA_LIKE_SEND",
|
|
185
226
|
"SOLANA_LIKE_RECEIVE",
|
|
186
227
|
"SOLANA_LIKE_CREATE_DELEGATE_STAKE",
|
|
@@ -193,16 +234,16 @@ var zSolanaLikeTransactionType = z5.enum([
|
|
|
193
234
|
"SOLANA_LIKE_SEND_TOKEN",
|
|
194
235
|
"SOLANA_LIKE_FUND_TOKEN"
|
|
195
236
|
]).describe("Solana-like transaction type");
|
|
196
|
-
var zStellarLikeTransactionType =
|
|
197
|
-
var zTezosLikeTransactionType =
|
|
237
|
+
var zStellarLikeTransactionType = z7.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).describe("Stellar-like transaction type");
|
|
238
|
+
var zTezosLikeTransactionType = z7.enum([
|
|
198
239
|
"TEZOS_LIKE_SEND",
|
|
199
240
|
"TEZOS_LIKE_RECEIVE",
|
|
200
241
|
"TEZOS_LIKE_REVEAL",
|
|
201
242
|
"TEZOS_LIKE_DELEGATE",
|
|
202
243
|
"TEZOS_LIKE_UNDELEGATE"
|
|
203
244
|
]).describe("Tezos-like transaction type");
|
|
204
|
-
var zGenericTransactionType =
|
|
205
|
-
|
|
245
|
+
var zGenericTransactionType = z7.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
|
|
246
|
+
z7.union([
|
|
206
247
|
zBitcoinLikeTransactionType,
|
|
207
248
|
zCardanoLikeTransactionType,
|
|
208
249
|
zEthereumLikeTransferTransactionType,
|
|
@@ -214,45 +255,45 @@ z5.union([
|
|
|
214
255
|
zStellarLikeTransactionType,
|
|
215
256
|
zTezosLikeTransactionType
|
|
216
257
|
]);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
type:
|
|
258
|
+
z7.discriminatedUnion("type", [
|
|
259
|
+
z7.object({
|
|
260
|
+
type: z7.literal("ETHEREUM_LIKE"),
|
|
220
261
|
baseFees: zIntString,
|
|
221
262
|
gasLimit: zIntString,
|
|
222
|
-
nonce:
|
|
263
|
+
nonce: z7.string(),
|
|
223
264
|
priorityFees: zIntString
|
|
224
265
|
})
|
|
225
266
|
]);
|
|
226
|
-
var zMessageType =
|
|
227
|
-
var zMessage =
|
|
267
|
+
var zMessageType = z7.enum(["EIP191", "EIP712"]);
|
|
268
|
+
var zMessage = z7.object({
|
|
228
269
|
type: zMessageType.describe("Type of the message to sign"),
|
|
229
270
|
data: zHexString.nonempty().describe("Hex data to sign, either a json string for EIP712, or a raw string for EIP191")
|
|
230
271
|
});
|
|
231
272
|
|
|
232
273
|
// src/transactions/request-data.ts
|
|
233
|
-
var zHexDataString =
|
|
274
|
+
var zHexDataString = z7.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/).transform((hex) => `0x${hex.toLowerCase().replace("0x", "")}`);
|
|
234
275
|
if ("openapi" in zHexDataString) {
|
|
235
276
|
zHexDataString = zHexDataString.openapi?.({ effectType: "same" });
|
|
236
277
|
}
|
|
237
|
-
var zCommonTransactionData =
|
|
278
|
+
var zCommonTransactionData = z7.object({
|
|
238
279
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
239
280
|
currency: zCurrency.describe("Transaction currency"),
|
|
240
281
|
// TODO: strict literal or enum?
|
|
241
282
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
242
|
-
recipient:
|
|
283
|
+
recipient: z7.string().describe("Transaction recipient")
|
|
243
284
|
});
|
|
244
|
-
var zFeeStrategyCustom =
|
|
245
|
-
type:
|
|
285
|
+
var zFeeStrategyCustom = z7.object({
|
|
286
|
+
type: z7.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
|
|
246
287
|
});
|
|
247
|
-
var zFeeStrategy =
|
|
248
|
-
type:
|
|
288
|
+
var zFeeStrategy = z7.object({
|
|
289
|
+
type: z7.enum(["SLOW", "NORMAL", "FAST"])
|
|
249
290
|
});
|
|
250
291
|
var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
251
292
|
// nullish is optional + nullable, it is easier to seed rather than just optional
|
|
252
293
|
feePerByte: zUnsignedIntString.nullish().describe("Fee per byte")
|
|
253
294
|
}).describe("Bitcoin-like fee strategy");
|
|
254
295
|
var zBitcoinLikeSendData = zCommonTransactionData.extend({
|
|
255
|
-
type:
|
|
296
|
+
type: z7.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
|
|
256
297
|
feeStrategy: zBitcoinLikeFeeStrategy
|
|
257
298
|
}).describe("Bitcoin-like send data");
|
|
258
299
|
var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
|
|
@@ -264,21 +305,21 @@ var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
|
|
|
264
305
|
maxFeePerGas: zUnsignedIntString.describe("Maximum fee per gas (base + priority)"),
|
|
265
306
|
gasLimit: zUnsignedIntString.describe("Gas limit")
|
|
266
307
|
}).describe("Ethereum-like EIP-1559 fee strategy");
|
|
267
|
-
var zEthereumLikeFeeStrategy =
|
|
308
|
+
var zEthereumLikeFeeStrategy = z7.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).describe("Ethereum-like fee strategy");
|
|
268
309
|
var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
269
|
-
type:
|
|
310
|
+
type: z7.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
|
|
270
311
|
// force the recipient to be the zero address
|
|
271
|
-
recipient:
|
|
312
|
+
recipient: z7.literal("0x0000000000000000000000000000000000000000"),
|
|
272
313
|
contractData: zHexDataString.describe("Contract data in hexadecimal format"),
|
|
273
314
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
274
315
|
}).describe("Ethereum-like deploy contract data");
|
|
275
316
|
var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
276
|
-
type:
|
|
317
|
+
type: z7.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
|
|
277
318
|
contractData: zHexDataString.describe("Contract call data in hexadecimal format"),
|
|
278
319
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
279
320
|
}).describe("Ethereum-like execute contract data");
|
|
280
321
|
var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
281
|
-
type:
|
|
322
|
+
type: z7.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
282
323
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
283
324
|
}).describe("Ethereum-like send data");
|
|
284
325
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
@@ -286,183 +327,183 @@ var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
|
286
327
|
storageLimit: zUnsignedIntString.nullable().describe("Storage limit")
|
|
287
328
|
}).describe("Tezos-like fee strategy");
|
|
288
329
|
var zTezosLikeDelegateData = zCommonTransactionData.extend({
|
|
289
|
-
type:
|
|
330
|
+
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
290
331
|
feeStrategy: zTezosLikeFeeStrategy
|
|
291
332
|
}).describe("Tezos-like delegate data");
|
|
292
333
|
var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
293
|
-
type:
|
|
334
|
+
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
|
|
294
335
|
feeStrategy: zTezosLikeFeeStrategy
|
|
295
336
|
}).describe("Tezos-like send data");
|
|
296
337
|
var zTezosLikeUndelegateData = zCommonTransactionData.extend({
|
|
297
|
-
type:
|
|
338
|
+
type: z7.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
298
339
|
feeStrategy: zTezosLikeFeeStrategy
|
|
299
340
|
}).describe("Tezos-like undelegate data");
|
|
300
|
-
var zPolkadotRewardDestination =
|
|
301
|
-
var zPolkadotLikeAddProxyData =
|
|
302
|
-
type:
|
|
341
|
+
var zPolkadotRewardDestination = z7.enum(["Staked", "Stash"]);
|
|
342
|
+
var zPolkadotLikeAddProxyData = z7.object({
|
|
343
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
303
344
|
currency: zCurrency.describe("Transaction currency"),
|
|
304
|
-
kind:
|
|
305
|
-
proxy:
|
|
345
|
+
kind: z7.literal("Staking").describe("Proxy kind"),
|
|
346
|
+
proxy: z7.string().describe("Proxy address")
|
|
306
347
|
}).describe("Polkadot-like add proxy data");
|
|
307
|
-
var zPolkadotLikeAnonymousProxyData =
|
|
308
|
-
type:
|
|
348
|
+
var zPolkadotLikeAnonymousProxyData = z7.object({
|
|
349
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
309
350
|
currency: zCurrency.describe("Transaction currency")
|
|
310
351
|
}).describe("Polkadot-like anonymous proxy data");
|
|
311
|
-
var zPolkadotLikeBondData =
|
|
312
|
-
type:
|
|
352
|
+
var zPolkadotLikeBondData = z7.object({
|
|
353
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
313
354
|
currency: zCurrency.describe("Transaction currency"),
|
|
314
355
|
payee: zPolkadotRewardDestination,
|
|
315
356
|
amount: zUnsignedIntString.describe("Amount")
|
|
316
357
|
}).describe("Polkadot-like bond data");
|
|
317
|
-
var zPolkadotLikeBondExtraData =
|
|
318
|
-
type:
|
|
358
|
+
var zPolkadotLikeBondExtraData = z7.object({
|
|
359
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
319
360
|
currency: zCurrency.describe("Transaction currency"),
|
|
320
361
|
amount: zUnsignedIntString.describe("Amount")
|
|
321
362
|
}).describe("Polkadot-like bond extra data");
|
|
322
|
-
var zPolkadotLikeChillData =
|
|
323
|
-
type:
|
|
363
|
+
var zPolkadotLikeChillData = z7.object({
|
|
364
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
324
365
|
currency: zCurrency.describe("Transaction currency")
|
|
325
366
|
}).describe("Polkadot-like chill data");
|
|
326
|
-
var zPolkadotLikeKillAnonymousData =
|
|
327
|
-
type:
|
|
367
|
+
var zPolkadotLikeKillAnonymousData = z7.object({
|
|
368
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
328
369
|
currency: zCurrency.describe("Transaction currency")
|
|
329
370
|
}).describe("Polkadot-like kill anonymous data");
|
|
330
|
-
var zPolkadotLikeRebondData =
|
|
331
|
-
type:
|
|
371
|
+
var zPolkadotLikeRebondData = z7.object({
|
|
372
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
332
373
|
currency: zCurrency.describe("Transaction currency"),
|
|
333
374
|
amount: zUnsignedIntString.describe("Amount")
|
|
334
375
|
}).describe("Polkadot-like rebond data");
|
|
335
|
-
var zPolkadotLikeRemoveProxyData =
|
|
336
|
-
type:
|
|
376
|
+
var zPolkadotLikeRemoveProxyData = z7.object({
|
|
377
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
337
378
|
currency: zCurrency.describe("Transaction currency"),
|
|
338
|
-
kind:
|
|
339
|
-
proxy:
|
|
379
|
+
kind: z7.literal("Staking"),
|
|
380
|
+
proxy: z7.string().describe("Proxy address")
|
|
340
381
|
}).describe("Polkadot-like remove proxy data");
|
|
341
382
|
var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
342
|
-
type:
|
|
383
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
|
|
343
384
|
}).describe("Polkadot-like send data");
|
|
344
|
-
var zPolkadotLikeSetPayeeData =
|
|
345
|
-
type:
|
|
385
|
+
var zPolkadotLikeSetPayeeData = z7.object({
|
|
386
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
346
387
|
currency: zCurrency.describe("Transaction currency"),
|
|
347
388
|
payee: zPolkadotRewardDestination
|
|
348
389
|
}).describe("Polkadot-like set payee data");
|
|
349
|
-
var zPolkadotLikeUnbondData =
|
|
350
|
-
type:
|
|
390
|
+
var zPolkadotLikeUnbondData = z7.object({
|
|
391
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
351
392
|
currency: zCurrency.describe("Transaction currency"),
|
|
352
393
|
amount: zUnsignedIntString.describe("Amount")
|
|
353
394
|
}).describe("Polkadot-like unbond data");
|
|
354
|
-
var zPolkadotLikeWithdrawUnbondedData =
|
|
355
|
-
type:
|
|
395
|
+
var zPolkadotLikeWithdrawUnbondedData = z7.object({
|
|
396
|
+
type: z7.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
356
397
|
currency: zCurrency.describe("Transaction currency")
|
|
357
398
|
}).describe("Polkadot-like withdraw unbonded data");
|
|
358
399
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
359
|
-
type:
|
|
400
|
+
type: z7.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
360
401
|
destinationTag: zIntString.nullable().describe("Destination tag"),
|
|
361
402
|
feeStrategy: zFeeStrategyCustom.describe("Ripple-like fee strategy")
|
|
362
403
|
}).describe("Ripple-like send data");
|
|
363
|
-
var zStellarMemo =
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
MEMO_HASH:
|
|
404
|
+
var zStellarMemo = z7.union([
|
|
405
|
+
z7.object({ MEMO_TEXT: z7.string().max(28).describe("Text memo (at most a 28 bytes string)") }).describe("Text memo"),
|
|
406
|
+
z7.object({ MEMO_ID: zIntString.describe("Id memo (unsigned 64 bits integer)") }).describe("Id memo"),
|
|
407
|
+
z7.object({
|
|
408
|
+
MEMO_HASH: z7.string().max(128).regex(/^[a-fA-F0-9]+$/).describe("Transaction hash memo (64 bytes hexadecimal string)")
|
|
368
409
|
}).describe("Hash memo"),
|
|
369
|
-
|
|
370
|
-
MEMO_RETURN:
|
|
410
|
+
z7.object({
|
|
411
|
+
MEMO_RETURN: z7.string().max(128).regex(/^[a-fA-F0-9]+$/).describe(
|
|
371
412
|
"A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
|
|
372
413
|
)
|
|
373
414
|
}).describe("Return memo")
|
|
374
415
|
]);
|
|
375
416
|
var zStellarLikeSendData = zCommonTransactionData.extend({
|
|
376
|
-
type:
|
|
417
|
+
type: z7.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
|
|
377
418
|
memo: zStellarMemo.nullable().describe("Stellar memo"),
|
|
378
419
|
feeStrategy: zFeeStrategy.describe("Stellar-like fee strategy")
|
|
379
420
|
}).describe("Stellar-like send data");
|
|
380
421
|
var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
381
|
-
type:
|
|
382
|
-
recipient:
|
|
422
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
|
|
423
|
+
recipient: z7.string().describe("Delegated vote address"),
|
|
383
424
|
// Re-described
|
|
384
425
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
385
426
|
}).describe("Solana-like create delegate stake data");
|
|
386
|
-
var zSolanaLikeDeactivateStakeData =
|
|
387
|
-
type:
|
|
427
|
+
var zSolanaLikeDeactivateStakeData = z7.object({
|
|
428
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
388
429
|
currency: zCurrency.describe("Transaction currency"),
|
|
389
430
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
390
|
-
stakeAccount:
|
|
431
|
+
stakeAccount: z7.string().describe("Stake account address"),
|
|
391
432
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
392
433
|
// No recipient, no amount
|
|
393
434
|
}).describe("Solana-like deactivate stake data");
|
|
394
|
-
var zSolanaLikeDelegateStakeData =
|
|
395
|
-
type:
|
|
435
|
+
var zSolanaLikeDelegateStakeData = z7.object({
|
|
436
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
396
437
|
currency: zCurrency.describe("Transaction currency"),
|
|
397
438
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
398
|
-
recipient:
|
|
399
|
-
stakeAccount:
|
|
439
|
+
recipient: z7.string().describe("Delegated vote address"),
|
|
440
|
+
stakeAccount: z7.string().describe("Stake account address"),
|
|
400
441
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
401
442
|
// No amount
|
|
402
443
|
}).describe("Solana-like delegate stake data");
|
|
403
|
-
var zSolanaLikeMergeStakeData =
|
|
404
|
-
type:
|
|
444
|
+
var zSolanaLikeMergeStakeData = z7.object({
|
|
445
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
405
446
|
currency: zCurrency.describe("Transaction currency"),
|
|
406
447
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
407
|
-
mergeSrcAccount:
|
|
408
|
-
mergeDstAccount:
|
|
448
|
+
mergeSrcAccount: z7.string().describe("Source stake address"),
|
|
449
|
+
mergeDstAccount: z7.string().describe("Destination stake address"),
|
|
409
450
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
410
451
|
// No recipient, no amount
|
|
411
452
|
}).describe("Solana-like merge stake data");
|
|
412
453
|
var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
413
|
-
type:
|
|
454
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
|
|
414
455
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
415
456
|
}).describe("Solana-like send data");
|
|
416
|
-
var zSolanaLikeSplitDeactivateStakeData =
|
|
417
|
-
type:
|
|
457
|
+
var zSolanaLikeSplitDeactivateStakeData = z7.object({
|
|
458
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
418
459
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
419
460
|
currency: zCurrency.describe("Transaction currency"),
|
|
420
461
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
421
|
-
stakeAccount:
|
|
462
|
+
stakeAccount: z7.string().describe("Stake account address"),
|
|
422
463
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
423
464
|
// No recipient
|
|
424
465
|
}).describe("Solana-like split deactivate stake data");
|
|
425
|
-
var zSolanaLikeSplitStakeData =
|
|
426
|
-
type:
|
|
466
|
+
var zSolanaLikeSplitStakeData = z7.object({
|
|
467
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
427
468
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
428
469
|
currency: zCurrency.describe("Transaction currency"),
|
|
429
470
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
430
|
-
stakeAccount:
|
|
471
|
+
stakeAccount: z7.string().describe("Stake account address"),
|
|
431
472
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
432
473
|
// No recipient
|
|
433
474
|
}).describe("Solana-like split stake data");
|
|
434
|
-
var zSolanaLikeWithdrawStakeData =
|
|
435
|
-
type:
|
|
475
|
+
var zSolanaLikeWithdrawStakeData = z7.object({
|
|
476
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
436
477
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
437
478
|
currency: zCurrency.describe("Transaction currency"),
|
|
438
479
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
439
|
-
stakeAccount:
|
|
480
|
+
stakeAccount: z7.string().describe("Stake account address"),
|
|
440
481
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
441
482
|
// No recipient
|
|
442
483
|
}).describe("Solana-like delegate stake data");
|
|
443
484
|
var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
444
|
-
type:
|
|
485
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
445
486
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
446
487
|
}).describe("Solana-like send token data");
|
|
447
488
|
var zSolanaLikeFundTokenData = zCommonTransactionData.extend({
|
|
448
|
-
type:
|
|
489
|
+
type: z7.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_TOKEN),
|
|
449
490
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
450
491
|
}).describe("Solana-like fund token data");
|
|
451
492
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
452
|
-
type:
|
|
493
|
+
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
453
494
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
|
|
454
495
|
}).describe("Cardano-like send data");
|
|
455
|
-
var zCardanoStakingDelegateData =
|
|
456
|
-
type:
|
|
496
|
+
var zCardanoStakingDelegateData = z7.object({
|
|
497
|
+
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
457
498
|
currency: zCurrency.describe("Transaction currency"),
|
|
458
499
|
// TODO: strict literal or enum?
|
|
459
500
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
460
501
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
461
502
|
// DELEGATE doesn't have neither amount nor recipient
|
|
462
|
-
stakePoolId:
|
|
503
|
+
stakePoolId: z7.string().min(1).max(100).describe("")
|
|
463
504
|
}).describe("Cardano-like staking delegate");
|
|
464
|
-
var zCardanoStakingDeregisterData =
|
|
465
|
-
type:
|
|
505
|
+
var zCardanoStakingDeregisterData = z7.object({
|
|
506
|
+
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
466
507
|
currency: zCurrency.describe("Transaction currency"),
|
|
467
508
|
// TODO: strict literal or enum?
|
|
468
509
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -470,8 +511,8 @@ var zCardanoStakingDeregisterData = z5.object({
|
|
|
470
511
|
// DEREGISTER doesn't have a recipient
|
|
471
512
|
amount: zUnsignedIntString.describe("Amount to deregister")
|
|
472
513
|
}).describe("Cardano-like staking deregister data");
|
|
473
|
-
var zCardanoStakingRegisterData =
|
|
474
|
-
type:
|
|
514
|
+
var zCardanoStakingRegisterData = z7.object({
|
|
515
|
+
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
475
516
|
currency: zCurrency.describe("Transaction currency"),
|
|
476
517
|
// TODO: strict literal or enum?
|
|
477
518
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -479,8 +520,8 @@ var zCardanoStakingRegisterData = z5.object({
|
|
|
479
520
|
// REGISTER doesn't have a recipient
|
|
480
521
|
amount: zUnsignedIntString.describe("Amount to register")
|
|
481
522
|
}).describe("Cardano-like staking register data");
|
|
482
|
-
var zCardanoStakingWithdrawData =
|
|
483
|
-
type:
|
|
523
|
+
var zCardanoStakingWithdrawData = z7.object({
|
|
524
|
+
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
484
525
|
currency: zCurrency.describe("Transaction currency"),
|
|
485
526
|
// TODO: strict literal or enum?
|
|
486
527
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -488,12 +529,12 @@ var zCardanoStakingWithdrawData = z5.object({
|
|
|
488
529
|
// WITHDRAW doesn't have a recipient
|
|
489
530
|
amount: zUnsignedIntString.describe("Amount to withdraw")
|
|
490
531
|
}).describe("Cardano-like staking withdraw data");
|
|
491
|
-
var zGenericTransactionData =
|
|
492
|
-
type:
|
|
532
|
+
var zGenericTransactionData = z7.object({
|
|
533
|
+
type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
493
534
|
currency: zCurrency.describe("Transaction currency"),
|
|
494
|
-
rawTx:
|
|
535
|
+
rawTx: z7.string().describe("Raw tx")
|
|
495
536
|
}).describe("Generic transaction data");
|
|
496
|
-
var zTransactionData =
|
|
537
|
+
var zTransactionData = z7.discriminatedUnion("type", [
|
|
497
538
|
// Bitcoin
|
|
498
539
|
zBitcoinLikeSendData,
|
|
499
540
|
// Cardano
|
|
@@ -541,7 +582,7 @@ var zTransactionData = z5.discriminatedUnion("type", [
|
|
|
541
582
|
zTezosLikeSendData,
|
|
542
583
|
zTezosLikeUndelegateData
|
|
543
584
|
]);
|
|
544
|
-
var zSendOnlyTransactionData =
|
|
585
|
+
var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
|
|
545
586
|
zBitcoinLikeSendData,
|
|
546
587
|
zCardanoSendData,
|
|
547
588
|
zEthereumLikeSendData,
|
|
@@ -551,128 +592,89 @@ var zSendOnlyTransactionData = z5.discriminatedUnion("type", [
|
|
|
551
592
|
zStellarLikeSendData,
|
|
552
593
|
zTezosLikeSendData
|
|
553
594
|
]);
|
|
554
|
-
var zCreateTransactionRequestData =
|
|
555
|
-
accountId:
|
|
595
|
+
var zCreateTransactionRequestData = z7.object({
|
|
596
|
+
accountId: z7.string().min(1).describe("Target account id"),
|
|
556
597
|
transaction: zTransactionData
|
|
557
598
|
});
|
|
558
|
-
var zSignMessageRequestData =
|
|
599
|
+
var zSignMessageRequestData = z7.object({
|
|
559
600
|
message: zMessage.describe("Message to sign"),
|
|
560
|
-
accountId:
|
|
561
|
-
address:
|
|
562
|
-
derivationPath:
|
|
601
|
+
accountId: z7.string().min(1).describe("Target account id"),
|
|
602
|
+
address: z7.string().nonempty().describe("Address with which to sign the message"),
|
|
603
|
+
derivationPath: z7.string().nonempty().describe("Derivation path of the signing address")
|
|
563
604
|
});
|
|
564
605
|
var zSignMessageUserInputData = zSignMessageRequestData.partial({
|
|
565
606
|
address: true,
|
|
566
607
|
derivationPath: true
|
|
567
608
|
});
|
|
568
|
-
|
|
609
|
+
z7.object({
|
|
569
610
|
// Populated after input data is validated.
|
|
570
611
|
govRuleHsmId: zHsmObjectId.optional(),
|
|
571
612
|
// Populated after request is executed -- it holds the message-signing result.
|
|
572
613
|
signature: zHsmSignature.optional()
|
|
573
614
|
});
|
|
574
|
-
var zDigestData =
|
|
615
|
+
var zDigestData = z7.object({
|
|
575
616
|
digest: zHexString.describe("The hex string digest to sign"),
|
|
576
|
-
derivationPath:
|
|
577
|
-
});
|
|
578
|
-
var zSignDigestsRequestData = z5.object({
|
|
579
|
-
accountId: z5.string().min(1).describe("Target account id"),
|
|
580
|
-
digests: z5.array(zDigestData).describe("The digests to sign")
|
|
581
|
-
});
|
|
582
|
-
z5.object({
|
|
583
|
-
signatures: z5.array(zHsmSignature)
|
|
617
|
+
derivationPath: z7.string().nonempty().describe("The derivation path with which to sign the digest")
|
|
584
618
|
});
|
|
585
|
-
var
|
|
586
|
-
"
|
|
587
|
-
"
|
|
588
|
-
"DEPLOY_CONTRACT",
|
|
589
|
-
"EXECUTE_CONTRACT",
|
|
590
|
-
"ACTIVATE_TOKEN"
|
|
591
|
-
]);
|
|
592
|
-
var zValueTransactionOperation = z.object({
|
|
593
|
-
type: zValueTransactionOperationType,
|
|
594
|
-
currency: zCurrency,
|
|
595
|
-
recipient: z.string().nonempty(),
|
|
596
|
-
destinationTag: z.string().nonempty().optional(),
|
|
597
|
-
value: zUnsignedIntString
|
|
619
|
+
var zSignDigestsRequestData = z7.object({
|
|
620
|
+
accountId: z7.string().min(1).describe("Target account id"),
|
|
621
|
+
digests: z7.array(zDigestData).describe("The digests to sign")
|
|
598
622
|
});
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
type: zSigningOperationType
|
|
602
|
-
});
|
|
603
|
-
var zClassicOperationType = z.enum([
|
|
604
|
-
"SEND",
|
|
605
|
-
"STAKE",
|
|
606
|
-
"DEPLOY_CONTRACT",
|
|
607
|
-
"EXECUTE_CONTRACT",
|
|
608
|
-
"SIGN_MESSAGE",
|
|
609
|
-
"ACTIVATE_TOKEN"
|
|
610
|
-
]);
|
|
611
|
-
z.enum(["SIGN_DIGESTS"]);
|
|
612
|
-
var zOperationType = z.enum([
|
|
613
|
-
...zValueTransactionOperationType.options,
|
|
614
|
-
...zSigningOperationType.options
|
|
615
|
-
]);
|
|
616
|
-
z.discriminatedUnion("type", [
|
|
617
|
-
zValueTransactionOperation,
|
|
618
|
-
zSigningOperation
|
|
619
|
-
]);
|
|
620
|
-
var zNote = z5.object({
|
|
621
|
-
title: z5.string().describe("Request note title"),
|
|
622
|
-
content: z5.string().describe("Request note content")
|
|
623
|
+
z7.object({
|
|
624
|
+
signatures: z7.array(zHsmSignature)
|
|
623
625
|
});
|
|
624
626
|
|
|
625
627
|
// src/accounts/clients/types.ts
|
|
626
|
-
var zTransactionStatus =
|
|
627
|
-
var zBitcoinLikeCoinFields =
|
|
628
|
+
var zTransactionStatus = z7.enum(["SUCCESSFUL", "FAILED"]);
|
|
629
|
+
var zBitcoinLikeCoinFields = z7.object({
|
|
628
630
|
type: zBitcoinLikeTransactionType
|
|
629
631
|
});
|
|
630
|
-
var zCardanoLikeCoinFields =
|
|
632
|
+
var zCardanoLikeCoinFields = z7.object({
|
|
631
633
|
type: zCardanoLikeTransactionType
|
|
632
634
|
});
|
|
633
|
-
var zEthereumLikeTransferCoinFields =
|
|
635
|
+
var zEthereumLikeTransferCoinFields = z7.object({
|
|
634
636
|
type: zEthereumLikeTransferTransactionType,
|
|
635
|
-
gasPrice:
|
|
636
|
-
gasLimit:
|
|
637
|
-
nonce:
|
|
637
|
+
gasPrice: z7.string(),
|
|
638
|
+
gasLimit: z7.string(),
|
|
639
|
+
nonce: z7.string()
|
|
638
640
|
});
|
|
639
641
|
var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
|
|
640
642
|
type: zEthereumLikeContractTransactionType,
|
|
641
|
-
contractData:
|
|
643
|
+
contractData: z7.string().describe("Contract deployment or contract execution data")
|
|
642
644
|
});
|
|
643
|
-
var zGenericCoinFields =
|
|
645
|
+
var zGenericCoinFields = z7.object({
|
|
644
646
|
type: zGenericTransactionType
|
|
645
647
|
});
|
|
646
|
-
var zPolkadotLikeCoinFields =
|
|
648
|
+
var zPolkadotLikeCoinFields = z7.object({
|
|
647
649
|
type: zPolkadotLikeTransactionType
|
|
648
650
|
});
|
|
649
|
-
var zRippleLikeCoinFields =
|
|
651
|
+
var zRippleLikeCoinFields = z7.object({
|
|
650
652
|
type: zRippleLikeTransactionType,
|
|
651
|
-
memos:
|
|
652
|
-
destinationTag:
|
|
653
|
+
memos: z7.array(z7.string()),
|
|
654
|
+
destinationTag: z7.string()
|
|
653
655
|
});
|
|
654
|
-
var zSolanaLikeCoinFields =
|
|
656
|
+
var zSolanaLikeCoinFields = z7.object({
|
|
655
657
|
type: zSolanaLikeTransactionType
|
|
656
658
|
});
|
|
657
|
-
var zStellarLikeCoinFields =
|
|
659
|
+
var zStellarLikeCoinFields = z7.object({
|
|
658
660
|
type: zStellarLikeTransactionType
|
|
659
661
|
});
|
|
660
|
-
var zTezosLikeCoinFields =
|
|
662
|
+
var zTezosLikeCoinFields = z7.object({
|
|
661
663
|
type: zTezosLikeTransactionType
|
|
662
664
|
});
|
|
663
|
-
var zCommonTransactionResponse =
|
|
664
|
-
id:
|
|
665
|
-
hash:
|
|
666
|
-
block:
|
|
667
|
-
height:
|
|
668
|
-
time:
|
|
665
|
+
var zCommonTransactionResponse = z7.object({
|
|
666
|
+
id: z7.string().describe("Internal unique identifier"),
|
|
667
|
+
hash: z7.string().describe("Transaction hash"),
|
|
668
|
+
block: z7.object({
|
|
669
|
+
height: z7.string().nullable().describe("Transaction block height"),
|
|
670
|
+
time: z7.string().nullable().describe("Transaction block time")
|
|
669
671
|
}),
|
|
670
672
|
status: zTransactionStatus.describe("Transaction status"),
|
|
671
|
-
confirmations:
|
|
672
|
-
amount:
|
|
673
|
-
fee:
|
|
674
|
-
senders:
|
|
675
|
-
recipients:
|
|
673
|
+
confirmations: z7.string().describe("Block confirmations"),
|
|
674
|
+
amount: z7.string().describe("Transaction amount"),
|
|
675
|
+
fee: z7.string().describe("Transaction fee"),
|
|
676
|
+
senders: z7.array(z7.string()).describe("Senders (can be multiple for UTXOs-based accounts)"),
|
|
677
|
+
recipients: z7.array(z7.string()).describe("Recipients (can be multiple for multi-output transactions)")
|
|
676
678
|
});
|
|
677
679
|
var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.merge(zBitcoinLikeCoinFields).describe("Bitcoin-like transaction");
|
|
678
680
|
var zCardanoLikeTransactionResponse = zCommonTransactionResponse.merge(zCardanoLikeCoinFields).describe("Cardano-like transaction");
|
|
@@ -684,7 +686,7 @@ var zRippleLikeTransactionResponse = zCommonTransactionResponse.merge(zRippleLik
|
|
|
684
686
|
var zSolanaLikeTransactionResponse = zCommonTransactionResponse.merge(zSolanaLikeCoinFields).describe("Solana-like transaction");
|
|
685
687
|
var zStellarLikeTransactionResponse = zCommonTransactionResponse.merge(zStellarLikeCoinFields).describe("Stellar-like transaction");
|
|
686
688
|
var zTezosLikeTransactionResponse = zCommonTransactionResponse.merge(zTezosLikeCoinFields).describe("Tezos-like transaction");
|
|
687
|
-
var zTransactionResponse =
|
|
689
|
+
var zTransactionResponse = z7.discriminatedUnion("type", [
|
|
688
690
|
zBitcoinLikeTransactionResponse,
|
|
689
691
|
zCardanoLikeTransactionResponse,
|
|
690
692
|
zEthereumLikeTransferTransactionResponse,
|
|
@@ -696,7 +698,7 @@ var zTransactionResponse = z5.discriminatedUnion("type", [
|
|
|
696
698
|
zStellarLikeTransactionResponse,
|
|
697
699
|
zTezosLikeTransactionResponse
|
|
698
700
|
]);
|
|
699
|
-
|
|
701
|
+
z7.discriminatedUnion(
|
|
700
702
|
zTransactionResponse.discriminator,
|
|
701
703
|
ensureNonEmptyArray(
|
|
702
704
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
|
|
@@ -813,60 +815,60 @@ var INCLUDE_MEMBERS = {
|
|
|
813
815
|
include: { members: true }
|
|
814
816
|
}
|
|
815
817
|
};
|
|
816
|
-
var zUpdateQuorumRequestData =
|
|
817
|
-
quorum:
|
|
818
|
+
var zUpdateQuorumRequestData = z7.object({
|
|
819
|
+
quorum: z7.number().int().min(2).describe("Workspace quorum")
|
|
818
820
|
});
|
|
819
|
-
var zWorkspaceName =
|
|
821
|
+
var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
820
822
|
|
|
821
823
|
// src/tradelink/types.ts
|
|
822
|
-
var zTradelinkWhitelistAddress =
|
|
823
|
-
name:
|
|
824
|
+
var zTradelinkWhitelistAddress = z7.object({
|
|
825
|
+
name: z7.string().min(1),
|
|
824
826
|
currency: zCurrency,
|
|
825
|
-
address:
|
|
827
|
+
address: z7.string().min(1)
|
|
826
828
|
});
|
|
827
|
-
|
|
828
|
-
var zTradelinkId =
|
|
829
|
-
var zTradelinkOrgEntityResponse =
|
|
829
|
+
z7.array(zTradelinkWhitelistAddress);
|
|
830
|
+
var zTradelinkId = z7.string().describe("Unique identifier in Tradelink service");
|
|
831
|
+
var zTradelinkOrgEntityResponse = z7.object({
|
|
830
832
|
tradelinkId: zTradelinkId,
|
|
831
|
-
name:
|
|
832
|
-
code:
|
|
833
|
-
logoUrl:
|
|
833
|
+
name: z7.string().describe("Name"),
|
|
834
|
+
code: z7.string().describe("Code"),
|
|
835
|
+
logoUrl: z7.string().describe("Logo URL")
|
|
834
836
|
});
|
|
835
837
|
zTradelinkOrgEntityResponse.omit({
|
|
836
838
|
tradelinkId: true
|
|
837
839
|
});
|
|
838
|
-
|
|
840
|
+
z7.object({
|
|
839
841
|
tradelinkId: zTradelinkId
|
|
840
842
|
});
|
|
841
|
-
var zTradelinkExchangeConfig =
|
|
842
|
-
exchangeId:
|
|
843
|
-
repledgeAuthorized:
|
|
844
|
-
needsAssetManagerApprovalForSettlements:
|
|
843
|
+
var zTradelinkExchangeConfig = z7.object({
|
|
844
|
+
exchangeId: z7.string().describe("Tradelink exchange id"),
|
|
845
|
+
repledgeAuthorized: z7.boolean().describe("Determines whether this exchange is authorized to repledge on this account"),
|
|
846
|
+
needsAssetManagerApprovalForSettlements: z7.boolean().describe(
|
|
845
847
|
'Determines whether asset manager will "pre-approve" the settlement requests on this account'
|
|
846
848
|
)
|
|
847
849
|
});
|
|
848
|
-
var zTradelinkExchangeConfigs =
|
|
849
|
-
|
|
850
|
+
var zTradelinkExchangeConfigs = z7.array(zTradelinkExchangeConfig);
|
|
851
|
+
z7.object({
|
|
850
852
|
workspaceName: zWorkspaceName,
|
|
851
|
-
custodian:
|
|
852
|
-
assetManagers:
|
|
853
|
-
exchanges:
|
|
853
|
+
custodian: z7.object({ name: z7.string() }),
|
|
854
|
+
assetManagers: z7.array(z7.object({ name: z7.string() })),
|
|
855
|
+
exchanges: z7.array(z7.object({ name: z7.string() }))
|
|
854
856
|
});
|
|
855
|
-
|
|
856
|
-
tradelinkId:
|
|
857
|
+
z7.object({
|
|
858
|
+
tradelinkId: z7.string(),
|
|
857
859
|
workspaceName: zWorkspaceName,
|
|
858
860
|
custodian: zTradelinkOrgEntityResponse,
|
|
859
|
-
assetManagers:
|
|
860
|
-
exchanges:
|
|
861
|
+
assetManagers: z7.array(zTradelinkOrgEntityResponse),
|
|
862
|
+
exchanges: z7.array(zTradelinkOrgEntityResponse)
|
|
861
863
|
});
|
|
862
|
-
var zTradelinkAsset =
|
|
863
|
-
name:
|
|
864
|
-
magnitude:
|
|
864
|
+
var zTradelinkAsset = z7.object({
|
|
865
|
+
name: z7.string(),
|
|
866
|
+
magnitude: z7.number().int().nonnegative()
|
|
865
867
|
});
|
|
866
|
-
|
|
868
|
+
z7.object({
|
|
867
869
|
tradelinkId: zTradelinkId,
|
|
868
870
|
asset: zTradelinkAsset,
|
|
869
|
-
state:
|
|
871
|
+
state: z7.enum([
|
|
870
872
|
"PLEDGE_READY",
|
|
871
873
|
"PLEDGE_INCREMENT_PENDING_APPROVAL",
|
|
872
874
|
"PLEDGE_APPROVED",
|
|
@@ -883,28 +885,28 @@ z5.object({
|
|
|
883
885
|
"RECOVERING_FROM_FAILURE",
|
|
884
886
|
"PLEDGE_CONSUMED"
|
|
885
887
|
]),
|
|
886
|
-
isLocked:
|
|
887
|
-
amount:
|
|
888
|
-
pending:
|
|
889
|
-
repledge:
|
|
890
|
-
exchangeTradelinkId:
|
|
891
|
-
accountId:
|
|
892
|
-
});
|
|
893
|
-
|
|
894
|
-
workspaceName:
|
|
895
|
-
clientAccountId:
|
|
888
|
+
isLocked: z7.boolean(),
|
|
889
|
+
amount: z7.string().describe("Currently pledged amount"),
|
|
890
|
+
pending: z7.string().describe("Requested pledge increment, not yet approved"),
|
|
891
|
+
repledge: z7.string().describe("TODO: describe this field"),
|
|
892
|
+
exchangeTradelinkId: z7.string(),
|
|
893
|
+
accountId: z7.string()
|
|
894
|
+
});
|
|
895
|
+
z7.object({
|
|
896
|
+
workspaceName: z7.string(),
|
|
897
|
+
clientAccountId: z7.string().describe("Account ID from the client side"),
|
|
896
898
|
exchangeTradelinkId: zTradelinkId,
|
|
897
899
|
asset: zTradelinkAsset
|
|
898
900
|
});
|
|
899
|
-
|
|
901
|
+
z7.object({
|
|
900
902
|
pledgeTradelinkId: zTradelinkId,
|
|
901
903
|
amount: zUnsignedIntString,
|
|
902
904
|
asset: zTradelinkAsset
|
|
903
905
|
});
|
|
904
|
-
|
|
905
|
-
tradelinkId:
|
|
906
|
-
pledgeTradelinkId:
|
|
907
|
-
state:
|
|
906
|
+
z7.object({
|
|
907
|
+
tradelinkId: z7.string(),
|
|
908
|
+
pledgeTradelinkId: z7.string(),
|
|
909
|
+
state: z7.enum([
|
|
908
910
|
"REGISTERED",
|
|
909
911
|
"PENDING_REPLEDGE_CREATION_APPROVAL",
|
|
910
912
|
"PENDING_REPLEDGE_APPROVAL",
|
|
@@ -918,45 +920,45 @@ z5.object({
|
|
|
918
920
|
"CANCELED"
|
|
919
921
|
]),
|
|
920
922
|
// For now we only consider the outbound settlement
|
|
921
|
-
outboundTransactionHash:
|
|
923
|
+
outboundTransactionHash: z7.string().nullable()
|
|
922
924
|
});
|
|
923
925
|
|
|
924
926
|
// src/tradelink/request-data.ts
|
|
925
|
-
var zCustodianRequestData =
|
|
927
|
+
var zCustodianRequestData = z7.object({
|
|
926
928
|
settlement: zReviewStepWithUsersArray.describe("List of settlement review steps"),
|
|
927
929
|
withdraw: zReviewStepWithUsersArray.describe("List of withdraw review steps"),
|
|
928
930
|
arbitration: zReviewStepWithUsersArray.describe("List of arbitration review steps")
|
|
929
931
|
});
|
|
930
|
-
var zTradelinkEntityRequestData =
|
|
931
|
-
tradelinkId:
|
|
932
|
+
var zTradelinkEntityRequestData = z7.object({
|
|
933
|
+
tradelinkId: z7.string().min(1),
|
|
932
934
|
groups: zReviewStepWithUsersArray.describe("List of asset manager review groups"),
|
|
933
|
-
whitelist:
|
|
935
|
+
whitelist: z7.array(zTradelinkWhitelistAddress).describe("List of asset manager whitelisted addresses")
|
|
934
936
|
});
|
|
935
|
-
var zAdjustPledgeRequestData =
|
|
936
|
-
accountId:
|
|
937
|
-
exchangeId:
|
|
937
|
+
var zAdjustPledgeRequestData = z7.object({
|
|
938
|
+
accountId: z7.string().describe("Account id"),
|
|
939
|
+
exchangeId: z7.string().describe("Exchange id"),
|
|
938
940
|
amount: zIntString.describe("Amount to add to pledge")
|
|
939
941
|
});
|
|
940
|
-
var zRepledgeRequestData =
|
|
941
|
-
accountId:
|
|
942
|
-
exchangeId:
|
|
942
|
+
var zRepledgeRequestData = z7.object({
|
|
943
|
+
accountId: z7.string().describe("Account id"),
|
|
944
|
+
exchangeId: z7.string().describe("Exchange id"),
|
|
943
945
|
amount: zIntString.describe("Amount to add to pledge")
|
|
944
946
|
});
|
|
945
|
-
var zCreateSettlementRequestData =
|
|
946
|
-
accountId:
|
|
947
|
-
exchangeId:
|
|
947
|
+
var zCreateSettlementRequestData = z7.object({
|
|
948
|
+
accountId: z7.string().describe("Account id"),
|
|
949
|
+
exchangeId: z7.string().describe("Exchange id"),
|
|
948
950
|
transaction: zSendOnlyTransactionData
|
|
949
951
|
});
|
|
950
|
-
var zForceUnpledgeRequestData =
|
|
951
|
-
accountId:
|
|
952
|
-
exchangeId:
|
|
952
|
+
var zForceUnpledgeRequestData = z7.object({
|
|
953
|
+
accountId: z7.string().describe("Account id"),
|
|
954
|
+
exchangeId: z7.string().describe("Exchange id")
|
|
953
955
|
});
|
|
954
|
-
var zTradelinkWithdrawRequestData =
|
|
955
|
-
accountId:
|
|
956
|
+
var zTradelinkWithdrawRequestData = z7.object({
|
|
957
|
+
accountId: z7.string().describe("Account id"),
|
|
956
958
|
transaction: zSendOnlyTransactionData
|
|
957
959
|
});
|
|
958
|
-
var zTradelinkArbitrationRequestData =
|
|
959
|
-
accountId:
|
|
960
|
+
var zTradelinkArbitrationRequestData = z7.object({
|
|
961
|
+
accountId: z7.string().describe("Account id"),
|
|
960
962
|
transaction: zSendOnlyTransactionData
|
|
961
963
|
});
|
|
962
964
|
|
|
@@ -971,117 +973,117 @@ var zTradelinkAccountGovernanceFields = z.object({
|
|
|
971
973
|
exchangeConfigs: zTradelinkExchangeConfigs.describe("Tradelink exchange configurations")
|
|
972
974
|
}).describe("Tradelink");
|
|
973
975
|
var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).describe("Governance fields");
|
|
974
|
-
var zCardanoLikeStakingData =
|
|
975
|
-
staked:
|
|
976
|
+
var zCardanoLikeStakingData = z7.object({
|
|
977
|
+
staked: z7.string().describe("Staked balance")
|
|
976
978
|
}).nullable().describe("Cardano-like staking data");
|
|
977
|
-
var zCardanoLikeStakingFields =
|
|
978
|
-
type:
|
|
979
|
+
var zCardanoLikeStakingFields = z7.object({
|
|
980
|
+
type: z7.literal(AccountType.CARDANO_LIKE).describe("Account type"),
|
|
979
981
|
staking: zCardanoLikeStakingData.optional()
|
|
980
982
|
});
|
|
981
|
-
var zEthereumLikeStakingData =
|
|
982
|
-
totalStaking:
|
|
983
|
-
totalRewards:
|
|
984
|
-
availableRewards:
|
|
985
|
-
networkApy:
|
|
983
|
+
var zEthereumLikeStakingData = z7.object({
|
|
984
|
+
totalStaking: z7.string().describe("Total staked amount"),
|
|
985
|
+
totalRewards: z7.string().describe("Total of rewards"),
|
|
986
|
+
availableRewards: z7.string().describe("Available rewards"),
|
|
987
|
+
networkApy: z7.number().describe("Network APY")
|
|
986
988
|
}).nullable().describe("Ethereum-like staking data");
|
|
987
|
-
var zEthereumLikeStakingFields =
|
|
988
|
-
type:
|
|
989
|
+
var zEthereumLikeStakingFields = z7.object({
|
|
990
|
+
type: z7.literal(AccountType.ETHEREUM_LIKE).describe("Account type"),
|
|
989
991
|
staking: zEthereumLikeStakingData.optional()
|
|
990
992
|
});
|
|
991
|
-
var zPolkadotUnbondingAmount =
|
|
992
|
-
amount:
|
|
993
|
-
waiting_time:
|
|
994
|
-
});
|
|
995
|
-
var zPolkadotLikeStakingData =
|
|
996
|
-
info:
|
|
997
|
-
controllerAddress:
|
|
998
|
-
rewardsDestination:
|
|
999
|
-
proxies:
|
|
1000
|
-
legacyStaking:
|
|
1001
|
-
isNominator:
|
|
993
|
+
var zPolkadotUnbondingAmount = z7.object({
|
|
994
|
+
amount: z7.string().describe("Amount"),
|
|
995
|
+
waiting_time: z7.string().describe("Waiting time")
|
|
996
|
+
});
|
|
997
|
+
var zPolkadotLikeStakingData = z7.object({
|
|
998
|
+
info: z7.object({
|
|
999
|
+
controllerAddress: z7.string().nullable().describe("Controller address"),
|
|
1000
|
+
rewardsDestination: z7.string().nullable().describe("Rewards destination"),
|
|
1001
|
+
proxies: z7.array(z7.string()).describe("Proxies"),
|
|
1002
|
+
legacyStaking: z7.boolean().describe("True if account uses legacy staking"),
|
|
1003
|
+
isNominator: z7.boolean().describe("True if is nominator")
|
|
1002
1004
|
}),
|
|
1003
|
-
balances:
|
|
1004
|
-
free:
|
|
1005
|
-
reserved:
|
|
1006
|
-
frozen:
|
|
1007
|
-
bonded:
|
|
1008
|
-
available:
|
|
1009
|
-
unbonding:
|
|
1010
|
-
unbonded:
|
|
1011
|
-
totalUnbonding:
|
|
1012
|
-
totalUnbonded:
|
|
1005
|
+
balances: z7.object({
|
|
1006
|
+
free: z7.string().describe("Free balance"),
|
|
1007
|
+
reserved: z7.string().describe("Reserved balance"),
|
|
1008
|
+
frozen: z7.string().describe("Frozen balance"),
|
|
1009
|
+
bonded: z7.string().describe("Bonded balance"),
|
|
1010
|
+
available: z7.string().describe("Available balance"),
|
|
1011
|
+
unbonding: z7.array(zPolkadotUnbondingAmount).describe("Unbonding balances"),
|
|
1012
|
+
unbonded: z7.array(zPolkadotUnbondingAmount).describe("Unbonded balances"),
|
|
1013
|
+
totalUnbonding: z7.string().describe("Total unbonding"),
|
|
1014
|
+
totalUnbonded: z7.string().describe("Total unbonded")
|
|
1013
1015
|
}),
|
|
1014
|
-
anonymousProxy:
|
|
1015
|
-
address:
|
|
1016
|
-
createdAt:
|
|
1017
|
-
isController:
|
|
1018
|
-
isMain:
|
|
1019
|
-
balances:
|
|
1020
|
-
free:
|
|
1021
|
-
reserved:
|
|
1022
|
-
frozen:
|
|
1023
|
-
bonded:
|
|
1024
|
-
available:
|
|
1025
|
-
total:
|
|
1016
|
+
anonymousProxy: z7.object({
|
|
1017
|
+
address: z7.string().describe("Address"),
|
|
1018
|
+
createdAt: z7.string().describe("Creation date"),
|
|
1019
|
+
isController: z7.boolean().describe("True if is controller"),
|
|
1020
|
+
isMain: z7.boolean().describe("True if is main"),
|
|
1021
|
+
balances: z7.object({
|
|
1022
|
+
free: z7.string().describe("Anonymous proxy free balance"),
|
|
1023
|
+
reserved: z7.string().describe("Anonymous proxy reserved balance"),
|
|
1024
|
+
frozen: z7.string().describe("Anonymous proxy frozen balance"),
|
|
1025
|
+
bonded: z7.string().describe("Anonymous proxy bonded balance"),
|
|
1026
|
+
available: z7.string().describe("Anonymous proxy available balance"),
|
|
1027
|
+
total: z7.string().describe("Anonymous proxy total balance")
|
|
1026
1028
|
}).nullable(),
|
|
1027
|
-
blockHeight:
|
|
1028
|
-
extIndex:
|
|
1029
|
-
index:
|
|
1030
|
-
kind:
|
|
1029
|
+
blockHeight: z7.string().describe("Anonymous proxy block height"),
|
|
1030
|
+
extIndex: z7.string().describe("Ext index"),
|
|
1031
|
+
index: z7.string().describe("Index"),
|
|
1032
|
+
kind: z7.string().describe("Kind")
|
|
1031
1033
|
}).nullable().describe("Anonymous proxy")
|
|
1032
1034
|
}).nullable().describe("Polkadot-like staking data");
|
|
1033
|
-
var zPolkadotLikeStakingFields =
|
|
1034
|
-
type:
|
|
1035
|
+
var zPolkadotLikeStakingFields = z7.object({
|
|
1036
|
+
type: z7.literal(AccountType.POLKADOT_LIKE).describe("Account type"),
|
|
1035
1037
|
staking: zPolkadotLikeStakingData.optional()
|
|
1036
1038
|
});
|
|
1037
|
-
var zSolanaStakingAccountStatus =
|
|
1038
|
-
var zSolanaLikeStakingData =
|
|
1039
|
-
staked:
|
|
1040
|
-
rewards:
|
|
1041
|
-
total:
|
|
1042
|
-
last7:
|
|
1043
|
-
last30:
|
|
1039
|
+
var zSolanaStakingAccountStatus = z7.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).describe("Staking account status");
|
|
1040
|
+
var zSolanaLikeStakingData = z7.object({
|
|
1041
|
+
staked: z7.string().describe("Staked balance"),
|
|
1042
|
+
rewards: z7.object({
|
|
1043
|
+
total: z7.string().describe("Total rewards"),
|
|
1044
|
+
last7: z7.string().describe("Rewards on last 7 days"),
|
|
1045
|
+
last30: z7.string().describe("Rewards on last 30 days")
|
|
1044
1046
|
}),
|
|
1045
|
-
stakes:
|
|
1046
|
-
|
|
1047
|
-
uid:
|
|
1048
|
-
baseAccountUid:
|
|
1049
|
-
pubKey:
|
|
1050
|
-
validatorPubKey:
|
|
1051
|
-
initialAmount:
|
|
1052
|
-
activeAmount:
|
|
1053
|
-
inactiveAmount:
|
|
1054
|
-
totalBalance:
|
|
1055
|
-
creationDate:
|
|
1056
|
-
activationEpoch:
|
|
1057
|
-
activationDate:
|
|
1058
|
-
deactivationEpoch:
|
|
1059
|
-
deactivationDate:
|
|
1047
|
+
stakes: z7.array(
|
|
1048
|
+
z7.object({
|
|
1049
|
+
uid: z7.string(),
|
|
1050
|
+
baseAccountUid: z7.string(),
|
|
1051
|
+
pubKey: z7.string().describe("Public key"),
|
|
1052
|
+
validatorPubKey: z7.string().nullable().describe("Validator public key"),
|
|
1053
|
+
initialAmount: z7.string().describe("Initial amount"),
|
|
1054
|
+
activeAmount: z7.string().describe("Active amount"),
|
|
1055
|
+
inactiveAmount: z7.string().describe("Inactive amount"),
|
|
1056
|
+
totalBalance: z7.string().describe("Total balance"),
|
|
1057
|
+
creationDate: z7.string().describe("Creation date"),
|
|
1058
|
+
activationEpoch: z7.string().nullable().describe("Activation epoch"),
|
|
1059
|
+
activationDate: z7.string().nullable().describe("Activation date"),
|
|
1060
|
+
deactivationEpoch: z7.string().nullable().describe("Deactivation epoch"),
|
|
1061
|
+
deactivationDate: z7.string().nullable().describe("Deactivation date"),
|
|
1060
1062
|
status: zSolanaStakingAccountStatus,
|
|
1061
|
-
rentExemptReserve:
|
|
1062
|
-
withdrawableAmount:
|
|
1063
|
-
totalRewards:
|
|
1064
|
-
creationTxHash:
|
|
1065
|
-
actionsTxHashes:
|
|
1063
|
+
rentExemptReserve: z7.string().describe("Rent exempt reserve"),
|
|
1064
|
+
withdrawableAmount: z7.string().describe("Withdrawable amount"),
|
|
1065
|
+
totalRewards: z7.string().describe("Total rewards"),
|
|
1066
|
+
creationTxHash: z7.string().nullable().describe("Creation transaction hash"),
|
|
1067
|
+
actionsTxHashes: z7.array(z7.string()).describe("Actions transactions hashes")
|
|
1066
1068
|
})
|
|
1067
1069
|
)
|
|
1068
1070
|
}).nullable().describe("Solana-like staking data");
|
|
1069
|
-
var zSolanaLikeStakingFields =
|
|
1070
|
-
type:
|
|
1071
|
+
var zSolanaLikeStakingFields = z7.object({
|
|
1072
|
+
type: z7.literal(AccountType.SOLANA_LIKE).describe("Account type"),
|
|
1071
1073
|
staking: zSolanaLikeStakingData.optional()
|
|
1072
1074
|
});
|
|
1073
|
-
var zTezosLikeStakingData =
|
|
1074
|
-
delegations:
|
|
1075
|
-
|
|
1076
|
-
address:
|
|
1075
|
+
var zTezosLikeStakingData = z7.object({
|
|
1076
|
+
delegations: z7.array(
|
|
1077
|
+
z7.object({
|
|
1078
|
+
address: z7.string()
|
|
1077
1079
|
})
|
|
1078
1080
|
)
|
|
1079
1081
|
}).nullable().describe("Tezos-like staking data");
|
|
1080
|
-
var zTezosLikeStakingFields =
|
|
1081
|
-
type:
|
|
1082
|
+
var zTezosLikeStakingFields = z7.object({
|
|
1083
|
+
type: z7.literal(AccountType.TEZOS_LIKE).describe("Account type"),
|
|
1082
1084
|
staking: zTezosLikeStakingData.optional()
|
|
1083
1085
|
});
|
|
1084
|
-
|
|
1086
|
+
z7.discriminatedUnion("type", [
|
|
1085
1087
|
zCardanoLikeStakingFields,
|
|
1086
1088
|
zEthereumLikeStakingFields,
|
|
1087
1089
|
zPolkadotLikeStakingFields,
|
|
@@ -1090,60 +1092,60 @@ z5.discriminatedUnion("type", [
|
|
|
1090
1092
|
]);
|
|
1091
1093
|
|
|
1092
1094
|
// src/accounts/types.ts
|
|
1093
|
-
var zAccountCommonFields =
|
|
1094
|
-
id:
|
|
1095
|
-
legacyId:
|
|
1096
|
-
name:
|
|
1095
|
+
var zAccountCommonFields = z7.object({
|
|
1096
|
+
id: z7.string().describe("Internal unique identifier"),
|
|
1097
|
+
legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1098
|
+
name: z7.string().describe("Name"),
|
|
1097
1099
|
currency: zCurrency,
|
|
1098
|
-
index:
|
|
1099
|
-
derivationPath:
|
|
1100
|
-
status:
|
|
1101
|
-
createdAt:
|
|
1102
|
-
updatedAt:
|
|
1103
|
-
});
|
|
1104
|
-
var zAccountBalanceFields =
|
|
1105
|
-
total:
|
|
1106
|
-
pending:
|
|
1100
|
+
index: z7.number().gte(0).describe("BIP44 account index"),
|
|
1101
|
+
derivationPath: z7.string().describe("Derivation path"),
|
|
1102
|
+
status: z7.nativeEnum(ActivationStatus).describe("Status"),
|
|
1103
|
+
createdAt: z7.coerce.date().describe("Creation timestamp"),
|
|
1104
|
+
updatedAt: z7.coerce.date().describe("Last modification timestamp")
|
|
1105
|
+
});
|
|
1106
|
+
var zAccountBalanceFields = z7.object({
|
|
1107
|
+
total: z7.string().describe("Total balance"),
|
|
1108
|
+
pending: z7.string().describe("Pending balance")
|
|
1107
1109
|
}).describe("Balance fields");
|
|
1108
1110
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1109
1111
|
asset: zAccountAssetStaticFields,
|
|
1110
1112
|
governance: zAccountGovernanceFields
|
|
1111
1113
|
});
|
|
1112
|
-
|
|
1114
|
+
z7.enum([
|
|
1113
1115
|
"name",
|
|
1114
1116
|
"currency",
|
|
1115
1117
|
"index",
|
|
1116
1118
|
"createdAt",
|
|
1117
1119
|
"updatedAt"
|
|
1118
1120
|
]).default("createdAt");
|
|
1119
|
-
var zCommonLiveData =
|
|
1120
|
-
id:
|
|
1121
|
+
var zCommonLiveData = z7.object({
|
|
1122
|
+
id: z7.string().describe("Account internal unique identifier"),
|
|
1121
1123
|
balance: zAccountBalanceFields
|
|
1122
1124
|
});
|
|
1123
1125
|
var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
1124
|
-
type:
|
|
1126
|
+
type: z7.literal(AccountType.BITCOIN_LIKE).describe("Account type")
|
|
1125
1127
|
}).describe("Bitcoin-like");
|
|
1126
1128
|
var zCardanoLikeLiveData = zCommonLiveData.merge(zCardanoLikeStakingFields).describe("Cardano-like");
|
|
1127
1129
|
var zEthereumLikeLiveData = zCommonLiveData.merge(zEthereumLikeStakingFields).describe("Ethereum-like");
|
|
1128
1130
|
var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
|
|
1129
|
-
type:
|
|
1131
|
+
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE, AccountType.TRC20_LIKE]).describe("Account type")
|
|
1130
1132
|
}).describe("Ethereum-like token");
|
|
1131
1133
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
1132
|
-
type:
|
|
1134
|
+
type: z7.literal(AccountType.GENERIC_LIKE).describe("Account type")
|
|
1133
1135
|
}).describe("Generic-like");
|
|
1134
1136
|
var zPolkadotLikeLiveData = zCommonLiveData.merge(zPolkadotLikeStakingFields).describe("Polkadot-like");
|
|
1135
1137
|
var zRawSigningLiveData = zCommonLiveData.extend({
|
|
1136
|
-
type:
|
|
1138
|
+
type: z7.literal(AccountType.RAW_SIGNING).describe("Account type")
|
|
1137
1139
|
}).describe("Raw signing account");
|
|
1138
1140
|
var zRippleLikeLiveData = zCommonLiveData.extend({
|
|
1139
|
-
type:
|
|
1141
|
+
type: z7.literal(AccountType.RIPPLE_LIKE).describe("Account type")
|
|
1140
1142
|
}).describe("Ripple-like");
|
|
1141
1143
|
var zSolanaLikeLiveData = zCommonLiveData.merge(zSolanaLikeStakingFields).describe("Solana-like");
|
|
1142
1144
|
var zStellarLikeLiveData = zCommonLiveData.extend({
|
|
1143
|
-
type:
|
|
1145
|
+
type: z7.literal(AccountType.STELLAR_LIKE).describe("Account type")
|
|
1144
1146
|
}).describe("Stellar-like");
|
|
1145
1147
|
var zTezosLikeLiveData = zCommonLiveData.merge(zTezosLikeStakingFields).describe("Tezos-like");
|
|
1146
|
-
|
|
1148
|
+
z7.discriminatedUnion("type", [
|
|
1147
1149
|
zBitcoinLikeLiveData,
|
|
1148
1150
|
zCardanoLikeLiveData,
|
|
1149
1151
|
zEthereumLikeLiveData,
|
|
@@ -1158,39 +1160,39 @@ z5.discriminatedUnion("type", [
|
|
|
1158
1160
|
]);
|
|
1159
1161
|
|
|
1160
1162
|
// src/accounts/app-types.ts
|
|
1161
|
-
|
|
1162
|
-
title: z5.string().describe("Transaction note title"),
|
|
1163
|
-
content: z5.string().describe("Transaction note content")
|
|
1164
|
-
}).describe("Optional transaction note");
|
|
1165
|
-
z5.discriminatedUnion(
|
|
1163
|
+
z7.discriminatedUnion(
|
|
1166
1164
|
zTransactionResponse.discriminator,
|
|
1167
1165
|
ensureNonEmptyArray(
|
|
1168
|
-
zTransactionResponse.options.map(
|
|
1166
|
+
zTransactionResponse.options.map(
|
|
1167
|
+
(_) => _.extend({
|
|
1168
|
+
note: zNote.nullable().describe("Optional transaction note")
|
|
1169
|
+
})
|
|
1170
|
+
)
|
|
1169
1171
|
)
|
|
1170
1172
|
);
|
|
1171
|
-
var zWhitelistAddress =
|
|
1172
|
-
name:
|
|
1173
|
+
var zWhitelistAddress = z7.object({
|
|
1174
|
+
name: z7.string().min(1).max(50),
|
|
1173
1175
|
currency: zCurrency,
|
|
1174
|
-
address:
|
|
1176
|
+
address: z7.string().min(1).max(200),
|
|
1175
1177
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1176
1178
|
// Empty array (or undefined) means no check on destination tag.
|
|
1177
|
-
destinationTags:
|
|
1179
|
+
destinationTags: z7.array(z7.string().min(1).regex(/^\w+$/)).optional()
|
|
1178
1180
|
});
|
|
1179
|
-
var zWhitelistAddresses =
|
|
1180
|
-
var zWhitelistName =
|
|
1181
|
-
var zCreateWhitelistRequestData =
|
|
1181
|
+
var zWhitelistAddresses = z7.array(zWhitelistAddress);
|
|
1182
|
+
var zWhitelistName = z7.string().min(1).max(45).describe("Whitelist name");
|
|
1183
|
+
var zCreateWhitelistRequestData = z7.object({
|
|
1182
1184
|
name: zWhitelistName,
|
|
1183
|
-
description:
|
|
1185
|
+
description: z7.string().nullable(),
|
|
1184
1186
|
addresses: zWhitelistAddresses,
|
|
1185
|
-
type:
|
|
1187
|
+
type: z7.nativeEnum(WhitelistType)
|
|
1186
1188
|
});
|
|
1187
|
-
var zEditWhitelistRequestData =
|
|
1189
|
+
var zEditWhitelistRequestData = z7.object({
|
|
1188
1190
|
name: zWhitelistName,
|
|
1189
1191
|
addresses: zWhitelistAddresses
|
|
1190
1192
|
});
|
|
1191
1193
|
|
|
1192
1194
|
// src/policies/db-utils.ts
|
|
1193
|
-
var zBaseGovRuleData =
|
|
1195
|
+
var zBaseGovRuleData = z7.object({
|
|
1194
1196
|
// Steps of users that will need to review operations
|
|
1195
1197
|
reviewSteps: zReviewStepsArray,
|
|
1196
1198
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
@@ -1207,83 +1209,83 @@ zBaseGovRuleData.extend({
|
|
|
1207
1209
|
({
|
|
1208
1210
|
reviewConfigs: { include: review_config_exports.INCLUDE_MEMBERS }
|
|
1209
1211
|
});
|
|
1210
|
-
var zPolicyName =
|
|
1211
|
-
var zCurrency2 =
|
|
1212
|
-
var zCreatePublicPolicyRequestData =
|
|
1212
|
+
var zPolicyName = z7.string().min(1).max(19).describe("Policy name");
|
|
1213
|
+
var zCurrency2 = z7.string().min(1).max(40).regex(/^\w+$/).describe("Currency");
|
|
1214
|
+
var zCreatePublicPolicyRequestData = z7.object({
|
|
1213
1215
|
name: zPolicyName,
|
|
1214
|
-
description:
|
|
1216
|
+
description: z7.string().nullable().describe("Description"),
|
|
1215
1217
|
currency: zCurrency2.nullable(),
|
|
1216
|
-
govRules:
|
|
1218
|
+
govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
|
|
1217
1219
|
});
|
|
1218
|
-
var zEditPublicPolicyRequestData =
|
|
1220
|
+
var zEditPublicPolicyRequestData = z7.object({
|
|
1219
1221
|
name: zPolicyName,
|
|
1220
|
-
description:
|
|
1221
|
-
govRules:
|
|
1222
|
+
description: z7.string().nullable().describe("Description"),
|
|
1223
|
+
govRules: z7.array(zClassicGovRuleData).describe("Governance rules")
|
|
1222
1224
|
});
|
|
1223
1225
|
|
|
1224
1226
|
// src/accounts/request-data.ts
|
|
1225
|
-
var zAccountName =
|
|
1226
|
-
var zSignDigestsGovRuleData =
|
|
1227
|
-
operationType:
|
|
1227
|
+
var zAccountName = z7.string().min(1).max(40).describe("Account name");
|
|
1228
|
+
var zSignDigestsGovRuleData = z7.object({
|
|
1229
|
+
operationType: z7.literal("SIGN_DIGESTS"),
|
|
1228
1230
|
reviewSteps: zReviewStepWithUsersArray
|
|
1229
1231
|
// we need to control for API users only
|
|
1230
1232
|
}).describe("Digest signing rule");
|
|
1231
|
-
var zAccountPolicyRequestData =
|
|
1232
|
-
|
|
1233
|
-
|
|
1233
|
+
var zAccountPolicyRequestData = z7.union([
|
|
1234
|
+
z7.object({ policyId: z7.string() }).describe("Account policy"),
|
|
1235
|
+
z7.object({ rules: z7.array(zClassicGovRuleData) }).describe("Account governance rules")
|
|
1234
1236
|
]).describe("Account policy or governance rules");
|
|
1235
|
-
var zCreateAccountGovernanceData =
|
|
1236
|
-
|
|
1237
|
-
type:
|
|
1237
|
+
var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
1238
|
+
z7.object({
|
|
1239
|
+
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1238
1240
|
policy: zAccountPolicyRequestData
|
|
1239
1241
|
}),
|
|
1240
|
-
|
|
1241
|
-
type:
|
|
1242
|
-
assetManagerId:
|
|
1242
|
+
z7.object({
|
|
1243
|
+
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1244
|
+
assetManagerId: z7.string(),
|
|
1243
1245
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1244
1246
|
}),
|
|
1245
|
-
|
|
1246
|
-
type:
|
|
1247
|
-
policy:
|
|
1247
|
+
z7.object({
|
|
1248
|
+
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1249
|
+
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1248
1250
|
})
|
|
1249
1251
|
]);
|
|
1250
|
-
var zCreateAccountUserInputData =
|
|
1252
|
+
var zCreateAccountUserInputData = z7.object({
|
|
1251
1253
|
name: zAccountName,
|
|
1252
1254
|
currency: zCurrency,
|
|
1253
1255
|
// "bitcoin"
|
|
1254
|
-
index:
|
|
1255
|
-
contractAddress:
|
|
1256
|
+
index: z7.number().nonnegative().optional().describe("Account index"),
|
|
1257
|
+
contractAddress: z7.string().min(1).optional().describe("Account contract address"),
|
|
1256
1258
|
governance: zCreateAccountGovernanceData
|
|
1257
1259
|
});
|
|
1258
1260
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
1259
|
-
index:
|
|
1260
|
-
derivationPath:
|
|
1261
|
-
type:
|
|
1261
|
+
index: z7.number().nonnegative().describe("Account index"),
|
|
1262
|
+
derivationPath: z7.string().describe("Account bip44 derivation path"),
|
|
1263
|
+
type: z7.nativeEnum(AccountType)
|
|
1262
1264
|
// "BITCOIN_LIKE"
|
|
1263
1265
|
});
|
|
1264
|
-
var zEditAccountGovernanceData =
|
|
1265
|
-
|
|
1266
|
-
type:
|
|
1266
|
+
var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
1267
|
+
z7.object({
|
|
1268
|
+
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1267
1269
|
policy: zAccountPolicyRequestData
|
|
1268
1270
|
}),
|
|
1269
|
-
|
|
1270
|
-
type:
|
|
1271
|
+
z7.object({
|
|
1272
|
+
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1271
1273
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1272
1274
|
}),
|
|
1273
|
-
|
|
1274
|
-
type:
|
|
1275
|
-
policy:
|
|
1275
|
+
z7.object({
|
|
1276
|
+
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1277
|
+
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1276
1278
|
})
|
|
1277
1279
|
]);
|
|
1278
|
-
var zEditAccountRequestData =
|
|
1280
|
+
var zEditAccountRequestData = z7.object({
|
|
1279
1281
|
name: zAccountName,
|
|
1280
1282
|
governance: zEditAccountGovernanceData
|
|
1281
1283
|
});
|
|
1282
|
-
var zActivateAccountRequestData =
|
|
1283
|
-
var zEditTokenRuleRequestData =
|
|
1284
|
-
parentAccountId:
|
|
1285
|
-
contractAddress:
|
|
1286
|
-
rules:
|
|
1284
|
+
var zActivateAccountRequestData = z7.object({});
|
|
1285
|
+
var zEditTokenRuleRequestData = z7.object({
|
|
1286
|
+
parentAccountId: z7.string().min(1).describe("Parent account unique ID"),
|
|
1287
|
+
contractAddress: z7.string().min(1).describe("Token contract address"),
|
|
1288
|
+
rules: z7.array(zClassicGovRuleData).describe("Account governance rules")
|
|
1287
1289
|
});
|
|
1288
1290
|
|
|
1289
1291
|
// src/accounts/app-utils.ts
|
|
@@ -1380,15 +1382,15 @@ var serializeAccount = (account) => {
|
|
|
1380
1382
|
};
|
|
1381
1383
|
return zAccountResponse.parse(response);
|
|
1382
1384
|
};
|
|
1383
|
-
var zSciConfigData =
|
|
1384
|
-
dapps:
|
|
1385
|
-
customContractCallEnabled:
|
|
1385
|
+
var zSciConfigData = z7.object({
|
|
1386
|
+
dapps: z7.array(z7.string()).nullable().describe("Allowed DApps, null allows all"),
|
|
1387
|
+
customContractCallEnabled: z7.boolean().describe("Allow non-DApp SCI")
|
|
1386
1388
|
});
|
|
1387
|
-
var zCreateSciConfigRequestData =
|
|
1388
|
-
account:
|
|
1389
|
+
var zCreateSciConfigRequestData = z7.object({
|
|
1390
|
+
account: z7.string().describe("Account UUID"),
|
|
1389
1391
|
config: zSciConfigData
|
|
1390
1392
|
});
|
|
1391
|
-
var zEditSciConfigRequestData =
|
|
1393
|
+
var zEditSciConfigRequestData = z7.object({
|
|
1392
1394
|
config: zSciConfigData
|
|
1393
1395
|
});
|
|
1394
1396
|
var zRequestReviewStep = z.object({
|
|
@@ -1411,287 +1413,287 @@ zUserRegistrationCreateInput.extend({
|
|
|
1411
1413
|
});
|
|
1412
1414
|
|
|
1413
1415
|
// src/users/request-data.ts
|
|
1414
|
-
var zCreatePsdUserRequestData =
|
|
1415
|
-
registrationId:
|
|
1416
|
+
var zCreatePsdUserRequestData = z7.object({
|
|
1417
|
+
registrationId: z7.string().describe("User registration ID")
|
|
1416
1418
|
});
|
|
1417
|
-
var zCreateApiUserRequestData =
|
|
1419
|
+
var zCreateApiUserRequestData = z7.object({
|
|
1418
1420
|
name: zUserName,
|
|
1419
|
-
pubKey:
|
|
1420
|
-
role:
|
|
1421
|
-
viewAll:
|
|
1421
|
+
pubKey: z7.string().describe("Public key"),
|
|
1422
|
+
role: z7.enum(["ADMIN", "OPERATOR"]).describe("User role"),
|
|
1423
|
+
viewAll: z7.boolean().describe("View all data").default(false).optional()
|
|
1422
1424
|
}).describe("Create API user request data");
|
|
1423
|
-
var zCreateApiUserAccessRequestData =
|
|
1425
|
+
var zCreateApiUserAccessRequestData = z7.object({
|
|
1424
1426
|
name: zUserName
|
|
1425
1427
|
}).describe("Create API user credential request data");
|
|
1426
|
-
|
|
1427
|
-
authUserId:
|
|
1428
|
+
z7.object({
|
|
1429
|
+
authUserId: z7.string().describe("Authentication broker ID")
|
|
1428
1430
|
}).describe("Managed data for API user");
|
|
1429
|
-
var zGroupName =
|
|
1430
|
-
var zCreateGroupRequestData =
|
|
1431
|
+
var zGroupName = z7.string().min(1).max(19).describe("Group name");
|
|
1432
|
+
var zCreateGroupRequestData = z7.object({
|
|
1431
1433
|
name: zGroupName,
|
|
1432
|
-
description:
|
|
1433
|
-
members:
|
|
1434
|
+
description: z7.string().nullable().describe("Group description"),
|
|
1435
|
+
members: z7.array(z7.string()).describe("List of group members ids")
|
|
1434
1436
|
});
|
|
1435
|
-
var zEditGroupRequestData =
|
|
1437
|
+
var zEditGroupRequestData = z7.object({
|
|
1436
1438
|
name: zGroupName,
|
|
1437
|
-
description:
|
|
1438
|
-
members:
|
|
1439
|
+
description: z7.string().nullable().describe("Group description"),
|
|
1440
|
+
members: z7.array(z7.string()).describe("List of group members ids")
|
|
1439
1441
|
});
|
|
1440
|
-
var zApiKeyName =
|
|
1441
|
-
var zCreateApiKeyRequestData =
|
|
1442
|
+
var zApiKeyName = z7.string().min(1).max(19).describe("API key name");
|
|
1443
|
+
var zCreateApiKeyRequestData = z7.object({
|
|
1442
1444
|
name: zApiKeyName,
|
|
1443
|
-
entities:
|
|
1444
|
-
scopes:
|
|
1445
|
+
entities: z7.array(z7.string()).describe("List of related entities ids"),
|
|
1446
|
+
scopes: z7.object({}).describe("FIXME to be precised")
|
|
1445
1447
|
}).describe("Create read-only API key request data");
|
|
1446
1448
|
var zEditApiKeyRequestData = zCreateApiKeyRequestData.describe(
|
|
1447
1449
|
"Edit read-only API key request data"
|
|
1448
1450
|
);
|
|
1449
|
-
var zEntityName =
|
|
1450
|
-
var zCreateEntityRequestData =
|
|
1451
|
+
var zEntityName = z7.string().min(1).max(19).describe("Entity name");
|
|
1452
|
+
var zCreateEntityRequestData = z7.object({
|
|
1451
1453
|
name: zEntityName,
|
|
1452
|
-
accounts:
|
|
1454
|
+
accounts: z7.array(z7.string())
|
|
1453
1455
|
});
|
|
1454
|
-
var zEditEntityRequestData =
|
|
1456
|
+
var zEditEntityRequestData = z7.object({
|
|
1455
1457
|
name: zEntityName,
|
|
1456
|
-
accounts:
|
|
1458
|
+
accounts: z7.array(z7.string())
|
|
1457
1459
|
});
|
|
1458
1460
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1459
|
-
var zWorkspaceRuleRequestData =
|
|
1460
|
-
permission:
|
|
1461
|
+
var zWorkspaceRuleRequestData = z7.object({
|
|
1462
|
+
permission: z7.nativeEnum(NonRootAdminPermission).describe("Granted permissions"),
|
|
1461
1463
|
reviewConfig: zReviewStepWithUsersArray.describe("List of admin review steps")
|
|
1462
1464
|
});
|
|
1463
1465
|
|
|
1464
1466
|
// src/requests/request-data.ts
|
|
1465
1467
|
var zVaultRequestMixinsByType = {
|
|
1466
1468
|
// Workspaces
|
|
1467
|
-
[RequestType.UPDATE_QUORUM]:
|
|
1468
|
-
type:
|
|
1469
|
+
[RequestType.UPDATE_QUORUM]: z7.object({
|
|
1470
|
+
type: z7.literal(RequestType.UPDATE_QUORUM),
|
|
1469
1471
|
data: zUpdateQuorumRequestData
|
|
1470
1472
|
}),
|
|
1471
1473
|
// Operator requests
|
|
1472
|
-
[RequestType.CREATE_TRANSACTION]:
|
|
1473
|
-
type:
|
|
1474
|
+
[RequestType.CREATE_TRANSACTION]: z7.object({
|
|
1475
|
+
type: z7.literal(RequestType.CREATE_TRANSACTION),
|
|
1474
1476
|
data: zCreateTransactionRequestData,
|
|
1475
|
-
meta:
|
|
1476
|
-
hash:
|
|
1477
|
+
meta: z7.object({
|
|
1478
|
+
hash: z7.string().nullable()
|
|
1477
1479
|
}).optional().nullable()
|
|
1478
1480
|
}),
|
|
1479
|
-
[RequestType.SIGN_MESSAGE]:
|
|
1480
|
-
type:
|
|
1481
|
+
[RequestType.SIGN_MESSAGE]: z7.object({
|
|
1482
|
+
type: z7.literal(RequestType.SIGN_MESSAGE),
|
|
1481
1483
|
data: zSignMessageRequestData
|
|
1482
1484
|
}),
|
|
1483
|
-
[RequestType.SIGN_DIGESTS]:
|
|
1484
|
-
type:
|
|
1485
|
+
[RequestType.SIGN_DIGESTS]: z7.object({
|
|
1486
|
+
type: z7.literal(RequestType.SIGN_DIGESTS),
|
|
1485
1487
|
data: zSignDigestsRequestData
|
|
1486
1488
|
}),
|
|
1487
1489
|
// Accounts
|
|
1488
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1489
|
-
type:
|
|
1490
|
+
[RequestType.CREATE_ACCOUNT]: z7.object({
|
|
1491
|
+
type: z7.literal(RequestType.CREATE_ACCOUNT),
|
|
1490
1492
|
data: zCreateAccountRequestData
|
|
1491
1493
|
}),
|
|
1492
|
-
[RequestType.EDIT_ACCOUNT]:
|
|
1493
|
-
type:
|
|
1494
|
-
targetId:
|
|
1494
|
+
[RequestType.EDIT_ACCOUNT]: z7.object({
|
|
1495
|
+
type: z7.literal(RequestType.EDIT_ACCOUNT),
|
|
1496
|
+
targetId: z7.string(),
|
|
1495
1497
|
data: zEditAccountRequestData
|
|
1496
1498
|
}),
|
|
1497
|
-
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]:
|
|
1498
|
-
type:
|
|
1499
|
-
targetId:
|
|
1499
|
+
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]: z7.object({
|
|
1500
|
+
type: z7.literal(RequestType.ACTIVATE_TRADELINK_ACCOUNT),
|
|
1501
|
+
targetId: z7.string(),
|
|
1500
1502
|
data: zActivateAccountRequestData
|
|
1501
1503
|
}),
|
|
1502
|
-
[RequestType.EDIT_TOKEN_RULE]:
|
|
1503
|
-
type:
|
|
1504
|
-
targetId:
|
|
1504
|
+
[RequestType.EDIT_TOKEN_RULE]: z7.object({
|
|
1505
|
+
type: z7.literal(RequestType.EDIT_TOKEN_RULE),
|
|
1506
|
+
targetId: z7.string(),
|
|
1505
1507
|
data: zEditTokenRuleRequestData
|
|
1506
1508
|
}),
|
|
1507
1509
|
// Groups
|
|
1508
|
-
[RequestType.CREATE_GROUP]:
|
|
1509
|
-
type:
|
|
1510
|
+
[RequestType.CREATE_GROUP]: z7.object({
|
|
1511
|
+
type: z7.literal(RequestType.CREATE_GROUP),
|
|
1510
1512
|
data: zCreateGroupRequestData
|
|
1511
1513
|
}),
|
|
1512
|
-
[RequestType.EDIT_GROUP]:
|
|
1513
|
-
type:
|
|
1514
|
-
targetId:
|
|
1514
|
+
[RequestType.EDIT_GROUP]: z7.object({
|
|
1515
|
+
type: z7.literal(RequestType.EDIT_GROUP),
|
|
1516
|
+
targetId: z7.string(),
|
|
1515
1517
|
data: zEditGroupRequestData
|
|
1516
1518
|
}),
|
|
1517
|
-
[RequestType.REVOKE_GROUP]:
|
|
1518
|
-
type:
|
|
1519
|
-
data:
|
|
1519
|
+
[RequestType.REVOKE_GROUP]: z7.object({
|
|
1520
|
+
type: z7.literal(RequestType.REVOKE_GROUP),
|
|
1521
|
+
data: z7.object({})
|
|
1520
1522
|
}),
|
|
1521
1523
|
// Whitelists
|
|
1522
|
-
[RequestType.CREATE_WHITELIST]:
|
|
1523
|
-
type:
|
|
1524
|
+
[RequestType.CREATE_WHITELIST]: z7.object({
|
|
1525
|
+
type: z7.literal(RequestType.CREATE_WHITELIST),
|
|
1524
1526
|
data: zCreateWhitelistRequestData
|
|
1525
1527
|
}),
|
|
1526
|
-
[RequestType.EDIT_WHITELIST]:
|
|
1527
|
-
type:
|
|
1528
|
-
targetId:
|
|
1528
|
+
[RequestType.EDIT_WHITELIST]: z7.object({
|
|
1529
|
+
type: z7.literal(RequestType.EDIT_WHITELIST),
|
|
1530
|
+
targetId: z7.string(),
|
|
1529
1531
|
data: zEditWhitelistRequestData
|
|
1530
1532
|
}),
|
|
1531
1533
|
// Entities
|
|
1532
|
-
[RequestType.CREATE_ENTITY]:
|
|
1533
|
-
type:
|
|
1534
|
+
[RequestType.CREATE_ENTITY]: z7.object({
|
|
1535
|
+
type: z7.literal(RequestType.CREATE_ENTITY),
|
|
1534
1536
|
data: zCreateEntityRequestData
|
|
1535
1537
|
}),
|
|
1536
|
-
[RequestType.EDIT_ENTITY]:
|
|
1537
|
-
type:
|
|
1538
|
+
[RequestType.EDIT_ENTITY]: z7.object({
|
|
1539
|
+
type: z7.literal(RequestType.EDIT_ENTITY),
|
|
1538
1540
|
data: zEditEntityRequestData
|
|
1539
1541
|
}),
|
|
1540
|
-
[RequestType.REVOKE_ENTITY]:
|
|
1541
|
-
type:
|
|
1542
|
-
data:
|
|
1542
|
+
[RequestType.REVOKE_ENTITY]: z7.object({
|
|
1543
|
+
type: z7.literal(RequestType.REVOKE_ENTITY),
|
|
1544
|
+
data: z7.object({})
|
|
1543
1545
|
}),
|
|
1544
1546
|
// Users
|
|
1545
|
-
[RequestType.CREATE_PSD_USER]:
|
|
1546
|
-
type:
|
|
1547
|
+
[RequestType.CREATE_PSD_USER]: z7.object({
|
|
1548
|
+
type: z7.literal(RequestType.CREATE_PSD_USER),
|
|
1547
1549
|
data: zCreatePsdUserRequestData
|
|
1548
1550
|
}),
|
|
1549
|
-
[RequestType.CREATE_API_USER]:
|
|
1550
|
-
type:
|
|
1551
|
+
[RequestType.CREATE_API_USER]: z7.object({
|
|
1552
|
+
type: z7.literal(RequestType.CREATE_API_USER),
|
|
1551
1553
|
data: zCreateApiUserRequestData
|
|
1552
1554
|
}),
|
|
1553
|
-
[RequestType.CREATE_API_USER_ACCESS]:
|
|
1554
|
-
type:
|
|
1555
|
+
[RequestType.CREATE_API_USER_ACCESS]: z7.object({
|
|
1556
|
+
type: z7.literal(RequestType.CREATE_API_USER_ACCESS),
|
|
1555
1557
|
data: zCreateApiUserAccessRequestData
|
|
1556
1558
|
}),
|
|
1557
|
-
[RequestType.REVOKE_USER]:
|
|
1558
|
-
type:
|
|
1559
|
-
data:
|
|
1559
|
+
[RequestType.REVOKE_USER]: z7.object({
|
|
1560
|
+
type: z7.literal(RequestType.REVOKE_USER),
|
|
1561
|
+
data: z7.object({})
|
|
1560
1562
|
}),
|
|
1561
1563
|
// Admin gov rules
|
|
1562
|
-
[RequestType.CREATE_WORKSPACE_RULE]:
|
|
1563
|
-
type:
|
|
1564
|
+
[RequestType.CREATE_WORKSPACE_RULE]: z7.object({
|
|
1565
|
+
type: z7.literal(RequestType.CREATE_WORKSPACE_RULE),
|
|
1564
1566
|
data: zWorkspaceRuleRequestData
|
|
1565
1567
|
}),
|
|
1566
|
-
[RequestType.EDIT_WORKSPACE_RULE]:
|
|
1567
|
-
type:
|
|
1568
|
+
[RequestType.EDIT_WORKSPACE_RULE]: z7.object({
|
|
1569
|
+
type: z7.literal(RequestType.EDIT_WORKSPACE_RULE),
|
|
1568
1570
|
data: zWorkspaceRuleRequestData
|
|
1569
1571
|
}),
|
|
1570
1572
|
// SCI configs
|
|
1571
|
-
[RequestType.CREATE_SCICONFIG]:
|
|
1572
|
-
type:
|
|
1573
|
+
[RequestType.CREATE_SCICONFIG]: z7.object({
|
|
1574
|
+
type: z7.literal(RequestType.CREATE_SCICONFIG),
|
|
1573
1575
|
data: zCreateSciConfigRequestData
|
|
1574
1576
|
}),
|
|
1575
|
-
[RequestType.EDIT_SCICONFIG]:
|
|
1576
|
-
type:
|
|
1577
|
+
[RequestType.EDIT_SCICONFIG]: z7.object({
|
|
1578
|
+
type: z7.literal(RequestType.EDIT_SCICONFIG),
|
|
1577
1579
|
data: zEditSciConfigRequestData
|
|
1578
1580
|
}),
|
|
1579
1581
|
// API keys
|
|
1580
|
-
[RequestType.CREATE_API_KEY]:
|
|
1581
|
-
type:
|
|
1582
|
+
[RequestType.CREATE_API_KEY]: z7.object({
|
|
1583
|
+
type: z7.literal(RequestType.CREATE_API_KEY),
|
|
1582
1584
|
data: zCreateApiKeyRequestData
|
|
1583
1585
|
}),
|
|
1584
|
-
[RequestType.EDIT_API_KEY]:
|
|
1585
|
-
type:
|
|
1586
|
+
[RequestType.EDIT_API_KEY]: z7.object({
|
|
1587
|
+
type: z7.literal(RequestType.EDIT_API_KEY),
|
|
1586
1588
|
data: zEditApiKeyRequestData
|
|
1587
1589
|
}),
|
|
1588
|
-
[RequestType.REVOKE_API_KEY]:
|
|
1589
|
-
type:
|
|
1590
|
-
data:
|
|
1590
|
+
[RequestType.REVOKE_API_KEY]: z7.object({
|
|
1591
|
+
type: z7.literal(RequestType.REVOKE_API_KEY),
|
|
1592
|
+
data: z7.object({})
|
|
1591
1593
|
}),
|
|
1592
1594
|
// Policies
|
|
1593
|
-
[RequestType.CREATE_POLICY]:
|
|
1594
|
-
type:
|
|
1595
|
+
[RequestType.CREATE_POLICY]: z7.object({
|
|
1596
|
+
type: z7.literal(RequestType.CREATE_POLICY),
|
|
1595
1597
|
data: zCreatePublicPolicyRequestData
|
|
1596
1598
|
}),
|
|
1597
|
-
[RequestType.EDIT_POLICY]:
|
|
1598
|
-
type:
|
|
1599
|
-
targetId:
|
|
1599
|
+
[RequestType.EDIT_POLICY]: z7.object({
|
|
1600
|
+
type: z7.literal(RequestType.EDIT_POLICY),
|
|
1601
|
+
targetId: z7.string(),
|
|
1600
1602
|
data: zEditPublicPolicyRequestData
|
|
1601
1603
|
}),
|
|
1602
1604
|
// Tradelink
|
|
1603
|
-
[RequestType.CREATE_TRADELINK_CUSTODIAN]:
|
|
1604
|
-
type:
|
|
1605
|
+
[RequestType.CREATE_TRADELINK_CUSTODIAN]: z7.object({
|
|
1606
|
+
type: z7.literal(RequestType.CREATE_TRADELINK_CUSTODIAN),
|
|
1605
1607
|
data: zCustodianRequestData
|
|
1606
1608
|
}),
|
|
1607
|
-
[RequestType.EDIT_TRADELINK_CUSTODIAN]:
|
|
1608
|
-
type:
|
|
1609
|
-
targetId:
|
|
1609
|
+
[RequestType.EDIT_TRADELINK_CUSTODIAN]: z7.object({
|
|
1610
|
+
type: z7.literal(RequestType.EDIT_TRADELINK_CUSTODIAN),
|
|
1611
|
+
targetId: z7.string(),
|
|
1610
1612
|
data: zCustodianRequestData
|
|
1611
1613
|
}),
|
|
1612
|
-
[RequestType.CREATE_TRADELINK_EXCHANGE]:
|
|
1613
|
-
type:
|
|
1614
|
+
[RequestType.CREATE_TRADELINK_EXCHANGE]: z7.object({
|
|
1615
|
+
type: z7.literal(RequestType.CREATE_TRADELINK_EXCHANGE),
|
|
1614
1616
|
data: zTradelinkEntityRequestData
|
|
1615
1617
|
}),
|
|
1616
|
-
[RequestType.EDIT_TRADELINK_EXCHANGE]:
|
|
1617
|
-
type:
|
|
1618
|
-
targetId:
|
|
1618
|
+
[RequestType.EDIT_TRADELINK_EXCHANGE]: z7.object({
|
|
1619
|
+
type: z7.literal(RequestType.EDIT_TRADELINK_EXCHANGE),
|
|
1620
|
+
targetId: z7.string(),
|
|
1619
1621
|
data: zTradelinkEntityRequestData
|
|
1620
1622
|
}),
|
|
1621
|
-
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]:
|
|
1622
|
-
type:
|
|
1623
|
+
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]: z7.object({
|
|
1624
|
+
type: z7.literal(RequestType.CREATE_TRADELINK_ASSET_MANAGER),
|
|
1623
1625
|
data: zTradelinkEntityRequestData
|
|
1624
1626
|
}),
|
|
1625
|
-
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]:
|
|
1626
|
-
type:
|
|
1627
|
-
targetId:
|
|
1627
|
+
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]: z7.object({
|
|
1628
|
+
type: z7.literal(RequestType.EDIT_TRADELINK_ASSET_MANAGER),
|
|
1629
|
+
targetId: z7.string(),
|
|
1628
1630
|
data: zTradelinkEntityRequestData
|
|
1629
1631
|
}),
|
|
1630
|
-
[RequestType.ADJUST_PLEDGE]:
|
|
1631
|
-
type:
|
|
1632
|
+
[RequestType.ADJUST_PLEDGE]: z7.object({
|
|
1633
|
+
type: z7.literal(RequestType.ADJUST_PLEDGE),
|
|
1632
1634
|
data: zAdjustPledgeRequestData
|
|
1633
1635
|
}),
|
|
1634
|
-
[RequestType.TRADELINK_REPLEDGE]:
|
|
1635
|
-
type:
|
|
1636
|
+
[RequestType.TRADELINK_REPLEDGE]: z7.object({
|
|
1637
|
+
type: z7.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1636
1638
|
data: zRepledgeRequestData
|
|
1637
1639
|
}),
|
|
1638
|
-
[RequestType.CREATE_SETTLEMENT]:
|
|
1639
|
-
type:
|
|
1640
|
+
[RequestType.CREATE_SETTLEMENT]: z7.object({
|
|
1641
|
+
type: z7.literal(RequestType.CREATE_SETTLEMENT),
|
|
1640
1642
|
data: zCreateSettlementRequestData,
|
|
1641
|
-
meta:
|
|
1642
|
-
hash:
|
|
1643
|
+
meta: z7.object({
|
|
1644
|
+
hash: z7.string().nullable()
|
|
1643
1645
|
}).optional().nullable()
|
|
1644
1646
|
}),
|
|
1645
|
-
[RequestType.FORCE_UNPLEDGE]:
|
|
1646
|
-
type:
|
|
1647
|
+
[RequestType.FORCE_UNPLEDGE]: z7.object({
|
|
1648
|
+
type: z7.literal(RequestType.FORCE_UNPLEDGE),
|
|
1647
1649
|
data: zForceUnpledgeRequestData
|
|
1648
1650
|
}),
|
|
1649
|
-
[RequestType.TRADELINK_WITHDRAW]:
|
|
1650
|
-
type:
|
|
1651
|
+
[RequestType.TRADELINK_WITHDRAW]: z7.object({
|
|
1652
|
+
type: z7.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1651
1653
|
data: zTradelinkWithdrawRequestData,
|
|
1652
|
-
meta:
|
|
1653
|
-
hash:
|
|
1654
|
+
meta: z7.object({
|
|
1655
|
+
hash: z7.string().nullable()
|
|
1654
1656
|
}).optional().nullable()
|
|
1655
1657
|
}),
|
|
1656
|
-
[RequestType.TRADELINK_ARBITRATE]:
|
|
1657
|
-
type:
|
|
1658
|
+
[RequestType.TRADELINK_ARBITRATE]: z7.object({
|
|
1659
|
+
type: z7.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1658
1660
|
data: zTradelinkArbitrationRequestData,
|
|
1659
|
-
meta:
|
|
1660
|
-
hash:
|
|
1661
|
+
meta: z7.object({
|
|
1662
|
+
hash: z7.string().nullable()
|
|
1661
1663
|
}).optional().nullable()
|
|
1662
1664
|
})
|
|
1663
1665
|
};
|
|
1664
1666
|
|
|
1665
1667
|
// src/requests/app-types.ts
|
|
1666
|
-
var zRequestReviewResponse =
|
|
1668
|
+
var zRequestReviewResponse = z7.object({
|
|
1667
1669
|
// Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
|
|
1668
|
-
stepIndex:
|
|
1669
|
-
userId:
|
|
1670
|
-
status:
|
|
1671
|
-
createdAt:
|
|
1672
|
-
updatedAt:
|
|
1673
|
-
});
|
|
1674
|
-
var zVaultRequestCommonMixin =
|
|
1675
|
-
id:
|
|
1676
|
-
legacyId:
|
|
1677
|
-
state:
|
|
1670
|
+
stepIndex: z7.number().int().describe("Index of the governance step in the request workflow"),
|
|
1671
|
+
userId: z7.string().describe("Reviewer id"),
|
|
1672
|
+
status: z7.nativeEnum(RequestReviewStatus).describe("Review status"),
|
|
1673
|
+
createdAt: z7.coerce.date().describe("Created date"),
|
|
1674
|
+
updatedAt: z7.coerce.date().describe("Updated date")
|
|
1675
|
+
});
|
|
1676
|
+
var zVaultRequestCommonMixin = z7.object({
|
|
1677
|
+
id: z7.string().describe("Request unique identifier"),
|
|
1678
|
+
legacyId: z7.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1679
|
+
state: z7.nativeEnum(RequestState).describe("Request state"),
|
|
1678
1680
|
reviewSteps: zRequestReviewSteps.describe("Request review steps"),
|
|
1679
|
-
currentStepIndex:
|
|
1680
|
-
expiredAt:
|
|
1681
|
-
targetId:
|
|
1681
|
+
currentStepIndex: z7.number().int().min(0).describe("Index of the current approval step"),
|
|
1682
|
+
expiredAt: z7.coerce.date().nullable().describe("Optional expiration date"),
|
|
1683
|
+
targetId: z7.string().nullable().describe("Optional ID of the target object"),
|
|
1682
1684
|
note: zNote.nullable().describe("Optional request note"),
|
|
1683
|
-
reviews:
|
|
1685
|
+
reviews: z7.array(zRequestReviewResponse).describe("Requests reviews"),
|
|
1684
1686
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
1685
|
-
createdAt:
|
|
1686
|
-
updatedAt:
|
|
1687
|
+
createdAt: z7.coerce.date().describe("Creation timestamp"),
|
|
1688
|
+
updatedAt: z7.coerce.date().describe("Last modification timestamp"),
|
|
1687
1689
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
1688
|
-
inflight:
|
|
1689
|
-
lastError:
|
|
1690
|
-
numFailed:
|
|
1691
|
-
retryAfter:
|
|
1690
|
+
inflight: z7.object({
|
|
1691
|
+
lastError: z7.string().describe("Error message from the last failure"),
|
|
1692
|
+
numFailed: z7.number().int().describe("Number of failures so far"),
|
|
1693
|
+
retryAfter: z7.coerce.date().describe("Date after which next retry is scheduled")
|
|
1692
1694
|
}).optional().describe("Extra information if the request is currently being processed")
|
|
1693
1695
|
});
|
|
1694
|
-
var
|
|
1696
|
+
var allowedRequestCreationInputByType = {
|
|
1695
1697
|
[RequestType.UPDATE_QUORUM]: zVaultRequestMixinsByType[RequestType.UPDATE_QUORUM],
|
|
1696
1698
|
[RequestType.CREATE_PSD_USER]: zVaultRequestMixinsByType[RequestType.CREATE_PSD_USER],
|
|
1697
1699
|
[RequestType.CREATE_API_USER]: zVaultRequestMixinsByType[RequestType.CREATE_API_USER],
|
|
@@ -1700,14 +1702,14 @@ var allowedRequestCreationInput = {
|
|
|
1700
1702
|
[RequestType.CREATE_WHITELIST]: zVaultRequestMixinsByType[RequestType.CREATE_WHITELIST],
|
|
1701
1703
|
[RequestType.EDIT_WHITELIST]: zVaultRequestMixinsByType[RequestType.EDIT_WHITELIST],
|
|
1702
1704
|
[RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
|
|
1703
|
-
[RequestType.SIGN_MESSAGE]:
|
|
1704
|
-
type:
|
|
1705
|
+
[RequestType.SIGN_MESSAGE]: z7.object({
|
|
1706
|
+
type: z7.literal(RequestType.SIGN_MESSAGE),
|
|
1705
1707
|
data: zSignMessageUserInputData
|
|
1706
1708
|
}),
|
|
1707
1709
|
[RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
|
|
1708
1710
|
[RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
|
|
1709
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1710
|
-
type:
|
|
1711
|
+
[RequestType.CREATE_ACCOUNT]: z7.object({
|
|
1712
|
+
type: z7.literal(RequestType.CREATE_ACCOUNT),
|
|
1711
1713
|
data: zCreateAccountUserInputData
|
|
1712
1714
|
}),
|
|
1713
1715
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
@@ -1725,18 +1727,21 @@ var allowedRequestCreationInput = {
|
|
|
1725
1727
|
[RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
|
|
1726
1728
|
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE]
|
|
1727
1729
|
};
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
+
var zRequestCreationInputCommonMixin = z7.object({
|
|
1731
|
+
note: zNote.optional().describe("Optional request note")
|
|
1732
|
+
});
|
|
1733
|
+
z7.object({
|
|
1734
|
+
request: z7.discriminatedUnion(
|
|
1730
1735
|
"type",
|
|
1731
1736
|
ensureNonEmptyArray(
|
|
1732
|
-
Object.values(
|
|
1737
|
+
Object.values(allowedRequestCreationInputByType).map((_) => {
|
|
1733
1738
|
const requestType = _.shape.type._def.value;
|
|
1734
|
-
return _.describe(`${requestType} request data`);
|
|
1739
|
+
return _.merge(zRequestCreationInputCommonMixin).describe(`${requestType} request data`);
|
|
1735
1740
|
})
|
|
1736
1741
|
)
|
|
1737
1742
|
)
|
|
1738
1743
|
});
|
|
1739
|
-
var zVaultRequestResponse =
|
|
1744
|
+
var zVaultRequestResponse = z7.discriminatedUnion(
|
|
1740
1745
|
"type",
|
|
1741
1746
|
ensureNonEmptyArray(
|
|
1742
1747
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
@@ -1745,14 +1750,14 @@ var zVaultRequestResponse = z5.discriminatedUnion(
|
|
|
1745
1750
|
})
|
|
1746
1751
|
)
|
|
1747
1752
|
);
|
|
1748
|
-
|
|
1753
|
+
z7.enum([
|
|
1749
1754
|
"state",
|
|
1750
1755
|
"expiredAt",
|
|
1751
1756
|
"createdAt",
|
|
1752
1757
|
"updatedAt"
|
|
1753
1758
|
]).default("createdAt");
|
|
1754
|
-
|
|
1755
|
-
pubKey:
|
|
1759
|
+
z7.object({
|
|
1760
|
+
pubKey: z7.string().describe("Public key of the current user"),
|
|
1756
1761
|
challenge: zUserChallenge.describe("Challenge data to sign with the user's private key")
|
|
1757
1762
|
});
|
|
1758
1763
|
var shouldHaveTargetHsmId = (request) => {
|