@ledgerhq/revault-api 1.28.0 → 1.29.1
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-DRwjhbZ9.d.mts → app-types-mEeONvZb.d.mts} +3767 -3367
- package/lib/fakes.d.mts +3090 -2906
- package/lib/fakes.mjs +598 -571
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +1058 -781
- package/package.json +4 -4
package/lib/fakes.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { faker } from '@faker-js/faker';
|
|
2
|
-
import
|
|
2
|
+
import z5, { z } from 'zod';
|
|
3
3
|
import { ChallengeType, PsdModel, AccountType, AccountGovernanceType, ActivationStatus, WhitelistType, UserRole, UserRegistrationState, AdminPermission, RequestType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import invariant from 'invariant';
|
|
6
6
|
import { omit, times } from 'lodash';
|
|
7
7
|
import 'crypto';
|
|
8
|
-
import 'fs/promises';
|
|
9
|
-
import 'path';
|
|
10
8
|
|
|
11
9
|
// src/__fakes__/responses.ts
|
|
12
10
|
|
|
@@ -146,8 +144,8 @@ var zHsmSignature = z.object({
|
|
|
146
144
|
),
|
|
147
145
|
pubkey: zHexString.nullable().describe("Public key for signature verification, 32 or 33 bytes")
|
|
148
146
|
});
|
|
149
|
-
var zBitcoinLikeTransactionType =
|
|
150
|
-
var zCardanoLikeTransactionType =
|
|
147
|
+
var zBitcoinLikeTransactionType = z5.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).describe("Bitcoin-like transaction type");
|
|
148
|
+
var zCardanoLikeTransactionType = z5.enum([
|
|
151
149
|
"CARDANO_LIKE_SEND",
|
|
152
150
|
"CARDANO_LIKE_RECEIVE",
|
|
153
151
|
"CARDANO_LIKE_STAKING_REGISTER",
|
|
@@ -155,9 +153,9 @@ var zCardanoLikeTransactionType = z32.enum([
|
|
|
155
153
|
"CARDANO_LIKE_STAKING_DELEGATE",
|
|
156
154
|
"CARDANO_LIKE_STAKING_WITHDRAW"
|
|
157
155
|
]).describe("Cardano-like transaction type");
|
|
158
|
-
var zEthereumLikeTransferTransactionType =
|
|
159
|
-
var zEthereumLikeContractTransactionType =
|
|
160
|
-
var zPolkadotLikeTransactionType =
|
|
156
|
+
var zEthereumLikeTransferTransactionType = z5.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).describe("Ethereum-like transaction type");
|
|
157
|
+
var zEthereumLikeContractTransactionType = z5.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).describe("Ethereum-like transaction type");
|
|
158
|
+
var zPolkadotLikeTransactionType = z5.enum([
|
|
161
159
|
"POLKADOT_LIKE_SEND",
|
|
162
160
|
"POLKADOT_LIKE_RECEIVE",
|
|
163
161
|
"POLKADOT_LIKE_ADDPROXY",
|
|
@@ -179,8 +177,8 @@ var zPolkadotLikeTransactionType = z32.enum([
|
|
|
179
177
|
"POLKADOT_LIKE_CHILL",
|
|
180
178
|
"POLKADOT_LIKE_TRANSFERALL"
|
|
181
179
|
]).describe("Polkadot-like transaction type");
|
|
182
|
-
var zRippleLikeTransactionType =
|
|
183
|
-
var zSolanaLikeTransactionType =
|
|
180
|
+
var zRippleLikeTransactionType = z5.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).describe("Ripple-like transaction type");
|
|
181
|
+
var zSolanaLikeTransactionType = z5.enum([
|
|
184
182
|
"SOLANA_LIKE_SEND",
|
|
185
183
|
"SOLANA_LIKE_RECEIVE",
|
|
186
184
|
"SOLANA_LIKE_CREATE_DELEGATE_STAKE",
|
|
@@ -193,16 +191,16 @@ var zSolanaLikeTransactionType = z32.enum([
|
|
|
193
191
|
"SOLANA_LIKE_SEND_TOKEN",
|
|
194
192
|
"SOLANA_LIKE_FUND_TOKEN"
|
|
195
193
|
]).describe("Solana-like transaction type");
|
|
196
|
-
var zStellarLikeTransactionType =
|
|
197
|
-
var zTezosLikeTransactionType =
|
|
194
|
+
var zStellarLikeTransactionType = z5.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).describe("Stellar-like transaction type");
|
|
195
|
+
var zTezosLikeTransactionType = z5.enum([
|
|
198
196
|
"TEZOS_LIKE_SEND",
|
|
199
197
|
"TEZOS_LIKE_RECEIVE",
|
|
200
198
|
"TEZOS_LIKE_REVEAL",
|
|
201
199
|
"TEZOS_LIKE_DELEGATE",
|
|
202
200
|
"TEZOS_LIKE_UNDELEGATE"
|
|
203
201
|
]).describe("Tezos-like transaction type");
|
|
204
|
-
var zGenericTransactionType =
|
|
205
|
-
|
|
202
|
+
var zGenericTransactionType = z5.enum(["GENERIC_TRANSACTION"]).describe("Generic transaction type");
|
|
203
|
+
z5.union([
|
|
206
204
|
zBitcoinLikeTransactionType,
|
|
207
205
|
zCardanoLikeTransactionType,
|
|
208
206
|
zEthereumLikeTransferTransactionType,
|
|
@@ -214,31 +212,40 @@ z32.union([
|
|
|
214
212
|
zStellarLikeTransactionType,
|
|
215
213
|
zTezosLikeTransactionType
|
|
216
214
|
]);
|
|
215
|
+
z5.discriminatedUnion("type", [
|
|
216
|
+
z5.object({
|
|
217
|
+
type: z5.literal("ETHEREUM_LIKE"),
|
|
218
|
+
baseFees: zIntString,
|
|
219
|
+
gasLimit: zIntString,
|
|
220
|
+
nonce: z5.string(),
|
|
221
|
+
priorityFees: zIntString
|
|
222
|
+
})
|
|
223
|
+
]);
|
|
217
224
|
|
|
218
225
|
// src/transactions/request-data.ts
|
|
219
|
-
var zHexDataString =
|
|
226
|
+
var zHexDataString = z5.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/).transform((hex) => `0x${hex.toLowerCase().replace("0x", "")}`);
|
|
220
227
|
if ("openapi" in zHexDataString) {
|
|
221
228
|
zHexDataString = zHexDataString.openapi?.({ effectType: "same" });
|
|
222
229
|
}
|
|
223
|
-
var zCommonTransactionData =
|
|
230
|
+
var zCommonTransactionData = z5.object({
|
|
224
231
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
225
232
|
currency: zCurrency.describe("Transaction currency"),
|
|
226
233
|
// TODO: strict literal or enum?
|
|
227
234
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
228
|
-
recipient:
|
|
235
|
+
recipient: z5.string().describe("Transaction recipient")
|
|
229
236
|
});
|
|
230
|
-
var zFeeStrategyCustom =
|
|
231
|
-
type:
|
|
237
|
+
var zFeeStrategyCustom = z5.object({
|
|
238
|
+
type: z5.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
|
|
232
239
|
});
|
|
233
|
-
var zFeeStrategy =
|
|
234
|
-
type:
|
|
240
|
+
var zFeeStrategy = z5.object({
|
|
241
|
+
type: z5.enum(["SLOW", "NORMAL", "FAST"])
|
|
235
242
|
});
|
|
236
243
|
var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
237
244
|
// nullish is optional + nullable, it is easier to seed rather than just optional
|
|
238
245
|
feePerByte: zUnsignedIntString.nullish().describe("Fee per byte")
|
|
239
246
|
}).describe("Bitcoin-like fee strategy");
|
|
240
247
|
var zBitcoinLikeSendData = zCommonTransactionData.extend({
|
|
241
|
-
type:
|
|
248
|
+
type: z5.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
|
|
242
249
|
feeStrategy: zBitcoinLikeFeeStrategy
|
|
243
250
|
}).describe("Bitcoin-like send data");
|
|
244
251
|
var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
|
|
@@ -250,21 +257,21 @@ var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
|
|
|
250
257
|
maxFeePerGas: zUnsignedIntString.describe("Maximum fee per gas (base + priority)"),
|
|
251
258
|
gasLimit: zUnsignedIntString.describe("Gas limit")
|
|
252
259
|
}).describe("Ethereum-like EIP-1559 fee strategy");
|
|
253
|
-
var zEthereumLikeFeeStrategy =
|
|
260
|
+
var zEthereumLikeFeeStrategy = z5.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).describe("Ethereum-like fee strategy");
|
|
254
261
|
var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
255
|
-
type:
|
|
262
|
+
type: z5.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
|
|
256
263
|
// force the recipient to be the zero address
|
|
257
|
-
recipient:
|
|
264
|
+
recipient: z5.literal("0x0000000000000000000000000000000000000000"),
|
|
258
265
|
contractData: zHexDataString.describe("Contract data in hexadecimal format"),
|
|
259
266
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
260
267
|
}).describe("Ethereum-like deploy contract data");
|
|
261
268
|
var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
262
|
-
type:
|
|
269
|
+
type: z5.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
|
|
263
270
|
contractData: zHexDataString.describe("Contract call data in hexadecimal format"),
|
|
264
271
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
265
272
|
}).describe("Ethereum-like execute contract data");
|
|
266
273
|
var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
267
|
-
type:
|
|
274
|
+
type: z5.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
268
275
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
269
276
|
}).describe("Ethereum-like send data");
|
|
270
277
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
@@ -272,183 +279,183 @@ var zTezosLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
|
272
279
|
storageLimit: zUnsignedIntString.nullable().describe("Storage limit")
|
|
273
280
|
}).describe("Tezos-like fee strategy");
|
|
274
281
|
var zTezosLikeDelegateData = zCommonTransactionData.extend({
|
|
275
|
-
type:
|
|
282
|
+
type: z5.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
276
283
|
feeStrategy: zTezosLikeFeeStrategy
|
|
277
284
|
}).describe("Tezos-like delegate data");
|
|
278
285
|
var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
279
|
-
type:
|
|
286
|
+
type: z5.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
|
|
280
287
|
feeStrategy: zTezosLikeFeeStrategy
|
|
281
288
|
}).describe("Tezos-like send data");
|
|
282
289
|
var zTezosLikeUndelegateData = zCommonTransactionData.extend({
|
|
283
|
-
type:
|
|
290
|
+
type: z5.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
284
291
|
feeStrategy: zTezosLikeFeeStrategy
|
|
285
292
|
}).describe("Tezos-like undelegate data");
|
|
286
|
-
var zPolkadotRewardDestination =
|
|
287
|
-
var zPolkadotLikeAddProxyData =
|
|
288
|
-
type:
|
|
293
|
+
var zPolkadotRewardDestination = z5.enum(["Staked", "Stash"]);
|
|
294
|
+
var zPolkadotLikeAddProxyData = z5.object({
|
|
295
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
289
296
|
currency: zCurrency.describe("Transaction currency"),
|
|
290
|
-
kind:
|
|
291
|
-
proxy:
|
|
297
|
+
kind: z5.literal("Staking").describe("Proxy kind"),
|
|
298
|
+
proxy: z5.string().describe("Proxy address")
|
|
292
299
|
}).describe("Polkadot-like add proxy data");
|
|
293
|
-
var zPolkadotLikeAnonymousProxyData =
|
|
294
|
-
type:
|
|
300
|
+
var zPolkadotLikeAnonymousProxyData = z5.object({
|
|
301
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
295
302
|
currency: zCurrency.describe("Transaction currency")
|
|
296
303
|
}).describe("Polkadot-like anonymous proxy data");
|
|
297
|
-
var zPolkadotLikeBondData =
|
|
298
|
-
type:
|
|
304
|
+
var zPolkadotLikeBondData = z5.object({
|
|
305
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
299
306
|
currency: zCurrency.describe("Transaction currency"),
|
|
300
307
|
payee: zPolkadotRewardDestination,
|
|
301
308
|
amount: zUnsignedIntString.describe("Amount")
|
|
302
309
|
}).describe("Polkadot-like bond data");
|
|
303
|
-
var zPolkadotLikeBondExtraData =
|
|
304
|
-
type:
|
|
310
|
+
var zPolkadotLikeBondExtraData = z5.object({
|
|
311
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
305
312
|
currency: zCurrency.describe("Transaction currency"),
|
|
306
313
|
amount: zUnsignedIntString.describe("Amount")
|
|
307
314
|
}).describe("Polkadot-like bond extra data");
|
|
308
|
-
var zPolkadotLikeChillData =
|
|
309
|
-
type:
|
|
315
|
+
var zPolkadotLikeChillData = z5.object({
|
|
316
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
310
317
|
currency: zCurrency.describe("Transaction currency")
|
|
311
318
|
}).describe("Polkadot-like chill data");
|
|
312
|
-
var zPolkadotLikeKillAnonymousData =
|
|
313
|
-
type:
|
|
319
|
+
var zPolkadotLikeKillAnonymousData = z5.object({
|
|
320
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
314
321
|
currency: zCurrency.describe("Transaction currency")
|
|
315
322
|
}).describe("Polkadot-like kill anonymous data");
|
|
316
|
-
var zPolkadotLikeRebondData =
|
|
317
|
-
type:
|
|
323
|
+
var zPolkadotLikeRebondData = z5.object({
|
|
324
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
318
325
|
currency: zCurrency.describe("Transaction currency"),
|
|
319
326
|
amount: zUnsignedIntString.describe("Amount")
|
|
320
327
|
}).describe("Polkadot-like rebond data");
|
|
321
|
-
var zPolkadotLikeRemoveProxyData =
|
|
322
|
-
type:
|
|
328
|
+
var zPolkadotLikeRemoveProxyData = z5.object({
|
|
329
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
323
330
|
currency: zCurrency.describe("Transaction currency"),
|
|
324
|
-
kind:
|
|
325
|
-
proxy:
|
|
331
|
+
kind: z5.literal("Staking"),
|
|
332
|
+
proxy: z5.string().describe("Proxy address")
|
|
326
333
|
}).describe("Polkadot-like remove proxy data");
|
|
327
334
|
var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
328
|
-
type:
|
|
335
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
|
|
329
336
|
}).describe("Polkadot-like send data");
|
|
330
|
-
var zPolkadotLikeSetPayeeData =
|
|
331
|
-
type:
|
|
337
|
+
var zPolkadotLikeSetPayeeData = z5.object({
|
|
338
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
332
339
|
currency: zCurrency.describe("Transaction currency"),
|
|
333
340
|
payee: zPolkadotRewardDestination
|
|
334
341
|
}).describe("Polkadot-like set payee data");
|
|
335
|
-
var zPolkadotLikeUnbondData =
|
|
336
|
-
type:
|
|
342
|
+
var zPolkadotLikeUnbondData = z5.object({
|
|
343
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
337
344
|
currency: zCurrency.describe("Transaction currency"),
|
|
338
345
|
amount: zUnsignedIntString.describe("Amount")
|
|
339
346
|
}).describe("Polkadot-like unbond data");
|
|
340
|
-
var zPolkadotLikeWithdrawUnbondedData =
|
|
341
|
-
type:
|
|
347
|
+
var zPolkadotLikeWithdrawUnbondedData = z5.object({
|
|
348
|
+
type: z5.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
342
349
|
currency: zCurrency.describe("Transaction currency")
|
|
343
350
|
}).describe("Polkadot-like withdraw unbonded data");
|
|
344
351
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
345
|
-
type:
|
|
352
|
+
type: z5.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
346
353
|
destinationTag: zIntString.nullable().describe("Destination tag"),
|
|
347
354
|
feeStrategy: zFeeStrategyCustom.describe("Ripple-like fee strategy")
|
|
348
355
|
}).describe("Ripple-like send data");
|
|
349
|
-
var zStellarMemo =
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
MEMO_HASH:
|
|
356
|
+
var zStellarMemo = z5.union([
|
|
357
|
+
z5.object({ MEMO_TEXT: z5.string().max(28).describe("Text memo (at most a 28 bytes string)") }).describe("Text memo"),
|
|
358
|
+
z5.object({ MEMO_ID: zIntString.describe("Id memo (unsigned 64 bits integer)") }).describe("Id memo"),
|
|
359
|
+
z5.object({
|
|
360
|
+
MEMO_HASH: z5.string().max(128).regex(/^[a-fA-F0-9]+$/).describe("Transaction hash memo (64 bytes hexadecimal string)")
|
|
354
361
|
}).describe("Hash memo"),
|
|
355
|
-
|
|
356
|
-
MEMO_RETURN:
|
|
362
|
+
z5.object({
|
|
363
|
+
MEMO_RETURN: z5.string().max(128).regex(/^[a-fA-F0-9]+$/).describe(
|
|
357
364
|
"A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
|
|
358
365
|
)
|
|
359
366
|
}).describe("Return memo")
|
|
360
367
|
]);
|
|
361
368
|
var zStellarLikeSendData = zCommonTransactionData.extend({
|
|
362
|
-
type:
|
|
369
|
+
type: z5.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
|
|
363
370
|
memo: zStellarMemo.nullable().describe("Stellar memo"),
|
|
364
371
|
feeStrategy: zFeeStrategy.describe("Stellar-like fee strategy")
|
|
365
372
|
}).describe("Stellar-like send data");
|
|
366
373
|
var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
367
|
-
type:
|
|
368
|
-
recipient:
|
|
374
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
|
|
375
|
+
recipient: z5.string().describe("Delegated vote address"),
|
|
369
376
|
// Re-described
|
|
370
377
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
371
378
|
}).describe("Solana-like create delegate stake data");
|
|
372
|
-
var zSolanaLikeDeactivateStakeData =
|
|
373
|
-
type:
|
|
379
|
+
var zSolanaLikeDeactivateStakeData = z5.object({
|
|
380
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
374
381
|
currency: zCurrency.describe("Transaction currency"),
|
|
375
382
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
376
|
-
stakeAccount:
|
|
383
|
+
stakeAccount: z5.string().describe("Stake account address"),
|
|
377
384
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
378
385
|
// No recipient, no amount
|
|
379
386
|
}).describe("Solana-like deactivate stake data");
|
|
380
|
-
var zSolanaLikeDelegateStakeData =
|
|
381
|
-
type:
|
|
387
|
+
var zSolanaLikeDelegateStakeData = z5.object({
|
|
388
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
382
389
|
currency: zCurrency.describe("Transaction currency"),
|
|
383
390
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
384
|
-
recipient:
|
|
385
|
-
stakeAccount:
|
|
391
|
+
recipient: z5.string().describe("Delegated vote address"),
|
|
392
|
+
stakeAccount: z5.string().describe("Stake account address"),
|
|
386
393
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
387
394
|
// No amount
|
|
388
395
|
}).describe("Solana-like delegate stake data");
|
|
389
|
-
var zSolanaLikeMergeStakeData =
|
|
390
|
-
type:
|
|
396
|
+
var zSolanaLikeMergeStakeData = z5.object({
|
|
397
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
391
398
|
currency: zCurrency.describe("Transaction currency"),
|
|
392
399
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
393
|
-
mergeSrcAccount:
|
|
394
|
-
mergeDstAccount:
|
|
400
|
+
mergeSrcAccount: z5.string().describe("Source stake address"),
|
|
401
|
+
mergeDstAccount: z5.string().describe("Destination stake address"),
|
|
395
402
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
396
403
|
// No recipient, no amount
|
|
397
404
|
}).describe("Solana-like merge stake data");
|
|
398
405
|
var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
399
|
-
type:
|
|
406
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
|
|
400
407
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
401
408
|
}).describe("Solana-like send data");
|
|
402
|
-
var zSolanaLikeSplitDeactivateStakeData =
|
|
403
|
-
type:
|
|
409
|
+
var zSolanaLikeSplitDeactivateStakeData = z5.object({
|
|
410
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
404
411
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
405
412
|
currency: zCurrency.describe("Transaction currency"),
|
|
406
413
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
407
|
-
stakeAccount:
|
|
414
|
+
stakeAccount: z5.string().describe("Stake account address"),
|
|
408
415
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
409
416
|
// No recipient
|
|
410
417
|
}).describe("Solana-like split deactivate stake data");
|
|
411
|
-
var zSolanaLikeSplitStakeData =
|
|
412
|
-
type:
|
|
418
|
+
var zSolanaLikeSplitStakeData = z5.object({
|
|
419
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
413
420
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
414
421
|
currency: zCurrency.describe("Transaction currency"),
|
|
415
422
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
416
|
-
stakeAccount:
|
|
423
|
+
stakeAccount: z5.string().describe("Stake account address"),
|
|
417
424
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
418
425
|
// No recipient
|
|
419
426
|
}).describe("Solana-like split stake data");
|
|
420
|
-
var zSolanaLikeWithdrawStakeData =
|
|
421
|
-
type:
|
|
427
|
+
var zSolanaLikeWithdrawStakeData = z5.object({
|
|
428
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
422
429
|
amount: zUnsignedIntString.describe("Transaction amount"),
|
|
423
430
|
currency: zCurrency.describe("Transaction currency"),
|
|
424
431
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
425
|
-
stakeAccount:
|
|
432
|
+
stakeAccount: z5.string().describe("Stake account address"),
|
|
426
433
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
427
434
|
// No recipient
|
|
428
435
|
}).describe("Solana-like delegate stake data");
|
|
429
436
|
var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
430
|
-
type:
|
|
437
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
431
438
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
432
439
|
}).describe("Solana-like send token data");
|
|
433
440
|
var zSolanaLikeFundTokenData = zCommonTransactionData.extend({
|
|
434
|
-
type:
|
|
441
|
+
type: z5.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_TOKEN),
|
|
435
442
|
feeStrategy: zFeeStrategy.describe("Solana-like fee strategy")
|
|
436
443
|
}).describe("Solana-like fund token data");
|
|
437
444
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
438
|
-
type:
|
|
445
|
+
type: z5.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
439
446
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy")
|
|
440
447
|
}).describe("Cardano-like send data");
|
|
441
|
-
var zCardanoStakingDelegateData =
|
|
442
|
-
type:
|
|
448
|
+
var zCardanoStakingDelegateData = z5.object({
|
|
449
|
+
type: z5.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
443
450
|
currency: zCurrency.describe("Transaction currency"),
|
|
444
451
|
// TODO: strict literal or enum?
|
|
445
452
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
446
453
|
feeStrategy: zFeeStrategy.describe("Cardano-like fee strategy"),
|
|
447
454
|
// DELEGATE doesn't have neither amount nor recipient
|
|
448
|
-
stakePoolId:
|
|
455
|
+
stakePoolId: z5.string().min(1).max(100).describe("")
|
|
449
456
|
}).describe("Cardano-like staking delegate");
|
|
450
|
-
var zCardanoStakingDeregisterData =
|
|
451
|
-
type:
|
|
457
|
+
var zCardanoStakingDeregisterData = z5.object({
|
|
458
|
+
type: z5.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
452
459
|
currency: zCurrency.describe("Transaction currency"),
|
|
453
460
|
// TODO: strict literal or enum?
|
|
454
461
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -456,8 +463,8 @@ var zCardanoStakingDeregisterData = z32.object({
|
|
|
456
463
|
// DEREGISTER doesn't have a recipient
|
|
457
464
|
amount: zUnsignedIntString.describe("Amount to deregister")
|
|
458
465
|
}).describe("Cardano-like staking deregister data");
|
|
459
|
-
var zCardanoStakingRegisterData =
|
|
460
|
-
type:
|
|
466
|
+
var zCardanoStakingRegisterData = z5.object({
|
|
467
|
+
type: z5.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
461
468
|
currency: zCurrency.describe("Transaction currency"),
|
|
462
469
|
// TODO: strict literal or enum?
|
|
463
470
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -465,8 +472,8 @@ var zCardanoStakingRegisterData = z32.object({
|
|
|
465
472
|
// REGISTER doesn't have a recipient
|
|
466
473
|
amount: zUnsignedIntString.describe("Amount to register")
|
|
467
474
|
}).describe("Cardano-like staking register data");
|
|
468
|
-
var zCardanoStakingWithdrawData =
|
|
469
|
-
type:
|
|
475
|
+
var zCardanoStakingWithdrawData = z5.object({
|
|
476
|
+
type: z5.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
470
477
|
currency: zCurrency.describe("Transaction currency"),
|
|
471
478
|
// TODO: strict literal or enum?
|
|
472
479
|
maxFee: zUnsignedIntString.nullable().describe("Transaction max fee"),
|
|
@@ -474,12 +481,12 @@ var zCardanoStakingWithdrawData = z32.object({
|
|
|
474
481
|
// WITHDRAW doesn't have a recipient
|
|
475
482
|
amount: zUnsignedIntString.describe("Amount to withdraw")
|
|
476
483
|
}).describe("Cardano-like staking withdraw data");
|
|
477
|
-
var zGenericTransactionData =
|
|
478
|
-
type:
|
|
484
|
+
var zGenericTransactionData = z5.object({
|
|
485
|
+
type: z5.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
479
486
|
currency: zCurrency.describe("Transaction currency"),
|
|
480
|
-
rawTx:
|
|
487
|
+
rawTx: z5.string().describe("Raw tx")
|
|
481
488
|
}).describe("Generic transaction data");
|
|
482
|
-
var zTransactionData =
|
|
489
|
+
var zTransactionData = z5.discriminatedUnion("type", [
|
|
483
490
|
// Bitcoin
|
|
484
491
|
zBitcoinLikeSendData,
|
|
485
492
|
// Cardano
|
|
@@ -527,7 +534,7 @@ var zTransactionData = z32.discriminatedUnion("type", [
|
|
|
527
534
|
zTezosLikeSendData,
|
|
528
535
|
zTezosLikeUndelegateData
|
|
529
536
|
]);
|
|
530
|
-
var zSendOnlyTransactionData =
|
|
537
|
+
var zSendOnlyTransactionData = z5.discriminatedUnion("type", [
|
|
531
538
|
zBitcoinLikeSendData,
|
|
532
539
|
zCardanoSendData,
|
|
533
540
|
zEthereumLikeSendData,
|
|
@@ -537,95 +544,94 @@ var zSendOnlyTransactionData = z32.discriminatedUnion("type", [
|
|
|
537
544
|
zStellarLikeSendData,
|
|
538
545
|
zTezosLikeSendData
|
|
539
546
|
]);
|
|
540
|
-
var zCreateTransactionRequestData =
|
|
541
|
-
accountId:
|
|
547
|
+
var zCreateTransactionRequestData = z5.object({
|
|
548
|
+
accountId: z5.string().min(1).describe("Target account id"),
|
|
542
549
|
transaction: zTransactionData
|
|
543
550
|
});
|
|
544
|
-
var zSignMessageRequestData =
|
|
545
|
-
accountId:
|
|
546
|
-
message:
|
|
547
|
-
address:
|
|
551
|
+
var zSignMessageRequestData = z5.object({
|
|
552
|
+
accountId: z5.string().min(1).describe("Target account id"),
|
|
553
|
+
message: z5.string().nonempty().describe("Hex data to sign, either a json string for EIP712, or a raw string for EIP191"),
|
|
554
|
+
address: z5.string().nonempty().nullable().describe("Address for which to sign the message")
|
|
548
555
|
});
|
|
549
|
-
|
|
556
|
+
z5.object({
|
|
550
557
|
signature: zHsmSignature
|
|
551
558
|
});
|
|
552
|
-
var zDigestData =
|
|
559
|
+
var zDigestData = z5.object({
|
|
553
560
|
digest: zHexString.describe("The hex string digest to sign"),
|
|
554
|
-
derivationPath:
|
|
561
|
+
derivationPath: z5.string().nonempty().describe("The derivation path with which to sign the digest")
|
|
555
562
|
});
|
|
556
|
-
var zSignDigestsRequestData =
|
|
557
|
-
accountId:
|
|
558
|
-
digests:
|
|
563
|
+
var zSignDigestsRequestData = z5.object({
|
|
564
|
+
accountId: z5.string().min(1).describe("Target account id"),
|
|
565
|
+
digests: z5.array(zDigestData).describe("The digests to sign")
|
|
559
566
|
});
|
|
560
|
-
|
|
561
|
-
signatures:
|
|
567
|
+
z5.object({
|
|
568
|
+
signatures: z5.array(zHsmSignature)
|
|
562
569
|
});
|
|
563
|
-
var
|
|
570
|
+
var zClassicOperationType = z.enum([
|
|
564
571
|
"SEND",
|
|
565
572
|
"STAKE",
|
|
566
573
|
"DEPLOY_CONTRACT",
|
|
567
574
|
"EXECUTE_CONTRACT",
|
|
568
|
-
"SIGN_DIGESTS",
|
|
569
575
|
"SIGN_MESSAGE",
|
|
570
576
|
"ACTIVATE_TOKEN"
|
|
571
577
|
]);
|
|
572
|
-
var zOperationType = z.enum([...
|
|
573
|
-
var zNote =
|
|
574
|
-
title:
|
|
575
|
-
content:
|
|
578
|
+
var zOperationType = z.enum([...zClassicOperationType.options, "SIGN_DIGESTS"]);
|
|
579
|
+
var zNote = z5.object({
|
|
580
|
+
title: z5.string().describe("Request note title"),
|
|
581
|
+
content: z5.string().describe("Request note content")
|
|
576
582
|
});
|
|
577
583
|
|
|
578
584
|
// src/accounts/clients/types.ts
|
|
579
|
-
var zTransactionStatus =
|
|
580
|
-
var zBitcoinLikeCoinFields =
|
|
585
|
+
var zTransactionStatus = z5.enum(["SUCCESSFUL", "FAILED"]);
|
|
586
|
+
var zBitcoinLikeCoinFields = z5.object({
|
|
581
587
|
type: zBitcoinLikeTransactionType
|
|
582
588
|
});
|
|
583
|
-
var zCardanoLikeCoinFields =
|
|
589
|
+
var zCardanoLikeCoinFields = z5.object({
|
|
584
590
|
type: zCardanoLikeTransactionType
|
|
585
591
|
});
|
|
586
|
-
var zEthereumLikeTransferCoinFields =
|
|
592
|
+
var zEthereumLikeTransferCoinFields = z5.object({
|
|
587
593
|
type: zEthereumLikeTransferTransactionType,
|
|
588
|
-
gasPrice:
|
|
589
|
-
gasLimit:
|
|
590
|
-
nonce:
|
|
594
|
+
gasPrice: z5.string(),
|
|
595
|
+
gasLimit: z5.string(),
|
|
596
|
+
nonce: z5.string()
|
|
591
597
|
});
|
|
592
598
|
var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
|
|
593
599
|
type: zEthereumLikeContractTransactionType,
|
|
594
|
-
contractData:
|
|
600
|
+
contractData: z5.string().describe("Contract deployment or contract execution data")
|
|
595
601
|
});
|
|
596
|
-
var zGenericCoinFields =
|
|
602
|
+
var zGenericCoinFields = z5.object({
|
|
597
603
|
type: zGenericTransactionType
|
|
598
604
|
});
|
|
599
|
-
var zPolkadotLikeCoinFields =
|
|
605
|
+
var zPolkadotLikeCoinFields = z5.object({
|
|
600
606
|
type: zPolkadotLikeTransactionType
|
|
601
607
|
});
|
|
602
|
-
var zRippleLikeCoinFields =
|
|
608
|
+
var zRippleLikeCoinFields = z5.object({
|
|
603
609
|
type: zRippleLikeTransactionType,
|
|
604
|
-
memos:
|
|
605
|
-
destinationTag:
|
|
610
|
+
memos: z5.array(z5.string()),
|
|
611
|
+
destinationTag: z5.string()
|
|
606
612
|
});
|
|
607
|
-
var zSolanaLikeCoinFields =
|
|
613
|
+
var zSolanaLikeCoinFields = z5.object({
|
|
608
614
|
type: zSolanaLikeTransactionType
|
|
609
615
|
});
|
|
610
|
-
var zStellarLikeCoinFields =
|
|
616
|
+
var zStellarLikeCoinFields = z5.object({
|
|
611
617
|
type: zStellarLikeTransactionType
|
|
612
618
|
});
|
|
613
|
-
var zTezosLikeCoinFields =
|
|
619
|
+
var zTezosLikeCoinFields = z5.object({
|
|
614
620
|
type: zTezosLikeTransactionType
|
|
615
621
|
});
|
|
616
|
-
var zCommonTransactionResponse =
|
|
617
|
-
id:
|
|
618
|
-
hash:
|
|
619
|
-
block:
|
|
620
|
-
height:
|
|
621
|
-
time:
|
|
622
|
+
var zCommonTransactionResponse = z5.object({
|
|
623
|
+
id: z5.string().describe("Internal unique identifier"),
|
|
624
|
+
hash: z5.string().describe("Transaction hash"),
|
|
625
|
+
block: z5.object({
|
|
626
|
+
height: z5.string().nullable().describe("Transaction block height"),
|
|
627
|
+
time: z5.string().nullable().describe("Transaction block time")
|
|
622
628
|
}),
|
|
623
629
|
status: zTransactionStatus.describe("Transaction status"),
|
|
624
|
-
confirmations:
|
|
625
|
-
amount:
|
|
626
|
-
fee:
|
|
627
|
-
senders:
|
|
628
|
-
recipients:
|
|
630
|
+
confirmations: z5.string().describe("Block confirmations"),
|
|
631
|
+
amount: z5.string().describe("Transaction amount"),
|
|
632
|
+
fee: z5.string().describe("Transaction fee"),
|
|
633
|
+
senders: z5.array(z5.string()).describe("Senders (can be multiple for UTXOs-based accounts)"),
|
|
634
|
+
recipients: z5.array(z5.string()).describe("Recipients (can be multiple for multi-output transactions)")
|
|
629
635
|
});
|
|
630
636
|
var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.merge(zBitcoinLikeCoinFields).describe("Bitcoin-like transaction");
|
|
631
637
|
var zCardanoLikeTransactionResponse = zCommonTransactionResponse.merge(zCardanoLikeCoinFields).describe("Cardano-like transaction");
|
|
@@ -637,7 +643,7 @@ var zRippleLikeTransactionResponse = zCommonTransactionResponse.merge(zRippleLik
|
|
|
637
643
|
var zSolanaLikeTransactionResponse = zCommonTransactionResponse.merge(zSolanaLikeCoinFields).describe("Solana-like transaction");
|
|
638
644
|
var zStellarLikeTransactionResponse = zCommonTransactionResponse.merge(zStellarLikeCoinFields).describe("Stellar-like transaction");
|
|
639
645
|
var zTezosLikeTransactionResponse = zCommonTransactionResponse.merge(zTezosLikeCoinFields).describe("Tezos-like transaction");
|
|
640
|
-
var zTransactionResponse =
|
|
646
|
+
var zTransactionResponse = z5.discriminatedUnion("type", [
|
|
641
647
|
zBitcoinLikeTransactionResponse,
|
|
642
648
|
zCardanoLikeTransactionResponse,
|
|
643
649
|
zEthereumLikeTransferTransactionResponse,
|
|
@@ -649,123 +655,123 @@ var zTransactionResponse = z32.discriminatedUnion("type", [
|
|
|
649
655
|
zStellarLikeTransactionResponse,
|
|
650
656
|
zTezosLikeTransactionResponse
|
|
651
657
|
]);
|
|
652
|
-
|
|
658
|
+
z5.discriminatedUnion(
|
|
653
659
|
zTransactionResponse.discriminator,
|
|
654
660
|
ensureNonEmptyArray(
|
|
655
661
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
|
|
656
662
|
)
|
|
657
663
|
);
|
|
658
|
-
var zCardanoLikeStakingData =
|
|
659
|
-
staked:
|
|
664
|
+
var zCardanoLikeStakingData = z5.object({
|
|
665
|
+
staked: z5.string().describe("Staked balance")
|
|
660
666
|
}).nullable().describe("Cardano-like staking data");
|
|
661
|
-
var zCardanoLikeStakingFields =
|
|
662
|
-
type:
|
|
667
|
+
var zCardanoLikeStakingFields = z5.object({
|
|
668
|
+
type: z5.literal(AccountType.CARDANO_LIKE).describe("Account type"),
|
|
663
669
|
staking: zCardanoLikeStakingData.optional()
|
|
664
670
|
});
|
|
665
|
-
var zEthereumLikeStakingData =
|
|
666
|
-
totalStaking:
|
|
667
|
-
totalRewards:
|
|
668
|
-
availableRewards:
|
|
669
|
-
networkApy:
|
|
671
|
+
var zEthereumLikeStakingData = z5.object({
|
|
672
|
+
totalStaking: z5.string().describe("Total staked amount"),
|
|
673
|
+
totalRewards: z5.string().describe("Total of rewards"),
|
|
674
|
+
availableRewards: z5.string().describe("Available rewards"),
|
|
675
|
+
networkApy: z5.number().describe("Network APY")
|
|
670
676
|
}).nullable().describe("Ethereum-like staking data");
|
|
671
|
-
var zEthereumLikeStakingFields =
|
|
672
|
-
type:
|
|
677
|
+
var zEthereumLikeStakingFields = z5.object({
|
|
678
|
+
type: z5.literal(AccountType.ETHEREUM_LIKE).describe("Account type"),
|
|
673
679
|
staking: zEthereumLikeStakingData.optional()
|
|
674
680
|
});
|
|
675
|
-
var zPolkadotUnbondingAmount =
|
|
676
|
-
amount:
|
|
677
|
-
waiting_time:
|
|
678
|
-
});
|
|
679
|
-
var zPolkadotLikeStakingData =
|
|
680
|
-
info:
|
|
681
|
-
controllerAddress:
|
|
682
|
-
rewardsDestination:
|
|
683
|
-
proxies:
|
|
684
|
-
legacyStaking:
|
|
685
|
-
isNominator:
|
|
681
|
+
var zPolkadotUnbondingAmount = z5.object({
|
|
682
|
+
amount: z5.string().describe("Amount"),
|
|
683
|
+
waiting_time: z5.string().describe("Waiting time")
|
|
684
|
+
});
|
|
685
|
+
var zPolkadotLikeStakingData = z5.object({
|
|
686
|
+
info: z5.object({
|
|
687
|
+
controllerAddress: z5.string().nullable().describe("Controller address"),
|
|
688
|
+
rewardsDestination: z5.string().nullable().describe("Rewards destination"),
|
|
689
|
+
proxies: z5.array(z5.string()).describe("Proxies"),
|
|
690
|
+
legacyStaking: z5.boolean().describe("True if account uses legacy staking"),
|
|
691
|
+
isNominator: z5.boolean().describe("True if is nominator")
|
|
686
692
|
}),
|
|
687
|
-
balances:
|
|
688
|
-
free:
|
|
689
|
-
reserved:
|
|
690
|
-
frozen:
|
|
691
|
-
bonded:
|
|
692
|
-
available:
|
|
693
|
-
unbonding:
|
|
694
|
-
unbonded:
|
|
695
|
-
totalUnbonding:
|
|
696
|
-
totalUnbonded:
|
|
693
|
+
balances: z5.object({
|
|
694
|
+
free: z5.string().describe("Free balance"),
|
|
695
|
+
reserved: z5.string().describe("Reserved balance"),
|
|
696
|
+
frozen: z5.string().describe("Frozen balance"),
|
|
697
|
+
bonded: z5.string().describe("Bonded balance"),
|
|
698
|
+
available: z5.string().describe("Available balance"),
|
|
699
|
+
unbonding: z5.array(zPolkadotUnbondingAmount).describe("Unbonding balances"),
|
|
700
|
+
unbonded: z5.array(zPolkadotUnbondingAmount).describe("Unbonded balances"),
|
|
701
|
+
totalUnbonding: z5.string().describe("Total unbonding"),
|
|
702
|
+
totalUnbonded: z5.string().describe("Total unbonded")
|
|
697
703
|
}),
|
|
698
|
-
anonymousProxy:
|
|
699
|
-
address:
|
|
700
|
-
createdAt:
|
|
701
|
-
isController:
|
|
702
|
-
isMain:
|
|
703
|
-
balances:
|
|
704
|
-
free:
|
|
705
|
-
reserved:
|
|
706
|
-
frozen:
|
|
707
|
-
bonded:
|
|
708
|
-
available:
|
|
709
|
-
total:
|
|
704
|
+
anonymousProxy: z5.object({
|
|
705
|
+
address: z5.string().describe("Address"),
|
|
706
|
+
createdAt: z5.string().describe("Creation date"),
|
|
707
|
+
isController: z5.boolean().describe("True if is controller"),
|
|
708
|
+
isMain: z5.boolean().describe("True if is main"),
|
|
709
|
+
balances: z5.object({
|
|
710
|
+
free: z5.string().describe("Anonymous proxy free balance"),
|
|
711
|
+
reserved: z5.string().describe("Anonymous proxy reserved balance"),
|
|
712
|
+
frozen: z5.string().describe("Anonymous proxy frozen balance"),
|
|
713
|
+
bonded: z5.string().describe("Anonymous proxy bonded balance"),
|
|
714
|
+
available: z5.string().describe("Anonymous proxy available balance"),
|
|
715
|
+
total: z5.string().describe("Anonymous proxy total balance")
|
|
710
716
|
}).nullable(),
|
|
711
|
-
blockHeight:
|
|
712
|
-
extIndex:
|
|
713
|
-
index:
|
|
714
|
-
kind:
|
|
717
|
+
blockHeight: z5.string().describe("Anonymous proxy block height"),
|
|
718
|
+
extIndex: z5.string().describe("Ext index"),
|
|
719
|
+
index: z5.string().describe("Index"),
|
|
720
|
+
kind: z5.string().describe("Kind")
|
|
715
721
|
}).nullable().describe("Anonymous proxy")
|
|
716
722
|
}).nullable().describe("Polkadot-like staking data");
|
|
717
|
-
var zPolkadotLikeStakingFields =
|
|
718
|
-
type:
|
|
723
|
+
var zPolkadotLikeStakingFields = z5.object({
|
|
724
|
+
type: z5.literal(AccountType.POLKADOT_LIKE).describe("Account type"),
|
|
719
725
|
staking: zPolkadotLikeStakingData.optional()
|
|
720
726
|
});
|
|
721
|
-
var zSolanaStakingAccountStatus =
|
|
722
|
-
var zSolanaLikeStakingData =
|
|
723
|
-
staked:
|
|
724
|
-
rewards:
|
|
725
|
-
total:
|
|
726
|
-
last7:
|
|
727
|
-
last30:
|
|
727
|
+
var zSolanaStakingAccountStatus = z5.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).describe("Staking account status");
|
|
728
|
+
var zSolanaLikeStakingData = z5.object({
|
|
729
|
+
staked: z5.string().describe("Staked balance"),
|
|
730
|
+
rewards: z5.object({
|
|
731
|
+
total: z5.string().describe("Total rewards"),
|
|
732
|
+
last7: z5.string().describe("Rewards on last 7 days"),
|
|
733
|
+
last30: z5.string().describe("Rewards on last 30 days")
|
|
728
734
|
}),
|
|
729
|
-
stakes:
|
|
730
|
-
|
|
731
|
-
uid:
|
|
732
|
-
baseAccountUid:
|
|
733
|
-
pubKey:
|
|
734
|
-
validatorPubKey:
|
|
735
|
-
initialAmount:
|
|
736
|
-
activeAmount:
|
|
737
|
-
inactiveAmount:
|
|
738
|
-
totalBalance:
|
|
739
|
-
creationDate:
|
|
740
|
-
activationEpoch:
|
|
741
|
-
activationDate:
|
|
742
|
-
deactivationEpoch:
|
|
743
|
-
deactivationDate:
|
|
735
|
+
stakes: z5.array(
|
|
736
|
+
z5.object({
|
|
737
|
+
uid: z5.string(),
|
|
738
|
+
baseAccountUid: z5.string(),
|
|
739
|
+
pubKey: z5.string().describe("Public key"),
|
|
740
|
+
validatorPubKey: z5.string().nullable().describe("Validator public key"),
|
|
741
|
+
initialAmount: z5.string().describe("Initial amount"),
|
|
742
|
+
activeAmount: z5.string().describe("Active amount"),
|
|
743
|
+
inactiveAmount: z5.string().describe("Inactive amount"),
|
|
744
|
+
totalBalance: z5.string().describe("Total balance"),
|
|
745
|
+
creationDate: z5.string().describe("Creation date"),
|
|
746
|
+
activationEpoch: z5.string().nullable().describe("Activation epoch"),
|
|
747
|
+
activationDate: z5.string().nullable().describe("Activation date"),
|
|
748
|
+
deactivationEpoch: z5.string().nullable().describe("Deactivation epoch"),
|
|
749
|
+
deactivationDate: z5.string().nullable().describe("Deactivation date"),
|
|
744
750
|
status: zSolanaStakingAccountStatus,
|
|
745
|
-
rentExemptReserve:
|
|
746
|
-
withdrawableAmount:
|
|
747
|
-
totalRewards:
|
|
748
|
-
creationTxHash:
|
|
749
|
-
actionsTxHashes:
|
|
751
|
+
rentExemptReserve: z5.string().describe("Rent exempt reserve"),
|
|
752
|
+
withdrawableAmount: z5.string().describe("Withdrawable amount"),
|
|
753
|
+
totalRewards: z5.string().describe("Total rewards"),
|
|
754
|
+
creationTxHash: z5.string().nullable().describe("Creation transaction hash"),
|
|
755
|
+
actionsTxHashes: z5.array(z5.string()).describe("Actions transactions hashes")
|
|
750
756
|
})
|
|
751
757
|
)
|
|
752
758
|
}).nullable().describe("Solana-like staking data");
|
|
753
|
-
var zSolanaLikeStakingFields =
|
|
754
|
-
type:
|
|
759
|
+
var zSolanaLikeStakingFields = z5.object({
|
|
760
|
+
type: z5.literal(AccountType.SOLANA_LIKE).describe("Account type"),
|
|
755
761
|
staking: zSolanaLikeStakingData.optional()
|
|
756
762
|
});
|
|
757
|
-
var zTezosLikeStakingData =
|
|
758
|
-
delegations:
|
|
759
|
-
|
|
760
|
-
address:
|
|
763
|
+
var zTezosLikeStakingData = z5.object({
|
|
764
|
+
delegations: z5.array(
|
|
765
|
+
z5.object({
|
|
766
|
+
address: z5.string()
|
|
761
767
|
})
|
|
762
768
|
)
|
|
763
769
|
}).nullable().describe("Tezos-like staking data");
|
|
764
|
-
var zTezosLikeStakingFields =
|
|
765
|
-
type:
|
|
770
|
+
var zTezosLikeStakingFields = z5.object({
|
|
771
|
+
type: z5.literal(AccountType.TEZOS_LIKE).describe("Account type"),
|
|
766
772
|
staking: zTezosLikeStakingData.optional()
|
|
767
773
|
});
|
|
768
|
-
|
|
774
|
+
z5.discriminatedUnion("type", [
|
|
769
775
|
zCardanoLikeStakingFields,
|
|
770
776
|
zEthereumLikeStakingFields,
|
|
771
777
|
zPolkadotLikeStakingFields,
|
|
@@ -792,6 +798,7 @@ var zEthereumTokenLikeAssetFields = z.object({
|
|
|
792
798
|
contractAddress: z.string().describe("Token contract address")
|
|
793
799
|
}).describe("Ethereum-like token");
|
|
794
800
|
var zGenericLikeAssetFields = z.object({ type: z.literal(AccountType.GENERIC_LIKE).describe("Account type") }).describe("Generic-like");
|
|
801
|
+
var zRawSigningAssetFields = z.object({ type: z.literal(AccountType.RAW_SIGNING).describe("Account type") }).describe("Raw signing account");
|
|
795
802
|
var zPolkadotLikeAssetFields = z.object({
|
|
796
803
|
type: z.literal(AccountType.POLKADOT_LIKE).describe("Account type"),
|
|
797
804
|
address: z.string().describe("Account address").nullable()
|
|
@@ -820,6 +827,7 @@ z.discriminatedUnion("type", [
|
|
|
820
827
|
zEthereumTokenLikeAssetFields,
|
|
821
828
|
zGenericLikeAssetFields,
|
|
822
829
|
zPolkadotLikeAssetFields,
|
|
830
|
+
zRawSigningAssetFields,
|
|
823
831
|
zRippleLikeAssetFields,
|
|
824
832
|
zSolanaLikeAssetFields,
|
|
825
833
|
zStellarLikeAssetFields,
|
|
@@ -832,6 +840,7 @@ var zAccountAssetFields = z.discriminatedUnion("type", [
|
|
|
832
840
|
zEthereumTokenLikeAssetFields,
|
|
833
841
|
zGenericLikeAssetFields,
|
|
834
842
|
zPolkadotLikeAssetFields.merge(zPolkadotLikeStakingFields).describe("Polkadot-like"),
|
|
843
|
+
zRawSigningAssetFields,
|
|
835
844
|
zRippleLikeAssetFields,
|
|
836
845
|
zSolanaLikeAssetFields.merge(zSolanaLikeStakingFields).describe("Solana-like"),
|
|
837
846
|
zStellarLikeAssetFields,
|
|
@@ -852,57 +861,60 @@ var zReviewStepData = z.union([
|
|
|
852
861
|
}).describe("Review step with group")
|
|
853
862
|
]);
|
|
854
863
|
var zReviewStepsArray = z.array(zReviewStepData).min(1).describe("Review steps");
|
|
855
|
-
var
|
|
864
|
+
var zUpdateQuorumRequestData = z5.object({
|
|
865
|
+
quorum: z5.number().int().min(2).describe("Workspace quorum")
|
|
866
|
+
});
|
|
867
|
+
var zWorkspaceName = z5.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
856
868
|
|
|
857
869
|
// src/tradelink/types.ts
|
|
858
|
-
var zTradelinkWhitelistAddress =
|
|
859
|
-
name:
|
|
870
|
+
var zTradelinkWhitelistAddress = z5.object({
|
|
871
|
+
name: z5.string().min(1),
|
|
860
872
|
currency: zCurrency,
|
|
861
|
-
address:
|
|
873
|
+
address: z5.string().min(1)
|
|
862
874
|
});
|
|
863
|
-
|
|
864
|
-
var zTradelinkId =
|
|
865
|
-
var zTradelinkOrgEntityResponse =
|
|
875
|
+
z5.array(zTradelinkWhitelistAddress);
|
|
876
|
+
var zTradelinkId = z5.string().describe("Unique identifier in Tradelink service");
|
|
877
|
+
var zTradelinkOrgEntityResponse = z5.object({
|
|
866
878
|
tradelinkId: zTradelinkId,
|
|
867
|
-
name:
|
|
868
|
-
code:
|
|
869
|
-
logoUrl:
|
|
879
|
+
name: z5.string().describe("Name"),
|
|
880
|
+
code: z5.string().describe("Code"),
|
|
881
|
+
logoUrl: z5.string().describe("Logo URL")
|
|
870
882
|
});
|
|
871
883
|
zTradelinkOrgEntityResponse.omit({
|
|
872
884
|
tradelinkId: true
|
|
873
885
|
});
|
|
874
|
-
|
|
886
|
+
z5.object({
|
|
875
887
|
tradelinkId: zTradelinkId
|
|
876
888
|
});
|
|
877
|
-
var zTradelinkExchangeConfig =
|
|
878
|
-
exchangeId:
|
|
879
|
-
repledgeAuthorized:
|
|
880
|
-
needsAssetManagerApprovalForSettlements:
|
|
889
|
+
var zTradelinkExchangeConfig = z5.object({
|
|
890
|
+
exchangeId: z5.string().describe("Tradelink exchange id"),
|
|
891
|
+
repledgeAuthorized: z5.boolean().describe("Determines whether this exchange is authorized to repledge on this account"),
|
|
892
|
+
needsAssetManagerApprovalForSettlements: z5.boolean().describe(
|
|
881
893
|
'Determines whether asset manager will "pre-approve" the settlement requests on this account'
|
|
882
894
|
)
|
|
883
895
|
});
|
|
884
|
-
var zTradelinkExchangeConfigs =
|
|
885
|
-
|
|
896
|
+
var zTradelinkExchangeConfigs = z5.array(zTradelinkExchangeConfig);
|
|
897
|
+
z5.object({
|
|
886
898
|
workspaceName: zWorkspaceName,
|
|
887
|
-
custodian:
|
|
888
|
-
assetManagers:
|
|
889
|
-
exchanges:
|
|
899
|
+
custodian: z5.object({ name: z5.string() }),
|
|
900
|
+
assetManagers: z5.array(z5.object({ name: z5.string() })),
|
|
901
|
+
exchanges: z5.array(z5.object({ name: z5.string() }))
|
|
890
902
|
});
|
|
891
|
-
|
|
892
|
-
tradelinkId:
|
|
903
|
+
z5.object({
|
|
904
|
+
tradelinkId: z5.string(),
|
|
893
905
|
workspaceName: zWorkspaceName,
|
|
894
906
|
custodian: zTradelinkOrgEntityResponse,
|
|
895
|
-
assetManagers:
|
|
896
|
-
exchanges:
|
|
907
|
+
assetManagers: z5.array(zTradelinkOrgEntityResponse),
|
|
908
|
+
exchanges: z5.array(zTradelinkOrgEntityResponse)
|
|
897
909
|
});
|
|
898
|
-
var zTradelinkAsset =
|
|
899
|
-
name:
|
|
900
|
-
magnitude:
|
|
910
|
+
var zTradelinkAsset = z5.object({
|
|
911
|
+
name: z5.string(),
|
|
912
|
+
magnitude: z5.number().int().nonnegative()
|
|
901
913
|
});
|
|
902
|
-
|
|
914
|
+
z5.object({
|
|
903
915
|
tradelinkId: zTradelinkId,
|
|
904
916
|
asset: zTradelinkAsset,
|
|
905
|
-
state:
|
|
917
|
+
state: z5.enum([
|
|
906
918
|
"PLEDGE_READY",
|
|
907
919
|
"PLEDGE_INCREMENT_PENDING_APPROVAL",
|
|
908
920
|
"PLEDGE_APPROVED",
|
|
@@ -919,28 +931,28 @@ z32.object({
|
|
|
919
931
|
"RECOVERING_FROM_FAILURE",
|
|
920
932
|
"PLEDGE_CONSUMED"
|
|
921
933
|
]),
|
|
922
|
-
isLocked:
|
|
923
|
-
amount:
|
|
924
|
-
pending:
|
|
925
|
-
repledge:
|
|
926
|
-
exchangeTradelinkId:
|
|
927
|
-
accountId:
|
|
928
|
-
});
|
|
929
|
-
|
|
930
|
-
workspaceName:
|
|
931
|
-
clientAccountId:
|
|
934
|
+
isLocked: z5.boolean(),
|
|
935
|
+
amount: z5.string().describe("Currently pledged amount"),
|
|
936
|
+
pending: z5.string().describe("Requested pledge increment, not yet approved"),
|
|
937
|
+
repledge: z5.string().describe("TODO: describe this field"),
|
|
938
|
+
exchangeTradelinkId: z5.string(),
|
|
939
|
+
accountId: z5.string()
|
|
940
|
+
});
|
|
941
|
+
z5.object({
|
|
942
|
+
workspaceName: z5.string(),
|
|
943
|
+
clientAccountId: z5.string().describe("Account ID from the client side"),
|
|
932
944
|
exchangeTradelinkId: zTradelinkId,
|
|
933
945
|
asset: zTradelinkAsset
|
|
934
946
|
});
|
|
935
|
-
|
|
947
|
+
z5.object({
|
|
936
948
|
pledgeTradelinkId: zTradelinkId,
|
|
937
949
|
amount: zUnsignedIntString,
|
|
938
950
|
asset: zTradelinkAsset
|
|
939
951
|
});
|
|
940
|
-
|
|
941
|
-
tradelinkId:
|
|
942
|
-
pledgeTradelinkId:
|
|
943
|
-
state:
|
|
952
|
+
z5.object({
|
|
953
|
+
tradelinkId: z5.string(),
|
|
954
|
+
pledgeTradelinkId: z5.string(),
|
|
955
|
+
state: z5.enum([
|
|
944
956
|
"REGISTERED",
|
|
945
957
|
"PENDING_REPLEDGE_CREATION_APPROVAL",
|
|
946
958
|
"PENDING_REPLEDGE_APPROVAL",
|
|
@@ -950,48 +962,49 @@ z32.object({
|
|
|
950
962
|
"APPROVED",
|
|
951
963
|
"REJECTED",
|
|
952
964
|
"CONFIRMED",
|
|
953
|
-
"FAILED"
|
|
965
|
+
"FAILED",
|
|
966
|
+
"CANCELED"
|
|
954
967
|
]),
|
|
955
968
|
// For now we only consider the outbound settlement
|
|
956
|
-
outboundTransactionHash:
|
|
969
|
+
outboundTransactionHash: z5.string().nullable()
|
|
957
970
|
});
|
|
958
971
|
|
|
959
972
|
// src/tradelink/request-data.ts
|
|
960
|
-
var zCustodianRequestData =
|
|
973
|
+
var zCustodianRequestData = z5.object({
|
|
961
974
|
settlement: zReviewStepWithUsersArray.describe("List of settlement review steps"),
|
|
962
975
|
withdraw: zReviewStepWithUsersArray.describe("List of withdraw review steps"),
|
|
963
976
|
arbitration: zReviewStepWithUsersArray.describe("List of arbitration review steps")
|
|
964
977
|
});
|
|
965
|
-
var zTradelinkEntityRequestData =
|
|
966
|
-
tradelinkId:
|
|
978
|
+
var zTradelinkEntityRequestData = z5.object({
|
|
979
|
+
tradelinkId: z5.string().min(1),
|
|
967
980
|
groups: zReviewStepWithUsersArray.describe("List of asset manager review groups"),
|
|
968
|
-
whitelist:
|
|
981
|
+
whitelist: z5.array(zTradelinkWhitelistAddress).describe("List of asset manager whitelisted addresses")
|
|
969
982
|
});
|
|
970
|
-
var zAdjustPledgeRequestData =
|
|
971
|
-
accountId:
|
|
972
|
-
exchangeId:
|
|
983
|
+
var zAdjustPledgeRequestData = z5.object({
|
|
984
|
+
accountId: z5.string().describe("Account id"),
|
|
985
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
973
986
|
amount: zIntString.describe("Amount to add to pledge")
|
|
974
987
|
});
|
|
975
|
-
var zRepledgeRequestData =
|
|
976
|
-
accountId:
|
|
977
|
-
exchangeId:
|
|
988
|
+
var zRepledgeRequestData = z5.object({
|
|
989
|
+
accountId: z5.string().describe("Account id"),
|
|
990
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
978
991
|
amount: zIntString.describe("Amount to add to pledge")
|
|
979
992
|
});
|
|
980
|
-
var zCreateSettlementRequestData =
|
|
981
|
-
accountId:
|
|
982
|
-
exchangeId:
|
|
993
|
+
var zCreateSettlementRequestData = z5.object({
|
|
994
|
+
accountId: z5.string().describe("Account id"),
|
|
995
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
983
996
|
transaction: zSendOnlyTransactionData
|
|
984
997
|
});
|
|
985
|
-
var zForceUnpledgeRequestData =
|
|
986
|
-
accountId:
|
|
987
|
-
exchangeId:
|
|
998
|
+
var zForceUnpledgeRequestData = z5.object({
|
|
999
|
+
accountId: z5.string().describe("Account id"),
|
|
1000
|
+
exchangeId: z5.string().describe("Exchange id")
|
|
988
1001
|
});
|
|
989
|
-
var zTradelinkWithdrawRequestData =
|
|
990
|
-
accountId:
|
|
1002
|
+
var zTradelinkWithdrawRequestData = z5.object({
|
|
1003
|
+
accountId: z5.string().describe("Account id"),
|
|
991
1004
|
transaction: zSendOnlyTransactionData
|
|
992
1005
|
});
|
|
993
|
-
var zTradelinkArbitrationRequestData =
|
|
994
|
-
accountId:
|
|
1006
|
+
var zTradelinkArbitrationRequestData = z5.object({
|
|
1007
|
+
accountId: z5.string().describe("Account id"),
|
|
995
1008
|
transaction: zSendOnlyTransactionData
|
|
996
1009
|
});
|
|
997
1010
|
|
|
@@ -1008,27 +1021,27 @@ var zTradelinkAccountGovernanceFields = z.object({
|
|
|
1008
1021
|
var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).describe("Governance fields");
|
|
1009
1022
|
|
|
1010
1023
|
// src/accounts/types.ts
|
|
1011
|
-
var zAccountCommonFields =
|
|
1012
|
-
id:
|
|
1013
|
-
legacyId:
|
|
1014
|
-
name:
|
|
1024
|
+
var zAccountCommonFields = z5.object({
|
|
1025
|
+
id: z5.string().describe("Internal unique identifier"),
|
|
1026
|
+
legacyId: z5.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1027
|
+
name: z5.string().describe("Name"),
|
|
1015
1028
|
currency: zCurrency,
|
|
1016
|
-
index:
|
|
1017
|
-
derivationPath:
|
|
1018
|
-
status:
|
|
1019
|
-
createdAt:
|
|
1020
|
-
updatedAt:
|
|
1021
|
-
});
|
|
1022
|
-
var zAccountBalanceFields =
|
|
1023
|
-
total:
|
|
1024
|
-
pending:
|
|
1029
|
+
index: z5.number().gte(0).describe("BIP44 account index"),
|
|
1030
|
+
derivationPath: z5.string().describe("Derivation path"),
|
|
1031
|
+
status: z5.nativeEnum(ActivationStatus).describe("Status"),
|
|
1032
|
+
createdAt: z5.coerce.date().describe("Creation timestamp"),
|
|
1033
|
+
updatedAt: z5.coerce.date().describe("Last modification timestamp")
|
|
1034
|
+
});
|
|
1035
|
+
var zAccountBalanceFields = z5.object({
|
|
1036
|
+
total: z5.string().describe("Total balance"),
|
|
1037
|
+
pending: z5.string().describe("Pending balance")
|
|
1025
1038
|
}).describe("Balance fields");
|
|
1026
1039
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1027
1040
|
balance: zAccountBalanceFields.optional(),
|
|
1028
1041
|
asset: zAccountAssetFields,
|
|
1029
1042
|
governance: zAccountGovernanceFields
|
|
1030
1043
|
});
|
|
1031
|
-
|
|
1044
|
+
z5.enum([
|
|
1032
1045
|
"name",
|
|
1033
1046
|
"currency",
|
|
1034
1047
|
"index",
|
|
@@ -1037,128 +1050,146 @@ z32.enum([
|
|
|
1037
1050
|
]).default("createdAt");
|
|
1038
1051
|
|
|
1039
1052
|
// src/accounts/app-types.ts
|
|
1040
|
-
var zNote2 =
|
|
1041
|
-
title:
|
|
1042
|
-
content:
|
|
1053
|
+
var zNote2 = z5.object({
|
|
1054
|
+
title: z5.string().describe("Transaction note title"),
|
|
1055
|
+
content: z5.string().describe("Transaction note content")
|
|
1043
1056
|
}).describe("Optional transaction note");
|
|
1044
|
-
|
|
1057
|
+
z5.discriminatedUnion(
|
|
1045
1058
|
zTransactionResponse.discriminator,
|
|
1046
1059
|
ensureNonEmptyArray(
|
|
1047
1060
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote2.nullable() }))
|
|
1048
1061
|
)
|
|
1049
1062
|
);
|
|
1050
|
-
var zWhitelistAddress =
|
|
1051
|
-
name:
|
|
1063
|
+
var zWhitelistAddress = z5.object({
|
|
1064
|
+
name: z5.string().min(1).max(50),
|
|
1052
1065
|
currency: zCurrency,
|
|
1053
|
-
address:
|
|
1066
|
+
address: z5.string().min(1).max(200),
|
|
1054
1067
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1055
1068
|
// Empty array (or undefined) means no check on destination tag.
|
|
1056
|
-
destinationTags:
|
|
1069
|
+
destinationTags: z5.array(z5.string().min(1).regex(/^\w+$/)).optional()
|
|
1057
1070
|
});
|
|
1058
|
-
var zWhitelistAddresses =
|
|
1059
|
-
var zWhitelistName =
|
|
1060
|
-
var zCreateWhitelistRequestData =
|
|
1071
|
+
var zWhitelistAddresses = z5.array(zWhitelistAddress);
|
|
1072
|
+
var zWhitelistName = z5.string().min(1).max(45).describe("Whitelist name");
|
|
1073
|
+
var zCreateWhitelistRequestData = z5.object({
|
|
1061
1074
|
name: zWhitelistName,
|
|
1062
|
-
description:
|
|
1075
|
+
description: z5.string().nullable(),
|
|
1063
1076
|
addresses: zWhitelistAddresses,
|
|
1064
|
-
type:
|
|
1077
|
+
type: z5.nativeEnum(WhitelistType)
|
|
1065
1078
|
});
|
|
1066
|
-
var zEditWhitelistRequestData =
|
|
1079
|
+
var zEditWhitelistRequestData = z5.object({
|
|
1067
1080
|
name: zWhitelistName,
|
|
1068
1081
|
addresses: zWhitelistAddresses
|
|
1069
1082
|
});
|
|
1070
1083
|
|
|
1071
1084
|
// src/policies/db-utils.ts
|
|
1072
|
-
var zThreshold =
|
|
1085
|
+
var zThreshold = z5.object({
|
|
1073
1086
|
min: zUnsignedIntString.nullable().describe("Minimum transaction amount"),
|
|
1074
1087
|
max: zUnsignedIntString.nullable().describe("Maximum transaction amount")
|
|
1075
1088
|
}).describe("Threshold for the transaction value");
|
|
1076
|
-
var zWhitelistIds =
|
|
1077
|
-
var zGovRuleJsonObject =
|
|
1089
|
+
var zWhitelistIds = z5.array(z5.string().min(1)).describe("IDs of whitelists for the recipient address");
|
|
1090
|
+
var zGovRuleJsonObject = z5.object({
|
|
1078
1091
|
// Required.
|
|
1079
1092
|
operationType: zOperationType.describe("Allowed operation type"),
|
|
1080
1093
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
1081
1094
|
threshold: zThreshold,
|
|
1082
1095
|
// Optional whitelist on transaction recipient: Empty list means no whitelist.
|
|
1083
1096
|
whitelistIds: zWhitelistIds,
|
|
1084
|
-
reviewConfigId:
|
|
1097
|
+
reviewConfigId: z5.string().min(1).describe("Id of ReviewConfig"),
|
|
1085
1098
|
// HSM id for the rule
|
|
1086
1099
|
hsmId: zHsmObjectId
|
|
1087
1100
|
}).describe("INTERNAL: Governance rule JSON representation in DB");
|
|
1088
|
-
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1101
|
+
z5.array(zGovRuleJsonObject);
|
|
1102
|
+
var zBaseGovRuleData = z5.object({
|
|
1103
|
+
// Steps of users that will need to review operations
|
|
1104
|
+
reviewSteps: zReviewStepsArray,
|
|
1091
1105
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
1092
1106
|
threshold: zThreshold.optional(),
|
|
1093
1107
|
// Optional whitelist on transaction recipient: Empty list means no whitelist.
|
|
1094
|
-
whitelistIds: zWhitelistIds.optional()
|
|
1095
|
-
|
|
1108
|
+
whitelistIds: zWhitelistIds.optional()
|
|
1109
|
+
});
|
|
1110
|
+
var zClassicGovRuleData = zBaseGovRuleData.extend({
|
|
1111
|
+
operationType: zClassicOperationType.describe("Allowed operation type")
|
|
1096
1112
|
}).describe("Account governance rule");
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
var
|
|
1113
|
+
zBaseGovRuleData.extend({
|
|
1114
|
+
operationType: zOperationType.describe("Allowed operation type")
|
|
1115
|
+
}).describe("Governance rule");
|
|
1116
|
+
var zPolicyName = z5.string().min(1).max(19).describe("Policy name");
|
|
1117
|
+
var zCurrency2 = z5.string().min(1).max(40).regex(/^\w+$/).describe("Currency");
|
|
1118
|
+
var zCreatePublicPolicyRequestData = z5.object({
|
|
1101
1119
|
name: zPolicyName,
|
|
1102
|
-
description:
|
|
1120
|
+
description: z5.string().nullable().describe("Description"),
|
|
1103
1121
|
currency: zCurrency2.nullable(),
|
|
1104
|
-
govRules:
|
|
1122
|
+
govRules: z5.array(zClassicGovRuleData).describe("Governance rules")
|
|
1105
1123
|
});
|
|
1106
|
-
var
|
|
1124
|
+
var zEditPublicPolicyRequestData = z5.object({
|
|
1107
1125
|
name: zPolicyName,
|
|
1108
|
-
description:
|
|
1109
|
-
govRules:
|
|
1126
|
+
description: z5.string().nullable().describe("Description"),
|
|
1127
|
+
govRules: z5.array(zClassicGovRuleData).describe("Governance rules")
|
|
1110
1128
|
});
|
|
1111
1129
|
|
|
1112
1130
|
// src/accounts/request-data.ts
|
|
1113
|
-
var zAccountName =
|
|
1114
|
-
var
|
|
1115
|
-
|
|
1116
|
-
|
|
1131
|
+
var zAccountName = z5.string().min(1).max(40).describe("Account name");
|
|
1132
|
+
var zSignDigestsGovRuleData = z5.object({
|
|
1133
|
+
operationType: z5.literal("SIGN_DIGESTS"),
|
|
1134
|
+
reviewSteps: zReviewStepWithUsersArray
|
|
1135
|
+
// we need to control for API users only
|
|
1136
|
+
}).describe("Digest signing rule");
|
|
1137
|
+
var zAccountPolicyRequestData = z5.union([
|
|
1138
|
+
z5.object({ policyId: z5.string() }).describe("Account policy"),
|
|
1139
|
+
z5.object({ rules: z5.array(zClassicGovRuleData) }).describe("Account governance rules")
|
|
1117
1140
|
]).describe("Account policy or governance rules");
|
|
1118
|
-
var zCreateAccountGovernanceData =
|
|
1119
|
-
|
|
1120
|
-
type:
|
|
1141
|
+
var zCreateAccountGovernanceData = z5.discriminatedUnion("type", [
|
|
1142
|
+
z5.object({
|
|
1143
|
+
type: z5.literal(AccountGovernanceType.CLASSIC),
|
|
1121
1144
|
policy: zAccountPolicyRequestData
|
|
1122
1145
|
}),
|
|
1123
|
-
|
|
1124
|
-
type:
|
|
1125
|
-
assetManagerId:
|
|
1146
|
+
z5.object({
|
|
1147
|
+
type: z5.literal(AccountGovernanceType.TRADELINK),
|
|
1148
|
+
assetManagerId: z5.string(),
|
|
1126
1149
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1150
|
+
}),
|
|
1151
|
+
z5.object({
|
|
1152
|
+
type: z5.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1153
|
+
policy: z5.object({ rules: z5.array(zSignDigestsGovRuleData) })
|
|
1127
1154
|
})
|
|
1128
1155
|
]);
|
|
1129
|
-
var zCreateAccountUserInputData =
|
|
1156
|
+
var zCreateAccountUserInputData = z5.object({
|
|
1130
1157
|
name: zAccountName,
|
|
1131
|
-
type: z32.nativeEnum(AccountType),
|
|
1132
|
-
// "BITCOIN_LIKE"
|
|
1133
1158
|
currency: zCurrency,
|
|
1134
1159
|
// "bitcoin"
|
|
1135
|
-
index:
|
|
1136
|
-
contractAddress:
|
|
1160
|
+
index: z5.number().nonnegative().optional().describe("Account index"),
|
|
1161
|
+
contractAddress: z5.string().min(1).optional().describe("Account contract address"),
|
|
1137
1162
|
governance: zCreateAccountGovernanceData
|
|
1138
1163
|
});
|
|
1139
1164
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
1140
|
-
index:
|
|
1141
|
-
derivationPath:
|
|
1165
|
+
index: z5.number().nonnegative().describe("Account index"),
|
|
1166
|
+
derivationPath: z5.string().describe("Account bip44 derivation path"),
|
|
1167
|
+
type: z5.nativeEnum(AccountType)
|
|
1168
|
+
// "BITCOIN_LIKE"
|
|
1142
1169
|
});
|
|
1143
|
-
var zEditAccountGovernanceData =
|
|
1144
|
-
|
|
1145
|
-
type:
|
|
1170
|
+
var zEditAccountGovernanceData = z5.discriminatedUnion("type", [
|
|
1171
|
+
z5.object({
|
|
1172
|
+
type: z5.literal(AccountGovernanceType.CLASSIC),
|
|
1146
1173
|
policy: zAccountPolicyRequestData
|
|
1147
1174
|
}),
|
|
1148
|
-
|
|
1149
|
-
type:
|
|
1175
|
+
z5.object({
|
|
1176
|
+
type: z5.literal(AccountGovernanceType.TRADELINK),
|
|
1150
1177
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1178
|
+
}),
|
|
1179
|
+
z5.object({
|
|
1180
|
+
type: z5.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1181
|
+
policy: z5.object({ rules: z5.array(zSignDigestsGovRuleData) })
|
|
1151
1182
|
})
|
|
1152
1183
|
]);
|
|
1153
|
-
var zEditAccountRequestData =
|
|
1184
|
+
var zEditAccountRequestData = z5.object({
|
|
1154
1185
|
name: zAccountName,
|
|
1155
1186
|
governance: zEditAccountGovernanceData
|
|
1156
1187
|
});
|
|
1157
|
-
var zActivateAccountRequestData =
|
|
1158
|
-
var zEditTokenRuleRequestData =
|
|
1159
|
-
parentAccountId:
|
|
1160
|
-
contractAddress:
|
|
1161
|
-
rules:
|
|
1188
|
+
var zActivateAccountRequestData = z5.object({});
|
|
1189
|
+
var zEditTokenRuleRequestData = z5.object({
|
|
1190
|
+
parentAccountId: z5.string().min(1).describe("Parent account unique ID"),
|
|
1191
|
+
contractAddress: z5.string().min(1).describe("Token contract address"),
|
|
1192
|
+
rules: z5.array(zClassicGovRuleData).describe("Account governance rules")
|
|
1162
1193
|
});
|
|
1163
1194
|
|
|
1164
1195
|
// src/accounts/app-utils.ts
|
|
@@ -1214,6 +1245,7 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1214
1245
|
address: account.address
|
|
1215
1246
|
};
|
|
1216
1247
|
case AccountType.GENERIC_LIKE:
|
|
1248
|
+
case AccountType.RAW_SIGNING:
|
|
1217
1249
|
return {
|
|
1218
1250
|
type: account.type
|
|
1219
1251
|
};
|
|
@@ -1225,6 +1257,7 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1225
1257
|
var getAccountGovernanceFields = (account) => {
|
|
1226
1258
|
switch (account.governanceType) {
|
|
1227
1259
|
case AccountGovernanceType.CLASSIC:
|
|
1260
|
+
case AccountGovernanceType.RAW_SIGNING:
|
|
1228
1261
|
return {
|
|
1229
1262
|
type: AccountGovernanceType.CLASSIC,
|
|
1230
1263
|
policyId: account.classicGovernanceMixin.policyId
|
|
@@ -1253,15 +1286,15 @@ var serializeAccount = (account) => {
|
|
|
1253
1286
|
};
|
|
1254
1287
|
return zAccountResponse.parse(response);
|
|
1255
1288
|
};
|
|
1256
|
-
var zSciConfigData =
|
|
1257
|
-
dapps:
|
|
1258
|
-
customContractCallEnabled:
|
|
1289
|
+
var zSciConfigData = z5.object({
|
|
1290
|
+
dapps: z5.array(z5.string()).nullable().describe("Allowed DApps, null allows all"),
|
|
1291
|
+
customContractCallEnabled: z5.boolean().describe("Allow non-DApp SCI")
|
|
1259
1292
|
});
|
|
1260
|
-
var zCreateSciConfigRequestData =
|
|
1261
|
-
account:
|
|
1293
|
+
var zCreateSciConfigRequestData = z5.object({
|
|
1294
|
+
account: z5.string().describe("Account UUID"),
|
|
1262
1295
|
config: zSciConfigData
|
|
1263
1296
|
});
|
|
1264
|
-
var zEditSciConfigRequestData =
|
|
1297
|
+
var zEditSciConfigRequestData = z5.object({
|
|
1265
1298
|
config: zSciConfigData
|
|
1266
1299
|
});
|
|
1267
1300
|
var zRequestReviewStep = z.object({
|
|
@@ -1284,299 +1317,288 @@ zUserRegistrationCreateInput.extend({
|
|
|
1284
1317
|
});
|
|
1285
1318
|
|
|
1286
1319
|
// src/users/request-data.ts
|
|
1287
|
-
var zCreatePsdUserRequestData =
|
|
1288
|
-
registrationId:
|
|
1320
|
+
var zCreatePsdUserRequestData = z5.object({
|
|
1321
|
+
registrationId: z5.string().describe("User registration ID")
|
|
1289
1322
|
});
|
|
1290
|
-
var zCreateApiUserRequestData =
|
|
1323
|
+
var zCreateApiUserRequestData = z5.object({
|
|
1291
1324
|
name: zUserName,
|
|
1292
|
-
pubKey:
|
|
1293
|
-
role:
|
|
1294
|
-
viewAll:
|
|
1325
|
+
pubKey: z5.string().describe("Public key"),
|
|
1326
|
+
role: z5.enum(["ADMIN", "OPERATOR"]).describe("User role"),
|
|
1327
|
+
viewAll: z5.boolean().describe("View all data").default(false).optional()
|
|
1295
1328
|
}).describe("Create API user request data");
|
|
1296
|
-
var zCreateApiUserAccessRequestData =
|
|
1329
|
+
var zCreateApiUserAccessRequestData = z5.object({
|
|
1297
1330
|
name: zUserName
|
|
1298
1331
|
}).describe("Create API user credential request data");
|
|
1299
|
-
|
|
1300
|
-
authUserId:
|
|
1332
|
+
z5.object({
|
|
1333
|
+
authUserId: z5.string().describe("Authentication broker ID")
|
|
1301
1334
|
}).describe("Managed data for API user");
|
|
1302
|
-
var zGroupName =
|
|
1303
|
-
var zCreateGroupRequestData =
|
|
1335
|
+
var zGroupName = z5.string().min(1).max(19).describe("Group name");
|
|
1336
|
+
var zCreateGroupRequestData = z5.object({
|
|
1304
1337
|
name: zGroupName,
|
|
1305
|
-
description:
|
|
1306
|
-
members:
|
|
1338
|
+
description: z5.string().nullable().describe("Group description"),
|
|
1339
|
+
members: z5.array(z5.string()).describe("List of group members ids")
|
|
1307
1340
|
});
|
|
1308
|
-
var zEditGroupRequestData =
|
|
1341
|
+
var zEditGroupRequestData = z5.object({
|
|
1309
1342
|
name: zGroupName,
|
|
1310
|
-
description:
|
|
1311
|
-
members:
|
|
1343
|
+
description: z5.string().nullable().describe("Group description"),
|
|
1344
|
+
members: z5.array(z5.string()).describe("List of group members ids")
|
|
1312
1345
|
});
|
|
1313
|
-
var zApiKeyName =
|
|
1314
|
-
var zCreateApiKeyRequestData =
|
|
1346
|
+
var zApiKeyName = z5.string().min(1).max(19).describe("API key name");
|
|
1347
|
+
var zCreateApiKeyRequestData = z5.object({
|
|
1315
1348
|
name: zApiKeyName,
|
|
1316
|
-
entities:
|
|
1317
|
-
scopes:
|
|
1349
|
+
entities: z5.array(z5.string()).describe("List of related entities ids"),
|
|
1350
|
+
scopes: z5.object({}).describe("FIXME to be precised")
|
|
1318
1351
|
}).describe("Create read-only API key request data");
|
|
1319
1352
|
var zEditApiKeyRequestData = zCreateApiKeyRequestData.describe(
|
|
1320
1353
|
"Edit read-only API key request data"
|
|
1321
1354
|
);
|
|
1322
|
-
var zEntityName =
|
|
1323
|
-
var zCreateEntityRequestData =
|
|
1355
|
+
var zEntityName = z5.string().min(1).max(19).describe("Entity name");
|
|
1356
|
+
var zCreateEntityRequestData = z5.object({
|
|
1324
1357
|
name: zEntityName,
|
|
1325
|
-
accounts:
|
|
1358
|
+
accounts: z5.array(z5.string())
|
|
1326
1359
|
});
|
|
1327
|
-
var zEditEntityRequestData =
|
|
1360
|
+
var zEditEntityRequestData = z5.object({
|
|
1328
1361
|
name: zEntityName,
|
|
1329
|
-
accounts:
|
|
1362
|
+
accounts: z5.array(z5.string())
|
|
1330
1363
|
});
|
|
1331
1364
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1332
|
-
var zWorkspaceRuleRequestData =
|
|
1333
|
-
permission:
|
|
1365
|
+
var zWorkspaceRuleRequestData = z5.object({
|
|
1366
|
+
permission: z5.nativeEnum(NonRootAdminPermission).describe("Granted permissions"),
|
|
1334
1367
|
reviewConfig: zReviewStepWithUsersArray.describe("List of admin review steps")
|
|
1335
1368
|
});
|
|
1336
|
-
var zUpdateQuorumRequestData = z32.object({
|
|
1337
|
-
quorum: z32.number().int().min(1).describe("Workspace quorum")
|
|
1338
|
-
});
|
|
1339
1369
|
|
|
1340
1370
|
// src/requests/request-data.ts
|
|
1341
1371
|
var zVaultRequestMixinsByType = {
|
|
1342
1372
|
// Workspaces
|
|
1343
|
-
[RequestType.UPDATE_QUORUM]:
|
|
1344
|
-
type:
|
|
1373
|
+
[RequestType.UPDATE_QUORUM]: z5.object({
|
|
1374
|
+
type: z5.literal(RequestType.UPDATE_QUORUM),
|
|
1345
1375
|
data: zUpdateQuorumRequestData
|
|
1346
1376
|
}),
|
|
1347
1377
|
// Operator requests
|
|
1348
|
-
[RequestType.CREATE_TRANSACTION]:
|
|
1349
|
-
type:
|
|
1378
|
+
[RequestType.CREATE_TRANSACTION]: z5.object({
|
|
1379
|
+
type: z5.literal(RequestType.CREATE_TRANSACTION),
|
|
1350
1380
|
data: zCreateTransactionRequestData,
|
|
1351
|
-
meta:
|
|
1352
|
-
hash:
|
|
1381
|
+
meta: z5.object({
|
|
1382
|
+
hash: z5.string().nullable()
|
|
1353
1383
|
}).optional().nullable()
|
|
1354
1384
|
}),
|
|
1355
|
-
[RequestType.SIGN_MESSAGE]:
|
|
1356
|
-
type:
|
|
1385
|
+
[RequestType.SIGN_MESSAGE]: z5.object({
|
|
1386
|
+
type: z5.literal(RequestType.SIGN_MESSAGE),
|
|
1357
1387
|
data: zSignMessageRequestData
|
|
1358
1388
|
}),
|
|
1359
|
-
[RequestType.SIGN_DIGESTS]:
|
|
1360
|
-
type:
|
|
1389
|
+
[RequestType.SIGN_DIGESTS]: z5.object({
|
|
1390
|
+
type: z5.literal(RequestType.SIGN_DIGESTS),
|
|
1361
1391
|
data: zSignDigestsRequestData
|
|
1362
1392
|
}),
|
|
1363
1393
|
// Accounts
|
|
1364
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1365
|
-
type:
|
|
1394
|
+
[RequestType.CREATE_ACCOUNT]: z5.object({
|
|
1395
|
+
type: z5.literal(RequestType.CREATE_ACCOUNT),
|
|
1366
1396
|
data: zCreateAccountRequestData
|
|
1367
1397
|
}),
|
|
1368
|
-
[RequestType.EDIT_ACCOUNT]:
|
|
1369
|
-
type:
|
|
1370
|
-
targetId:
|
|
1398
|
+
[RequestType.EDIT_ACCOUNT]: z5.object({
|
|
1399
|
+
type: z5.literal(RequestType.EDIT_ACCOUNT),
|
|
1400
|
+
targetId: z5.string(),
|
|
1371
1401
|
data: zEditAccountRequestData
|
|
1372
1402
|
}),
|
|
1373
|
-
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]:
|
|
1374
|
-
type:
|
|
1375
|
-
targetId:
|
|
1403
|
+
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]: z5.object({
|
|
1404
|
+
type: z5.literal(RequestType.ACTIVATE_TRADELINK_ACCOUNT),
|
|
1405
|
+
targetId: z5.string(),
|
|
1376
1406
|
data: zActivateAccountRequestData
|
|
1377
1407
|
}),
|
|
1378
|
-
[RequestType.EDIT_TOKEN_RULE]:
|
|
1379
|
-
type:
|
|
1380
|
-
targetId:
|
|
1408
|
+
[RequestType.EDIT_TOKEN_RULE]: z5.object({
|
|
1409
|
+
type: z5.literal(RequestType.EDIT_TOKEN_RULE),
|
|
1410
|
+
targetId: z5.string(),
|
|
1381
1411
|
data: zEditTokenRuleRequestData
|
|
1382
1412
|
}),
|
|
1383
1413
|
// Groups
|
|
1384
|
-
[RequestType.CREATE_GROUP]:
|
|
1385
|
-
type:
|
|
1414
|
+
[RequestType.CREATE_GROUP]: z5.object({
|
|
1415
|
+
type: z5.literal(RequestType.CREATE_GROUP),
|
|
1386
1416
|
data: zCreateGroupRequestData
|
|
1387
1417
|
}),
|
|
1388
|
-
[RequestType.EDIT_GROUP]:
|
|
1389
|
-
type:
|
|
1390
|
-
targetId:
|
|
1418
|
+
[RequestType.EDIT_GROUP]: z5.object({
|
|
1419
|
+
type: z5.literal(RequestType.EDIT_GROUP),
|
|
1420
|
+
targetId: z5.string(),
|
|
1391
1421
|
data: zEditGroupRequestData
|
|
1392
1422
|
}),
|
|
1393
|
-
[RequestType.REVOKE_GROUP]:
|
|
1394
|
-
type:
|
|
1395
|
-
data:
|
|
1423
|
+
[RequestType.REVOKE_GROUP]: z5.object({
|
|
1424
|
+
type: z5.literal(RequestType.REVOKE_GROUP),
|
|
1425
|
+
data: z5.object({})
|
|
1396
1426
|
}),
|
|
1397
1427
|
// Whitelists
|
|
1398
|
-
[RequestType.CREATE_WHITELIST]:
|
|
1399
|
-
type:
|
|
1428
|
+
[RequestType.CREATE_WHITELIST]: z5.object({
|
|
1429
|
+
type: z5.literal(RequestType.CREATE_WHITELIST),
|
|
1400
1430
|
data: zCreateWhitelistRequestData
|
|
1401
1431
|
}),
|
|
1402
|
-
[RequestType.EDIT_WHITELIST]:
|
|
1403
|
-
type:
|
|
1404
|
-
targetId:
|
|
1432
|
+
[RequestType.EDIT_WHITELIST]: z5.object({
|
|
1433
|
+
type: z5.literal(RequestType.EDIT_WHITELIST),
|
|
1434
|
+
targetId: z5.string(),
|
|
1405
1435
|
data: zEditWhitelistRequestData
|
|
1406
1436
|
}),
|
|
1407
1437
|
// Entities
|
|
1408
|
-
[RequestType.CREATE_ENTITY]:
|
|
1409
|
-
type:
|
|
1438
|
+
[RequestType.CREATE_ENTITY]: z5.object({
|
|
1439
|
+
type: z5.literal(RequestType.CREATE_ENTITY),
|
|
1410
1440
|
data: zCreateEntityRequestData
|
|
1411
1441
|
}),
|
|
1412
|
-
[RequestType.EDIT_ENTITY]:
|
|
1413
|
-
type:
|
|
1442
|
+
[RequestType.EDIT_ENTITY]: z5.object({
|
|
1443
|
+
type: z5.literal(RequestType.EDIT_ENTITY),
|
|
1414
1444
|
data: zEditEntityRequestData
|
|
1415
1445
|
}),
|
|
1416
|
-
[RequestType.REVOKE_ENTITY]:
|
|
1417
|
-
type:
|
|
1418
|
-
data:
|
|
1446
|
+
[RequestType.REVOKE_ENTITY]: z5.object({
|
|
1447
|
+
type: z5.literal(RequestType.REVOKE_ENTITY),
|
|
1448
|
+
data: z5.object({})
|
|
1419
1449
|
}),
|
|
1420
1450
|
// Users
|
|
1421
|
-
[RequestType.CREATE_PSD_USER]:
|
|
1422
|
-
type:
|
|
1451
|
+
[RequestType.CREATE_PSD_USER]: z5.object({
|
|
1452
|
+
type: z5.literal(RequestType.CREATE_PSD_USER),
|
|
1423
1453
|
data: zCreatePsdUserRequestData
|
|
1424
1454
|
}),
|
|
1425
|
-
[RequestType.CREATE_API_USER]:
|
|
1426
|
-
type:
|
|
1455
|
+
[RequestType.CREATE_API_USER]: z5.object({
|
|
1456
|
+
type: z5.literal(RequestType.CREATE_API_USER),
|
|
1427
1457
|
data: zCreateApiUserRequestData
|
|
1428
1458
|
}),
|
|
1429
|
-
[RequestType.CREATE_API_USER_ACCESS]:
|
|
1430
|
-
type:
|
|
1459
|
+
[RequestType.CREATE_API_USER_ACCESS]: z5.object({
|
|
1460
|
+
type: z5.literal(RequestType.CREATE_API_USER_ACCESS),
|
|
1431
1461
|
data: zCreateApiUserAccessRequestData
|
|
1432
1462
|
}),
|
|
1433
|
-
[RequestType.REVOKE_USER]:
|
|
1434
|
-
type:
|
|
1435
|
-
data:
|
|
1463
|
+
[RequestType.REVOKE_USER]: z5.object({
|
|
1464
|
+
type: z5.literal(RequestType.REVOKE_USER),
|
|
1465
|
+
data: z5.object({})
|
|
1436
1466
|
}),
|
|
1437
1467
|
// Admin gov rules
|
|
1438
|
-
[RequestType.CREATE_WORKSPACE_RULE]:
|
|
1439
|
-
type:
|
|
1468
|
+
[RequestType.CREATE_WORKSPACE_RULE]: z5.object({
|
|
1469
|
+
type: z5.literal(RequestType.CREATE_WORKSPACE_RULE),
|
|
1440
1470
|
data: zWorkspaceRuleRequestData
|
|
1441
1471
|
}),
|
|
1442
|
-
[RequestType.EDIT_WORKSPACE_RULE]:
|
|
1443
|
-
type:
|
|
1472
|
+
[RequestType.EDIT_WORKSPACE_RULE]: z5.object({
|
|
1473
|
+
type: z5.literal(RequestType.EDIT_WORKSPACE_RULE),
|
|
1444
1474
|
data: zWorkspaceRuleRequestData
|
|
1445
1475
|
}),
|
|
1446
1476
|
// SCI configs
|
|
1447
|
-
[RequestType.CREATE_SCICONFIG]:
|
|
1448
|
-
type:
|
|
1477
|
+
[RequestType.CREATE_SCICONFIG]: z5.object({
|
|
1478
|
+
type: z5.literal(RequestType.CREATE_SCICONFIG),
|
|
1449
1479
|
data: zCreateSciConfigRequestData
|
|
1450
1480
|
}),
|
|
1451
|
-
[RequestType.EDIT_SCICONFIG]:
|
|
1452
|
-
type:
|
|
1481
|
+
[RequestType.EDIT_SCICONFIG]: z5.object({
|
|
1482
|
+
type: z5.literal(RequestType.EDIT_SCICONFIG),
|
|
1453
1483
|
data: zEditSciConfigRequestData
|
|
1454
1484
|
}),
|
|
1455
1485
|
// API keys
|
|
1456
|
-
[RequestType.CREATE_API_KEY]:
|
|
1457
|
-
type:
|
|
1486
|
+
[RequestType.CREATE_API_KEY]: z5.object({
|
|
1487
|
+
type: z5.literal(RequestType.CREATE_API_KEY),
|
|
1458
1488
|
data: zCreateApiKeyRequestData
|
|
1459
1489
|
}),
|
|
1460
|
-
[RequestType.EDIT_API_KEY]:
|
|
1461
|
-
type:
|
|
1490
|
+
[RequestType.EDIT_API_KEY]: z5.object({
|
|
1491
|
+
type: z5.literal(RequestType.EDIT_API_KEY),
|
|
1462
1492
|
data: zEditApiKeyRequestData
|
|
1463
1493
|
}),
|
|
1464
|
-
[RequestType.REVOKE_API_KEY]:
|
|
1465
|
-
type:
|
|
1466
|
-
data:
|
|
1494
|
+
[RequestType.REVOKE_API_KEY]: z5.object({
|
|
1495
|
+
type: z5.literal(RequestType.REVOKE_API_KEY),
|
|
1496
|
+
data: z5.object({})
|
|
1467
1497
|
}),
|
|
1468
1498
|
// Policies
|
|
1469
|
-
[RequestType.CREATE_POLICY]:
|
|
1470
|
-
type:
|
|
1471
|
-
data:
|
|
1499
|
+
[RequestType.CREATE_POLICY]: z5.object({
|
|
1500
|
+
type: z5.literal(RequestType.CREATE_POLICY),
|
|
1501
|
+
data: zCreatePublicPolicyRequestData
|
|
1472
1502
|
}),
|
|
1473
|
-
[RequestType.EDIT_POLICY]:
|
|
1474
|
-
type:
|
|
1475
|
-
targetId:
|
|
1476
|
-
data:
|
|
1503
|
+
[RequestType.EDIT_POLICY]: z5.object({
|
|
1504
|
+
type: z5.literal(RequestType.EDIT_POLICY),
|
|
1505
|
+
targetId: z5.string(),
|
|
1506
|
+
data: zEditPublicPolicyRequestData
|
|
1477
1507
|
}),
|
|
1478
1508
|
// Tradelink
|
|
1479
|
-
[RequestType.CREATE_TRADELINK_CUSTODIAN]:
|
|
1480
|
-
type:
|
|
1509
|
+
[RequestType.CREATE_TRADELINK_CUSTODIAN]: z5.object({
|
|
1510
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_CUSTODIAN),
|
|
1481
1511
|
data: zCustodianRequestData
|
|
1482
1512
|
}),
|
|
1483
|
-
[RequestType.EDIT_TRADELINK_CUSTODIAN]:
|
|
1484
|
-
type:
|
|
1485
|
-
targetId:
|
|
1513
|
+
[RequestType.EDIT_TRADELINK_CUSTODIAN]: z5.object({
|
|
1514
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_CUSTODIAN),
|
|
1515
|
+
targetId: z5.string(),
|
|
1486
1516
|
data: zCustodianRequestData
|
|
1487
1517
|
}),
|
|
1488
|
-
[RequestType.CREATE_TRADELINK_EXCHANGE]:
|
|
1489
|
-
type:
|
|
1518
|
+
[RequestType.CREATE_TRADELINK_EXCHANGE]: z5.object({
|
|
1519
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_EXCHANGE),
|
|
1490
1520
|
data: zTradelinkEntityRequestData
|
|
1491
1521
|
}),
|
|
1492
|
-
[RequestType.EDIT_TRADELINK_EXCHANGE]:
|
|
1493
|
-
type:
|
|
1494
|
-
targetId:
|
|
1522
|
+
[RequestType.EDIT_TRADELINK_EXCHANGE]: z5.object({
|
|
1523
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_EXCHANGE),
|
|
1524
|
+
targetId: z5.string(),
|
|
1495
1525
|
data: zTradelinkEntityRequestData
|
|
1496
1526
|
}),
|
|
1497
|
-
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]:
|
|
1498
|
-
type:
|
|
1527
|
+
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]: z5.object({
|
|
1528
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_ASSET_MANAGER),
|
|
1499
1529
|
data: zTradelinkEntityRequestData
|
|
1500
1530
|
}),
|
|
1501
|
-
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]:
|
|
1502
|
-
type:
|
|
1503
|
-
targetId:
|
|
1531
|
+
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]: z5.object({
|
|
1532
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_ASSET_MANAGER),
|
|
1533
|
+
targetId: z5.string(),
|
|
1504
1534
|
data: zTradelinkEntityRequestData
|
|
1505
1535
|
}),
|
|
1506
|
-
[RequestType.ADJUST_PLEDGE]:
|
|
1507
|
-
type:
|
|
1536
|
+
[RequestType.ADJUST_PLEDGE]: z5.object({
|
|
1537
|
+
type: z5.literal(RequestType.ADJUST_PLEDGE),
|
|
1508
1538
|
data: zAdjustPledgeRequestData
|
|
1509
1539
|
}),
|
|
1510
|
-
[RequestType.TRADELINK_REPLEDGE]:
|
|
1511
|
-
type:
|
|
1540
|
+
[RequestType.TRADELINK_REPLEDGE]: z5.object({
|
|
1541
|
+
type: z5.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1512
1542
|
data: zRepledgeRequestData
|
|
1513
1543
|
}),
|
|
1514
|
-
[RequestType.CREATE_SETTLEMENT]:
|
|
1515
|
-
type:
|
|
1544
|
+
[RequestType.CREATE_SETTLEMENT]: z5.object({
|
|
1545
|
+
type: z5.literal(RequestType.CREATE_SETTLEMENT),
|
|
1516
1546
|
data: zCreateSettlementRequestData,
|
|
1517
|
-
meta:
|
|
1518
|
-
hash:
|
|
1547
|
+
meta: z5.object({
|
|
1548
|
+
hash: z5.string().nullable()
|
|
1519
1549
|
}).optional().nullable()
|
|
1520
1550
|
}),
|
|
1521
|
-
[RequestType.FORCE_UNPLEDGE]:
|
|
1522
|
-
type:
|
|
1551
|
+
[RequestType.FORCE_UNPLEDGE]: z5.object({
|
|
1552
|
+
type: z5.literal(RequestType.FORCE_UNPLEDGE),
|
|
1523
1553
|
data: zForceUnpledgeRequestData
|
|
1524
1554
|
}),
|
|
1525
|
-
[RequestType.TRADELINK_WITHDRAW]:
|
|
1526
|
-
type:
|
|
1555
|
+
[RequestType.TRADELINK_WITHDRAW]: z5.object({
|
|
1556
|
+
type: z5.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1527
1557
|
data: zTradelinkWithdrawRequestData,
|
|
1528
|
-
meta:
|
|
1529
|
-
hash:
|
|
1558
|
+
meta: z5.object({
|
|
1559
|
+
hash: z5.string().nullable()
|
|
1530
1560
|
}).optional().nullable()
|
|
1531
1561
|
}),
|
|
1532
|
-
[RequestType.TRADELINK_ARBITRATE]:
|
|
1533
|
-
type:
|
|
1562
|
+
[RequestType.TRADELINK_ARBITRATE]: z5.object({
|
|
1563
|
+
type: z5.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1534
1564
|
data: zTradelinkArbitrationRequestData,
|
|
1535
|
-
meta:
|
|
1536
|
-
hash:
|
|
1565
|
+
meta: z5.object({
|
|
1566
|
+
hash: z5.string().nullable()
|
|
1537
1567
|
}).optional().nullable()
|
|
1538
|
-
}),
|
|
1539
|
-
// Deprecate ADMIN_GOV_RULE
|
|
1540
|
-
[RequestType.CREATE_ADMIN_GOV_RULE]: z32.object({
|
|
1541
|
-
type: z32.literal(RequestType.CREATE_ADMIN_GOV_RULE),
|
|
1542
|
-
data: z32.object({}).describe("Deprecated")
|
|
1543
|
-
}),
|
|
1544
|
-
[RequestType.EDIT_ADMIN_GOV_RULE]: z32.object({
|
|
1545
|
-
type: z32.literal(RequestType.EDIT_ADMIN_GOV_RULE),
|
|
1546
|
-
data: z32.object({}).describe("Deprecated")
|
|
1547
1568
|
})
|
|
1548
1569
|
};
|
|
1549
1570
|
|
|
1550
1571
|
// src/requests/app-types.ts
|
|
1551
|
-
var zRequestReviewResponse =
|
|
1572
|
+
var zRequestReviewResponse = z5.object({
|
|
1552
1573
|
// Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
|
|
1553
|
-
stepIndex:
|
|
1554
|
-
userId:
|
|
1555
|
-
status:
|
|
1556
|
-
createdAt:
|
|
1557
|
-
updatedAt:
|
|
1558
|
-
});
|
|
1559
|
-
var zVaultRequestCommonMixin =
|
|
1560
|
-
id:
|
|
1561
|
-
legacyId:
|
|
1562
|
-
state:
|
|
1574
|
+
stepIndex: z5.number().int().describe("Index of the governance step in the request workflow"),
|
|
1575
|
+
userId: z5.string().describe("Reviewer id"),
|
|
1576
|
+
status: z5.nativeEnum(RequestReviewStatus).describe("Review status"),
|
|
1577
|
+
createdAt: z5.coerce.date().describe("Created date"),
|
|
1578
|
+
updatedAt: z5.coerce.date().describe("Updated date")
|
|
1579
|
+
});
|
|
1580
|
+
var zVaultRequestCommonMixin = z5.object({
|
|
1581
|
+
id: z5.string().describe("Request unique identifier"),
|
|
1582
|
+
legacyId: z5.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1583
|
+
state: z5.nativeEnum(RequestState).describe("Request state"),
|
|
1563
1584
|
reviewSteps: zRequestReviewSteps.describe("Request review steps"),
|
|
1564
|
-
currentStepIndex:
|
|
1565
|
-
expiredAt:
|
|
1566
|
-
targetId:
|
|
1585
|
+
currentStepIndex: z5.number().int().min(0).describe("Index of the current approval step"),
|
|
1586
|
+
expiredAt: z5.coerce.date().nullable().describe("Optional expiration date"),
|
|
1587
|
+
targetId: z5.string().nullable().describe("Optional ID of the target object"),
|
|
1567
1588
|
note: zNote.nullable().describe("Optional request note"),
|
|
1568
|
-
reviews:
|
|
1589
|
+
reviews: z5.array(zRequestReviewResponse).describe("Requests reviews"),
|
|
1569
1590
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
1570
|
-
createdAt:
|
|
1571
|
-
updatedAt:
|
|
1591
|
+
createdAt: z5.coerce.date().describe("Creation timestamp"),
|
|
1592
|
+
updatedAt: z5.coerce.date().describe("Last modification timestamp"),
|
|
1572
1593
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
1573
|
-
inflight:
|
|
1574
|
-
lastError:
|
|
1575
|
-
numFailed:
|
|
1576
|
-
retryAfter:
|
|
1594
|
+
inflight: z5.object({
|
|
1595
|
+
lastError: z5.string().describe("Error message from the last failure"),
|
|
1596
|
+
numFailed: z5.number().int().describe("Number of failures so far"),
|
|
1597
|
+
retryAfter: z5.coerce.date().describe("Date after which next retry is scheduled")
|
|
1577
1598
|
}).optional().describe("Extra information if the request is currently being processed")
|
|
1578
1599
|
});
|
|
1579
1600
|
var allowedRequestCreationInput = {
|
|
1601
|
+
[RequestType.UPDATE_QUORUM]: zVaultRequestMixinsByType[RequestType.UPDATE_QUORUM],
|
|
1580
1602
|
[RequestType.CREATE_PSD_USER]: zVaultRequestMixinsByType[RequestType.CREATE_PSD_USER],
|
|
1581
1603
|
[RequestType.CREATE_API_USER]: zVaultRequestMixinsByType[RequestType.CREATE_API_USER],
|
|
1582
1604
|
[RequestType.CREATE_GROUP]: zVaultRequestMixinsByType[RequestType.CREATE_GROUP],
|
|
@@ -1586,8 +1608,8 @@ var allowedRequestCreationInput = {
|
|
|
1586
1608
|
[RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
|
|
1587
1609
|
[RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
|
|
1588
1610
|
[RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
|
|
1589
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1590
|
-
type:
|
|
1611
|
+
[RequestType.CREATE_ACCOUNT]: z5.object({
|
|
1612
|
+
type: z5.literal(RequestType.CREATE_ACCOUNT),
|
|
1591
1613
|
data: zCreateAccountUserInputData
|
|
1592
1614
|
}),
|
|
1593
1615
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
@@ -1605,8 +1627,8 @@ var allowedRequestCreationInput = {
|
|
|
1605
1627
|
[RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
|
|
1606
1628
|
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE]
|
|
1607
1629
|
};
|
|
1608
|
-
|
|
1609
|
-
request:
|
|
1630
|
+
z5.object({
|
|
1631
|
+
request: z5.discriminatedUnion(
|
|
1610
1632
|
"type",
|
|
1611
1633
|
ensureNonEmptyArray(
|
|
1612
1634
|
Object.values(allowedRequestCreationInput).map((_) => {
|
|
@@ -1616,7 +1638,7 @@ z32.object({
|
|
|
1616
1638
|
)
|
|
1617
1639
|
)
|
|
1618
1640
|
});
|
|
1619
|
-
var zVaultRequestResponse =
|
|
1641
|
+
var zVaultRequestResponse = z5.discriminatedUnion(
|
|
1620
1642
|
"type",
|
|
1621
1643
|
ensureNonEmptyArray(
|
|
1622
1644
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
@@ -1625,14 +1647,14 @@ var zVaultRequestResponse = z32.discriminatedUnion(
|
|
|
1625
1647
|
})
|
|
1626
1648
|
)
|
|
1627
1649
|
);
|
|
1628
|
-
|
|
1650
|
+
z5.enum([
|
|
1629
1651
|
"state",
|
|
1630
1652
|
"expiredAt",
|
|
1631
1653
|
"createdAt",
|
|
1632
1654
|
"updatedAt"
|
|
1633
1655
|
]).default("createdAt");
|
|
1634
|
-
|
|
1635
|
-
pubKey:
|
|
1656
|
+
z5.object({
|
|
1657
|
+
pubKey: z5.string().describe("Public key of the current user"),
|
|
1636
1658
|
challenge: zUserChallenge.describe("Challenge data to sign with the user's private key")
|
|
1637
1659
|
});
|
|
1638
1660
|
var shouldHaveTargetHsmId = (request) => {
|
|
@@ -1647,13 +1669,13 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1647
1669
|
case RequestType.REVOKE_API_KEY:
|
|
1648
1670
|
case RequestType.CREATE_WORKSPACE_RULE:
|
|
1649
1671
|
case RequestType.EDIT_WORKSPACE_RULE:
|
|
1672
|
+
case RequestType.UPDATE_QUORUM:
|
|
1650
1673
|
return false;
|
|
1651
1674
|
case RequestType.CREATE_PSD_USER:
|
|
1652
1675
|
case RequestType.CREATE_API_USER:
|
|
1653
1676
|
case RequestType.CREATE_API_USER_ACCESS:
|
|
1654
1677
|
// targeting / editing an existing `User`
|
|
1655
1678
|
case RequestType.REVOKE_USER:
|
|
1656
|
-
case RequestType.UPDATE_QUORUM:
|
|
1657
1679
|
case RequestType.CREATE_TRANSACTION:
|
|
1658
1680
|
case RequestType.SIGN_MESSAGE:
|
|
1659
1681
|
case RequestType.SIGN_DIGESTS:
|
|
@@ -1676,10 +1698,6 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1676
1698
|
return request.state !== RequestState.INITIAL;
|
|
1677
1699
|
case RequestType.EDIT_TOKEN_RULE:
|
|
1678
1700
|
return true;
|
|
1679
|
-
/* v8 ignore start */
|
|
1680
|
-
case RequestType.CREATE_ADMIN_GOV_RULE:
|
|
1681
|
-
case RequestType.EDIT_ADMIN_GOV_RULE:
|
|
1682
|
-
throw new Error(`RequestType ${request.type} is deprecated`);
|
|
1683
1701
|
}
|
|
1684
1702
|
};
|
|
1685
1703
|
var shouldHaveTargetId = (request) => {
|
|
@@ -1692,6 +1710,7 @@ var shouldHaveTargetId = (request) => {
|
|
|
1692
1710
|
case RequestType.SIGN_MESSAGE:
|
|
1693
1711
|
case RequestType.SIGN_DIGESTS:
|
|
1694
1712
|
return false;
|
|
1713
|
+
case RequestType.UPDATE_QUORUM:
|
|
1695
1714
|
case RequestType.CREATE_PSD_USER:
|
|
1696
1715
|
case RequestType.CREATE_API_USER:
|
|
1697
1716
|
case RequestType.CREATE_WORKSPACE_RULE:
|
|
@@ -1705,7 +1724,6 @@ var shouldHaveTargetId = (request) => {
|
|
|
1705
1724
|
case RequestType.CREATE_TRADELINK_EXCHANGE:
|
|
1706
1725
|
case RequestType.CREATE_TRADELINK_ASSET_MANAGER:
|
|
1707
1726
|
return request.state === RequestState.EXECUTED;
|
|
1708
|
-
case RequestType.UPDATE_QUORUM:
|
|
1709
1727
|
case RequestType.EDIT_WORKSPACE_RULE:
|
|
1710
1728
|
case RequestType.EDIT_ACCOUNT:
|
|
1711
1729
|
case RequestType.ACTIVATE_TRADELINK_ACCOUNT:
|
|
@@ -1730,10 +1748,6 @@ var shouldHaveTargetId = (request) => {
|
|
|
1730
1748
|
case RequestType.TRADELINK_WITHDRAW:
|
|
1731
1749
|
case RequestType.TRADELINK_ARBITRATE:
|
|
1732
1750
|
return true;
|
|
1733
|
-
/* v8 ignore start */
|
|
1734
|
-
case RequestType.CREATE_ADMIN_GOV_RULE:
|
|
1735
|
-
case RequestType.EDIT_ADMIN_GOV_RULE:
|
|
1736
|
-
throw new Error(`RequestType ${request.type} is deprecated`);
|
|
1737
1751
|
}
|
|
1738
1752
|
};
|
|
1739
1753
|
|
|
@@ -1909,6 +1923,17 @@ var genAssetFieldsForType = (type) => {
|
|
|
1909
1923
|
hsmXpub,
|
|
1910
1924
|
hsmChainCode
|
|
1911
1925
|
};
|
|
1926
|
+
case "RAW_SIGNING":
|
|
1927
|
+
return {
|
|
1928
|
+
type,
|
|
1929
|
+
currency: faker.helpers.arrayElement(["ethereum", "bitcoin"]),
|
|
1930
|
+
derivationPath: "44'/118'/0'",
|
|
1931
|
+
address: null,
|
|
1932
|
+
contractAddress: null,
|
|
1933
|
+
xpub: null,
|
|
1934
|
+
hsmXpub,
|
|
1935
|
+
hsmChainCode
|
|
1936
|
+
};
|
|
1912
1937
|
}
|
|
1913
1938
|
};
|
|
1914
1939
|
var genGovernanceFieldsForType = (governanceType, {
|
|
@@ -1918,6 +1943,7 @@ var genGovernanceFieldsForType = (governanceType, {
|
|
|
1918
1943
|
}) => {
|
|
1919
1944
|
switch (governanceType) {
|
|
1920
1945
|
case AccountGovernanceType.CLASSIC:
|
|
1946
|
+
case AccountGovernanceType.RAW_SIGNING:
|
|
1921
1947
|
return {
|
|
1922
1948
|
governanceType,
|
|
1923
1949
|
classicGovernanceMixin: {
|
|
@@ -2064,6 +2090,7 @@ var stakingFieldsByAccountType = {
|
|
|
2064
2090
|
}
|
|
2065
2091
|
}),
|
|
2066
2092
|
GENERIC_LIKE: () => null,
|
|
2093
|
+
RAW_SIGNING: () => null,
|
|
2067
2094
|
POLKADOT_LIKE: () => ({
|
|
2068
2095
|
type: "POLKADOT_LIKE",
|
|
2069
2096
|
staking: {
|