@trinaryex/sdk 3.9.0 → 4.0.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/DESIGN.md +253 -71
- package/README.md +218 -16
- package/dist/ReadOnlyClient.d.ts +42 -8
- package/dist/TriexClient.d.ts +73 -8
- package/dist/armature/OrgClient.d.ts +372 -0
- package/dist/armature/OrgClientGroups.d.ts +186 -0
- package/dist/armature/OrgsApi.d.ts +69 -0
- package/dist/armature/actions.d.ts +75 -0
- package/dist/armature/create.d.ts +27 -0
- package/dist/armature/currency.d.ts +64 -0
- package/dist/armature/executors.d.ts +44 -0
- package/dist/armature/governance.d.ts +194 -0
- package/dist/armature/harness.d.ts +96 -0
- package/dist/armature/lifecycle.d.ts +84 -0
- package/dist/armature/plan.d.ts +39 -0
- package/dist/armature/proposals.d.ts +51 -0
- package/dist/armature/queries.d.ts +16 -0
- package/dist/armature/schemas.d.ts +559 -0
- package/dist/armature/trading.d.ts +114 -0
- package/dist/armature/transactions.d.ts +160 -0
- package/dist/armature/treasury.d.ts +41 -0
- package/dist/armature/tree.d.ts +13 -0
- package/dist/armature/types.d.ts +59 -0
- package/dist/armature/upgrade.d.ts +27 -0
- package/dist/armature/vault.d.ts +94 -0
- package/dist/coins/CoinsApi.d.ts +53 -0
- package/dist/coins/funding.d.ts +6 -0
- package/dist/coins/money.d.ts +36 -0
- package/dist/coins/onchain.d.ts +162 -0
- package/dist/coins/schemas.d.ts +456 -0
- package/dist/coins/transactions.d.ts +82 -0
- package/dist/coins/types.d.ts +115 -0
- package/dist/errors.d.ts +11 -1
- package/dist/funding.d.ts +2 -2
- package/dist/http.d.ts +3 -0
- package/dist/index.d.ts +63 -8
- package/dist/index.js +10587 -959
- package/dist/money.d.ts +15 -0
- package/dist/moveAbort.d.ts +28 -0
- package/dist/moveAbortCatalog.generated.d.ts +9 -0
- package/dist/onchain.d.ts +55 -3
- package/dist/paging.d.ts +9 -3
- package/dist/queries.d.ts +35 -7
- package/dist/schemas.d.ts +1911 -50
- package/dist/transactions.d.ts +63 -1
- package/dist/types.d.ts +116 -7
- package/package.json +3 -1
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CoinMarketSchema: z.ZodPipe<z.ZodObject<{
|
|
3
|
+
base_asset_id: z.ZodString;
|
|
4
|
+
base_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
5
|
+
base_asset_name: z.ZodNullable<z.ZodString>;
|
|
6
|
+
base_asset_decimals: z.ZodNumber;
|
|
7
|
+
quote_asset_id: z.ZodString;
|
|
8
|
+
quote_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
9
|
+
quote_asset_name: z.ZodNullable<z.ZodString>;
|
|
10
|
+
quote_asset_decimals: z.ZodNumber;
|
|
11
|
+
pool_id: z.ZodString;
|
|
12
|
+
pool_name: z.ZodNullable<z.ZodString>;
|
|
13
|
+
fee: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
14
|
+
fee_rate: z.ZodNullable<z.ZodNumber>;
|
|
15
|
+
best_bid: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
16
|
+
best_ask: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
17
|
+
open_orders: z.ZodNumber;
|
|
18
|
+
traders: z.ZodNumber;
|
|
19
|
+
last_price: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
20
|
+
last_traded_at: z.ZodNullable<z.ZodNumber>;
|
|
21
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
22
|
+
poolId: string;
|
|
23
|
+
poolName: string | null;
|
|
24
|
+
baseCoinType: string;
|
|
25
|
+
baseSymbol: string | null;
|
|
26
|
+
baseName: string | null;
|
|
27
|
+
baseDecimals: number;
|
|
28
|
+
quoteCoinType: string;
|
|
29
|
+
quoteSymbol: string | null;
|
|
30
|
+
quoteName: string | null;
|
|
31
|
+
quoteDecimals: number;
|
|
32
|
+
feeRateScaled: bigint | null;
|
|
33
|
+
feeRate: number | null;
|
|
34
|
+
bestBid: bigint | null;
|
|
35
|
+
bestAsk: bigint | null;
|
|
36
|
+
lastPrice: bigint | null;
|
|
37
|
+
lastTradedAt: number | null;
|
|
38
|
+
openOrders: number;
|
|
39
|
+
traders: number;
|
|
40
|
+
}, {
|
|
41
|
+
base_asset_id: string;
|
|
42
|
+
base_asset_symbol: string | null;
|
|
43
|
+
base_asset_name: string | null;
|
|
44
|
+
base_asset_decimals: number;
|
|
45
|
+
quote_asset_id: string;
|
|
46
|
+
quote_asset_symbol: string | null;
|
|
47
|
+
quote_asset_name: string | null;
|
|
48
|
+
quote_asset_decimals: number;
|
|
49
|
+
pool_id: string;
|
|
50
|
+
pool_name: string | null;
|
|
51
|
+
fee: bigint | null;
|
|
52
|
+
fee_rate: number | null;
|
|
53
|
+
best_bid: bigint | null;
|
|
54
|
+
best_ask: bigint | null;
|
|
55
|
+
open_orders: number;
|
|
56
|
+
traders: number;
|
|
57
|
+
last_price: bigint | null;
|
|
58
|
+
last_traded_at: number | null;
|
|
59
|
+
}>>;
|
|
60
|
+
export declare const CoinTreasuryHoldingSchema: z.ZodPipe<z.ZodObject<{
|
|
61
|
+
address: z.ZodString;
|
|
62
|
+
label: z.ZodNullable<z.ZodString>;
|
|
63
|
+
type: z.ZodString;
|
|
64
|
+
amount: z.ZodNumber;
|
|
65
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
66
|
+
address: string;
|
|
67
|
+
label: string | null;
|
|
68
|
+
type: string;
|
|
69
|
+
amount: number;
|
|
70
|
+
}, {
|
|
71
|
+
address: string;
|
|
72
|
+
label: string | null;
|
|
73
|
+
type: string;
|
|
74
|
+
amount: number;
|
|
75
|
+
}>>;
|
|
76
|
+
export declare const CoinMintPolicySchema: z.ZodPipe<z.ZodObject<{
|
|
77
|
+
kind: z.ZodEnum<{
|
|
78
|
+
fixed: "fixed";
|
|
79
|
+
mintable: "mintable";
|
|
80
|
+
}>;
|
|
81
|
+
capped: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
82
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
83
|
+
kind: "fixed" | "mintable";
|
|
84
|
+
capped: boolean | null;
|
|
85
|
+
}, {
|
|
86
|
+
kind: "fixed" | "mintable";
|
|
87
|
+
capped?: boolean | null | undefined;
|
|
88
|
+
}>>;
|
|
89
|
+
export declare const CoinInfoSchema: z.ZodPipe<z.ZodObject<{
|
|
90
|
+
coin_type: z.ZodString;
|
|
91
|
+
symbol: z.ZodNullable<z.ZodString>;
|
|
92
|
+
name: z.ZodNullable<z.ZodString>;
|
|
93
|
+
decimals: z.ZodNullable<z.ZodNumber>;
|
|
94
|
+
icon_url: z.ZodNullable<z.ZodString>;
|
|
95
|
+
total_supply: z.ZodNullable<z.ZodNumber>;
|
|
96
|
+
circulating: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
treasury_holdings: z.ZodNullable<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
98
|
+
address: z.ZodString;
|
|
99
|
+
label: z.ZodNullable<z.ZodString>;
|
|
100
|
+
type: z.ZodString;
|
|
101
|
+
amount: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
103
|
+
address: string;
|
|
104
|
+
label: string | null;
|
|
105
|
+
type: string;
|
|
106
|
+
amount: number;
|
|
107
|
+
}, {
|
|
108
|
+
address: string;
|
|
109
|
+
label: string | null;
|
|
110
|
+
type: string;
|
|
111
|
+
amount: number;
|
|
112
|
+
}>>>>;
|
|
113
|
+
max_supply: z.ZodNullable<z.ZodNumber>;
|
|
114
|
+
mint_policy: z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
115
|
+
kind: z.ZodEnum<{
|
|
116
|
+
fixed: "fixed";
|
|
117
|
+
mintable: "mintable";
|
|
118
|
+
}>;
|
|
119
|
+
capped: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
120
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
121
|
+
kind: "fixed" | "mintable";
|
|
122
|
+
capped: boolean | null;
|
|
123
|
+
}, {
|
|
124
|
+
kind: "fixed" | "mintable";
|
|
125
|
+
capped?: boolean | null | undefined;
|
|
126
|
+
}>>>;
|
|
127
|
+
immutable: z.ZodNullable<z.ZodBoolean>;
|
|
128
|
+
upgradeable: z.ZodNullable<z.ZodBoolean>;
|
|
129
|
+
verified: z.ZodNullable<z.ZodBoolean>;
|
|
130
|
+
market: z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
131
|
+
base_asset_id: z.ZodString;
|
|
132
|
+
base_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
133
|
+
base_asset_name: z.ZodNullable<z.ZodString>;
|
|
134
|
+
base_asset_decimals: z.ZodNumber;
|
|
135
|
+
quote_asset_id: z.ZodString;
|
|
136
|
+
quote_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
137
|
+
quote_asset_name: z.ZodNullable<z.ZodString>;
|
|
138
|
+
quote_asset_decimals: z.ZodNumber;
|
|
139
|
+
pool_id: z.ZodString;
|
|
140
|
+
pool_name: z.ZodNullable<z.ZodString>;
|
|
141
|
+
fee: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
142
|
+
fee_rate: z.ZodNullable<z.ZodNumber>;
|
|
143
|
+
best_bid: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
144
|
+
best_ask: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
145
|
+
open_orders: z.ZodNumber;
|
|
146
|
+
traders: z.ZodNumber;
|
|
147
|
+
last_price: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
148
|
+
last_traded_at: z.ZodNullable<z.ZodNumber>;
|
|
149
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
150
|
+
poolId: string;
|
|
151
|
+
poolName: string | null;
|
|
152
|
+
baseCoinType: string;
|
|
153
|
+
baseSymbol: string | null;
|
|
154
|
+
baseName: string | null;
|
|
155
|
+
baseDecimals: number;
|
|
156
|
+
quoteCoinType: string;
|
|
157
|
+
quoteSymbol: string | null;
|
|
158
|
+
quoteName: string | null;
|
|
159
|
+
quoteDecimals: number;
|
|
160
|
+
feeRateScaled: bigint | null;
|
|
161
|
+
feeRate: number | null;
|
|
162
|
+
bestBid: bigint | null;
|
|
163
|
+
bestAsk: bigint | null;
|
|
164
|
+
lastPrice: bigint | null;
|
|
165
|
+
lastTradedAt: number | null;
|
|
166
|
+
openOrders: number;
|
|
167
|
+
traders: number;
|
|
168
|
+
}, {
|
|
169
|
+
base_asset_id: string;
|
|
170
|
+
base_asset_symbol: string | null;
|
|
171
|
+
base_asset_name: string | null;
|
|
172
|
+
base_asset_decimals: number;
|
|
173
|
+
quote_asset_id: string;
|
|
174
|
+
quote_asset_symbol: string | null;
|
|
175
|
+
quote_asset_name: string | null;
|
|
176
|
+
quote_asset_decimals: number;
|
|
177
|
+
pool_id: string;
|
|
178
|
+
pool_name: string | null;
|
|
179
|
+
fee: bigint | null;
|
|
180
|
+
fee_rate: number | null;
|
|
181
|
+
best_bid: bigint | null;
|
|
182
|
+
best_ask: bigint | null;
|
|
183
|
+
open_orders: number;
|
|
184
|
+
traders: number;
|
|
185
|
+
last_price: bigint | null;
|
|
186
|
+
last_traded_at: number | null;
|
|
187
|
+
}>>>;
|
|
188
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
189
|
+
coinType: string;
|
|
190
|
+
symbol: string | null;
|
|
191
|
+
name: string | null;
|
|
192
|
+
decimals: number | null;
|
|
193
|
+
iconUrl: string | null;
|
|
194
|
+
totalSupply: number | null;
|
|
195
|
+
circulating: number | null;
|
|
196
|
+
treasuryHoldings: {
|
|
197
|
+
address: string;
|
|
198
|
+
label: string | null;
|
|
199
|
+
type: string;
|
|
200
|
+
amount: number;
|
|
201
|
+
}[] | null;
|
|
202
|
+
maxSupply: number | null;
|
|
203
|
+
mintPolicy: {
|
|
204
|
+
kind: "fixed" | "mintable";
|
|
205
|
+
capped: boolean | null;
|
|
206
|
+
} | null;
|
|
207
|
+
immutable: boolean | null;
|
|
208
|
+
upgradeable: boolean | null;
|
|
209
|
+
verified: boolean | null;
|
|
210
|
+
market: {
|
|
211
|
+
poolId: string;
|
|
212
|
+
poolName: string | null;
|
|
213
|
+
baseCoinType: string;
|
|
214
|
+
baseSymbol: string | null;
|
|
215
|
+
baseName: string | null;
|
|
216
|
+
baseDecimals: number;
|
|
217
|
+
quoteCoinType: string;
|
|
218
|
+
quoteSymbol: string | null;
|
|
219
|
+
quoteName: string | null;
|
|
220
|
+
quoteDecimals: number;
|
|
221
|
+
feeRateScaled: bigint | null;
|
|
222
|
+
feeRate: number | null;
|
|
223
|
+
bestBid: bigint | null;
|
|
224
|
+
bestAsk: bigint | null;
|
|
225
|
+
lastPrice: bigint | null;
|
|
226
|
+
lastTradedAt: number | null;
|
|
227
|
+
openOrders: number;
|
|
228
|
+
traders: number;
|
|
229
|
+
} | null;
|
|
230
|
+
}, {
|
|
231
|
+
coin_type: string;
|
|
232
|
+
symbol: string | null;
|
|
233
|
+
name: string | null;
|
|
234
|
+
decimals: number | null;
|
|
235
|
+
icon_url: string | null;
|
|
236
|
+
total_supply: number | null;
|
|
237
|
+
circulating: number | null;
|
|
238
|
+
treasury_holdings: {
|
|
239
|
+
address: string;
|
|
240
|
+
label: string | null;
|
|
241
|
+
type: string;
|
|
242
|
+
amount: number;
|
|
243
|
+
}[] | null;
|
|
244
|
+
max_supply: number | null;
|
|
245
|
+
mint_policy: {
|
|
246
|
+
kind: "fixed" | "mintable";
|
|
247
|
+
capped: boolean | null;
|
|
248
|
+
} | null;
|
|
249
|
+
immutable: boolean | null;
|
|
250
|
+
upgradeable: boolean | null;
|
|
251
|
+
verified: boolean | null;
|
|
252
|
+
market: {
|
|
253
|
+
poolId: string;
|
|
254
|
+
poolName: string | null;
|
|
255
|
+
baseCoinType: string;
|
|
256
|
+
baseSymbol: string | null;
|
|
257
|
+
baseName: string | null;
|
|
258
|
+
baseDecimals: number;
|
|
259
|
+
quoteCoinType: string;
|
|
260
|
+
quoteSymbol: string | null;
|
|
261
|
+
quoteName: string | null;
|
|
262
|
+
quoteDecimals: number;
|
|
263
|
+
feeRateScaled: bigint | null;
|
|
264
|
+
feeRate: number | null;
|
|
265
|
+
bestBid: bigint | null;
|
|
266
|
+
bestAsk: bigint | null;
|
|
267
|
+
lastPrice: bigint | null;
|
|
268
|
+
lastTradedAt: number | null;
|
|
269
|
+
openOrders: number;
|
|
270
|
+
traders: number;
|
|
271
|
+
} | null;
|
|
272
|
+
}>>;
|
|
273
|
+
export declare const CoinListSchema: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
274
|
+
coin_type: z.ZodString;
|
|
275
|
+
symbol: z.ZodNullable<z.ZodString>;
|
|
276
|
+
name: z.ZodNullable<z.ZodString>;
|
|
277
|
+
decimals: z.ZodNullable<z.ZodNumber>;
|
|
278
|
+
icon_url: z.ZodNullable<z.ZodString>;
|
|
279
|
+
total_supply: z.ZodNullable<z.ZodNumber>;
|
|
280
|
+
circulating: z.ZodNullable<z.ZodNumber>;
|
|
281
|
+
treasury_holdings: z.ZodNullable<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
282
|
+
address: z.ZodString;
|
|
283
|
+
label: z.ZodNullable<z.ZodString>;
|
|
284
|
+
type: z.ZodString;
|
|
285
|
+
amount: z.ZodNumber;
|
|
286
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
287
|
+
address: string;
|
|
288
|
+
label: string | null;
|
|
289
|
+
type: string;
|
|
290
|
+
amount: number;
|
|
291
|
+
}, {
|
|
292
|
+
address: string;
|
|
293
|
+
label: string | null;
|
|
294
|
+
type: string;
|
|
295
|
+
amount: number;
|
|
296
|
+
}>>>>;
|
|
297
|
+
max_supply: z.ZodNullable<z.ZodNumber>;
|
|
298
|
+
mint_policy: z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
299
|
+
kind: z.ZodEnum<{
|
|
300
|
+
fixed: "fixed";
|
|
301
|
+
mintable: "mintable";
|
|
302
|
+
}>;
|
|
303
|
+
capped: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
304
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
305
|
+
kind: "fixed" | "mintable";
|
|
306
|
+
capped: boolean | null;
|
|
307
|
+
}, {
|
|
308
|
+
kind: "fixed" | "mintable";
|
|
309
|
+
capped?: boolean | null | undefined;
|
|
310
|
+
}>>>;
|
|
311
|
+
immutable: z.ZodNullable<z.ZodBoolean>;
|
|
312
|
+
upgradeable: z.ZodNullable<z.ZodBoolean>;
|
|
313
|
+
verified: z.ZodNullable<z.ZodBoolean>;
|
|
314
|
+
market: z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
315
|
+
base_asset_id: z.ZodString;
|
|
316
|
+
base_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
317
|
+
base_asset_name: z.ZodNullable<z.ZodString>;
|
|
318
|
+
base_asset_decimals: z.ZodNumber;
|
|
319
|
+
quote_asset_id: z.ZodString;
|
|
320
|
+
quote_asset_symbol: z.ZodNullable<z.ZodString>;
|
|
321
|
+
quote_asset_name: z.ZodNullable<z.ZodString>;
|
|
322
|
+
quote_asset_decimals: z.ZodNumber;
|
|
323
|
+
pool_id: z.ZodString;
|
|
324
|
+
pool_name: z.ZodNullable<z.ZodString>;
|
|
325
|
+
fee: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
326
|
+
fee_rate: z.ZodNullable<z.ZodNumber>;
|
|
327
|
+
best_bid: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
328
|
+
best_ask: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
329
|
+
open_orders: z.ZodNumber;
|
|
330
|
+
traders: z.ZodNumber;
|
|
331
|
+
last_price: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<bigint, string | number>>>;
|
|
332
|
+
last_traded_at: z.ZodNullable<z.ZodNumber>;
|
|
333
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
334
|
+
poolId: string;
|
|
335
|
+
poolName: string | null;
|
|
336
|
+
baseCoinType: string;
|
|
337
|
+
baseSymbol: string | null;
|
|
338
|
+
baseName: string | null;
|
|
339
|
+
baseDecimals: number;
|
|
340
|
+
quoteCoinType: string;
|
|
341
|
+
quoteSymbol: string | null;
|
|
342
|
+
quoteName: string | null;
|
|
343
|
+
quoteDecimals: number;
|
|
344
|
+
feeRateScaled: bigint | null;
|
|
345
|
+
feeRate: number | null;
|
|
346
|
+
bestBid: bigint | null;
|
|
347
|
+
bestAsk: bigint | null;
|
|
348
|
+
lastPrice: bigint | null;
|
|
349
|
+
lastTradedAt: number | null;
|
|
350
|
+
openOrders: number;
|
|
351
|
+
traders: number;
|
|
352
|
+
}, {
|
|
353
|
+
base_asset_id: string;
|
|
354
|
+
base_asset_symbol: string | null;
|
|
355
|
+
base_asset_name: string | null;
|
|
356
|
+
base_asset_decimals: number;
|
|
357
|
+
quote_asset_id: string;
|
|
358
|
+
quote_asset_symbol: string | null;
|
|
359
|
+
quote_asset_name: string | null;
|
|
360
|
+
quote_asset_decimals: number;
|
|
361
|
+
pool_id: string;
|
|
362
|
+
pool_name: string | null;
|
|
363
|
+
fee: bigint | null;
|
|
364
|
+
fee_rate: number | null;
|
|
365
|
+
best_bid: bigint | null;
|
|
366
|
+
best_ask: bigint | null;
|
|
367
|
+
open_orders: number;
|
|
368
|
+
traders: number;
|
|
369
|
+
last_price: bigint | null;
|
|
370
|
+
last_traded_at: number | null;
|
|
371
|
+
}>>>;
|
|
372
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
373
|
+
coinType: string;
|
|
374
|
+
symbol: string | null;
|
|
375
|
+
name: string | null;
|
|
376
|
+
decimals: number | null;
|
|
377
|
+
iconUrl: string | null;
|
|
378
|
+
totalSupply: number | null;
|
|
379
|
+
circulating: number | null;
|
|
380
|
+
treasuryHoldings: {
|
|
381
|
+
address: string;
|
|
382
|
+
label: string | null;
|
|
383
|
+
type: string;
|
|
384
|
+
amount: number;
|
|
385
|
+
}[] | null;
|
|
386
|
+
maxSupply: number | null;
|
|
387
|
+
mintPolicy: {
|
|
388
|
+
kind: "fixed" | "mintable";
|
|
389
|
+
capped: boolean | null;
|
|
390
|
+
} | null;
|
|
391
|
+
immutable: boolean | null;
|
|
392
|
+
upgradeable: boolean | null;
|
|
393
|
+
verified: boolean | null;
|
|
394
|
+
market: {
|
|
395
|
+
poolId: string;
|
|
396
|
+
poolName: string | null;
|
|
397
|
+
baseCoinType: string;
|
|
398
|
+
baseSymbol: string | null;
|
|
399
|
+
baseName: string | null;
|
|
400
|
+
baseDecimals: number;
|
|
401
|
+
quoteCoinType: string;
|
|
402
|
+
quoteSymbol: string | null;
|
|
403
|
+
quoteName: string | null;
|
|
404
|
+
quoteDecimals: number;
|
|
405
|
+
feeRateScaled: bigint | null;
|
|
406
|
+
feeRate: number | null;
|
|
407
|
+
bestBid: bigint | null;
|
|
408
|
+
bestAsk: bigint | null;
|
|
409
|
+
lastPrice: bigint | null;
|
|
410
|
+
lastTradedAt: number | null;
|
|
411
|
+
openOrders: number;
|
|
412
|
+
traders: number;
|
|
413
|
+
} | null;
|
|
414
|
+
}, {
|
|
415
|
+
coin_type: string;
|
|
416
|
+
symbol: string | null;
|
|
417
|
+
name: string | null;
|
|
418
|
+
decimals: number | null;
|
|
419
|
+
icon_url: string | null;
|
|
420
|
+
total_supply: number | null;
|
|
421
|
+
circulating: number | null;
|
|
422
|
+
treasury_holdings: {
|
|
423
|
+
address: string;
|
|
424
|
+
label: string | null;
|
|
425
|
+
type: string;
|
|
426
|
+
amount: number;
|
|
427
|
+
}[] | null;
|
|
428
|
+
max_supply: number | null;
|
|
429
|
+
mint_policy: {
|
|
430
|
+
kind: "fixed" | "mintable";
|
|
431
|
+
capped: boolean | null;
|
|
432
|
+
} | null;
|
|
433
|
+
immutable: boolean | null;
|
|
434
|
+
upgradeable: boolean | null;
|
|
435
|
+
verified: boolean | null;
|
|
436
|
+
market: {
|
|
437
|
+
poolId: string;
|
|
438
|
+
poolName: string | null;
|
|
439
|
+
baseCoinType: string;
|
|
440
|
+
baseSymbol: string | null;
|
|
441
|
+
baseName: string | null;
|
|
442
|
+
baseDecimals: number;
|
|
443
|
+
quoteCoinType: string;
|
|
444
|
+
quoteSymbol: string | null;
|
|
445
|
+
quoteName: string | null;
|
|
446
|
+
quoteDecimals: number;
|
|
447
|
+
feeRateScaled: bigint | null;
|
|
448
|
+
feeRate: number | null;
|
|
449
|
+
bestBid: bigint | null;
|
|
450
|
+
bestAsk: bigint | null;
|
|
451
|
+
lastPrice: bigint | null;
|
|
452
|
+
lastTradedAt: number | null;
|
|
453
|
+
openOrders: number;
|
|
454
|
+
traders: number;
|
|
455
|
+
} | null;
|
|
456
|
+
}>>>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Transaction, TransactionArgument, TransactionObjectArgument, TransactionResult } from '@mysten/sui/transactions';
|
|
2
|
+
import { PackageIds } from '../types';
|
|
3
|
+
export interface CoinPoolTypes {
|
|
4
|
+
poolId: string;
|
|
5
|
+
baseCoinType: string;
|
|
6
|
+
quoteCoinType: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PlaceCoinLimitOrderArgs extends CoinPoolTypes {
|
|
9
|
+
account: TransactionObjectArgument;
|
|
10
|
+
proof: TransactionObjectArgument;
|
|
11
|
+
price: bigint;
|
|
12
|
+
quantity: bigint;
|
|
13
|
+
isBid: boolean;
|
|
14
|
+
orderType?: number;
|
|
15
|
+
selfMatchingOption?: number;
|
|
16
|
+
expireTimestamp: bigint;
|
|
17
|
+
}
|
|
18
|
+
export declare function placeCoinLimitOrder(tx: Transaction, ids: PackageIds, args: PlaceCoinLimitOrderArgs): TransactionResult;
|
|
19
|
+
export interface PlaceCoinMarketOrderArgs extends CoinPoolTypes {
|
|
20
|
+
account: TransactionObjectArgument;
|
|
21
|
+
proof: TransactionObjectArgument;
|
|
22
|
+
quantity: bigint;
|
|
23
|
+
isBid: boolean;
|
|
24
|
+
selfMatchingOption?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function placeCoinMarketOrder(tx: Transaction, ids: PackageIds, args: PlaceCoinMarketOrderArgs): TransactionResult;
|
|
27
|
+
interface CoinAccountArgs extends CoinPoolTypes {
|
|
28
|
+
account: TransactionObjectArgument;
|
|
29
|
+
proof: TransactionObjectArgument;
|
|
30
|
+
}
|
|
31
|
+
export declare function cancelCoinOrder(tx: Transaction, ids: PackageIds, args: CoinAccountArgs & {
|
|
32
|
+
orderId: bigint;
|
|
33
|
+
}): void;
|
|
34
|
+
export declare function cancelCoinOrders(tx: Transaction, ids: PackageIds, args: CoinAccountArgs & {
|
|
35
|
+
orderIds: bigint[];
|
|
36
|
+
}): void;
|
|
37
|
+
export declare function cancelAllCoinOrders(tx: Transaction, ids: PackageIds, args: CoinAccountArgs): void;
|
|
38
|
+
export declare function modifyCoinOrder(tx: Transaction, ids: PackageIds, args: CoinAccountArgs & {
|
|
39
|
+
orderId: bigint;
|
|
40
|
+
newQuantity: bigint;
|
|
41
|
+
}): void;
|
|
42
|
+
export declare function withdrawSettledCoinAmounts(tx: Transaction, ids: PackageIds, args: CoinAccountArgs): void;
|
|
43
|
+
export declare function withdrawSettledCoinAmountsPermissionless(tx: Transaction, ids: PackageIds, args: CoinPoolTypes & {
|
|
44
|
+
account: TransactionObjectArgument;
|
|
45
|
+
}): void;
|
|
46
|
+
export declare function zeroCoin(tx: Transaction, coinType: string): TransactionResult;
|
|
47
|
+
export interface CoinSwapArgs extends CoinPoolTypes {
|
|
48
|
+
coinIn: TransactionObjectArgument;
|
|
49
|
+
credIn: TransactionObjectArgument;
|
|
50
|
+
minOut: bigint;
|
|
51
|
+
}
|
|
52
|
+
export declare function swapExactBaseForQuote(tx: Transaction, ids: PackageIds, args: CoinSwapArgs): TransactionResult;
|
|
53
|
+
export declare function swapExactQuoteForBase(tx: Transaction, ids: PackageIds, args: CoinSwapArgs): TransactionResult;
|
|
54
|
+
export interface CoinCapSwapArgs extends CoinPoolTypes {
|
|
55
|
+
account: TransactionObjectArgument;
|
|
56
|
+
tradeCap: TransactionObjectArgument;
|
|
57
|
+
depositCap: TransactionObjectArgument;
|
|
58
|
+
withdrawCap: TransactionObjectArgument;
|
|
59
|
+
coinIn: TransactionObjectArgument;
|
|
60
|
+
minOut: bigint;
|
|
61
|
+
}
|
|
62
|
+
export declare function swapExactBaseForQuoteWithTradingAccount(tx: Transaction, ids: PackageIds, args: CoinCapSwapArgs): TransactionResult;
|
|
63
|
+
export declare function swapExactQuoteForBaseWithTradingAccount(tx: Transaction, ids: PackageIds, args: CoinCapSwapArgs): TransactionResult;
|
|
64
|
+
export declare function currencyObjectId(coinType: string): string;
|
|
65
|
+
export declare function createPermissionlessCoinPool(tx: Transaction, ids: PackageIds, args: {
|
|
66
|
+
baseCoinType: string;
|
|
67
|
+
quoteCoinType: string;
|
|
68
|
+
creationFee: TransactionObjectArgument;
|
|
69
|
+
}): TransactionResult;
|
|
70
|
+
export declare function getCoinPoolIdByAsset(tx: Transaction, ids: PackageIds, args: {
|
|
71
|
+
baseCoinType: string;
|
|
72
|
+
quoteCoinType: string;
|
|
73
|
+
}): TransactionResult;
|
|
74
|
+
export declare function iterCoinOrders(tx: Transaction, ids: PackageIds, args: CoinPoolTypes & {
|
|
75
|
+
startOrderId?: bigint | null;
|
|
76
|
+
endOrderId?: bigint | null;
|
|
77
|
+
minExpireTimestamp?: bigint | null;
|
|
78
|
+
limit: bigint;
|
|
79
|
+
bids: boolean;
|
|
80
|
+
}): TransactionResult;
|
|
81
|
+
export declare function coinPoolView(tx: Transaction, ids: PackageIds, fn: string, pool: CoinPoolTypes, extraArgs?: (tx: Transaction) => TransactionArgument[]): TransactionResult;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BookLevel } from '../book';
|
|
3
|
+
import { OrderSide, TxResult } from '../types';
|
|
4
|
+
import { CoinInfoSchema, CoinMarketSchema, CoinMintPolicySchema, CoinTreasuryHoldingSchema } from './schemas';
|
|
5
|
+
import { CoinBookOrder } from './onchain';
|
|
6
|
+
export type CoinInfo = z.output<typeof CoinInfoSchema>;
|
|
7
|
+
export type CoinMarket = z.output<typeof CoinMarketSchema>;
|
|
8
|
+
export type CoinTreasuryHolding = z.output<typeof CoinTreasuryHoldingSchema>;
|
|
9
|
+
export type CoinMintPolicy = z.output<typeof CoinMintPolicySchema>;
|
|
10
|
+
export interface CoinPoolSelector {
|
|
11
|
+
poolId?: string;
|
|
12
|
+
baseCoinType?: string;
|
|
13
|
+
quoteCoinType?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CoinPool {
|
|
16
|
+
poolId: string;
|
|
17
|
+
baseCoinType: string;
|
|
18
|
+
quoteCoinType: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CoinOrderbook extends CoinPool {
|
|
21
|
+
bids: CoinBookOrder[];
|
|
22
|
+
asks: CoinBookOrder[];
|
|
23
|
+
bidLevels: BookLevel[];
|
|
24
|
+
askLevels: BookLevel[];
|
|
25
|
+
hasMoreBids: boolean;
|
|
26
|
+
hasMoreAsks: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CoinOrderbookParams extends CoinPoolSelector {
|
|
29
|
+
depth?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CoinAccountParams extends CoinPoolSelector {
|
|
32
|
+
tradingAccountId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface CoinTradeParamsParams extends CoinPoolSelector {
|
|
35
|
+
tradingAccountId?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface CoinSwapQuoteParams extends CoinPoolSelector {
|
|
38
|
+
side: OrderSide;
|
|
39
|
+
amountIn: bigint;
|
|
40
|
+
tradingAccountId?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CoinSwapQuote {
|
|
43
|
+
side: OrderSide;
|
|
44
|
+
amountIn: bigint;
|
|
45
|
+
amountOut: bigint;
|
|
46
|
+
unspent: bigint;
|
|
47
|
+
}
|
|
48
|
+
export interface CoinMarketEstimateParams extends CoinPoolSelector {
|
|
49
|
+
side: OrderSide;
|
|
50
|
+
quantity: bigint;
|
|
51
|
+
depth?: number;
|
|
52
|
+
takerFeeRateScaled?: bigint;
|
|
53
|
+
}
|
|
54
|
+
export interface CoinBalancesParams {
|
|
55
|
+
coinType: string;
|
|
56
|
+
address?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface CoinBalances {
|
|
59
|
+
coinType: string;
|
|
60
|
+
wallet: bigint;
|
|
61
|
+
tradingAccount: bigint;
|
|
62
|
+
tradingAccountId: string | null;
|
|
63
|
+
}
|
|
64
|
+
export interface CoinDepositParams {
|
|
65
|
+
coinType: string;
|
|
66
|
+
amount: bigint;
|
|
67
|
+
}
|
|
68
|
+
export interface CoinWithdrawParams {
|
|
69
|
+
coinType: string;
|
|
70
|
+
amount?: bigint;
|
|
71
|
+
}
|
|
72
|
+
export interface CoinLimitOrderParams extends CoinPoolSelector {
|
|
73
|
+
side: OrderSide;
|
|
74
|
+
price: bigint;
|
|
75
|
+
quantity: bigint;
|
|
76
|
+
expireAt?: bigint;
|
|
77
|
+
orderType?: number;
|
|
78
|
+
selfMatchingOption?: number;
|
|
79
|
+
quoteDeposit?: bigint;
|
|
80
|
+
}
|
|
81
|
+
export interface CoinMarketOrderParams extends CoinPoolSelector {
|
|
82
|
+
side: OrderSide;
|
|
83
|
+
quantity: bigint;
|
|
84
|
+
quoteBudget?: bigint;
|
|
85
|
+
selfMatchingOption?: number;
|
|
86
|
+
}
|
|
87
|
+
export interface CoinSwapParams extends CoinPoolSelector {
|
|
88
|
+
side: OrderSide;
|
|
89
|
+
amountIn: bigint;
|
|
90
|
+
minOut?: bigint;
|
|
91
|
+
slippageBps?: number;
|
|
92
|
+
}
|
|
93
|
+
export interface CoinSwapResult extends TxResult {
|
|
94
|
+
minOut: bigint;
|
|
95
|
+
}
|
|
96
|
+
export interface CoinCancelOrderParams extends CoinPoolSelector {
|
|
97
|
+
orderId: bigint | string;
|
|
98
|
+
}
|
|
99
|
+
export interface CoinCancelOrdersParams extends CoinPoolSelector {
|
|
100
|
+
orderIds: Array<bigint | string>;
|
|
101
|
+
}
|
|
102
|
+
export interface CoinModifyOrderParams extends CoinCancelOrderParams {
|
|
103
|
+
newQuantity: bigint;
|
|
104
|
+
}
|
|
105
|
+
export interface CoinClaimSettledParams {
|
|
106
|
+
pools: CoinPoolSelector[];
|
|
107
|
+
withdrawCoinTypes?: string[];
|
|
108
|
+
}
|
|
109
|
+
export interface CreateCoinPoolParams {
|
|
110
|
+
baseCoinType: string;
|
|
111
|
+
quoteCoinType?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface CreateCoinPoolResult extends TxResult {
|
|
114
|
+
poolId: string | null;
|
|
115
|
+
}
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { explainMoveAbortDetailed, parseMoveAbort, unpackAbortCode, MoveAbortExplanation, AbortCodeBits } from './moveAbort';
|
|
1
2
|
export declare enum TriexError {
|
|
2
3
|
ExecutorRequired = "TRIEX_EXECUTOR_REQUIRED",
|
|
3
4
|
AddressRequired = "TRIEX_ADDRESS_REQUIRED",
|
|
@@ -9,11 +10,18 @@ export declare enum TriexError {
|
|
|
9
10
|
ValidationFailed = "TRIEX_VALIDATION_FAILED",
|
|
10
11
|
InsufficientBalance = "TRIEX_INSUFFICIENT_BALANCE",
|
|
11
12
|
CollectionMismatch = "TRIEX_COLLECTION_MISMATCH",
|
|
12
|
-
|
|
13
|
+
TradingAccountNotFound = "TRIEX_TRADING_ACCOUNT_NOT_FOUND",
|
|
14
|
+
BalanceManagerNotFound = "TRIEX_TRADING_ACCOUNT_NOT_FOUND",
|
|
13
15
|
PoolNotFound = "TRIEX_POOL_NOT_FOUND",
|
|
14
16
|
HubNotFound = "TRIEX_HUB_NOT_FOUND",
|
|
15
17
|
SolarSystemNotFound = "TRIEX_SOLAR_SYSTEM_NOT_FOUND",
|
|
18
|
+
OrgNotFound = "TRIEX_ORG_NOT_FOUND",
|
|
16
19
|
CharacterNotFound = "TRIEX_CHARACTER_NOT_FOUND",
|
|
20
|
+
OrderNotFound = "TRIEX_ORDER_NOT_FOUND",
|
|
21
|
+
FillNotFound = "TRIEX_FILL_NOT_FOUND",
|
|
22
|
+
TribeNotFound = "TRIEX_TRIBE_NOT_FOUND",
|
|
23
|
+
ItemNotFound = "TRIEX_ITEM_NOT_FOUND",
|
|
24
|
+
RouteNotFound = "TRIEX_ROUTE_NOT_FOUND",
|
|
17
25
|
TransactionFailed = "TRIEX_TRANSACTION_FAILED",
|
|
18
26
|
Timeout = "TRIEX_TIMEOUT",
|
|
19
27
|
NotImplemented = "TRIEX_NOT_IMPLEMENTED"
|
|
@@ -28,3 +36,5 @@ export declare class TriexClientError extends Error {
|
|
|
28
36
|
export declare function fail(code: TriexError, message: string, cause?: unknown): never;
|
|
29
37
|
export declare function notImplemented(what: string): never;
|
|
30
38
|
export declare function explainMoveAbort(error: unknown): string | null;
|
|
39
|
+
export { explainMoveAbortDetailed, parseMoveAbort, unpackAbortCode };
|
|
40
|
+
export type { MoveAbortExplanation, AbortCodeBits };
|
package/dist/funding.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface SourceItemsParams {
|
|
|
9
9
|
vaultCollectionId: string;
|
|
10
10
|
assetId: bigint;
|
|
11
11
|
amount: bigint;
|
|
12
|
-
|
|
12
|
+
tradingAccountId: string | null;
|
|
13
13
|
deficitMode?: boolean;
|
|
14
14
|
}
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function sourceItemsIntoTradingAccount(suiClient: ClientWithCoreApi, tx: Transaction, ids: PackageIds, bm: TransactionObjectArgument, params: SourceItemsParams): Promise<void>;
|
package/dist/http.d.ts
ADDED