@ledgerhq/revault-api 1.39.1 → 1.40.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-b9W8_2Yl.d.mts → app-types-tkBR8GCa.d.mts} +162 -41
- package/lib/fakes.d.mts +32 -5
- package/lib/fakes.mjs +709 -705
- package/lib/fakes.mjs.map +1 -1
- package/lib/index.d.mts +392 -90
- package/package.json +2 -2
package/lib/fakes.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __export } from './chunk-J5LGTIGS.mjs';
|
|
2
2
|
import { faker } from '@faker-js/faker';
|
|
3
3
|
import { AllowedAction, AccountType, ChallengeType, PsdModel, UserRole, UserRegistrationState, AdminPermission, RequestType, MessageType, AccountGovernanceType, ActivationStatus, WhitelistType, RequestReviewStatus, RequestState, GateAccountType } from '@prisma/client';
|
|
4
|
-
import
|
|
4
|
+
import z11, { z } from 'zod';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import invariant from 'invariant';
|
|
7
7
|
import { omit, times, get, isPlainObject } from 'lodash';
|
|
@@ -30,7 +30,8 @@ var zValueTransactionOperationType = z.enum([
|
|
|
30
30
|
AllowedAction.STAKE,
|
|
31
31
|
AllowedAction.DEPLOY_CONTRACT,
|
|
32
32
|
AllowedAction.EXECUTE_CONTRACT,
|
|
33
|
-
AllowedAction.ACTIVATE_TOKEN
|
|
33
|
+
AllowedAction.ACTIVATE_TOKEN,
|
|
34
|
+
AllowedAction.RECEIVE
|
|
34
35
|
]);
|
|
35
36
|
var zValueTransactionOperation = z.object({
|
|
36
37
|
type: zValueTransactionOperationType,
|
|
@@ -49,7 +50,8 @@ var zClassicOperationType = z.enum([
|
|
|
49
50
|
AllowedAction.DEPLOY_CONTRACT,
|
|
50
51
|
AllowedAction.EXECUTE_CONTRACT,
|
|
51
52
|
AllowedAction.SIGN_MESSAGE,
|
|
52
|
-
AllowedAction.ACTIVATE_TOKEN
|
|
53
|
+
AllowedAction.ACTIVATE_TOKEN,
|
|
54
|
+
AllowedAction.RECEIVE
|
|
53
55
|
]);
|
|
54
56
|
z.enum([AllowedAction.SIGN_DIGESTS]);
|
|
55
57
|
var zOperationType = z.enum([
|
|
@@ -60,9 +62,9 @@ z.discriminatedUnion("type", [
|
|
|
60
62
|
zValueTransactionOperation,
|
|
61
63
|
zSigningOperation
|
|
62
64
|
]);
|
|
63
|
-
var zNote =
|
|
64
|
-
title:
|
|
65
|
-
content:
|
|
65
|
+
var zNote = z11.object({
|
|
66
|
+
title: z11.string().meta({ description: "Note title" }),
|
|
67
|
+
content: z11.string().meta({ description: "Note content" })
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
// src/errors.ts
|
|
@@ -91,83 +93,99 @@ function unreachable(value) {
|
|
|
91
93
|
throw new Error(`Un-covered: ${value}`);
|
|
92
94
|
}
|
|
93
95
|
var NetworkFamily = omit(AccountType, ["RAW_SIGNING"]);
|
|
94
|
-
var zHexDataString =
|
|
96
|
+
var zHexDataString = z11.codec(z11.string().regex(/^(?:0x|0X)?[a-fA-F0-9]+$/), z11.string(), {
|
|
95
97
|
decode: (hex) => `0x${hex.toLowerCase().replace("0x", "")}`,
|
|
96
98
|
encode: (hex) => hex
|
|
97
99
|
});
|
|
98
|
-
var zCommonLiveData =
|
|
99
|
-
id:
|
|
100
|
-
balance:
|
|
101
|
-
total:
|
|
102
|
-
pending:
|
|
100
|
+
var zCommonLiveData = z11.object({
|
|
101
|
+
id: z11.string().meta({ description: "Account internal unique identifier" }),
|
|
102
|
+
balance: z11.object({
|
|
103
|
+
total: z11.string().meta({ description: "Total balance" }),
|
|
104
|
+
pending: z11.string().meta({ description: "Pending balance" })
|
|
103
105
|
}).meta({ description: "Balance fields" })
|
|
104
106
|
});
|
|
105
|
-
var zCommonTransactionData =
|
|
107
|
+
var zCommonTransactionData = z11.object({
|
|
106
108
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
107
109
|
currency: zCurrencyString.meta({
|
|
108
110
|
description: "Will be deprecated soon, use Account.network. Transaction currency"
|
|
109
111
|
}),
|
|
110
112
|
// TODO: to remove, use account.network instead
|
|
111
113
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
112
|
-
recipient:
|
|
114
|
+
recipient: z11.string().nonempty().meta({ description: "Transaction recipient" })
|
|
113
115
|
});
|
|
114
|
-
var zFeeStrategyCustom =
|
|
115
|
-
type:
|
|
116
|
+
var zFeeStrategyCustom = z11.object({
|
|
117
|
+
type: z11.enum(["SLOW", "NORMAL", "FAST", "CUSTOM"])
|
|
116
118
|
});
|
|
117
|
-
var zFeeStrategy =
|
|
118
|
-
type:
|
|
119
|
+
var zFeeStrategy = z11.object({
|
|
120
|
+
type: z11.enum(["SLOW", "NORMAL", "FAST"])
|
|
119
121
|
});
|
|
120
|
-
var zTransactionStatus =
|
|
121
|
-
var zCommonTransactionResponse =
|
|
122
|
-
id:
|
|
123
|
-
hash:
|
|
124
|
-
block:
|
|
125
|
-
height:
|
|
126
|
-
time:
|
|
122
|
+
var zTransactionStatus = z11.enum(["SUCCESSFUL", "FAILED"]);
|
|
123
|
+
var zCommonTransactionResponse = z11.object({
|
|
124
|
+
id: z11.string().meta({ description: "Internal unique identifier" }),
|
|
125
|
+
hash: z11.string().meta({ description: "Transaction hash" }),
|
|
126
|
+
block: z11.object({
|
|
127
|
+
height: z11.string().nullable().meta({ description: "Transaction block height" }),
|
|
128
|
+
time: z11.string().nullable().meta({ description: "Transaction block time" })
|
|
127
129
|
}),
|
|
128
130
|
status: zTransactionStatus.meta({ description: "Transaction status" }),
|
|
129
|
-
confirmations:
|
|
130
|
-
amount:
|
|
131
|
-
fee:
|
|
132
|
-
senders:
|
|
133
|
-
recipients:
|
|
131
|
+
confirmations: z11.string().meta({ description: "Block confirmations" }),
|
|
132
|
+
amount: z11.string().meta({ description: "Transaction amount" }),
|
|
133
|
+
fee: z11.string().meta({ description: "Transaction fee" }),
|
|
134
|
+
senders: z11.array(z11.string()).meta({ description: "Senders (can be multiple for UTXOs-based accounts)" }),
|
|
135
|
+
recipients: z11.array(z11.string()).meta({ description: "Recipients (can be multiple for multi-output transactions)" })
|
|
134
136
|
});
|
|
135
137
|
|
|
136
138
|
// src/networks/bitcoin.ts
|
|
137
|
-
var zBitcoinLikeAssetFields =
|
|
138
|
-
type:
|
|
139
|
-
xpub:
|
|
139
|
+
var zBitcoinLikeAssetFields = z11.object({
|
|
140
|
+
type: z11.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" }),
|
|
141
|
+
xpub: z11.string().meta({ description: "xpub (extended public key)" })
|
|
140
142
|
}).meta({ description: "Bitcoin-like" });
|
|
141
143
|
var zBitcoinLikeLiveData = zCommonLiveData.extend({
|
|
142
|
-
type:
|
|
144
|
+
type: z11.literal(NetworkFamily.BITCOIN_LIKE).meta({ description: "Account type" })
|
|
143
145
|
}).meta({ description: "Bitcoin-like" });
|
|
144
|
-
var zBitcoinLikeTransactionType =
|
|
146
|
+
var zBitcoinLikeTransactionType = z11.enum(["BITCOIN_LIKE_SEND", "BITCOIN_LIKE_RECEIVE"]).meta({ description: "Bitcoin-like transaction type" });
|
|
145
147
|
var zBitcoinLikeFeeStrategy = zFeeStrategyCustom.extend({
|
|
146
148
|
// nullish is optional + nullable, it is easier to seed rather than just optional
|
|
147
149
|
feePerByte: zUnsignedIntString.nullish().meta({ description: "Fee per byte" })
|
|
148
150
|
}).meta({ description: "Bitcoin-like fee strategy" });
|
|
149
151
|
var zBitcoinLikeSendData = zCommonTransactionData.extend({
|
|
150
|
-
type:
|
|
152
|
+
type: z11.literal(zBitcoinLikeTransactionType.enum.BITCOIN_LIKE_SEND),
|
|
151
153
|
feeStrategy: zBitcoinLikeFeeStrategy
|
|
152
154
|
}).meta({
|
|
153
155
|
description: "Bitcoin-like send data",
|
|
154
156
|
id: "BitcoinLikeSendData"
|
|
155
157
|
});
|
|
156
|
-
var zBitcoinLikeTransactionData =
|
|
158
|
+
var zBitcoinLikeTransactionData = z11.discriminatedUnion("type", [zBitcoinLikeSendData]);
|
|
157
159
|
var zBitcoinLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zBitcoinLikeTransactionType }).meta({ description: "Bitcoin-like transaction" });
|
|
158
|
-
var
|
|
159
|
-
type:
|
|
160
|
-
address:
|
|
160
|
+
var zCantonLikeAssetFields = z11.object({
|
|
161
|
+
type: z11.literal(NetworkFamily.CANTON_LIKE).meta({ description: "Account type" }),
|
|
162
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
163
|
+
}).meta({ description: "Canton-like" });
|
|
164
|
+
var zCantonLikeLiveData = zCommonLiveData.extend({
|
|
165
|
+
type: z11.literal(NetworkFamily.CANTON_LIKE).meta({ description: "Account type" })
|
|
166
|
+
}).meta({ description: "Canton-like" });
|
|
167
|
+
var zCantonLikeTransactionType = z11.enum(["CANTON_LIKE_SEND", "CANTON_LIKE_RECEIVE"]).meta({ description: "Canton-like transaction type" });
|
|
168
|
+
var zCantonLikeSendData = zCommonTransactionData.extend({
|
|
169
|
+
type: z11.literal(zCantonLikeTransactionType.enum.CANTON_LIKE_SEND)
|
|
170
|
+
}).meta({
|
|
171
|
+
description: "Canton-like send data",
|
|
172
|
+
id: "CantonLikeSendData"
|
|
173
|
+
});
|
|
174
|
+
var zCantonLikeTransactionData = z11.discriminatedUnion("type", [zCantonLikeSendData]);
|
|
175
|
+
var zCantonLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zCantonLikeTransactionType }).meta({ description: "Canton-like transaction" });
|
|
176
|
+
var zCardanoLikeAssetFields = z11.object({
|
|
177
|
+
type: z11.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
|
|
178
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
161
179
|
}).meta({ description: "Cardano-like" });
|
|
162
|
-
var zCardanoLikeStakingData =
|
|
163
|
-
staked:
|
|
180
|
+
var zCardanoLikeStakingData = z11.object({
|
|
181
|
+
staked: z11.string().meta({ description: "Staked balance" })
|
|
164
182
|
}).nullable().meta({ description: "Cardano-like staking data" });
|
|
165
|
-
var zCardanoLikeStakingFields =
|
|
166
|
-
type:
|
|
183
|
+
var zCardanoLikeStakingFields = z11.object({
|
|
184
|
+
type: z11.literal(NetworkFamily.CARDANO_LIKE).meta({ description: "Account type" }),
|
|
167
185
|
staking: zCardanoLikeStakingData.optional()
|
|
168
186
|
});
|
|
169
187
|
var zCardanoLikeLiveData = zCommonLiveData.extend(zCardanoLikeStakingFields.shape).meta({ description: "Cardano-like" });
|
|
170
|
-
var zCardanoLikeTransactionType =
|
|
188
|
+
var zCardanoLikeTransactionType = z11.enum([
|
|
171
189
|
"CARDANO_LIKE_SEND",
|
|
172
190
|
"CARDANO_LIKE_RECEIVE",
|
|
173
191
|
"CARDANO_LIKE_STAKING_REGISTER",
|
|
@@ -176,26 +194,26 @@ var zCardanoLikeTransactionType = z10.enum([
|
|
|
176
194
|
"CARDANO_LIKE_STAKING_WITHDRAW"
|
|
177
195
|
]).meta({ description: "Cardano-like transaction type" });
|
|
178
196
|
var zCardanoLikeSendData = zCommonTransactionData.extend({
|
|
179
|
-
type:
|
|
197
|
+
type: z11.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_SEND),
|
|
180
198
|
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" })
|
|
181
199
|
}).meta({
|
|
182
200
|
description: "Cardano-like send data",
|
|
183
201
|
id: "CardanoSendData"
|
|
184
202
|
});
|
|
185
|
-
var zCardanoStakingDelegateData =
|
|
186
|
-
type:
|
|
203
|
+
var zCardanoStakingDelegateData = z11.object({
|
|
204
|
+
type: z11.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DELEGATE),
|
|
187
205
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
188
206
|
// TODO: strict literal or enum?
|
|
189
207
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
190
208
|
feeStrategy: zFeeStrategy.meta({ description: "Cardano-like fee strategy" }),
|
|
191
209
|
// DELEGATE doesn't have neither amount nor recipient
|
|
192
|
-
stakePoolId:
|
|
210
|
+
stakePoolId: z11.string().min(1).max(100).meta({ description: "" })
|
|
193
211
|
}).meta({
|
|
194
212
|
description: "Cardano-like staking delegate",
|
|
195
213
|
id: "CardanoStakingDelegateData"
|
|
196
214
|
});
|
|
197
|
-
var zCardanoStakingDeregisterData =
|
|
198
|
-
type:
|
|
215
|
+
var zCardanoStakingDeregisterData = z11.object({
|
|
216
|
+
type: z11.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_DEREGISTER),
|
|
199
217
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
200
218
|
// TODO: strict literal or enum?
|
|
201
219
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -206,8 +224,8 @@ var zCardanoStakingDeregisterData = z10.object({
|
|
|
206
224
|
description: "Cardano-like staking deregister data",
|
|
207
225
|
id: "CardanoStakingDeregisterData"
|
|
208
226
|
});
|
|
209
|
-
var zCardanoStakingRegisterData =
|
|
210
|
-
type:
|
|
227
|
+
var zCardanoStakingRegisterData = z11.object({
|
|
228
|
+
type: z11.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_REGISTER),
|
|
211
229
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
212
230
|
// TODO: strict literal or enum?
|
|
213
231
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -218,8 +236,8 @@ var zCardanoStakingRegisterData = z10.object({
|
|
|
218
236
|
description: "Cardano-like staking register data",
|
|
219
237
|
id: "CardanoStakingRegisterData"
|
|
220
238
|
});
|
|
221
|
-
var zCardanoStakingWithdrawData =
|
|
222
|
-
type:
|
|
239
|
+
var zCardanoStakingWithdrawData = z11.object({
|
|
240
|
+
type: z11.literal(zCardanoLikeTransactionType.enum.CARDANO_LIKE_STAKING_WITHDRAW),
|
|
223
241
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
224
242
|
// TODO: strict literal or enum?
|
|
225
243
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
@@ -230,7 +248,7 @@ var zCardanoStakingWithdrawData = z10.object({
|
|
|
230
248
|
description: "Cardano-like staking withdraw data",
|
|
231
249
|
id: "CardanoStakingWithdrawData"
|
|
232
250
|
});
|
|
233
|
-
var zCardanoLikeTransactionData =
|
|
251
|
+
var zCardanoLikeTransactionData = z11.discriminatedUnion("type", [
|
|
234
252
|
zCardanoLikeSendData,
|
|
235
253
|
zCardanoStakingDelegateData,
|
|
236
254
|
zCardanoStakingDeregisterData,
|
|
@@ -238,40 +256,33 @@ var zCardanoLikeTransactionData = z10.discriminatedUnion("type", [
|
|
|
238
256
|
zCardanoStakingWithdrawData
|
|
239
257
|
]);
|
|
240
258
|
var zCardanoLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zCardanoLikeTransactionType }).meta({ description: "Cardano-like transaction" });
|
|
241
|
-
var zEthereumLikeAssetFields =
|
|
242
|
-
type:
|
|
243
|
-
address:
|
|
244
|
-
|
|
245
|
-
var zEthereumTokenLikeAssetFields = z10.object({
|
|
246
|
-
type: z10.enum([NetworkFamily.ERC20_LIKE, NetworkFamily.BEP20_LIKE]).meta({ description: "Account type" }),
|
|
247
|
-
address: z10.string().nullable().meta({ description: "Account address" }),
|
|
248
|
-
contractAddress: z10.string().meta({
|
|
259
|
+
var zEthereumLikeAssetFields = z11.object({
|
|
260
|
+
type: z11.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
|
|
261
|
+
address: z11.string().nullable().meta({ description: "Account address" }),
|
|
262
|
+
contractAddress: z11.string().nullable().meta({
|
|
249
263
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
250
264
|
}).optional()
|
|
251
|
-
}).meta({ description: "Ethereum-like
|
|
252
|
-
var zEthereumLikeStakingData =
|
|
253
|
-
totalStaking:
|
|
254
|
-
totalRewards:
|
|
255
|
-
availableRewards:
|
|
256
|
-
networkApy:
|
|
265
|
+
}).meta({ description: "Ethereum-like" });
|
|
266
|
+
var zEthereumLikeStakingData = z11.object({
|
|
267
|
+
totalStaking: z11.string().meta({ description: "Total staked amount" }),
|
|
268
|
+
totalRewards: z11.string().meta({ description: "Total of rewards" }),
|
|
269
|
+
availableRewards: z11.string().meta({ description: "Available rewards" }),
|
|
270
|
+
networkApy: z11.number().meta({ description: "Network APY" })
|
|
257
271
|
}).nullable().meta({ description: "Ethereum-like staking data" });
|
|
258
|
-
var zEthereumLikeStakingFields =
|
|
259
|
-
type:
|
|
272
|
+
var zEthereumLikeStakingFields = z11.object({
|
|
273
|
+
type: z11.literal(NetworkFamily.ETHEREUM_LIKE).meta({ description: "Account type" }),
|
|
260
274
|
staking: zEthereumLikeStakingData.optional()
|
|
261
275
|
});
|
|
262
276
|
var zEthereumLikeLiveData = zCommonLiveData.extend(zEthereumLikeStakingFields.shape).meta({ description: "Ethereum-like" });
|
|
263
|
-
var
|
|
264
|
-
type:
|
|
265
|
-
}).meta({ description: "Ethereum-like token" });
|
|
266
|
-
var zEthereumLikeEstimatedFees = z10.object({
|
|
267
|
-
type: z10.literal(NetworkFamily.ETHEREUM_LIKE),
|
|
277
|
+
var zEthereumLikeEstimatedFees = z11.object({
|
|
278
|
+
type: z11.literal(NetworkFamily.ETHEREUM_LIKE),
|
|
268
279
|
baseFees: zIntString,
|
|
269
280
|
gasLimit: zIntString,
|
|
270
|
-
nonce:
|
|
281
|
+
nonce: z11.string(),
|
|
271
282
|
priorityFees: zIntString
|
|
272
283
|
}).meta({ description: "Ethereum-like fees" });
|
|
273
|
-
var zEthereumLikeTransferTransactionType =
|
|
274
|
-
var zEthereumLikeContractTransactionType =
|
|
284
|
+
var zEthereumLikeTransferTransactionType = z11.enum(["ETHEREUM_LIKE_SEND", "ETHEREUM_LIKE_RECEIVE"]).meta({ description: "Ethereum-like transaction type" });
|
|
285
|
+
var zEthereumLikeContractTransactionType = z11.enum(["ETHEREUM_LIKE_EXECUTE_CONTRACT", "ETHEREUM_LIKE_DEPLOY_CONTRACT"]).meta({ description: "Ethereum-like transaction type" });
|
|
275
286
|
var zEthereumLikeLegacyFeeStrategy = zFeeStrategyCustom.extend({
|
|
276
287
|
gasPrice: zUnsignedIntString.meta({ description: "Gas price" }),
|
|
277
288
|
gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
|
|
@@ -281,14 +292,14 @@ var zEthereumLikeEip1559FeeStrategy = zFeeStrategyCustom.extend({
|
|
|
281
292
|
maxFeePerGas: zUnsignedIntString.meta({ description: "Maximum fee per gas (base + priority)" }),
|
|
282
293
|
gasLimit: zUnsignedIntString.meta({ description: "Gas limit" })
|
|
283
294
|
}).meta({ description: "Ethereum-like EIP-1559 fee strategy" });
|
|
284
|
-
var zEthereumLikeFeeStrategy =
|
|
295
|
+
var zEthereumLikeFeeStrategy = z11.union([zEthereumLikeLegacyFeeStrategy, zEthereumLikeEip1559FeeStrategy]).meta({
|
|
285
296
|
description: "Ethereum-like fee strategy",
|
|
286
297
|
id: "EthereumLikeFeeStrategy"
|
|
287
298
|
});
|
|
288
299
|
var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
289
|
-
type:
|
|
300
|
+
type: z11.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_DEPLOY_CONTRACT),
|
|
290
301
|
// force the recipient to be the zero address
|
|
291
|
-
recipient:
|
|
302
|
+
recipient: z11.literal("0x0000000000000000000000000000000000000000"),
|
|
292
303
|
contractData: zHexDataString.meta({ description: "Contract data in hexadecimal format" }),
|
|
293
304
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
294
305
|
}).meta({
|
|
@@ -296,7 +307,7 @@ var zEthereumLikeDeployContractData = zCommonTransactionData.extend({
|
|
|
296
307
|
id: "EthereumLikeDeployContractData"
|
|
297
308
|
});
|
|
298
309
|
var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
299
|
-
type:
|
|
310
|
+
type: z11.literal(zEthereumLikeContractTransactionType.enum.ETHEREUM_LIKE_EXECUTE_CONTRACT),
|
|
300
311
|
contractData: zHexDataString.meta({ description: "Contract call data in hexadecimal format" }),
|
|
301
312
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
302
313
|
}).meta({
|
|
@@ -304,95 +315,95 @@ var zEthereumLikeExecuteContractData = zCommonTransactionData.extend({
|
|
|
304
315
|
id: "EthereumLikeExecuteContractData"
|
|
305
316
|
});
|
|
306
317
|
var zEthereumLikeSendData = zCommonTransactionData.extend({
|
|
307
|
-
type:
|
|
318
|
+
type: z11.literal(zEthereumLikeTransferTransactionType.enum.ETHEREUM_LIKE_SEND),
|
|
308
319
|
feeStrategy: zEthereumLikeFeeStrategy
|
|
309
320
|
}).meta({
|
|
310
321
|
description: "Ethereum-like send data",
|
|
311
322
|
id: "EthereumLikeSendData"
|
|
312
323
|
});
|
|
313
|
-
var zEthereumLikeTransactionData =
|
|
324
|
+
var zEthereumLikeTransactionData = z11.discriminatedUnion("type", [
|
|
314
325
|
zEthereumLikeDeployContractData,
|
|
315
326
|
zEthereumLikeExecuteContractData,
|
|
316
327
|
zEthereumLikeSendData
|
|
317
328
|
]);
|
|
318
|
-
var zEthereumLikeTransferCoinFields =
|
|
329
|
+
var zEthereumLikeTransferCoinFields = z11.object({
|
|
319
330
|
type: zEthereumLikeTransferTransactionType,
|
|
320
|
-
gasPrice:
|
|
321
|
-
gasLimit:
|
|
322
|
-
nonce:
|
|
331
|
+
gasPrice: z11.string(),
|
|
332
|
+
gasLimit: z11.string(),
|
|
333
|
+
nonce: z11.string()
|
|
323
334
|
});
|
|
324
335
|
var zEthereumLikeContractCoinFields = zEthereumLikeTransferCoinFields.extend({
|
|
325
336
|
type: zEthereumLikeContractTransactionType,
|
|
326
|
-
contractData:
|
|
337
|
+
contractData: z11.string().meta({ description: "Contract deployment or contract execution data" })
|
|
327
338
|
});
|
|
328
339
|
var zEthereumLikeTransferTransactionResponse = zCommonTransactionResponse.extend(zEthereumLikeTransferCoinFields.shape).meta({ description: "Ethereum-like transfer transaction" });
|
|
329
340
|
var zEthereumLikeContractTransactionResponse = zCommonTransactionResponse.extend(zEthereumLikeContractCoinFields.shape).meta({ description: "Ethereum-like contract transaction" });
|
|
330
|
-
var zGenericLikeAssetFields =
|
|
341
|
+
var zGenericLikeAssetFields = z11.object({ type: z11.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" }) }).meta({ description: "Generic-like" });
|
|
331
342
|
var zGenericLikeLiveData = zCommonLiveData.extend({
|
|
332
|
-
type:
|
|
343
|
+
type: z11.literal(NetworkFamily.GENERIC_LIKE).meta({ description: "Account type" })
|
|
333
344
|
}).meta({ description: "Generic-like" });
|
|
334
|
-
var zGenericTransactionType =
|
|
335
|
-
var zGenericTransactionData =
|
|
336
|
-
type:
|
|
345
|
+
var zGenericTransactionType = z11.enum(["GENERIC_TRANSACTION"]).meta({ description: "Generic transaction type" });
|
|
346
|
+
var zGenericTransactionData = z11.object({
|
|
347
|
+
type: z11.literal(zGenericTransactionType.enum.GENERIC_TRANSACTION),
|
|
337
348
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
338
|
-
rawTx:
|
|
349
|
+
rawTx: z11.string().meta({ description: "Raw tx" })
|
|
339
350
|
}).meta({
|
|
340
351
|
description: "Generic transaction data",
|
|
341
352
|
id: "GenericTransactionData"
|
|
342
353
|
});
|
|
343
354
|
var zGenericTransactionResponse = zCommonTransactionResponse.extend({ type: zGenericTransactionType }).meta({ description: "Generic transaction" });
|
|
344
|
-
var zPolkadotLikeAssetFields =
|
|
345
|
-
type:
|
|
346
|
-
address:
|
|
355
|
+
var zPolkadotLikeAssetFields = z11.object({
|
|
356
|
+
type: z11.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
|
|
357
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
347
358
|
}).meta({ description: "Polkadot-like" });
|
|
348
|
-
var zPolkadotUnbondingAmount =
|
|
349
|
-
amount:
|
|
350
|
-
waiting_time:
|
|
351
|
-
});
|
|
352
|
-
var zPolkadotLikeStakingData =
|
|
353
|
-
info:
|
|
354
|
-
controllerAddress:
|
|
355
|
-
rewardsDestination:
|
|
356
|
-
proxies:
|
|
357
|
-
legacyStaking:
|
|
358
|
-
isNominator:
|
|
359
|
+
var zPolkadotUnbondingAmount = z11.object({
|
|
360
|
+
amount: z11.string().meta({ description: "Amount" }),
|
|
361
|
+
waiting_time: z11.string().meta({ description: "Waiting time" })
|
|
362
|
+
});
|
|
363
|
+
var zPolkadotLikeStakingData = z11.object({
|
|
364
|
+
info: z11.object({
|
|
365
|
+
controllerAddress: z11.string().nullable().meta({ description: "Controller address" }),
|
|
366
|
+
rewardsDestination: z11.string().nullable().meta({ description: "Rewards destination" }),
|
|
367
|
+
proxies: z11.array(z11.string()).meta({ description: "Proxies" }),
|
|
368
|
+
legacyStaking: z11.boolean().meta({ description: "True if account uses legacy staking" }),
|
|
369
|
+
isNominator: z11.boolean().meta({ description: "True if is nominator" })
|
|
359
370
|
}),
|
|
360
|
-
balances:
|
|
361
|
-
free:
|
|
362
|
-
reserved:
|
|
363
|
-
frozen:
|
|
364
|
-
bonded:
|
|
365
|
-
available:
|
|
366
|
-
unbonding:
|
|
367
|
-
unbonded:
|
|
368
|
-
totalUnbonding:
|
|
369
|
-
totalUnbonded:
|
|
371
|
+
balances: z11.object({
|
|
372
|
+
free: z11.string().meta({ description: "Free balance" }),
|
|
373
|
+
reserved: z11.string().meta({ description: "Reserved balance" }),
|
|
374
|
+
frozen: z11.string().meta({ description: "Frozen balance" }),
|
|
375
|
+
bonded: z11.string().meta({ description: "Bonded balance" }),
|
|
376
|
+
available: z11.string().meta({ description: "Available balance" }),
|
|
377
|
+
unbonding: z11.array(zPolkadotUnbondingAmount).meta({ description: "Unbonding balances" }),
|
|
378
|
+
unbonded: z11.array(zPolkadotUnbondingAmount).meta({ description: "Unbonded balances" }),
|
|
379
|
+
totalUnbonding: z11.string().meta({ description: "Total unbonding" }),
|
|
380
|
+
totalUnbonded: z11.string().meta({ description: "Total unbonded" })
|
|
370
381
|
}),
|
|
371
|
-
anonymousProxy:
|
|
372
|
-
address:
|
|
373
|
-
createdAt:
|
|
374
|
-
isController:
|
|
375
|
-
isMain:
|
|
376
|
-
balances:
|
|
377
|
-
free:
|
|
378
|
-
reserved:
|
|
379
|
-
frozen:
|
|
380
|
-
bonded:
|
|
381
|
-
available:
|
|
382
|
-
total:
|
|
382
|
+
anonymousProxy: z11.object({
|
|
383
|
+
address: z11.string().meta({ description: "Address" }),
|
|
384
|
+
createdAt: z11.string().meta({ description: "Creation date" }),
|
|
385
|
+
isController: z11.boolean().meta({ description: "True if is controller" }),
|
|
386
|
+
isMain: z11.boolean().meta({ description: "True if is main" }),
|
|
387
|
+
balances: z11.object({
|
|
388
|
+
free: z11.string().meta({ description: "Anonymous proxy free balance" }),
|
|
389
|
+
reserved: z11.string().meta({ description: "Anonymous proxy reserved balance" }),
|
|
390
|
+
frozen: z11.string().meta({ description: "Anonymous proxy frozen balance" }),
|
|
391
|
+
bonded: z11.string().meta({ description: "Anonymous proxy bonded balance" }),
|
|
392
|
+
available: z11.string().meta({ description: "Anonymous proxy available balance" }),
|
|
393
|
+
total: z11.string().meta({ description: "Anonymous proxy total balance" })
|
|
383
394
|
}).nullable(),
|
|
384
|
-
blockHeight:
|
|
385
|
-
extIndex:
|
|
386
|
-
index:
|
|
387
|
-
kind:
|
|
395
|
+
blockHeight: z11.string().meta({ description: "Anonymous proxy block height" }),
|
|
396
|
+
extIndex: z11.string().meta({ description: "Ext index" }),
|
|
397
|
+
index: z11.string().meta({ description: "Index" }),
|
|
398
|
+
kind: z11.string().meta({ description: "Kind" })
|
|
388
399
|
}).nullable().meta({ description: "Anonymous proxy" })
|
|
389
400
|
}).nullable().meta({ description: "Polkadot-like staking data" });
|
|
390
|
-
var zPolkadotLikeStakingFields =
|
|
391
|
-
type:
|
|
401
|
+
var zPolkadotLikeStakingFields = z11.object({
|
|
402
|
+
type: z11.literal(NetworkFamily.POLKADOT_LIKE).meta({ description: "Account type" }),
|
|
392
403
|
staking: zPolkadotLikeStakingData.optional()
|
|
393
404
|
});
|
|
394
405
|
var zPolkadotLikeLiveData = zCommonLiveData.extend(zPolkadotLikeStakingFields.shape).meta({ description: "Polkadot-like" });
|
|
395
|
-
var zPolkadotLikeTransactionType =
|
|
406
|
+
var zPolkadotLikeTransactionType = z11.enum([
|
|
396
407
|
"POLKADOT_LIKE_SEND",
|
|
397
408
|
"POLKADOT_LIKE_RECEIVE",
|
|
398
409
|
"POLKADOT_LIKE_ADDPROXY",
|
|
@@ -414,25 +425,25 @@ var zPolkadotLikeTransactionType = z10.enum([
|
|
|
414
425
|
"POLKADOT_LIKE_CHILL",
|
|
415
426
|
"POLKADOT_LIKE_TRANSFERALL"
|
|
416
427
|
]).meta({ description: "Polkadot-like transaction type" });
|
|
417
|
-
var zPolkadotRewardDestination =
|
|
418
|
-
var zPolkadotLikeAddProxyData =
|
|
419
|
-
type:
|
|
428
|
+
var zPolkadotRewardDestination = z11.enum(["Staked", "Stash"]);
|
|
429
|
+
var zPolkadotLikeAddProxyData = z11.object({
|
|
430
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ADDPROXY),
|
|
420
431
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
421
|
-
kind:
|
|
422
|
-
proxy:
|
|
432
|
+
kind: z11.literal("Staking").meta({ description: "Proxy kind" }),
|
|
433
|
+
proxy: z11.string().meta({ description: "Proxy address" })
|
|
423
434
|
}).meta({
|
|
424
435
|
description: "Polkadot-like add proxy data",
|
|
425
436
|
id: "PolkadotLikeAddProxyData"
|
|
426
437
|
});
|
|
427
|
-
var zPolkadotLikeAnonymousProxyData =
|
|
428
|
-
type:
|
|
438
|
+
var zPolkadotLikeAnonymousProxyData = z11.object({
|
|
439
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_ANONYMOUSPROXY),
|
|
429
440
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
430
441
|
}).meta({
|
|
431
442
|
description: "Polkadot-like anonymous proxy data",
|
|
432
443
|
id: "PolkadotLikeAnonymousProxyData"
|
|
433
444
|
});
|
|
434
|
-
var zPolkadotLikeBondData =
|
|
435
|
-
type:
|
|
445
|
+
var zPolkadotLikeBondData = z11.object({
|
|
446
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BOND),
|
|
436
447
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
437
448
|
payee: zPolkadotRewardDestination,
|
|
438
449
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
@@ -440,75 +451,75 @@ var zPolkadotLikeBondData = z10.object({
|
|
|
440
451
|
description: "Polkadot-like bond data",
|
|
441
452
|
id: "PolkadotLikeBondData"
|
|
442
453
|
});
|
|
443
|
-
var zPolkadotLikeBondExtraData =
|
|
444
|
-
type:
|
|
454
|
+
var zPolkadotLikeBondExtraData = z11.object({
|
|
455
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_BONDEXTRA),
|
|
445
456
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
446
457
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
447
458
|
}).meta({
|
|
448
459
|
description: "Polkadot-like bond extra data",
|
|
449
460
|
id: "PolkadotLikeBondExtraData"
|
|
450
461
|
});
|
|
451
|
-
var zPolkadotLikeChillData =
|
|
452
|
-
type:
|
|
462
|
+
var zPolkadotLikeChillData = z11.object({
|
|
463
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_CHILL),
|
|
453
464
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
454
465
|
}).meta({
|
|
455
466
|
description: "Polkadot-like chill data",
|
|
456
467
|
id: "PolkadotLikeChillData"
|
|
457
468
|
});
|
|
458
|
-
var zPolkadotLikeKillAnonymousData =
|
|
459
|
-
type:
|
|
469
|
+
var zPolkadotLikeKillAnonymousData = z11.object({
|
|
470
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_KILLANONYMOUS),
|
|
460
471
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
461
472
|
}).meta({
|
|
462
473
|
description: "Polkadot-like kill anonymous data",
|
|
463
474
|
id: "PolkadotLikeKillAnonymousData"
|
|
464
475
|
});
|
|
465
|
-
var zPolkadotLikeRebondData =
|
|
466
|
-
type:
|
|
476
|
+
var zPolkadotLikeRebondData = z11.object({
|
|
477
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REBOND),
|
|
467
478
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
468
479
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
469
480
|
}).meta({
|
|
470
481
|
description: "Polkadot-like rebond data",
|
|
471
482
|
id: "PolkadotLikeRebondData"
|
|
472
483
|
});
|
|
473
|
-
var zPolkadotLikeRemoveProxyData =
|
|
474
|
-
type:
|
|
484
|
+
var zPolkadotLikeRemoveProxyData = z11.object({
|
|
485
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_REMOVEPROXY),
|
|
475
486
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
476
|
-
kind:
|
|
477
|
-
proxy:
|
|
487
|
+
kind: z11.literal("Staking"),
|
|
488
|
+
proxy: z11.string().meta({ description: "Proxy address" })
|
|
478
489
|
}).meta({
|
|
479
490
|
description: "Polkadot-like remove proxy data",
|
|
480
491
|
id: "PolkadotLikeRemoveProxyData"
|
|
481
492
|
});
|
|
482
493
|
var zPolkadotLikeSendData = zCommonTransactionData.extend({
|
|
483
|
-
type:
|
|
494
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SEND)
|
|
484
495
|
}).meta({
|
|
485
496
|
description: "Polkadot-like send data",
|
|
486
497
|
id: "PolkadotLikeSendData"
|
|
487
498
|
});
|
|
488
|
-
var zPolkadotLikeSetPayeeData =
|
|
489
|
-
type:
|
|
499
|
+
var zPolkadotLikeSetPayeeData = z11.object({
|
|
500
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_SETPAYEE),
|
|
490
501
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
491
502
|
payee: zPolkadotRewardDestination
|
|
492
503
|
}).meta({
|
|
493
504
|
description: "Polkadot-like set payee data",
|
|
494
505
|
id: "PolkadotLikeSetPayeeData"
|
|
495
506
|
});
|
|
496
|
-
var zPolkadotLikeUnbondData =
|
|
497
|
-
type:
|
|
507
|
+
var zPolkadotLikeUnbondData = z11.object({
|
|
508
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_UNBOND),
|
|
498
509
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
499
510
|
amount: zUnsignedIntString.meta({ description: "Amount" })
|
|
500
511
|
}).meta({
|
|
501
512
|
description: "Polkadot-like unbond data",
|
|
502
513
|
id: "PolkadotLikeUnbondData"
|
|
503
514
|
});
|
|
504
|
-
var zPolkadotLikeWithdrawUnbondedData =
|
|
505
|
-
type:
|
|
515
|
+
var zPolkadotLikeWithdrawUnbondedData = z11.object({
|
|
516
|
+
type: z11.literal(zPolkadotLikeTransactionType.enum.POLKADOT_LIKE_WITHDRAWUNBONDED),
|
|
506
517
|
currency: zCurrencyString.meta({ description: "Transaction currency" })
|
|
507
518
|
}).meta({
|
|
508
519
|
description: "Polkadot-like withdraw unbonded data",
|
|
509
520
|
id: "PolkadotLikeWithdrawUnbondedData"
|
|
510
521
|
});
|
|
511
|
-
var zPolkadotLikeTransactionData =
|
|
522
|
+
var zPolkadotLikeTransactionData = z11.discriminatedUnion("type", [
|
|
512
523
|
zPolkadotLikeAddProxyData,
|
|
513
524
|
zPolkadotLikeAnonymousProxyData,
|
|
514
525
|
zPolkadotLikeBondData,
|
|
@@ -523,77 +534,77 @@ var zPolkadotLikeTransactionData = z10.discriminatedUnion("type", [
|
|
|
523
534
|
zPolkadotLikeWithdrawUnbondedData
|
|
524
535
|
]);
|
|
525
536
|
var zPolkadotLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zPolkadotLikeTransactionType }).meta({ description: "Polkadot-like transaction" });
|
|
526
|
-
var zRippleLikeAssetFields =
|
|
527
|
-
type:
|
|
528
|
-
address:
|
|
537
|
+
var zRippleLikeAssetFields = z11.object({
|
|
538
|
+
type: z11.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" }),
|
|
539
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
529
540
|
}).meta({ description: "Ripple-like" });
|
|
530
541
|
var zRippleLikeLiveData = zCommonLiveData.extend({
|
|
531
|
-
type:
|
|
542
|
+
type: z11.literal(NetworkFamily.RIPPLE_LIKE).meta({ description: "Account type" })
|
|
532
543
|
}).meta({ description: "Ripple-like" });
|
|
533
|
-
var zRippleLikeEstimatedFees =
|
|
534
|
-
type:
|
|
544
|
+
var zRippleLikeEstimatedFees = z11.object({
|
|
545
|
+
type: z11.literal(NetworkFamily.RIPPLE_LIKE),
|
|
535
546
|
fee: zIntString
|
|
536
547
|
}).meta({ description: "Ripple-like fees" });
|
|
537
|
-
var zRippleLikeTransactionType =
|
|
548
|
+
var zRippleLikeTransactionType = z11.enum(["RIPPLE_LIKE_SEND", "RIPPLE_LIKE_RECEIVE"]).meta({ description: "Ripple-like transaction type" });
|
|
538
549
|
var zRippleLikeSendData = zCommonTransactionData.extend({
|
|
539
|
-
type:
|
|
550
|
+
type: z11.literal(zRippleLikeTransactionType.enum.RIPPLE_LIKE_SEND),
|
|
540
551
|
destinationTag: zIntString.nullable().meta({ description: "Destination tag" }),
|
|
541
552
|
feeStrategy: zFeeStrategyCustom.meta({ description: "Ripple-like fee strategy" })
|
|
542
553
|
}).meta({
|
|
543
554
|
description: "Ripple-like send data",
|
|
544
555
|
id: "RippleLikeSendData"
|
|
545
556
|
});
|
|
546
|
-
var zRippleLikeTransactionData =
|
|
557
|
+
var zRippleLikeTransactionData = z11.discriminatedUnion("type", [zRippleLikeSendData]);
|
|
547
558
|
var zRippleLikeTransactionResponse = zCommonTransactionResponse.extend({
|
|
548
559
|
type: zRippleLikeTransactionType,
|
|
549
|
-
memos:
|
|
550
|
-
destinationTag:
|
|
560
|
+
memos: z11.array(z11.string()),
|
|
561
|
+
destinationTag: z11.string()
|
|
551
562
|
}).meta({ description: "Ripple-like transaction" });
|
|
552
|
-
var zSolanaLikeAssetFields =
|
|
553
|
-
type:
|
|
554
|
-
address:
|
|
555
|
-
contractAddress:
|
|
563
|
+
var zSolanaLikeAssetFields = z11.object({
|
|
564
|
+
type: z11.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
|
|
565
|
+
address: z11.string().nullable().meta({ description: "Account address" }),
|
|
566
|
+
contractAddress: z11.string().meta({
|
|
556
567
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
557
568
|
}).nullable().optional()
|
|
558
569
|
}).meta({ description: "Solana-like" });
|
|
559
|
-
var zSolanaStakingAccountStatus =
|
|
560
|
-
var zSolanaLikeStakingData =
|
|
561
|
-
staked:
|
|
562
|
-
rewards:
|
|
563
|
-
total:
|
|
564
|
-
last7:
|
|
565
|
-
last30:
|
|
570
|
+
var zSolanaStakingAccountStatus = z11.enum(["not_sync", "activating", "activated", "deactivating", "deactivated", "deleted"]).meta({ description: "Staking account status" });
|
|
571
|
+
var zSolanaLikeStakingData = z11.object({
|
|
572
|
+
staked: z11.string().meta({ description: "Staked balance" }),
|
|
573
|
+
rewards: z11.object({
|
|
574
|
+
total: z11.string().meta({ description: "Total rewards" }),
|
|
575
|
+
last7: z11.string().meta({ description: "Rewards on last 7 days" }),
|
|
576
|
+
last30: z11.string().meta({ description: "Rewards on last 30 days" })
|
|
566
577
|
}),
|
|
567
|
-
stakes:
|
|
568
|
-
|
|
569
|
-
uid:
|
|
570
|
-
baseAccountUid:
|
|
571
|
-
pubKey:
|
|
572
|
-
validatorPubKey:
|
|
573
|
-
initialAmount:
|
|
574
|
-
activeAmount:
|
|
575
|
-
inactiveAmount:
|
|
576
|
-
totalBalance:
|
|
577
|
-
creationDate:
|
|
578
|
-
activationEpoch:
|
|
579
|
-
activationDate:
|
|
580
|
-
deactivationEpoch:
|
|
581
|
-
deactivationDate:
|
|
578
|
+
stakes: z11.array(
|
|
579
|
+
z11.object({
|
|
580
|
+
uid: z11.string(),
|
|
581
|
+
baseAccountUid: z11.string(),
|
|
582
|
+
pubKey: z11.string().meta({ description: "Public key" }),
|
|
583
|
+
validatorPubKey: z11.string().nullable().meta({ description: "Validator public key" }),
|
|
584
|
+
initialAmount: z11.string().meta({ description: "Initial amount" }),
|
|
585
|
+
activeAmount: z11.string().meta({ description: "Active amount" }),
|
|
586
|
+
inactiveAmount: z11.string().meta({ description: "Inactive amount" }),
|
|
587
|
+
totalBalance: z11.string().meta({ description: "Total balance" }),
|
|
588
|
+
creationDate: z11.string().meta({ description: "Creation date" }),
|
|
589
|
+
activationEpoch: z11.string().nullable().meta({ description: "Activation epoch" }),
|
|
590
|
+
activationDate: z11.string().nullable().meta({ description: "Activation date" }),
|
|
591
|
+
deactivationEpoch: z11.string().nullable().meta({ description: "Deactivation epoch" }),
|
|
592
|
+
deactivationDate: z11.string().nullable().meta({ description: "Deactivation date" }),
|
|
582
593
|
status: zSolanaStakingAccountStatus,
|
|
583
|
-
rentExemptReserve:
|
|
584
|
-
withdrawableAmount:
|
|
585
|
-
totalRewards:
|
|
586
|
-
creationTxHash:
|
|
587
|
-
actionsTxHashes:
|
|
594
|
+
rentExemptReserve: z11.string().meta({ description: "Rent exempt reserve" }),
|
|
595
|
+
withdrawableAmount: z11.string().meta({ description: "Withdrawable amount" }),
|
|
596
|
+
totalRewards: z11.string().meta({ description: "Total rewards" }),
|
|
597
|
+
creationTxHash: z11.string().nullable().meta({ description: "Creation transaction hash" }),
|
|
598
|
+
actionsTxHashes: z11.array(z11.string()).meta({ description: "Actions transactions hashes" })
|
|
588
599
|
})
|
|
589
600
|
)
|
|
590
601
|
}).nullable().meta({ description: "Solana-like staking data" });
|
|
591
|
-
var zSolanaLikeStakingFields =
|
|
592
|
-
type:
|
|
602
|
+
var zSolanaLikeStakingFields = z11.object({
|
|
603
|
+
type: z11.literal(NetworkFamily.SOLANA_LIKE).meta({ description: "Account type" }),
|
|
593
604
|
staking: zSolanaLikeStakingData.optional()
|
|
594
605
|
});
|
|
595
606
|
var zSolanaLikeLiveData = zCommonLiveData.extend(zSolanaLikeStakingFields.shape).meta({ description: "Solana-like" });
|
|
596
|
-
var zSolanaLikeTransactionType =
|
|
607
|
+
var zSolanaLikeTransactionType = z11.enum([
|
|
597
608
|
"SOLANA_LIKE_SEND",
|
|
598
609
|
"SOLANA_LIKE_RECEIVE",
|
|
599
610
|
"SOLANA_LIKE_CREATE_DELEGATE_STAKE",
|
|
@@ -608,43 +619,43 @@ var zSolanaLikeTransactionType = z10.enum([
|
|
|
608
619
|
"SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT"
|
|
609
620
|
]).meta({ description: "Solana-like transaction type" });
|
|
610
621
|
var zSolanaLikeCreateDelegateStakeData = zCommonTransactionData.extend({
|
|
611
|
-
type:
|
|
612
|
-
recipient:
|
|
622
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_DELEGATE_STAKE),
|
|
623
|
+
recipient: z11.string().meta({ description: "Delegated vote address" }),
|
|
613
624
|
// Re-described
|
|
614
625
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
615
626
|
}).meta({
|
|
616
627
|
description: "Solana-like create delegate stake data",
|
|
617
628
|
id: "SolanaLikeCreateDelegateStakeData"
|
|
618
629
|
});
|
|
619
|
-
var zSolanaLikeDeactivateStakeData =
|
|
620
|
-
type:
|
|
630
|
+
var zSolanaLikeDeactivateStakeData = z11.object({
|
|
631
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DEACTIVATE_STAKE),
|
|
621
632
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
622
633
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
623
|
-
stakeAccount:
|
|
634
|
+
stakeAccount: z11.string().meta({ description: "Stake account address" }),
|
|
624
635
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
625
636
|
// No recipient, no amount
|
|
626
637
|
}).meta({
|
|
627
638
|
description: "Solana-like deactivate stake data",
|
|
628
639
|
id: "SolanaLikeDeactivateStakeData"
|
|
629
640
|
});
|
|
630
|
-
var zSolanaLikeDelegateStakeData =
|
|
631
|
-
type:
|
|
641
|
+
var zSolanaLikeDelegateStakeData = z11.object({
|
|
642
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_DELEGATE_STAKE),
|
|
632
643
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
633
644
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
634
|
-
recipient:
|
|
635
|
-
stakeAccount:
|
|
645
|
+
recipient: z11.string().meta({ description: "Delegated vote address" }),
|
|
646
|
+
stakeAccount: z11.string().meta({ description: "Stake account address" }),
|
|
636
647
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
637
648
|
// No amount
|
|
638
649
|
}).meta({
|
|
639
650
|
description: "Solana-like delegate stake data",
|
|
640
651
|
id: "SolanaLikeDelegateStakeData"
|
|
641
652
|
});
|
|
642
|
-
var zSolanaLikeMergeStakeData =
|
|
643
|
-
type:
|
|
653
|
+
var zSolanaLikeMergeStakeData = z11.object({
|
|
654
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_MERGE_STAKE),
|
|
644
655
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
645
656
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
646
|
-
mergeSrcAccount:
|
|
647
|
-
mergeDstAccount:
|
|
657
|
+
mergeSrcAccount: z11.string().meta({ description: "Source stake address" }),
|
|
658
|
+
mergeDstAccount: z11.string().meta({ description: "Destination stake address" }),
|
|
648
659
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
649
660
|
// No recipient, no amount
|
|
650
661
|
}).meta({
|
|
@@ -652,42 +663,42 @@ var zSolanaLikeMergeStakeData = z10.object({
|
|
|
652
663
|
id: "SolanaLikeMergeStakeData"
|
|
653
664
|
});
|
|
654
665
|
var zSolanaLikeSendData = zCommonTransactionData.extend({
|
|
655
|
-
type:
|
|
666
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND),
|
|
656
667
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
657
668
|
}).meta({
|
|
658
669
|
description: "Solana-like send data",
|
|
659
670
|
id: "SolanaLikeSendData"
|
|
660
671
|
});
|
|
661
|
-
var zSolanaLikeSplitDeactivateStakeData =
|
|
662
|
-
type:
|
|
672
|
+
var zSolanaLikeSplitDeactivateStakeData = z11.object({
|
|
673
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_DEACTIVATE_STAKE),
|
|
663
674
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
664
675
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
665
676
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
666
|
-
stakeAccount:
|
|
677
|
+
stakeAccount: z11.string().meta({ description: "Stake account address" }),
|
|
667
678
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
668
679
|
// No recipient
|
|
669
680
|
}).meta({
|
|
670
681
|
description: "Solana-like split deactivate stake data",
|
|
671
682
|
id: "SolanaLikeSplitDeactivateStakeData"
|
|
672
683
|
});
|
|
673
|
-
var zSolanaLikeSplitStakeData =
|
|
674
|
-
type:
|
|
684
|
+
var zSolanaLikeSplitStakeData = z11.object({
|
|
685
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SPLIT_STAKE),
|
|
675
686
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
676
687
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
677
688
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
678
|
-
stakeAccount:
|
|
689
|
+
stakeAccount: z11.string().meta({ description: "Stake account address" }),
|
|
679
690
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
680
691
|
// No recipient
|
|
681
692
|
}).meta({
|
|
682
693
|
description: "Solana-like split stake data",
|
|
683
694
|
id: "SolanaLikeSplitStakeData"
|
|
684
695
|
});
|
|
685
|
-
var zSolanaLikeWithdrawStakeData =
|
|
686
|
-
type:
|
|
696
|
+
var zSolanaLikeWithdrawStakeData = z11.object({
|
|
697
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_WITHDRAW_STAKE),
|
|
687
698
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
688
699
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
689
700
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
690
|
-
stakeAccount:
|
|
701
|
+
stakeAccount: z11.string().meta({ description: "Stake account address" }),
|
|
691
702
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
692
703
|
// No recipient
|
|
693
704
|
}).meta({
|
|
@@ -695,21 +706,21 @@ var zSolanaLikeWithdrawStakeData = z10.object({
|
|
|
695
706
|
id: "SolanaLikeWithdrawStakeData"
|
|
696
707
|
});
|
|
697
708
|
var zSolanaLikeSendTokenData = zCommonTransactionData.extend({
|
|
698
|
-
type:
|
|
709
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_SEND_TOKEN),
|
|
699
710
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
700
711
|
}).meta({
|
|
701
712
|
description: "Solana-like send token data",
|
|
702
713
|
id: "SolanaLikeSendTokenData"
|
|
703
714
|
});
|
|
704
715
|
var zSolanaLikeFundAndSendTokenData = zCommonTransactionData.extend({
|
|
705
|
-
type:
|
|
716
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_FUND_AND_SEND_TOKEN),
|
|
706
717
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
707
718
|
}).meta({
|
|
708
719
|
description: "Solana-like fund token account and send token data",
|
|
709
720
|
id: "SolanaLikeFundAndSendTokenData"
|
|
710
721
|
});
|
|
711
|
-
var zSolanaLikeCreateTokenAccountData =
|
|
712
|
-
type:
|
|
722
|
+
var zSolanaLikeCreateTokenAccountData = z11.object({
|
|
723
|
+
type: z11.literal(zSolanaLikeTransactionType.enum.SOLANA_LIKE_CREATE_SPL_TOKEN_ACCOUNT),
|
|
713
724
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
714
725
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
715
726
|
feeStrategy: zFeeStrategy.meta({ description: "Solana-like fee strategy" })
|
|
@@ -717,7 +728,7 @@ var zSolanaLikeCreateTokenAccountData = z10.object({
|
|
|
717
728
|
description: "Solana-like create token account",
|
|
718
729
|
id: "SolanaLikeCreateTokenAccountData"
|
|
719
730
|
});
|
|
720
|
-
var zSolanaLikeTransactionData =
|
|
731
|
+
var zSolanaLikeTransactionData = z11.discriminatedUnion("type", [
|
|
721
732
|
zSolanaLikeCreateDelegateStakeData,
|
|
722
733
|
zSolanaLikeDeactivateStakeData,
|
|
723
734
|
zSolanaLikeDelegateStakeData,
|
|
@@ -731,60 +742,60 @@ var zSolanaLikeTransactionData = z10.discriminatedUnion("type", [
|
|
|
731
742
|
zSolanaLikeCreateTokenAccountData
|
|
732
743
|
]);
|
|
733
744
|
var zSolanaLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zSolanaLikeTransactionType }).meta({ description: "Solana-like transaction" });
|
|
734
|
-
var zStellarLikeAssetFields =
|
|
735
|
-
type:
|
|
736
|
-
address:
|
|
745
|
+
var zStellarLikeAssetFields = z11.object({
|
|
746
|
+
type: z11.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" }),
|
|
747
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
737
748
|
}).meta({ description: "Stellar-like" });
|
|
738
749
|
var zStellarLikeLiveData = zCommonLiveData.extend({
|
|
739
|
-
type:
|
|
750
|
+
type: z11.literal(NetworkFamily.STELLAR_LIKE).meta({ description: "Account type" })
|
|
740
751
|
}).meta({ description: "Stellar-like" });
|
|
741
|
-
var zStellarLikeEstimatedFees =
|
|
742
|
-
type:
|
|
752
|
+
var zStellarLikeEstimatedFees = z11.object({
|
|
753
|
+
type: z11.literal(NetworkFamily.STELLAR_LIKE),
|
|
743
754
|
fee: zIntString
|
|
744
755
|
}).meta({ description: "Stellar-like fees" });
|
|
745
|
-
var zStellarLikeTransactionType =
|
|
746
|
-
var zStellarMemo =
|
|
747
|
-
|
|
748
|
-
MEMO_TEXT:
|
|
756
|
+
var zStellarLikeTransactionType = z11.enum(["STELLAR_LIKE_SEND", "STELLAR_LIKE_RECEIVE"]).meta({ description: "Stellar-like transaction type" });
|
|
757
|
+
var zStellarMemo = z11.union([
|
|
758
|
+
z11.object({
|
|
759
|
+
MEMO_TEXT: z11.string().max(28).meta({ description: "Text memo (at most a 28 bytes string)" })
|
|
749
760
|
}).meta({ description: "Text memo" }),
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
MEMO_HASH:
|
|
761
|
+
z11.object({ MEMO_ID: zIntString.meta({ description: "Id memo (unsigned 64 bits integer)" }) }).meta({ description: "Id memo" }),
|
|
762
|
+
z11.object({
|
|
763
|
+
MEMO_HASH: z11.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({ description: "Transaction hash memo (64 bytes hexadecimal string)" })
|
|
753
764
|
}).meta({ description: "Hash memo" }),
|
|
754
|
-
|
|
755
|
-
MEMO_RETURN:
|
|
765
|
+
z11.object({
|
|
766
|
+
MEMO_RETURN: z11.string().max(128).regex(/^[a-fA-F0-9]+$/).meta({
|
|
756
767
|
description: "A 64 bytes hexadecimal string intended to be interpreted as the hash of the transaction the sender is refunding."
|
|
757
768
|
})
|
|
758
769
|
}).meta({ description: "Return memo" })
|
|
759
770
|
]);
|
|
760
771
|
var zStellarLikeSendData = zCommonTransactionData.extend({
|
|
761
|
-
type:
|
|
772
|
+
type: z11.literal(zStellarLikeTransactionType.enum.STELLAR_LIKE_SEND),
|
|
762
773
|
memo: zStellarMemo.nullable().meta({ description: "Stellar memo" }),
|
|
763
774
|
feeStrategy: zFeeStrategy.meta({ description: "Stellar-like fee strategy" })
|
|
764
775
|
}).meta({
|
|
765
776
|
description: "Stellar-like send data",
|
|
766
777
|
id: "StellarLikeSendData"
|
|
767
778
|
});
|
|
768
|
-
var zStellarLikeTransactionData =
|
|
779
|
+
var zStellarLikeTransactionData = z11.discriminatedUnion("type", [zStellarLikeSendData]);
|
|
769
780
|
var zStellarLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zStellarLikeTransactionType }).meta({ description: "Stellar-like transaction" });
|
|
770
|
-
var zSuiLikeAssetFields =
|
|
771
|
-
type:
|
|
772
|
-
address:
|
|
781
|
+
var zSuiLikeAssetFields = z11.object({
|
|
782
|
+
type: z11.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
|
|
783
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
773
784
|
}).meta({ description: "Sui-like" });
|
|
774
|
-
var zSuiLikeStakingData =
|
|
775
|
-
totalStaked:
|
|
776
|
-
totalRewards:
|
|
785
|
+
var zSuiLikeStakingData = z11.object({
|
|
786
|
+
totalStaked: z11.string().meta({ description: "Total staked amount" }),
|
|
787
|
+
totalRewards: z11.string().meta({ description: "Total of rewards" })
|
|
777
788
|
}).nullable().meta({ description: "Sui-like staking data" });
|
|
778
|
-
var zSuiLikeStakingFields =
|
|
779
|
-
type:
|
|
789
|
+
var zSuiLikeStakingFields = z11.object({
|
|
790
|
+
type: z11.literal(NetworkFamily.SUI_LIKE).meta({ description: "Account type" }),
|
|
780
791
|
staking: zSuiLikeStakingData.optional()
|
|
781
792
|
});
|
|
782
793
|
var zSuiLikeLiveData = zCommonLiveData.extend(zSuiLikeStakingFields.shape).meta({ description: "Sui-like" });
|
|
783
|
-
var zSuiLikeEstimatedFees =
|
|
784
|
-
type:
|
|
794
|
+
var zSuiLikeEstimatedFees = z11.object({
|
|
795
|
+
type: z11.literal(NetworkFamily.SUI_LIKE),
|
|
785
796
|
fee: zIntString
|
|
786
797
|
}).meta({ description: "Sui-like fees" });
|
|
787
|
-
var zSuiLikeTransactionType =
|
|
798
|
+
var zSuiLikeTransactionType = z11.enum([
|
|
788
799
|
"SUI_LIKE_SEND",
|
|
789
800
|
"SUI_LIKE_RECEIVE",
|
|
790
801
|
"SUI_LIKE_SEND_TOKEN",
|
|
@@ -793,21 +804,21 @@ var zSuiLikeTransactionType = z10.enum([
|
|
|
793
804
|
"SUI_LIKE_UNSTAKE"
|
|
794
805
|
]).meta({ description: "Sui-like transaction type" });
|
|
795
806
|
var zSuiLikeSendData = zCommonTransactionData.extend({
|
|
796
|
-
type:
|
|
807
|
+
type: z11.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND),
|
|
797
808
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
|
|
798
809
|
}).meta({
|
|
799
810
|
description: "Sui-like send data",
|
|
800
811
|
id: "SuiLikeSendData"
|
|
801
812
|
});
|
|
802
813
|
var zSuiLikeTransferTokenData = zCommonTransactionData.extend({
|
|
803
|
-
type:
|
|
814
|
+
type: z11.literal(zSuiLikeTransactionType.enum.SUI_LIKE_SEND_TOKEN),
|
|
804
815
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" })
|
|
805
816
|
}).meta({
|
|
806
817
|
description: "Sui-like transfer token data",
|
|
807
818
|
id: "SuiLikeTransferTokenData"
|
|
808
819
|
});
|
|
809
|
-
var zSuiLikeStakeData =
|
|
810
|
-
type:
|
|
820
|
+
var zSuiLikeStakeData = z11.object({
|
|
821
|
+
type: z11.literal(zSuiLikeTransactionType.enum.SUI_LIKE_STAKE),
|
|
811
822
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
|
|
812
823
|
amount: zUnsignedIntString.meta({ description: "Transaction amount" }),
|
|
813
824
|
currency: zCurrencyString.meta({
|
|
@@ -815,55 +826,55 @@ var zSuiLikeStakeData = z10.object({
|
|
|
815
826
|
}),
|
|
816
827
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
817
828
|
// DELEGATE does not have recipient, but has validator instead
|
|
818
|
-
validator:
|
|
829
|
+
validator: z11.string().nonempty().meta({ description: "Validator address" })
|
|
819
830
|
}).meta({
|
|
820
831
|
description: "Sui-like stake data",
|
|
821
832
|
id: "SuiLikeStakeData"
|
|
822
833
|
});
|
|
823
|
-
var zSuiLikeUnstakeData =
|
|
824
|
-
type:
|
|
834
|
+
var zSuiLikeUnstakeData = z11.object({
|
|
835
|
+
type: z11.literal(zSuiLikeTransactionType.enum.SUI_LIKE_UNSTAKE),
|
|
825
836
|
feeStrategy: zFeeStrategy.meta({ description: "Sui-like fee strategy" }),
|
|
826
837
|
currency: zCurrencyString.meta({
|
|
827
838
|
description: "Will be deprecated soon, use Account.network. Transaction currency"
|
|
828
839
|
}),
|
|
829
840
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
830
|
-
stakedSuiId:
|
|
841
|
+
stakedSuiId: z11.string().nonempty().meta({ description: "Staked object to (partially?) unstake" }),
|
|
831
842
|
amount: zUnsignedIntString.meta({ description: "Amount to unstake from the position" }),
|
|
832
|
-
useAllAmount:
|
|
843
|
+
useAllAmount: z11.boolean().meta({
|
|
833
844
|
description: "Whether to unstake the full amount (triggers different sets of transaction commands)"
|
|
834
845
|
})
|
|
835
846
|
}).meta({
|
|
836
847
|
description: "Sui-like unstake data",
|
|
837
848
|
id: "SuiLikeUnstakeData"
|
|
838
849
|
});
|
|
839
|
-
var zSuiLikeTransactionData =
|
|
850
|
+
var zSuiLikeTransactionData = z11.discriminatedUnion("type", [
|
|
840
851
|
zSuiLikeSendData,
|
|
841
852
|
zSuiLikeTransferTokenData,
|
|
842
853
|
zSuiLikeStakeData,
|
|
843
854
|
zSuiLikeUnstakeData
|
|
844
855
|
]);
|
|
845
856
|
var zSuiLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zSuiLikeTransactionType }).meta({ description: "Sui-like transaction" });
|
|
846
|
-
var zTezosLikeAssetFields =
|
|
847
|
-
type:
|
|
848
|
-
address:
|
|
857
|
+
var zTezosLikeAssetFields = z11.object({
|
|
858
|
+
type: z11.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
|
|
859
|
+
address: z11.string().nullable().meta({ description: "Account address" })
|
|
849
860
|
}).meta({ description: "Tezos-like" });
|
|
850
|
-
var zTezosLikeStakingData =
|
|
851
|
-
delegations:
|
|
852
|
-
|
|
853
|
-
address:
|
|
861
|
+
var zTezosLikeStakingData = z11.object({
|
|
862
|
+
delegations: z11.array(
|
|
863
|
+
z11.object({
|
|
864
|
+
address: z11.string()
|
|
854
865
|
})
|
|
855
866
|
)
|
|
856
867
|
}).nullable().meta({ description: "Tezos-like staking data" });
|
|
857
|
-
var zTezosLikeStakingFields =
|
|
858
|
-
type:
|
|
868
|
+
var zTezosLikeStakingFields = z11.object({
|
|
869
|
+
type: z11.literal(NetworkFamily.TEZOS_LIKE).meta({ description: "Account type" }),
|
|
859
870
|
staking: zTezosLikeStakingData.optional()
|
|
860
871
|
});
|
|
861
872
|
var zTezosLikeLiveData = zCommonLiveData.extend(zTezosLikeStakingFields.shape).meta({ description: "Tezos-like" });
|
|
862
|
-
var zTezosLikeEstimatedFees =
|
|
863
|
-
type:
|
|
873
|
+
var zTezosLikeEstimatedFees = z11.object({
|
|
874
|
+
type: z11.literal(NetworkFamily.TEZOS_LIKE),
|
|
864
875
|
fee: zIntString
|
|
865
876
|
}).describe("Tezos-like fees");
|
|
866
|
-
var zTezosLikeTransactionType =
|
|
877
|
+
var zTezosLikeTransactionType = z11.enum([
|
|
867
878
|
"TEZOS_LIKE_SEND",
|
|
868
879
|
"TEZOS_LIKE_RECEIVE",
|
|
869
880
|
"TEZOS_LIKE_REVEAL",
|
|
@@ -872,84 +883,80 @@ var zTezosLikeTransactionType = z10.enum([
|
|
|
872
883
|
]).meta({ description: "Tezos-like transaction type" });
|
|
873
884
|
var zTezosLikeFeeStrategy = zFeeStrategyCustom.meta({ description: "Tezos-like fee strategy" });
|
|
874
885
|
var zTezosLikeSendData = zCommonTransactionData.extend({
|
|
875
|
-
type:
|
|
886
|
+
type: z11.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_SEND),
|
|
876
887
|
feeStrategy: zTezosLikeFeeStrategy
|
|
877
888
|
}).meta({
|
|
878
889
|
description: "Tezos-like send data",
|
|
879
890
|
id: "TezosLikeSendData"
|
|
880
891
|
});
|
|
881
|
-
var zTezosLikeDelegateData =
|
|
882
|
-
type:
|
|
892
|
+
var zTezosLikeDelegateData = z11.object({
|
|
893
|
+
type: z11.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_DELEGATE),
|
|
883
894
|
amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
884
895
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
885
896
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
886
|
-
recipient:
|
|
897
|
+
recipient: z11.string().nonempty().meta({ description: "Transaction recipient" }),
|
|
887
898
|
feeStrategy: zTezosLikeFeeStrategy
|
|
888
899
|
}).meta({
|
|
889
900
|
description: "Tezos-like delegate data",
|
|
890
901
|
id: "TezosLikeDelegateData"
|
|
891
902
|
});
|
|
892
|
-
var zTezosLikeUndelegateData =
|
|
893
|
-
type:
|
|
903
|
+
var zTezosLikeUndelegateData = z11.object({
|
|
904
|
+
type: z11.literal(zTezosLikeTransactionType.enum.TEZOS_LIKE_UNDELEGATE),
|
|
894
905
|
amount: zUnsignedIntString.optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
895
906
|
currency: zCurrencyString.meta({ description: "Transaction currency" }),
|
|
896
907
|
maxFee: zUnsignedIntString.nullable().meta({ description: "Transaction max fee" }),
|
|
897
|
-
recipient:
|
|
908
|
+
recipient: z11.string().nonempty().optional().meta({ description: "Deprecated: DO NOT USE!" }),
|
|
898
909
|
feeStrategy: zTezosLikeFeeStrategy
|
|
899
910
|
}).meta({
|
|
900
911
|
description: "Tezos-like undelegate data",
|
|
901
912
|
id: "TezosLikeUndelegateData"
|
|
902
913
|
});
|
|
903
|
-
var zTezosLikeTransactionData =
|
|
914
|
+
var zTezosLikeTransactionData = z11.discriminatedUnion("type", [
|
|
904
915
|
zTezosLikeSendData,
|
|
905
916
|
zTezosLikeDelegateData,
|
|
906
917
|
zTezosLikeUndelegateData
|
|
907
918
|
]);
|
|
908
919
|
var zTezosLikeTransactionResponse = zCommonTransactionResponse.extend({ type: zTezosLikeTransactionType }).meta({ description: "Tezos-like transaction" });
|
|
909
|
-
var zTronLikeAssetFields =
|
|
910
|
-
type:
|
|
911
|
-
address:
|
|
912
|
-
|
|
913
|
-
var zTrc20LikeAssetFields = z10.object({
|
|
914
|
-
type: z10.literal(NetworkFamily.TRC20_LIKE).meta({ description: "Account type" }),
|
|
915
|
-
address: z10.string().nullable().meta({ description: "Account address" }),
|
|
916
|
-
contractAddress: z10.string().meta({
|
|
920
|
+
var zTronLikeAssetFields = z11.object({
|
|
921
|
+
type: z11.literal(NetworkFamily.TRON_LIKE).meta({ description: "Account type" }),
|
|
922
|
+
address: z11.string().nullable().meta({ description: "Account address" }),
|
|
923
|
+
contractAddress: z11.string().nullable().meta({
|
|
917
924
|
description: "Will be deprecated, Use contractAddress at root level instead; Token contract address"
|
|
918
925
|
}).optional()
|
|
919
|
-
}).meta({ description: "Tron-like
|
|
926
|
+
}).meta({ description: "Tron-like" });
|
|
920
927
|
var zTronLikeLiveData = zCommonLiveData.extend({
|
|
921
|
-
type:
|
|
928
|
+
type: z11.literal(NetworkFamily.TRON_LIKE).meta({ description: "Account type" })
|
|
922
929
|
}).meta({ description: "Tron-like" });
|
|
923
|
-
var zTronLikeEstimatedFees =
|
|
924
|
-
type:
|
|
930
|
+
var zTronLikeEstimatedFees = z11.object({
|
|
931
|
+
type: z11.literal(NetworkFamily.TRON_LIKE),
|
|
925
932
|
fee: zIntString
|
|
926
933
|
}).meta({ description: "Tron-like fees" });
|
|
927
|
-
var zTronLikeTransactionType =
|
|
934
|
+
var zTronLikeTransactionType = z11.enum(["TRON_LIKE_SEND", "TRON_LIKE_RECEIVE", "TRON_LIKE_SEND_TOKEN", "TRON_LIKE_RECEIVE_TOKEN"]).meta({ description: "Tron-like transaction type" });
|
|
928
935
|
var zTronLikeSendData = zCommonTransactionData.extend({
|
|
929
|
-
type:
|
|
936
|
+
type: z11.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND),
|
|
930
937
|
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
931
938
|
}).meta({
|
|
932
939
|
description: "Tron-like send data",
|
|
933
940
|
id: "TronLikeSendData"
|
|
934
941
|
});
|
|
935
942
|
var zTronLikeSendTokenData = zCommonTransactionData.extend({
|
|
936
|
-
type:
|
|
943
|
+
type: z11.literal(zTronLikeTransactionType.enum.TRON_LIKE_SEND_TOKEN),
|
|
937
944
|
feeStrategy: zFeeStrategy.meta({ description: "Tron-like fee strategy" })
|
|
938
945
|
}).meta({
|
|
939
946
|
description: "Tron-like send token data",
|
|
940
947
|
id: "TronLikeSendTokenData"
|
|
941
948
|
});
|
|
942
|
-
var zTronLikeTransactionData =
|
|
949
|
+
var zTronLikeTransactionData = z11.discriminatedUnion("type", [
|
|
943
950
|
zTronLikeSendData,
|
|
944
951
|
zTronLikeSendTokenData
|
|
945
952
|
]);
|
|
946
953
|
|
|
947
954
|
// src/networks/index.ts
|
|
948
|
-
var zNetworkAssetFields =
|
|
955
|
+
var zNetworkAssetFields = z11.discriminatedUnion("type", [
|
|
949
956
|
zBitcoinLikeAssetFields,
|
|
957
|
+
zCantonLikeAssetFields,
|
|
950
958
|
zCardanoLikeAssetFields,
|
|
951
959
|
zEthereumLikeAssetFields,
|
|
952
|
-
zEthereumTokenLikeAssetFields,
|
|
953
960
|
zGenericLikeAssetFields,
|
|
954
961
|
zPolkadotLikeAssetFields,
|
|
955
962
|
zRippleLikeAssetFields,
|
|
@@ -957,14 +964,13 @@ var zNetworkAssetFields = z10.discriminatedUnion("type", [
|
|
|
957
964
|
zStellarLikeAssetFields,
|
|
958
965
|
zTezosLikeAssetFields,
|
|
959
966
|
zSuiLikeAssetFields,
|
|
960
|
-
zTronLikeAssetFields
|
|
961
|
-
zTrc20LikeAssetFields
|
|
967
|
+
zTronLikeAssetFields
|
|
962
968
|
]).meta({ description: "Network asset fields" });
|
|
963
|
-
var zAccountLiveData =
|
|
969
|
+
var zAccountLiveData = z11.discriminatedUnion("type", [
|
|
964
970
|
zBitcoinLikeLiveData,
|
|
971
|
+
zCantonLikeLiveData,
|
|
965
972
|
zCardanoLikeLiveData,
|
|
966
973
|
zEthereumLikeLiveData,
|
|
967
|
-
zEthereumTokenLikeLiveData,
|
|
968
974
|
zGenericLikeLiveData,
|
|
969
975
|
zPolkadotLikeLiveData,
|
|
970
976
|
zRippleLikeLiveData,
|
|
@@ -974,7 +980,7 @@ var zAccountLiveData = z10.discriminatedUnion("type", [
|
|
|
974
980
|
zTezosLikeLiveData,
|
|
975
981
|
zTronLikeLiveData
|
|
976
982
|
]);
|
|
977
|
-
|
|
983
|
+
z11.discriminatedUnion("type", [
|
|
978
984
|
zCardanoLikeStakingFields,
|
|
979
985
|
zEthereumLikeStakingFields,
|
|
980
986
|
zPolkadotLikeStakingFields,
|
|
@@ -982,7 +988,7 @@ z10.discriminatedUnion("type", [
|
|
|
982
988
|
zSuiLikeStakingFields,
|
|
983
989
|
zTezosLikeStakingFields
|
|
984
990
|
]);
|
|
985
|
-
|
|
991
|
+
z11.discriminatedUnion("type", [
|
|
986
992
|
zEthereumLikeEstimatedFees,
|
|
987
993
|
zRippleLikeEstimatedFees,
|
|
988
994
|
zStellarLikeEstimatedFees,
|
|
@@ -990,8 +996,9 @@ z10.discriminatedUnion("type", [
|
|
|
990
996
|
zTezosLikeEstimatedFees,
|
|
991
997
|
zTronLikeEstimatedFees
|
|
992
998
|
]);
|
|
993
|
-
|
|
999
|
+
z11.union([
|
|
994
1000
|
zBitcoinLikeTransactionType,
|
|
1001
|
+
zCantonLikeTransactionType,
|
|
995
1002
|
zCardanoLikeTransactionType,
|
|
996
1003
|
zEthereumLikeTransferTransactionType,
|
|
997
1004
|
zEthereumLikeContractTransactionType,
|
|
@@ -1006,6 +1013,7 @@ z10.union([
|
|
|
1006
1013
|
]);
|
|
1007
1014
|
({
|
|
1008
1015
|
...zBitcoinLikeTransactionType.enum,
|
|
1016
|
+
...zCantonLikeTransactionType.enum,
|
|
1009
1017
|
...zCardanoLikeTransactionType.enum,
|
|
1010
1018
|
...zEthereumLikeTransferTransactionType.enum,
|
|
1011
1019
|
...zEthereumLikeContractTransactionType.enum,
|
|
@@ -1021,13 +1029,11 @@ z10.union([
|
|
|
1021
1029
|
({
|
|
1022
1030
|
...NetworkFamily,
|
|
1023
1031
|
// TODO: Sometimes `NetworkFamily` is not a `TransactionType` prefix - but why?
|
|
1024
|
-
[NetworkFamily.ERC20_LIKE]: "ETHEREUM_LIKE",
|
|
1025
|
-
[NetworkFamily.BEP20_LIKE]: "ETHEREUM_LIKE",
|
|
1026
|
-
[NetworkFamily.TRC20_LIKE]: "TRON_LIKE",
|
|
1027
1032
|
[NetworkFamily.GENERIC_LIKE]: "GENERIC"
|
|
1028
1033
|
});
|
|
1029
|
-
var zTransactionData =
|
|
1034
|
+
var zTransactionData = z11.discriminatedUnion("type", [
|
|
1030
1035
|
...zBitcoinLikeTransactionData.options,
|
|
1036
|
+
...zCantonLikeTransactionData.options,
|
|
1031
1037
|
...zCardanoLikeTransactionData.options,
|
|
1032
1038
|
...zEthereumLikeTransactionData.options,
|
|
1033
1039
|
...zPolkadotLikeTransactionData.options,
|
|
@@ -1039,8 +1045,9 @@ var zTransactionData = z10.discriminatedUnion("type", [
|
|
|
1039
1045
|
...zTronLikeTransactionData.options,
|
|
1040
1046
|
zGenericTransactionData
|
|
1041
1047
|
]);
|
|
1042
|
-
var zSendOnlyTransactionData =
|
|
1048
|
+
var zSendOnlyTransactionData = z11.discriminatedUnion("type", [
|
|
1043
1049
|
zBitcoinLikeSendData,
|
|
1050
|
+
zCantonLikeSendData,
|
|
1044
1051
|
zCardanoLikeSendData,
|
|
1045
1052
|
zEthereumLikeSendData,
|
|
1046
1053
|
zPolkadotLikeSendData,
|
|
@@ -1050,8 +1057,9 @@ var zSendOnlyTransactionData = z10.discriminatedUnion("type", [
|
|
|
1050
1057
|
zSuiLikeSendData,
|
|
1051
1058
|
zTezosLikeSendData
|
|
1052
1059
|
]);
|
|
1053
|
-
var zTransactionResponse =
|
|
1060
|
+
var zTransactionResponse = z11.discriminatedUnion("type", [
|
|
1054
1061
|
zBitcoinLikeTransactionResponse,
|
|
1062
|
+
zCantonLikeTransactionResponse,
|
|
1055
1063
|
zCardanoLikeTransactionResponse,
|
|
1056
1064
|
zEthereumLikeTransferTransactionResponse,
|
|
1057
1065
|
zEthereumLikeContractTransactionResponse,
|
|
@@ -1065,7 +1073,7 @@ var zTransactionResponse = z10.discriminatedUnion("type", [
|
|
|
1065
1073
|
]);
|
|
1066
1074
|
|
|
1067
1075
|
// src/accounts/clients/types.ts
|
|
1068
|
-
|
|
1076
|
+
z11.discriminatedUnion(
|
|
1069
1077
|
zTransactionResponse._zod.def.discriminator,
|
|
1070
1078
|
ensureNonEmptyArray(
|
|
1071
1079
|
zTransactionResponse.options.map((_) => _.extend({ note: zNote.nullable() }))
|
|
@@ -1234,7 +1242,7 @@ var zHsmSignature = z.object({
|
|
|
1234
1242
|
}),
|
|
1235
1243
|
pubkey: zHexString.nullable().meta({ description: "Public key for signature verification, 32 or 33 bytes" })
|
|
1236
1244
|
});
|
|
1237
|
-
var zWorkspaceName =
|
|
1245
|
+
var zWorkspaceName = z11.string().min(1).max(20).regex(/^[a-z0-9]+$/);
|
|
1238
1246
|
var zUserName = z.string().min(1).max(19).meta({ description: "User name" });
|
|
1239
1247
|
var zUserRegistrationCreateInput = z.object({
|
|
1240
1248
|
name: zUserName,
|
|
@@ -1250,80 +1258,80 @@ zUserRegistrationCreateInput.extend({
|
|
|
1250
1258
|
});
|
|
1251
1259
|
|
|
1252
1260
|
// src/users/request-data.ts
|
|
1253
|
-
var zCreatePsdUserRequestData =
|
|
1254
|
-
registrationId:
|
|
1261
|
+
var zCreatePsdUserRequestData = z11.object({
|
|
1262
|
+
registrationId: z11.string().meta({ description: "User registration ID" })
|
|
1255
1263
|
});
|
|
1256
|
-
var zCreateApiUserRequestData =
|
|
1264
|
+
var zCreateApiUserRequestData = z11.object({
|
|
1257
1265
|
name: zUserName,
|
|
1258
|
-
pubKey:
|
|
1259
|
-
role:
|
|
1260
|
-
viewAll:
|
|
1266
|
+
pubKey: z11.string().meta({ description: "Public key" }),
|
|
1267
|
+
role: z11.enum(["ADMIN", "OPERATOR"]).meta({ description: "User role" }),
|
|
1268
|
+
viewAll: z11.boolean().meta({ description: "View all data" }).optional()
|
|
1261
1269
|
}).meta({ description: "Create API user request data" });
|
|
1262
|
-
var zCreateApiUserAccessRequestData =
|
|
1270
|
+
var zCreateApiUserAccessRequestData = z11.object({
|
|
1263
1271
|
name: zUserName
|
|
1264
1272
|
}).meta({ description: "Create API user credential request data" });
|
|
1265
|
-
|
|
1266
|
-
authUserId:
|
|
1273
|
+
z11.object({
|
|
1274
|
+
authUserId: z11.string().meta({ description: "Authentication broker ID" })
|
|
1267
1275
|
}).meta({ description: "Managed data for API user" });
|
|
1268
|
-
var zRevokeUserRequestData =
|
|
1269
|
-
var zUpdateQuorumRequestData =
|
|
1270
|
-
quorum:
|
|
1276
|
+
var zRevokeUserRequestData = z11.object({});
|
|
1277
|
+
var zUpdateQuorumRequestData = z11.object({
|
|
1278
|
+
quorum: z11.number().int().min(2).meta({ description: "Workspace quorum" })
|
|
1271
1279
|
});
|
|
1272
1280
|
var NonRootAdminPermission = omit(AdminPermission, "ROOT");
|
|
1273
|
-
var zWorkspaceRuleRequestData =
|
|
1274
|
-
permission:
|
|
1281
|
+
var zWorkspaceRuleRequestData = z11.object({
|
|
1282
|
+
permission: z11.enum(NonRootAdminPermission).meta({ description: "Granted permissions" }),
|
|
1275
1283
|
reviewConfig: zReviewStepWithUsersArray.meta({ description: "List of admin review steps" })
|
|
1276
1284
|
});
|
|
1277
|
-
var zTradelinkWhitelistAddress =
|
|
1278
|
-
name:
|
|
1285
|
+
var zTradelinkWhitelistAddress = z11.object({
|
|
1286
|
+
name: z11.string().min(1),
|
|
1279
1287
|
currency: zCurrencyString,
|
|
1280
|
-
address:
|
|
1288
|
+
address: z11.string().min(1)
|
|
1281
1289
|
});
|
|
1282
|
-
|
|
1283
|
-
var zTradelinkId =
|
|
1284
|
-
var zTradelinkOrgEntityResponse =
|
|
1290
|
+
z11.array(zTradelinkWhitelistAddress);
|
|
1291
|
+
var zTradelinkId = z11.string().meta({ description: "Unique identifier in Tradelink service" });
|
|
1292
|
+
var zTradelinkOrgEntityResponse = z11.object({
|
|
1285
1293
|
tradelinkId: zTradelinkId,
|
|
1286
|
-
name:
|
|
1287
|
-
code:
|
|
1288
|
-
logoUrl:
|
|
1294
|
+
name: z11.string().meta({ description: "Name" }),
|
|
1295
|
+
code: z11.string().meta({ description: "Code" }),
|
|
1296
|
+
logoUrl: z11.string().meta({ description: "Logo URL" })
|
|
1289
1297
|
});
|
|
1290
1298
|
zTradelinkOrgEntityResponse.omit({
|
|
1291
1299
|
tradelinkId: true
|
|
1292
1300
|
});
|
|
1293
|
-
|
|
1301
|
+
z11.object({
|
|
1294
1302
|
tradelinkId: zTradelinkId
|
|
1295
1303
|
});
|
|
1296
|
-
var zTradelinkExchangeConfig =
|
|
1297
|
-
exchangeId:
|
|
1298
|
-
repledgeAuthorized:
|
|
1304
|
+
var zTradelinkExchangeConfig = z11.object({
|
|
1305
|
+
exchangeId: z11.string().meta({ description: "Tradelink exchange id" }),
|
|
1306
|
+
repledgeAuthorized: z11.boolean().meta({
|
|
1299
1307
|
description: "Determines whether this exchange is authorized to repledge on this account"
|
|
1300
1308
|
}),
|
|
1301
|
-
needsAssetManagerApprovalForSettlements:
|
|
1309
|
+
needsAssetManagerApprovalForSettlements: z11.boolean().meta({
|
|
1302
1310
|
description: 'Determines whether asset manager will "pre-approve" the settlement requests on this account'
|
|
1303
1311
|
})
|
|
1304
1312
|
});
|
|
1305
|
-
var zTradelinkExchangeConfigs =
|
|
1306
|
-
|
|
1313
|
+
var zTradelinkExchangeConfigs = z11.array(zTradelinkExchangeConfig);
|
|
1314
|
+
z11.object({
|
|
1307
1315
|
workspaceName: zWorkspaceName,
|
|
1308
|
-
custodian:
|
|
1309
|
-
assetManagers:
|
|
1310
|
-
exchanges:
|
|
1316
|
+
custodian: z11.object({ name: z11.string() }),
|
|
1317
|
+
assetManagers: z11.array(z11.object({ name: z11.string() })),
|
|
1318
|
+
exchanges: z11.array(z11.object({ name: z11.string() }))
|
|
1311
1319
|
});
|
|
1312
|
-
|
|
1313
|
-
tradelinkId:
|
|
1320
|
+
z11.object({
|
|
1321
|
+
tradelinkId: z11.string(),
|
|
1314
1322
|
workspaceName: zWorkspaceName,
|
|
1315
1323
|
custodian: zTradelinkOrgEntityResponse,
|
|
1316
|
-
assetManagers:
|
|
1317
|
-
exchanges:
|
|
1324
|
+
assetManagers: z11.array(zTradelinkOrgEntityResponse),
|
|
1325
|
+
exchanges: z11.array(zTradelinkOrgEntityResponse)
|
|
1318
1326
|
});
|
|
1319
|
-
var zTradelinkAsset =
|
|
1320
|
-
name:
|
|
1321
|
-
magnitude:
|
|
1327
|
+
var zTradelinkAsset = z11.object({
|
|
1328
|
+
name: z11.string(),
|
|
1329
|
+
magnitude: z11.number().int().nonnegative()
|
|
1322
1330
|
});
|
|
1323
|
-
|
|
1331
|
+
z11.object({
|
|
1324
1332
|
tradelinkId: zTradelinkId,
|
|
1325
1333
|
asset: zTradelinkAsset,
|
|
1326
|
-
state:
|
|
1334
|
+
state: z11.enum([
|
|
1327
1335
|
"PLEDGE_READY",
|
|
1328
1336
|
"PLEDGE_INCREMENT_PENDING_APPROVAL",
|
|
1329
1337
|
"PLEDGE_APPROVED",
|
|
@@ -1340,28 +1348,28 @@ z10.object({
|
|
|
1340
1348
|
"RECOVERING_FROM_FAILURE",
|
|
1341
1349
|
"PLEDGE_CONSUMED"
|
|
1342
1350
|
]),
|
|
1343
|
-
isLocked:
|
|
1344
|
-
amount:
|
|
1345
|
-
pending:
|
|
1346
|
-
repledge:
|
|
1347
|
-
exchangeTradelinkId:
|
|
1348
|
-
accountId:
|
|
1349
|
-
});
|
|
1350
|
-
|
|
1351
|
-
workspaceName:
|
|
1352
|
-
clientAccountId:
|
|
1351
|
+
isLocked: z11.boolean(),
|
|
1352
|
+
amount: z11.string().meta({ description: "Currently pledged amount" }),
|
|
1353
|
+
pending: z11.string().meta({ description: "Requested pledge increment, not yet approved" }),
|
|
1354
|
+
repledge: z11.string().meta({ description: "TODO: describe this field" }),
|
|
1355
|
+
exchangeTradelinkId: z11.string(),
|
|
1356
|
+
accountId: z11.string()
|
|
1357
|
+
});
|
|
1358
|
+
z11.object({
|
|
1359
|
+
workspaceName: z11.string(),
|
|
1360
|
+
clientAccountId: z11.string().meta({ description: "Account ID from the client side" }),
|
|
1353
1361
|
exchangeTradelinkId: zTradelinkId,
|
|
1354
1362
|
asset: zTradelinkAsset
|
|
1355
1363
|
});
|
|
1356
|
-
|
|
1364
|
+
z11.object({
|
|
1357
1365
|
pledgeTradelinkId: zTradelinkId,
|
|
1358
1366
|
amount: zUnsignedIntString,
|
|
1359
1367
|
asset: zTradelinkAsset
|
|
1360
1368
|
});
|
|
1361
|
-
|
|
1362
|
-
tradelinkId:
|
|
1363
|
-
pledgeTradelinkId:
|
|
1364
|
-
state:
|
|
1369
|
+
z11.object({
|
|
1370
|
+
tradelinkId: z11.string(),
|
|
1371
|
+
pledgeTradelinkId: z11.string(),
|
|
1372
|
+
state: z11.enum([
|
|
1365
1373
|
"REGISTERED",
|
|
1366
1374
|
"PENDING_REPLEDGE_CREATION_APPROVAL",
|
|
1367
1375
|
"PENDING_REPLEDGE_APPROVAL",
|
|
@@ -1375,160 +1383,160 @@ z10.object({
|
|
|
1375
1383
|
"CANCELED"
|
|
1376
1384
|
]),
|
|
1377
1385
|
// For now we only consider the outbound settlement
|
|
1378
|
-
outboundTransactionHash:
|
|
1386
|
+
outboundTransactionHash: z11.string().nullable()
|
|
1379
1387
|
});
|
|
1380
1388
|
|
|
1381
1389
|
// src/tradelink/request-data.ts
|
|
1382
|
-
var zTradelinkActivateAccountRequestData =
|
|
1383
|
-
var zTradelinkCustodianRequestData =
|
|
1390
|
+
var zTradelinkActivateAccountRequestData = z11.null();
|
|
1391
|
+
var zTradelinkCustodianRequestData = z11.object({
|
|
1384
1392
|
settlement: zReviewStepWithUsersArray.meta({ description: "List of settlement review steps" }),
|
|
1385
1393
|
withdraw: zReviewStepWithUsersArray.meta({ description: "List of withdraw review steps" }),
|
|
1386
1394
|
arbitration: zReviewStepWithUsersArray.meta({ description: "List of arbitration review steps" })
|
|
1387
1395
|
});
|
|
1388
|
-
var zTradelinkEntityRequestData =
|
|
1389
|
-
tradelinkId:
|
|
1396
|
+
var zTradelinkEntityRequestData = z11.object({
|
|
1397
|
+
tradelinkId: z11.string().min(1),
|
|
1390
1398
|
groups: zReviewStepWithUsersArray.meta({ description: "List of asset manager review groups" }),
|
|
1391
|
-
whitelist:
|
|
1399
|
+
whitelist: z11.array(zTradelinkWhitelistAddress).meta({ description: "List of asset manager whitelisted addresses" })
|
|
1392
1400
|
});
|
|
1393
|
-
var zTradelinkAdjustPledgeRequestData =
|
|
1394
|
-
accountId:
|
|
1395
|
-
exchangeId:
|
|
1401
|
+
var zTradelinkAdjustPledgeRequestData = z11.object({
|
|
1402
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1403
|
+
exchangeId: z11.string().meta({ description: "Exchange id" }),
|
|
1396
1404
|
amount: zIntString.meta({ description: "Amount to add to pledge" })
|
|
1397
1405
|
});
|
|
1398
|
-
var zTradelinkRepledgeRequestData =
|
|
1399
|
-
accountId:
|
|
1400
|
-
exchangeId:
|
|
1406
|
+
var zTradelinkRepledgeRequestData = z11.object({
|
|
1407
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1408
|
+
exchangeId: z11.string().meta({ description: "Exchange id" }),
|
|
1401
1409
|
amount: zIntString.meta({ description: "Amount to add to pledge" })
|
|
1402
1410
|
});
|
|
1403
|
-
var zTradelinkCreateSettlementRequestData =
|
|
1404
|
-
accountId:
|
|
1405
|
-
exchangeId:
|
|
1411
|
+
var zTradelinkCreateSettlementRequestData = z11.object({
|
|
1412
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1413
|
+
exchangeId: z11.string().meta({ description: "Exchange id" }),
|
|
1406
1414
|
transaction: zSendOnlyTransactionData
|
|
1407
1415
|
});
|
|
1408
|
-
var zTradelinkForceUnpledgeRequestData =
|
|
1409
|
-
accountId:
|
|
1410
|
-
exchangeId:
|
|
1416
|
+
var zTradelinkForceUnpledgeRequestData = z11.object({
|
|
1417
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1418
|
+
exchangeId: z11.string().meta({ description: "Exchange id" })
|
|
1411
1419
|
});
|
|
1412
|
-
var zTradelinkWithdrawRequestData =
|
|
1413
|
-
accountId:
|
|
1420
|
+
var zTradelinkWithdrawRequestData = z11.object({
|
|
1421
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1414
1422
|
transaction: zSendOnlyTransactionData
|
|
1415
1423
|
});
|
|
1416
|
-
var zTradelinkArbitrationRequestData =
|
|
1417
|
-
accountId:
|
|
1424
|
+
var zTradelinkArbitrationRequestData = z11.object({
|
|
1425
|
+
accountId: z11.string().meta({ description: "Account id" }),
|
|
1418
1426
|
transaction: zSendOnlyTransactionData
|
|
1419
1427
|
});
|
|
1420
1428
|
var zTradelinkRequestMixinsByType = {
|
|
1421
|
-
[RequestType.TRADELINK_ACTIVATE_ACCOUNT]:
|
|
1422
|
-
type:
|
|
1423
|
-
targetId:
|
|
1429
|
+
[RequestType.TRADELINK_ACTIVATE_ACCOUNT]: z11.object({
|
|
1430
|
+
type: z11.literal(RequestType.TRADELINK_ACTIVATE_ACCOUNT),
|
|
1431
|
+
targetId: z11.string(),
|
|
1424
1432
|
data: zTradelinkActivateAccountRequestData
|
|
1425
1433
|
}),
|
|
1426
|
-
[RequestType.TRADELINK_CREATE_CUSTODIAN]:
|
|
1427
|
-
type:
|
|
1434
|
+
[RequestType.TRADELINK_CREATE_CUSTODIAN]: z11.object({
|
|
1435
|
+
type: z11.literal(RequestType.TRADELINK_CREATE_CUSTODIAN),
|
|
1428
1436
|
data: zTradelinkCustodianRequestData
|
|
1429
1437
|
}),
|
|
1430
|
-
[RequestType.TRADELINK_EDIT_CUSTODIAN]:
|
|
1431
|
-
type:
|
|
1432
|
-
targetId:
|
|
1438
|
+
[RequestType.TRADELINK_EDIT_CUSTODIAN]: z11.object({
|
|
1439
|
+
type: z11.literal(RequestType.TRADELINK_EDIT_CUSTODIAN),
|
|
1440
|
+
targetId: z11.string(),
|
|
1433
1441
|
data: zTradelinkCustodianRequestData
|
|
1434
1442
|
}),
|
|
1435
|
-
[RequestType.TRADELINK_CREATE_EXCHANGE]:
|
|
1436
|
-
type:
|
|
1443
|
+
[RequestType.TRADELINK_CREATE_EXCHANGE]: z11.object({
|
|
1444
|
+
type: z11.literal(RequestType.TRADELINK_CREATE_EXCHANGE),
|
|
1437
1445
|
data: zTradelinkEntityRequestData
|
|
1438
1446
|
}),
|
|
1439
|
-
[RequestType.TRADELINK_EDIT_EXCHANGE]:
|
|
1440
|
-
type:
|
|
1441
|
-
targetId:
|
|
1447
|
+
[RequestType.TRADELINK_EDIT_EXCHANGE]: z11.object({
|
|
1448
|
+
type: z11.literal(RequestType.TRADELINK_EDIT_EXCHANGE),
|
|
1449
|
+
targetId: z11.string(),
|
|
1442
1450
|
data: zTradelinkEntityRequestData
|
|
1443
1451
|
}),
|
|
1444
|
-
[RequestType.TRADELINK_CREATE_ASSET_MANAGER]:
|
|
1445
|
-
type:
|
|
1452
|
+
[RequestType.TRADELINK_CREATE_ASSET_MANAGER]: z11.object({
|
|
1453
|
+
type: z11.literal(RequestType.TRADELINK_CREATE_ASSET_MANAGER),
|
|
1446
1454
|
data: zTradelinkEntityRequestData
|
|
1447
1455
|
}),
|
|
1448
|
-
[RequestType.TRADELINK_EDIT_ASSET_MANAGER]:
|
|
1449
|
-
type:
|
|
1450
|
-
targetId:
|
|
1456
|
+
[RequestType.TRADELINK_EDIT_ASSET_MANAGER]: z11.object({
|
|
1457
|
+
type: z11.literal(RequestType.TRADELINK_EDIT_ASSET_MANAGER),
|
|
1458
|
+
targetId: z11.string(),
|
|
1451
1459
|
data: zTradelinkEntityRequestData
|
|
1452
1460
|
}),
|
|
1453
|
-
[RequestType.TRADELINK_ADJUST_PLEDGE]:
|
|
1454
|
-
type:
|
|
1461
|
+
[RequestType.TRADELINK_ADJUST_PLEDGE]: z11.object({
|
|
1462
|
+
type: z11.literal(RequestType.TRADELINK_ADJUST_PLEDGE),
|
|
1455
1463
|
data: zTradelinkAdjustPledgeRequestData
|
|
1456
1464
|
}),
|
|
1457
|
-
[RequestType.TRADELINK_REPLEDGE]:
|
|
1458
|
-
type:
|
|
1465
|
+
[RequestType.TRADELINK_REPLEDGE]: z11.object({
|
|
1466
|
+
type: z11.literal(RequestType.TRADELINK_REPLEDGE),
|
|
1459
1467
|
data: zTradelinkRepledgeRequestData
|
|
1460
1468
|
}),
|
|
1461
|
-
[RequestType.TRADELINK_CREATE_SETTLEMENT]:
|
|
1462
|
-
type:
|
|
1469
|
+
[RequestType.TRADELINK_CREATE_SETTLEMENT]: z11.object({
|
|
1470
|
+
type: z11.literal(RequestType.TRADELINK_CREATE_SETTLEMENT),
|
|
1463
1471
|
data: zTradelinkCreateSettlementRequestData,
|
|
1464
|
-
meta:
|
|
1465
|
-
hash:
|
|
1472
|
+
meta: z11.object({
|
|
1473
|
+
hash: z11.string().nullable()
|
|
1466
1474
|
}).optional().nullable()
|
|
1467
1475
|
}),
|
|
1468
|
-
[RequestType.TRADELINK_FORCE_UNPLEDGE]:
|
|
1469
|
-
type:
|
|
1476
|
+
[RequestType.TRADELINK_FORCE_UNPLEDGE]: z11.object({
|
|
1477
|
+
type: z11.literal(RequestType.TRADELINK_FORCE_UNPLEDGE),
|
|
1470
1478
|
data: zTradelinkForceUnpledgeRequestData
|
|
1471
1479
|
}),
|
|
1472
|
-
[RequestType.TRADELINK_WITHDRAW]:
|
|
1473
|
-
type:
|
|
1480
|
+
[RequestType.TRADELINK_WITHDRAW]: z11.object({
|
|
1481
|
+
type: z11.literal(RequestType.TRADELINK_WITHDRAW),
|
|
1474
1482
|
data: zTradelinkWithdrawRequestData,
|
|
1475
|
-
meta:
|
|
1476
|
-
hash:
|
|
1483
|
+
meta: z11.object({
|
|
1484
|
+
hash: z11.string().nullable()
|
|
1477
1485
|
}).optional().nullable()
|
|
1478
1486
|
}),
|
|
1479
|
-
[RequestType.TRADELINK_ARBITRATE]:
|
|
1480
|
-
type:
|
|
1487
|
+
[RequestType.TRADELINK_ARBITRATE]: z11.object({
|
|
1488
|
+
type: z11.literal(RequestType.TRADELINK_ARBITRATE),
|
|
1481
1489
|
data: zTradelinkArbitrationRequestData,
|
|
1482
|
-
meta:
|
|
1483
|
-
hash:
|
|
1490
|
+
meta: z11.object({
|
|
1491
|
+
hash: z11.string().nullable()
|
|
1484
1492
|
}).optional().nullable()
|
|
1485
1493
|
})
|
|
1486
1494
|
};
|
|
1487
|
-
var zMessageType =
|
|
1495
|
+
var zMessageType = z11.enum(MessageType).meta({ description: "Type of the message to sign" });
|
|
1488
1496
|
var zMessageData = zHexString.nonempty().meta({
|
|
1489
1497
|
description: "Hex data to sign, either a json string for EIP712, or a raw string for EIP191"
|
|
1490
1498
|
});
|
|
1491
|
-
var zMessage =
|
|
1499
|
+
var zMessage = z11.object({
|
|
1492
1500
|
type: zMessageType,
|
|
1493
1501
|
data: zMessageData
|
|
1494
1502
|
});
|
|
1495
|
-
|
|
1496
|
-
id:
|
|
1503
|
+
z11.object({
|
|
1504
|
+
id: z11.string().meta({ description: "Unique identifier" }),
|
|
1497
1505
|
type: zMessageType,
|
|
1498
1506
|
data: zMessageData,
|
|
1499
|
-
address:
|
|
1500
|
-
derivationPath:
|
|
1507
|
+
address: z11.string().meta({ description: "Address of the signing key" }),
|
|
1508
|
+
derivationPath: z11.string().meta({ description: "Derivation path of the signing key" }),
|
|
1501
1509
|
signature: zHsmSignature.meta({ description: "Signature of the message" }),
|
|
1502
|
-
createdById:
|
|
1503
|
-
createdAt:
|
|
1510
|
+
createdById: z11.string().meta({ description: "ID of the creator" }),
|
|
1511
|
+
createdAt: z11.coerce.date().meta({ description: "Creation timestamp" })
|
|
1504
1512
|
}).meta({ description: "Signed message", id: "SignedMessageResponse" });
|
|
1505
|
-
var zCreateTransactionRequestData =
|
|
1506
|
-
accountId:
|
|
1513
|
+
var zCreateTransactionRequestData = z11.object({
|
|
1514
|
+
accountId: z11.string().min(1).meta({ description: "Target account id" }),
|
|
1507
1515
|
transaction: zTransactionData
|
|
1508
1516
|
}).meta({
|
|
1509
1517
|
description: "Create transaction request data",
|
|
1510
1518
|
id: "CreateTransactionRequestData"
|
|
1511
1519
|
});
|
|
1512
|
-
var zSignMessageRequestData =
|
|
1520
|
+
var zSignMessageRequestData = z11.object({
|
|
1513
1521
|
message: zMessage.meta({ description: "Message to sign" }),
|
|
1514
|
-
accountId:
|
|
1515
|
-
address:
|
|
1516
|
-
derivationPath:
|
|
1522
|
+
accountId: z11.string().min(1).meta({ description: "Target account id" }),
|
|
1523
|
+
address: z11.string().nonempty().meta({ description: "Address with which to sign the message" }),
|
|
1524
|
+
derivationPath: z11.string().nonempty().meta({ description: "Derivation path of the signing address" })
|
|
1517
1525
|
});
|
|
1518
1526
|
var zSignMessageUserInputData = zSignMessageRequestData.partial({
|
|
1519
1527
|
address: true,
|
|
1520
1528
|
derivationPath: true
|
|
1521
1529
|
});
|
|
1522
|
-
var zDigestData =
|
|
1530
|
+
var zDigestData = z11.object({
|
|
1523
1531
|
digest: zHexString.meta({ description: "The hex string digest to sign" }),
|
|
1524
|
-
derivationPath:
|
|
1532
|
+
derivationPath: z11.string().nonempty().meta({ description: "The derivation path with which to sign the digest" })
|
|
1525
1533
|
});
|
|
1526
|
-
var zSignDigestsRequestData =
|
|
1527
|
-
accountId:
|
|
1528
|
-
digests:
|
|
1534
|
+
var zSignDigestsRequestData = z11.object({
|
|
1535
|
+
accountId: z11.string().min(1).meta({ description: "Target account id" }),
|
|
1536
|
+
digests: z11.array(zDigestData).meta({ description: "The digests to sign" })
|
|
1529
1537
|
});
|
|
1530
|
-
|
|
1531
|
-
signatures:
|
|
1538
|
+
z11.object({
|
|
1539
|
+
signatures: z11.array(zHsmSignature)
|
|
1532
1540
|
});
|
|
1533
1541
|
|
|
1534
1542
|
// src/accounts/account-governance-fields.ts
|
|
@@ -1546,26 +1554,26 @@ var zTradelinkAccountGovernanceFields = z.object({
|
|
|
1546
1554
|
var zAccountGovernanceFields = z.discriminatedUnion("type", [zClassicAccountGovernanceFields, zTradelinkAccountGovernanceFields]).meta({ description: "Governance fields" });
|
|
1547
1555
|
|
|
1548
1556
|
// src/accounts/types.ts
|
|
1549
|
-
var zAccountCommonFields =
|
|
1550
|
-
id:
|
|
1551
|
-
legacyId:
|
|
1552
|
-
name:
|
|
1557
|
+
var zAccountCommonFields = z11.object({
|
|
1558
|
+
id: z11.string().meta({ description: "Internal unique identifier" }),
|
|
1559
|
+
legacyId: z11.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
|
|
1560
|
+
name: z11.string().meta({ description: "Name" }),
|
|
1553
1561
|
currency: zCurrencyString,
|
|
1554
1562
|
network: zNetwork,
|
|
1555
|
-
contractAddress:
|
|
1556
|
-
index:
|
|
1557
|
-
derivationPath:
|
|
1558
|
-
status:
|
|
1559
|
-
createdAt:
|
|
1560
|
-
updatedAt:
|
|
1561
|
-
});
|
|
1562
|
-
var zRawSigningAssetFields =
|
|
1563
|
-
var zAccountAssetFields =
|
|
1563
|
+
contractAddress: z11.string().nullable().meta({ description: "Token contract address for Token account" }),
|
|
1564
|
+
index: z11.number().gte(0).meta({ description: "BIP44 account index" }),
|
|
1565
|
+
derivationPath: z11.string().meta({ description: "Derivation path" }),
|
|
1566
|
+
status: z11.enum(ActivationStatus).meta({ description: "Status" }),
|
|
1567
|
+
createdAt: z11.coerce.date().meta({ description: "Creation timestamp" }),
|
|
1568
|
+
updatedAt: z11.coerce.date().meta({ description: "Last modification timestamp" })
|
|
1569
|
+
});
|
|
1570
|
+
var zRawSigningAssetFields = z11.object({ type: z11.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" }) }).meta({ description: "Raw signing account" });
|
|
1571
|
+
var zAccountAssetFields = z11.discriminatedUnion("type", [zRawSigningAssetFields, ...zNetworkAssetFields.options]).meta({ description: "Account asset fields" });
|
|
1564
1572
|
var zAccountResponse = zAccountCommonFields.extend({
|
|
1565
1573
|
asset: zAccountAssetFields,
|
|
1566
1574
|
governance: zAccountGovernanceFields
|
|
1567
1575
|
});
|
|
1568
|
-
|
|
1576
|
+
z11.enum([
|
|
1569
1577
|
"name",
|
|
1570
1578
|
"currency",
|
|
1571
1579
|
"index",
|
|
@@ -1573,42 +1581,42 @@ z10.enum([
|
|
|
1573
1581
|
"updatedAt"
|
|
1574
1582
|
]).default("createdAt");
|
|
1575
1583
|
var zRawSigningLiveData = zCommonLiveData.extend({
|
|
1576
|
-
type:
|
|
1584
|
+
type: z11.literal(AccountType.RAW_SIGNING).meta({ description: "Account type" })
|
|
1577
1585
|
}).meta({ description: "Raw signing account" });
|
|
1578
|
-
|
|
1586
|
+
z11.discriminatedUnion("type", [
|
|
1579
1587
|
zRawSigningLiveData,
|
|
1580
1588
|
...zAccountLiveData.options
|
|
1581
1589
|
]);
|
|
1582
|
-
|
|
1583
|
-
address:
|
|
1584
|
-
derivationPath:
|
|
1590
|
+
z11.object({
|
|
1591
|
+
address: z11.string().meta({ description: "Address" }),
|
|
1592
|
+
derivationPath: z11.string().nullable().meta({ description: "Derivation path" })
|
|
1585
1593
|
});
|
|
1586
|
-
|
|
1594
|
+
z11.object({
|
|
1587
1595
|
amount: zIntString.meta({ description: "Amount in the smallest unit of the currency" }),
|
|
1588
1596
|
currency: zCurrency
|
|
1589
1597
|
});
|
|
1590
|
-
|
|
1591
|
-
id:
|
|
1592
|
-
validator:
|
|
1593
|
-
state:
|
|
1594
|
-
staked:
|
|
1595
|
-
rewards:
|
|
1596
|
-
total:
|
|
1598
|
+
z11.object({
|
|
1599
|
+
id: z11.string().nonempty().meta({ description: "Staking position ID (if applicable)" }),
|
|
1600
|
+
validator: z11.string().nonempty().meta({ description: "Validator address" }),
|
|
1601
|
+
state: z11.enum(["ACTIVE", "INACTIVE", "ACTIVATING", "DEACTIVATING", "UNKNOWN"]).meta({ description: "Stake state" }),
|
|
1602
|
+
staked: z11.string().meta({ description: "Staked amount" }),
|
|
1603
|
+
rewards: z11.object({
|
|
1604
|
+
total: z11.string().meta({ description: "Total rewards" })
|
|
1597
1605
|
})
|
|
1598
1606
|
});
|
|
1599
|
-
|
|
1600
|
-
address:
|
|
1601
|
-
apy:
|
|
1602
|
-
balance:
|
|
1603
|
-
commissionRate:
|
|
1604
|
-
description:
|
|
1605
|
-
logo:
|
|
1606
|
-
name:
|
|
1607
|
-
url:
|
|
1607
|
+
z11.object({
|
|
1608
|
+
address: z11.string().meta({ description: "Validator address" }),
|
|
1609
|
+
apy: z11.string().nullable().meta({ description: "Validator APY" }),
|
|
1610
|
+
balance: z11.string().nullable().meta({ description: "Validator balance" }),
|
|
1611
|
+
commissionRate: z11.string().nullable().meta({ description: "Validator commission rate" }),
|
|
1612
|
+
description: z11.string().nullable().meta({ description: "Description" }),
|
|
1613
|
+
logo: z11.string().nullable().meta({ description: "Logo URL" }),
|
|
1614
|
+
name: z11.string().nullable().meta({ description: "Validator name" }),
|
|
1615
|
+
url: z11.string().nullable().meta({ description: "Validator URL" })
|
|
1608
1616
|
});
|
|
1609
1617
|
|
|
1610
1618
|
// src/accounts/app-types.ts
|
|
1611
|
-
|
|
1619
|
+
z11.discriminatedUnion(
|
|
1612
1620
|
zTransactionResponse._zod.def.discriminator,
|
|
1613
1621
|
ensureNonEmptyArray(
|
|
1614
1622
|
zTransactionResponse.options.map(
|
|
@@ -1618,29 +1626,29 @@ z10.discriminatedUnion(
|
|
|
1618
1626
|
)
|
|
1619
1627
|
)
|
|
1620
1628
|
);
|
|
1621
|
-
var zWhitelistAddress =
|
|
1622
|
-
name:
|
|
1629
|
+
var zWhitelistAddress = z11.object({
|
|
1630
|
+
name: z11.string().min(1).max(50),
|
|
1623
1631
|
currency: zCurrencyString,
|
|
1624
|
-
address:
|
|
1632
|
+
address: z11.string().min(1).max(200),
|
|
1625
1633
|
// Destination tags are numeric-only or alpha-numeric.
|
|
1626
1634
|
// Empty array (or undefined) means no check on destination tag.
|
|
1627
|
-
destinationTags:
|
|
1635
|
+
destinationTags: z11.array(z11.string().min(1).regex(/^\w+$/)).optional()
|
|
1628
1636
|
});
|
|
1629
|
-
var zWhitelistAddresses =
|
|
1630
|
-
var zWhitelistName =
|
|
1631
|
-
var zCreateWhitelistRequestData =
|
|
1637
|
+
var zWhitelistAddresses = z11.array(zWhitelistAddress);
|
|
1638
|
+
var zWhitelistName = z11.string().min(1).max(45).meta({ description: "Whitelist name" });
|
|
1639
|
+
var zCreateWhitelistRequestData = z11.object({
|
|
1632
1640
|
name: zWhitelistName,
|
|
1633
|
-
description:
|
|
1641
|
+
description: z11.string().nullable(),
|
|
1634
1642
|
addresses: zWhitelistAddresses,
|
|
1635
|
-
type:
|
|
1643
|
+
type: z11.enum(WhitelistType)
|
|
1636
1644
|
});
|
|
1637
|
-
var zEditWhitelistRequestData =
|
|
1645
|
+
var zEditWhitelistRequestData = z11.object({
|
|
1638
1646
|
name: zWhitelistName,
|
|
1639
1647
|
addresses: zWhitelistAddresses
|
|
1640
1648
|
});
|
|
1641
1649
|
|
|
1642
1650
|
// src/policies/db-utils.ts
|
|
1643
|
-
var zBaseGovRuleData =
|
|
1651
|
+
var zBaseGovRuleData = z11.object({
|
|
1644
1652
|
// Steps of users that will need to review operations
|
|
1645
1653
|
reviewSteps: zReviewStepsArray,
|
|
1646
1654
|
// Optional threshold on transaction value: null `min` = 0, null `max` = +inf
|
|
@@ -1657,86 +1665,86 @@ zBaseGovRuleData.extend({
|
|
|
1657
1665
|
({
|
|
1658
1666
|
reviewConfigs: { include: review_config_exports.INCLUDE_MEMBERS }
|
|
1659
1667
|
});
|
|
1660
|
-
var zPolicyName =
|
|
1661
|
-
var zCurrency2 =
|
|
1662
|
-
var zCreatePublicPolicyRequestData =
|
|
1668
|
+
var zPolicyName = z11.string().min(1).max(19).meta({ description: "Policy name" });
|
|
1669
|
+
var zCurrency2 = z11.string().min(1).max(40).regex(/^\w+$/).meta({ description: "Currency" });
|
|
1670
|
+
var zCreatePublicPolicyRequestData = z11.object({
|
|
1663
1671
|
name: zPolicyName,
|
|
1664
|
-
description:
|
|
1672
|
+
description: z11.string().nullable().meta({ description: "Description" }),
|
|
1665
1673
|
currency: zCurrency2.nullable(),
|
|
1666
|
-
govRules:
|
|
1674
|
+
govRules: z11.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
1667
1675
|
});
|
|
1668
|
-
var zEditPublicPolicyRequestData =
|
|
1676
|
+
var zEditPublicPolicyRequestData = z11.object({
|
|
1669
1677
|
name: zPolicyName,
|
|
1670
|
-
description:
|
|
1671
|
-
govRules:
|
|
1678
|
+
description: z11.string().nullable().meta({ description: "Description" }),
|
|
1679
|
+
govRules: z11.array(zClassicGovRuleData).meta({ description: "Governance rules" })
|
|
1672
1680
|
});
|
|
1673
|
-
var zAccountName =
|
|
1674
|
-
var zSignDigestsGovRuleData =
|
|
1675
|
-
operationType:
|
|
1681
|
+
var zAccountName = z11.string().min(1).max(40).meta({ description: "Account name" });
|
|
1682
|
+
var zSignDigestsGovRuleData = z11.object({
|
|
1683
|
+
operationType: z11.literal("SIGN_DIGESTS"),
|
|
1676
1684
|
reviewSteps: zReviewStepWithUsersArray
|
|
1677
1685
|
// we need to control for API users only
|
|
1678
1686
|
}).meta({ description: "Digest signing rule" });
|
|
1679
|
-
var zAccountPolicyRequestData =
|
|
1680
|
-
|
|
1681
|
-
|
|
1687
|
+
var zAccountPolicyRequestData = z11.union([
|
|
1688
|
+
z11.object({ policyId: z11.string() }).meta({ description: "Account policy" }),
|
|
1689
|
+
z11.object({ rules: z11.array(zClassicGovRuleData) }).meta({ description: "Account governance rules" })
|
|
1682
1690
|
]).meta({ description: "Account policy or governance rules" });
|
|
1683
|
-
var zCreateAccountGovernanceData =
|
|
1684
|
-
|
|
1685
|
-
type:
|
|
1691
|
+
var zCreateAccountGovernanceData = z11.discriminatedUnion("type", [
|
|
1692
|
+
z11.object({
|
|
1693
|
+
type: z11.literal(AccountGovernanceType.CLASSIC),
|
|
1686
1694
|
policy: zAccountPolicyRequestData
|
|
1687
1695
|
}).meta({ description: "Classic governance" }),
|
|
1688
|
-
|
|
1689
|
-
type:
|
|
1690
|
-
assetManagerId:
|
|
1696
|
+
z11.object({
|
|
1697
|
+
type: z11.literal(AccountGovernanceType.TRADELINK),
|
|
1698
|
+
assetManagerId: z11.string(),
|
|
1691
1699
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1692
1700
|
}).meta({ description: "Tradelink governance" }),
|
|
1693
|
-
|
|
1694
|
-
type:
|
|
1695
|
-
policy:
|
|
1701
|
+
z11.object({
|
|
1702
|
+
type: z11.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1703
|
+
policy: z11.object({ rules: z11.array(zSignDigestsGovRuleData) })
|
|
1696
1704
|
}).meta({ description: "Raw signing governance" })
|
|
1697
1705
|
]).meta({ description: "Governance fields" });
|
|
1698
|
-
var zCreateAccountUserInputData =
|
|
1706
|
+
var zCreateAccountUserInputData = z11.object({
|
|
1699
1707
|
name: zAccountName,
|
|
1700
1708
|
currency: zCurrencyString,
|
|
1701
1709
|
// "bitcoin"
|
|
1702
|
-
index:
|
|
1703
|
-
contractAddress:
|
|
1710
|
+
index: z11.number().nonnegative().optional().meta({ description: "Account index" }),
|
|
1711
|
+
contractAddress: z11.string().min(1).optional().meta({ description: "Account contract address" }),
|
|
1704
1712
|
governance: zCreateAccountGovernanceData
|
|
1705
1713
|
});
|
|
1706
1714
|
var zCreateAccountRequestData = zCreateAccountUserInputData.omit({ index: true }).extend({
|
|
1707
|
-
index:
|
|
1708
|
-
derivationPath:
|
|
1709
|
-
type:
|
|
1715
|
+
index: z11.number().nonnegative().meta({ description: "Account index" }),
|
|
1716
|
+
derivationPath: z11.string().meta({ description: "Account bip44 derivation path" }),
|
|
1717
|
+
type: z11.enum(AccountType)
|
|
1710
1718
|
// "BITCOIN_LIKE"
|
|
1711
1719
|
}).meta({
|
|
1712
1720
|
description: "Create account request data",
|
|
1713
1721
|
id: "CreateAccountRequestData"
|
|
1714
1722
|
});
|
|
1715
|
-
var zEditAccountGovernanceData =
|
|
1716
|
-
|
|
1717
|
-
type:
|
|
1723
|
+
var zEditAccountGovernanceData = z11.discriminatedUnion("type", [
|
|
1724
|
+
z11.object({
|
|
1725
|
+
type: z11.literal(AccountGovernanceType.CLASSIC),
|
|
1718
1726
|
policy: zAccountPolicyRequestData
|
|
1719
1727
|
}).meta({ description: "Classic governance" }),
|
|
1720
|
-
|
|
1721
|
-
type:
|
|
1728
|
+
z11.object({
|
|
1729
|
+
type: z11.literal(AccountGovernanceType.TRADELINK),
|
|
1722
1730
|
exchangeConfigs: zTradelinkExchangeConfigs
|
|
1723
1731
|
}).meta({ description: "Tradelink governance" }),
|
|
1724
|
-
|
|
1725
|
-
type:
|
|
1726
|
-
policy:
|
|
1732
|
+
z11.object({
|
|
1733
|
+
type: z11.literal(AccountGovernanceType.RAW_SIGNING),
|
|
1734
|
+
policy: z11.object({ rules: z11.array(zSignDigestsGovRuleData) })
|
|
1727
1735
|
}).meta({ description: "Raw signing governance" })
|
|
1728
1736
|
]).meta({ description: "Governance fields" });
|
|
1729
|
-
var zEditAccountRequestData =
|
|
1737
|
+
var zEditAccountRequestData = z11.object({
|
|
1730
1738
|
name: zAccountName,
|
|
1731
1739
|
governance: zEditAccountGovernanceData
|
|
1732
1740
|
}).meta({
|
|
1733
1741
|
description: "Edit account request data",
|
|
1734
1742
|
id: "EditAccountRequestData"
|
|
1735
1743
|
});
|
|
1736
|
-
var zEditTokenRuleRequestData =
|
|
1737
|
-
parentAccountId:
|
|
1738
|
-
contractAddress:
|
|
1739
|
-
rules:
|
|
1744
|
+
var zEditTokenRuleRequestData = z11.object({
|
|
1745
|
+
parentAccountId: z11.string().min(1).meta({ description: "Parent account unique ID" }),
|
|
1746
|
+
contractAddress: z11.string().min(1).meta({ description: "Token contract address" }),
|
|
1747
|
+
rules: z11.array(zClassicGovRuleData).meta({ description: "Account governance rules" })
|
|
1740
1748
|
});
|
|
1741
1749
|
|
|
1742
1750
|
// src/accounts/app-utils.ts
|
|
@@ -1748,13 +1756,6 @@ var getAccountAssetFields = (account) => {
|
|
|
1748
1756
|
xpub: account.xpub
|
|
1749
1757
|
};
|
|
1750
1758
|
case AccountType.ETHEREUM_LIKE:
|
|
1751
|
-
return {
|
|
1752
|
-
type: account.type,
|
|
1753
|
-
address: account.address
|
|
1754
|
-
};
|
|
1755
|
-
case AccountType.ERC20_LIKE:
|
|
1756
|
-
case AccountType.BEP20_LIKE:
|
|
1757
|
-
case AccountType.TRC20_LIKE:
|
|
1758
1759
|
return {
|
|
1759
1760
|
type: account.type,
|
|
1760
1761
|
address: account.address,
|
|
@@ -1799,13 +1800,19 @@ var getAccountAssetFields = (account) => {
|
|
|
1799
1800
|
case AccountType.TRON_LIKE:
|
|
1800
1801
|
return {
|
|
1801
1802
|
type: account.type,
|
|
1802
|
-
address: account.address
|
|
1803
|
+
address: account.address,
|
|
1804
|
+
contractAddress: account.contractAddress
|
|
1803
1805
|
};
|
|
1804
1806
|
case AccountType.GENERIC_LIKE:
|
|
1805
1807
|
case AccountType.RAW_SIGNING:
|
|
1806
1808
|
return {
|
|
1807
1809
|
type: account.type
|
|
1808
1810
|
};
|
|
1811
|
+
case AccountType.CANTON_LIKE:
|
|
1812
|
+
return {
|
|
1813
|
+
type: account.type,
|
|
1814
|
+
address: account.address
|
|
1815
|
+
};
|
|
1809
1816
|
/* v8 ignore start */
|
|
1810
1817
|
default:
|
|
1811
1818
|
unreachable(account.type);
|
|
@@ -1866,15 +1873,15 @@ var patchTezosRequestData = (data) => {
|
|
|
1866
1873
|
}
|
|
1867
1874
|
return data;
|
|
1868
1875
|
};
|
|
1869
|
-
var zSciConfigData =
|
|
1870
|
-
dapps:
|
|
1871
|
-
customContractCallEnabled:
|
|
1876
|
+
var zSciConfigData = z11.object({
|
|
1877
|
+
dapps: z11.array(z11.string()).nullable().meta({ description: "Allowed DApps, null allows all" }),
|
|
1878
|
+
customContractCallEnabled: z11.boolean().meta({ description: "Allow non-DApp SCI" })
|
|
1872
1879
|
});
|
|
1873
|
-
var zCreateSciConfigRequestData =
|
|
1874
|
-
account:
|
|
1880
|
+
var zCreateSciConfigRequestData = z11.object({
|
|
1881
|
+
account: z11.string().meta({ description: "Account UUID" }),
|
|
1875
1882
|
config: zSciConfigData
|
|
1876
1883
|
});
|
|
1877
|
-
var zEditSciConfigRequestData =
|
|
1884
|
+
var zEditSciConfigRequestData = z11.object({
|
|
1878
1885
|
config: zSciConfigData
|
|
1879
1886
|
});
|
|
1880
1887
|
var zRequestReviewStep = z.object({
|
|
@@ -1882,165 +1889,165 @@ var zRequestReviewStep = z.object({
|
|
|
1882
1889
|
quorum: z.int().min(1).meta({ description: "Quorum for the review step" })
|
|
1883
1890
|
});
|
|
1884
1891
|
var zRequestReviewSteps = z.array(zRequestReviewStep);
|
|
1885
|
-
var zGroupName =
|
|
1886
|
-
var zCreateGroupRequestData =
|
|
1892
|
+
var zGroupName = z11.string().min(1).max(19).meta({ description: "Group name" });
|
|
1893
|
+
var zCreateGroupRequestData = z11.object({
|
|
1887
1894
|
name: zGroupName,
|
|
1888
|
-
description:
|
|
1889
|
-
members:
|
|
1895
|
+
description: z11.string().nullable().meta({ description: "Group description" }),
|
|
1896
|
+
members: z11.array(z11.string()).meta({ description: "List of group members ids" })
|
|
1890
1897
|
});
|
|
1891
|
-
var zEditGroupRequestData =
|
|
1898
|
+
var zEditGroupRequestData = z11.object({
|
|
1892
1899
|
name: zGroupName,
|
|
1893
|
-
description:
|
|
1894
|
-
members:
|
|
1900
|
+
description: z11.string().nullable().meta({ description: "Group description" }),
|
|
1901
|
+
members: z11.array(z11.string()).meta({ description: "List of group members ids" })
|
|
1895
1902
|
});
|
|
1896
|
-
var zApiKeyName =
|
|
1897
|
-
var zCreateApiKeyRequestData =
|
|
1903
|
+
var zApiKeyName = z11.string().min(1).max(19).meta({ description: "API key name" });
|
|
1904
|
+
var zCreateApiKeyRequestData = z11.object({
|
|
1898
1905
|
name: zApiKeyName,
|
|
1899
|
-
entities:
|
|
1900
|
-
scopes:
|
|
1906
|
+
entities: z11.array(z11.string()).meta({ description: "List of related entities ids" }),
|
|
1907
|
+
scopes: z11.object({}).meta({ description: "FIXME to be precised" })
|
|
1901
1908
|
}).meta({ description: "Create read-only API key request data" });
|
|
1902
1909
|
var zEditApiKeyRequestData = zCreateApiKeyRequestData.meta({
|
|
1903
1910
|
description: "Edit read-only API key request data"
|
|
1904
1911
|
});
|
|
1905
|
-
var zEntityName =
|
|
1906
|
-
var zCreateEntityRequestData =
|
|
1912
|
+
var zEntityName = z11.string().min(1).max(19).meta({ description: "Entity name" });
|
|
1913
|
+
var zCreateEntityRequestData = z11.object({
|
|
1907
1914
|
name: zEntityName,
|
|
1908
|
-
accounts:
|
|
1915
|
+
accounts: z11.array(z11.string())
|
|
1909
1916
|
});
|
|
1910
|
-
var zEditEntityRequestData =
|
|
1917
|
+
var zEditEntityRequestData = z11.object({
|
|
1911
1918
|
name: zEntityName,
|
|
1912
|
-
accounts:
|
|
1919
|
+
accounts: z11.array(z11.string())
|
|
1913
1920
|
});
|
|
1914
1921
|
|
|
1915
1922
|
// src/requests/request-data.ts
|
|
1916
1923
|
var zVaultRequestMixinsByType = {
|
|
1917
1924
|
// Workspaces
|
|
1918
|
-
[RequestType.UPDATE_QUORUM]:
|
|
1919
|
-
type:
|
|
1925
|
+
[RequestType.UPDATE_QUORUM]: z11.object({
|
|
1926
|
+
type: z11.literal(RequestType.UPDATE_QUORUM),
|
|
1920
1927
|
data: zUpdateQuorumRequestData
|
|
1921
1928
|
}),
|
|
1922
1929
|
// Operator requests
|
|
1923
|
-
[RequestType.CREATE_TRANSACTION]:
|
|
1924
|
-
type:
|
|
1930
|
+
[RequestType.CREATE_TRANSACTION]: z11.object({
|
|
1931
|
+
type: z11.literal(RequestType.CREATE_TRANSACTION),
|
|
1925
1932
|
data: zCreateTransactionRequestData,
|
|
1926
|
-
meta:
|
|
1927
|
-
hash:
|
|
1933
|
+
meta: z11.object({
|
|
1934
|
+
hash: z11.string().nullable()
|
|
1928
1935
|
}).optional().nullable()
|
|
1929
1936
|
}),
|
|
1930
|
-
[RequestType.SIGN_MESSAGE]:
|
|
1931
|
-
type:
|
|
1937
|
+
[RequestType.SIGN_MESSAGE]: z11.object({
|
|
1938
|
+
type: z11.literal(RequestType.SIGN_MESSAGE),
|
|
1932
1939
|
data: zSignMessageRequestData
|
|
1933
1940
|
}),
|
|
1934
|
-
[RequestType.SIGN_DIGESTS]:
|
|
1935
|
-
type:
|
|
1941
|
+
[RequestType.SIGN_DIGESTS]: z11.object({
|
|
1942
|
+
type: z11.literal(RequestType.SIGN_DIGESTS),
|
|
1936
1943
|
data: zSignDigestsRequestData
|
|
1937
1944
|
}),
|
|
1938
1945
|
// Accounts
|
|
1939
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
1940
|
-
type:
|
|
1946
|
+
[RequestType.CREATE_ACCOUNT]: z11.object({
|
|
1947
|
+
type: z11.literal(RequestType.CREATE_ACCOUNT),
|
|
1941
1948
|
data: zCreateAccountRequestData
|
|
1942
1949
|
}),
|
|
1943
|
-
[RequestType.EDIT_ACCOUNT]:
|
|
1944
|
-
type:
|
|
1945
|
-
targetId:
|
|
1950
|
+
[RequestType.EDIT_ACCOUNT]: z11.object({
|
|
1951
|
+
type: z11.literal(RequestType.EDIT_ACCOUNT),
|
|
1952
|
+
targetId: z11.string(),
|
|
1946
1953
|
data: zEditAccountRequestData
|
|
1947
1954
|
}),
|
|
1948
|
-
[RequestType.EDIT_TOKEN_RULE]:
|
|
1949
|
-
type:
|
|
1950
|
-
targetId:
|
|
1955
|
+
[RequestType.EDIT_TOKEN_RULE]: z11.object({
|
|
1956
|
+
type: z11.literal(RequestType.EDIT_TOKEN_RULE),
|
|
1957
|
+
targetId: z11.string(),
|
|
1951
1958
|
data: zEditTokenRuleRequestData
|
|
1952
1959
|
}),
|
|
1953
1960
|
// Groups
|
|
1954
|
-
[RequestType.CREATE_GROUP]:
|
|
1955
|
-
type:
|
|
1961
|
+
[RequestType.CREATE_GROUP]: z11.object({
|
|
1962
|
+
type: z11.literal(RequestType.CREATE_GROUP),
|
|
1956
1963
|
data: zCreateGroupRequestData
|
|
1957
1964
|
}),
|
|
1958
|
-
[RequestType.EDIT_GROUP]:
|
|
1959
|
-
type:
|
|
1960
|
-
targetId:
|
|
1965
|
+
[RequestType.EDIT_GROUP]: z11.object({
|
|
1966
|
+
type: z11.literal(RequestType.EDIT_GROUP),
|
|
1967
|
+
targetId: z11.string(),
|
|
1961
1968
|
data: zEditGroupRequestData
|
|
1962
1969
|
}),
|
|
1963
|
-
[RequestType.REVOKE_GROUP]:
|
|
1964
|
-
type:
|
|
1965
|
-
targetId:
|
|
1970
|
+
[RequestType.REVOKE_GROUP]: z11.object({
|
|
1971
|
+
type: z11.literal(RequestType.REVOKE_GROUP),
|
|
1972
|
+
targetId: z11.string(),
|
|
1966
1973
|
data: zRevokeUserRequestData
|
|
1967
1974
|
}),
|
|
1968
1975
|
// Whitelists
|
|
1969
|
-
[RequestType.CREATE_WHITELIST]:
|
|
1970
|
-
type:
|
|
1976
|
+
[RequestType.CREATE_WHITELIST]: z11.object({
|
|
1977
|
+
type: z11.literal(RequestType.CREATE_WHITELIST),
|
|
1971
1978
|
data: zCreateWhitelistRequestData
|
|
1972
1979
|
}),
|
|
1973
|
-
[RequestType.EDIT_WHITELIST]:
|
|
1974
|
-
type:
|
|
1975
|
-
targetId:
|
|
1980
|
+
[RequestType.EDIT_WHITELIST]: z11.object({
|
|
1981
|
+
type: z11.literal(RequestType.EDIT_WHITELIST),
|
|
1982
|
+
targetId: z11.string(),
|
|
1976
1983
|
data: zEditWhitelistRequestData
|
|
1977
1984
|
}),
|
|
1978
1985
|
// Entities
|
|
1979
|
-
[RequestType.CREATE_ENTITY]:
|
|
1980
|
-
type:
|
|
1986
|
+
[RequestType.CREATE_ENTITY]: z11.object({
|
|
1987
|
+
type: z11.literal(RequestType.CREATE_ENTITY),
|
|
1981
1988
|
data: zCreateEntityRequestData
|
|
1982
1989
|
}),
|
|
1983
|
-
[RequestType.EDIT_ENTITY]:
|
|
1984
|
-
type:
|
|
1990
|
+
[RequestType.EDIT_ENTITY]: z11.object({
|
|
1991
|
+
type: z11.literal(RequestType.EDIT_ENTITY),
|
|
1985
1992
|
data: zEditEntityRequestData
|
|
1986
1993
|
}),
|
|
1987
|
-
[RequestType.REVOKE_ENTITY]:
|
|
1988
|
-
type:
|
|
1989
|
-
data:
|
|
1994
|
+
[RequestType.REVOKE_ENTITY]: z11.object({
|
|
1995
|
+
type: z11.literal(RequestType.REVOKE_ENTITY),
|
|
1996
|
+
data: z11.object({})
|
|
1990
1997
|
}),
|
|
1991
1998
|
// Users
|
|
1992
|
-
[RequestType.CREATE_PSD_USER]:
|
|
1993
|
-
type:
|
|
1999
|
+
[RequestType.CREATE_PSD_USER]: z11.object({
|
|
2000
|
+
type: z11.literal(RequestType.CREATE_PSD_USER),
|
|
1994
2001
|
data: zCreatePsdUserRequestData
|
|
1995
2002
|
}),
|
|
1996
|
-
[RequestType.CREATE_API_USER]:
|
|
1997
|
-
type:
|
|
2003
|
+
[RequestType.CREATE_API_USER]: z11.object({
|
|
2004
|
+
type: z11.literal(RequestType.CREATE_API_USER),
|
|
1998
2005
|
data: zCreateApiUserRequestData
|
|
1999
2006
|
}),
|
|
2000
|
-
[RequestType.CREATE_API_USER_ACCESS]:
|
|
2001
|
-
type:
|
|
2007
|
+
[RequestType.CREATE_API_USER_ACCESS]: z11.object({
|
|
2008
|
+
type: z11.literal(RequestType.CREATE_API_USER_ACCESS),
|
|
2002
2009
|
data: zCreateApiUserAccessRequestData
|
|
2003
2010
|
}),
|
|
2004
|
-
[RequestType.REVOKE_USER]:
|
|
2005
|
-
type:
|
|
2006
|
-
targetId:
|
|
2011
|
+
[RequestType.REVOKE_USER]: z11.object({
|
|
2012
|
+
type: z11.literal(RequestType.REVOKE_USER),
|
|
2013
|
+
targetId: z11.string(),
|
|
2007
2014
|
data: zRevokeUserRequestData
|
|
2008
2015
|
}),
|
|
2009
2016
|
// Admin gov rules
|
|
2010
|
-
[RequestType.EDIT_WORKSPACE_RULE]:
|
|
2011
|
-
type:
|
|
2017
|
+
[RequestType.EDIT_WORKSPACE_RULE]: z11.object({
|
|
2018
|
+
type: z11.literal(RequestType.EDIT_WORKSPACE_RULE),
|
|
2012
2019
|
data: zWorkspaceRuleRequestData
|
|
2013
2020
|
}),
|
|
2014
2021
|
// SCI configs
|
|
2015
|
-
[RequestType.CREATE_SCICONFIG]:
|
|
2016
|
-
type:
|
|
2022
|
+
[RequestType.CREATE_SCICONFIG]: z11.object({
|
|
2023
|
+
type: z11.literal(RequestType.CREATE_SCICONFIG),
|
|
2017
2024
|
data: zCreateSciConfigRequestData
|
|
2018
2025
|
}),
|
|
2019
|
-
[RequestType.EDIT_SCICONFIG]:
|
|
2020
|
-
type:
|
|
2026
|
+
[RequestType.EDIT_SCICONFIG]: z11.object({
|
|
2027
|
+
type: z11.literal(RequestType.EDIT_SCICONFIG),
|
|
2021
2028
|
data: zEditSciConfigRequestData
|
|
2022
2029
|
}),
|
|
2023
2030
|
// API keys
|
|
2024
|
-
[RequestType.CREATE_API_KEY]:
|
|
2025
|
-
type:
|
|
2031
|
+
[RequestType.CREATE_API_KEY]: z11.object({
|
|
2032
|
+
type: z11.literal(RequestType.CREATE_API_KEY),
|
|
2026
2033
|
data: zCreateApiKeyRequestData
|
|
2027
2034
|
}),
|
|
2028
|
-
[RequestType.EDIT_API_KEY]:
|
|
2029
|
-
type:
|
|
2035
|
+
[RequestType.EDIT_API_KEY]: z11.object({
|
|
2036
|
+
type: z11.literal(RequestType.EDIT_API_KEY),
|
|
2030
2037
|
data: zEditApiKeyRequestData
|
|
2031
2038
|
}),
|
|
2032
|
-
[RequestType.REVOKE_API_KEY]:
|
|
2033
|
-
type:
|
|
2034
|
-
data:
|
|
2039
|
+
[RequestType.REVOKE_API_KEY]: z11.object({
|
|
2040
|
+
type: z11.literal(RequestType.REVOKE_API_KEY),
|
|
2041
|
+
data: z11.object({})
|
|
2035
2042
|
}),
|
|
2036
2043
|
// Policies
|
|
2037
|
-
[RequestType.CREATE_POLICY]:
|
|
2038
|
-
type:
|
|
2044
|
+
[RequestType.CREATE_POLICY]: z11.object({
|
|
2045
|
+
type: z11.literal(RequestType.CREATE_POLICY),
|
|
2039
2046
|
data: zCreatePublicPolicyRequestData
|
|
2040
2047
|
}),
|
|
2041
|
-
[RequestType.EDIT_POLICY]:
|
|
2042
|
-
type:
|
|
2043
|
-
targetId:
|
|
2048
|
+
[RequestType.EDIT_POLICY]: z11.object({
|
|
2049
|
+
type: z11.literal(RequestType.EDIT_POLICY),
|
|
2050
|
+
targetId: z11.string(),
|
|
2044
2051
|
data: zEditPublicPolicyRequestData
|
|
2045
2052
|
}),
|
|
2046
2053
|
// Tradelink-related requests
|
|
@@ -2048,34 +2055,34 @@ var zVaultRequestMixinsByType = {
|
|
|
2048
2055
|
};
|
|
2049
2056
|
|
|
2050
2057
|
// src/requests/app-types.ts
|
|
2051
|
-
var zRequestReviewResponse =
|
|
2058
|
+
var zRequestReviewResponse = z11.object({
|
|
2052
2059
|
// Note: Do NOT include `quorum` as it is already available in the request's `reviewSteps` field.
|
|
2053
|
-
stepIndex:
|
|
2054
|
-
userId:
|
|
2055
|
-
status:
|
|
2056
|
-
createdAt:
|
|
2057
|
-
updatedAt:
|
|
2058
|
-
});
|
|
2059
|
-
var zVaultRequestCommonMixin =
|
|
2060
|
-
id:
|
|
2061
|
-
legacyId:
|
|
2062
|
-
state:
|
|
2060
|
+
stepIndex: z11.number().int().meta({ description: "Index of the governance step in the request workflow" }),
|
|
2061
|
+
userId: z11.string().meta({ description: "Reviewer id" }),
|
|
2062
|
+
status: z11.enum(RequestReviewStatus).meta({ description: "Review status" }),
|
|
2063
|
+
createdAt: z11.coerce.date().meta({ description: "Created date" }),
|
|
2064
|
+
updatedAt: z11.coerce.date().meta({ description: "Updated date" })
|
|
2065
|
+
});
|
|
2066
|
+
var zVaultRequestCommonMixin = z11.object({
|
|
2067
|
+
id: z11.string().meta({ description: "Request unique identifier" }),
|
|
2068
|
+
legacyId: z11.number().meta({ description: "Legacy internal unique identifier (for retro-compatibility)" }),
|
|
2069
|
+
state: z11.enum(RequestState).meta({ description: "Request state" }),
|
|
2063
2070
|
reviewSteps: zRequestReviewSteps.meta({ description: "Request review steps" }),
|
|
2064
|
-
currentStepIndex:
|
|
2065
|
-
expiresAt:
|
|
2066
|
-
expiredAt:
|
|
2067
|
-
targetId:
|
|
2071
|
+
currentStepIndex: z11.number().int().min(0).meta({ description: "Index of the current approval step" }),
|
|
2072
|
+
expiresAt: z11.coerce.date().meta({ description: "Request expiration date" }),
|
|
2073
|
+
expiredAt: z11.coerce.date().optional().meta({ description: "Deprecated: use expiresAt" }),
|
|
2074
|
+
targetId: z11.string().nullable().meta({ description: "Optional ID of the target object" }),
|
|
2068
2075
|
note: zNote.nullable().meta({ description: "Optional request note" }),
|
|
2069
|
-
reviews:
|
|
2076
|
+
reviews: z11.array(zRequestReviewResponse).meta({ description: "Requests reviews" }),
|
|
2070
2077
|
// `type` and `data` are correlated -- See `zVaultRequestMixinsByType`
|
|
2071
|
-
createdAt:
|
|
2072
|
-
updatedAt:
|
|
2073
|
-
createdById:
|
|
2078
|
+
createdAt: z11.coerce.date().meta({ description: "Creation timestamp" }),
|
|
2079
|
+
updatedAt: z11.coerce.date().meta({ description: "Last modification timestamp" }),
|
|
2080
|
+
createdById: z11.string().meta({ description: "ID of the user who created the request" }),
|
|
2074
2081
|
// `inflight` is fetched from ONGOING RequestSaga
|
|
2075
|
-
inflight:
|
|
2076
|
-
lastError:
|
|
2077
|
-
numFailed:
|
|
2078
|
-
retryAfter:
|
|
2082
|
+
inflight: z11.object({
|
|
2083
|
+
lastError: z11.string().nullable().meta({ description: "Error message from the last failure" }),
|
|
2084
|
+
numFailed: z11.number().int().meta({ description: "Number of failures so far" }),
|
|
2085
|
+
retryAfter: z11.coerce.date().meta({ description: "Date after which next retry is scheduled" })
|
|
2079
2086
|
}).optional().meta({ description: "Extra information if the request is currently being processed" })
|
|
2080
2087
|
});
|
|
2081
2088
|
var allowedRequestCreationInputByType = {
|
|
@@ -2087,14 +2094,14 @@ var allowedRequestCreationInputByType = {
|
|
|
2087
2094
|
[RequestType.CREATE_WHITELIST]: zVaultRequestMixinsByType[RequestType.CREATE_WHITELIST],
|
|
2088
2095
|
[RequestType.EDIT_WHITELIST]: zVaultRequestMixinsByType[RequestType.EDIT_WHITELIST],
|
|
2089
2096
|
[RequestType.CREATE_TRANSACTION]: zVaultRequestMixinsByType[RequestType.CREATE_TRANSACTION],
|
|
2090
|
-
[RequestType.SIGN_MESSAGE]:
|
|
2091
|
-
type:
|
|
2097
|
+
[RequestType.SIGN_MESSAGE]: z11.object({
|
|
2098
|
+
type: z11.literal(RequestType.SIGN_MESSAGE),
|
|
2092
2099
|
data: zSignMessageUserInputData
|
|
2093
2100
|
}),
|
|
2094
2101
|
[RequestType.CREATE_POLICY]: zVaultRequestMixinsByType[RequestType.CREATE_POLICY],
|
|
2095
2102
|
[RequestType.EDIT_POLICY]: zVaultRequestMixinsByType[RequestType.EDIT_POLICY],
|
|
2096
|
-
[RequestType.CREATE_ACCOUNT]:
|
|
2097
|
-
type:
|
|
2103
|
+
[RequestType.CREATE_ACCOUNT]: z11.object({
|
|
2104
|
+
type: z11.literal(RequestType.CREATE_ACCOUNT),
|
|
2098
2105
|
data: zCreateAccountUserInputData
|
|
2099
2106
|
}),
|
|
2100
2107
|
[RequestType.EDIT_ACCOUNT]: zVaultRequestMixinsByType[RequestType.EDIT_ACCOUNT],
|
|
@@ -2114,11 +2121,11 @@ var allowedRequestCreationInputByType = {
|
|
|
2114
2121
|
[RequestType.REVOKE_USER]: zVaultRequestMixinsByType[RequestType.REVOKE_USER],
|
|
2115
2122
|
[RequestType.EDIT_WORKSPACE_RULE]: zVaultRequestMixinsByType[RequestType.EDIT_WORKSPACE_RULE]
|
|
2116
2123
|
};
|
|
2117
|
-
var zRequestCreationInputCommonMixin =
|
|
2124
|
+
var zRequestCreationInputCommonMixin = z11.object({
|
|
2118
2125
|
note: zNote.optional().meta({ description: "Optional request note" })
|
|
2119
2126
|
});
|
|
2120
|
-
|
|
2121
|
-
request:
|
|
2127
|
+
z11.object({
|
|
2128
|
+
request: z11.discriminatedUnion(
|
|
2122
2129
|
"type",
|
|
2123
2130
|
ensureNonEmptyArray(
|
|
2124
2131
|
Object.values(allowedRequestCreationInputByType).map((_) => {
|
|
@@ -2130,7 +2137,7 @@ z10.object({
|
|
|
2130
2137
|
)
|
|
2131
2138
|
)
|
|
2132
2139
|
});
|
|
2133
|
-
var zVaultRequestResponse =
|
|
2140
|
+
var zVaultRequestResponse = z11.discriminatedUnion(
|
|
2134
2141
|
"type",
|
|
2135
2142
|
ensureNonEmptyArray(
|
|
2136
2143
|
Object.values(zVaultRequestMixinsByType).map((_) => {
|
|
@@ -2144,14 +2151,14 @@ var zVaultRequestResponse = z10.discriminatedUnion(
|
|
|
2144
2151
|
description: "Vault request response data",
|
|
2145
2152
|
id: "VaultRequestResponse"
|
|
2146
2153
|
});
|
|
2147
|
-
|
|
2154
|
+
z11.enum([
|
|
2148
2155
|
"state",
|
|
2149
2156
|
"expiresAt",
|
|
2150
2157
|
"createdAt",
|
|
2151
2158
|
"updatedAt"
|
|
2152
2159
|
]).default("createdAt");
|
|
2153
|
-
|
|
2154
|
-
pubKey:
|
|
2160
|
+
z11.object({
|
|
2161
|
+
pubKey: z11.string().meta({ description: "Public key of the current user" }),
|
|
2155
2162
|
challenge: zUserChallenge.meta({
|
|
2156
2163
|
description: "Challenge data to sign with the user's private key"
|
|
2157
2164
|
})
|
|
@@ -2323,19 +2330,27 @@ var genAssetFieldsForType = (type) => {
|
|
|
2323
2330
|
hsmChainCode
|
|
2324
2331
|
};
|
|
2325
2332
|
case "ETHEREUM_LIKE":
|
|
2326
|
-
// fall-through...
|
|
2327
|
-
case "ERC20_LIKE":
|
|
2328
|
-
case "BEP20_LIKE":
|
|
2329
2333
|
return {
|
|
2330
2334
|
type,
|
|
2331
|
-
currency:
|
|
2335
|
+
currency: faker.helpers.arrayElement(["ethereum", "ethereum_goerli"]),
|
|
2332
2336
|
derivationPath: "44'/60'/0'",
|
|
2333
2337
|
address: faker.finance.ethereumAddress(),
|
|
2334
|
-
contractAddress:
|
|
2338
|
+
contractAddress: null,
|
|
2335
2339
|
xpub: null,
|
|
2336
2340
|
hsmXpub,
|
|
2337
2341
|
hsmChainCode
|
|
2338
2342
|
};
|
|
2343
|
+
case "CANTON_LIKE":
|
|
2344
|
+
return {
|
|
2345
|
+
type,
|
|
2346
|
+
currency: "canton",
|
|
2347
|
+
derivationPath: "44'/6767'/0'/0'/0'",
|
|
2348
|
+
address: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2349
|
+
contractAddress: null,
|
|
2350
|
+
xpub: null,
|
|
2351
|
+
hsmXpub,
|
|
2352
|
+
hsmChainCode: null
|
|
2353
|
+
};
|
|
2339
2354
|
case "CARDANO_LIKE":
|
|
2340
2355
|
return {
|
|
2341
2356
|
type,
|
|
@@ -2402,17 +2417,6 @@ var genAssetFieldsForType = (type) => {
|
|
|
2402
2417
|
hsmXpub,
|
|
2403
2418
|
hsmChainCode: null
|
|
2404
2419
|
};
|
|
2405
|
-
case "TRC20_LIKE":
|
|
2406
|
-
return {
|
|
2407
|
-
type,
|
|
2408
|
-
currency: faker.helpers.arrayElement(["tron"]),
|
|
2409
|
-
derivationPath: "44'/195'/0'",
|
|
2410
|
-
address: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2411
|
-
contractAddress: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2412
|
-
xpub: null,
|
|
2413
|
-
hsmXpub,
|
|
2414
|
-
hsmChainCode
|
|
2415
|
-
};
|
|
2416
2420
|
case "TRON_LIKE":
|
|
2417
2421
|
return {
|
|
2418
2422
|
type,
|
|
@@ -2430,7 +2434,7 @@ var genAssetFieldsForType = (type) => {
|
|
|
2430
2434
|
currency: faker.helpers.arrayElement(["sui"]),
|
|
2431
2435
|
derivationPath: "44'/784'/0'",
|
|
2432
2436
|
address: faker.string.alphanumeric({ length: 34, casing: "mixed" }),
|
|
2433
|
-
contractAddress:
|
|
2437
|
+
contractAddress: null,
|
|
2434
2438
|
xpub: null,
|
|
2435
2439
|
hsmXpub,
|
|
2436
2440
|
hsmChainCode: null
|