@ledgerhq/revault-api 1.40.1 → 1.41.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-BuzfKOYN.d.mts → app-types-BCPeZhFD.d.mts} +87 -35
- package/lib/fakes.d.mts +8 -7
- package/lib/fakes.mjs +993 -817
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +216 -61
- package/package.json +2 -2
package/lib/fakes.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __export } from './chunk-J5LGTIGS.mjs';
|
|
2
2
|
import { faker } from '@faker-js/faker';
|
|
3
|
-
import { AccountType, ChallengeType, PsdModel, UserRole, UserRegistrationState, AllowedAction, AdminPermission,
|
|
3
|
+
import { AccountType, ChallengeType, PsdModel, UserRole, UserRegistrationState, AllowedAction, AdminPermission, RequestType, AccountGovernanceType, ActivationStatus, MessageType, WhitelistType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
|
|
4
4
|
import { omit, times, get, isPlainObject } from 'lodash';
|
|
5
5
|
import 'axios';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import invariant8 from 'invariant';
|
|
7
|
+
import z13, { z } from 'zod';
|
|
8
|
+
import 'ts-pattern';
|
|
8
9
|
|
|
9
10
|
// src/errors.ts
|
|
10
11
|
var ValidationError = class extends Error {
|
|
@@ -22,7 +23,7 @@ var buildGateSyncId = (workspaceName, gateType, gateId) => {
|
|
|
22
23
|
// src/utils.ts
|
|
23
24
|
var isRecord = (value) => isPlainObject(value);
|
|
24
25
|
var ensureNonEmptyArray = (values, message) => {
|
|
25
|
-
|
|
26
|
+
invariant8(
|
|
26
27
|
values.length > 0,
|
|
27
28
|
`Expected non-empty array but got one with length ${values.length}`
|
|
28
29
|
);
|
|
@@ -297,100 +298,128 @@ z.codec(z.iso.datetime(), z.date(), {
|
|
|
297
298
|
encode: (date) => date.toISOString()
|
|
298
299
|
// Date → ISO string
|
|
299
300
|
});
|
|
301
|
+
|
|
302
|
+
// src/networks/common.ts
|
|
300
303
|
var NetworkFamily = omit(AccountType, ["RAW_SIGNING"]);
|
|
301
|
-
var zHexDataString =
|
|
304
|
+
var zHexDataString = z13.codec(z13.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/), z13.string(), {
|
|
302
305
|
decode: (hex) => `0x${hex.toLowerCase().replace("0x", "")}`,
|
|
303
306
|
encode: (hex) => hex
|
|
304
307
|
});
|
|
305
|
-
var zCommonLiveData =
|
|
306
|
-
id:
|
|
307
|
-
balance:
|
|
308
|
-
total:
|
|
309
|
-
pending:
|
|
308
|
+
var zCommonLiveData = z13.object({
|
|
309
|
+
id: z13.string().meta({ description: "Account internal unique identifier" }),
|
|
310
|
+
balance: z13.object({
|
|
311
|
+
total: z13.string().meta({ description: "Total balance" }),
|
|
312
|
+
pending: z13.string().meta({ description: "Pending balance" })
|
|
310
313
|
}).meta({ description: "Balance fields" })
|
|
311
314
|
});
|
|
312
|
-
var zCommonTransactionData =
|
|
315
|
+
var zCommonTransactionData = z13.object({
|
|
313
316
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
314
317
|
currency: zCurrencyString.meta({
|
|
315
318
|
description: "Will be deprecated soon, use Account.network. Transaction currency"
|
|
316
319
|
}),
|
|
317
320
|
// TODO: to remove, use account.network instead
|
|
318
321
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
319
|
-
recipient:
|
|
322
|
+
recipient: z13.string().nonempty().meta({ description: "Transaction recipient" })
|
|
320
323
|
});
|
|
321
|
-
var zFeeStrategyCustom =
|
|
322
|
-
type:
|
|
324
|
+
var zFeeStrategyCustom = z13.object({
|
|
325
|
+
type: z13.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
|
|
323
326
|
});
|
|
324
|
-
var zFeeStrategy =
|
|
325
|
-
type:
|
|
327
|
+
var zFeeStrategy = z13.object({
|
|
328
|
+
type: z13.enum(["SLOW", "NORMAL", "FAST"])
|
|
326
329
|
});
|
|
327
|
-
var zTransactionStatus =
|
|
328
|
-
var zCommonTransactionResponse =
|
|
329
|
-
id:
|
|
330
|
-
hash:
|
|
331
|
-
block:
|
|
332
|
-
height:
|
|
333
|
-
time:
|
|
330
|
+
var zTransactionStatus = z13.enum(["SUCCESSFUL", "FAILED"]);
|
|
331
|
+
var zCommonTransactionResponse = z13.object({
|
|
332
|
+
id: z13.string().meta({ description: "Internal unique identifier" }),
|
|
333
|
+
hash: z13.string().meta({ description: "Transaction hash" }),
|
|
334
|
+
block: z13.object({
|
|
335
|
+
height: z13.string().nullable().meta({ description: "Transaction block height" }),
|
|
336
|
+
time: z13.string().nullable().meta({ description: "Transaction block time" })
|
|
334
337
|
}),
|
|
335
338
|
status: zTransactionStatus.meta({ description: "Transaction status" }),
|
|
336
|
-
confirmations:
|
|
337
|
-
amount:
|
|
338
|
-
fee:
|
|
339
|
-
senders:
|
|
340
|
-
recipients:
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
type: z9.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" }),
|
|
346
|
-
xpub: z9.string().meta({ description: "xpub (extended public key)" })
|
|
339
|
+
confirmations: z13.string().meta({ description: "Block confirmations" }),
|
|
340
|
+
amount: z13.string().meta({ description: "Transaction amount" }),
|
|
341
|
+
fee: z13.string().meta({ description: "Transaction fee" }),
|
|
342
|
+
senders: z13.array(z13.string()).meta({ description: "Senders (can be multiple for UTXOs-based accounts)" }),
|
|
343
|
+
recipients: z13.array(z13.string()).meta({ description: "Recipients (can be multiple for multi-output transactions)" })
|
|
344
|
+
});
|
|
345
|
+
var zBitcoinLikeAssetFields = z13.object({
|
|
346
|
+
type: z13.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" }),
|
|
347
|
+
xpub: z13.string().meta({ description: "xpub (extended public key)" })
|
|
347
348
|
}).meta({ description: "Bitcoin-like" });
|
|
348
349
|
var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
349
|
-
type:
|
|
350
|
+
type: z13.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" })
|
|
350
351
|
}).meta({ description: "Bitcoin-like" });
|
|
351
|
-
var zBitcoinLikeTransactionType =
|
|
352
|
+
var zBitcoinLikeTransactionType = z13.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).meta({ description: "Bitcoin-like transaction type" });
|
|
352
353
|
var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
353
354
|
// nullish is optional + nullable, it is easier to seed rather than just optional
|
|
354
355
|
feePerByte: zUnsignedIntString.nullish().meta({ description: "Fee per byte" })
|
|
355
356
|
}).meta({ description: "Bitcoin-like fee strategy" });
|
|
356
357
|
var zBitcoinLikeSendData = zCommonTransactionData.extend({
|
|
357
|
-
type:
|
|
358
|
+
type: z13.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
|
|
358
359
|
feeStrategy: zBitcoinLikeFeeStrategy
|
|
359
360
|
}).meta({
|
|
360
361
|
description: "Bitcoin-like send data",
|
|
361
362
|
id: "BitcoinLikeSendData"
|
|
362
363
|
});
|
|
363
|
-
var zBitcoinLikeTransactionData =
|
|
364
|
-
var zBitcoinLikeTransactionResponse =
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
364
|
+
var zBitcoinLikeTransactionData = z13.discriminatedUnion("type", [zBitcoinLikeSendData]);
|
|
365
|
+
var zBitcoinLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
366
|
+
zCommonTransactionResponse.extend({ type: zBitcoinLikeTransactionType }).meta({ description: "Bitcoin-like transaction" })
|
|
367
|
+
]);
|
|
368
|
+
|
|
369
|
+
// src/networks/bitcoin/index.ts
|
|
370
|
+
var BITCOIN_SPEC = {
|
|
371
|
+
family: NetworkFamily.BITCOIN_LIKE,
|
|
372
|
+
zAssetFields: zBitcoinLikeAssetFields,
|
|
373
|
+
zLiveData: zBitcoinLikeLiveData,
|
|
374
|
+
zTransactionType: zBitcoinLikeTransactionType,
|
|
375
|
+
zTransactionData: zBitcoinLikeTransactionData,
|
|
376
|
+
zSendTransactionData: zBitcoinLikeSendData,
|
|
377
|
+
zEstimatedFees: z13.never(),
|
|
378
|
+
zTransactionResponse: zBitcoinLikeTransactionResponse,
|
|
379
|
+
zStakingFields: z13.never()};
|
|
380
|
+
var zCantonLikeAssetFields = z13.object({
|
|
381
|
+
type: z13.literal(NetworkFamily.CANTON_LIKE).meta({ description: "Account type" }),
|
|
382
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
368
383
|
}).meta({ description: "Canton-like" });
|
|
369
384
|
var zCantonLikeLiveData = zCommonLiveData.extend({
|
|
370
|
-
type:
|
|
385
|
+
type: z13.literal(NetworkFamily.CANTON_LIKE).meta({ description: "Account type" })
|
|
371
386
|
}).meta({ description: "Canton-like" });
|
|
372
|
-
var zCantonLikeTransactionType =
|
|
387
|
+
var zCantonLikeTransactionType = z13.enum(["CANTON_LIKE_SEND", "CANTON_LIKE_RECEIVE"]).meta({ description: "Canton-like transaction type" });
|
|
373
388
|
var zCantonLikeSendData = zCommonTransactionData.extend({
|
|
374
|
-
type:
|
|
389
|
+
type: z13.literal(zCantonLikeTransactionType.enum.CANTON_LIKE_SEND)
|
|
375
390
|
}).meta({
|
|
376
391
|
description: "Canton-like send data",
|
|
377
392
|
id: "CantonLikeSendData"
|
|
378
393
|
});
|
|
379
|
-
var zCantonLikeTransactionData =
|
|
380
|
-
var zCantonLikeTransactionResponse =
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
394
|
+
var zCantonLikeTransactionData = z13.discriminatedUnion("type", [zCantonLikeSendData]);
|
|
395
|
+
var zCantonLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
396
|
+
zCommonTransactionResponse.extend({ type: zCantonLikeTransactionType }).meta({ description: "Canton-like transaction" })
|
|
397
|
+
]);
|
|
398
|
+
|
|
399
|
+
// src/networks/canton/index.ts
|
|
400
|
+
var CANTON_SPEC = {
|
|
401
|
+
family: NetworkFamily.CANTON_LIKE,
|
|
402
|
+
zAssetFields: zCantonLikeAssetFields,
|
|
403
|
+
zLiveData: zCantonLikeLiveData,
|
|
404
|
+
zTransactionType: zCantonLikeTransactionType,
|
|
405
|
+
zTransactionData: zCantonLikeTransactionData,
|
|
406
|
+
zSendTransactionData: zCantonLikeSendData,
|
|
407
|
+
zEstimatedFees: z13.never(),
|
|
408
|
+
zTransactionResponse: zCantonLikeTransactionResponse,
|
|
409
|
+
zStakingFields: z13.never()};
|
|
410
|
+
var zCardanoLikeAssetFields = z13.object({
|
|
411
|
+
type: z13.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
|
|
412
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
384
413
|
}).meta({ description: "Cardano-like" });
|
|
385
|
-
var zCardanoLikeStakingData =
|
|
386
|
-
staked:
|
|
414
|
+
var zCardanoLikeStakingData = z13.object({
|
|
415
|
+
staked: z13.string().meta({ description: "Staked balance" })
|
|
387
416
|
}).nullable().meta({ description: "Cardano-like staking data" });
|
|
388
|
-
var zCardanoLikeStakingFields =
|
|
389
|
-
type:
|
|
417
|
+
var zCardanoLikeStakingFields = z13.object({
|
|
418
|
+
type: z13.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
|
|
390
419
|
staking: zCardanoLikeStakingData.optional()
|
|
391
420
|
});
|
|
392
421
|
var zCardanoLikeLiveData = zCommonLiveData.extend(zCardanoLikeStakingFields.shape).meta({ description: "Cardano-like" });
|
|
393
|
-
var zCardanoLikeTransactionType =
|
|
422
|
+
var zCardanoLikeTransactionType = z13.enum([
|
|
394
423
|
"CARDANO_LIKE_SEND",
|
|
395
424
|
"CARDANO_LIKE_RECEIVE",
|
|
396
425
|
"CARDANO_LIKE_STAKING_REGISTER",
|
|
@@ -399,26 +428,26 @@ var zCardanoLikeTransactionType = z9.enum([
|
|
|
399
428
|
"CARDANO_LIKE_STAKING_WITHDRAW"
|
|
400
429
|
]).meta({ description: "Cardano-like transaction type" });
|
|
401
430
|
var zCardanoLikeSendData = zCommonTransactionData.extend({
|
|
402
|
-
type:
|
|
431
|
+
type: z13.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
403
432
|
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" })
|
|
404
433
|
}).meta({
|
|
405
434
|
description: "Cardano-like send data",
|
|
406
435
|
id: "CardanoSendData"
|
|
407
436
|
});
|
|
408
|
-
var zCardanoStakingDelegateData =
|
|
409
|
-
type:
|
|
437
|
+
var zCardanoStakingDelegateData = z13.object({
|
|
438
|
+
type: z13.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
410
439
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
411
440
|
// TODO: strict literal or enum?
|
|
412
441
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
413
442
|
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
414
443
|
// DELEGATE doesn't have neither amount nor recipient
|
|
415
|
-
stakePoolId:
|
|
444
|
+
stakePoolId: z13.string().min(1).max(100).meta({ description: "" })
|
|
416
445
|
}).meta({
|
|
417
446
|
description: "Cardano-like staking delegate",
|
|
418
447
|
id: "CardanoStakingDelegateData"
|
|
419
448
|
});
|
|
420
|
-
var zCardanoStakingDeregisterData =
|
|
421
|
-
type:
|
|
449
|
+
var zCardanoStakingDeregisterData = z13.object({
|
|
450
|
+
type: z13.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
422
451
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
423
452
|
// TODO: strict literal or enum?
|
|
424
453
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -429,8 +458,8 @@ var zCardanoStakingDeregisterData = z9.object({
|
|
|
429
458
|
description: "Cardano-like staking deregister data",
|
|
430
459
|
id: "CardanoStakingDeregisterData"
|
|
431
460
|
});
|
|
432
|
-
var zCardanoStakingRegisterData =
|
|
433
|
-
type:
|
|
461
|
+
var zCardanoStakingRegisterData = z13.object({
|
|
462
|
+
type: z13.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
434
463
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
435
464
|
// TODO: strict literal or enum?
|
|
436
465
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -441,8 +470,8 @@ var zCardanoStakingRegisterData = z9.object({
|
|
|
441
470
|
description: "Cardano-like staking register data",
|
|
442
471
|
id: "CardanoStakingRegisterData"
|
|
443
472
|
});
|
|
444
|
-
var zCardanoStakingWithdrawData =
|
|
445
|
-
type:
|
|
473
|
+
var zCardanoStakingWithdrawData = z13.object({
|
|
474
|
+
type: z13.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
446
475
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
447
476
|
// TODO: strict literal or enum?
|
|
448
477
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -453,41 +482,61 @@ var zCardanoStakingWithdrawData = z9.object({
|
|
|
453
482
|
description: "Cardano-like staking withdraw data",
|
|
454
483
|
id: "CardanoStakingWithdrawData"
|
|
455
484
|
});
|
|
456
|
-
var zCardanoLikeTransactionData =
|
|
485
|
+
var zCardanoLikeTransactionData = z13.discriminatedUnion("type", [
|
|
457
486
|
zCardanoLikeSendData,
|
|
458
487
|
zCardanoStakingDelegateData,
|
|
459
488
|
zCardanoStakingDeregisterData,
|
|
460
489
|
zCardanoStakingRegisterData,
|
|
461
490
|
zCardanoStakingWithdrawData
|
|
462
491
|
]);
|
|
463
|
-
var zCardanoLikeTransactionResponse =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
492
|
+
var zCardanoLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
493
|
+
zCommonTransactionResponse.extend({ type: zCardanoLikeTransactionType }).meta({ description: "Cardano-like transaction" })
|
|
494
|
+
]);
|
|
495
|
+
|
|
496
|
+
// src/networks/cardano/index.ts
|
|
497
|
+
var CARDANO_SPEC = {
|
|
498
|
+
family: NetworkFamily.CARDANO_LIKE,
|
|
499
|
+
zAssetFields: zCardanoLikeAssetFields,
|
|
500
|
+
zLiveData: zCardanoLikeLiveData,
|
|
501
|
+
zTransactionType: zCardanoLikeTransactionType,
|
|
502
|
+
zTransactionData: zCardanoLikeTransactionData,
|
|
503
|
+
zSendTransactionData: zCardanoLikeSendData,
|
|
504
|
+
zEstimatedFees: z13.never(),
|
|
505
|
+
zTransactionResponse: zCardanoLikeTransactionResponse,
|
|
506
|
+
zStakingFields: zCardanoLikeStakingFields};
|
|
507
|
+
var zEthereumLikeAssetFields = z13.object({
|
|
508
|
+
type: z13.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
|
|
509
|
+
address: z13.string().nullable().meta({ description: "Account address" }),
|
|
510
|
+
contractAddress: z13.string().nullable().meta({
|
|
468
511
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
469
512
|
}).optional()
|
|
470
513
|
}).meta({ description: "Ethereum-like" });
|
|
471
|
-
var zEthereumLikeStakingData =
|
|
472
|
-
totalStaking:
|
|
473
|
-
totalRewards:
|
|
474
|
-
availableRewards:
|
|
475
|
-
networkApy:
|
|
514
|
+
var zEthereumLikeStakingData = z13.object({
|
|
515
|
+
totalStaking: z13.string().meta({ description: "Total staked amount" }),
|
|
516
|
+
totalRewards: z13.string().meta({ description: "Total of rewards" }),
|
|
517
|
+
availableRewards: z13.string().meta({ description: "Available rewards" }),
|
|
518
|
+
networkApy: z13.number().meta({ description: "Network APY" })
|
|
476
519
|
}).nullable().meta({ description: "Ethereum-like staking data" });
|
|
477
|
-
var zEthereumLikeStakingFields =
|
|
478
|
-
type:
|
|
520
|
+
var zEthereumLikeStakingFields = z13.object({
|
|
521
|
+
type: z13.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
|
|
479
522
|
staking: zEthereumLikeStakingData.optional()
|
|
480
523
|
});
|
|
481
524
|
var zEthereumLikeLiveData = zCommonLiveData.extend(zEthereumLikeStakingFields.shape).meta({ description: "Ethereum-like" });
|
|
482
|
-
var zEthereumLikeEstimatedFees =
|
|
483
|
-
type:
|
|
525
|
+
var zEthereumLikeEstimatedFees = z13.object({
|
|
526
|
+
type: z13.literal(NetworkFamily.ETHEREUM_LIKE),
|
|
484
527
|
baseFees: zIntString,
|
|
485
528
|
gasLimit: zIntString,
|
|
486
|
-
nonce:
|
|
529
|
+
nonce: z13.string(),
|
|
487
530
|
priorityFees: zIntString
|
|
488
531
|
}).meta({ description: "Ethereum-like fees" });
|
|
489
|
-
var zEthereumLikeTransferTransactionType =
|
|
490
|
-
var zEthereumLikeContractTransactionType =
|
|
532
|
+
var zEthereumLikeTransferTransactionType = z13.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).meta({ description: "Ethereum-like transaction type" });
|
|
533
|
+
var zEthereumLikeContractTransactionType = z13.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).meta({ description: "Ethereum-like transaction type" });
|
|
534
|
+
var zEthereumLikeTransactionType = z13.enum([
|
|
535
|
+
...zEthereumLikeTransferTransactionType.options,
|
|
536
|
+
...zEthereumLikeContractTransactionType.options
|
|
537
|
+
]).meta({
|
|
538
|
+
description: "Ethereum-like transaction type"
|
|
539
|
+
});
|
|
491
540
|
var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
|
|
492
541
|
gasPrice: zUnsignedIntString.meta({ description: "Gas price" }),
|
|
493
542
|
gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
|
|
@@ -497,14 +546,14 @@ var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
|
|
|
497
546
|
maxFeePerGas: zUnsignedIntString.meta({ description: "Maximum fee per gas (base + priority)" }),
|
|
498
547
|
gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
|
|
499
548
|
}).meta({ description: "Ethereum-like EIP-1559 fee strategy" });
|
|
500
|
-
var zEthereumLikeFeeStrategy =
|
|
549
|
+
var zEthereumLikeFeeStrategy = z13.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).meta({
|
|
501
550
|
description: "Ethereum-like fee strategy",
|
|
502
551
|
id: "EthereumLikeFeeStrategy"
|
|
503
552
|
});
|
|
504
553
|
var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
505
|
-
type:
|
|
554
|
+
type: z13.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
|
|
506
555
|
// force the recipient to be the zero address
|
|
507
|
-
recipient:
|
|
556
|
+
recipient: z13.literal("0x0000000000000000000000000000000000000000"),
|
|
508
557
|
contractData: zHexDataString.meta({ description: "Contract data in hexadecimal format" }),
|
|
509
558
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
510
559
|
}).meta({
|
|
@@ -512,7 +561,7 @@ var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
|
512
561
|
id: "EthereumLikeDeployContractData"
|
|
513
562
|
});
|
|
514
563
|
var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
515
|
-
type:
|
|
564
|
+
type: z13.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
|
|
516
565
|
contractData: zHexDataString.meta({ description: "Contract call data in hexadecimal format" }),
|
|
517
566
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
518
567
|
}).meta({
|
|
@@ -520,95 +569,125 @@ var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
|
520
569
|
id: "EthereumLikeExecuteContractData"
|
|
521
570
|
});
|
|
522
571
|
var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
523
|
-
type:
|
|
572
|
+
type: z13.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
524
573
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
525
574
|
}).meta({
|
|
526
575
|
description: "Ethereum-like send data",
|
|
527
576
|
id: "EthereumLikeSendData"
|
|
528
577
|
});
|
|
529
|
-
var zEthereumLikeTransactionData =
|
|
578
|
+
var zEthereumLikeTransactionData = z13.discriminatedUnion("type", [
|
|
530
579
|
zEthereumLikeDeployContractData,
|
|
531
580
|
zEthereumLikeExecuteContractData,
|
|
532
581
|
zEthereumLikeSendData
|
|
533
582
|
]);
|
|
534
|
-
var zEthereumLikeTransferCoinFields =
|
|
583
|
+
var zEthereumLikeTransferCoinFields = z13.object({
|
|
535
584
|
type: zEthereumLikeTransferTransactionType,
|
|
536
|
-
gasPrice:
|
|
537
|
-
gasLimit:
|
|
538
|
-
nonce:
|
|
585
|
+
gasPrice: z13.string(),
|
|
586
|
+
gasLimit: z13.string(),
|
|
587
|
+
nonce: z13.string()
|
|
539
588
|
});
|
|
540
589
|
var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
|
|
541
590
|
type: zEthereumLikeContractTransactionType,
|
|
542
|
-
contractData:
|
|
591
|
+
contractData: z13.string().meta({ description: "Contract deployment or contract execution data" })
|
|
543
592
|
});
|
|
544
|
-
var
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
593
|
+
var zEthereumLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
594
|
+
zCommonTransactionResponse.extend(zEthereumLikeTransferCoinFields.shape).meta({ description: "Ethereum-like transfer transaction" }),
|
|
595
|
+
zCommonTransactionResponse.extend(zEthereumLikeContractCoinFields.shape).meta({ description: "Ethereum-like contract transaction" })
|
|
596
|
+
]).meta({ description: "Ethereum-like contract transaction" });
|
|
597
|
+
|
|
598
|
+
// src/networks/ethereum/index.ts
|
|
599
|
+
var ETHEREUM_SPEC = {
|
|
600
|
+
family: NetworkFamily.ETHEREUM_LIKE,
|
|
601
|
+
zAssetFields: zEthereumLikeAssetFields,
|
|
602
|
+
zLiveData: zEthereumLikeLiveData,
|
|
603
|
+
zTransactionType: zEthereumLikeTransactionType,
|
|
604
|
+
zTransactionData: zEthereumLikeTransactionData,
|
|
605
|
+
zSendTransactionData: zEthereumLikeSendData,
|
|
606
|
+
zEstimatedFees: zEthereumLikeEstimatedFees,
|
|
607
|
+
zTransactionResponse: zEthereumLikeTransactionResponse,
|
|
608
|
+
zStakingFields: zEthereumLikeStakingFields};
|
|
609
|
+
var zGenericAssetFields = z13.object({ type: z13.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" }) }).meta({ description: "Generic-like" });
|
|
610
|
+
var zGenericLiveData = zCommonLiveData.extend({
|
|
611
|
+
type: z13.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" })
|
|
549
612
|
}).meta({ description: "Generic-like" });
|
|
550
|
-
var zGenericTransactionType =
|
|
551
|
-
var zGenericTransactionData =
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
613
|
+
var zGenericTransactionType = z13.enum(["GENERIC_TRANSACTION"]).meta({ description: "Generic transaction type" });
|
|
614
|
+
var zGenericTransactionData = z13.discriminatedUnion("type", [
|
|
615
|
+
z13.object({
|
|
616
|
+
type: z13.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
617
|
+
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
618
|
+
rawTx: z13.string().meta({ description: "Raw tx" })
|
|
619
|
+
}).meta({
|
|
620
|
+
description: "Generic transaction data",
|
|
621
|
+
id: "GenericTransactionData"
|
|
622
|
+
})
|
|
623
|
+
]);
|
|
624
|
+
var zGenericTransactionResponse = z13.discriminatedUnion("type", [
|
|
625
|
+
zCommonTransactionResponse.extend({ type: zGenericTransactionType }).meta({ description: "Generic transaction" })
|
|
626
|
+
]);
|
|
627
|
+
|
|
628
|
+
// src/networks/generic/index.ts
|
|
629
|
+
var GENERIC_SPEC = {
|
|
630
|
+
family: NetworkFamily.GENERIC_LIKE,
|
|
631
|
+
zAssetFields: zGenericAssetFields,
|
|
632
|
+
zLiveData: zGenericLiveData,
|
|
633
|
+
zTransactionType: zGenericTransactionType,
|
|
634
|
+
zTransactionData: zGenericTransactionData,
|
|
635
|
+
zSendTransactionData: z13.never(),
|
|
636
|
+
zEstimatedFees: z13.never(),
|
|
637
|
+
zTransactionResponse: zGenericTransactionResponse,
|
|
638
|
+
zStakingFields: z13.never()};
|
|
639
|
+
var zPolkadotLikeAssetFields = z13.object({
|
|
640
|
+
type: z13.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
|
|
641
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
563
642
|
}).meta({ description: "Polkadot-like" });
|
|
564
|
-
var zPolkadotUnbondingAmount =
|
|
565
|
-
amount:
|
|
566
|
-
waiting_time:
|
|
567
|
-
});
|
|
568
|
-
var zPolkadotLikeStakingData =
|
|
569
|
-
info:
|
|
570
|
-
controllerAddress:
|
|
571
|
-
rewardsDestination:
|
|
572
|
-
proxies:
|
|
573
|
-
legacyStaking:
|
|
574
|
-
isNominator:
|
|
643
|
+
var zPolkadotUnbondingAmount = z13.object({
|
|
644
|
+
amount: z13.string().meta({ description: "Amount" }),
|
|
645
|
+
waiting_time: z13.string().meta({ description: "Waiting time" })
|
|
646
|
+
});
|
|
647
|
+
var zPolkadotLikeStakingData = z13.object({
|
|
648
|
+
info: z13.object({
|
|
649
|
+
controllerAddress: z13.string().nullable().meta({ description: "Controller address" }),
|
|
650
|
+
rewardsDestination: z13.string().nullable().meta({ description: "Rewards destination" }),
|
|
651
|
+
proxies: z13.array(z13.string()).meta({ description: "Proxies" }),
|
|
652
|
+
legacyStaking: z13.boolean().meta({ description: "True if account uses legacy staking" }),
|
|
653
|
+
isNominator: z13.boolean().meta({ description: "True if is nominator" })
|
|
575
654
|
}),
|
|
576
|
-
balances:
|
|
577
|
-
free:
|
|
578
|
-
reserved:
|
|
579
|
-
frozen:
|
|
580
|
-
bonded:
|
|
581
|
-
available:
|
|
582
|
-
unbonding:
|
|
583
|
-
unbonded:
|
|
584
|
-
totalUnbonding:
|
|
585
|
-
totalUnbonded:
|
|
655
|
+
balances: z13.object({
|
|
656
|
+
free: z13.string().meta({ description: "Free balance" }),
|
|
657
|
+
reserved: z13.string().meta({ description: "Reserved balance" }),
|
|
658
|
+
frozen: z13.string().meta({ description: "Frozen balance" }),
|
|
659
|
+
bonded: z13.string().meta({ description: "Bonded balance" }),
|
|
660
|
+
available: z13.string().meta({ description: "Available balance" }),
|
|
661
|
+
unbonding: z13.array(zPolkadotUnbondingAmount).meta({ description: "Unbonding balances" }),
|
|
662
|
+
unbonded: z13.array(zPolkadotUnbondingAmount).meta({ description: "Unbonded balances" }),
|
|
663
|
+
totalUnbonding: z13.string().meta({ description: "Total unbonding" }),
|
|
664
|
+
totalUnbonded: z13.string().meta({ description: "Total unbonded" })
|
|
586
665
|
}),
|
|
587
|
-
anonymousProxy:
|
|
588
|
-
address:
|
|
589
|
-
createdAt:
|
|
590
|
-
isController:
|
|
591
|
-
isMain:
|
|
592
|
-
balances:
|
|
593
|
-
free:
|
|
594
|
-
reserved:
|
|
595
|
-
frozen:
|
|
596
|
-
bonded:
|
|
597
|
-
available:
|
|
598
|
-
total:
|
|
666
|
+
anonymousProxy: z13.object({
|
|
667
|
+
address: z13.string().meta({ description: "Address" }),
|
|
668
|
+
createdAt: z13.string().meta({ description: "Creation date" }),
|
|
669
|
+
isController: z13.boolean().meta({ description: "True if is controller" }),
|
|
670
|
+
isMain: z13.boolean().meta({ description: "True if is main" }),
|
|
671
|
+
balances: z13.object({
|
|
672
|
+
free: z13.string().meta({ description: "Anonymous proxy free balance" }),
|
|
673
|
+
reserved: z13.string().meta({ description: "Anonymous proxy reserved balance" }),
|
|
674
|
+
frozen: z13.string().meta({ description: "Anonymous proxy frozen balance" }),
|
|
675
|
+
bonded: z13.string().meta({ description: "Anonymous proxy bonded balance" }),
|
|
676
|
+
available: z13.string().meta({ description: "Anonymous proxy available balance" }),
|
|
677
|
+
total: z13.string().meta({ description: "Anonymous proxy total balance" })
|
|
599
678
|
}).nullable(),
|
|
600
|
-
blockHeight:
|
|
601
|
-
extIndex:
|
|
602
|
-
index:
|
|
603
|
-
kind:
|
|
679
|
+
blockHeight: z13.string().meta({ description: "Anonymous proxy block height" }),
|
|
680
|
+
extIndex: z13.string().meta({ description: "Ext index" }),
|
|
681
|
+
index: z13.string().meta({ description: "Index" }),
|
|
682
|
+
kind: z13.string().meta({ description: "Kind" })
|
|
604
683
|
}).nullable().meta({ description: "Anonymous proxy" })
|
|
605
684
|
}).nullable().meta({ description: "Polkadot-like staking data" });
|
|
606
|
-
var zPolkadotLikeStakingFields =
|
|
607
|
-
type:
|
|
685
|
+
var zPolkadotLikeStakingFields = z13.object({
|
|
686
|
+
type: z13.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
|
|
608
687
|
staking: zPolkadotLikeStakingData.optional()
|
|
609
688
|
});
|
|
610
689
|
var zPolkadotLikeLiveData = zCommonLiveData.extend(zPolkadotLikeStakingFields.shape).meta({ description: "Polkadot-like" });
|
|
611
|
-
var zPolkadotLikeTransactionType =
|
|
690
|
+
var zPolkadotLikeTransactionType = z13.enum([
|
|
612
691
|
"POLKADOT_LIKE_SEND",
|
|
613
692
|
"POLKADOT_LIKE_RECEIVE",
|
|
614
693
|
"POLKADOT_LIKE_ADDPROXY",
|
|
@@ -630,25 +709,25 @@ var zPolkadotLikeTransactionType = z9.enum([
|
|
|
630
709
|
"POLKADOT_LIKE_CHILL",
|
|
631
710
|
"POLKADOT_LIKE_TRANSFERALL"
|
|
632
711
|
]).meta({ description: "Polkadot-like transaction type" });
|
|
633
|
-
var zPolkadotRewardDestination =
|
|
634
|
-
var zPolkadotLikeAddProxyData =
|
|
635
|
-
type:
|
|
712
|
+
var zPolkadotRewardDestination = z13.enum(["Staked", "Stash"]);
|
|
713
|
+
var zPolkadotLikeAddProxyData = z13.object({
|
|
714
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
636
715
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
637
|
-
kind:
|
|
638
|
-
proxy:
|
|
716
|
+
kind: z13.literal("Staking").meta({ description: "Proxy kind" }),
|
|
717
|
+
proxy: z13.string().meta({ description: "Proxy address" })
|
|
639
718
|
}).meta({
|
|
640
719
|
description: "Polkadot-like add proxy data",
|
|
641
720
|
id: "PolkadotLikeAddProxyData"
|
|
642
721
|
});
|
|
643
|
-
var zPolkadotLikeAnonymousProxyData =
|
|
644
|
-
type:
|
|
722
|
+
var zPolkadotLikeAnonymousProxyData = z13.object({
|
|
723
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
645
724
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
646
725
|
}).meta({
|
|
647
726
|
description: "Polkadot-like anonymous proxy data",
|
|
648
727
|
id: "PolkadotLikeAnonymousProxyData"
|
|
649
728
|
});
|
|
650
|
-
var zPolkadotLikeBondData =
|
|
651
|
-
type:
|
|
729
|
+
var zPolkadotLikeBondData = z13.object({
|
|
730
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
652
731
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
653
732
|
payee: zPolkadotRewardDestination,
|
|
654
733
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
@@ -656,75 +735,75 @@ var zPolkadotLikeBondData = z9.object({
|
|
|
656
735
|
description: "Polkadot-like bond data",
|
|
657
736
|
id: "PolkadotLikeBondData"
|
|
658
737
|
});
|
|
659
|
-
var zPolkadotLikeBondExtraData =
|
|
660
|
-
type:
|
|
738
|
+
var zPolkadotLikeBondExtraData = z13.object({
|
|
739
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
661
740
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
662
741
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
663
742
|
}).meta({
|
|
664
743
|
description: "Polkadot-like bond extra data",
|
|
665
744
|
id: "PolkadotLikeBondExtraData"
|
|
666
745
|
});
|
|
667
|
-
var zPolkadotLikeChillData =
|
|
668
|
-
type:
|
|
746
|
+
var zPolkadotLikeChillData = z13.object({
|
|
747
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
669
748
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
670
749
|
}).meta({
|
|
671
750
|
description: "Polkadot-like chill data",
|
|
672
751
|
id: "PolkadotLikeChillData"
|
|
673
752
|
});
|
|
674
|
-
var zPolkadotLikeKillAnonymousData =
|
|
675
|
-
type:
|
|
753
|
+
var zPolkadotLikeKillAnonymousData = z13.object({
|
|
754
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
676
755
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
677
756
|
}).meta({
|
|
678
757
|
description: "Polkadot-like kill anonymous data",
|
|
679
758
|
id: "PolkadotLikeKillAnonymousData"
|
|
680
759
|
});
|
|
681
|
-
var zPolkadotLikeRebondData =
|
|
682
|
-
type:
|
|
760
|
+
var zPolkadotLikeRebondData = z13.object({
|
|
761
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
683
762
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
684
763
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
685
764
|
}).meta({
|
|
686
765
|
description: "Polkadot-like rebond data",
|
|
687
766
|
id: "PolkadotLikeRebondData"
|
|
688
767
|
});
|
|
689
|
-
var zPolkadotLikeRemoveProxyData =
|
|
690
|
-
type:
|
|
768
|
+
var zPolkadotLikeRemoveProxyData = z13.object({
|
|
769
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
691
770
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
692
|
-
kind:
|
|
693
|
-
proxy:
|
|
771
|
+
kind: z13.literal("Staking"),
|
|
772
|
+
proxy: z13.string().meta({ description: "Proxy address" })
|
|
694
773
|
}).meta({
|
|
695
774
|
description: "Polkadot-like remove proxy data",
|
|
696
775
|
id: "PolkadotLikeRemoveProxyData"
|
|
697
776
|
});
|
|
698
777
|
var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
699
|
-
type:
|
|
778
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
|
|
700
779
|
}).meta({
|
|
701
780
|
description: "Polkadot-like send data",
|
|
702
781
|
id: "PolkadotLikeSendData"
|
|
703
782
|
});
|
|
704
|
-
var zPolkadotLikeSetPayeeData =
|
|
705
|
-
type:
|
|
783
|
+
var zPolkadotLikeSetPayeeData = z13.object({
|
|
784
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
706
785
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
707
786
|
payee: zPolkadotRewardDestination
|
|
708
787
|
}).meta({
|
|
709
788
|
description: "Polkadot-like set payee data",
|
|
710
789
|
id: "PolkadotLikeSetPayeeData"
|
|
711
790
|
});
|
|
712
|
-
var zPolkadotLikeUnbondData =
|
|
713
|
-
type:
|
|
791
|
+
var zPolkadotLikeUnbondData = z13.object({
|
|
792
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
714
793
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
715
794
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
716
795
|
}).meta({
|
|
717
796
|
description: "Polkadot-like unbond data",
|
|
718
797
|
id: "PolkadotLikeUnbondData"
|
|
719
798
|
});
|
|
720
|
-
var zPolkadotLikeWithdrawUnbondedData =
|
|
721
|
-
type:
|
|
799
|
+
var zPolkadotLikeWithdrawUnbondedData = z13.object({
|
|
800
|
+
type: z13.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
722
801
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
723
802
|
}).meta({
|
|
724
803
|
description: "Polkadot-like withdraw unbonded data",
|
|
725
804
|
id: "PolkadotLikeWithdrawUnbondedData"
|
|
726
805
|
});
|
|
727
|
-
var zPolkadotLikeTransactionData =
|
|
806
|
+
var zPolkadotLikeTransactionData = z13.discriminatedUnion("type", [
|
|
728
807
|
zPolkadotLikeAddProxyData,
|
|
729
808
|
zPolkadotLikeAnonymousProxyData,
|
|
730
809
|
zPolkadotLikeBondData,
|
|
@@ -738,78 +817,106 @@ var zPolkadotLikeTransactionData = z9.discriminatedUnion("type", [
|
|
|
738
817
|
zPolkadotLikeUnbondData,
|
|
739
818
|
zPolkadotLikeWithdrawUnbondedData
|
|
740
819
|
]);
|
|
741
|
-
var zPolkadotLikeTransactionResponse =
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
820
|
+
var zPolkadotLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
821
|
+
zCommonTransactionResponse.extend({ type: zPolkadotLikeTransactionType }).meta({ description: "Polkadot-like transaction" })
|
|
822
|
+
]);
|
|
823
|
+
|
|
824
|
+
// src/networks/polkadot/index.ts
|
|
825
|
+
var POLKADOT_SPEC = {
|
|
826
|
+
family: NetworkFamily.POLKADOT_LIKE,
|
|
827
|
+
zAssetFields: zPolkadotLikeAssetFields,
|
|
828
|
+
zLiveData: zPolkadotLikeLiveData,
|
|
829
|
+
zTransactionType: zPolkadotLikeTransactionType,
|
|
830
|
+
zTransactionData: zPolkadotLikeTransactionData,
|
|
831
|
+
zSendTransactionData: zPolkadotLikeSendData,
|
|
832
|
+
zEstimatedFees: z13.never(),
|
|
833
|
+
zTransactionResponse: zPolkadotLikeTransactionResponse,
|
|
834
|
+
zStakingFields: zPolkadotLikeStakingFields};
|
|
835
|
+
var zRippleLikeAssetFields = z13.object({
|
|
836
|
+
type: z13.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" }),
|
|
837
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
745
838
|
}).meta({ description: "Ripple-like" });
|
|
746
839
|
var zRippleLikeLiveData = zCommonLiveData.extend({
|
|
747
|
-
type:
|
|
840
|
+
type: z13.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" })
|
|
748
841
|
}).meta({ description: "Ripple-like" });
|
|
749
|
-
var zRippleLikeEstimatedFees =
|
|
750
|
-
type:
|
|
842
|
+
var zRippleLikeEstimatedFees = z13.object({
|
|
843
|
+
type: z13.literal(NetworkFamily.RIPPLE_LIKE),
|
|
751
844
|
fee: zIntString
|
|
752
845
|
}).meta({ description: "Ripple-like fees" });
|
|
753
|
-
var zRippleLikeTransactionType =
|
|
846
|
+
var zRippleLikeTransactionType = z13.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).meta({ description: "Ripple-like transaction type" });
|
|
754
847
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
755
|
-
type:
|
|
848
|
+
type: z13.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
756
849
|
destinationTag: zIntString.nullable().meta({ description: "Destination tag" }),
|
|
757
850
|
feeStrategy: zFeeStrategyCustom.meta({ description: "Ripple-like fee strategy" })
|
|
758
851
|
}).meta({
|
|
759
852
|
description: "Ripple-like send data",
|
|
760
853
|
id: "RippleLikeSendData"
|
|
761
854
|
});
|
|
762
|
-
var zRippleLikeTransactionData =
|
|
763
|
-
var zRippleLikeTransactionResponse =
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
855
|
+
var zRippleLikeTransactionData = z13.discriminatedUnion("type", [zRippleLikeSendData]);
|
|
856
|
+
var zRippleLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
857
|
+
zCommonTransactionResponse.extend({
|
|
858
|
+
type: zRippleLikeTransactionType,
|
|
859
|
+
memos: z13.array(z13.string()),
|
|
860
|
+
destinationTag: z13.string()
|
|
861
|
+
}).meta({ description: "Ripple-like transaction" })
|
|
862
|
+
]);
|
|
863
|
+
|
|
864
|
+
// src/networks/ripple/index.ts
|
|
865
|
+
var RIPPLE_SPEC = {
|
|
866
|
+
family: NetworkFamily.RIPPLE_LIKE,
|
|
867
|
+
zAssetFields: zRippleLikeAssetFields,
|
|
868
|
+
zLiveData: zRippleLikeLiveData,
|
|
869
|
+
zTransactionType: zRippleLikeTransactionType,
|
|
870
|
+
zTransactionData: zRippleLikeTransactionData,
|
|
871
|
+
zSendTransactionData: zRippleLikeSendData,
|
|
872
|
+
zEstimatedFees: zRippleLikeEstimatedFees,
|
|
873
|
+
zTransactionResponse: zRippleLikeTransactionResponse,
|
|
874
|
+
zStakingFields: z13.never()};
|
|
875
|
+
var zSolanaLikeAssetFields = z13.object({
|
|
876
|
+
type: z13.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
|
|
877
|
+
address: z13.string().nullable().meta({ description: "Account address" }),
|
|
878
|
+
contractAddress: z13.string().meta({
|
|
772
879
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
773
880
|
}).nullable().optional()
|
|
774
881
|
}).meta({ description: "Solana-like" });
|
|
775
|
-
var zSolanaStakingAccountStatus =
|
|
776
|
-
var zSolanaLikeStakingData =
|
|
777
|
-
staked:
|
|
778
|
-
rewards:
|
|
779
|
-
total:
|
|
780
|
-
last7:
|
|
781
|
-
last30:
|
|
882
|
+
var zSolanaStakingAccountStatus = z13.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).meta({ description: "Staking account status" });
|
|
883
|
+
var zSolanaLikeStakingData = z13.object({
|
|
884
|
+
staked: z13.string().meta({ description: "Staked balance" }),
|
|
885
|
+
rewards: z13.object({
|
|
886
|
+
total: z13.string().meta({ description: "Total rewards" }),
|
|
887
|
+
last7: z13.string().meta({ description: "Rewards on last 7 days" }),
|
|
888
|
+
last30: z13.string().meta({ description: "Rewards on last 30 days" })
|
|
782
889
|
}),
|
|
783
|
-
stakes:
|
|
784
|
-
|
|
785
|
-
uid:
|
|
786
|
-
baseAccountUid:
|
|
787
|
-
pubKey:
|
|
788
|
-
validatorPubKey:
|
|
789
|
-
initialAmount:
|
|
790
|
-
activeAmount:
|
|
791
|
-
inactiveAmount:
|
|
792
|
-
totalBalance:
|
|
793
|
-
creationDate:
|
|
794
|
-
activationEpoch:
|
|
795
|
-
activationDate:
|
|
796
|
-
deactivationEpoch:
|
|
797
|
-
deactivationDate:
|
|
890
|
+
stakes: z13.array(
|
|
891
|
+
z13.object({
|
|
892
|
+
uid: z13.string(),
|
|
893
|
+
baseAccountUid: z13.string(),
|
|
894
|
+
pubKey: z13.string().meta({ description: "Public key" }),
|
|
895
|
+
validatorPubKey: z13.string().nullable().meta({ description: "Validator public key" }),
|
|
896
|
+
initialAmount: z13.string().meta({ description: "Initial amount" }),
|
|
897
|
+
activeAmount: z13.string().meta({ description: "Active amount" }),
|
|
898
|
+
inactiveAmount: z13.string().meta({ description: "Inactive amount" }),
|
|
899
|
+
totalBalance: z13.string().meta({ description: "Total balance" }),
|
|
900
|
+
creationDate: z13.string().meta({ description: "Creation date" }),
|
|
901
|
+
activationEpoch: z13.string().nullable().meta({ description: "Activation epoch" }),
|
|
902
|
+
activationDate: z13.string().nullable().meta({ description: "Activation date" }),
|
|
903
|
+
deactivationEpoch: z13.string().nullable().meta({ description: "Deactivation epoch" }),
|
|
904
|
+
deactivationDate: z13.string().nullable().meta({ description: "Deactivation date" }),
|
|
798
905
|
status: zSolanaStakingAccountStatus,
|
|
799
|
-
rentExemptReserve:
|
|
800
|
-
withdrawableAmount:
|
|
801
|
-
totalRewards:
|
|
802
|
-
creationTxHash:
|
|
803
|
-
actionsTxHashes:
|
|
906
|
+
rentExemptReserve: z13.string().meta({ description: "Rent exempt reserve" }),
|
|
907
|
+
withdrawableAmount: z13.string().meta({ description: "Withdrawable amount" }),
|
|
908
|
+
totalRewards: z13.string().meta({ description: "Total rewards" }),
|
|
909
|
+
creationTxHash: z13.string().nullable().meta({ description: "Creation transaction hash" }),
|
|
910
|
+
actionsTxHashes: z13.array(z13.string()).meta({ description: "Actions transactions hashes" })
|
|
804
911
|
})
|
|
805
912
|
)
|
|
806
913
|
}).nullable().meta({ description: "Solana-like staking data" });
|
|
807
|
-
var zSolanaLikeStakingFields =
|
|
808
|
-
type:
|
|
914
|
+
var zSolanaLikeStakingFields = z13.object({
|
|
915
|
+
type: z13.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
|
|
809
916
|
staking: zSolanaLikeStakingData.optional()
|
|
810
917
|
});
|
|
811
918
|
var zSolanaLikeLiveData = zCommonLiveData.extend(zSolanaLikeStakingFields.shape).meta({ description: "Solana-like" });
|
|
812
|
-
var zSolanaLikeTransactionType =
|
|
919
|
+
var zSolanaLikeTransactionType = z13.enum([
|
|
813
920
|
"SOLANA_LIKE_SEND",
|
|
814
921
|
"SOLANA_LIKE_RECEIVE",
|
|
815
922
|
"SOLANA_LIKE_CREATE_DELEGATE_STAKE",
|
|
@@ -824,43 +931,43 @@ var zSolanaLikeTransactionType = z9.enum([
|
|
|
824
931
|
"SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT"
|
|
825
932
|
]).meta({ description: "Solana-like transaction type" });
|
|
826
933
|
var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
827
|
-
type:
|
|
828
|
-
recipient:
|
|
934
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
|
|
935
|
+
recipient: z13.string().meta({ description: "Delegated vote address" }),
|
|
829
936
|
// Re-described
|
|
830
937
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
831
938
|
}).meta({
|
|
832
939
|
description: "Solana-like create delegate stake data",
|
|
833
940
|
id: "SolanaLikeCreateDelegateStakeData"
|
|
834
941
|
});
|
|
835
|
-
var zSolanaLikeDeactivateStakeData =
|
|
836
|
-
type:
|
|
942
|
+
var zSolanaLikeDeactivateStakeData = z13.object({
|
|
943
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
837
944
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
838
945
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
839
|
-
stakeAccount:
|
|
946
|
+
stakeAccount: z13.string().meta({ description: "Stake account address" }),
|
|
840
947
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
841
948
|
// No recipient, no amount
|
|
842
949
|
}).meta({
|
|
843
950
|
description: "Solana-like deactivate stake data",
|
|
844
951
|
id: "SolanaLikeDeactivateStakeData"
|
|
845
952
|
});
|
|
846
|
-
var zSolanaLikeDelegateStakeData =
|
|
847
|
-
type:
|
|
953
|
+
var zSolanaLikeDelegateStakeData = z13.object({
|
|
954
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
848
955
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
849
956
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
850
|
-
recipient:
|
|
851
|
-
stakeAccount:
|
|
957
|
+
recipient: z13.string().meta({ description: "Delegated vote address" }),
|
|
958
|
+
stakeAccount: z13.string().meta({ description: "Stake account address" }),
|
|
852
959
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
853
960
|
// No amount
|
|
854
961
|
}).meta({
|
|
855
962
|
description: "Solana-like delegate stake data",
|
|
856
963
|
id: "SolanaLikeDelegateStakeData"
|
|
857
964
|
});
|
|
858
|
-
var zSolanaLikeMergeStakeData =
|
|
859
|
-
type:
|
|
965
|
+
var zSolanaLikeMergeStakeData = z13.object({
|
|
966
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
860
967
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
861
968
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
862
|
-
mergeSrcAccount:
|
|
863
|
-
mergeDstAccount:
|
|
969
|
+
mergeSrcAccount: z13.string().meta({ description: "Source stake address" }),
|
|
970
|
+
mergeDstAccount: z13.string().meta({ description: "Destination stake address" }),
|
|
864
971
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
865
972
|
// No recipient, no amount
|
|
866
973
|
}).meta({
|
|
@@ -868,42 +975,42 @@ var zSolanaLikeMergeStakeData = z9.object({
|
|
|
868
975
|
id: "SolanaLikeMergeStakeData"
|
|
869
976
|
});
|
|
870
977
|
var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
871
|
-
type:
|
|
978
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
|
|
872
979
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
873
980
|
}).meta({
|
|
874
981
|
description: "Solana-like send data",
|
|
875
982
|
id: "SolanaLikeSendData"
|
|
876
983
|
});
|
|
877
|
-
var zSolanaLikeSplitDeactivateStakeData =
|
|
878
|
-
type:
|
|
984
|
+
var zSolanaLikeSplitDeactivateStakeData = z13.object({
|
|
985
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
879
986
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
880
987
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
881
988
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
882
|
-
stakeAccount:
|
|
989
|
+
stakeAccount: z13.string().meta({ description: "Stake account address" }),
|
|
883
990
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
884
991
|
// No recipient
|
|
885
992
|
}).meta({
|
|
886
993
|
description: "Solana-like split deactivate stake data",
|
|
887
994
|
id: "SolanaLikeSplitDeactivateStakeData"
|
|
888
995
|
});
|
|
889
|
-
var zSolanaLikeSplitStakeData =
|
|
890
|
-
type:
|
|
996
|
+
var zSolanaLikeSplitStakeData = z13.object({
|
|
997
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
891
998
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
892
999
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
893
1000
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
894
|
-
stakeAccount:
|
|
1001
|
+
stakeAccount: z13.string().meta({ description: "Stake account address" }),
|
|
895
1002
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
896
1003
|
// No recipient
|
|
897
1004
|
}).meta({
|
|
898
1005
|
description: "Solana-like split stake data",
|
|
899
1006
|
id: "SolanaLikeSplitStakeData"
|
|
900
1007
|
});
|
|
901
|
-
var zSolanaLikeWithdrawStakeData =
|
|
902
|
-
type:
|
|
1008
|
+
var zSolanaLikeWithdrawStakeData = z13.object({
|
|
1009
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
903
1010
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
904
1011
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
905
1012
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
906
|
-
stakeAccount:
|
|
1013
|
+
stakeAccount: z13.string().meta({ description: "Stake account address" }),
|
|
907
1014
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
908
1015
|
// No recipient
|
|
909
1016
|
}).meta({
|
|
@@ -911,21 +1018,21 @@ var zSolanaLikeWithdrawStakeData = z9.object({
|
|
|
911
1018
|
id: "SolanaLikeWithdrawStakeData"
|
|
912
1019
|
});
|
|
913
1020
|
var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
914
|
-
type:
|
|
1021
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
915
1022
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
916
1023
|
}).meta({
|
|
917
1024
|
description: "Solana-like send token data",
|
|
918
1025
|
id: "SolanaLikeSendTokenData"
|
|
919
1026
|
});
|
|
920
1027
|
var zSolanaLikeFundAndSendTokenData = zCommonTransactionData.extend({
|
|
921
|
-
type:
|
|
1028
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_AND_SEND_TOKEN),
|
|
922
1029
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
923
1030
|
}).meta({
|
|
924
1031
|
description: "Solana-like fund token account and send token data",
|
|
925
1032
|
id: "SolanaLikeFundAndSendTokenData"
|
|
926
1033
|
});
|
|
927
|
-
var zSolanaLikeCreateTokenAccountData =
|
|
928
|
-
type:
|
|
1034
|
+
var zSolanaLikeCreateTokenAccountData = z13.object({
|
|
1035
|
+
type: z13.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT),
|
|
929
1036
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
930
1037
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
931
1038
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
@@ -933,7 +1040,7 @@ var zSolanaLikeCreateTokenAccountData = z9.object({
|
|
|
933
1040
|
description: "Solana-like create token account",
|
|
934
1041
|
id: "SolanaLikeCreateTokenAccountData"
|
|
935
1042
|
});
|
|
936
|
-
var zSolanaLikeTransactionData =
|
|
1043
|
+
var zSolanaLikeTransactionData = z13.discriminatedUnion("type", [
|
|
937
1044
|
zSolanaLikeCreateDelegateStakeData,
|
|
938
1045
|
zSolanaLikeDeactivateStakeData,
|
|
939
1046
|
zSolanaLikeDelegateStakeData,
|
|
@@ -946,61 +1053,89 @@ var zSolanaLikeTransactionData = z9.discriminatedUnion("type", [
|
|
|
946
1053
|
zSolanaLikeFundAndSendTokenData,
|
|
947
1054
|
zSolanaLikeCreateTokenAccountData
|
|
948
1055
|
]);
|
|
949
|
-
var zSolanaLikeTransactionResponse =
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1056
|
+
var zSolanaLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
1057
|
+
zCommonTransactionResponse.extend({ type: zSolanaLikeTransactionType }).meta({ description: "Solana-like transaction" })
|
|
1058
|
+
]);
|
|
1059
|
+
|
|
1060
|
+
// src/networks/solana/index.ts
|
|
1061
|
+
var SOLANA_SPEC = {
|
|
1062
|
+
family: NetworkFamily.SOLANA_LIKE,
|
|
1063
|
+
zAssetFields: zSolanaLikeAssetFields,
|
|
1064
|
+
zLiveData: zSolanaLikeLiveData,
|
|
1065
|
+
zTransactionType: zSolanaLikeTransactionType,
|
|
1066
|
+
zTransactionData: zSolanaLikeTransactionData,
|
|
1067
|
+
zSendTransactionData: zSolanaLikeSendData,
|
|
1068
|
+
zEstimatedFees: z13.never(),
|
|
1069
|
+
zTransactionResponse: zSolanaLikeTransactionResponse,
|
|
1070
|
+
zStakingFields: zSolanaLikeStakingFields};
|
|
1071
|
+
var zStellarLikeAssetFields = z13.object({
|
|
1072
|
+
type: z13.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" }),
|
|
1073
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
953
1074
|
}).meta({ description: "Stellar-like" });
|
|
954
1075
|
var zStellarLikeLiveData = zCommonLiveData.extend({
|
|
955
|
-
type:
|
|
1076
|
+
type: z13.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" })
|
|
956
1077
|
}).meta({ description: "Stellar-like" });
|
|
957
|
-
var zStellarLikeEstimatedFees =
|
|
958
|
-
type:
|
|
1078
|
+
var zStellarLikeEstimatedFees = z13.object({
|
|
1079
|
+
type: z13.literal(NetworkFamily.STELLAR_LIKE),
|
|
959
1080
|
fee: zIntString
|
|
960
1081
|
}).meta({ description: "Stellar-like fees" });
|
|
961
|
-
var zStellarLikeTransactionType =
|
|
962
|
-
var zStellarMemo =
|
|
963
|
-
|
|
964
|
-
MEMO_TEXT:
|
|
1082
|
+
var zStellarLikeTransactionType = z13.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).meta({ description: "Stellar-like transaction type" });
|
|
1083
|
+
var zStellarMemo = z13.union([
|
|
1084
|
+
z13.object({
|
|
1085
|
+
MEMO_TEXT: z13.string().max(28).meta({ description: "Text memo (at most a 28 bytes string)" })
|
|
965
1086
|
}).meta({ description: "Text memo" }),
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
MEMO_HASH:
|
|
1087
|
+
z13.object({ MEMO_ID: zIntString.meta({ description: "Id memo (unsigned 64 bits integer)" }) }).meta({ description: "Id memo" }),
|
|
1088
|
+
z13.object({
|
|
1089
|
+
MEMO_HASH: z13.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({ description: "Transaction hash memo (64 bytes hexadecimal string)" })
|
|
969
1090
|
}).meta({ description: "Hash memo" }),
|
|
970
|
-
|
|
971
|
-
MEMO_RETURN:
|
|
1091
|
+
z13.object({
|
|
1092
|
+
MEMO_RETURN: z13.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({
|
|
972
1093
|
description: "A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
|
|
973
1094
|
})
|
|
974
1095
|
}).meta({ description: "Return memo" })
|
|
975
1096
|
]);
|
|
976
1097
|
var zStellarLikeSendData = zCommonTransactionData.extend({
|
|
977
|
-
type:
|
|
1098
|
+
type: z13.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
|
|
978
1099
|
memo: zStellarMemo.nullable().meta({ description: "Stellar memo" }),
|
|
979
1100
|
feeStrategy: zFeeStrategy.meta({ description: "Stellar-like fee strategy" })
|
|
980
1101
|
}).meta({
|
|
981
1102
|
description: "Stellar-like send data",
|
|
982
1103
|
id: "StellarLikeSendData"
|
|
983
1104
|
});
|
|
984
|
-
var zStellarLikeTransactionData =
|
|
985
|
-
var zStellarLikeTransactionResponse =
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1105
|
+
var zStellarLikeTransactionData = z13.discriminatedUnion("type", [zStellarLikeSendData]);
|
|
1106
|
+
var zStellarLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
1107
|
+
zCommonTransactionResponse.extend({ type: zStellarLikeTransactionType }).meta({ description: "Stellar-like transaction" })
|
|
1108
|
+
]);
|
|
1109
|
+
|
|
1110
|
+
// src/networks/stellar/index.ts
|
|
1111
|
+
var STELLAR_SPEC = {
|
|
1112
|
+
family: NetworkFamily.STELLAR_LIKE,
|
|
1113
|
+
zAssetFields: zStellarLikeAssetFields,
|
|
1114
|
+
zLiveData: zStellarLikeLiveData,
|
|
1115
|
+
zTransactionType: zStellarLikeTransactionType,
|
|
1116
|
+
zTransactionData: zStellarLikeTransactionData,
|
|
1117
|
+
zSendTransactionData: zStellarLikeSendData,
|
|
1118
|
+
zEstimatedFees: zStellarLikeEstimatedFees,
|
|
1119
|
+
zTransactionResponse: zStellarLikeTransactionResponse,
|
|
1120
|
+
zStakingFields: z13.never()};
|
|
1121
|
+
var zSuiLikeAssetFields = z13.object({
|
|
1122
|
+
type: z13.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
|
|
1123
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
989
1124
|
}).meta({ description: "Sui-like" });
|
|
990
|
-
var zSuiLikeStakingData =
|
|
991
|
-
totalStaked:
|
|
992
|
-
totalRewards:
|
|
1125
|
+
var zSuiLikeStakingData = z13.object({
|
|
1126
|
+
totalStaked: z13.string().meta({ description: "Total staked amount" }),
|
|
1127
|
+
totalRewards: z13.string().meta({ description: "Total of rewards" })
|
|
993
1128
|
}).nullable().meta({ description: "Sui-like staking data" });
|
|
994
|
-
var zSuiLikeStakingFields =
|
|
995
|
-
type:
|
|
1129
|
+
var zSuiLikeStakingFields = z13.object({
|
|
1130
|
+
type: z13.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
|
|
996
1131
|
staking: zSuiLikeStakingData.optional()
|
|
997
1132
|
});
|
|
998
1133
|
var zSuiLikeLiveData = zCommonLiveData.extend(zSuiLikeStakingFields.shape).meta({ description: "Sui-like" });
|
|
999
|
-
var zSuiLikeEstimatedFees =
|
|
1000
|
-
type:
|
|
1134
|
+
var zSuiLikeEstimatedFees = z13.object({
|
|
1135
|
+
type: z13.literal(NetworkFamily.SUI_LIKE),
|
|
1001
1136
|
fee: zIntString
|
|
1002
1137
|
}).meta({ description: "Sui-like fees" });
|
|
1003
|
-
var zSuiLikeTransactionType =
|
|
1138
|
+
var zSuiLikeTransactionType = z13.enum([
|
|
1004
1139
|
"SUI_LIKE_SEND",
|
|
1005
1140
|
"SUI_LIKE_RECEIVE",
|
|
1006
1141
|
"SUI_LIKE_SEND_TOKEN",
|
|
@@ -1009,21 +1144,21 @@ var zSuiLikeTransactionType = z9.enum([
|
|
|
1009
1144
|
"SUI_LIKE_UNSTAKE"
|
|
1010
1145
|
]).meta({ description: "Sui-like transaction type" });
|
|
1011
1146
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
1012
|
-
type:
|
|
1147
|
+
type: z13.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
1013
1148
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
|
|
1014
1149
|
}).meta({
|
|
1015
1150
|
description: "Sui-like send data",
|
|
1016
1151
|
id: "SuiLikeSendData"
|
|
1017
1152
|
});
|
|
1018
1153
|
var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
1019
|
-
type:
|
|
1154
|
+
type: z13.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
1020
1155
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
|
|
1021
1156
|
}).meta({
|
|
1022
1157
|
description: "Sui-like transfer token data",
|
|
1023
1158
|
id: "SuiLikeTransferTokenData"
|
|
1024
1159
|
});
|
|
1025
|
-
var zSuiLikeStakeData =
|
|
1026
|
-
type:
|
|
1160
|
+
var zSuiLikeStakeData = z13.object({
|
|
1161
|
+
type: z13.literal(zSuiLikeTransactionType.enum.SUI_LIKE_STAKE),
|
|
1027
1162
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
|
|
1028
1163
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
1029
1164
|
currency: zCurrencyString.meta({
|
|
@@ -1031,55 +1166,69 @@ var zSuiLikeStakeData = z9.object({
|
|
|
1031
1166
|
}),
|
|
1032
1167
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
1033
1168
|
// DELEGATE does not have recipient, but has validator instead
|
|
1034
|
-
validator:
|
|
1169
|
+
validator: z13.string().nonempty().meta({ description: "Validator address" })
|
|
1035
1170
|
}).meta({
|
|
1036
1171
|
description: "Sui-like stake data",
|
|
1037
1172
|
id: "SuiLikeStakeData"
|
|
1038
1173
|
});
|
|
1039
|
-
var zSuiLikeUnstakeData =
|
|
1040
|
-
type:
|
|
1174
|
+
var zSuiLikeUnstakeData = z13.object({
|
|
1175
|
+
type: z13.literal(zSuiLikeTransactionType.enum.SUI_LIKE_UNSTAKE),
|
|
1041
1176
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
|
|
1042
1177
|
currency: zCurrencyString.meta({
|
|
1043
1178
|
description: "Will be deprecated soon, use Account.network. Transaction currency"
|
|
1044
1179
|
}),
|
|
1045
1180
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
1046
|
-
stakedSuiId:
|
|
1181
|
+
stakedSuiId: z13.string().nonempty().meta({ description: "Staked object to (partially?) unstake" }),
|
|
1047
1182
|
amount: zUnsignedIntString.meta({ description: "Amount to unstake from the position" }),
|
|
1048
|
-
useAllAmount:
|
|
1183
|
+
useAllAmount: z13.boolean().meta({
|
|
1049
1184
|
description: "Whether to unstake the full amount (triggers different sets of transaction commands)"
|
|
1050
1185
|
})
|
|
1051
1186
|
}).meta({
|
|
1052
1187
|
description: "Sui-like unstake data",
|
|
1053
1188
|
id: "SuiLikeUnstakeData"
|
|
1054
1189
|
});
|
|
1055
|
-
var zSuiLikeTransactionData =
|
|
1190
|
+
var zSuiLikeTransactionData = z13.discriminatedUnion("type", [
|
|
1056
1191
|
zSuiLikeSendData,
|
|
1057
1192
|
zSuiLikeTransferTokenData,
|
|
1058
1193
|
zSuiLikeStakeData,
|
|
1059
1194
|
zSuiLikeUnstakeData
|
|
1060
1195
|
]);
|
|
1061
|
-
var zSuiLikeTransactionResponse =
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1196
|
+
var zSuiLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
1197
|
+
zCommonTransactionResponse.extend({ type: zSuiLikeTransactionType }).meta({ description: "Sui-like transaction" })
|
|
1198
|
+
]);
|
|
1199
|
+
|
|
1200
|
+
// src/networks/sui/index.ts
|
|
1201
|
+
var SUI_SPEC = {
|
|
1202
|
+
family: NetworkFamily.SUI_LIKE,
|
|
1203
|
+
zAssetFields: zSuiLikeAssetFields,
|
|
1204
|
+
zLiveData: zSuiLikeLiveData,
|
|
1205
|
+
zTransactionType: zSuiLikeTransactionType,
|
|
1206
|
+
zTransactionData: zSuiLikeTransactionData,
|
|
1207
|
+
zSendTransactionData: zSuiLikeSendData,
|
|
1208
|
+
zEstimatedFees: zSuiLikeEstimatedFees,
|
|
1209
|
+
zTransactionResponse: zSuiLikeTransactionResponse,
|
|
1210
|
+
zStakingFields: zSuiLikeStakingFields};
|
|
1211
|
+
var zTezosLikeAssetFields = z13.object({
|
|
1212
|
+
type: z13.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
|
|
1213
|
+
address: z13.string().nullable().meta({ description: "Account address" })
|
|
1065
1214
|
}).meta({ description: "Tezos-like" });
|
|
1066
|
-
var zTezosLikeStakingData =
|
|
1067
|
-
delegations:
|
|
1068
|
-
|
|
1069
|
-
address:
|
|
1215
|
+
var zTezosLikeStakingData = z13.object({
|
|
1216
|
+
delegations: z13.array(
|
|
1217
|
+
z13.object({
|
|
1218
|
+
address: z13.string()
|
|
1070
1219
|
})
|
|
1071
1220
|
)
|
|
1072
1221
|
}).nullable().meta({ description: "Tezos-like staking data" });
|
|
1073
|
-
var zTezosLikeStakingFields =
|
|
1074
|
-
type:
|
|
1222
|
+
var zTezosLikeStakingFields = z13.object({
|
|
1223
|
+
type: z13.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
|
|
1075
1224
|
staking: zTezosLikeStakingData.optional()
|
|
1076
1225
|
});
|
|
1077
1226
|
var zTezosLikeLiveData = zCommonLiveData.extend(zTezosLikeStakingFields.shape).meta({ description: "Tezos-like" });
|
|
1078
|
-
var zTezosLikeEstimatedFees =
|
|
1079
|
-
type:
|
|
1227
|
+
var zTezosLikeEstimatedFees = z13.object({
|
|
1228
|
+
type: z13.literal(NetworkFamily.TEZOS_LIKE),
|
|
1080
1229
|
fee: zIntString
|
|
1081
1230
|
}).describe("Tezos-like fees");
|
|
1082
|
-
var zTezosLikeTransactionType =
|
|
1231
|
+
var zTezosLikeTransactionType = z13.enum([
|
|
1083
1232
|
"TEZOS_LIKE_SEND",
|
|
1084
1233
|
"TEZOS_LIKE_RECEIVE",
|
|
1085
1234
|
"TEZOS_LIKE_REVEAL",
|
|
@@ -1088,193 +1237,220 @@ var zTezosLikeTransactionType = z9.enum([
|
|
|
1088
1237
|
]).meta({ description: "Tezos-like transaction type" });
|
|
1089
1238
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.meta({ description: "Tezos-like fee strategy" });
|
|
1090
1239
|
var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
1091
|
-
type:
|
|
1240
|
+
type: z13.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
|
|
1092
1241
|
feeStrategy: zTezosLikeFeeStrategy
|
|
1093
1242
|
}).meta({
|
|
1094
1243
|
description: "Tezos-like send data",
|
|
1095
1244
|
id: "TezosLikeSendData"
|
|
1096
1245
|
});
|
|
1097
|
-
var zTezosLikeDelegateData =
|
|
1098
|
-
type:
|
|
1246
|
+
var zTezosLikeDelegateData = z13.object({
|
|
1247
|
+
type: z13.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
1099
1248
|
amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
1100
1249
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
1101
1250
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
1102
|
-
recipient:
|
|
1251
|
+
recipient: z13.string().nonempty().meta({ description: "Transaction recipient" }),
|
|
1103
1252
|
feeStrategy: zTezosLikeFeeStrategy
|
|
1104
1253
|
}).meta({
|
|
1105
1254
|
description: "Tezos-like delegate data",
|
|
1106
1255
|
id: "TezosLikeDelegateData"
|
|
1107
1256
|
});
|
|
1108
|
-
var zTezosLikeUndelegateData =
|
|
1109
|
-
type:
|
|
1257
|
+
var zTezosLikeUndelegateData = z13.object({
|
|
1258
|
+
type: z13.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
1110
1259
|
amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
1111
1260
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
1112
1261
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
1113
|
-
recipient:
|
|
1262
|
+
recipient: z13.string().nonempty().optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
1114
1263
|
feeStrategy: zTezosLikeFeeStrategy
|
|
1115
1264
|
}).meta({
|
|
1116
1265
|
description: "Tezos-like undelegate data",
|
|
1117
1266
|
id: "TezosLikeUndelegateData"
|
|
1118
1267
|
});
|
|
1119
|
-
var zTezosLikeTransactionData =
|
|
1268
|
+
var zTezosLikeTransactionData = z13.discriminatedUnion("type", [
|
|
1120
1269
|
zTezosLikeSendData,
|
|
1121
1270
|
zTezosLikeDelegateData,
|
|
1122
1271
|
zTezosLikeUndelegateData
|
|
1123
1272
|
]);
|
|
1124
|
-
var zTezosLikeTransactionResponse =
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1273
|
+
var zTezosLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
1274
|
+
zCommonTransactionResponse.extend({ type: zTezosLikeTransactionType }).meta({ description: "Tezos-like transaction" })
|
|
1275
|
+
]);
|
|
1276
|
+
|
|
1277
|
+
// src/networks/tezos/index.ts
|
|
1278
|
+
var TEZOS_SPEC = {
|
|
1279
|
+
family: NetworkFamily.TEZOS_LIKE,
|
|
1280
|
+
zAssetFields: zTezosLikeAssetFields,
|
|
1281
|
+
zLiveData: zTezosLikeLiveData,
|
|
1282
|
+
zTransactionType: zTezosLikeTransactionType,
|
|
1283
|
+
zTransactionData: zTezosLikeTransactionData,
|
|
1284
|
+
zSendTransactionData: zTezosLikeSendData,
|
|
1285
|
+
zEstimatedFees: zTezosLikeEstimatedFees,
|
|
1286
|
+
zTransactionResponse: zTezosLikeTransactionResponse,
|
|
1287
|
+
zStakingFields: zTezosLikeStakingFields};
|
|
1288
|
+
var zTronLikeAssetFields = z13.object({
|
|
1289
|
+
type: z13.literal(NetworkFamily.TRON_LIKE).meta({ description: "Account type" }),
|
|
1290
|
+
address: z13.string().nullable().meta({ description: "Account address" }),
|
|
1291
|
+
contractAddress: z13.string().nullable().meta({
|
|
1129
1292
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
1130
1293
|
}).optional()
|
|
1131
1294
|
}).meta({ description: "Tron-like" });
|
|
1132
1295
|
var zTronLikeLiveData = zCommonLiveData.extend({
|
|
1133
|
-
type:
|
|
1296
|
+
type: z13.literal(NetworkFamily.TRON_LIKE).meta({ description: "Account type" })
|
|
1134
1297
|
}).meta({ description: "Tron-like" });
|
|
1135
|
-
var zTronLikeEstimatedFees =
|
|
1136
|
-
type:
|
|
1298
|
+
var zTronLikeEstimatedFees = z13.object({
|
|
1299
|
+
type: z13.literal(NetworkFamily.TRON_LIKE),
|
|
1137
1300
|
fee: zIntString
|
|
1138
1301
|
}).meta({ description: "Tron-like fees" });
|
|
1139
|
-
var zTronLikeTransactionType =
|
|
1302
|
+
var zTronLikeTransactionType = z13.enum(["TRON_LIKE_SEND", "TRON_LIKE_RECEIVE", "TRON_LIKE_SEND_TOKEN", "TRON_LIKE_RECEIVE_TOKEN"]).meta({ description: "Tron-like transaction type" });
|
|
1140
1303
|
var zTronLikeSendData = zCommonTransactionData.extend({
|
|
1141
|
-
type:
|
|
1304
|
+
type: z13.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
|
|
1142
1305
|
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
1143
1306
|
}).meta({
|
|
1144
1307
|
description: "Tron-like send data",
|
|
1145
1308
|
id: "TronLikeSendData"
|
|
1146
1309
|
});
|
|
1147
1310
|
var zTronLikeSendTokenData = zCommonTransactionData.extend({
|
|
1148
|
-
type:
|
|
1311
|
+
type: z13.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
|
|
1149
1312
|
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
1150
1313
|
}).meta({
|
|
1151
1314
|
description: "Tron-like send token data",
|
|
1152
1315
|
id: "TronLikeSendTokenData"
|
|
1153
1316
|
});
|
|
1154
|
-
var zTronLikeTransactionData =
|
|
1317
|
+
var zTronLikeTransactionData = z13.discriminatedUnion("type", [
|
|
1155
1318
|
zTronLikeSendData,
|
|
1156
1319
|
zTronLikeSendTokenData
|
|
1157
1320
|
]);
|
|
1321
|
+
var zTronLikeTransactionResponse = z13.discriminatedUnion("type", [
|
|
1322
|
+
zCommonTransactionResponse.extend({ type: zTronLikeTransactionType }).meta({ description: "Tron-like transaction" })
|
|
1323
|
+
]);
|
|
1324
|
+
|
|
1325
|
+
// src/networks/tron/index.ts
|
|
1326
|
+
var TRON_SPEC = {
|
|
1327
|
+
family: NetworkFamily.TRON_LIKE,
|
|
1328
|
+
zAssetFields: zTronLikeAssetFields,
|
|
1329
|
+
zLiveData: zTronLikeLiveData,
|
|
1330
|
+
zTransactionType: zTronLikeTransactionType,
|
|
1331
|
+
zTransactionData: zTronLikeTransactionData,
|
|
1332
|
+
zSendTransactionData: z13.never(),
|
|
1333
|
+
zEstimatedFees: zTronLikeEstimatedFees,
|
|
1334
|
+
zTransactionResponse: zTronLikeTransactionResponse,
|
|
1335
|
+
zStakingFields: z13.never()};
|
|
1158
1336
|
|
|
1159
1337
|
// src/networks/index.ts
|
|
1160
|
-
var zNetworkAssetFields =
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1338
|
+
var zNetworkAssetFields = z13.discriminatedUnion("type", [
|
|
1339
|
+
BITCOIN_SPEC.zAssetFields,
|
|
1340
|
+
CANTON_SPEC.zAssetFields,
|
|
1341
|
+
CARDANO_SPEC.zAssetFields,
|
|
1342
|
+
ETHEREUM_SPEC.zAssetFields,
|
|
1343
|
+
GENERIC_SPEC.zAssetFields,
|
|
1344
|
+
POLKADOT_SPEC.zAssetFields,
|
|
1345
|
+
RIPPLE_SPEC.zAssetFields,
|
|
1346
|
+
SOLANA_SPEC.zAssetFields,
|
|
1347
|
+
STELLAR_SPEC.zAssetFields,
|
|
1348
|
+
SUI_SPEC.zAssetFields,
|
|
1349
|
+
TEZOS_SPEC.zAssetFields,
|
|
1350
|
+
TRON_SPEC.zAssetFields
|
|
1173
1351
|
]).meta({ description: "Network asset fields" });
|
|
1174
|
-
var zAccountLiveData =
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1352
|
+
var zAccountLiveData = z13.discriminatedUnion("type", [
|
|
1353
|
+
BITCOIN_SPEC.zLiveData,
|
|
1354
|
+
CANTON_SPEC.zLiveData,
|
|
1355
|
+
CARDANO_SPEC.zLiveData,
|
|
1356
|
+
ETHEREUM_SPEC.zLiveData,
|
|
1357
|
+
GENERIC_SPEC.zLiveData,
|
|
1358
|
+
POLKADOT_SPEC.zLiveData,
|
|
1359
|
+
RIPPLE_SPEC.zLiveData,
|
|
1360
|
+
SOLANA_SPEC.zLiveData,
|
|
1361
|
+
STELLAR_SPEC.zLiveData,
|
|
1362
|
+
SUI_SPEC.zLiveData,
|
|
1363
|
+
TEZOS_SPEC.zLiveData,
|
|
1364
|
+
TRON_SPEC.zLiveData
|
|
1187
1365
|
]);
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1366
|
+
z13.discriminatedUnion("type", [
|
|
1367
|
+
CARDANO_SPEC.zStakingFields,
|
|
1368
|
+
ETHEREUM_SPEC.zStakingFields,
|
|
1369
|
+
POLKADOT_SPEC.zStakingFields,
|
|
1370
|
+
SOLANA_SPEC.zStakingFields,
|
|
1371
|
+
SUI_SPEC.zStakingFields,
|
|
1372
|
+
TEZOS_SPEC.zStakingFields
|
|
1195
1373
|
]);
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1374
|
+
z13.discriminatedUnion("type", [
|
|
1375
|
+
ETHEREUM_SPEC.zEstimatedFees,
|
|
1376
|
+
RIPPLE_SPEC.zEstimatedFees,
|
|
1377
|
+
STELLAR_SPEC.zEstimatedFees,
|
|
1378
|
+
SUI_SPEC.zEstimatedFees,
|
|
1379
|
+
TEZOS_SPEC.zEstimatedFees,
|
|
1380
|
+
TRON_SPEC.zEstimatedFees
|
|
1203
1381
|
]);
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
zTronLikeTransactionType
|
|
1382
|
+
z13.union([
|
|
1383
|
+
BITCOIN_SPEC.zTransactionType,
|
|
1384
|
+
CANTON_SPEC.zTransactionType,
|
|
1385
|
+
CARDANO_SPEC.zTransactionType,
|
|
1386
|
+
ETHEREUM_SPEC.zTransactionType,
|
|
1387
|
+
GENERIC_SPEC.zTransactionType,
|
|
1388
|
+
POLKADOT_SPEC.zTransactionType,
|
|
1389
|
+
RIPPLE_SPEC.zTransactionType,
|
|
1390
|
+
SOLANA_SPEC.zTransactionType,
|
|
1391
|
+
STELLAR_SPEC.zTransactionType,
|
|
1392
|
+
SUI_SPEC.zTransactionType,
|
|
1393
|
+
TEZOS_SPEC.zTransactionType,
|
|
1394
|
+
TRON_SPEC.zTransactionType
|
|
1218
1395
|
]);
|
|
1219
1396
|
({
|
|
1220
|
-
...
|
|
1221
|
-
...
|
|
1222
|
-
...
|
|
1223
|
-
...
|
|
1224
|
-
...
|
|
1225
|
-
...
|
|
1226
|
-
...
|
|
1227
|
-
...
|
|
1228
|
-
...
|
|
1229
|
-
...
|
|
1230
|
-
...
|
|
1231
|
-
...
|
|
1232
|
-
...zTronLikeTransactionType.enum
|
|
1397
|
+
...BITCOIN_SPEC.zTransactionType.enum,
|
|
1398
|
+
...CANTON_SPEC.zTransactionType.enum,
|
|
1399
|
+
...CARDANO_SPEC.zTransactionType.enum,
|
|
1400
|
+
...ETHEREUM_SPEC.zTransactionType.enum,
|
|
1401
|
+
...GENERIC_SPEC.zTransactionType.enum,
|
|
1402
|
+
...POLKADOT_SPEC.zTransactionType.enum,
|
|
1403
|
+
...RIPPLE_SPEC.zTransactionType.enum,
|
|
1404
|
+
...SOLANA_SPEC.zTransactionType.enum,
|
|
1405
|
+
...STELLAR_SPEC.zTransactionType.enum,
|
|
1406
|
+
...SUI_SPEC.zTransactionType.enum,
|
|
1407
|
+
...TEZOS_SPEC.zTransactionType.enum,
|
|
1408
|
+
...TRON_SPEC.zTransactionType.enum
|
|
1233
1409
|
});
|
|
1234
1410
|
({
|
|
1235
1411
|
...NetworkFamily,
|
|
1236
1412
|
// TODO: Sometimes `NetworkFamily` is not a `TransactionType` prefix - but why?
|
|
1237
1413
|
[NetworkFamily.GENERIC_LIKE]: "GENERIC"
|
|
1238
1414
|
});
|
|
1239
|
-
var zTransactionData =
|
|
1240
|
-
...
|
|
1241
|
-
...
|
|
1242
|
-
...
|
|
1243
|
-
...
|
|
1244
|
-
...
|
|
1245
|
-
...
|
|
1246
|
-
...
|
|
1247
|
-
...
|
|
1248
|
-
...
|
|
1249
|
-
...
|
|
1250
|
-
...
|
|
1251
|
-
|
|
1415
|
+
var zTransactionData = z13.discriminatedUnion("type", [
|
|
1416
|
+
...BITCOIN_SPEC.zTransactionData.options,
|
|
1417
|
+
...CANTON_SPEC.zTransactionData.options,
|
|
1418
|
+
...CARDANO_SPEC.zTransactionData.options,
|
|
1419
|
+
...ETHEREUM_SPEC.zTransactionData.options,
|
|
1420
|
+
...GENERIC_SPEC.zTransactionData.options,
|
|
1421
|
+
...POLKADOT_SPEC.zTransactionData.options,
|
|
1422
|
+
...RIPPLE_SPEC.zTransactionData.options,
|
|
1423
|
+
...SOLANA_SPEC.zTransactionData.options,
|
|
1424
|
+
...STELLAR_SPEC.zTransactionData.options,
|
|
1425
|
+
...SUI_SPEC.zTransactionData.options,
|
|
1426
|
+
...TEZOS_SPEC.zTransactionData.options,
|
|
1427
|
+
...TRON_SPEC.zTransactionData.options
|
|
1252
1428
|
]);
|
|
1253
|
-
var zSendOnlyTransactionData =
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1429
|
+
var zSendOnlyTransactionData = z13.discriminatedUnion("type", [
|
|
1430
|
+
BITCOIN_SPEC.zSendTransactionData,
|
|
1431
|
+
CANTON_SPEC.zSendTransactionData,
|
|
1432
|
+
CARDANO_SPEC.zSendTransactionData,
|
|
1433
|
+
ETHEREUM_SPEC.zSendTransactionData,
|
|
1434
|
+
POLKADOT_SPEC.zSendTransactionData,
|
|
1435
|
+
RIPPLE_SPEC.zSendTransactionData,
|
|
1436
|
+
SOLANA_SPEC.zSendTransactionData,
|
|
1437
|
+
STELLAR_SPEC.zSendTransactionData,
|
|
1438
|
+
SUI_SPEC.zSendTransactionData,
|
|
1439
|
+
TEZOS_SPEC.zSendTransactionData
|
|
1264
1440
|
]);
|
|
1265
|
-
var zTransactionResponse =
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1441
|
+
var zTransactionResponse = z13.discriminatedUnion("type", [
|
|
1442
|
+
...BITCOIN_SPEC.zTransactionResponse.options,
|
|
1443
|
+
...CANTON_SPEC.zTransactionResponse.options,
|
|
1444
|
+
...CARDANO_SPEC.zTransactionResponse.options,
|
|
1445
|
+
...ETHEREUM_SPEC.zTransactionResponse.options,
|
|
1446
|
+
...GENERIC_SPEC.zTransactionResponse.options,
|
|
1447
|
+
...POLKADOT_SPEC.zTransactionResponse.options,
|
|
1448
|
+
...RIPPLE_SPEC.zTransactionResponse.options,
|
|
1449
|
+
...SOLANA_SPEC.zTransactionResponse.options,
|
|
1450
|
+
...STELLAR_SPEC.zTransactionResponse.options,
|
|
1451
|
+
...SUI_SPEC.zTransactionResponse.options,
|
|
1452
|
+
...TEZOS_SPEC.zTransactionResponse.options,
|
|
1453
|
+
...TRON_SPEC.zTransactionResponse.options
|
|
1278
1454
|
]);
|
|
1279
1455
|
var shouldHaveTargetHsmId = (request) => {
|
|
1280
1456
|
switch (request.type) {
|
|
@@ -1539,7 +1715,7 @@ var zHsmSignature = z.object({
|
|
|
1539
1715
|
}),
|
|
1540
1716
|
pubkey: zHexString.nullable().meta({ description: "Public key for signature verification, 32 or 33 bytes" })
|
|
1541
1717
|
});
|
|
1542
|
-
var zWorkspaceName =
|
|
1718
|
+
var zWorkspaceName = z13.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
1543
1719
|
var zUserName = z.string().min(1).max(19).meta({ description: "User name" });
|
|
1544
1720
|
var zUserRegistrationCreateInput = z.object({
|
|
1545
1721
|
name: zUserName,
|
|
@@ -1555,22 +1731,22 @@ zUserRegistrationCreateInput.extend({
|
|
|
1555
1731
|
});
|
|
1556
1732
|
|
|
1557
1733
|
// src/users/request-data.ts
|
|
1558
|
-
var zCreatePsdUserRequestData =
|
|
1559
|
-
registrationId:
|
|
1734
|
+
var zCreatePsdUserRequestData = z13.object({
|
|
1735
|
+
registrationId: z13.string().meta({ description: "User registration ID" })
|
|
1560
1736
|
});
|
|
1561
|
-
var zCreateApiUserRequestData =
|
|
1737
|
+
var zCreateApiUserRequestData = z13.object({
|
|
1562
1738
|
name: zUserName,
|
|
1563
|
-
pubKey:
|
|
1564
|
-
role:
|
|
1565
|
-
viewAll:
|
|
1739
|
+
pubKey: z13.string().meta({ description: "Public key" }),
|
|
1740
|
+
role: z13.enum(["ADMIN", "OPERATOR"]).meta({ description: "User role" }),
|
|
1741
|
+
viewAll: z13.boolean().meta({ description: "View all data" }).optional()
|
|
1566
1742
|
}).meta({ description: "Create API user request data" });
|
|
1567
|
-
var zCreateApiUserAccessRequestData =
|
|
1743
|
+
var zCreateApiUserAccessRequestData = z13.object({
|
|
1568
1744
|
name: zUserName
|
|
1569
1745
|
}).meta({ description: "Create API user credential request data" });
|
|
1570
|
-
|
|
1571
|
-
authUserId:
|
|
1746
|
+
z13.object({
|
|
1747
|
+
authUserId: z13.string().meta({ description: "Authentication broker ID" })
|
|
1572
1748
|
}).meta({ description: "Managed data for API user" });
|
|
1573
|
-
var zRevokeUserRequestData =
|
|
1749
|
+
var zRevokeUserRequestData = z13.object({});
|
|
1574
1750
|
var zReviewStepWithUsers = z.object({
|
|
1575
1751
|
quorum: z.number().min(0).meta({ description: "Number of required approvals for the step" }),
|
|
1576
1752
|
userIds: z.array(z.string().min(1)).meta({ description: "User ids in the step" })
|
|
@@ -1596,9 +1772,9 @@ __export(policy_exports, {
|
|
|
1596
1772
|
zThreshold: () => zThreshold,
|
|
1597
1773
|
zWhitelistIds: () => zWhitelistIds
|
|
1598
1774
|
});
|
|
1599
|
-
var zNote =
|
|
1600
|
-
title:
|
|
1601
|
-
content:
|
|
1775
|
+
var zNote = z13.object({
|
|
1776
|
+
title: z13.string().meta({ description: "Note title" }),
|
|
1777
|
+
content: z13.string().meta({ description: "Note content" })
|
|
1602
1778
|
});
|
|
1603
1779
|
var zValueTransactionOperationType = z.enum([
|
|
1604
1780
|
AllowedAction.SEND,
|
|
@@ -1672,116 +1848,70 @@ var INCLUDE_MEMBERS = {
|
|
|
1672
1848
|
include: { members: true }
|
|
1673
1849
|
}
|
|
1674
1850
|
};
|
|
1675
|
-
var zUpdateQuorumRequestData =
|
|
1676
|
-
quorum:
|
|
1851
|
+
var zUpdateQuorumRequestData = z13.object({
|
|
1852
|
+
quorum: z13.number().int().min(2).meta({ description: "Workspace quorum" })
|
|
1677
1853
|
});
|
|
1678
1854
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1679
|
-
var zWorkspaceRuleRequestData =
|
|
1680
|
-
permission:
|
|
1855
|
+
var zWorkspaceRuleRequestData = z13.object({
|
|
1856
|
+
permission: z13.enum(NonRootAdminPermission).meta({ description: "Granted permissions" }),
|
|
1681
1857
|
reviewConfig: zReviewStepWithUsersArray.meta({ description: "List of admin review steps" })
|
|
1682
1858
|
});
|
|
1683
|
-
|
|
1859
|
+
z13.discriminatedUnion(
|
|
1684
1860
|
zTransactionResponse._zod.def.discriminator,
|
|
1685
1861
|
ensureNonEmptyArray(
|
|
1686
1862
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
|
|
1687
1863
|
)
|
|
1688
1864
|
);
|
|
1689
|
-
var
|
|
1690
|
-
|
|
1691
|
-
description: "Hex data to sign, either a json string for EIP712, or a raw string for EIP191"
|
|
1692
|
-
});
|
|
1693
|
-
var zMessage = z9.object({
|
|
1694
|
-
type: zMessageType,
|
|
1695
|
-
data: zMessageData
|
|
1696
|
-
});
|
|
1697
|
-
z9.object({
|
|
1698
|
-
id: z9.string().meta({ description: "Unique identifier" }),
|
|
1699
|
-
type: zMessageType,
|
|
1700
|
-
data: zMessageData,
|
|
1701
|
-
address: z9.string().meta({ description: "Address of the signing key" }),
|
|
1702
|
-
derivationPath: z9.string().meta({ description: "Derivation path of the signing key" }),
|
|
1703
|
-
signature: zHsmSignature.meta({ description: "Signature of the message" }),
|
|
1704
|
-
createdById: z9.string().meta({ description: "ID of the creator" }),
|
|
1705
|
-
createdAt: z9.coerce.date().meta({ description: "Creation timestamp" })
|
|
1706
|
-
}).meta({ description: "Signed message", id: "SignedMessageResponse" });
|
|
1707
|
-
var zCreateTransactionRequestData = z9.object({
|
|
1708
|
-
accountId: z9.string().min(1).meta({ description: "Target account id" }),
|
|
1709
|
-
transaction: zTransactionData
|
|
1710
|
-
}).meta({
|
|
1711
|
-
description: "Create transaction request data",
|
|
1712
|
-
id: "CreateTransactionRequestData"
|
|
1713
|
-
});
|
|
1714
|
-
var zSignMessageRequestData = z9.object({
|
|
1715
|
-
message: zMessage.meta({ description: "Message to sign" }),
|
|
1716
|
-
accountId: z9.string().min(1).meta({ description: "Target account id" }),
|
|
1717
|
-
address: z9.string().nonempty().meta({ description: "Address with which to sign the message" }),
|
|
1718
|
-
derivationPath: z9.string().nonempty().meta({ description: "Derivation path of the signing address" })
|
|
1719
|
-
});
|
|
1720
|
-
var zSignMessageUserInputData = zSignMessageRequestData.partial({
|
|
1721
|
-
address: true,
|
|
1722
|
-
derivationPath: true
|
|
1723
|
-
});
|
|
1724
|
-
var zDigestData = z9.object({
|
|
1725
|
-
digest: zHexString.meta({ description: "The hex string digest to sign" }),
|
|
1726
|
-
derivationPath: z9.string().nonempty().meta({ description: "The derivation path with which to sign the digest" })
|
|
1727
|
-
});
|
|
1728
|
-
var zSignDigestsRequestData = z9.object({
|
|
1729
|
-
accountId: z9.string().min(1).meta({ description: "Target account id" }),
|
|
1730
|
-
digests: z9.array(zDigestData).meta({ description: "The digests to sign" })
|
|
1731
|
-
});
|
|
1732
|
-
z9.object({
|
|
1733
|
-
signatures: z9.array(zHsmSignature)
|
|
1734
|
-
});
|
|
1735
|
-
var zTradelinkWhitelistAddress = z9.object({
|
|
1736
|
-
name: z9.string().min(1),
|
|
1865
|
+
var zTradelinkWhitelistAddress = z13.object({
|
|
1866
|
+
name: z13.string().min(1),
|
|
1737
1867
|
currency: zCurrencyString,
|
|
1738
|
-
address:
|
|
1868
|
+
address: z13.string().min(1)
|
|
1739
1869
|
});
|
|
1740
|
-
|
|
1741
|
-
var zTradelinkId =
|
|
1742
|
-
var zTradelinkOrgEntityResponse =
|
|
1870
|
+
z13.array(zTradelinkWhitelistAddress);
|
|
1871
|
+
var zTradelinkId = z13.string().meta({ description: "Unique identifier in Tradelink service" });
|
|
1872
|
+
var zTradelinkOrgEntityResponse = z13.object({
|
|
1743
1873
|
tradelinkId: zTradelinkId,
|
|
1744
|
-
name:
|
|
1745
|
-
code:
|
|
1746
|
-
logoUrl:
|
|
1874
|
+
name: z13.string().meta({ description: "Name" }),
|
|
1875
|
+
code: z13.string().meta({ description: "Code" }),
|
|
1876
|
+
logoUrl: z13.string().meta({ description: "Logo URL" })
|
|
1747
1877
|
});
|
|
1748
1878
|
zTradelinkOrgEntityResponse.omit({
|
|
1749
1879
|
tradelinkId: true
|
|
1750
1880
|
});
|
|
1751
|
-
|
|
1881
|
+
z13.object({
|
|
1752
1882
|
tradelinkId: zTradelinkId
|
|
1753
1883
|
});
|
|
1754
|
-
var zTradelinkExchangeConfig =
|
|
1755
|
-
exchangeId:
|
|
1756
|
-
repledgeAuthorized:
|
|
1884
|
+
var zTradelinkExchangeConfig = z13.object({
|
|
1885
|
+
exchangeId: z13.string().meta({ description: "Tradelink exchange id" }),
|
|
1886
|
+
repledgeAuthorized: z13.boolean().meta({
|
|
1757
1887
|
description: "Determines whether this exchange is authorized to repledge on this account"
|
|
1758
1888
|
}),
|
|
1759
|
-
needsAssetManagerApprovalForSettlements:
|
|
1889
|
+
needsAssetManagerApprovalForSettlements: z13.boolean().meta({
|
|
1760
1890
|
description: 'Determines whether asset manager will "pre-approve" the settlement requests on this account'
|
|
1761
1891
|
})
|
|
1762
1892
|
});
|
|
1763
|
-
var zTradelinkExchangeConfigs =
|
|
1764
|
-
|
|
1893
|
+
var zTradelinkExchangeConfigs = z13.array(zTradelinkExchangeConfig);
|
|
1894
|
+
z13.object({
|
|
1765
1895
|
workspaceName: zWorkspaceName,
|
|
1766
|
-
custodian:
|
|
1767
|
-
assetManagers:
|
|
1768
|
-
exchanges:
|
|
1896
|
+
custodian: z13.object({ name: z13.string() }),
|
|
1897
|
+
assetManagers: z13.array(z13.object({ name: z13.string() })),
|
|
1898
|
+
exchanges: z13.array(z13.object({ name: z13.string() }))
|
|
1769
1899
|
});
|
|
1770
|
-
|
|
1771
|
-
tradelinkId:
|
|
1900
|
+
z13.object({
|
|
1901
|
+
tradelinkId: z13.string(),
|
|
1772
1902
|
workspaceName: zWorkspaceName,
|
|
1773
1903
|
custodian: zTradelinkOrgEntityResponse,
|
|
1774
|
-
assetManagers:
|
|
1775
|
-
exchanges:
|
|
1904
|
+
assetManagers: z13.array(zTradelinkOrgEntityResponse),
|
|
1905
|
+
exchanges: z13.array(zTradelinkOrgEntityResponse)
|
|
1776
1906
|
});
|
|
1777
|
-
var zTradelinkAsset =
|
|
1778
|
-
name:
|
|
1779
|
-
magnitude:
|
|
1907
|
+
var zTradelinkAsset = z13.object({
|
|
1908
|
+
name: z13.string(),
|
|
1909
|
+
magnitude: z13.number().int().nonnegative()
|
|
1780
1910
|
});
|
|
1781
|
-
|
|
1911
|
+
z13.object({
|
|
1782
1912
|
tradelinkId: zTradelinkId,
|
|
1783
1913
|
asset: zTradelinkAsset,
|
|
1784
|
-
state:
|
|
1914
|
+
state: z13.enum([
|
|
1785
1915
|
"PLEDGE_READY",
|
|
1786
1916
|
"PLEDGE_INCREMENT_PENDING_APPROVAL",
|
|
1787
1917
|
"PLEDGE_APPROVED",
|
|
@@ -1798,28 +1928,28 @@ z9.object({
|
|
|
1798
1928
|
"RECOVERING_FROM_FAILURE",
|
|
1799
1929
|
"PLEDGE_CONSUMED"
|
|
1800
1930
|
]),
|
|
1801
|
-
isLocked:
|
|
1802
|
-
amount:
|
|
1803
|
-
pending:
|
|
1804
|
-
repledge:
|
|
1805
|
-
exchangeTradelinkId:
|
|
1806
|
-
accountId:
|
|
1807
|
-
});
|
|
1808
|
-
|
|
1809
|
-
workspaceName:
|
|
1810
|
-
clientAccountId:
|
|
1931
|
+
isLocked: z13.boolean(),
|
|
1932
|
+
amount: z13.string().meta({ description: "Currently pledged amount" }),
|
|
1933
|
+
pending: z13.string().meta({ description: "Requested pledge increment, not yet approved" }),
|
|
1934
|
+
repledge: z13.string().meta({ description: "TODO: describe this field" }),
|
|
1935
|
+
exchangeTradelinkId: z13.string(),
|
|
1936
|
+
accountId: z13.string()
|
|
1937
|
+
});
|
|
1938
|
+
z13.object({
|
|
1939
|
+
workspaceName: z13.string(),
|
|
1940
|
+
clientAccountId: z13.string().meta({ description: "Account ID from the client side" }),
|
|
1811
1941
|
exchangeTradelinkId: zTradelinkId,
|
|
1812
1942
|
asset: zTradelinkAsset
|
|
1813
1943
|
});
|
|
1814
|
-
|
|
1944
|
+
z13.object({
|
|
1815
1945
|
pledgeTradelinkId: zTradelinkId,
|
|
1816
1946
|
amount: zUnsignedIntString,
|
|
1817
1947
|
asset: zTradelinkAsset
|
|
1818
1948
|
});
|
|
1819
|
-
|
|
1820
|
-
tradelinkId:
|
|
1821
|
-
pledgeTradelinkId:
|
|
1822
|
-
state:
|
|
1949
|
+
z13.object({
|
|
1950
|
+
tradelinkId: z13.string(),
|
|
1951
|
+
pledgeTradelinkId: z13.string(),
|
|
1952
|
+
state: z13.enum([
|
|
1823
1953
|
"REGISTERED",
|
|
1824
1954
|
"PENDING_REPLEDGE_CREATION_APPROVAL",
|
|
1825
1955
|
"PENDING_REPLEDGE_APPROVAL",
|
|
@@ -1833,110 +1963,110 @@ z9.object({
|
|
|
1833
1963
|
"CANCELED"
|
|
1834
1964
|
]),
|
|
1835
1965
|
// For now we only consider the outbound settlement
|
|
1836
|
-
outboundTransactionHash:
|
|
1966
|
+
outboundTransactionHash: z13.string().nullable()
|
|
1837
1967
|
});
|
|
1838
|
-
var zTradelinkActivateAccountRequestData =
|
|
1839
|
-
var zTradelinkCustodianRequestData =
|
|
1968
|
+
var zTradelinkActivateAccountRequestData = z13.null();
|
|
1969
|
+
var zTradelinkCustodianRequestData = z13.object({
|
|
1840
1970
|
settlement: zReviewStepWithUsersArray.meta({ description: "List of settlement review steps" }),
|
|
1841
1971
|
withdraw: zReviewStepWithUsersArray.meta({ description: "List of withdraw review steps" }),
|
|
1842
1972
|
arbitration: zReviewStepWithUsersArray.meta({ description: "List of arbitration review steps" })
|
|
1843
1973
|
});
|
|
1844
|
-
var zTradelinkEntityRequestData =
|
|
1845
|
-
tradelinkId:
|
|
1974
|
+
var zTradelinkEntityRequestData = z13.object({
|
|
1975
|
+
tradelinkId: z13.string().min(1),
|
|
1846
1976
|
groups: zReviewStepWithUsersArray.meta({ description: "List of asset manager review groups" }),
|
|
1847
|
-
whitelist:
|
|
1977
|
+
whitelist: z13.array(zTradelinkWhitelistAddress).meta({ description: "List of asset manager whitelisted addresses" })
|
|
1848
1978
|
});
|
|
1849
|
-
var zTradelinkAdjustPledgeRequestData =
|
|
1850
|
-
accountId:
|
|
1851
|
-
exchangeId:
|
|
1979
|
+
var zTradelinkAdjustPledgeRequestData = z13.object({
|
|
1980
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1981
|
+
exchangeId: z13.string().meta({ description: "Exchange id" }),
|
|
1852
1982
|
amount: zIntString.meta({ description: "Amount to add to pledge" })
|
|
1853
1983
|
});
|
|
1854
|
-
var zTradelinkRepledgeRequestData =
|
|
1855
|
-
accountId:
|
|
1856
|
-
exchangeId:
|
|
1984
|
+
var zTradelinkRepledgeRequestData = z13.object({
|
|
1985
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1986
|
+
exchangeId: z13.string().meta({ description: "Exchange id" }),
|
|
1857
1987
|
amount: zIntString.meta({ description: "Amount to add to pledge" })
|
|
1858
1988
|
});
|
|
1859
|
-
var zTradelinkCreateSettlementRequestData =
|
|
1860
|
-
accountId:
|
|
1861
|
-
exchangeId:
|
|
1989
|
+
var zTradelinkCreateSettlementRequestData = z13.object({
|
|
1990
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1991
|
+
exchangeId: z13.string().meta({ description: "Exchange id" }),
|
|
1862
1992
|
transaction: zSendOnlyTransactionData
|
|
1863
1993
|
});
|
|
1864
|
-
var zTradelinkForceUnpledgeRequestData =
|
|
1865
|
-
accountId:
|
|
1866
|
-
exchangeId:
|
|
1994
|
+
var zTradelinkForceUnpledgeRequestData = z13.object({
|
|
1995
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1996
|
+
exchangeId: z13.string().meta({ description: "Exchange id" })
|
|
1867
1997
|
});
|
|
1868
|
-
var zTradelinkWithdrawRequestData =
|
|
1869
|
-
accountId:
|
|
1998
|
+
var zTradelinkWithdrawRequestData = z13.object({
|
|
1999
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1870
2000
|
transaction: zSendOnlyTransactionData
|
|
1871
2001
|
});
|
|
1872
|
-
var zTradelinkArbitrationRequestData =
|
|
1873
|
-
accountId:
|
|
2002
|
+
var zTradelinkArbitrationRequestData = z13.object({
|
|
2003
|
+
accountId: z13.string().meta({ description: "Account id" }),
|
|
1874
2004
|
transaction: zSendOnlyTransactionData
|
|
1875
2005
|
});
|
|
1876
2006
|
var zTradelinkRequestMixinsByType = {
|
|
1877
|
-
[RequestType.TRADELINK_ACTIVATE_ACCOUNT]:
|
|
1878
|
-
type:
|
|
1879
|
-
targetId:
|
|
2007
|
+
[RequestType.TRADELINK_ACTIVATE_ACCOUNT]: z13.object({
|
|
2008
|
+
type: z13.literal(RequestType.TRADELINK_ACTIVATE_ACCOUNT),
|
|
2009
|
+
targetId: z13.string(),
|
|
1880
2010
|
data: zTradelinkActivateAccountRequestData
|
|
1881
2011
|
}),
|
|
1882
|
-
[RequestType.TRADELINK_CREATE_CUSTODIAN]:
|
|
1883
|
-
type:
|
|
2012
|
+
[RequestType.TRADELINK_CREATE_CUSTODIAN]: z13.object({
|
|
2013
|
+
type: z13.literal(RequestType.TRADELINK_CREATE_CUSTODIAN),
|
|
1884
2014
|
data: zTradelinkCustodianRequestData
|
|
1885
2015
|
}),
|
|
1886
|
-
[RequestType.TRADELINK_EDIT_CUSTODIAN]:
|
|
1887
|
-
type:
|
|
1888
|
-
targetId:
|
|
2016
|
+
[RequestType.TRADELINK_EDIT_CUSTODIAN]: z13.object({
|
|
2017
|
+
type: z13.literal(RequestType.TRADELINK_EDIT_CUSTODIAN),
|
|
2018
|
+
targetId: z13.string(),
|
|
1889
2019
|
data: zTradelinkCustodianRequestData
|
|
1890
2020
|
}),
|
|
1891
|
-
[RequestType.TRADELINK_CREATE_EXCHANGE]:
|
|
1892
|
-
type:
|
|
2021
|
+
[RequestType.TRADELINK_CREATE_EXCHANGE]: z13.object({
|
|
2022
|
+
type: z13.literal(RequestType.TRADELINK_CREATE_EXCHANGE),
|
|
1893
2023
|
data: zTradelinkEntityRequestData
|
|
1894
2024
|
}),
|
|
1895
|
-
[RequestType.TRADELINK_EDIT_EXCHANGE]:
|
|
1896
|
-
type:
|
|
1897
|
-
targetId:
|
|
2025
|
+
[RequestType.TRADELINK_EDIT_EXCHANGE]: z13.object({
|
|
2026
|
+
type: z13.literal(RequestType.TRADELINK_EDIT_EXCHANGE),
|
|
2027
|
+
targetId: z13.string(),
|
|
1898
2028
|
data: zTradelinkEntityRequestData
|
|
1899
2029
|
}),
|
|
1900
|
-
[RequestType.TRADELINK_CREATE_ASSET_MANAGER]:
|
|
1901
|
-
type:
|
|
2030
|
+
[RequestType.TRADELINK_CREATE_ASSET_MANAGER]: z13.object({
|
|
2031
|
+
type: z13.literal(RequestType.TRADELINK_CREATE_ASSET_MANAGER),
|
|
1902
2032
|
data: zTradelinkEntityRequestData
|
|
1903
2033
|
}),
|
|
1904
|
-
[RequestType.TRADELINK_EDIT_ASSET_MANAGER]:
|
|
1905
|
-
type:
|
|
1906
|
-
targetId:
|
|
2034
|
+
[RequestType.TRADELINK_EDIT_ASSET_MANAGER]: z13.object({
|
|
2035
|
+
type: z13.literal(RequestType.TRADELINK_EDIT_ASSET_MANAGER),
|
|
2036
|
+
targetId: z13.string(),
|
|
1907
2037
|
data: zTradelinkEntityRequestData
|
|
1908
2038
|
}),
|
|
1909
|
-
[RequestType.TRADELINK_ADJUST_PLEDGE]:
|
|
1910
|
-
type:
|
|
2039
|
+
[RequestType.TRADELINK_ADJUST_PLEDGE]: z13.object({
|
|
2040
|
+
type: z13.literal(RequestType.TRADELINK_ADJUST_PLEDGE),
|
|
1911
2041
|
data: zTradelinkAdjustPledgeRequestData
|
|
1912
2042
|
}),
|
|
1913
|
-
[RequestType.TRADELINK_REPLEDGE]:
|
|
1914
|
-
type:
|
|
2043
|
+
[RequestType.TRADELINK_REPLEDGE]: z13.object({
|
|
2044
|
+
type: z13.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1915
2045
|
data: zTradelinkRepledgeRequestData
|
|
1916
2046
|
}),
|
|
1917
|
-
[RequestType.TRADELINK_CREATE_SETTLEMENT]:
|
|
1918
|
-
type:
|
|
2047
|
+
[RequestType.TRADELINK_CREATE_SETTLEMENT]: z13.object({
|
|
2048
|
+
type: z13.literal(RequestType.TRADELINK_CREATE_SETTLEMENT),
|
|
1919
2049
|
data: zTradelinkCreateSettlementRequestData,
|
|
1920
|
-
meta:
|
|
1921
|
-
hash:
|
|
2050
|
+
meta: z13.object({
|
|
2051
|
+
hash: z13.string().nullable()
|
|
1922
2052
|
}).optional().nullable()
|
|
1923
2053
|
}),
|
|
1924
|
-
[RequestType.TRADELINK_FORCE_UNPLEDGE]:
|
|
1925
|
-
type:
|
|
2054
|
+
[RequestType.TRADELINK_FORCE_UNPLEDGE]: z13.object({
|
|
2055
|
+
type: z13.literal(RequestType.TRADELINK_FORCE_UNPLEDGE),
|
|
1926
2056
|
data: zTradelinkForceUnpledgeRequestData
|
|
1927
2057
|
}),
|
|
1928
|
-
[RequestType.TRADELINK_WITHDRAW]:
|
|
1929
|
-
type:
|
|
2058
|
+
[RequestType.TRADELINK_WITHDRAW]: z13.object({
|
|
2059
|
+
type: z13.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1930
2060
|
data: zTradelinkWithdrawRequestData,
|
|
1931
|
-
meta:
|
|
1932
|
-
hash:
|
|
2061
|
+
meta: z13.object({
|
|
2062
|
+
hash: z13.string().nullable()
|
|
1933
2063
|
}).optional().nullable()
|
|
1934
2064
|
}),
|
|
1935
|
-
[RequestType.TRADELINK_ARBITRATE]:
|
|
1936
|
-
type:
|
|
2065
|
+
[RequestType.TRADELINK_ARBITRATE]: z13.object({
|
|
2066
|
+
type: z13.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1937
2067
|
data: zTradelinkArbitrationRequestData,
|
|
1938
|
-
meta:
|
|
1939
|
-
hash:
|
|
2068
|
+
meta: z13.object({
|
|
2069
|
+
hash: z13.string().nullable()
|
|
1940
2070
|
}).optional().nullable()
|
|
1941
2071
|
})
|
|
1942
2072
|
};
|
|
@@ -1956,26 +2086,26 @@ var zTradelinkAccountGovernanceFields = z.object({
|
|
|
1956
2086
|
var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).meta({ description: "Governance fields" });
|
|
1957
2087
|
|
|
1958
2088
|
// src/accounts/types.ts
|
|
1959
|
-
var zAccountCommonFields =
|
|
1960
|
-
id:
|
|
1961
|
-
legacyId:
|
|
1962
|
-
name:
|
|
2089
|
+
var zAccountCommonFields = z13.object({
|
|
2090
|
+
id: z13.string().meta({ description: "Internal unique identifier" }),
|
|
2091
|
+
legacyId: z13.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
|
|
2092
|
+
name: z13.string().meta({ description: "Name" }),
|
|
1963
2093
|
currency: zCurrencyString,
|
|
1964
2094
|
network: zNetwork,
|
|
1965
|
-
contractAddress:
|
|
1966
|
-
index:
|
|
1967
|
-
derivationPath:
|
|
1968
|
-
status:
|
|
1969
|
-
createdAt:
|
|
1970
|
-
updatedAt:
|
|
1971
|
-
});
|
|
1972
|
-
var zRawSigningAssetFields =
|
|
1973
|
-
var zAccountAssetFields =
|
|
2095
|
+
contractAddress: z13.string().nullable().meta({ description: "Token contract address for Token account" }),
|
|
2096
|
+
index: z13.number().gte(0).meta({ description: "BIP44 account index" }),
|
|
2097
|
+
derivationPath: z13.string().meta({ description: "Derivation path" }),
|
|
2098
|
+
status: z13.enum(ActivationStatus).meta({ description: "Status" }),
|
|
2099
|
+
createdAt: z13.coerce.date().meta({ description: "Creation timestamp" }),
|
|
2100
|
+
updatedAt: z13.coerce.date().meta({ description: "Last modification timestamp" })
|
|
2101
|
+
});
|
|
2102
|
+
var zRawSigningAssetFields = z13.object({ type: z13.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" }) }).meta({ description: "Raw signing account" });
|
|
2103
|
+
var zAccountAssetFields = z13.discriminatedUnion("type", [zRawSigningAssetFields, ...zNetworkAssetFields.options]).meta({ description: "Account asset fields" });
|
|
1974
2104
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1975
2105
|
asset: zAccountAssetFields,
|
|
1976
2106
|
governance: zAccountGovernanceFields
|
|
1977
2107
|
});
|
|
1978
|
-
|
|
2108
|
+
z13.enum([
|
|
1979
2109
|
"name",
|
|
1980
2110
|
"currency",
|
|
1981
2111
|
"index",
|
|
@@ -1983,77 +2113,123 @@ z9.enum([
|
|
|
1983
2113
|
"updatedAt"
|
|
1984
2114
|
]).default("createdAt");
|
|
1985
2115
|
var zRawSigningLiveData = zCommonLiveData.extend({
|
|
1986
|
-
type:
|
|
2116
|
+
type: z13.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" })
|
|
1987
2117
|
}).meta({ description: "Raw signing account" });
|
|
1988
|
-
|
|
2118
|
+
z13.discriminatedUnion("type", [
|
|
1989
2119
|
zRawSigningLiveData,
|
|
1990
2120
|
...zAccountLiveData.options
|
|
1991
2121
|
]);
|
|
1992
|
-
|
|
1993
|
-
address:
|
|
1994
|
-
derivationPath:
|
|
2122
|
+
z13.object({
|
|
2123
|
+
address: z13.string().meta({ description: "Address" }),
|
|
2124
|
+
derivationPath: z13.string().nullable().meta({ description: "Derivation path" })
|
|
1995
2125
|
});
|
|
1996
|
-
|
|
2126
|
+
z13.object({
|
|
1997
2127
|
amount: zIntString.meta({ description: "Amount in the smallest unit of the currency" }),
|
|
1998
2128
|
currency: zCurrency
|
|
1999
2129
|
});
|
|
2000
|
-
|
|
2001
|
-
id:
|
|
2002
|
-
validator:
|
|
2003
|
-
state:
|
|
2004
|
-
staked:
|
|
2005
|
-
rewards:
|
|
2006
|
-
total:
|
|
2130
|
+
z13.object({
|
|
2131
|
+
id: z13.string().nonempty().meta({ description: "Staking position ID (if applicable)" }),
|
|
2132
|
+
validator: z13.string().nonempty().meta({ description: "Validator address" }),
|
|
2133
|
+
state: z13.enum(["ACTIVE", "INACTIVE", "ACTIVATING", "DEACTIVATING", "UNKNOWN"]).meta({ description: "Stake state" }),
|
|
2134
|
+
staked: z13.string().meta({ description: "Staked amount" }),
|
|
2135
|
+
rewards: z13.object({
|
|
2136
|
+
total: z13.string().meta({ description: "Total rewards" })
|
|
2007
2137
|
})
|
|
2008
2138
|
});
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
address:
|
|
2012
|
-
apy:
|
|
2013
|
-
balance:
|
|
2014
|
-
commissionRate:
|
|
2015
|
-
description:
|
|
2016
|
-
logo:
|
|
2017
|
-
name:
|
|
2018
|
-
url:
|
|
2019
|
-
});
|
|
2020
|
-
|
|
2139
|
+
z13.enum(["staked", "rewards", "total"]).default("total");
|
|
2140
|
+
z13.object({
|
|
2141
|
+
address: z13.string().meta({ description: "Validator address" }),
|
|
2142
|
+
apy: z13.string().nullable().meta({ description: "Validator APY" }),
|
|
2143
|
+
balance: z13.string().nullable().meta({ description: "Validator balance" }),
|
|
2144
|
+
commissionRate: z13.string().nullable().meta({ description: "Validator commission rate" }),
|
|
2145
|
+
description: z13.string().nullable().meta({ description: "Description" }),
|
|
2146
|
+
logo: z13.string().nullable().meta({ description: "Logo URL" }),
|
|
2147
|
+
name: z13.string().nullable().meta({ description: "Validator name" }),
|
|
2148
|
+
url: z13.string().nullable().meta({ description: "Validator URL" })
|
|
2149
|
+
});
|
|
2150
|
+
z13.enum(["balance"]).default("balance");
|
|
2151
|
+
var zMessageType = z13.enum(MessageType).meta({ description: "Type of the message to sign" });
|
|
2152
|
+
var zMessageData = zHexString.nonempty().meta({
|
|
2153
|
+
description: "Hex data to sign, either a json string for EIP712, or a raw string for EIP191"
|
|
2154
|
+
});
|
|
2155
|
+
var zMessage = z13.object({
|
|
2156
|
+
type: zMessageType,
|
|
2157
|
+
data: zMessageData
|
|
2158
|
+
});
|
|
2159
|
+
z13.object({
|
|
2160
|
+
id: z13.string().meta({ description: "Unique identifier" }),
|
|
2161
|
+
type: zMessageType,
|
|
2162
|
+
data: zMessageData,
|
|
2163
|
+
address: z13.string().meta({ description: "Address of the signing key" }),
|
|
2164
|
+
derivationPath: z13.string().meta({ description: "Derivation path of the signing key" }),
|
|
2165
|
+
signature: zHsmSignature.meta({ description: "Signature of the message" }),
|
|
2166
|
+
createdById: z13.string().meta({ description: "ID of the creator" }),
|
|
2167
|
+
createdAt: z13.coerce.date().meta({ description: "Creation timestamp" })
|
|
2168
|
+
}).meta({ description: "Signed message", id: "SignedMessageResponse" });
|
|
2169
|
+
var zCreateTransactionRequestData = z13.object({
|
|
2170
|
+
accountId: z13.string().min(1).meta({ description: "Target account id" }),
|
|
2171
|
+
transaction: zTransactionData
|
|
2172
|
+
}).meta({
|
|
2173
|
+
description: "Create transaction request data",
|
|
2174
|
+
id: "CreateTransactionRequestData"
|
|
2175
|
+
});
|
|
2176
|
+
var zSignMessageRequestData = z13.object({
|
|
2177
|
+
message: zMessage.meta({ description: "Message to sign" }),
|
|
2178
|
+
accountId: z13.string().min(1).meta({ description: "Target account id" }),
|
|
2179
|
+
address: z13.string().nonempty().meta({ description: "Address with which to sign the message" }),
|
|
2180
|
+
derivationPath: z13.string().nonempty().meta({ description: "Derivation path of the signing address" })
|
|
2181
|
+
});
|
|
2182
|
+
var zSignMessageUserInputData = zSignMessageRequestData.partial({
|
|
2183
|
+
address: true,
|
|
2184
|
+
derivationPath: true
|
|
2185
|
+
});
|
|
2186
|
+
var zDigestData = z13.object({
|
|
2187
|
+
digest: zHexString.meta({ description: "The hex string digest to sign" }),
|
|
2188
|
+
derivationPath: z13.string().nonempty().meta({ description: "The derivation path with which to sign the digest" })
|
|
2189
|
+
});
|
|
2190
|
+
var zSignDigestsRequestData = z13.object({
|
|
2191
|
+
accountId: z13.string().min(1).meta({ description: "Target account id" }),
|
|
2192
|
+
digests: z13.array(zDigestData).meta({ description: "The digests to sign" })
|
|
2193
|
+
});
|
|
2194
|
+
z13.object({
|
|
2195
|
+
signatures: z13.array(zHsmSignature)
|
|
2196
|
+
});
|
|
2021
2197
|
|
|
2022
2198
|
// src/accounts/app-types.ts
|
|
2023
|
-
|
|
2199
|
+
z13.discriminatedUnion(
|
|
2024
2200
|
zTransactionResponse._zod.def.discriminator,
|
|
2025
2201
|
ensureNonEmptyArray(
|
|
2026
2202
|
zTransactionResponse.options.map(
|
|
2027
2203
|
(_) => _.extend({
|
|
2028
2204
|
note: zNote.nullable().meta({ description: "Optional transaction note" }),
|
|
2029
|
-
requestId:
|
|
2205
|
+
requestId: z13.string().nullable().meta({ description: "Request ID associated with the transaction, if available" })
|
|
2030
2206
|
})
|
|
2031
2207
|
)
|
|
2032
2208
|
)
|
|
2033
2209
|
);
|
|
2034
|
-
var zWhitelistAddress =
|
|
2035
|
-
name:
|
|
2210
|
+
var zWhitelistAddress = z13.object({
|
|
2211
|
+
name: z13.string().min(1).max(50),
|
|
2036
2212
|
currency: zCurrencyString,
|
|
2037
|
-
address:
|
|
2213
|
+
address: z13.string().min(1).max(200),
|
|
2038
2214
|
// Destination tags are numeric-only or alpha-numeric.
|
|
2039
2215
|
// Empty array (or undefined) means no check on destination tag.
|
|
2040
|
-
destinationTags:
|
|
2216
|
+
destinationTags: z13.array(z13.string().min(1).regex(/^\w+$/)).optional()
|
|
2041
2217
|
});
|
|
2042
|
-
var zWhitelistAddresses =
|
|
2043
|
-
var zWhitelistName =
|
|
2044
|
-
var zCreateWhitelistRequestData =
|
|
2218
|
+
var zWhitelistAddresses = z13.array(zWhitelistAddress);
|
|
2219
|
+
var zWhitelistName = z13.string().min(1).max(45).meta({ description: "Whitelist name" });
|
|
2220
|
+
var zCreateWhitelistRequestData = z13.object({
|
|
2045
2221
|
name: zWhitelistName,
|
|
2046
|
-
description:
|
|
2222
|
+
description: z13.string().nullable(),
|
|
2047
2223
|
addresses: zWhitelistAddresses,
|
|
2048
|
-
type:
|
|
2224
|
+
type: z13.enum(WhitelistType)
|
|
2049
2225
|
});
|
|
2050
|
-
var zEditWhitelistRequestData =
|
|
2226
|
+
var zEditWhitelistRequestData = z13.object({
|
|
2051
2227
|
name: zWhitelistName,
|
|
2052
2228
|
addresses: zWhitelistAddresses
|
|
2053
2229
|
});
|
|
2054
2230
|
|
|
2055
2231
|
// src/policies/db-utils.ts
|
|
2056
|
-
var zBaseGovRuleData =
|
|
2232
|
+
var zBaseGovRuleData = z13.object({
|
|
2057
2233
|
// Steps of users that will need to review operations
|
|
2058
2234
|
reviewSteps: zReviewStepsArray,
|
|
2059
2235
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
@@ -2070,87 +2246,87 @@ zBaseGovRuleData.extend({
|
|
|
2070
2246
|
({
|
|
2071
2247
|
reviewConfigs: { include: review_config_exports.INCLUDE_MEMBERS }
|
|
2072
2248
|
});
|
|
2073
|
-
var zPolicyName =
|
|
2074
|
-
var zCurrency2 =
|
|
2075
|
-
var zCreatePublicPolicyRequestData =
|
|
2249
|
+
var zPolicyName = z13.string().min(1).max(19).meta({ description: "Policy name" });
|
|
2250
|
+
var zCurrency2 = z13.string().min(1).max(40).regex(/^\w+$/).meta({ description: "Currency" });
|
|
2251
|
+
var zCreatePublicPolicyRequestData = z13.object({
|
|
2076
2252
|
name: zPolicyName,
|
|
2077
|
-
description:
|
|
2253
|
+
description: z13.string().nullable().meta({ description: "Description" }),
|
|
2078
2254
|
currency: zCurrency2.nullable(),
|
|
2079
|
-
govRules:
|
|
2255
|
+
govRules: z13.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
2080
2256
|
});
|
|
2081
|
-
var zEditPublicPolicyRequestData =
|
|
2257
|
+
var zEditPublicPolicyRequestData = z13.object({
|
|
2082
2258
|
name: zPolicyName,
|
|
2083
|
-
description:
|
|
2084
|
-
govRules:
|
|
2259
|
+
description: z13.string().nullable().meta({ description: "Description" }),
|
|
2260
|
+
govRules: z13.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
2085
2261
|
});
|
|
2086
|
-
var zAccountName =
|
|
2087
|
-
|
|
2088
|
-
var zSignDigestsGovRuleData =
|
|
2089
|
-
operationType:
|
|
2262
|
+
var zAccountName = z13.string().min(1).max(40).meta({ description: "Account name" });
|
|
2263
|
+
z13.enum(["standalone", "legacy"]);
|
|
2264
|
+
var zSignDigestsGovRuleData = z13.object({
|
|
2265
|
+
operationType: z13.literal("SIGN_DIGESTS"),
|
|
2090
2266
|
reviewSteps: zReviewStepWithUsersArray
|
|
2091
2267
|
// we need to control for API users only
|
|
2092
2268
|
}).meta({ description: "Digest signing rule" });
|
|
2093
|
-
var zAccountPolicyRequestData =
|
|
2094
|
-
|
|
2095
|
-
|
|
2269
|
+
var zAccountPolicyRequestData = z13.union([
|
|
2270
|
+
z13.object({ policyId: z13.string() }).meta({ description: "Account policy" }),
|
|
2271
|
+
z13.object({ rules: z13.array(zClassicGovRuleData) }).meta({ description: "Account governance rules" })
|
|
2096
2272
|
]).meta({ description: "Account policy or governance rules" });
|
|
2097
|
-
var zCreateAccountGovernanceData =
|
|
2098
|
-
|
|
2099
|
-
type:
|
|
2273
|
+
var zCreateAccountGovernanceData = z13.discriminatedUnion("type", [
|
|
2274
|
+
z13.object({
|
|
2275
|
+
type: z13.literal(AccountGovernanceType.CLASSIC),
|
|
2100
2276
|
policy: zAccountPolicyRequestData
|
|
2101
2277
|
}).meta({ description: "Classic governance" }),
|
|
2102
|
-
|
|
2103
|
-
type:
|
|
2104
|
-
assetManagerId:
|
|
2278
|
+
z13.object({
|
|
2279
|
+
type: z13.literal(AccountGovernanceType.TRADELINK),
|
|
2280
|
+
assetManagerId: z13.string(),
|
|
2105
2281
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
2106
2282
|
}).meta({ description: "Tradelink governance" }),
|
|
2107
|
-
|
|
2108
|
-
type:
|
|
2109
|
-
policy:
|
|
2283
|
+
z13.object({
|
|
2284
|
+
type: z13.literal(AccountGovernanceType.RAW_SIGNING),
|
|
2285
|
+
policy: z13.object({ rules: z13.array(zSignDigestsGovRuleData) })
|
|
2110
2286
|
}).meta({ description: "Raw signing governance" })
|
|
2111
2287
|
]).meta({ description: "Governance fields" });
|
|
2112
|
-
var zCreateAccountUserInputData =
|
|
2288
|
+
var zCreateAccountUserInputData = z13.object({
|
|
2113
2289
|
name: zAccountName,
|
|
2114
2290
|
currency: zCurrencyString,
|
|
2115
2291
|
// "bitcoin"
|
|
2116
|
-
index:
|
|
2117
|
-
contractAddress:
|
|
2292
|
+
index: z13.number().nonnegative().optional().meta({ description: "Account index" }),
|
|
2293
|
+
contractAddress: z13.string().min(1).optional().meta({ description: "Account contract address" }),
|
|
2118
2294
|
governance: zCreateAccountGovernanceData
|
|
2119
2295
|
});
|
|
2120
2296
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
2121
|
-
index:
|
|
2122
|
-
derivationPath:
|
|
2123
|
-
type:
|
|
2297
|
+
index: z13.number().nonnegative().meta({ description: "Account index" }),
|
|
2298
|
+
derivationPath: z13.string().meta({ description: "Account bip44 derivation path" }),
|
|
2299
|
+
type: z13.enum(AccountType)
|
|
2124
2300
|
// "BITCOIN_LIKE"
|
|
2125
2301
|
}).meta({
|
|
2126
2302
|
description: "Create account request data",
|
|
2127
2303
|
id: "CreateAccountRequestData"
|
|
2128
2304
|
});
|
|
2129
|
-
var zEditAccountGovernanceData =
|
|
2130
|
-
|
|
2131
|
-
type:
|
|
2305
|
+
var zEditAccountGovernanceData = z13.discriminatedUnion("type", [
|
|
2306
|
+
z13.object({
|
|
2307
|
+
type: z13.literal(AccountGovernanceType.CLASSIC),
|
|
2132
2308
|
policy: zAccountPolicyRequestData
|
|
2133
2309
|
}).meta({ description: "Classic governance" }),
|
|
2134
|
-
|
|
2135
|
-
type:
|
|
2310
|
+
z13.object({
|
|
2311
|
+
type: z13.literal(AccountGovernanceType.TRADELINK),
|
|
2136
2312
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
2137
2313
|
}).meta({ description: "Tradelink governance" }),
|
|
2138
|
-
|
|
2139
|
-
type:
|
|
2140
|
-
policy:
|
|
2314
|
+
z13.object({
|
|
2315
|
+
type: z13.literal(AccountGovernanceType.RAW_SIGNING),
|
|
2316
|
+
policy: z13.object({ rules: z13.array(zSignDigestsGovRuleData) })
|
|
2141
2317
|
}).meta({ description: "Raw signing governance" })
|
|
2142
2318
|
]).meta({ description: "Governance fields" });
|
|
2143
|
-
var zEditAccountRequestData =
|
|
2319
|
+
var zEditAccountRequestData = z13.object({
|
|
2144
2320
|
name: zAccountName,
|
|
2145
2321
|
governance: zEditAccountGovernanceData
|
|
2146
2322
|
}).meta({
|
|
2147
2323
|
description: "Edit account request data",
|
|
2148
2324
|
id: "EditAccountRequestData"
|
|
2149
2325
|
});
|
|
2150
|
-
var zEditTokenRuleRequestData =
|
|
2151
|
-
parentAccountId:
|
|
2152
|
-
contractAddress:
|
|
2153
|
-
rules:
|
|
2326
|
+
var zEditTokenRuleRequestData = z13.object({
|
|
2327
|
+
parentAccountId: z13.string().min(1).meta({ description: "Parent account unique ID" }),
|
|
2328
|
+
contractAddress: z13.string().min(1).meta({ description: "Token contract address" }),
|
|
2329
|
+
rules: z13.array(zClassicGovRuleData).meta({ description: "Account governance rules" })
|
|
2154
2330
|
});
|
|
2155
2331
|
|
|
2156
2332
|
// src/accounts/app-utils.ts
|
|
@@ -2279,15 +2455,15 @@ var patchTezosRequestData = (data) => {
|
|
|
2279
2455
|
}
|
|
2280
2456
|
return data;
|
|
2281
2457
|
};
|
|
2282
|
-
var zSciConfigData =
|
|
2283
|
-
dapps:
|
|
2284
|
-
customContractCallEnabled:
|
|
2458
|
+
var zSciConfigData = z13.object({
|
|
2459
|
+
dapps: z13.array(z13.string()).nullable().meta({ description: "Allowed DApps, null allows all" }),
|
|
2460
|
+
customContractCallEnabled: z13.boolean().meta({ description: "Allow non-DApp SCI" })
|
|
2285
2461
|
});
|
|
2286
|
-
var zCreateSciConfigRequestData =
|
|
2287
|
-
account:
|
|
2462
|
+
var zCreateSciConfigRequestData = z13.object({
|
|
2463
|
+
account: z13.string().meta({ description: "Account UUID" }),
|
|
2288
2464
|
config: zSciConfigData
|
|
2289
2465
|
});
|
|
2290
|
-
var zEditSciConfigRequestData =
|
|
2466
|
+
var zEditSciConfigRequestData = z13.object({
|
|
2291
2467
|
config: zSciConfigData
|
|
2292
2468
|
});
|
|
2293
2469
|
var zRequestReviewStep = z.object({
|
|
@@ -2295,165 +2471,165 @@ var zRequestReviewStep = z.object({
|
|
|
2295
2471
|
quorum: z.int().min(1).meta({ description: "Quorum for the review step" })
|
|
2296
2472
|
});
|
|
2297
2473
|
var zRequestReviewSteps = z.array(zRequestReviewStep);
|
|
2298
|
-
var zGroupName =
|
|
2299
|
-
var zCreateGroupRequestData =
|
|
2474
|
+
var zGroupName = z13.string().min(1).max(19).meta({ description: "Group name" });
|
|
2475
|
+
var zCreateGroupRequestData = z13.object({
|
|
2300
2476
|
name: zGroupName,
|
|
2301
|
-
description:
|
|
2302
|
-
members:
|
|
2477
|
+
description: z13.string().nullable().meta({ description: "Group description" }),
|
|
2478
|
+
members: z13.array(z13.string()).meta({ description: "List of group members ids" })
|
|
2303
2479
|
});
|
|
2304
|
-
var zEditGroupRequestData =
|
|
2480
|
+
var zEditGroupRequestData = z13.object({
|
|
2305
2481
|
name: zGroupName,
|
|
2306
|
-
description:
|
|
2307
|
-
members:
|
|
2482
|
+
description: z13.string().nullable().meta({ description: "Group description" }),
|
|
2483
|
+
members: z13.array(z13.string()).meta({ description: "List of group members ids" })
|
|
2308
2484
|
});
|
|
2309
|
-
var zApiKeyName =
|
|
2310
|
-
var zCreateApiKeyRequestData =
|
|
2485
|
+
var zApiKeyName = z13.string().min(1).max(19).meta({ description: "API key name" });
|
|
2486
|
+
var zCreateApiKeyRequestData = z13.object({
|
|
2311
2487
|
name: zApiKeyName,
|
|
2312
|
-
entities:
|
|
2313
|
-
scopes:
|
|
2488
|
+
entities: z13.array(z13.string()).meta({ description: "List of related entities ids" }),
|
|
2489
|
+
scopes: z13.object({}).meta({ description: "FIXME to be precised" })
|
|
2314
2490
|
}).meta({ description: "Create read-only API key request data" });
|
|
2315
2491
|
var zEditApiKeyRequestData = zCreateApiKeyRequestData.meta({
|
|
2316
2492
|
description: "Edit read-only API key request data"
|
|
2317
2493
|
});
|
|
2318
|
-
var zEntityName =
|
|
2319
|
-
var zCreateEntityRequestData =
|
|
2494
|
+
var zEntityName = z13.string().min(1).max(19).meta({ description: "Entity name" });
|
|
2495
|
+
var zCreateEntityRequestData = z13.object({
|
|
2320
2496
|
name: zEntityName,
|
|
2321
|
-
accounts:
|
|
2497
|
+
accounts: z13.array(z13.string())
|
|
2322
2498
|
});
|
|
2323
|
-
var zEditEntityRequestData =
|
|
2499
|
+
var zEditEntityRequestData = z13.object({
|
|
2324
2500
|
name: zEntityName,
|
|
2325
|
-
accounts:
|
|
2501
|
+
accounts: z13.array(z13.string())
|
|
2326
2502
|
});
|
|
2327
2503
|
|
|
2328
2504
|
// src/requests/request-data.ts
|
|
2329
2505
|
var zVaultRequestMixinsByType = {
|
|
2330
2506
|
// Workspaces
|
|
2331
|
-
[RequestType.UPDATE_QUORUM]:
|
|
2332
|
-
type:
|
|
2507
|
+
[RequestType.UPDATE_QUORUM]: z13.object({
|
|
2508
|
+
type: z13.literal(RequestType.UPDATE_QUORUM),
|
|
2333
2509
|
data: zUpdateQuorumRequestData
|
|
2334
2510
|
}),
|
|
2335
2511
|
// Operator requests
|
|
2336
|
-
[RequestType.CREATE_TRANSACTION]:
|
|
2337
|
-
type:
|
|
2512
|
+
[RequestType.CREATE_TRANSACTION]: z13.object({
|
|
2513
|
+
type: z13.literal(RequestType.CREATE_TRANSACTION),
|
|
2338
2514
|
data: zCreateTransactionRequestData,
|
|
2339
|
-
meta:
|
|
2340
|
-
hash:
|
|
2515
|
+
meta: z13.object({
|
|
2516
|
+
hash: z13.string().nullable()
|
|
2341
2517
|
}).optional().nullable()
|
|
2342
2518
|
}),
|
|
2343
|
-
[RequestType.SIGN_MESSAGE]:
|
|
2344
|
-
type:
|
|
2519
|
+
[RequestType.SIGN_MESSAGE]: z13.object({
|
|
2520
|
+
type: z13.literal(RequestType.SIGN_MESSAGE),
|
|
2345
2521
|
data: zSignMessageRequestData
|
|
2346
2522
|
}),
|
|
2347
|
-
[RequestType.SIGN_DIGESTS]:
|
|
2348
|
-
type:
|
|
2523
|
+
[RequestType.SIGN_DIGESTS]: z13.object({
|
|
2524
|
+
type: z13.literal(RequestType.SIGN_DIGESTS),
|
|
2349
2525
|
data: zSignDigestsRequestData
|
|
2350
2526
|
}),
|
|
2351
2527
|
// Accounts
|
|
2352
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
2353
|
-
type:
|
|
2528
|
+
[RequestType.CREATE_ACCOUNT]: z13.object({
|
|
2529
|
+
type: z13.literal(RequestType.CREATE_ACCOUNT),
|
|
2354
2530
|
data: zCreateAccountRequestData
|
|
2355
2531
|
}),
|
|
2356
|
-
[RequestType.EDIT_ACCOUNT]:
|
|
2357
|
-
type:
|
|
2358
|
-
targetId:
|
|
2532
|
+
[RequestType.EDIT_ACCOUNT]: z13.object({
|
|
2533
|
+
type: z13.literal(RequestType.EDIT_ACCOUNT),
|
|
2534
|
+
targetId: z13.string(),
|
|
2359
2535
|
data: zEditAccountRequestData
|
|
2360
2536
|
}),
|
|
2361
|
-
[RequestType.EDIT_TOKEN_RULE]:
|
|
2362
|
-
type:
|
|
2363
|
-
targetId:
|
|
2537
|
+
[RequestType.EDIT_TOKEN_RULE]: z13.object({
|
|
2538
|
+
type: z13.literal(RequestType.EDIT_TOKEN_RULE),
|
|
2539
|
+
targetId: z13.string(),
|
|
2364
2540
|
data: zEditTokenRuleRequestData
|
|
2365
2541
|
}),
|
|
2366
2542
|
// Groups
|
|
2367
|
-
[RequestType.CREATE_GROUP]:
|
|
2368
|
-
type:
|
|
2543
|
+
[RequestType.CREATE_GROUP]: z13.object({
|
|
2544
|
+
type: z13.literal(RequestType.CREATE_GROUP),
|
|
2369
2545
|
data: zCreateGroupRequestData
|
|
2370
2546
|
}),
|
|
2371
|
-
[RequestType.EDIT_GROUP]:
|
|
2372
|
-
type:
|
|
2373
|
-
targetId:
|
|
2547
|
+
[RequestType.EDIT_GROUP]: z13.object({
|
|
2548
|
+
type: z13.literal(RequestType.EDIT_GROUP),
|
|
2549
|
+
targetId: z13.string(),
|
|
2374
2550
|
data: zEditGroupRequestData
|
|
2375
2551
|
}),
|
|
2376
|
-
[RequestType.REVOKE_GROUP]:
|
|
2377
|
-
type:
|
|
2378
|
-
targetId:
|
|
2552
|
+
[RequestType.REVOKE_GROUP]: z13.object({
|
|
2553
|
+
type: z13.literal(RequestType.REVOKE_GROUP),
|
|
2554
|
+
targetId: z13.string(),
|
|
2379
2555
|
data: zRevokeUserRequestData
|
|
2380
2556
|
}),
|
|
2381
2557
|
// Whitelists
|
|
2382
|
-
[RequestType.CREATE_WHITELIST]:
|
|
2383
|
-
type:
|
|
2558
|
+
[RequestType.CREATE_WHITELIST]: z13.object({
|
|
2559
|
+
type: z13.literal(RequestType.CREATE_WHITELIST),
|
|
2384
2560
|
data: zCreateWhitelistRequestData
|
|
2385
2561
|
}),
|
|
2386
|
-
[RequestType.EDIT_WHITELIST]:
|
|
2387
|
-
type:
|
|
2388
|
-
targetId:
|
|
2562
|
+
[RequestType.EDIT_WHITELIST]: z13.object({
|
|
2563
|
+
type: z13.literal(RequestType.EDIT_WHITELIST),
|
|
2564
|
+
targetId: z13.string(),
|
|
2389
2565
|
data: zEditWhitelistRequestData
|
|
2390
2566
|
}),
|
|
2391
2567
|
// Entities
|
|
2392
|
-
[RequestType.CREATE_ENTITY]:
|
|
2393
|
-
type:
|
|
2568
|
+
[RequestType.CREATE_ENTITY]: z13.object({
|
|
2569
|
+
type: z13.literal(RequestType.CREATE_ENTITY),
|
|
2394
2570
|
data: zCreateEntityRequestData
|
|
2395
2571
|
}),
|
|
2396
|
-
[RequestType.EDIT_ENTITY]:
|
|
2397
|
-
type:
|
|
2572
|
+
[RequestType.EDIT_ENTITY]: z13.object({
|
|
2573
|
+
type: z13.literal(RequestType.EDIT_ENTITY),
|
|
2398
2574
|
data: zEditEntityRequestData
|
|
2399
2575
|
}),
|
|
2400
|
-
[RequestType.REVOKE_ENTITY]:
|
|
2401
|
-
type:
|
|
2402
|
-
data:
|
|
2576
|
+
[RequestType.REVOKE_ENTITY]: z13.object({
|
|
2577
|
+
type: z13.literal(RequestType.REVOKE_ENTITY),
|
|
2578
|
+
data: z13.object({})
|
|
2403
2579
|
}),
|
|
2404
2580
|
// Users
|
|
2405
|
-
[RequestType.CREATE_PSD_USER]:
|
|
2406
|
-
type:
|
|
2581
|
+
[RequestType.CREATE_PSD_USER]: z13.object({
|
|
2582
|
+
type: z13.literal(RequestType.CREATE_PSD_USER),
|
|
2407
2583
|
data: zCreatePsdUserRequestData
|
|
2408
2584
|
}),
|
|
2409
|
-
[RequestType.CREATE_API_USER]:
|
|
2410
|
-
type:
|
|
2585
|
+
[RequestType.CREATE_API_USER]: z13.object({
|
|
2586
|
+
type: z13.literal(RequestType.CREATE_API_USER),
|
|
2411
2587
|
data: zCreateApiUserRequestData
|
|
2412
2588
|
}),
|
|
2413
|
-
[RequestType.CREATE_API_USER_ACCESS]:
|
|
2414
|
-
type:
|
|
2589
|
+
[RequestType.CREATE_API_USER_ACCESS]: z13.object({
|
|
2590
|
+
type: z13.literal(RequestType.CREATE_API_USER_ACCESS),
|
|
2415
2591
|
data: zCreateApiUserAccessRequestData
|
|
2416
2592
|
}),
|
|
2417
|
-
[RequestType.REVOKE_USER]:
|
|
2418
|
-
type:
|
|
2419
|
-
targetId:
|
|
2593
|
+
[RequestType.REVOKE_USER]: z13.object({
|
|
2594
|
+
type: z13.literal(RequestType.REVOKE_USER),
|
|
2595
|
+
targetId: z13.string(),
|
|
2420
2596
|
data: zRevokeUserRequestData
|
|
2421
2597
|
}),
|
|
2422
2598
|
// Admin gov rules
|
|
2423
|
-
[RequestType.EDIT_WORKSPACE_RULE]:
|
|
2424
|
-
type:
|
|
2599
|
+
[RequestType.EDIT_WORKSPACE_RULE]: z13.object({
|
|
2600
|
+
type: z13.literal(RequestType.EDIT_WORKSPACE_RULE),
|
|
2425
2601
|
data: zWorkspaceRuleRequestData
|
|
2426
2602
|
}),
|
|
2427
2603
|
// SCI configs
|
|
2428
|
-
[RequestType.CREATE_SCICONFIG]:
|
|
2429
|
-
type:
|
|
2604
|
+
[RequestType.CREATE_SCICONFIG]: z13.object({
|
|
2605
|
+
type: z13.literal(RequestType.CREATE_SCICONFIG),
|
|
2430
2606
|
data: zCreateSciConfigRequestData
|
|
2431
2607
|
}),
|
|
2432
|
-
[RequestType.EDIT_SCICONFIG]:
|
|
2433
|
-
type:
|
|
2608
|
+
[RequestType.EDIT_SCICONFIG]: z13.object({
|
|
2609
|
+
type: z13.literal(RequestType.EDIT_SCICONFIG),
|
|
2434
2610
|
data: zEditSciConfigRequestData
|
|
2435
2611
|
}),
|
|
2436
2612
|
// API keys
|
|
2437
|
-
[RequestType.CREATE_API_KEY]:
|
|
2438
|
-
type:
|
|
2613
|
+
[RequestType.CREATE_API_KEY]: z13.object({
|
|
2614
|
+
type: z13.literal(RequestType.CREATE_API_KEY),
|
|
2439
2615
|
data: zCreateApiKeyRequestData
|
|
2440
2616
|
}),
|
|
2441
|
-
[RequestType.EDIT_API_KEY]:
|
|
2442
|
-
type:
|
|
2617
|
+
[RequestType.EDIT_API_KEY]: z13.object({
|
|
2618
|
+
type: z13.literal(RequestType.EDIT_API_KEY),
|
|
2443
2619
|
data: zEditApiKeyRequestData
|
|
2444
2620
|
}),
|
|
2445
|
-
[RequestType.REVOKE_API_KEY]:
|
|
2446
|
-
type:
|
|
2447
|
-
data:
|
|
2621
|
+
[RequestType.REVOKE_API_KEY]: z13.object({
|
|
2622
|
+
type: z13.literal(RequestType.REVOKE_API_KEY),
|
|
2623
|
+
data: z13.object({})
|
|
2448
2624
|
}),
|
|
2449
2625
|
// Policies
|
|
2450
|
-
[RequestType.CREATE_POLICY]:
|
|
2451
|
-
type:
|
|
2626
|
+
[RequestType.CREATE_POLICY]: z13.object({
|
|
2627
|
+
type: z13.literal(RequestType.CREATE_POLICY),
|
|
2452
2628
|
data: zCreatePublicPolicyRequestData
|
|
2453
2629
|
}),
|
|
2454
|
-
[RequestType.EDIT_POLICY]:
|
|
2455
|
-
type:
|
|
2456
|
-
targetId:
|
|
2630
|
+
[RequestType.EDIT_POLICY]: z13.object({
|
|
2631
|
+
type: z13.literal(RequestType.EDIT_POLICY),
|
|
2632
|
+
targetId: z13.string(),
|
|
2457
2633
|
data: zEditPublicPolicyRequestData
|
|
2458
2634
|
}),
|
|
2459
2635
|
// Tradelink-related requests
|
|
@@ -2461,34 +2637,34 @@ var zVaultRequestMixinsByType = {
|
|
|
2461
2637
|
};
|
|
2462
2638
|
|
|
2463
2639
|
// src/requests/app-types.ts
|
|
2464
|
-
var zRequestReviewResponse =
|
|
2640
|
+
var zRequestReviewResponse = z13.object({
|
|
2465
2641
|
// Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
|
|
2466
|
-
stepIndex:
|
|
2467
|
-
userId:
|
|
2468
|
-
status:
|
|
2469
|
-
createdAt:
|
|
2470
|
-
updatedAt:
|
|
2471
|
-
});
|
|
2472
|
-
var zVaultRequestCommonMixin =
|
|
2473
|
-
id:
|
|
2474
|
-
legacyId:
|
|
2475
|
-
state:
|
|
2642
|
+
stepIndex: z13.number().int().meta({ description: "Index of the governance step in the request workflow" }),
|
|
2643
|
+
userId: z13.string().meta({ description: "Reviewer id" }),
|
|
2644
|
+
status: z13.enum(RequestReviewStatus).meta({ description: "Review status" }),
|
|
2645
|
+
createdAt: z13.coerce.date().meta({ description: "Created date" }),
|
|
2646
|
+
updatedAt: z13.coerce.date().meta({ description: "Updated date" })
|
|
2647
|
+
});
|
|
2648
|
+
var zVaultRequestCommonMixin = z13.object({
|
|
2649
|
+
id: z13.string().meta({ description: "Request unique identifier" }),
|
|
2650
|
+
legacyId: z13.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
|
|
2651
|
+
state: z13.enum(RequestState).meta({ description: "Request state" }),
|
|
2476
2652
|
reviewSteps: zRequestReviewSteps.meta({ description: "Request review steps" }),
|
|
2477
|
-
currentStepIndex:
|
|
2478
|
-
expiresAt:
|
|
2479
|
-
expiredAt:
|
|
2480
|
-
targetId:
|
|
2653
|
+
currentStepIndex: z13.number().int().min(0).meta({ description: "Index of the current approval step" }),
|
|
2654
|
+
expiresAt: z13.coerce.date().meta({ description: "Request expiration date" }),
|
|
2655
|
+
expiredAt: z13.coerce.date().optional().meta({ description: "Deprecated: use expiresAt" }),
|
|
2656
|
+
targetId: z13.string().nullable().meta({ description: "Optional ID of the target object" }),
|
|
2481
2657
|
note: zNote.nullable().meta({ description: "Optional request note" }),
|
|
2482
|
-
reviews:
|
|
2658
|
+
reviews: z13.array(zRequestReviewResponse).meta({ description: "Requests reviews" }),
|
|
2483
2659
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
2484
|
-
createdAt:
|
|
2485
|
-
updatedAt:
|
|
2486
|
-
createdById:
|
|
2660
|
+
createdAt: z13.coerce.date().meta({ description: "Creation timestamp" }),
|
|
2661
|
+
updatedAt: z13.coerce.date().meta({ description: "Last modification timestamp" }),
|
|
2662
|
+
createdById: z13.string().meta({ description: "ID of the user who created the request" }),
|
|
2487
2663
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
2488
|
-
inflight:
|
|
2489
|
-
lastError:
|
|
2490
|
-
numFailed:
|
|
2491
|
-
retryAfter:
|
|
2664
|
+
inflight: z13.object({
|
|
2665
|
+
lastError: z13.string().nullable().meta({ description: "Error message from the last failure" }),
|
|
2666
|
+
numFailed: z13.number().int().meta({ description: "Number of failures so far" }),
|
|
2667
|
+
retryAfter: z13.coerce.date().meta({ description: "Date after which next retry is scheduled" })
|
|
2492
2668
|
}).optional().meta({ description: "Extra information if the request is currently being processed" })
|
|
2493
2669
|
});
|
|
2494
2670
|
var allowedRequestCreationInputByType = {
|
|
@@ -2500,14 +2676,14 @@ var allowedRequestCreationInputByType = {
|
|
|
2500
2676
|
[RequestType.CREATE_WHITELIST]: zVaultRequestMixinsByType[RequestType.CREATE_WHITELIST],
|
|
2501
2677
|
[RequestType.EDIT_WHITELIST]: zVaultRequestMixinsByType[RequestType.EDIT_WHITELIST],
|
|
2502
2678
|
[RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
|
|
2503
|
-
[RequestType.SIGN_MESSAGE]:
|
|
2504
|
-
type:
|
|
2679
|
+
[RequestType.SIGN_MESSAGE]: z13.object({
|
|
2680
|
+
type: z13.literal(RequestType.SIGN_MESSAGE),
|
|
2505
2681
|
data: zSignMessageUserInputData
|
|
2506
2682
|
}),
|
|
2507
2683
|
[RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
|
|
2508
2684
|
[RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
|
|
2509
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
2510
|
-
type:
|
|
2685
|
+
[RequestType.CREATE_ACCOUNT]: z13.object({
|
|
2686
|
+
type: z13.literal(RequestType.CREATE_ACCOUNT),
|
|
2511
2687
|
data: zCreateAccountUserInputData
|
|
2512
2688
|
}),
|
|
2513
2689
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
@@ -2527,11 +2703,11 @@ var allowedRequestCreationInputByType = {
|
|
|
2527
2703
|
[RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER],
|
|
2528
2704
|
[RequestType.EDIT_WORKSPACE_RULE]: zVaultRequestMixinsByType[RequestType.EDIT_WORKSPACE_RULE]
|
|
2529
2705
|
};
|
|
2530
|
-
var zRequestCreationInputCommonMixin =
|
|
2706
|
+
var zRequestCreationInputCommonMixin = z13.object({
|
|
2531
2707
|
note: zNote.optional().meta({ description: "Optional request note" })
|
|
2532
2708
|
});
|
|
2533
|
-
|
|
2534
|
-
request:
|
|
2709
|
+
z13.object({
|
|
2710
|
+
request: z13.discriminatedUnion(
|
|
2535
2711
|
"type",
|
|
2536
2712
|
ensureNonEmptyArray(
|
|
2537
2713
|
Object.values(allowedRequestCreationInputByType).map((_) => {
|
|
@@ -2543,7 +2719,7 @@ z9.object({
|
|
|
2543
2719
|
)
|
|
2544
2720
|
)
|
|
2545
2721
|
});
|
|
2546
|
-
var zVaultRequestResponse =
|
|
2722
|
+
var zVaultRequestResponse = z13.discriminatedUnion(
|
|
2547
2723
|
"type",
|
|
2548
2724
|
ensureNonEmptyArray(
|
|
2549
2725
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
@@ -2557,14 +2733,14 @@ var zVaultRequestResponse = z9.discriminatedUnion(
|
|
|
2557
2733
|
description: "Vault request response data",
|
|
2558
2734
|
id: "VaultRequestResponse"
|
|
2559
2735
|
});
|
|
2560
|
-
|
|
2736
|
+
z13.enum([
|
|
2561
2737
|
"state",
|
|
2562
2738
|
"expiresAt",
|
|
2563
2739
|
"createdAt",
|
|
2564
2740
|
"updatedAt"
|
|
2565
2741
|
]).default("createdAt");
|
|
2566
|
-
|
|
2567
|
-
pubKey:
|
|
2742
|
+
z13.object({
|
|
2743
|
+
pubKey: z13.string().meta({ description: "Public key of the current user" }),
|
|
2568
2744
|
challenge: zUserChallenge.meta({
|
|
2569
2745
|
description: "Challenge data to sign with the user's private key"
|
|
2570
2746
|
})
|