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