@ledgerhq/revault-api 1.28.0 → 1.29.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-DRwjhbZ9.d.mts → app-types-mEeONvZb.d.mts} +3767 -3367
- package/lib/fakes.d.mts +3090 -2906
- package/lib/fakes.mjs +596 -570
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +948 -759
- 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",
|
|
@@ -953,45 +965,45 @@ z32.object({
|
|
|
953
965
|
"FAILED"
|
|
954
966
|
]),
|
|
955
967
|
// For now we only consider the outbound settlement
|
|
956
|
-
outboundTransactionHash:
|
|
968
|
+
outboundTransactionHash: z5.string().nullable()
|
|
957
969
|
});
|
|
958
970
|
|
|
959
971
|
// src/tradelink/request-data.ts
|
|
960
|
-
var zCustodianRequestData =
|
|
972
|
+
var zCustodianRequestData = z5.object({
|
|
961
973
|
settlement: zReviewStepWithUsersArray.describe("List of settlement review steps"),
|
|
962
974
|
withdraw: zReviewStepWithUsersArray.describe("List of withdraw review steps"),
|
|
963
975
|
arbitration: zReviewStepWithUsersArray.describe("List of arbitration review steps")
|
|
964
976
|
});
|
|
965
|
-
var zTradelinkEntityRequestData =
|
|
966
|
-
tradelinkId:
|
|
977
|
+
var zTradelinkEntityRequestData = z5.object({
|
|
978
|
+
tradelinkId: z5.string().min(1),
|
|
967
979
|
groups: zReviewStepWithUsersArray.describe("List of asset manager review groups"),
|
|
968
|
-
whitelist:
|
|
980
|
+
whitelist: z5.array(zTradelinkWhitelistAddress).describe("List of asset manager whitelisted addresses")
|
|
969
981
|
});
|
|
970
|
-
var zAdjustPledgeRequestData =
|
|
971
|
-
accountId:
|
|
972
|
-
exchangeId:
|
|
982
|
+
var zAdjustPledgeRequestData = z5.object({
|
|
983
|
+
accountId: z5.string().describe("Account id"),
|
|
984
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
973
985
|
amount: zIntString.describe("Amount to add to pledge")
|
|
974
986
|
});
|
|
975
|
-
var zRepledgeRequestData =
|
|
976
|
-
accountId:
|
|
977
|
-
exchangeId:
|
|
987
|
+
var zRepledgeRequestData = z5.object({
|
|
988
|
+
accountId: z5.string().describe("Account id"),
|
|
989
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
978
990
|
amount: zIntString.describe("Amount to add to pledge")
|
|
979
991
|
});
|
|
980
|
-
var zCreateSettlementRequestData =
|
|
981
|
-
accountId:
|
|
982
|
-
exchangeId:
|
|
992
|
+
var zCreateSettlementRequestData = z5.object({
|
|
993
|
+
accountId: z5.string().describe("Account id"),
|
|
994
|
+
exchangeId: z5.string().describe("Exchange id"),
|
|
983
995
|
transaction: zSendOnlyTransactionData
|
|
984
996
|
});
|
|
985
|
-
var zForceUnpledgeRequestData =
|
|
986
|
-
accountId:
|
|
987
|
-
exchangeId:
|
|
997
|
+
var zForceUnpledgeRequestData = z5.object({
|
|
998
|
+
accountId: z5.string().describe("Account id"),
|
|
999
|
+
exchangeId: z5.string().describe("Exchange id")
|
|
988
1000
|
});
|
|
989
|
-
var zTradelinkWithdrawRequestData =
|
|
990
|
-
accountId:
|
|
1001
|
+
var zTradelinkWithdrawRequestData = z5.object({
|
|
1002
|
+
accountId: z5.string().describe("Account id"),
|
|
991
1003
|
transaction: zSendOnlyTransactionData
|
|
992
1004
|
});
|
|
993
|
-
var zTradelinkArbitrationRequestData =
|
|
994
|
-
accountId:
|
|
1005
|
+
var zTradelinkArbitrationRequestData = z5.object({
|
|
1006
|
+
accountId: z5.string().describe("Account id"),
|
|
995
1007
|
transaction: zSendOnlyTransactionData
|
|
996
1008
|
});
|
|
997
1009
|
|
|
@@ -1008,27 +1020,27 @@ var zTradelinkAccountGovernanceFields = z.object({
|
|
|
1008
1020
|
var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).describe("Governance fields");
|
|
1009
1021
|
|
|
1010
1022
|
// src/accounts/types.ts
|
|
1011
|
-
var zAccountCommonFields =
|
|
1012
|
-
id:
|
|
1013
|
-
legacyId:
|
|
1014
|
-
name:
|
|
1023
|
+
var zAccountCommonFields = z5.object({
|
|
1024
|
+
id: z5.string().describe("Internal unique identifier"),
|
|
1025
|
+
legacyId: z5.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1026
|
+
name: z5.string().describe("Name"),
|
|
1015
1027
|
currency: zCurrency,
|
|
1016
|
-
index:
|
|
1017
|
-
derivationPath:
|
|
1018
|
-
status:
|
|
1019
|
-
createdAt:
|
|
1020
|
-
updatedAt:
|
|
1021
|
-
});
|
|
1022
|
-
var zAccountBalanceFields =
|
|
1023
|
-
total:
|
|
1024
|
-
pending:
|
|
1028
|
+
index: z5.number().gte(0).describe("BIP44 account index"),
|
|
1029
|
+
derivationPath: z5.string().describe("Derivation path"),
|
|
1030
|
+
status: z5.nativeEnum(ActivationStatus).describe("Status"),
|
|
1031
|
+
createdAt: z5.coerce.date().describe("Creation timestamp"),
|
|
1032
|
+
updatedAt: z5.coerce.date().describe("Last modification timestamp")
|
|
1033
|
+
});
|
|
1034
|
+
var zAccountBalanceFields = z5.object({
|
|
1035
|
+
total: z5.string().describe("Total balance"),
|
|
1036
|
+
pending: z5.string().describe("Pending balance")
|
|
1025
1037
|
}).describe("Balance fields");
|
|
1026
1038
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1027
1039
|
balance: zAccountBalanceFields.optional(),
|
|
1028
1040
|
asset: zAccountAssetFields,
|
|
1029
1041
|
governance: zAccountGovernanceFields
|
|
1030
1042
|
});
|
|
1031
|
-
|
|
1043
|
+
z5.enum([
|
|
1032
1044
|
"name",
|
|
1033
1045
|
"currency",
|
|
1034
1046
|
"index",
|
|
@@ -1037,128 +1049,146 @@ z32.enum([
|
|
|
1037
1049
|
]).default("createdAt");
|
|
1038
1050
|
|
|
1039
1051
|
// src/accounts/app-types.ts
|
|
1040
|
-
var zNote2 =
|
|
1041
|
-
title:
|
|
1042
|
-
content:
|
|
1052
|
+
var zNote2 = z5.object({
|
|
1053
|
+
title: z5.string().describe("Transaction note title"),
|
|
1054
|
+
content: z5.string().describe("Transaction note content")
|
|
1043
1055
|
}).describe("Optional transaction note");
|
|
1044
|
-
|
|
1056
|
+
z5.discriminatedUnion(
|
|
1045
1057
|
zTransactionResponse.discriminator,
|
|
1046
1058
|
ensureNonEmptyArray(
|
|
1047
1059
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote2.nullable() }))
|
|
1048
1060
|
)
|
|
1049
1061
|
);
|
|
1050
|
-
var zWhitelistAddress =
|
|
1051
|
-
name:
|
|
1062
|
+
var zWhitelistAddress = z5.object({
|
|
1063
|
+
name: z5.string().min(1).max(50),
|
|
1052
1064
|
currency: zCurrency,
|
|
1053
|
-
address:
|
|
1065
|
+
address: z5.string().min(1).max(200),
|
|
1054
1066
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1055
1067
|
// Empty array (or undefined) means no check on destination tag.
|
|
1056
|
-
destinationTags:
|
|
1068
|
+
destinationTags: z5.array(z5.string().min(1).regex(/^\w+$/)).optional()
|
|
1057
1069
|
});
|
|
1058
|
-
var zWhitelistAddresses =
|
|
1059
|
-
var zWhitelistName =
|
|
1060
|
-
var zCreateWhitelistRequestData =
|
|
1070
|
+
var zWhitelistAddresses = z5.array(zWhitelistAddress);
|
|
1071
|
+
var zWhitelistName = z5.string().min(1).max(45).describe("Whitelist name");
|
|
1072
|
+
var zCreateWhitelistRequestData = z5.object({
|
|
1061
1073
|
name: zWhitelistName,
|
|
1062
|
-
description:
|
|
1074
|
+
description: z5.string().nullable(),
|
|
1063
1075
|
addresses: zWhitelistAddresses,
|
|
1064
|
-
type:
|
|
1076
|
+
type: z5.nativeEnum(WhitelistType)
|
|
1065
1077
|
});
|
|
1066
|
-
var zEditWhitelistRequestData =
|
|
1078
|
+
var zEditWhitelistRequestData = z5.object({
|
|
1067
1079
|
name: zWhitelistName,
|
|
1068
1080
|
addresses: zWhitelistAddresses
|
|
1069
1081
|
});
|
|
1070
1082
|
|
|
1071
1083
|
// src/policies/db-utils.ts
|
|
1072
|
-
var zThreshold =
|
|
1084
|
+
var zThreshold = z5.object({
|
|
1073
1085
|
min: zUnsignedIntString.nullable().describe("Minimum transaction amount"),
|
|
1074
1086
|
max: zUnsignedIntString.nullable().describe("Maximum transaction amount")
|
|
1075
1087
|
}).describe("Threshold for the transaction value");
|
|
1076
|
-
var zWhitelistIds =
|
|
1077
|
-
var zGovRuleJsonObject =
|
|
1088
|
+
var zWhitelistIds = z5.array(z5.string().min(1)).describe("IDs of whitelists for the recipient address");
|
|
1089
|
+
var zGovRuleJsonObject = z5.object({
|
|
1078
1090
|
// Required.
|
|
1079
1091
|
operationType: zOperationType.describe("Allowed operation type"),
|
|
1080
1092
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
1081
1093
|
threshold: zThreshold,
|
|
1082
1094
|
// Optional whitelist on transaction recipient: Empty list means no whitelist.
|
|
1083
1095
|
whitelistIds: zWhitelistIds,
|
|
1084
|
-
reviewConfigId:
|
|
1096
|
+
reviewConfigId: z5.string().min(1).describe("Id of ReviewConfig"),
|
|
1085
1097
|
// HSM id for the rule
|
|
1086
1098
|
hsmId: zHsmObjectId
|
|
1087
1099
|
}).describe("INTERNAL: Governance rule JSON representation in DB");
|
|
1088
|
-
|
|
1089
|
-
var
|
|
1090
|
-
|
|
1100
|
+
z5.array(zGovRuleJsonObject);
|
|
1101
|
+
var zBaseGovRuleData = z5.object({
|
|
1102
|
+
// Steps of users that will need to review operations
|
|
1103
|
+
reviewSteps: zReviewStepsArray,
|
|
1091
1104
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
1092
1105
|
threshold: zThreshold.optional(),
|
|
1093
1106
|
// Optional whitelist on transaction recipient: Empty list means no whitelist.
|
|
1094
|
-
whitelistIds: zWhitelistIds.optional()
|
|
1095
|
-
|
|
1107
|
+
whitelistIds: zWhitelistIds.optional()
|
|
1108
|
+
});
|
|
1109
|
+
var zClassicGovRuleData = zBaseGovRuleData.extend({
|
|
1110
|
+
operationType: zClassicOperationType.describe("Allowed operation type")
|
|
1096
1111
|
}).describe("Account governance rule");
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
var
|
|
1112
|
+
zBaseGovRuleData.extend({
|
|
1113
|
+
operationType: zOperationType.describe("Allowed operation type")
|
|
1114
|
+
}).describe("Governance rule");
|
|
1115
|
+
var zPolicyName = z5.string().min(1).max(19).describe("Policy name");
|
|
1116
|
+
var zCurrency2 = z5.string().min(1).max(40).regex(/^\w+$/).describe("Currency");
|
|
1117
|
+
var zCreatePublicPolicyRequestData = z5.object({
|
|
1101
1118
|
name: zPolicyName,
|
|
1102
|
-
description:
|
|
1119
|
+
description: z5.string().nullable().describe("Description"),
|
|
1103
1120
|
currency: zCurrency2.nullable(),
|
|
1104
|
-
govRules:
|
|
1121
|
+
govRules: z5.array(zClassicGovRuleData).describe("Governance rules")
|
|
1105
1122
|
});
|
|
1106
|
-
var
|
|
1123
|
+
var zEditPublicPolicyRequestData = z5.object({
|
|
1107
1124
|
name: zPolicyName,
|
|
1108
|
-
description:
|
|
1109
|
-
govRules:
|
|
1125
|
+
description: z5.string().nullable().describe("Description"),
|
|
1126
|
+
govRules: z5.array(zClassicGovRuleData).describe("Governance rules")
|
|
1110
1127
|
});
|
|
1111
1128
|
|
|
1112
1129
|
// src/accounts/request-data.ts
|
|
1113
|
-
var zAccountName =
|
|
1114
|
-
var
|
|
1115
|
-
|
|
1116
|
-
|
|
1130
|
+
var zAccountName = z5.string().min(1).max(40).describe("Account name");
|
|
1131
|
+
var zSignDigestsGovRuleData = z5.object({
|
|
1132
|
+
operationType: z5.literal("SIGN_DIGESTS"),
|
|
1133
|
+
reviewSteps: zReviewStepWithUsersArray
|
|
1134
|
+
// we need to control for API users only
|
|
1135
|
+
}).describe("Digest signing rule");
|
|
1136
|
+
var zAccountPolicyRequestData = z5.union([
|
|
1137
|
+
z5.object({ policyId: z5.string() }).describe("Account policy"),
|
|
1138
|
+
z5.object({ rules: z5.array(zClassicGovRuleData) }).describe("Account governance rules")
|
|
1117
1139
|
]).describe("Account policy or governance rules");
|
|
1118
|
-
var zCreateAccountGovernanceData =
|
|
1119
|
-
|
|
1120
|
-
type:
|
|
1140
|
+
var zCreateAccountGovernanceData = z5.discriminatedUnion("type", [
|
|
1141
|
+
z5.object({
|
|
1142
|
+
type: z5.literal(AccountGovernanceType.CLASSIC),
|
|
1121
1143
|
policy: zAccountPolicyRequestData
|
|
1122
1144
|
}),
|
|
1123
|
-
|
|
1124
|
-
type:
|
|
1125
|
-
assetManagerId:
|
|
1145
|
+
z5.object({
|
|
1146
|
+
type: z5.literal(AccountGovernanceType.TRADELINK),
|
|
1147
|
+
assetManagerId: z5.string(),
|
|
1126
1148
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1149
|
+
}),
|
|
1150
|
+
z5.object({
|
|
1151
|
+
type: z5.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1152
|
+
policy: z5.object({ rules: z5.array(zSignDigestsGovRuleData) })
|
|
1127
1153
|
})
|
|
1128
1154
|
]);
|
|
1129
|
-
var zCreateAccountUserInputData =
|
|
1155
|
+
var zCreateAccountUserInputData = z5.object({
|
|
1130
1156
|
name: zAccountName,
|
|
1131
|
-
type: z32.nativeEnum(AccountType),
|
|
1132
|
-
// "BITCOIN_LIKE"
|
|
1133
1157
|
currency: zCurrency,
|
|
1134
1158
|
// "bitcoin"
|
|
1135
|
-
index:
|
|
1136
|
-
contractAddress:
|
|
1159
|
+
index: z5.number().nonnegative().optional().describe("Account index"),
|
|
1160
|
+
contractAddress: z5.string().min(1).optional().describe("Account contract address"),
|
|
1137
1161
|
governance: zCreateAccountGovernanceData
|
|
1138
1162
|
});
|
|
1139
1163
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
1140
|
-
index:
|
|
1141
|
-
derivationPath:
|
|
1164
|
+
index: z5.number().nonnegative().describe("Account index"),
|
|
1165
|
+
derivationPath: z5.string().describe("Account bip44 derivation path"),
|
|
1166
|
+
type: z5.nativeEnum(AccountType)
|
|
1167
|
+
// "BITCOIN_LIKE"
|
|
1142
1168
|
});
|
|
1143
|
-
var zEditAccountGovernanceData =
|
|
1144
|
-
|
|
1145
|
-
type:
|
|
1169
|
+
var zEditAccountGovernanceData = z5.discriminatedUnion("type", [
|
|
1170
|
+
z5.object({
|
|
1171
|
+
type: z5.literal(AccountGovernanceType.CLASSIC),
|
|
1146
1172
|
policy: zAccountPolicyRequestData
|
|
1147
1173
|
}),
|
|
1148
|
-
|
|
1149
|
-
type:
|
|
1174
|
+
z5.object({
|
|
1175
|
+
type: z5.literal(AccountGovernanceType.TRADELINK),
|
|
1150
1176
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1177
|
+
}),
|
|
1178
|
+
z5.object({
|
|
1179
|
+
type: z5.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1180
|
+
policy: z5.object({ rules: z5.array(zSignDigestsGovRuleData) })
|
|
1151
1181
|
})
|
|
1152
1182
|
]);
|
|
1153
|
-
var zEditAccountRequestData =
|
|
1183
|
+
var zEditAccountRequestData = z5.object({
|
|
1154
1184
|
name: zAccountName,
|
|
1155
1185
|
governance: zEditAccountGovernanceData
|
|
1156
1186
|
});
|
|
1157
|
-
var zActivateAccountRequestData =
|
|
1158
|
-
var zEditTokenRuleRequestData =
|
|
1159
|
-
parentAccountId:
|
|
1160
|
-
contractAddress:
|
|
1161
|
-
rules:
|
|
1187
|
+
var zActivateAccountRequestData = z5.object({});
|
|
1188
|
+
var zEditTokenRuleRequestData = z5.object({
|
|
1189
|
+
parentAccountId: z5.string().min(1).describe("Parent account unique ID"),
|
|
1190
|
+
contractAddress: z5.string().min(1).describe("Token contract address"),
|
|
1191
|
+
rules: z5.array(zClassicGovRuleData).describe("Account governance rules")
|
|
1162
1192
|
});
|
|
1163
1193
|
|
|
1164
1194
|
// src/accounts/app-utils.ts
|
|
@@ -1214,6 +1244,7 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1214
1244
|
address: account.address
|
|
1215
1245
|
};
|
|
1216
1246
|
case AccountType.GENERIC_LIKE:
|
|
1247
|
+
case AccountType.RAW_SIGNING:
|
|
1217
1248
|
return {
|
|
1218
1249
|
type: account.type
|
|
1219
1250
|
};
|
|
@@ -1225,6 +1256,7 @@ var getAccountAssetStaticFields = (account) => {
|
|
|
1225
1256
|
var getAccountGovernanceFields = (account) => {
|
|
1226
1257
|
switch (account.governanceType) {
|
|
1227
1258
|
case AccountGovernanceType.CLASSIC:
|
|
1259
|
+
case AccountGovernanceType.RAW_SIGNING:
|
|
1228
1260
|
return {
|
|
1229
1261
|
type: AccountGovernanceType.CLASSIC,
|
|
1230
1262
|
policyId: account.classicGovernanceMixin.policyId
|
|
@@ -1253,15 +1285,15 @@ var serializeAccount = (account) => {
|
|
|
1253
1285
|
};
|
|
1254
1286
|
return zAccountResponse.parse(response);
|
|
1255
1287
|
};
|
|
1256
|
-
var zSciConfigData =
|
|
1257
|
-
dapps:
|
|
1258
|
-
customContractCallEnabled:
|
|
1288
|
+
var zSciConfigData = z5.object({
|
|
1289
|
+
dapps: z5.array(z5.string()).nullable().describe("Allowed DApps, null allows all"),
|
|
1290
|
+
customContractCallEnabled: z5.boolean().describe("Allow non-DApp SCI")
|
|
1259
1291
|
});
|
|
1260
|
-
var zCreateSciConfigRequestData =
|
|
1261
|
-
account:
|
|
1292
|
+
var zCreateSciConfigRequestData = z5.object({
|
|
1293
|
+
account: z5.string().describe("Account UUID"),
|
|
1262
1294
|
config: zSciConfigData
|
|
1263
1295
|
});
|
|
1264
|
-
var zEditSciConfigRequestData =
|
|
1296
|
+
var zEditSciConfigRequestData = z5.object({
|
|
1265
1297
|
config: zSciConfigData
|
|
1266
1298
|
});
|
|
1267
1299
|
var zRequestReviewStep = z.object({
|
|
@@ -1284,299 +1316,288 @@ zUserRegistrationCreateInput.extend({
|
|
|
1284
1316
|
});
|
|
1285
1317
|
|
|
1286
1318
|
// src/users/request-data.ts
|
|
1287
|
-
var zCreatePsdUserRequestData =
|
|
1288
|
-
registrationId:
|
|
1319
|
+
var zCreatePsdUserRequestData = z5.object({
|
|
1320
|
+
registrationId: z5.string().describe("User registration ID")
|
|
1289
1321
|
});
|
|
1290
|
-
var zCreateApiUserRequestData =
|
|
1322
|
+
var zCreateApiUserRequestData = z5.object({
|
|
1291
1323
|
name: zUserName,
|
|
1292
|
-
pubKey:
|
|
1293
|
-
role:
|
|
1294
|
-
viewAll:
|
|
1324
|
+
pubKey: z5.string().describe("Public key"),
|
|
1325
|
+
role: z5.enum(["ADMIN", "OPERATOR"]).describe("User role"),
|
|
1326
|
+
viewAll: z5.boolean().describe("View all data").default(false).optional()
|
|
1295
1327
|
}).describe("Create API user request data");
|
|
1296
|
-
var zCreateApiUserAccessRequestData =
|
|
1328
|
+
var zCreateApiUserAccessRequestData = z5.object({
|
|
1297
1329
|
name: zUserName
|
|
1298
1330
|
}).describe("Create API user credential request data");
|
|
1299
|
-
|
|
1300
|
-
authUserId:
|
|
1331
|
+
z5.object({
|
|
1332
|
+
authUserId: z5.string().describe("Authentication broker ID")
|
|
1301
1333
|
}).describe("Managed data for API user");
|
|
1302
|
-
var zGroupName =
|
|
1303
|
-
var zCreateGroupRequestData =
|
|
1334
|
+
var zGroupName = z5.string().min(1).max(19).describe("Group name");
|
|
1335
|
+
var zCreateGroupRequestData = z5.object({
|
|
1304
1336
|
name: zGroupName,
|
|
1305
|
-
description:
|
|
1306
|
-
members:
|
|
1337
|
+
description: z5.string().nullable().describe("Group description"),
|
|
1338
|
+
members: z5.array(z5.string()).describe("List of group members ids")
|
|
1307
1339
|
});
|
|
1308
|
-
var zEditGroupRequestData =
|
|
1340
|
+
var zEditGroupRequestData = z5.object({
|
|
1309
1341
|
name: zGroupName,
|
|
1310
|
-
description:
|
|
1311
|
-
members:
|
|
1342
|
+
description: z5.string().nullable().describe("Group description"),
|
|
1343
|
+
members: z5.array(z5.string()).describe("List of group members ids")
|
|
1312
1344
|
});
|
|
1313
|
-
var zApiKeyName =
|
|
1314
|
-
var zCreateApiKeyRequestData =
|
|
1345
|
+
var zApiKeyName = z5.string().min(1).max(19).describe("API key name");
|
|
1346
|
+
var zCreateApiKeyRequestData = z5.object({
|
|
1315
1347
|
name: zApiKeyName,
|
|
1316
|
-
entities:
|
|
1317
|
-
scopes:
|
|
1348
|
+
entities: z5.array(z5.string()).describe("List of related entities ids"),
|
|
1349
|
+
scopes: z5.object({}).describe("FIXME to be precised")
|
|
1318
1350
|
}).describe("Create read-only API key request data");
|
|
1319
1351
|
var zEditApiKeyRequestData = zCreateApiKeyRequestData.describe(
|
|
1320
1352
|
"Edit read-only API key request data"
|
|
1321
1353
|
);
|
|
1322
|
-
var zEntityName =
|
|
1323
|
-
var zCreateEntityRequestData =
|
|
1354
|
+
var zEntityName = z5.string().min(1).max(19).describe("Entity name");
|
|
1355
|
+
var zCreateEntityRequestData = z5.object({
|
|
1324
1356
|
name: zEntityName,
|
|
1325
|
-
accounts:
|
|
1357
|
+
accounts: z5.array(z5.string())
|
|
1326
1358
|
});
|
|
1327
|
-
var zEditEntityRequestData =
|
|
1359
|
+
var zEditEntityRequestData = z5.object({
|
|
1328
1360
|
name: zEntityName,
|
|
1329
|
-
accounts:
|
|
1361
|
+
accounts: z5.array(z5.string())
|
|
1330
1362
|
});
|
|
1331
1363
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1332
|
-
var zWorkspaceRuleRequestData =
|
|
1333
|
-
permission:
|
|
1364
|
+
var zWorkspaceRuleRequestData = z5.object({
|
|
1365
|
+
permission: z5.nativeEnum(NonRootAdminPermission).describe("Granted permissions"),
|
|
1334
1366
|
reviewConfig: zReviewStepWithUsersArray.describe("List of admin review steps")
|
|
1335
1367
|
});
|
|
1336
|
-
var zUpdateQuorumRequestData = z32.object({
|
|
1337
|
-
quorum: z32.number().int().min(1).describe("Workspace quorum")
|
|
1338
|
-
});
|
|
1339
1368
|
|
|
1340
1369
|
// src/requests/request-data.ts
|
|
1341
1370
|
var zVaultRequestMixinsByType = {
|
|
1342
1371
|
// Workspaces
|
|
1343
|
-
[RequestType.UPDATE_QUORUM]:
|
|
1344
|
-
type:
|
|
1372
|
+
[RequestType.UPDATE_QUORUM]: z5.object({
|
|
1373
|
+
type: z5.literal(RequestType.UPDATE_QUORUM),
|
|
1345
1374
|
data: zUpdateQuorumRequestData
|
|
1346
1375
|
}),
|
|
1347
1376
|
// Operator requests
|
|
1348
|
-
[RequestType.CREATE_TRANSACTION]:
|
|
1349
|
-
type:
|
|
1377
|
+
[RequestType.CREATE_TRANSACTION]: z5.object({
|
|
1378
|
+
type: z5.literal(RequestType.CREATE_TRANSACTION),
|
|
1350
1379
|
data: zCreateTransactionRequestData,
|
|
1351
|
-
meta:
|
|
1352
|
-
hash:
|
|
1380
|
+
meta: z5.object({
|
|
1381
|
+
hash: z5.string().nullable()
|
|
1353
1382
|
}).optional().nullable()
|
|
1354
1383
|
}),
|
|
1355
|
-
[RequestType.SIGN_MESSAGE]:
|
|
1356
|
-
type:
|
|
1384
|
+
[RequestType.SIGN_MESSAGE]: z5.object({
|
|
1385
|
+
type: z5.literal(RequestType.SIGN_MESSAGE),
|
|
1357
1386
|
data: zSignMessageRequestData
|
|
1358
1387
|
}),
|
|
1359
|
-
[RequestType.SIGN_DIGESTS]:
|
|
1360
|
-
type:
|
|
1388
|
+
[RequestType.SIGN_DIGESTS]: z5.object({
|
|
1389
|
+
type: z5.literal(RequestType.SIGN_DIGESTS),
|
|
1361
1390
|
data: zSignDigestsRequestData
|
|
1362
1391
|
}),
|
|
1363
1392
|
// Accounts
|
|
1364
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1365
|
-
type:
|
|
1393
|
+
[RequestType.CREATE_ACCOUNT]: z5.object({
|
|
1394
|
+
type: z5.literal(RequestType.CREATE_ACCOUNT),
|
|
1366
1395
|
data: zCreateAccountRequestData
|
|
1367
1396
|
}),
|
|
1368
|
-
[RequestType.EDIT_ACCOUNT]:
|
|
1369
|
-
type:
|
|
1370
|
-
targetId:
|
|
1397
|
+
[RequestType.EDIT_ACCOUNT]: z5.object({
|
|
1398
|
+
type: z5.literal(RequestType.EDIT_ACCOUNT),
|
|
1399
|
+
targetId: z5.string(),
|
|
1371
1400
|
data: zEditAccountRequestData
|
|
1372
1401
|
}),
|
|
1373
|
-
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]:
|
|
1374
|
-
type:
|
|
1375
|
-
targetId:
|
|
1402
|
+
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]: z5.object({
|
|
1403
|
+
type: z5.literal(RequestType.ACTIVATE_TRADELINK_ACCOUNT),
|
|
1404
|
+
targetId: z5.string(),
|
|
1376
1405
|
data: zActivateAccountRequestData
|
|
1377
1406
|
}),
|
|
1378
|
-
[RequestType.EDIT_TOKEN_RULE]:
|
|
1379
|
-
type:
|
|
1380
|
-
targetId:
|
|
1407
|
+
[RequestType.EDIT_TOKEN_RULE]: z5.object({
|
|
1408
|
+
type: z5.literal(RequestType.EDIT_TOKEN_RULE),
|
|
1409
|
+
targetId: z5.string(),
|
|
1381
1410
|
data: zEditTokenRuleRequestData
|
|
1382
1411
|
}),
|
|
1383
1412
|
// Groups
|
|
1384
|
-
[RequestType.CREATE_GROUP]:
|
|
1385
|
-
type:
|
|
1413
|
+
[RequestType.CREATE_GROUP]: z5.object({
|
|
1414
|
+
type: z5.literal(RequestType.CREATE_GROUP),
|
|
1386
1415
|
data: zCreateGroupRequestData
|
|
1387
1416
|
}),
|
|
1388
|
-
[RequestType.EDIT_GROUP]:
|
|
1389
|
-
type:
|
|
1390
|
-
targetId:
|
|
1417
|
+
[RequestType.EDIT_GROUP]: z5.object({
|
|
1418
|
+
type: z5.literal(RequestType.EDIT_GROUP),
|
|
1419
|
+
targetId: z5.string(),
|
|
1391
1420
|
data: zEditGroupRequestData
|
|
1392
1421
|
}),
|
|
1393
|
-
[RequestType.REVOKE_GROUP]:
|
|
1394
|
-
type:
|
|
1395
|
-
data:
|
|
1422
|
+
[RequestType.REVOKE_GROUP]: z5.object({
|
|
1423
|
+
type: z5.literal(RequestType.REVOKE_GROUP),
|
|
1424
|
+
data: z5.object({})
|
|
1396
1425
|
}),
|
|
1397
1426
|
// Whitelists
|
|
1398
|
-
[RequestType.CREATE_WHITELIST]:
|
|
1399
|
-
type:
|
|
1427
|
+
[RequestType.CREATE_WHITELIST]: z5.object({
|
|
1428
|
+
type: z5.literal(RequestType.CREATE_WHITELIST),
|
|
1400
1429
|
data: zCreateWhitelistRequestData
|
|
1401
1430
|
}),
|
|
1402
|
-
[RequestType.EDIT_WHITELIST]:
|
|
1403
|
-
type:
|
|
1404
|
-
targetId:
|
|
1431
|
+
[RequestType.EDIT_WHITELIST]: z5.object({
|
|
1432
|
+
type: z5.literal(RequestType.EDIT_WHITELIST),
|
|
1433
|
+
targetId: z5.string(),
|
|
1405
1434
|
data: zEditWhitelistRequestData
|
|
1406
1435
|
}),
|
|
1407
1436
|
// Entities
|
|
1408
|
-
[RequestType.CREATE_ENTITY]:
|
|
1409
|
-
type:
|
|
1437
|
+
[RequestType.CREATE_ENTITY]: z5.object({
|
|
1438
|
+
type: z5.literal(RequestType.CREATE_ENTITY),
|
|
1410
1439
|
data: zCreateEntityRequestData
|
|
1411
1440
|
}),
|
|
1412
|
-
[RequestType.EDIT_ENTITY]:
|
|
1413
|
-
type:
|
|
1441
|
+
[RequestType.EDIT_ENTITY]: z5.object({
|
|
1442
|
+
type: z5.literal(RequestType.EDIT_ENTITY),
|
|
1414
1443
|
data: zEditEntityRequestData
|
|
1415
1444
|
}),
|
|
1416
|
-
[RequestType.REVOKE_ENTITY]:
|
|
1417
|
-
type:
|
|
1418
|
-
data:
|
|
1445
|
+
[RequestType.REVOKE_ENTITY]: z5.object({
|
|
1446
|
+
type: z5.literal(RequestType.REVOKE_ENTITY),
|
|
1447
|
+
data: z5.object({})
|
|
1419
1448
|
}),
|
|
1420
1449
|
// Users
|
|
1421
|
-
[RequestType.CREATE_PSD_USER]:
|
|
1422
|
-
type:
|
|
1450
|
+
[RequestType.CREATE_PSD_USER]: z5.object({
|
|
1451
|
+
type: z5.literal(RequestType.CREATE_PSD_USER),
|
|
1423
1452
|
data: zCreatePsdUserRequestData
|
|
1424
1453
|
}),
|
|
1425
|
-
[RequestType.CREATE_API_USER]:
|
|
1426
|
-
type:
|
|
1454
|
+
[RequestType.CREATE_API_USER]: z5.object({
|
|
1455
|
+
type: z5.literal(RequestType.CREATE_API_USER),
|
|
1427
1456
|
data: zCreateApiUserRequestData
|
|
1428
1457
|
}),
|
|
1429
|
-
[RequestType.CREATE_API_USER_ACCESS]:
|
|
1430
|
-
type:
|
|
1458
|
+
[RequestType.CREATE_API_USER_ACCESS]: z5.object({
|
|
1459
|
+
type: z5.literal(RequestType.CREATE_API_USER_ACCESS),
|
|
1431
1460
|
data: zCreateApiUserAccessRequestData
|
|
1432
1461
|
}),
|
|
1433
|
-
[RequestType.REVOKE_USER]:
|
|
1434
|
-
type:
|
|
1435
|
-
data:
|
|
1462
|
+
[RequestType.REVOKE_USER]: z5.object({
|
|
1463
|
+
type: z5.literal(RequestType.REVOKE_USER),
|
|
1464
|
+
data: z5.object({})
|
|
1436
1465
|
}),
|
|
1437
1466
|
// Admin gov rules
|
|
1438
|
-
[RequestType.CREATE_WORKSPACE_RULE]:
|
|
1439
|
-
type:
|
|
1467
|
+
[RequestType.CREATE_WORKSPACE_RULE]: z5.object({
|
|
1468
|
+
type: z5.literal(RequestType.CREATE_WORKSPACE_RULE),
|
|
1440
1469
|
data: zWorkspaceRuleRequestData
|
|
1441
1470
|
}),
|
|
1442
|
-
[RequestType.EDIT_WORKSPACE_RULE]:
|
|
1443
|
-
type:
|
|
1471
|
+
[RequestType.EDIT_WORKSPACE_RULE]: z5.object({
|
|
1472
|
+
type: z5.literal(RequestType.EDIT_WORKSPACE_RULE),
|
|
1444
1473
|
data: zWorkspaceRuleRequestData
|
|
1445
1474
|
}),
|
|
1446
1475
|
// SCI configs
|
|
1447
|
-
[RequestType.CREATE_SCICONFIG]:
|
|
1448
|
-
type:
|
|
1476
|
+
[RequestType.CREATE_SCICONFIG]: z5.object({
|
|
1477
|
+
type: z5.literal(RequestType.CREATE_SCICONFIG),
|
|
1449
1478
|
data: zCreateSciConfigRequestData
|
|
1450
1479
|
}),
|
|
1451
|
-
[RequestType.EDIT_SCICONFIG]:
|
|
1452
|
-
type:
|
|
1480
|
+
[RequestType.EDIT_SCICONFIG]: z5.object({
|
|
1481
|
+
type: z5.literal(RequestType.EDIT_SCICONFIG),
|
|
1453
1482
|
data: zEditSciConfigRequestData
|
|
1454
1483
|
}),
|
|
1455
1484
|
// API keys
|
|
1456
|
-
[RequestType.CREATE_API_KEY]:
|
|
1457
|
-
type:
|
|
1485
|
+
[RequestType.CREATE_API_KEY]: z5.object({
|
|
1486
|
+
type: z5.literal(RequestType.CREATE_API_KEY),
|
|
1458
1487
|
data: zCreateApiKeyRequestData
|
|
1459
1488
|
}),
|
|
1460
|
-
[RequestType.EDIT_API_KEY]:
|
|
1461
|
-
type:
|
|
1489
|
+
[RequestType.EDIT_API_KEY]: z5.object({
|
|
1490
|
+
type: z5.literal(RequestType.EDIT_API_KEY),
|
|
1462
1491
|
data: zEditApiKeyRequestData
|
|
1463
1492
|
}),
|
|
1464
|
-
[RequestType.REVOKE_API_KEY]:
|
|
1465
|
-
type:
|
|
1466
|
-
data:
|
|
1493
|
+
[RequestType.REVOKE_API_KEY]: z5.object({
|
|
1494
|
+
type: z5.literal(RequestType.REVOKE_API_KEY),
|
|
1495
|
+
data: z5.object({})
|
|
1467
1496
|
}),
|
|
1468
1497
|
// Policies
|
|
1469
|
-
[RequestType.CREATE_POLICY]:
|
|
1470
|
-
type:
|
|
1471
|
-
data:
|
|
1498
|
+
[RequestType.CREATE_POLICY]: z5.object({
|
|
1499
|
+
type: z5.literal(RequestType.CREATE_POLICY),
|
|
1500
|
+
data: zCreatePublicPolicyRequestData
|
|
1472
1501
|
}),
|
|
1473
|
-
[RequestType.EDIT_POLICY]:
|
|
1474
|
-
type:
|
|
1475
|
-
targetId:
|
|
1476
|
-
data:
|
|
1502
|
+
[RequestType.EDIT_POLICY]: z5.object({
|
|
1503
|
+
type: z5.literal(RequestType.EDIT_POLICY),
|
|
1504
|
+
targetId: z5.string(),
|
|
1505
|
+
data: zEditPublicPolicyRequestData
|
|
1477
1506
|
}),
|
|
1478
1507
|
// Tradelink
|
|
1479
|
-
[RequestType.CREATE_TRADELINK_CUSTODIAN]:
|
|
1480
|
-
type:
|
|
1508
|
+
[RequestType.CREATE_TRADELINK_CUSTODIAN]: z5.object({
|
|
1509
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_CUSTODIAN),
|
|
1481
1510
|
data: zCustodianRequestData
|
|
1482
1511
|
}),
|
|
1483
|
-
[RequestType.EDIT_TRADELINK_CUSTODIAN]:
|
|
1484
|
-
type:
|
|
1485
|
-
targetId:
|
|
1512
|
+
[RequestType.EDIT_TRADELINK_CUSTODIAN]: z5.object({
|
|
1513
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_CUSTODIAN),
|
|
1514
|
+
targetId: z5.string(),
|
|
1486
1515
|
data: zCustodianRequestData
|
|
1487
1516
|
}),
|
|
1488
|
-
[RequestType.CREATE_TRADELINK_EXCHANGE]:
|
|
1489
|
-
type:
|
|
1517
|
+
[RequestType.CREATE_TRADELINK_EXCHANGE]: z5.object({
|
|
1518
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_EXCHANGE),
|
|
1490
1519
|
data: zTradelinkEntityRequestData
|
|
1491
1520
|
}),
|
|
1492
|
-
[RequestType.EDIT_TRADELINK_EXCHANGE]:
|
|
1493
|
-
type:
|
|
1494
|
-
targetId:
|
|
1521
|
+
[RequestType.EDIT_TRADELINK_EXCHANGE]: z5.object({
|
|
1522
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_EXCHANGE),
|
|
1523
|
+
targetId: z5.string(),
|
|
1495
1524
|
data: zTradelinkEntityRequestData
|
|
1496
1525
|
}),
|
|
1497
|
-
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]:
|
|
1498
|
-
type:
|
|
1526
|
+
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]: z5.object({
|
|
1527
|
+
type: z5.literal(RequestType.CREATE_TRADELINK_ASSET_MANAGER),
|
|
1499
1528
|
data: zTradelinkEntityRequestData
|
|
1500
1529
|
}),
|
|
1501
|
-
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]:
|
|
1502
|
-
type:
|
|
1503
|
-
targetId:
|
|
1530
|
+
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]: z5.object({
|
|
1531
|
+
type: z5.literal(RequestType.EDIT_TRADELINK_ASSET_MANAGER),
|
|
1532
|
+
targetId: z5.string(),
|
|
1504
1533
|
data: zTradelinkEntityRequestData
|
|
1505
1534
|
}),
|
|
1506
|
-
[RequestType.ADJUST_PLEDGE]:
|
|
1507
|
-
type:
|
|
1535
|
+
[RequestType.ADJUST_PLEDGE]: z5.object({
|
|
1536
|
+
type: z5.literal(RequestType.ADJUST_PLEDGE),
|
|
1508
1537
|
data: zAdjustPledgeRequestData
|
|
1509
1538
|
}),
|
|
1510
|
-
[RequestType.TRADELINK_REPLEDGE]:
|
|
1511
|
-
type:
|
|
1539
|
+
[RequestType.TRADELINK_REPLEDGE]: z5.object({
|
|
1540
|
+
type: z5.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1512
1541
|
data: zRepledgeRequestData
|
|
1513
1542
|
}),
|
|
1514
|
-
[RequestType.CREATE_SETTLEMENT]:
|
|
1515
|
-
type:
|
|
1543
|
+
[RequestType.CREATE_SETTLEMENT]: z5.object({
|
|
1544
|
+
type: z5.literal(RequestType.CREATE_SETTLEMENT),
|
|
1516
1545
|
data: zCreateSettlementRequestData,
|
|
1517
|
-
meta:
|
|
1518
|
-
hash:
|
|
1546
|
+
meta: z5.object({
|
|
1547
|
+
hash: z5.string().nullable()
|
|
1519
1548
|
}).optional().nullable()
|
|
1520
1549
|
}),
|
|
1521
|
-
[RequestType.FORCE_UNPLEDGE]:
|
|
1522
|
-
type:
|
|
1550
|
+
[RequestType.FORCE_UNPLEDGE]: z5.object({
|
|
1551
|
+
type: z5.literal(RequestType.FORCE_UNPLEDGE),
|
|
1523
1552
|
data: zForceUnpledgeRequestData
|
|
1524
1553
|
}),
|
|
1525
|
-
[RequestType.TRADELINK_WITHDRAW]:
|
|
1526
|
-
type:
|
|
1554
|
+
[RequestType.TRADELINK_WITHDRAW]: z5.object({
|
|
1555
|
+
type: z5.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1527
1556
|
data: zTradelinkWithdrawRequestData,
|
|
1528
|
-
meta:
|
|
1529
|
-
hash:
|
|
1557
|
+
meta: z5.object({
|
|
1558
|
+
hash: z5.string().nullable()
|
|
1530
1559
|
}).optional().nullable()
|
|
1531
1560
|
}),
|
|
1532
|
-
[RequestType.TRADELINK_ARBITRATE]:
|
|
1533
|
-
type:
|
|
1561
|
+
[RequestType.TRADELINK_ARBITRATE]: z5.object({
|
|
1562
|
+
type: z5.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1534
1563
|
data: zTradelinkArbitrationRequestData,
|
|
1535
|
-
meta:
|
|
1536
|
-
hash:
|
|
1564
|
+
meta: z5.object({
|
|
1565
|
+
hash: z5.string().nullable()
|
|
1537
1566
|
}).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
1567
|
})
|
|
1548
1568
|
};
|
|
1549
1569
|
|
|
1550
1570
|
// src/requests/app-types.ts
|
|
1551
|
-
var zRequestReviewResponse =
|
|
1571
|
+
var zRequestReviewResponse = z5.object({
|
|
1552
1572
|
// 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:
|
|
1573
|
+
stepIndex: z5.number().int().describe("Index of the governance step in the request workflow"),
|
|
1574
|
+
userId: z5.string().describe("Reviewer id"),
|
|
1575
|
+
status: z5.nativeEnum(RequestReviewStatus).describe("Review status"),
|
|
1576
|
+
createdAt: z5.coerce.date().describe("Created date"),
|
|
1577
|
+
updatedAt: z5.coerce.date().describe("Updated date")
|
|
1578
|
+
});
|
|
1579
|
+
var zVaultRequestCommonMixin = z5.object({
|
|
1580
|
+
id: z5.string().describe("Request unique identifier"),
|
|
1581
|
+
legacyId: z5.number().describe("Legacy internal unique identifier (for retro-compatibility)"),
|
|
1582
|
+
state: z5.nativeEnum(RequestState).describe("Request state"),
|
|
1563
1583
|
reviewSteps: zRequestReviewSteps.describe("Request review steps"),
|
|
1564
|
-
currentStepIndex:
|
|
1565
|
-
expiredAt:
|
|
1566
|
-
targetId:
|
|
1584
|
+
currentStepIndex: z5.number().int().min(0).describe("Index of the current approval step"),
|
|
1585
|
+
expiredAt: z5.coerce.date().nullable().describe("Optional expiration date"),
|
|
1586
|
+
targetId: z5.string().nullable().describe("Optional ID of the target object"),
|
|
1567
1587
|
note: zNote.nullable().describe("Optional request note"),
|
|
1568
|
-
reviews:
|
|
1588
|
+
reviews: z5.array(zRequestReviewResponse).describe("Requests reviews"),
|
|
1569
1589
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
1570
|
-
createdAt:
|
|
1571
|
-
updatedAt:
|
|
1590
|
+
createdAt: z5.coerce.date().describe("Creation timestamp"),
|
|
1591
|
+
updatedAt: z5.coerce.date().describe("Last modification timestamp"),
|
|
1572
1592
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
1573
|
-
inflight:
|
|
1574
|
-
lastError:
|
|
1575
|
-
numFailed:
|
|
1576
|
-
retryAfter:
|
|
1593
|
+
inflight: z5.object({
|
|
1594
|
+
lastError: z5.string().describe("Error message from the last failure"),
|
|
1595
|
+
numFailed: z5.number().int().describe("Number of failures so far"),
|
|
1596
|
+
retryAfter: z5.coerce.date().describe("Date after which next retry is scheduled")
|
|
1577
1597
|
}).optional().describe("Extra information if the request is currently being processed")
|
|
1578
1598
|
});
|
|
1579
1599
|
var allowedRequestCreationInput = {
|
|
1600
|
+
[RequestType.UPDATE_QUORUM]: zVaultRequestMixinsByType[RequestType.UPDATE_QUORUM],
|
|
1580
1601
|
[RequestType.CREATE_PSD_USER]: zVaultRequestMixinsByType[RequestType.CREATE_PSD_USER],
|
|
1581
1602
|
[RequestType.CREATE_API_USER]: zVaultRequestMixinsByType[RequestType.CREATE_API_USER],
|
|
1582
1603
|
[RequestType.CREATE_GROUP]: zVaultRequestMixinsByType[RequestType.CREATE_GROUP],
|
|
@@ -1586,8 +1607,8 @@ var allowedRequestCreationInput = {
|
|
|
1586
1607
|
[RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
|
|
1587
1608
|
[RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
|
|
1588
1609
|
[RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
|
|
1589
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1590
|
-
type:
|
|
1610
|
+
[RequestType.CREATE_ACCOUNT]: z5.object({
|
|
1611
|
+
type: z5.literal(RequestType.CREATE_ACCOUNT),
|
|
1591
1612
|
data: zCreateAccountUserInputData
|
|
1592
1613
|
}),
|
|
1593
1614
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
@@ -1605,8 +1626,8 @@ var allowedRequestCreationInput = {
|
|
|
1605
1626
|
[RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
|
|
1606
1627
|
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE]
|
|
1607
1628
|
};
|
|
1608
|
-
|
|
1609
|
-
request:
|
|
1629
|
+
z5.object({
|
|
1630
|
+
request: z5.discriminatedUnion(
|
|
1610
1631
|
"type",
|
|
1611
1632
|
ensureNonEmptyArray(
|
|
1612
1633
|
Object.values(allowedRequestCreationInput).map((_) => {
|
|
@@ -1616,7 +1637,7 @@ z32.object({
|
|
|
1616
1637
|
)
|
|
1617
1638
|
)
|
|
1618
1639
|
});
|
|
1619
|
-
var zVaultRequestResponse =
|
|
1640
|
+
var zVaultRequestResponse = z5.discriminatedUnion(
|
|
1620
1641
|
"type",
|
|
1621
1642
|
ensureNonEmptyArray(
|
|
1622
1643
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
@@ -1625,14 +1646,14 @@ var zVaultRequestResponse = z32.discriminatedUnion(
|
|
|
1625
1646
|
})
|
|
1626
1647
|
)
|
|
1627
1648
|
);
|
|
1628
|
-
|
|
1649
|
+
z5.enum([
|
|
1629
1650
|
"state",
|
|
1630
1651
|
"expiredAt",
|
|
1631
1652
|
"createdAt",
|
|
1632
1653
|
"updatedAt"
|
|
1633
1654
|
]).default("createdAt");
|
|
1634
|
-
|
|
1635
|
-
pubKey:
|
|
1655
|
+
z5.object({
|
|
1656
|
+
pubKey: z5.string().describe("Public key of the current user"),
|
|
1636
1657
|
challenge: zUserChallenge.describe("Challenge data to sign with the user's private key")
|
|
1637
1658
|
});
|
|
1638
1659
|
var shouldHaveTargetHsmId = (request) => {
|
|
@@ -1647,13 +1668,13 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1647
1668
|
case RequestType.REVOKE_API_KEY:
|
|
1648
1669
|
case RequestType.CREATE_WORKSPACE_RULE:
|
|
1649
1670
|
case RequestType.EDIT_WORKSPACE_RULE:
|
|
1671
|
+
case RequestType.UPDATE_QUORUM:
|
|
1650
1672
|
return false;
|
|
1651
1673
|
case RequestType.CREATE_PSD_USER:
|
|
1652
1674
|
case RequestType.CREATE_API_USER:
|
|
1653
1675
|
case RequestType.CREATE_API_USER_ACCESS:
|
|
1654
1676
|
// targeting / editing an existing `User`
|
|
1655
1677
|
case RequestType.REVOKE_USER:
|
|
1656
|
-
case RequestType.UPDATE_QUORUM:
|
|
1657
1678
|
case RequestType.CREATE_TRANSACTION:
|
|
1658
1679
|
case RequestType.SIGN_MESSAGE:
|
|
1659
1680
|
case RequestType.SIGN_DIGESTS:
|
|
@@ -1676,10 +1697,6 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1676
1697
|
return request.state !== RequestState.INITIAL;
|
|
1677
1698
|
case RequestType.EDIT_TOKEN_RULE:
|
|
1678
1699
|
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
1700
|
}
|
|
1684
1701
|
};
|
|
1685
1702
|
var shouldHaveTargetId = (request) => {
|
|
@@ -1692,6 +1709,7 @@ var shouldHaveTargetId = (request) => {
|
|
|
1692
1709
|
case RequestType.SIGN_MESSAGE:
|
|
1693
1710
|
case RequestType.SIGN_DIGESTS:
|
|
1694
1711
|
return false;
|
|
1712
|
+
case RequestType.UPDATE_QUORUM:
|
|
1695
1713
|
case RequestType.CREATE_PSD_USER:
|
|
1696
1714
|
case RequestType.CREATE_API_USER:
|
|
1697
1715
|
case RequestType.CREATE_WORKSPACE_RULE:
|
|
@@ -1705,7 +1723,6 @@ var shouldHaveTargetId = (request) => {
|
|
|
1705
1723
|
case RequestType.CREATE_TRADELINK_EXCHANGE:
|
|
1706
1724
|
case RequestType.CREATE_TRADELINK_ASSET_MANAGER:
|
|
1707
1725
|
return request.state === RequestState.EXECUTED;
|
|
1708
|
-
case RequestType.UPDATE_QUORUM:
|
|
1709
1726
|
case RequestType.EDIT_WORKSPACE_RULE:
|
|
1710
1727
|
case RequestType.EDIT_ACCOUNT:
|
|
1711
1728
|
case RequestType.ACTIVATE_TRADELINK_ACCOUNT:
|
|
@@ -1730,10 +1747,6 @@ var shouldHaveTargetId = (request) => {
|
|
|
1730
1747
|
case RequestType.TRADELINK_WITHDRAW:
|
|
1731
1748
|
case RequestType.TRADELINK_ARBITRATE:
|
|
1732
1749
|
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
1750
|
}
|
|
1738
1751
|
};
|
|
1739
1752
|
|
|
@@ -1909,6 +1922,17 @@ var genAssetFieldsForType = (type) => {
|
|
|
1909
1922
|
hsmXpub,
|
|
1910
1923
|
hsmChainCode
|
|
1911
1924
|
};
|
|
1925
|
+
case "RAW_SIGNING":
|
|
1926
|
+
return {
|
|
1927
|
+
type,
|
|
1928
|
+
currency: faker.helpers.arrayElement(["ethereum", "bitcoin"]),
|
|
1929
|
+
derivationPath: "44'/118'/0'",
|
|
1930
|
+
address: null,
|
|
1931
|
+
contractAddress: null,
|
|
1932
|
+
xpub: null,
|
|
1933
|
+
hsmXpub,
|
|
1934
|
+
hsmChainCode
|
|
1935
|
+
};
|
|
1912
1936
|
}
|
|
1913
1937
|
};
|
|
1914
1938
|
var genGovernanceFieldsForType = (governanceType, {
|
|
@@ -1918,6 +1942,7 @@ var genGovernanceFieldsForType = (governanceType, {
|
|
|
1918
1942
|
}) => {
|
|
1919
1943
|
switch (governanceType) {
|
|
1920
1944
|
case AccountGovernanceType.CLASSIC:
|
|
1945
|
+
case AccountGovernanceType.RAW_SIGNING:
|
|
1921
1946
|
return {
|
|
1922
1947
|
governanceType,
|
|
1923
1948
|
classicGovernanceMixin: {
|
|
@@ -2064,6 +2089,7 @@ var stakingFieldsByAccountType = {
|
|
|
2064
2089
|
}
|
|
2065
2090
|
}),
|
|
2066
2091
|
GENERIC_LIKE: () => null,
|
|
2092
|
+
RAW_SIGNING: () => null,
|
|
2067
2093
|
POLKADOT_LIKE: () => ({
|
|
2068
2094
|
type: "POLKADOT_LIKE",
|
|
2069
2095
|
staking: {
|