@ledgerhq/revault-api 1.37.0 → 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 -4738
- package/lib/fakes.mjs +913 -698
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +21262 -26758
- package/lib/index.mjs +2 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +5 -5
- package/lib/app-types-BiULyctM.d.mts +0 -46528
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,102 +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
|
-
|
|
557
|
-
|
|
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
|
+
});
|
|
558
681
|
var zSolanaLikeTransactionData = z7.discriminatedUnion("type", [
|
|
559
682
|
zSolanaLikeCreateDelegateStakeData,
|
|
560
683
|
zSolanaLikeDeactivateStakeData,
|
|
@@ -570,44 +693,59 @@ var zSolanaLikeTransactionData = z7.discriminatedUnion("type", [
|
|
|
570
693
|
]);
|
|
571
694
|
var zCardanoSendData = zCommonTransactionData.extend({
|
|
572
695
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
573
|
-
feeStrategy: zFeeStrategy.
|
|
574
|
-
}).
|
|
696
|
+
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" })
|
|
697
|
+
}).meta({
|
|
698
|
+
description: "Cardano-like send data",
|
|
699
|
+
id: "CardanoSendData"
|
|
700
|
+
});
|
|
575
701
|
var zCardanoStakingDelegateData = z7.object({
|
|
576
702
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
577
|
-
currency: zCurrencyString.
|
|
703
|
+
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
578
704
|
// TODO: strict literal or enum?
|
|
579
|
-
maxFee: zUnsignedIntString.nullable().
|
|
580
|
-
feeStrategy: zFeeStrategy.
|
|
705
|
+
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
706
|
+
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
581
707
|
// DELEGATE doesn't have neither amount nor recipient
|
|
582
|
-
stakePoolId: z7.string().min(1).max(100).
|
|
583
|
-
}).
|
|
708
|
+
stakePoolId: z7.string().min(1).max(100).meta({ description: "" })
|
|
709
|
+
}).meta({
|
|
710
|
+
description: "Cardano-like staking delegate",
|
|
711
|
+
id: "CardanoStakingDelegateData"
|
|
712
|
+
});
|
|
584
713
|
var zCardanoStakingDeregisterData = z7.object({
|
|
585
714
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
586
|
-
currency: zCurrencyString.
|
|
715
|
+
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
587
716
|
// TODO: strict literal or enum?
|
|
588
|
-
maxFee: zUnsignedIntString.nullable().
|
|
589
|
-
feeStrategy: zFeeStrategy.
|
|
717
|
+
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
718
|
+
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
590
719
|
// DEREGISTER doesn't have a recipient
|
|
591
|
-
amount: zUnsignedIntString.
|
|
592
|
-
}).
|
|
720
|
+
amount: zUnsignedIntString.meta({ description: "Amount to deregister" })
|
|
721
|
+
}).meta({
|
|
722
|
+
description: "Cardano-like staking deregister data",
|
|
723
|
+
id: "CardanoStakingDeregisterData"
|
|
724
|
+
});
|
|
593
725
|
var zCardanoStakingRegisterData = z7.object({
|
|
594
726
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
595
|
-
currency: zCurrencyString.
|
|
727
|
+
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
596
728
|
// TODO: strict literal or enum?
|
|
597
|
-
maxFee: zUnsignedIntString.nullable().
|
|
598
|
-
feeStrategy: zFeeStrategy.
|
|
729
|
+
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
730
|
+
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
599
731
|
// REGISTER doesn't have a recipient
|
|
600
|
-
amount: zUnsignedIntString.
|
|
601
|
-
}).
|
|
732
|
+
amount: zUnsignedIntString.meta({ description: "Amount to register" })
|
|
733
|
+
}).meta({
|
|
734
|
+
description: "Cardano-like staking register data",
|
|
735
|
+
id: "CardanoStakingRegisterData"
|
|
736
|
+
});
|
|
602
737
|
var zCardanoStakingWithdrawData = z7.object({
|
|
603
738
|
type: z7.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
604
|
-
currency: zCurrencyString.
|
|
739
|
+
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
605
740
|
// TODO: strict literal or enum?
|
|
606
|
-
maxFee: zUnsignedIntString.nullable().
|
|
607
|
-
feeStrategy: zFeeStrategy.
|
|
741
|
+
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
742
|
+
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
608
743
|
// WITHDRAW doesn't have a recipient
|
|
609
|
-
amount: zUnsignedIntString.
|
|
610
|
-
}).
|
|
744
|
+
amount: zUnsignedIntString.meta({ description: "Amount to withdraw" })
|
|
745
|
+
}).meta({
|
|
746
|
+
description: "Cardano-like staking withdraw data",
|
|
747
|
+
id: "CardanoStakingWithdrawData"
|
|
748
|
+
});
|
|
611
749
|
var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
|
|
612
750
|
zCardanoSendData,
|
|
613
751
|
zCardanoStakingDelegateData,
|
|
@@ -617,29 +755,76 @@ var zCardanoLikeTransactionData = z7.discriminatedUnion("type", [
|
|
|
617
755
|
]);
|
|
618
756
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
619
757
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
620
|
-
feeStrategy: zFeeStrategy.
|
|
621
|
-
}).
|
|
758
|
+
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
|
|
759
|
+
}).meta({
|
|
760
|
+
description: "Sui-like send data",
|
|
761
|
+
id: "SuiLikeSendData"
|
|
762
|
+
});
|
|
622
763
|
var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
623
764
|
type: z7.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
624
|
-
feeStrategy: zFeeStrategy.
|
|
625
|
-
}).
|
|
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
|
+
});
|
|
626
800
|
var zSuiLikeTransactionData = z7.discriminatedUnion("type", [
|
|
627
801
|
zSuiLikeSendData,
|
|
628
|
-
zSuiLikeTransferTokenData
|
|
802
|
+
zSuiLikeTransferTokenData,
|
|
803
|
+
zSuiLikeStakeData,
|
|
804
|
+
zSuiLikeUnstakeData
|
|
629
805
|
]);
|
|
630
806
|
var zGenericTransactionData = z7.object({
|
|
631
807
|
type: z7.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
632
|
-
currency: zCurrencyString.
|
|
633
|
-
rawTx: z7.string().
|
|
634
|
-
}).
|
|
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
|
+
});
|
|
635
814
|
var zTronLikeSendData = zCommonTransactionData.extend({
|
|
636
815
|
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
|
|
637
|
-
feeStrategy: zFeeStrategy.
|
|
638
|
-
}).
|
|
816
|
+
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
817
|
+
}).meta({
|
|
818
|
+
description: "Tron-like send data",
|
|
819
|
+
id: "TronLikeSendData"
|
|
820
|
+
});
|
|
639
821
|
var zTronLikeSendTokenData = zCommonTransactionData.extend({
|
|
640
822
|
type: z7.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
|
|
641
|
-
feeStrategy: zFeeStrategy.
|
|
642
|
-
}).
|
|
823
|
+
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
824
|
+
}).meta({
|
|
825
|
+
description: "Tron-like send token data",
|
|
826
|
+
id: "TronLikeSendTokenData"
|
|
827
|
+
});
|
|
643
828
|
var zTronLikeTransactionData = z7.discriminatedUnion("type", [
|
|
644
829
|
zTronLikeSendData,
|
|
645
830
|
zTronLikeSendTokenData
|
|
@@ -680,32 +865,29 @@ var zSendOnlyTransactionData = z7.discriminatedUnion("type", [
|
|
|
680
865
|
zTezosLikeSendData
|
|
681
866
|
]);
|
|
682
867
|
var zCreateTransactionRequestData = z7.object({
|
|
683
|
-
accountId: z7.string().min(1).
|
|
868
|
+
accountId: z7.string().min(1).meta({ description: "Target account id" }),
|
|
684
869
|
transaction: zTransactionData
|
|
870
|
+
}).meta({
|
|
871
|
+
description: "Create transaction request data",
|
|
872
|
+
id: "CreateTransactionRequestData"
|
|
685
873
|
});
|
|
686
874
|
var zSignMessageRequestData = z7.object({
|
|
687
|
-
message: zMessage.
|
|
688
|
-
accountId: z7.string().min(1).
|
|
689
|
-
address: z7.string().nonempty().
|
|
690
|
-
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" })
|
|
691
879
|
});
|
|
692
880
|
var zSignMessageUserInputData = zSignMessageRequestData.partial({
|
|
693
881
|
address: true,
|
|
694
882
|
derivationPath: true
|
|
695
883
|
});
|
|
696
|
-
z7.object({
|
|
697
|
-
// Populated after input data is validated.
|
|
698
|
-
govRuleHsmId: zHsmObjectId.optional(),
|
|
699
|
-
// Populated after request is executed -- it holds the message-signing result.
|
|
700
|
-
signature: zHsmSignature.optional()
|
|
701
|
-
});
|
|
702
884
|
var zDigestData = z7.object({
|
|
703
|
-
digest: zHexString.
|
|
704
|
-
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" })
|
|
705
887
|
});
|
|
706
888
|
var zSignDigestsRequestData = z7.object({
|
|
707
|
-
accountId: z7.string().min(1).
|
|
708
|
-
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" })
|
|
709
891
|
});
|
|
710
892
|
z7.object({
|
|
711
893
|
signatures: z7.array(zHsmSignature)
|
|
@@ -727,7 +909,7 @@ var zEthereumLikeTransferCoinFields = z7.object({
|
|
|
727
909
|
});
|
|
728
910
|
var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
|
|
729
911
|
type: zEthereumLikeContractTransactionType,
|
|
730
|
-
contractData: z7.string().
|
|
912
|
+
contractData: z7.string().meta({ description: "Contract deployment or contract execution data" })
|
|
731
913
|
});
|
|
732
914
|
var zGenericCoinFields = z7.object({
|
|
733
915
|
type: zGenericTransactionType
|
|
@@ -753,30 +935,30 @@ var zTezosLikeCoinFields = z7.object({
|
|
|
753
935
|
type: zTezosLikeTransactionType
|
|
754
936
|
});
|
|
755
937
|
var zCommonTransactionResponse = z7.object({
|
|
756
|
-
id: z7.string().
|
|
757
|
-
hash: z7.string().
|
|
938
|
+
id: z7.string().meta({ description: "Internal unique identifier" }),
|
|
939
|
+
hash: z7.string().meta({ description: "Transaction hash" }),
|
|
758
940
|
block: z7.object({
|
|
759
|
-
height: z7.string().nullable().
|
|
760
|
-
time: z7.string().nullable().
|
|
941
|
+
height: z7.string().nullable().meta({ description: "Transaction block height" }),
|
|
942
|
+
time: z7.string().nullable().meta({ description: "Transaction block time" })
|
|
761
943
|
}),
|
|
762
|
-
status: zTransactionStatus.
|
|
763
|
-
confirmations: z7.string().
|
|
764
|
-
amount: z7.string().
|
|
765
|
-
fee: z7.string().
|
|
766
|
-
senders: z7.array(z7.string()).
|
|
767
|
-
recipients: z7.array(z7.string()).
|
|
768
|
-
});
|
|
769
|
-
var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.
|
|
770
|
-
var zCardanoLikeTransactionResponse = zCommonTransactionResponse.
|
|
771
|
-
var zEthereumLikeTransferTransactionResponse = zCommonTransactionResponse.
|
|
772
|
-
var zEthereumLikeContractTransactionResponse = zCommonTransactionResponse.
|
|
773
|
-
var zGenericTransactionResponse = zCommonTransactionResponse.
|
|
774
|
-
var zPolkadotLikeTransactionResponse = zCommonTransactionResponse.
|
|
775
|
-
var zRippleLikeTransactionResponse = zCommonTransactionResponse.
|
|
776
|
-
var zSolanaLikeTransactionResponse = zCommonTransactionResponse.
|
|
777
|
-
var zStellarLikeTransactionResponse = zCommonTransactionResponse.
|
|
778
|
-
var zTezosLikeTransactionResponse = zCommonTransactionResponse.
|
|
779
|
-
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" });
|
|
780
962
|
var zTransactionResponse = z7.discriminatedUnion("type", [
|
|
781
963
|
zBitcoinLikeTransactionResponse,
|
|
782
964
|
zCardanoLikeTransactionResponse,
|
|
@@ -791,63 +973,63 @@ var zTransactionResponse = z7.discriminatedUnion("type", [
|
|
|
791
973
|
zTezosLikeTransactionResponse
|
|
792
974
|
]);
|
|
793
975
|
z7.discriminatedUnion(
|
|
794
|
-
zTransactionResponse.discriminator,
|
|
976
|
+
zTransactionResponse._zod.def.discriminator,
|
|
795
977
|
ensureNonEmptyArray(
|
|
796
978
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
|
|
797
979
|
)
|
|
798
980
|
);
|
|
799
981
|
var zBitcoinLikeAssetFields = z.object({
|
|
800
|
-
type: z.literal(AccountType.BITCOIN_LIKE).
|
|
801
|
-
xpub: z.string().
|
|
802
|
-
}).
|
|
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" });
|
|
803
985
|
var zCardanoLikeAssetFields = z.object({
|
|
804
|
-
type: z.literal(AccountType.CARDANO_LIKE).
|
|
805
|
-
address: z.string().
|
|
806
|
-
}).
|
|
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" });
|
|
807
989
|
var zEthereumLikeAssetFields = z.object({
|
|
808
|
-
type: z.literal(AccountType.ETHEREUM_LIKE).
|
|
809
|
-
address: z.string().
|
|
810
|
-
}).
|
|
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" });
|
|
811
993
|
var zEthereumTokenLikeAssetFields = z.object({
|
|
812
|
-
type: z.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE, AccountType.TRC20_LIKE]).
|
|
813
|
-
address: z.string().
|
|
814
|
-
contractAddress: z.string().
|
|
815
|
-
"Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
|
|
816
|
-
).optional()
|
|
817
|
-
}).
|
|
818
|
-
var zGenericLikeAssetFields = z.object({ type: z.literal(AccountType.GENERIC_LIKE).
|
|
819
|
-
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" });
|
|
820
1002
|
var zPolkadotLikeAssetFields = z.object({
|
|
821
|
-
type: z.literal(AccountType.POLKADOT_LIKE).
|
|
822
|
-
address: z.string().
|
|
823
|
-
}).
|
|
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" });
|
|
824
1006
|
var zRippleLikeAssetFields = z.object({
|
|
825
|
-
type: z.literal(AccountType.RIPPLE_LIKE).
|
|
826
|
-
address: z.string().
|
|
827
|
-
}).
|
|
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" });
|
|
828
1010
|
var zSolanaLikeAssetFields = z.object({
|
|
829
|
-
type: z.literal(AccountType.SOLANA_LIKE).
|
|
830
|
-
address: z.string().
|
|
831
|
-
contractAddress: z.string().
|
|
832
|
-
"Will be deprecated, Use contractAddress at root objet level instead; Token contract address"
|
|
833
|
-
).nullable().optional()
|
|
834
|
-
}).
|
|
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" });
|
|
835
1017
|
var zStellarLikeAssetFields = z.object({
|
|
836
|
-
type: z.literal(AccountType.STELLAR_LIKE).
|
|
837
|
-
address: z.string().
|
|
838
|
-
}).
|
|
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" });
|
|
839
1021
|
var zSuiLikeAssetFields = z.object({
|
|
840
|
-
type: z.literal(AccountType.SUI_LIKE).
|
|
841
|
-
address: z.string().
|
|
842
|
-
}).
|
|
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" });
|
|
843
1025
|
var zTezosLikeAssetFields = z.object({
|
|
844
|
-
type: z.literal(AccountType.TEZOS_LIKE).
|
|
845
|
-
address: z.string().
|
|
846
|
-
}).
|
|
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" });
|
|
847
1029
|
var zTronLikeAssetFields = z.object({
|
|
848
|
-
type: z.literal(AccountType.TRON_LIKE).
|
|
849
|
-
address: z.string().
|
|
850
|
-
}).
|
|
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" });
|
|
851
1033
|
var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
852
1034
|
zBitcoinLikeAssetFields,
|
|
853
1035
|
zCardanoLikeAssetFields,
|
|
@@ -862,22 +1044,22 @@ var zAccountAssetStaticFields = z.discriminatedUnion("type", [
|
|
|
862
1044
|
zTezosLikeAssetFields,
|
|
863
1045
|
zSuiLikeAssetFields,
|
|
864
1046
|
zTronLikeAssetFields
|
|
865
|
-
]).
|
|
1047
|
+
]).meta({ description: "Account asset fields" });
|
|
866
1048
|
var zReviewStepWithUsers = z.object({
|
|
867
|
-
quorum: z.number().min(0).
|
|
868
|
-
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" })
|
|
869
1051
|
// PKs to `User` model
|
|
870
|
-
}).
|
|
1052
|
+
}).meta({ description: "Review step with users" });
|
|
871
1053
|
var zReviewStepWithUsersArray = z.array(zReviewStepWithUsers);
|
|
872
1054
|
var zReviewStepData = z.union([
|
|
873
1055
|
zReviewStepWithUsers,
|
|
874
1056
|
z.object({
|
|
875
|
-
quorum: z.number().min(0).
|
|
876
|
-
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" })
|
|
877
1059
|
// PKs to `Group` model
|
|
878
|
-
}).
|
|
1060
|
+
}).meta({ description: "Review step with group" })
|
|
879
1061
|
]);
|
|
880
|
-
var zReviewStepsArray = z.array(zReviewStepData).min(1).
|
|
1062
|
+
var zReviewStepsArray = z.array(zReviewStepData).min(1).meta({ description: "Review steps" });
|
|
881
1063
|
|
|
882
1064
|
// src/prisma-utils/policy.ts
|
|
883
1065
|
var policy_exports = {};
|
|
@@ -889,21 +1071,21 @@ __export(policy_exports, {
|
|
|
889
1071
|
zWhitelistIds: () => zWhitelistIds
|
|
890
1072
|
});
|
|
891
1073
|
var zThreshold = z.object({
|
|
892
|
-
min: zUnsignedIntString.nullable().
|
|
893
|
-
max: zUnsignedIntString.nullable().
|
|
894
|
-
}).
|
|
895
|
-
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" });
|
|
896
1078
|
var zGovRuleJsonObject = z.object({
|
|
897
1079
|
// Required.
|
|
898
|
-
operationType: zOperationType.
|
|
1080
|
+
operationType: zOperationType.meta({ description: "Allowed operation type" }),
|
|
899
1081
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
900
1082
|
threshold: zThreshold,
|
|
901
1083
|
// Optional whitelist on transaction recipient: Empty list means no whitelist.
|
|
902
1084
|
whitelistIds: zWhitelistIds,
|
|
903
|
-
reviewConfigId: z.string().min(1).
|
|
1085
|
+
reviewConfigId: z.string().min(1).meta({ description: "Id of ReviewConfig" }),
|
|
904
1086
|
// HSM id for the rule
|
|
905
1087
|
hsmId: zHsmObjectId
|
|
906
|
-
}).
|
|
1088
|
+
}).meta({ description: "INTERNAL: Governance rule JSON representation in DB" });
|
|
907
1089
|
var zGovRulesJsonArray = z.array(zGovRuleJsonObject);
|
|
908
1090
|
var parseFields = (policy) => {
|
|
909
1091
|
const rulesJsonArray = zGovRulesJsonArray.parse(policy.rulesJsonArray);
|
|
@@ -922,7 +1104,7 @@ var INCLUDE_MEMBERS = {
|
|
|
922
1104
|
}
|
|
923
1105
|
};
|
|
924
1106
|
var zUpdateQuorumRequestData = z7.object({
|
|
925
|
-
quorum: z7.number().int().min(2).
|
|
1107
|
+
quorum: z7.number().int().min(2).meta({ description: "Workspace quorum" })
|
|
926
1108
|
});
|
|
927
1109
|
var zWorkspaceName = z7.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
928
1110
|
|
|
@@ -933,12 +1115,12 @@ var zTradelinkWhitelistAddress = z7.object({
|
|
|
933
1115
|
address: z7.string().min(1)
|
|
934
1116
|
});
|
|
935
1117
|
z7.array(zTradelinkWhitelistAddress);
|
|
936
|
-
var zTradelinkId = z7.string().
|
|
1118
|
+
var zTradelinkId = z7.string().meta({ description: "Unique identifier in Tradelink service" });
|
|
937
1119
|
var zTradelinkOrgEntityResponse = z7.object({
|
|
938
1120
|
tradelinkId: zTradelinkId,
|
|
939
|
-
name: z7.string().
|
|
940
|
-
code: z7.string().
|
|
941
|
-
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" })
|
|
942
1124
|
});
|
|
943
1125
|
zTradelinkOrgEntityResponse.omit({
|
|
944
1126
|
tradelinkId: true
|
|
@@ -947,11 +1129,13 @@ z7.object({
|
|
|
947
1129
|
tradelinkId: zTradelinkId
|
|
948
1130
|
});
|
|
949
1131
|
var zTradelinkExchangeConfig = z7.object({
|
|
950
|
-
exchangeId: z7.string().
|
|
951
|
-
repledgeAuthorized: z7.boolean().
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
)
|
|
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
|
+
})
|
|
955
1139
|
});
|
|
956
1140
|
var zTradelinkExchangeConfigs = z7.array(zTradelinkExchangeConfig);
|
|
957
1141
|
z7.object({
|
|
@@ -992,15 +1176,15 @@ z7.object({
|
|
|
992
1176
|
"PLEDGE_CONSUMED"
|
|
993
1177
|
]),
|
|
994
1178
|
isLocked: z7.boolean(),
|
|
995
|
-
amount: z7.string().
|
|
996
|
-
pending: z7.string().
|
|
997
|
-
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" }),
|
|
998
1182
|
exchangeTradelinkId: z7.string(),
|
|
999
1183
|
accountId: z7.string()
|
|
1000
1184
|
});
|
|
1001
1185
|
z7.object({
|
|
1002
1186
|
workspaceName: z7.string(),
|
|
1003
|
-
clientAccountId: z7.string().
|
|
1187
|
+
clientAccountId: z7.string().meta({ description: "Account ID from the client side" }),
|
|
1004
1188
|
exchangeTradelinkId: zTradelinkId,
|
|
1005
1189
|
asset: zTradelinkAsset
|
|
1006
1190
|
});
|
|
@@ -1030,163 +1214,241 @@ z7.object({
|
|
|
1030
1214
|
});
|
|
1031
1215
|
|
|
1032
1216
|
// src/tradelink/request-data.ts
|
|
1033
|
-
var
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
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" })
|
|
1037
1222
|
});
|
|
1038
1223
|
var zTradelinkEntityRequestData = z7.object({
|
|
1039
1224
|
tradelinkId: z7.string().min(1),
|
|
1040
|
-
groups: zReviewStepWithUsersArray.
|
|
1041
|
-
whitelist: z7.array(zTradelinkWhitelistAddress).
|
|
1042
|
-
});
|
|
1043
|
-
var
|
|
1044
|
-
accountId: z7.string().
|
|
1045
|
-
exchangeId: z7.string().
|
|
1046
|
-
amount: zIntString.
|
|
1047
|
-
});
|
|
1048
|
-
var
|
|
1049
|
-
accountId: z7.string().
|
|
1050
|
-
exchangeId: z7.string().
|
|
1051
|
-
amount: zIntString.
|
|
1052
|
-
});
|
|
1053
|
-
var
|
|
1054
|
-
accountId: z7.string().
|
|
1055
|
-
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" }),
|
|
1056
1241
|
transaction: zSendOnlyTransactionData
|
|
1057
1242
|
});
|
|
1058
|
-
var
|
|
1059
|
-
accountId: z7.string().
|
|
1060
|
-
exchangeId: z7.string().
|
|
1243
|
+
var zTradelinkForceUnpledgeRequestData = z7.object({
|
|
1244
|
+
accountId: z7.string().meta({ description: "Account id" }),
|
|
1245
|
+
exchangeId: z7.string().meta({ description: "Exchange id" })
|
|
1061
1246
|
});
|
|
1062
1247
|
var zTradelinkWithdrawRequestData = z7.object({
|
|
1063
|
-
accountId: z7.string().
|
|
1248
|
+
accountId: z7.string().meta({ description: "Account id" }),
|
|
1064
1249
|
transaction: zSendOnlyTransactionData
|
|
1065
1250
|
});
|
|
1066
1251
|
var zTradelinkArbitrationRequestData = z7.object({
|
|
1067
|
-
accountId: z7.string().
|
|
1252
|
+
accountId: z7.string().meta({ description: "Account id" }),
|
|
1068
1253
|
transaction: zSendOnlyTransactionData
|
|
1069
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
|
+
};
|
|
1070
1322
|
|
|
1071
1323
|
// src/accounts/account-governance-fields.ts
|
|
1072
1324
|
var zClassicAccountGovernanceFields = z.object({
|
|
1073
|
-
type: z.literal(AccountGovernanceType.CLASSIC).
|
|
1074
|
-
policyId: z.string().
|
|
1075
|
-
}).
|
|
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" });
|
|
1076
1328
|
var zTradelinkAccountGovernanceFields = z.object({
|
|
1077
|
-
type: z.literal(AccountGovernanceType.TRADELINK).
|
|
1078
|
-
assetManagerId: z.string().
|
|
1079
|
-
exchangeConfigs: zTradelinkExchangeConfigs.
|
|
1080
|
-
|
|
1081
|
-
|
|
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" });
|
|
1082
1336
|
var zCardanoLikeStakingData = z7.object({
|
|
1083
|
-
staked: z7.string().
|
|
1084
|
-
}).nullable().
|
|
1337
|
+
staked: z7.string().meta({ description: "Staked balance" })
|
|
1338
|
+
}).nullable().meta({ description: "Cardano-like staking data" });
|
|
1085
1339
|
var zCardanoLikeStakingFields = z7.object({
|
|
1086
|
-
type: z7.literal(AccountType.CARDANO_LIKE).
|
|
1340
|
+
type: z7.literal(AccountType.CARDANO_LIKE).meta({ description: "Account type" }),
|
|
1087
1341
|
staking: zCardanoLikeStakingData.optional()
|
|
1088
1342
|
});
|
|
1089
1343
|
var zEthereumLikeStakingData = z7.object({
|
|
1090
|
-
totalStaking: z7.string().
|
|
1091
|
-
totalRewards: z7.string().
|
|
1092
|
-
availableRewards: z7.string().
|
|
1093
|
-
networkApy: z7.number().
|
|
1094
|
-
}).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" });
|
|
1095
1349
|
var zEthereumLikeStakingFields = z7.object({
|
|
1096
|
-
type: z7.literal(AccountType.ETHEREUM_LIKE).
|
|
1350
|
+
type: z7.literal(AccountType.ETHEREUM_LIKE).meta({ description: "Account type" }),
|
|
1097
1351
|
staking: zEthereumLikeStakingData.optional()
|
|
1098
1352
|
});
|
|
1099
1353
|
var zPolkadotUnbondingAmount = z7.object({
|
|
1100
|
-
amount: z7.string().
|
|
1101
|
-
waiting_time: z7.string().
|
|
1354
|
+
amount: z7.string().meta({ description: "Amount" }),
|
|
1355
|
+
waiting_time: z7.string().meta({ description: "Waiting time" })
|
|
1102
1356
|
});
|
|
1103
1357
|
var zPolkadotLikeStakingData = z7.object({
|
|
1104
1358
|
info: z7.object({
|
|
1105
|
-
controllerAddress: z7.string().nullable().
|
|
1106
|
-
rewardsDestination: z7.string().nullable().
|
|
1107
|
-
proxies: z7.array(z7.string()).
|
|
1108
|
-
legacyStaking: z7.boolean().
|
|
1109
|
-
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" })
|
|
1110
1364
|
}),
|
|
1111
1365
|
balances: z7.object({
|
|
1112
|
-
free: z7.string().
|
|
1113
|
-
reserved: z7.string().
|
|
1114
|
-
frozen: z7.string().
|
|
1115
|
-
bonded: z7.string().
|
|
1116
|
-
available: z7.string().
|
|
1117
|
-
unbonding: z7.array(zPolkadotUnbondingAmount).
|
|
1118
|
-
unbonded: z7.array(zPolkadotUnbondingAmount).
|
|
1119
|
-
totalUnbonding: z7.string().
|
|
1120
|
-
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" })
|
|
1121
1375
|
}),
|
|
1122
1376
|
anonymousProxy: z7.object({
|
|
1123
|
-
address: z7.string().
|
|
1124
|
-
createdAt: z7.string().
|
|
1125
|
-
isController: z7.boolean().
|
|
1126
|
-
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" }),
|
|
1127
1381
|
balances: z7.object({
|
|
1128
|
-
free: z7.string().
|
|
1129
|
-
reserved: z7.string().
|
|
1130
|
-
frozen: z7.string().
|
|
1131
|
-
bonded: z7.string().
|
|
1132
|
-
available: z7.string().
|
|
1133
|
-
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" })
|
|
1134
1388
|
}).nullable(),
|
|
1135
|
-
blockHeight: z7.string().
|
|
1136
|
-
extIndex: z7.string().
|
|
1137
|
-
index: z7.string().
|
|
1138
|
-
kind: z7.string().
|
|
1139
|
-
}).nullable().
|
|
1140
|
-
}).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" });
|
|
1141
1395
|
var zPolkadotLikeStakingFields = z7.object({
|
|
1142
|
-
type: z7.literal(AccountType.POLKADOT_LIKE).
|
|
1396
|
+
type: z7.literal(AccountType.POLKADOT_LIKE).meta({ description: "Account type" }),
|
|
1143
1397
|
staking: zPolkadotLikeStakingData.optional()
|
|
1144
1398
|
});
|
|
1145
|
-
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" });
|
|
1146
1400
|
var zSolanaLikeStakingData = z7.object({
|
|
1147
|
-
staked: z7.string().
|
|
1401
|
+
staked: z7.string().meta({ description: "Staked balance" }),
|
|
1148
1402
|
rewards: z7.object({
|
|
1149
|
-
total: z7.string().
|
|
1150
|
-
last7: z7.string().
|
|
1151
|
-
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" })
|
|
1152
1406
|
}),
|
|
1153
1407
|
stakes: z7.array(
|
|
1154
1408
|
z7.object({
|
|
1155
1409
|
uid: z7.string(),
|
|
1156
1410
|
baseAccountUid: z7.string(),
|
|
1157
|
-
pubKey: z7.string().
|
|
1158
|
-
validatorPubKey: z7.string().nullable().
|
|
1159
|
-
initialAmount: z7.string().
|
|
1160
|
-
activeAmount: z7.string().
|
|
1161
|
-
inactiveAmount: z7.string().
|
|
1162
|
-
totalBalance: z7.string().
|
|
1163
|
-
creationDate: z7.string().
|
|
1164
|
-
activationEpoch: z7.string().nullable().
|
|
1165
|
-
activationDate: z7.string().nullable().
|
|
1166
|
-
deactivationEpoch: z7.string().nullable().
|
|
1167
|
-
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" }),
|
|
1168
1422
|
status: zSolanaStakingAccountStatus,
|
|
1169
|
-
rentExemptReserve: z7.string().
|
|
1170
|
-
withdrawableAmount: z7.string().
|
|
1171
|
-
totalRewards: z7.string().
|
|
1172
|
-
creationTxHash: z7.string().nullable().
|
|
1173
|
-
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" })
|
|
1174
1428
|
})
|
|
1175
1429
|
)
|
|
1176
|
-
}).nullable().
|
|
1430
|
+
}).nullable().meta({ description: "Solana-like staking data" });
|
|
1177
1431
|
var zSolanaLikeStakingFields = z7.object({
|
|
1178
|
-
type: z7.literal(AccountType.SOLANA_LIKE).
|
|
1432
|
+
type: z7.literal(AccountType.SOLANA_LIKE).meta({ description: "Account type" }),
|
|
1179
1433
|
staking: zSolanaLikeStakingData.optional()
|
|
1180
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
|
+
});
|
|
1181
1443
|
var zTezosLikeStakingData = z7.object({
|
|
1182
1444
|
delegations: z7.array(
|
|
1183
1445
|
z7.object({
|
|
1184
1446
|
address: z7.string()
|
|
1185
1447
|
})
|
|
1186
1448
|
)
|
|
1187
|
-
}).nullable().
|
|
1449
|
+
}).nullable().meta({ description: "Tezos-like staking data" });
|
|
1188
1450
|
var zTezosLikeStakingFields = z7.object({
|
|
1189
|
-
type: z7.literal(AccountType.TEZOS_LIKE).
|
|
1451
|
+
type: z7.literal(AccountType.TEZOS_LIKE).meta({ description: "Account type" }),
|
|
1190
1452
|
staking: zTezosLikeStakingData.optional()
|
|
1191
1453
|
});
|
|
1192
1454
|
z7.discriminatedUnion("type", [
|
|
@@ -1194,27 +1456,28 @@ z7.discriminatedUnion("type", [
|
|
|
1194
1456
|
zEthereumLikeStakingFields,
|
|
1195
1457
|
zPolkadotLikeStakingFields,
|
|
1196
1458
|
zSolanaLikeStakingFields,
|
|
1459
|
+
zSuiLikeStakingFields,
|
|
1197
1460
|
zTezosLikeStakingFields
|
|
1198
1461
|
]);
|
|
1199
1462
|
|
|
1200
1463
|
// src/accounts/types.ts
|
|
1201
1464
|
var zAccountCommonFields = z7.object({
|
|
1202
|
-
id: z7.string().
|
|
1203
|
-
legacyId: z7.number().
|
|
1204
|
-
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" }),
|
|
1205
1468
|
currency: zCurrencyString,
|
|
1206
1469
|
network: zNetwork,
|
|
1207
|
-
contractAddress: z7.string().
|
|
1208
|
-
index: z7.number().gte(0).
|
|
1209
|
-
derivationPath: z7.string().
|
|
1210
|
-
status: z7.
|
|
1211
|
-
createdAt: z7.coerce.date().
|
|
1212
|
-
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" })
|
|
1213
1476
|
});
|
|
1214
1477
|
var zAccountBalanceFields = z7.object({
|
|
1215
|
-
total: z7.string().
|
|
1216
|
-
pending: z7.string().
|
|
1217
|
-
}).
|
|
1478
|
+
total: z7.string().meta({ description: "Total balance" }),
|
|
1479
|
+
pending: z7.string().meta({ description: "Pending balance" })
|
|
1480
|
+
}).meta({ description: "Balance fields" });
|
|
1218
1481
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1219
1482
|
asset: zAccountAssetStaticFields,
|
|
1220
1483
|
governance: zAccountGovernanceFields
|
|
@@ -1227,38 +1490,36 @@ z7.enum([
|
|
|
1227
1490
|
"updatedAt"
|
|
1228
1491
|
]).default("createdAt");
|
|
1229
1492
|
var zCommonLiveData = z7.object({
|
|
1230
|
-
id: z7.string().
|
|
1493
|
+
id: z7.string().meta({ description: "Account internal unique identifier" }),
|
|
1231
1494
|
balance: zAccountBalanceFields
|
|
1232
1495
|
});
|
|
1233
1496
|
var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
1234
|
-
type: z7.literal(AccountType.BITCOIN_LIKE).
|
|
1235
|
-
}).
|
|
1236
|
-
var zCardanoLikeLiveData = zCommonLiveData.
|
|
1237
|
-
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" });
|
|
1238
1501
|
var zEthereumTokenLikeLiveData = zCommonLiveData.extend({
|
|
1239
|
-
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).
|
|
1240
|
-
}).
|
|
1502
|
+
type: z7.enum([AccountType.ERC20_LIKE, AccountType.BEP20_LIKE]).meta({ description: "Account type" })
|
|
1503
|
+
}).meta({ description: "Ethereum-like token" });
|
|
1241
1504
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
1242
|
-
type: z7.literal(AccountType.GENERIC_LIKE).
|
|
1243
|
-
}).
|
|
1244
|
-
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" });
|
|
1245
1508
|
var zRawSigningLiveData = zCommonLiveData.extend({
|
|
1246
|
-
type: z7.literal(AccountType.RAW_SIGNING).
|
|
1247
|
-
}).
|
|
1509
|
+
type: z7.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" })
|
|
1510
|
+
}).meta({ description: "Raw signing account" });
|
|
1248
1511
|
var zRippleLikeLiveData = zCommonLiveData.extend({
|
|
1249
|
-
type: z7.literal(AccountType.RIPPLE_LIKE).
|
|
1250
|
-
}).
|
|
1251
|
-
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" });
|
|
1252
1515
|
var zStellarLikeLiveData = zCommonLiveData.extend({
|
|
1253
|
-
type: z7.literal(AccountType.STELLAR_LIKE).
|
|
1254
|
-
}).
|
|
1255
|
-
var zSuiLikeLiveData = zCommonLiveData.extend({
|
|
1256
|
-
|
|
1257
|
-
}).describe("Sui-like");
|
|
1258
|
-
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" });
|
|
1259
1520
|
var zTronLikeLiveData = zCommonLiveData.extend({
|
|
1260
|
-
type: z7.enum([AccountType.TRON_LIKE, AccountType.TRC20_LIKE]).
|
|
1261
|
-
}).
|
|
1521
|
+
type: z7.enum([AccountType.TRON_LIKE, AccountType.TRC20_LIKE]).meta({ description: "Account type" })
|
|
1522
|
+
}).meta({ description: "Tron-like" });
|
|
1262
1523
|
z7.discriminatedUnion("type", [
|
|
1263
1524
|
zBitcoinLikeLiveData,
|
|
1264
1525
|
zCardanoLikeLiveData,
|
|
@@ -1275,21 +1536,30 @@ z7.discriminatedUnion("type", [
|
|
|
1275
1536
|
zTronLikeLiveData
|
|
1276
1537
|
]);
|
|
1277
1538
|
z7.object({
|
|
1278
|
-
address: z7.string().
|
|
1279
|
-
derivationPath: z7.string().nullable().
|
|
1539
|
+
address: z7.string().meta({ description: "Address" }),
|
|
1540
|
+
derivationPath: z7.string().nullable().meta({ description: "Derivation path" })
|
|
1280
1541
|
});
|
|
1281
1542
|
z7.object({
|
|
1282
|
-
amount: zIntString.
|
|
1543
|
+
amount: zIntString.meta({ description: "Amount in the smallest unit of the currency" }),
|
|
1283
1544
|
currency: zCurrency
|
|
1284
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
|
+
});
|
|
1285
1555
|
|
|
1286
1556
|
// src/accounts/app-types.ts
|
|
1287
1557
|
z7.discriminatedUnion(
|
|
1288
|
-
zTransactionResponse.discriminator,
|
|
1558
|
+
zTransactionResponse._zod.def.discriminator,
|
|
1289
1559
|
ensureNonEmptyArray(
|
|
1290
1560
|
zTransactionResponse.options.map(
|
|
1291
1561
|
(_) => _.extend({
|
|
1292
|
-
note: zNote.nullable().
|
|
1562
|
+
note: zNote.nullable().meta({ description: "Optional transaction note" })
|
|
1293
1563
|
})
|
|
1294
1564
|
)
|
|
1295
1565
|
)
|
|
@@ -1303,12 +1573,12 @@ var zWhitelistAddress = z7.object({
|
|
|
1303
1573
|
destinationTags: z7.array(z7.string().min(1).regex(/^\w+$/)).optional()
|
|
1304
1574
|
});
|
|
1305
1575
|
var zWhitelistAddresses = z7.array(zWhitelistAddress);
|
|
1306
|
-
var zWhitelistName = z7.string().min(1).max(45).
|
|
1576
|
+
var zWhitelistName = z7.string().min(1).max(45).meta({ description: "Whitelist name" });
|
|
1307
1577
|
var zCreateWhitelistRequestData = z7.object({
|
|
1308
1578
|
name: zWhitelistName,
|
|
1309
1579
|
description: z7.string().nullable(),
|
|
1310
1580
|
addresses: zWhitelistAddresses,
|
|
1311
|
-
type: z7.
|
|
1581
|
+
type: z7.enum(WhitelistType)
|
|
1312
1582
|
});
|
|
1313
1583
|
var zEditWhitelistRequestData = z7.object({
|
|
1314
1584
|
name: zWhitelistName,
|
|
@@ -1325,89 +1595,94 @@ var zBaseGovRuleData = z7.object({
|
|
|
1325
1595
|
whitelistIds: policy_exports.zWhitelistIds.optional()
|
|
1326
1596
|
});
|
|
1327
1597
|
var zClassicGovRuleData = zBaseGovRuleData.extend({
|
|
1328
|
-
operationType: zClassicOperationType.
|
|
1329
|
-
}).
|
|
1598
|
+
operationType: zClassicOperationType.meta({ description: "Allowed operation type" })
|
|
1599
|
+
}).meta({ description: "Account governance rule", id: "ClassicGovRuleData" });
|
|
1330
1600
|
zBaseGovRuleData.extend({
|
|
1331
|
-
operationType: zOperationType.
|
|
1332
|
-
}).
|
|
1601
|
+
operationType: zOperationType.meta({ description: "Allowed operation type" })
|
|
1602
|
+
}).meta({ description: "Governance rule", id: "GovRuleResponse" });
|
|
1333
1603
|
({
|
|
1334
1604
|
reviewConfigs: { include: review_config_exports.INCLUDE_MEMBERS }
|
|
1335
1605
|
});
|
|
1336
|
-
var zPolicyName = z7.string().min(1).max(19).
|
|
1337
|
-
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" });
|
|
1338
1608
|
var zCreatePublicPolicyRequestData = z7.object({
|
|
1339
1609
|
name: zPolicyName,
|
|
1340
|
-
description: z7.string().nullable().
|
|
1610
|
+
description: z7.string().nullable().meta({ description: "Description" }),
|
|
1341
1611
|
currency: zCurrency2.nullable(),
|
|
1342
|
-
govRules: z7.array(zClassicGovRuleData).
|
|
1612
|
+
govRules: z7.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
1343
1613
|
});
|
|
1344
1614
|
var zEditPublicPolicyRequestData = z7.object({
|
|
1345
1615
|
name: zPolicyName,
|
|
1346
|
-
description: z7.string().nullable().
|
|
1347
|
-
govRules: z7.array(zClassicGovRuleData).
|
|
1616
|
+
description: z7.string().nullable().meta({ description: "Description" }),
|
|
1617
|
+
govRules: z7.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
1348
1618
|
});
|
|
1349
|
-
var zAccountName = z7.string().min(1).max(40).
|
|
1619
|
+
var zAccountName = z7.string().min(1).max(40).meta({ description: "Account name" });
|
|
1350
1620
|
var zSignDigestsGovRuleData = z7.object({
|
|
1351
1621
|
operationType: z7.literal("SIGN_DIGESTS"),
|
|
1352
1622
|
reviewSteps: zReviewStepWithUsersArray
|
|
1353
1623
|
// we need to control for API users only
|
|
1354
|
-
}).
|
|
1624
|
+
}).meta({ description: "Digest signing rule" });
|
|
1355
1625
|
var zAccountPolicyRequestData = z7.union([
|
|
1356
|
-
z7.object({ policyId: z7.string() }).
|
|
1357
|
-
z7.object({ rules: z7.array(zClassicGovRuleData) }).
|
|
1358
|
-
]).
|
|
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" });
|
|
1359
1629
|
var zCreateAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
1360
1630
|
z7.object({
|
|
1361
1631
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1362
1632
|
policy: zAccountPolicyRequestData
|
|
1363
|
-
}).
|
|
1633
|
+
}).meta({ description: "Classic governance" }),
|
|
1364
1634
|
z7.object({
|
|
1365
1635
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1366
1636
|
assetManagerId: z7.string(),
|
|
1367
1637
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1368
|
-
}).
|
|
1638
|
+
}).meta({ description: "Tradelink governance" }),
|
|
1369
1639
|
z7.object({
|
|
1370
1640
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1371
1641
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1372
|
-
}).
|
|
1373
|
-
]).
|
|
1642
|
+
}).meta({ description: "Raw signing governance" })
|
|
1643
|
+
]).meta({ description: "Governance fields" });
|
|
1374
1644
|
var zCreateAccountUserInputData = z7.object({
|
|
1375
1645
|
name: zAccountName,
|
|
1376
1646
|
currency: zCurrencyString,
|
|
1377
1647
|
// "bitcoin"
|
|
1378
|
-
index: z7.number().nonnegative().optional().
|
|
1379
|
-
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" }),
|
|
1380
1650
|
governance: zCreateAccountGovernanceData
|
|
1381
1651
|
});
|
|
1382
1652
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
1383
|
-
index: z7.number().nonnegative().
|
|
1384
|
-
derivationPath: z7.string().
|
|
1385
|
-
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)
|
|
1386
1656
|
// "BITCOIN_LIKE"
|
|
1657
|
+
}).meta({
|
|
1658
|
+
description: "Create account request data",
|
|
1659
|
+
id: "CreateAccountRequestData"
|
|
1387
1660
|
});
|
|
1388
1661
|
var zEditAccountGovernanceData = z7.discriminatedUnion("type", [
|
|
1389
1662
|
z7.object({
|
|
1390
1663
|
type: z7.literal(AccountGovernanceType.CLASSIC),
|
|
1391
1664
|
policy: zAccountPolicyRequestData
|
|
1392
|
-
}).
|
|
1665
|
+
}).meta({ description: "Classic governance" }),
|
|
1393
1666
|
z7.object({
|
|
1394
1667
|
type: z7.literal(AccountGovernanceType.TRADELINK),
|
|
1395
1668
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1396
|
-
}).
|
|
1669
|
+
}).meta({ description: "Tradelink governance" }),
|
|
1397
1670
|
z7.object({
|
|
1398
1671
|
type: z7.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1399
1672
|
policy: z7.object({ rules: z7.array(zSignDigestsGovRuleData) })
|
|
1400
|
-
}).
|
|
1401
|
-
]).
|
|
1673
|
+
}).meta({ description: "Raw signing governance" })
|
|
1674
|
+
]).meta({ description: "Governance fields" });
|
|
1402
1675
|
var zEditAccountRequestData = z7.object({
|
|
1403
1676
|
name: zAccountName,
|
|
1404
1677
|
governance: zEditAccountGovernanceData
|
|
1678
|
+
}).meta({
|
|
1679
|
+
description: "Edit account request data",
|
|
1680
|
+
id: "EditAccountRequestData"
|
|
1405
1681
|
});
|
|
1406
|
-
var zActivateAccountRequestData = z7.object({});
|
|
1407
1682
|
var zEditTokenRuleRequestData = z7.object({
|
|
1408
|
-
parentAccountId: z7.string().min(1).
|
|
1409
|
-
contractAddress: z7.string().min(1).
|
|
1410
|
-
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" })
|
|
1411
1686
|
});
|
|
1412
1687
|
|
|
1413
1688
|
// src/accounts/app-utils.ts
|
|
@@ -1538,73 +1813,73 @@ var patchTezosRequestData = (data) => {
|
|
|
1538
1813
|
return data;
|
|
1539
1814
|
};
|
|
1540
1815
|
var zSciConfigData = z7.object({
|
|
1541
|
-
dapps: z7.array(z7.string()).nullable().
|
|
1542
|
-
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" })
|
|
1543
1818
|
});
|
|
1544
1819
|
var zCreateSciConfigRequestData = z7.object({
|
|
1545
|
-
account: z7.string().
|
|
1820
|
+
account: z7.string().meta({ description: "Account UUID" }),
|
|
1546
1821
|
config: zSciConfigData
|
|
1547
1822
|
});
|
|
1548
1823
|
var zEditSciConfigRequestData = z7.object({
|
|
1549
1824
|
config: zSciConfigData
|
|
1550
1825
|
});
|
|
1551
1826
|
var zRequestReviewStep = z.object({
|
|
1552
|
-
stageName: z.string().regex(/^\w+$/).
|
|
1553
|
-
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" })
|
|
1554
1829
|
});
|
|
1555
1830
|
var zRequestReviewSteps = z.array(zRequestReviewStep);
|
|
1556
|
-
var zUserName = z.string().min(1).max(19).
|
|
1831
|
+
var zUserName = z.string().min(1).max(19).meta({ description: "User name" });
|
|
1557
1832
|
var zUserRegistrationCreateInput = z.object({
|
|
1558
1833
|
name: zUserName,
|
|
1559
|
-
role: z.enum([UserRole.ADMIN, UserRole.OPERATOR]).
|
|
1560
|
-
psdModel: z.
|
|
1561
|
-
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" })
|
|
1562
1837
|
});
|
|
1563
1838
|
zUserRegistrationCreateInput.extend({
|
|
1564
|
-
id: z.string().
|
|
1565
|
-
workspaceName: z.string().
|
|
1566
|
-
state: z.
|
|
1567
|
-
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" })
|
|
1568
1843
|
});
|
|
1569
1844
|
|
|
1570
1845
|
// src/users/request-data.ts
|
|
1571
1846
|
var zCreatePsdUserRequestData = z7.object({
|
|
1572
|
-
registrationId: z7.string().
|
|
1847
|
+
registrationId: z7.string().meta({ description: "User registration ID" })
|
|
1573
1848
|
});
|
|
1574
1849
|
var zCreateApiUserRequestData = z7.object({
|
|
1575
1850
|
name: zUserName,
|
|
1576
|
-
pubKey: z7.string().
|
|
1577
|
-
role: z7.enum(["ADMIN", "OPERATOR"]).
|
|
1578
|
-
viewAll: z7.boolean().
|
|
1579
|
-
}).
|
|
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" });
|
|
1580
1855
|
var zCreateApiUserAccessRequestData = z7.object({
|
|
1581
1856
|
name: zUserName
|
|
1582
|
-
}).
|
|
1857
|
+
}).meta({ description: "Create API user credential request data" });
|
|
1583
1858
|
z7.object({
|
|
1584
|
-
authUserId: z7.string().
|
|
1585
|
-
}).
|
|
1859
|
+
authUserId: z7.string().meta({ description: "Authentication broker ID" })
|
|
1860
|
+
}).meta({ description: "Managed data for API user" });
|
|
1586
1861
|
var zRevokeUserRequestData = z7.object({});
|
|
1587
|
-
var zGroupName = z7.string().min(1).max(19).
|
|
1862
|
+
var zGroupName = z7.string().min(1).max(19).meta({ description: "Group name" });
|
|
1588
1863
|
var zCreateGroupRequestData = z7.object({
|
|
1589
1864
|
name: zGroupName,
|
|
1590
|
-
description: z7.string().nullable().
|
|
1591
|
-
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" })
|
|
1592
1867
|
});
|
|
1593
1868
|
var zEditGroupRequestData = z7.object({
|
|
1594
1869
|
name: zGroupName,
|
|
1595
|
-
description: z7.string().nullable().
|
|
1596
|
-
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" })
|
|
1597
1872
|
});
|
|
1598
|
-
var zApiKeyName = z7.string().min(1).max(19).
|
|
1873
|
+
var zApiKeyName = z7.string().min(1).max(19).meta({ description: "API key name" });
|
|
1599
1874
|
var zCreateApiKeyRequestData = z7.object({
|
|
1600
1875
|
name: zApiKeyName,
|
|
1601
|
-
entities: z7.array(z7.string()).
|
|
1602
|
-
scopes: z7.object({}).
|
|
1603
|
-
}).
|
|
1604
|
-
var zEditApiKeyRequestData = zCreateApiKeyRequestData.
|
|
1605
|
-
"Edit read-only API key request data"
|
|
1606
|
-
);
|
|
1607
|
-
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" });
|
|
1608
1883
|
var zCreateEntityRequestData = z7.object({
|
|
1609
1884
|
name: zEntityName,
|
|
1610
1885
|
accounts: z7.array(z7.string())
|
|
@@ -1615,8 +1890,8 @@ var zEditEntityRequestData = z7.object({
|
|
|
1615
1890
|
});
|
|
1616
1891
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1617
1892
|
var zWorkspaceRuleRequestData = z7.object({
|
|
1618
|
-
permission: z7.
|
|
1619
|
-
reviewConfig: zReviewStepWithUsersArray.
|
|
1893
|
+
permission: z7.enum(NonRootAdminPermission).meta({ description: "Granted permissions" }),
|
|
1894
|
+
reviewConfig: zReviewStepWithUsersArray.meta({ description: "List of admin review steps" })
|
|
1620
1895
|
});
|
|
1621
1896
|
|
|
1622
1897
|
// src/requests/request-data.ts
|
|
@@ -1652,11 +1927,6 @@ var zVaultRequestMixinsByType = {
|
|
|
1652
1927
|
targetId: z7.string(),
|
|
1653
1928
|
data: zEditAccountRequestData
|
|
1654
1929
|
}),
|
|
1655
|
-
[RequestType.ACTIVATE_TRADELINK_ACCOUNT]: z7.object({
|
|
1656
|
-
type: z7.literal(RequestType.ACTIVATE_TRADELINK_ACCOUNT),
|
|
1657
|
-
targetId: z7.string(),
|
|
1658
|
-
data: zActivateAccountRequestData
|
|
1659
|
-
}),
|
|
1660
1930
|
[RequestType.EDIT_TOKEN_RULE]: z7.object({
|
|
1661
1931
|
type: z7.literal(RequestType.EDIT_TOKEN_RULE),
|
|
1662
1932
|
targetId: z7.string(),
|
|
@@ -1759,99 +2029,40 @@ var zVaultRequestMixinsByType = {
|
|
|
1759
2029
|
targetId: z7.string(),
|
|
1760
2030
|
data: zEditPublicPolicyRequestData
|
|
1761
2031
|
}),
|
|
1762
|
-
// Tradelink
|
|
1763
|
-
|
|
1764
|
-
type: z7.literal(RequestType.CREATE_TRADELINK_CUSTODIAN),
|
|
1765
|
-
data: zCustodianRequestData
|
|
1766
|
-
}),
|
|
1767
|
-
[RequestType.EDIT_TRADELINK_CUSTODIAN]: z7.object({
|
|
1768
|
-
type: z7.literal(RequestType.EDIT_TRADELINK_CUSTODIAN),
|
|
1769
|
-
targetId: z7.string(),
|
|
1770
|
-
data: zCustodianRequestData
|
|
1771
|
-
}),
|
|
1772
|
-
[RequestType.CREATE_TRADELINK_EXCHANGE]: z7.object({
|
|
1773
|
-
type: z7.literal(RequestType.CREATE_TRADELINK_EXCHANGE),
|
|
1774
|
-
data: zTradelinkEntityRequestData
|
|
1775
|
-
}),
|
|
1776
|
-
[RequestType.EDIT_TRADELINK_EXCHANGE]: z7.object({
|
|
1777
|
-
type: z7.literal(RequestType.EDIT_TRADELINK_EXCHANGE),
|
|
1778
|
-
targetId: z7.string(),
|
|
1779
|
-
data: zTradelinkEntityRequestData
|
|
1780
|
-
}),
|
|
1781
|
-
[RequestType.CREATE_TRADELINK_ASSET_MANAGER]: z7.object({
|
|
1782
|
-
type: z7.literal(RequestType.CREATE_TRADELINK_ASSET_MANAGER),
|
|
1783
|
-
data: zTradelinkEntityRequestData
|
|
1784
|
-
}),
|
|
1785
|
-
[RequestType.EDIT_TRADELINK_ASSET_MANAGER]: z7.object({
|
|
1786
|
-
type: z7.literal(RequestType.EDIT_TRADELINK_ASSET_MANAGER),
|
|
1787
|
-
targetId: z7.string(),
|
|
1788
|
-
data: zTradelinkEntityRequestData
|
|
1789
|
-
}),
|
|
1790
|
-
[RequestType.ADJUST_PLEDGE]: z7.object({
|
|
1791
|
-
type: z7.literal(RequestType.ADJUST_PLEDGE),
|
|
1792
|
-
data: zAdjustPledgeRequestData
|
|
1793
|
-
}),
|
|
1794
|
-
[RequestType.TRADELINK_REPLEDGE]: z7.object({
|
|
1795
|
-
type: z7.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1796
|
-
data: zRepledgeRequestData
|
|
1797
|
-
}),
|
|
1798
|
-
[RequestType.CREATE_SETTLEMENT]: z7.object({
|
|
1799
|
-
type: z7.literal(RequestType.CREATE_SETTLEMENT),
|
|
1800
|
-
data: zCreateSettlementRequestData,
|
|
1801
|
-
meta: z7.object({
|
|
1802
|
-
hash: z7.string().nullable()
|
|
1803
|
-
}).optional().nullable()
|
|
1804
|
-
}),
|
|
1805
|
-
[RequestType.FORCE_UNPLEDGE]: z7.object({
|
|
1806
|
-
type: z7.literal(RequestType.FORCE_UNPLEDGE),
|
|
1807
|
-
data: zForceUnpledgeRequestData
|
|
1808
|
-
}),
|
|
1809
|
-
[RequestType.TRADELINK_WITHDRAW]: z7.object({
|
|
1810
|
-
type: z7.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1811
|
-
data: zTradelinkWithdrawRequestData,
|
|
1812
|
-
meta: z7.object({
|
|
1813
|
-
hash: z7.string().nullable()
|
|
1814
|
-
}).optional().nullable()
|
|
1815
|
-
}),
|
|
1816
|
-
[RequestType.TRADELINK_ARBITRATE]: z7.object({
|
|
1817
|
-
type: z7.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1818
|
-
data: zTradelinkArbitrationRequestData,
|
|
1819
|
-
meta: z7.object({
|
|
1820
|
-
hash: z7.string().nullable()
|
|
1821
|
-
}).optional().nullable()
|
|
1822
|
-
})
|
|
2032
|
+
// Tradelink-related requests
|
|
2033
|
+
...zTradelinkRequestMixinsByType
|
|
1823
2034
|
};
|
|
1824
2035
|
|
|
1825
2036
|
// src/requests/app-types.ts
|
|
1826
2037
|
var zRequestReviewResponse = z7.object({
|
|
1827
2038
|
// Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
|
|
1828
|
-
stepIndex: z7.number().int().
|
|
1829
|
-
userId: z7.string().
|
|
1830
|
-
status: z7.
|
|
1831
|
-
createdAt: z7.coerce.date().
|
|
1832
|
-
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" })
|
|
1833
2044
|
});
|
|
1834
2045
|
var zVaultRequestCommonMixin = z7.object({
|
|
1835
|
-
id: z7.string().
|
|
1836
|
-
legacyId: z7.number().
|
|
1837
|
-
state: z7.
|
|
1838
|
-
reviewSteps: zRequestReviewSteps.
|
|
1839
|
-
currentStepIndex: z7.number().int().min(0).
|
|
1840
|
-
expiresAt: z7.coerce.date().
|
|
1841
|
-
expiredAt: z7.coerce.date().optional().
|
|
1842
|
-
targetId: z7.string().nullable().
|
|
1843
|
-
note: zNote.nullable().
|
|
1844
|
-
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" }),
|
|
1845
2056
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
1846
|
-
createdAt: z7.coerce.date().
|
|
1847
|
-
updatedAt: z7.coerce.date().
|
|
1848
|
-
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" }),
|
|
1849
2060
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
1850
2061
|
inflight: z7.object({
|
|
1851
|
-
lastError: z7.string().nullable().
|
|
1852
|
-
numFailed: z7.number().int().
|
|
1853
|
-
retryAfter: z7.coerce.date().
|
|
1854
|
-
}).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" })
|
|
1855
2066
|
});
|
|
1856
2067
|
var allowedRequestCreationInputByType = {
|
|
1857
2068
|
[RequestType.UPDATE_QUORUM]: zVaultRequestMixinsByType[RequestType.UPDATE_QUORUM],
|
|
@@ -1873,49 +2084,51 @@ var allowedRequestCreationInputByType = {
|
|
|
1873
2084
|
data: zCreateAccountUserInputData
|
|
1874
2085
|
}),
|
|
1875
2086
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
1876
|
-
[RequestType.
|
|
1877
|
-
[RequestType.
|
|
1878
|
-
[RequestType.
|
|
1879
|
-
[RequestType.
|
|
1880
|
-
[RequestType.
|
|
1881
|
-
[RequestType.
|
|
1882
|
-
[RequestType.
|
|
1883
|
-
[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],
|
|
1884
2095
|
[RequestType.TRADELINK_REPLEDGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_REPLEDGE],
|
|
1885
|
-
[RequestType.
|
|
1886
|
-
[RequestType.
|
|
2096
|
+
[RequestType.TRADELINK_FORCE_UNPLEDGE]: zVaultRequestMixinsByType[RequestType.TRADELINK_FORCE_UNPLEDGE],
|
|
2097
|
+
[RequestType.TRADELINK_CREATE_SETTLEMENT]: zVaultRequestMixinsByType[RequestType.TRADELINK_CREATE_SETTLEMENT],
|
|
1887
2098
|
[RequestType.TRADELINK_WITHDRAW]: zVaultRequestMixinsByType[RequestType.TRADELINK_WITHDRAW],
|
|
1888
2099
|
[RequestType.TRADELINK_ARBITRATE]: zVaultRequestMixinsByType[RequestType.TRADELINK_ARBITRATE],
|
|
1889
2100
|
[RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER]
|
|
1890
2101
|
};
|
|
1891
2102
|
var zRequestCreationInputCommonMixin = z7.object({
|
|
1892
|
-
note: zNote.optional().
|
|
2103
|
+
note: zNote.optional().meta({ description: "Optional request note" })
|
|
1893
2104
|
});
|
|
1894
2105
|
z7.object({
|
|
1895
2106
|
request: z7.discriminatedUnion(
|
|
1896
2107
|
"type",
|
|
1897
2108
|
ensureNonEmptyArray(
|
|
1898
2109
|
Object.values(allowedRequestCreationInputByType).map((_) => {
|
|
1899
|
-
const requestType = _.shape.type.
|
|
1900
|
-
return _.
|
|
2110
|
+
const requestType = _.shape.type.value;
|
|
2111
|
+
return _.extend(zRequestCreationInputCommonMixin.shape).meta({
|
|
2112
|
+
description: `${requestType} request data`
|
|
2113
|
+
});
|
|
1901
2114
|
})
|
|
1902
2115
|
)
|
|
1903
2116
|
)
|
|
1904
2117
|
});
|
|
1905
|
-
var generateNetworkSpecificTransactionRequestSchema = (transaction) => z7.object({
|
|
1906
|
-
accountId: z7.string().min(1).describe("Target account id"),
|
|
1907
|
-
transaction
|
|
1908
|
-
}).merge(zRequestCreationInputCommonMixin).describe("Transaction request data");
|
|
1909
|
-
generateNetworkSpecificTransactionRequestSchema(zSuiLikeTransactionData);
|
|
1910
2118
|
var zVaultRequestResponse = z7.discriminatedUnion(
|
|
1911
2119
|
"type",
|
|
1912
2120
|
ensureNonEmptyArray(
|
|
1913
2121
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
1914
|
-
const requestType = _.shape.type.
|
|
1915
|
-
return _.
|
|
2122
|
+
const requestType = _.shape.type.value;
|
|
2123
|
+
return _.extend(zVaultRequestCommonMixin.shape).meta({
|
|
2124
|
+
description: `${requestType} request`
|
|
2125
|
+
});
|
|
1916
2126
|
})
|
|
1917
2127
|
)
|
|
1918
|
-
)
|
|
2128
|
+
).meta({
|
|
2129
|
+
description: "Vault request response data",
|
|
2130
|
+
id: "VaultRequestResponse"
|
|
2131
|
+
});
|
|
1919
2132
|
z7.enum([
|
|
1920
2133
|
"state",
|
|
1921
2134
|
"expiresAt",
|
|
@@ -1923,8 +2136,10 @@ z7.enum([
|
|
|
1923
2136
|
"updatedAt"
|
|
1924
2137
|
]).default("createdAt");
|
|
1925
2138
|
z7.object({
|
|
1926
|
-
pubKey: z7.string().
|
|
1927
|
-
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
|
+
})
|
|
1928
2143
|
});
|
|
1929
2144
|
var shouldHaveTargetHsmId = (request) => {
|
|
1930
2145
|
switch (request.type) {
|
|
@@ -1950,7 +2165,7 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1950
2165
|
case RequestType.SIGN_DIGESTS:
|
|
1951
2166
|
case RequestType.CREATE_ACCOUNT:
|
|
1952
2167
|
case RequestType.EDIT_ACCOUNT:
|
|
1953
|
-
case RequestType.
|
|
2168
|
+
case RequestType.TRADELINK_ACTIVATE_ACCOUNT:
|
|
1954
2169
|
case RequestType.CREATE_GROUP:
|
|
1955
2170
|
case RequestType.EDIT_GROUP:
|
|
1956
2171
|
case RequestType.REVOKE_GROUP:
|
|
@@ -1958,12 +2173,12 @@ var shouldHaveTargetHsmId = (request) => {
|
|
|
1958
2173
|
case RequestType.EDIT_WHITELIST:
|
|
1959
2174
|
case RequestType.CREATE_POLICY:
|
|
1960
2175
|
case RequestType.EDIT_POLICY:
|
|
1961
|
-
case RequestType.
|
|
1962
|
-
case RequestType.
|
|
1963
|
-
case RequestType.
|
|
1964
|
-
case RequestType.
|
|
1965
|
-
case RequestType.
|
|
1966
|
-
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:
|
|
1967
2182
|
return request.state !== RequestState.INITIAL;
|
|
1968
2183
|
case RequestType.EDIT_TOKEN_RULE:
|
|
1969
2184
|
return true;
|
|
@@ -1976,7 +2191,6 @@ var shouldHaveTargetId = (request) => {
|
|
|
1976
2191
|
case RequestType.REVOKE_API_KEY:
|
|
1977
2192
|
return false;
|
|
1978
2193
|
case RequestType.CREATE_TRANSACTION:
|
|
1979
|
-
case RequestType.SIGN_MESSAGE:
|
|
1980
2194
|
case RequestType.SIGN_DIGESTS:
|
|
1981
2195
|
return false;
|
|
1982
2196
|
case RequestType.UPDATE_QUORUM:
|
|
@@ -1989,13 +2203,14 @@ var shouldHaveTargetId = (request) => {
|
|
|
1989
2203
|
case RequestType.CREATE_ENTITY:
|
|
1990
2204
|
case RequestType.CREATE_SCICONFIG:
|
|
1991
2205
|
case RequestType.CREATE_POLICY:
|
|
1992
|
-
case RequestType.
|
|
1993
|
-
case RequestType.
|
|
1994
|
-
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:
|
|
1995
2210
|
return request.state === RequestState.EXECUTED;
|
|
1996
2211
|
case RequestType.EDIT_WORKSPACE_RULE:
|
|
1997
2212
|
case RequestType.EDIT_ACCOUNT:
|
|
1998
|
-
case RequestType.
|
|
2213
|
+
case RequestType.TRADELINK_ACTIVATE_ACCOUNT:
|
|
1999
2214
|
case RequestType.EDIT_TOKEN_RULE:
|
|
2000
2215
|
// EDIT_TOKEN_RULE targetId is the parent account which must always exist, even when creating new token rule.
|
|
2001
2216
|
case RequestType.EDIT_GROUP:
|
|
@@ -2007,13 +2222,13 @@ var shouldHaveTargetId = (request) => {
|
|
|
2007
2222
|
case RequestType.REVOKE_USER:
|
|
2008
2223
|
case RequestType.EDIT_SCICONFIG:
|
|
2009
2224
|
case RequestType.EDIT_POLICY:
|
|
2010
|
-
case RequestType.
|
|
2011
|
-
case RequestType.
|
|
2012
|
-
case RequestType.
|
|
2013
|
-
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:
|
|
2014
2229
|
case RequestType.TRADELINK_REPLEDGE:
|
|
2015
|
-
case RequestType.
|
|
2016
|
-
case RequestType.
|
|
2230
|
+
case RequestType.TRADELINK_CREATE_SETTLEMENT:
|
|
2231
|
+
case RequestType.TRADELINK_FORCE_UNPLEDGE:
|
|
2017
2232
|
case RequestType.TRADELINK_WITHDRAW:
|
|
2018
2233
|
case RequestType.TRADELINK_ARBITRATE:
|
|
2019
2234
|
return true;
|
|
@@ -2030,7 +2245,7 @@ function serializeVaultRequest(request) {
|
|
|
2030
2245
|
case "CREATE_TRANSACTION":
|
|
2031
2246
|
case "TRADELINK_WITHDRAW":
|
|
2032
2247
|
case "TRADELINK_ARBITRATE":
|
|
2033
|
-
case "
|
|
2248
|
+
case "TRADELINK_CREATE_SETTLEMENT":
|
|
2034
2249
|
Object.assign(serialized, {
|
|
2035
2250
|
meta: {
|
|
2036
2251
|
hash: request.transactionMeta?.hash ?? null
|
|
@@ -2043,7 +2258,7 @@ function serializeVaultRequest(request) {
|
|
|
2043
2258
|
patched = patchTezosRequestData(patched);
|
|
2044
2259
|
return patched;
|
|
2045
2260
|
}
|
|
2046
|
-
var fakeUniqueName = (length) =>
|
|
2261
|
+
var fakeUniqueName = (length = 20) => faker.string.alphanumeric({ length, casing: "lower" });
|
|
2047
2262
|
var fakeHexString = (length, casing = "upper") => faker.string.hexadecimal({ prefix: "", casing, length });
|
|
2048
2263
|
var fakePubKey = () => fakeHexString(130);
|
|
2049
2264
|
var fakeIntegerId = () => faker.number.int({ min: 1, max: 2e9 });
|