@allbridge/bridge-core-sdk 3.16.0-beta.1 → 3.16.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/dist/browser/index.js +3 -3
- package/dist/browser/index.js.map +4 -4
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +4 -4
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +4 -4
- package/dist/src/services/bridge/srb/index.js +11 -10
- package/dist/src/services/bridge/srb/index.js.map +1 -1
- package/dist/src/services/bridge/utils.js +1 -1
- package/dist/src/services/bridge/utils.js.map +1 -1
- package/dist/src/services/liquidity-pool/srb/index.js +17 -14
- package/dist/src/services/liquidity-pool/srb/index.js.map +1 -1
- package/dist/src/services/models/srb/bridge-contract.d.ts +801 -0
- package/dist/src/services/models/srb/{bridge.js → bridge-contract.js} +49 -97
- package/dist/src/services/models/srb/bridge-contract.js.map +1 -0
- package/dist/src/services/models/srb/gas-oracle-contract.d.ts +350 -0
- package/dist/src/services/models/srb/gas-oracle-contract.js +87 -0
- package/dist/src/services/models/srb/gas-oracle-contract.js.map +1 -0
- package/dist/src/services/models/srb/messenger-contract.d.ts +573 -0
- package/dist/src/services/models/srb/messenger-contract.js +111 -0
- package/dist/src/services/models/srb/messenger-contract.js.map +1 -0
- package/dist/src/services/models/srb/pool-contract.d.ts +690 -0
- package/dist/src/services/models/srb/pool-contract.js +125 -0
- package/dist/src/services/models/srb/pool-contract.js.map +1 -0
- package/dist/src/services/models/srb/token-contract.d.ts +437 -160
- package/dist/src/services/models/srb/token-contract.js +41 -288
- package/dist/src/services/models/srb/token-contract.js.map +1 -1
- package/dist/src/services/models/srb/utils.d.ts +6 -0
- package/dist/src/services/models/srb/utils.js +35 -0
- package/dist/src/services/models/srb/utils.js.map +1 -0
- package/dist/src/services/token/srb/index.js +1 -1
- package/dist/src/services/token/srb/index.js.map +1 -1
- package/dist/src/utils/srb/index.d.ts +5 -6
- package/dist/src/utils/srb/index.js +1 -1
- package/dist/src/utils/srb/index.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +2 -2
- package/dist/src/services/models/srb/bridge.d.ts +0 -169
- package/dist/src/services/models/srb/bridge.js.map +0 -1
- package/dist/src/services/models/srb/pool.d.ts +0 -293
- package/dist/src/services/models/srb/pool.js +0 -233
- package/dist/src/services/models/srb/pool.js.map +0 -1
- package/dist/src/services/utils/srb/assembled-tx.d.ts +0 -73
- package/dist/src/services/utils/srb/assembled-tx.js +0 -143
- package/dist/src/services/utils/srb/assembled-tx.js.map +0 -1
- package/dist/src/services/utils/srb/build-tx.d.ts +0 -48
- package/dist/src/services/utils/srb/build-tx.js +0 -62
- package/dist/src/services/utils/srb/build-tx.js.map +0 -1
- package/dist/src/services/utils/srb/method-options.d.ts +0 -47
- package/dist/src/services/utils/srb/method-options.js +0 -5
- package/dist/src/services/utils/srb/method-options.js.map +0 -1
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { contract } from "@stellar/stellar-sdk";
|
|
3
|
+
import u128 = contract.u128;
|
|
4
|
+
import u32 = contract.u32;
|
|
5
|
+
import AssembledTransaction = contract.AssembledTransaction;
|
|
6
|
+
import Result = contract.Result;
|
|
7
|
+
import ContractClient = contract.Client;
|
|
8
|
+
import ContractClientOptions = contract.ClientOptions;
|
|
9
|
+
export interface SwappedFromVUsd {
|
|
10
|
+
amount: u128;
|
|
11
|
+
fee: u128;
|
|
12
|
+
recipient: string;
|
|
13
|
+
token: string;
|
|
14
|
+
vusd_amount: u128;
|
|
15
|
+
}
|
|
16
|
+
export interface SwappedToVUsd {
|
|
17
|
+
amount: u128;
|
|
18
|
+
fee: u128;
|
|
19
|
+
sender: string;
|
|
20
|
+
token: string;
|
|
21
|
+
vusd_amount: u128;
|
|
22
|
+
}
|
|
23
|
+
export interface Deposit {
|
|
24
|
+
amount: u128;
|
|
25
|
+
user: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Withdraw {
|
|
28
|
+
amount: u128;
|
|
29
|
+
user: string;
|
|
30
|
+
}
|
|
31
|
+
export interface RewardsClaimed {
|
|
32
|
+
amount: u128;
|
|
33
|
+
user: string;
|
|
34
|
+
}
|
|
35
|
+
export type Bridge = readonly [string];
|
|
36
|
+
export interface DataKey {
|
|
37
|
+
tag: "UserDeposit";
|
|
38
|
+
values: readonly [string];
|
|
39
|
+
}
|
|
40
|
+
export interface Pool {
|
|
41
|
+
a: u128;
|
|
42
|
+
acc_reward_per_share_p: u128;
|
|
43
|
+
admin_fee_amount: u128;
|
|
44
|
+
admin_fee_share_bp: u128;
|
|
45
|
+
balance_ratio_min_bp: u128;
|
|
46
|
+
can_deposit: boolean;
|
|
47
|
+
can_withdraw: boolean;
|
|
48
|
+
d: u128;
|
|
49
|
+
decimals: u32;
|
|
50
|
+
fee_share_bp: u128;
|
|
51
|
+
reserves: u128;
|
|
52
|
+
token: string;
|
|
53
|
+
token_balance: u128;
|
|
54
|
+
total_lp_amount: u128;
|
|
55
|
+
v_usd_balance: u128;
|
|
56
|
+
}
|
|
57
|
+
export interface UserDeposit {
|
|
58
|
+
lp_amount: u128;
|
|
59
|
+
reward_debt: u128;
|
|
60
|
+
}
|
|
61
|
+
export type Admin = readonly [string];
|
|
62
|
+
export type GasOracleAddress = readonly [string];
|
|
63
|
+
export type GasUsage = readonly [Map<u32, u128>];
|
|
64
|
+
export type NativeToken = readonly [string];
|
|
65
|
+
export type StopAuthority = readonly [string];
|
|
66
|
+
export declare const Errors: {
|
|
67
|
+
0: {
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
1: {
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
2: {
|
|
74
|
+
message: string;
|
|
75
|
+
};
|
|
76
|
+
3: {
|
|
77
|
+
message: string;
|
|
78
|
+
};
|
|
79
|
+
4: {
|
|
80
|
+
message: string;
|
|
81
|
+
};
|
|
82
|
+
5: {
|
|
83
|
+
message: string;
|
|
84
|
+
};
|
|
85
|
+
6: {
|
|
86
|
+
message: string;
|
|
87
|
+
};
|
|
88
|
+
7: {
|
|
89
|
+
message: string;
|
|
90
|
+
};
|
|
91
|
+
8: {
|
|
92
|
+
message: string;
|
|
93
|
+
};
|
|
94
|
+
9: {
|
|
95
|
+
message: string;
|
|
96
|
+
};
|
|
97
|
+
10: {
|
|
98
|
+
message: string;
|
|
99
|
+
};
|
|
100
|
+
11: {
|
|
101
|
+
message: string;
|
|
102
|
+
};
|
|
103
|
+
12: {
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
103: {
|
|
107
|
+
message: string;
|
|
108
|
+
};
|
|
109
|
+
104: {
|
|
110
|
+
message: string;
|
|
111
|
+
};
|
|
112
|
+
105: {
|
|
113
|
+
message: string;
|
|
114
|
+
};
|
|
115
|
+
106: {
|
|
116
|
+
message: string;
|
|
117
|
+
};
|
|
118
|
+
107: {
|
|
119
|
+
message: string;
|
|
120
|
+
};
|
|
121
|
+
108: {
|
|
122
|
+
message: string;
|
|
123
|
+
};
|
|
124
|
+
109: {
|
|
125
|
+
message: string;
|
|
126
|
+
};
|
|
127
|
+
203: {
|
|
128
|
+
message: string;
|
|
129
|
+
};
|
|
130
|
+
204: {
|
|
131
|
+
message: string;
|
|
132
|
+
};
|
|
133
|
+
205: {
|
|
134
|
+
message: string;
|
|
135
|
+
};
|
|
136
|
+
206: {
|
|
137
|
+
message: string;
|
|
138
|
+
};
|
|
139
|
+
207: {
|
|
140
|
+
message: string;
|
|
141
|
+
};
|
|
142
|
+
208: {
|
|
143
|
+
message: string;
|
|
144
|
+
};
|
|
145
|
+
209: {
|
|
146
|
+
message: string;
|
|
147
|
+
};
|
|
148
|
+
210: {
|
|
149
|
+
message: string;
|
|
150
|
+
};
|
|
151
|
+
211: {
|
|
152
|
+
message: string;
|
|
153
|
+
};
|
|
154
|
+
212: {
|
|
155
|
+
message: string;
|
|
156
|
+
};
|
|
157
|
+
214: {
|
|
158
|
+
message: string;
|
|
159
|
+
};
|
|
160
|
+
215: {
|
|
161
|
+
message: string;
|
|
162
|
+
};
|
|
163
|
+
216: {
|
|
164
|
+
message: string;
|
|
165
|
+
};
|
|
166
|
+
217: {
|
|
167
|
+
message: string;
|
|
168
|
+
};
|
|
169
|
+
218: {
|
|
170
|
+
message: string;
|
|
171
|
+
};
|
|
172
|
+
300: {
|
|
173
|
+
message: string;
|
|
174
|
+
};
|
|
175
|
+
301: {
|
|
176
|
+
message: string;
|
|
177
|
+
};
|
|
178
|
+
302: {
|
|
179
|
+
message: string;
|
|
180
|
+
};
|
|
181
|
+
303: {
|
|
182
|
+
message: string;
|
|
183
|
+
};
|
|
184
|
+
400: {
|
|
185
|
+
message: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export interface PoolContract {
|
|
189
|
+
/**
|
|
190
|
+
* Construct and simulate a initialize transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
191
|
+
*/
|
|
192
|
+
initialize: ({ admin, bridge, a, token, fee_share_bp, balance_ratio_min_bp, admin_fee_share_bp, }: {
|
|
193
|
+
admin: string;
|
|
194
|
+
bridge: string;
|
|
195
|
+
a: u128;
|
|
196
|
+
token: string;
|
|
197
|
+
fee_share_bp: u128;
|
|
198
|
+
balance_ratio_min_bp: u128;
|
|
199
|
+
admin_fee_share_bp: u128;
|
|
200
|
+
}, options?: {
|
|
201
|
+
/**
|
|
202
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
203
|
+
*/
|
|
204
|
+
fee?: number;
|
|
205
|
+
/**
|
|
206
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
207
|
+
*/
|
|
208
|
+
timeoutInSeconds?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
211
|
+
*/
|
|
212
|
+
simulate?: boolean;
|
|
213
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
214
|
+
/**
|
|
215
|
+
* Construct and simulate a deposit transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
216
|
+
*/
|
|
217
|
+
deposit: ({ sender, amount }: {
|
|
218
|
+
sender: string;
|
|
219
|
+
amount: u128;
|
|
220
|
+
}, options?: {
|
|
221
|
+
/**
|
|
222
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
223
|
+
*/
|
|
224
|
+
fee?: number;
|
|
225
|
+
/**
|
|
226
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
227
|
+
*/
|
|
228
|
+
timeoutInSeconds?: number;
|
|
229
|
+
/**
|
|
230
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
231
|
+
*/
|
|
232
|
+
simulate?: boolean;
|
|
233
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
234
|
+
/**
|
|
235
|
+
* Construct and simulate a withdraw transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
236
|
+
*/
|
|
237
|
+
withdraw: ({ sender, amount_lp }: {
|
|
238
|
+
sender: string;
|
|
239
|
+
amount_lp: u128;
|
|
240
|
+
}, options?: {
|
|
241
|
+
/**
|
|
242
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
243
|
+
*/
|
|
244
|
+
fee?: number;
|
|
245
|
+
/**
|
|
246
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
247
|
+
*/
|
|
248
|
+
timeoutInSeconds?: number;
|
|
249
|
+
/**
|
|
250
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
251
|
+
*/
|
|
252
|
+
simulate?: boolean;
|
|
253
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
254
|
+
/**
|
|
255
|
+
* Construct and simulate a swap_to_v_usd transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
256
|
+
*/
|
|
257
|
+
swap_to_v_usd: ({ user, amount, zero_fee }: {
|
|
258
|
+
user: string;
|
|
259
|
+
amount: u128;
|
|
260
|
+
zero_fee: boolean;
|
|
261
|
+
}, options?: {
|
|
262
|
+
/**
|
|
263
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
264
|
+
*/
|
|
265
|
+
fee?: number;
|
|
266
|
+
/**
|
|
267
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
268
|
+
*/
|
|
269
|
+
timeoutInSeconds?: number;
|
|
270
|
+
/**
|
|
271
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
272
|
+
*/
|
|
273
|
+
simulate?: boolean;
|
|
274
|
+
}) => Promise<AssembledTransaction<Result<u128>>>;
|
|
275
|
+
/**
|
|
276
|
+
* Construct and simulate a swap_from_v_usd transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
277
|
+
*/
|
|
278
|
+
swap_from_v_usd: ({ user, vusd_amount, receive_amount_min, zero_fee, }: {
|
|
279
|
+
user: string;
|
|
280
|
+
vusd_amount: u128;
|
|
281
|
+
receive_amount_min: u128;
|
|
282
|
+
zero_fee: boolean;
|
|
283
|
+
}, options?: {
|
|
284
|
+
/**
|
|
285
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
286
|
+
*/
|
|
287
|
+
fee?: number;
|
|
288
|
+
/**
|
|
289
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
290
|
+
*/
|
|
291
|
+
timeoutInSeconds?: number;
|
|
292
|
+
/**
|
|
293
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
294
|
+
*/
|
|
295
|
+
simulate?: boolean;
|
|
296
|
+
}) => Promise<AssembledTransaction<Result<u128>>>;
|
|
297
|
+
/**
|
|
298
|
+
* Construct and simulate a claim_rewards transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
299
|
+
*/
|
|
300
|
+
claim_rewards: ({ sender }: {
|
|
301
|
+
sender: string;
|
|
302
|
+
}, options?: {
|
|
303
|
+
/**
|
|
304
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
305
|
+
*/
|
|
306
|
+
fee?: number;
|
|
307
|
+
/**
|
|
308
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
309
|
+
*/
|
|
310
|
+
timeoutInSeconds?: number;
|
|
311
|
+
/**
|
|
312
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
313
|
+
*/
|
|
314
|
+
simulate?: boolean;
|
|
315
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
316
|
+
/**
|
|
317
|
+
* Construct and simulate a set_fee_share transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. *
|
|
318
|
+
* `admin`
|
|
319
|
+
*/
|
|
320
|
+
set_fee_share: ({ fee_share_bp }: {
|
|
321
|
+
fee_share_bp: u128;
|
|
322
|
+
}, options?: {
|
|
323
|
+
/**
|
|
324
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
325
|
+
*/
|
|
326
|
+
fee?: number;
|
|
327
|
+
/**
|
|
328
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
329
|
+
*/
|
|
330
|
+
timeoutInSeconds?: number;
|
|
331
|
+
/**
|
|
332
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
333
|
+
*/
|
|
334
|
+
simulate?: boolean;
|
|
335
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
336
|
+
/**
|
|
337
|
+
* Construct and simulate a adjust_total_lp_amount transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
338
|
+
*/
|
|
339
|
+
adjust_total_lp_amount: (options?: {
|
|
340
|
+
/**
|
|
341
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
342
|
+
*/
|
|
343
|
+
fee?: number;
|
|
344
|
+
/**
|
|
345
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
346
|
+
*/
|
|
347
|
+
timeoutInSeconds?: number;
|
|
348
|
+
/**
|
|
349
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
350
|
+
*/
|
|
351
|
+
simulate?: boolean;
|
|
352
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
353
|
+
/**
|
|
354
|
+
* Construct and simulate a set_balance_ratio_min_bp transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
355
|
+
*/
|
|
356
|
+
set_balance_ratio_min_bp: ({ balance_ratio_min_bp }: {
|
|
357
|
+
balance_ratio_min_bp: u128;
|
|
358
|
+
}, options?: {
|
|
359
|
+
/**
|
|
360
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
361
|
+
*/
|
|
362
|
+
fee?: number;
|
|
363
|
+
/**
|
|
364
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
365
|
+
*/
|
|
366
|
+
timeoutInSeconds?: number;
|
|
367
|
+
/**
|
|
368
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
369
|
+
*/
|
|
370
|
+
simulate?: boolean;
|
|
371
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
372
|
+
/**
|
|
373
|
+
* Construct and simulate a stop_deposit transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
374
|
+
*/
|
|
375
|
+
stop_deposit: (options?: {
|
|
376
|
+
/**
|
|
377
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
378
|
+
*/
|
|
379
|
+
fee?: number;
|
|
380
|
+
/**
|
|
381
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
382
|
+
*/
|
|
383
|
+
timeoutInSeconds?: number;
|
|
384
|
+
/**
|
|
385
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
386
|
+
*/
|
|
387
|
+
simulate?: boolean;
|
|
388
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
389
|
+
/**
|
|
390
|
+
* Construct and simulate a start_deposit transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
391
|
+
*/
|
|
392
|
+
start_deposit: (options?: {
|
|
393
|
+
/**
|
|
394
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
395
|
+
*/
|
|
396
|
+
fee?: number;
|
|
397
|
+
/**
|
|
398
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
399
|
+
*/
|
|
400
|
+
timeoutInSeconds?: number;
|
|
401
|
+
/**
|
|
402
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
403
|
+
*/
|
|
404
|
+
simulate?: boolean;
|
|
405
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
406
|
+
/**
|
|
407
|
+
* Construct and simulate a stop_withdraw transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
408
|
+
*/
|
|
409
|
+
stop_withdraw: (options?: {
|
|
410
|
+
/**
|
|
411
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
412
|
+
*/
|
|
413
|
+
fee?: number;
|
|
414
|
+
/**
|
|
415
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
416
|
+
*/
|
|
417
|
+
timeoutInSeconds?: number;
|
|
418
|
+
/**
|
|
419
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
420
|
+
*/
|
|
421
|
+
simulate?: boolean;
|
|
422
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
423
|
+
/**
|
|
424
|
+
* Construct and simulate a start_withdraw transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
425
|
+
*/
|
|
426
|
+
start_withdraw: (options?: {
|
|
427
|
+
/**
|
|
428
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
429
|
+
*/
|
|
430
|
+
fee?: number;
|
|
431
|
+
/**
|
|
432
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
433
|
+
*/
|
|
434
|
+
timeoutInSeconds?: number;
|
|
435
|
+
/**
|
|
436
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
437
|
+
*/
|
|
438
|
+
simulate?: boolean;
|
|
439
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
440
|
+
/**
|
|
441
|
+
* Construct and simulate a set_stop_authority transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
442
|
+
*/
|
|
443
|
+
set_stop_authority: ({ stop_authority }: {
|
|
444
|
+
stop_authority: string;
|
|
445
|
+
}, options?: {
|
|
446
|
+
/**
|
|
447
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
448
|
+
*/
|
|
449
|
+
fee?: number;
|
|
450
|
+
/**
|
|
451
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
452
|
+
*/
|
|
453
|
+
timeoutInSeconds?: number;
|
|
454
|
+
/**
|
|
455
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
456
|
+
*/
|
|
457
|
+
simulate?: boolean;
|
|
458
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
459
|
+
/**
|
|
460
|
+
* Construct and simulate a set_bridge transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
461
|
+
*/
|
|
462
|
+
set_bridge: ({ bridge }: {
|
|
463
|
+
bridge: string;
|
|
464
|
+
}, options?: {
|
|
465
|
+
/**
|
|
466
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
467
|
+
*/
|
|
468
|
+
fee?: number;
|
|
469
|
+
/**
|
|
470
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
471
|
+
*/
|
|
472
|
+
timeoutInSeconds?: number;
|
|
473
|
+
/**
|
|
474
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
475
|
+
*/
|
|
476
|
+
simulate?: boolean;
|
|
477
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
478
|
+
/**
|
|
479
|
+
* Construct and simulate a set_admin transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
480
|
+
*/
|
|
481
|
+
set_admin: ({ new_admin }: {
|
|
482
|
+
new_admin: string;
|
|
483
|
+
}, options?: {
|
|
484
|
+
/**
|
|
485
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
486
|
+
*/
|
|
487
|
+
fee?: number;
|
|
488
|
+
/**
|
|
489
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
490
|
+
*/
|
|
491
|
+
timeoutInSeconds?: number;
|
|
492
|
+
/**
|
|
493
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
494
|
+
*/
|
|
495
|
+
simulate?: boolean;
|
|
496
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
497
|
+
/**
|
|
498
|
+
* Construct and simulate a set_admin_fee_share transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
499
|
+
*/
|
|
500
|
+
set_admin_fee_share: ({ admin_fee_share_bp }: {
|
|
501
|
+
admin_fee_share_bp: u128;
|
|
502
|
+
}, options?: {
|
|
503
|
+
/**
|
|
504
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
505
|
+
*/
|
|
506
|
+
fee?: number;
|
|
507
|
+
/**
|
|
508
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
509
|
+
*/
|
|
510
|
+
timeoutInSeconds?: number;
|
|
511
|
+
/**
|
|
512
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
513
|
+
*/
|
|
514
|
+
simulate?: boolean;
|
|
515
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
516
|
+
/**
|
|
517
|
+
* Construct and simulate a claim_admin_fee transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
518
|
+
*/
|
|
519
|
+
claim_admin_fee: (options?: {
|
|
520
|
+
/**
|
|
521
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
522
|
+
*/
|
|
523
|
+
fee?: number;
|
|
524
|
+
/**
|
|
525
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
526
|
+
*/
|
|
527
|
+
timeoutInSeconds?: number;
|
|
528
|
+
/**
|
|
529
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
530
|
+
*/
|
|
531
|
+
simulate?: boolean;
|
|
532
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
533
|
+
/**
|
|
534
|
+
* Construct and simulate a pending_reward transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. *
|
|
535
|
+
* `view`
|
|
536
|
+
*/
|
|
537
|
+
pending_reward: ({ user }: {
|
|
538
|
+
user: string;
|
|
539
|
+
}, options?: {
|
|
540
|
+
/**
|
|
541
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
542
|
+
*/
|
|
543
|
+
fee?: number;
|
|
544
|
+
/**
|
|
545
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
546
|
+
*/
|
|
547
|
+
timeoutInSeconds?: number;
|
|
548
|
+
/**
|
|
549
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
550
|
+
*/
|
|
551
|
+
simulate?: boolean;
|
|
552
|
+
}) => Promise<AssembledTransaction<Result<u128>>>;
|
|
553
|
+
/**
|
|
554
|
+
* Construct and simulate a get_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
555
|
+
*/
|
|
556
|
+
get_pool: (options?: {
|
|
557
|
+
/**
|
|
558
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
559
|
+
*/
|
|
560
|
+
fee?: number;
|
|
561
|
+
/**
|
|
562
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
563
|
+
*/
|
|
564
|
+
timeoutInSeconds?: number;
|
|
565
|
+
/**
|
|
566
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
567
|
+
*/
|
|
568
|
+
simulate?: boolean;
|
|
569
|
+
}) => Promise<AssembledTransaction<Result<Pool>>>;
|
|
570
|
+
/**
|
|
571
|
+
* Construct and simulate a get_admin transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
572
|
+
*/
|
|
573
|
+
get_admin: (options?: {
|
|
574
|
+
/**
|
|
575
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
576
|
+
*/
|
|
577
|
+
fee?: number;
|
|
578
|
+
/**
|
|
579
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
580
|
+
*/
|
|
581
|
+
timeoutInSeconds?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
584
|
+
*/
|
|
585
|
+
simulate?: boolean;
|
|
586
|
+
}) => Promise<AssembledTransaction<Result<string>>>;
|
|
587
|
+
/**
|
|
588
|
+
* Construct and simulate a get_stop_authority transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
589
|
+
*/
|
|
590
|
+
get_stop_authority: (options?: {
|
|
591
|
+
/**
|
|
592
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
593
|
+
*/
|
|
594
|
+
fee?: number;
|
|
595
|
+
/**
|
|
596
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
597
|
+
*/
|
|
598
|
+
timeoutInSeconds?: number;
|
|
599
|
+
/**
|
|
600
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
601
|
+
*/
|
|
602
|
+
simulate?: boolean;
|
|
603
|
+
}) => Promise<AssembledTransaction<Result<string>>>;
|
|
604
|
+
/**
|
|
605
|
+
* Construct and simulate a get_bridge transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
606
|
+
*/
|
|
607
|
+
get_bridge: (options?: {
|
|
608
|
+
/**
|
|
609
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
610
|
+
*/
|
|
611
|
+
fee?: number;
|
|
612
|
+
/**
|
|
613
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
614
|
+
*/
|
|
615
|
+
timeoutInSeconds?: number;
|
|
616
|
+
/**
|
|
617
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
618
|
+
*/
|
|
619
|
+
simulate?: boolean;
|
|
620
|
+
}) => Promise<AssembledTransaction<Result<string>>>;
|
|
621
|
+
/**
|
|
622
|
+
* Construct and simulate a get_user_deposit transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
623
|
+
*/
|
|
624
|
+
get_user_deposit: ({ user }: {
|
|
625
|
+
user: string;
|
|
626
|
+
}, options?: {
|
|
627
|
+
/**
|
|
628
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
629
|
+
*/
|
|
630
|
+
fee?: number;
|
|
631
|
+
/**
|
|
632
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
633
|
+
*/
|
|
634
|
+
timeoutInSeconds?: number;
|
|
635
|
+
/**
|
|
636
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
637
|
+
*/
|
|
638
|
+
simulate?: boolean;
|
|
639
|
+
}) => Promise<AssembledTransaction<Result<UserDeposit>>>;
|
|
640
|
+
/**
|
|
641
|
+
* Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
642
|
+
*/
|
|
643
|
+
upgrade: ({ new_wasm_hash }: {
|
|
644
|
+
new_wasm_hash: Buffer;
|
|
645
|
+
}, options?: {
|
|
646
|
+
/**
|
|
647
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
648
|
+
*/
|
|
649
|
+
fee?: number;
|
|
650
|
+
/**
|
|
651
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
652
|
+
*/
|
|
653
|
+
timeoutInSeconds?: number;
|
|
654
|
+
/**
|
|
655
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
656
|
+
*/
|
|
657
|
+
simulate?: boolean;
|
|
658
|
+
}) => Promise<AssembledTransaction<Result<void>>>;
|
|
659
|
+
}
|
|
660
|
+
export declare class PoolContract extends ContractClient {
|
|
661
|
+
readonly options: ContractClientOptions;
|
|
662
|
+
constructor(options: ContractClientOptions);
|
|
663
|
+
readonly fromJSON: {
|
|
664
|
+
initialize: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
665
|
+
deposit: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
666
|
+
withdraw: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
667
|
+
swap_to_v_usd: (json: string) => contract.AssembledTransaction<contract.Result<bigint, contract.ErrorMessage>>;
|
|
668
|
+
swap_from_v_usd: (json: string) => contract.AssembledTransaction<contract.Result<bigint, contract.ErrorMessage>>;
|
|
669
|
+
claim_rewards: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
670
|
+
set_fee_share: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
671
|
+
adjust_total_lp_amount: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
672
|
+
set_balance_ratio_min_bp: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
673
|
+
stop_deposit: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
674
|
+
start_deposit: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
675
|
+
stop_withdraw: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
676
|
+
start_withdraw: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
677
|
+
set_stop_authority: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
678
|
+
set_bridge: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
679
|
+
set_admin: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
680
|
+
set_admin_fee_share: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
681
|
+
claim_admin_fee: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
682
|
+
pending_reward: (json: string) => contract.AssembledTransaction<contract.Result<bigint, contract.ErrorMessage>>;
|
|
683
|
+
get_pool: (json: string) => contract.AssembledTransaction<contract.Result<Pool, contract.ErrorMessage>>;
|
|
684
|
+
get_admin: (json: string) => contract.AssembledTransaction<contract.Result<string, contract.ErrorMessage>>;
|
|
685
|
+
get_stop_authority: (json: string) => contract.AssembledTransaction<contract.Result<string, contract.ErrorMessage>>;
|
|
686
|
+
get_bridge: (json: string) => contract.AssembledTransaction<contract.Result<string, contract.ErrorMessage>>;
|
|
687
|
+
get_user_deposit: (json: string) => contract.AssembledTransaction<contract.Result<UserDeposit, contract.ErrorMessage>>;
|
|
688
|
+
upgrade: (json: string) => contract.AssembledTransaction<contract.Result<void, contract.ErrorMessage>>;
|
|
689
|
+
};
|
|
690
|
+
}
|