@huma-finance/soroban-pool-storage 0.0.8-beta.2
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/README.md +54 -0
- package/dist/cjs/index.d.ts +817 -0
- package/dist/cjs/index.js +135 -0
- package/dist/esm/index.d.ts +817 -0
- package/dist/esm/index.js +117 -0
- package/dist/esm/package.json +1 -0
- package/dist/scripts/tsconfig.cjs.tsbuildinfo +1 -0
- package/dist/scripts/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/scripts/tsconfig.types.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +817 -0
- package/package.json +25 -0
- package/scripts/build.mjs +37 -0
- package/scripts/tsconfig.cjs.json +7 -0
- package/scripts/tsconfig.esm.json +7 -0
- package/scripts/tsconfig.types.json +8 -0
- package/src/index.ts +1061 -0
- package/tsconfig.json +14 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,1061 @@
|
|
|
1
|
+
import { ContractSpec, Address } from '@stellar/stellar-sdk'
|
|
2
|
+
import { Buffer } from 'buffer'
|
|
3
|
+
import {
|
|
4
|
+
AssembledTransaction,
|
|
5
|
+
ContractClient,
|
|
6
|
+
ContractClientOptions,
|
|
7
|
+
} from '@stellar/stellar-sdk/lib/contract_client/index.js'
|
|
8
|
+
import type {
|
|
9
|
+
u32,
|
|
10
|
+
i32,
|
|
11
|
+
u64,
|
|
12
|
+
i64,
|
|
13
|
+
u128,
|
|
14
|
+
i128,
|
|
15
|
+
u256,
|
|
16
|
+
i256,
|
|
17
|
+
Option,
|
|
18
|
+
Typepoint,
|
|
19
|
+
Duration,
|
|
20
|
+
} from '@stellar/stellar-sdk/lib/contract_client'
|
|
21
|
+
import { Result } from '@stellar/stellar-sdk/lib/rust_types/index.js'
|
|
22
|
+
export * from '@stellar/stellar-sdk'
|
|
23
|
+
export * from '@stellar/stellar-sdk/lib/contract_client/index.js'
|
|
24
|
+
export * from '@stellar/stellar-sdk/lib/rust_types/index.js'
|
|
25
|
+
|
|
26
|
+
if (typeof window !== 'undefined') {
|
|
27
|
+
//@ts-ignore Buffer exists
|
|
28
|
+
window.Buffer = window.Buffer || Buffer
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const networks = {
|
|
32
|
+
testnet: {
|
|
33
|
+
networkPassphrase: 'Test SDF Network ; September 2015',
|
|
34
|
+
contractId: 'CAKPKH2G3ALGKW2E5BJFUJ6WR3RXJVGIXEAPVI5S6Q4HKSDCMKEYJSBR',
|
|
35
|
+
},
|
|
36
|
+
} as const
|
|
37
|
+
|
|
38
|
+
export const Errors = {
|
|
39
|
+
8: { message: '' },
|
|
40
|
+
1: { message: '' },
|
|
41
|
+
96: { message: '' },
|
|
42
|
+
97: { message: '' },
|
|
43
|
+
79: { message: '' },
|
|
44
|
+
}
|
|
45
|
+
export type PayPeriodDuration =
|
|
46
|
+
| { tag: 'Monthly'; values: void }
|
|
47
|
+
| { tag: 'Quarterly'; values: void }
|
|
48
|
+
| { tag: 'SemiAnnually'; values: void }
|
|
49
|
+
|
|
50
|
+
export interface PoolSettings {
|
|
51
|
+
default_grace_period_days: u32
|
|
52
|
+
late_payment_grace_period_days: u32
|
|
53
|
+
max_credit_line: u128
|
|
54
|
+
min_deposit_amount: u128
|
|
55
|
+
pay_period_duration: PayPeriodDuration
|
|
56
|
+
principal_only_payment_allowed: boolean
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface LPConfig {
|
|
60
|
+
fixed_senior_yield_bps: u32
|
|
61
|
+
liquidity_cap: u128
|
|
62
|
+
max_senior_junior_ratio: u32
|
|
63
|
+
tranches_risk_adjustment_bps: u32
|
|
64
|
+
withdrawal_lockout_period_days: u32
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface FeeStructure {
|
|
68
|
+
front_loading_fee_bps: u32
|
|
69
|
+
front_loading_fee_flat: u128
|
|
70
|
+
late_fee_bps: u32
|
|
71
|
+
yield_bps: u32
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type PoolStatus =
|
|
75
|
+
| { tag: 'Off'; values: void }
|
|
76
|
+
| { tag: 'On'; values: void }
|
|
77
|
+
| { tag: 'Closed'; values: void }
|
|
78
|
+
|
|
79
|
+
export interface CurrentEpoch {
|
|
80
|
+
end_time: u64
|
|
81
|
+
id: u64
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AdminRnR {
|
|
85
|
+
liquidity_rate_bps_ea: u32
|
|
86
|
+
liquidity_rate_bps_pool_owner: u32
|
|
87
|
+
reward_rate_bps_ea: u32
|
|
88
|
+
reward_rate_bps_pool_owner: u32
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface TrancheAddresses {
|
|
92
|
+
addrs: Array<Option<string>>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface TrancheAssets {
|
|
96
|
+
assets: Array<u128>
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface Client {
|
|
100
|
+
/**
|
|
101
|
+
* 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.
|
|
102
|
+
*/
|
|
103
|
+
initialize: (
|
|
104
|
+
{
|
|
105
|
+
addrs,
|
|
106
|
+
protocol_on,
|
|
107
|
+
pool_status,
|
|
108
|
+
tranche_addrs,
|
|
109
|
+
}: {
|
|
110
|
+
addrs: Array<string>
|
|
111
|
+
protocol_on: boolean
|
|
112
|
+
pool_status: PoolStatus
|
|
113
|
+
tranche_addrs: Array<Option<string>>
|
|
114
|
+
},
|
|
115
|
+
options?: {
|
|
116
|
+
/**
|
|
117
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
118
|
+
*/
|
|
119
|
+
fee?: number
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
123
|
+
*/
|
|
124
|
+
timeoutInSeconds?: number
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
128
|
+
*/
|
|
129
|
+
simulate?: boolean
|
|
130
|
+
},
|
|
131
|
+
) => Promise<AssembledTransaction<null>>
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Construct and simulate a set_pool_manager 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.
|
|
135
|
+
*/
|
|
136
|
+
set_pool_manager: (
|
|
137
|
+
{ addr }: { addr: string },
|
|
138
|
+
options?: {
|
|
139
|
+
/**
|
|
140
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
141
|
+
*/
|
|
142
|
+
fee?: number
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
146
|
+
*/
|
|
147
|
+
timeoutInSeconds?: number
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
151
|
+
*/
|
|
152
|
+
simulate?: boolean
|
|
153
|
+
},
|
|
154
|
+
) => Promise<AssembledTransaction<null>>
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Construct and simulate a set_huma_config 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.
|
|
158
|
+
*/
|
|
159
|
+
set_huma_config: (
|
|
160
|
+
{
|
|
161
|
+
huma_config,
|
|
162
|
+
huma_owner,
|
|
163
|
+
sentinel,
|
|
164
|
+
protocol_on,
|
|
165
|
+
}: {
|
|
166
|
+
huma_config: string
|
|
167
|
+
huma_owner: string
|
|
168
|
+
sentinel: string
|
|
169
|
+
protocol_on: boolean
|
|
170
|
+
},
|
|
171
|
+
options?: {
|
|
172
|
+
/**
|
|
173
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
174
|
+
*/
|
|
175
|
+
fee?: number
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
179
|
+
*/
|
|
180
|
+
timeoutInSeconds?: number
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
184
|
+
*/
|
|
185
|
+
simulate?: boolean
|
|
186
|
+
},
|
|
187
|
+
) => Promise<AssembledTransaction<null>>
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Construct and simulate a set_admins 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
|
+
set_admins: (
|
|
193
|
+
{
|
|
194
|
+
pool_owner,
|
|
195
|
+
pool_owner_treasury,
|
|
196
|
+
ea,
|
|
197
|
+
}: { pool_owner: string; pool_owner_treasury: string; ea: string },
|
|
198
|
+
options?: {
|
|
199
|
+
/**
|
|
200
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
201
|
+
*/
|
|
202
|
+
fee?: number
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
206
|
+
*/
|
|
207
|
+
timeoutInSeconds?: number
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
211
|
+
*/
|
|
212
|
+
simulate?: boolean
|
|
213
|
+
},
|
|
214
|
+
) => Promise<AssembledTransaction<null>>
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Construct and simulate a set_tranche_addresses 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.
|
|
218
|
+
*/
|
|
219
|
+
set_tranche_addresses: (
|
|
220
|
+
{
|
|
221
|
+
junior_addr,
|
|
222
|
+
senior_addr,
|
|
223
|
+
}: { junior_addr: string; senior_addr: Option<string> },
|
|
224
|
+
options?: {
|
|
225
|
+
/**
|
|
226
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
227
|
+
*/
|
|
228
|
+
fee?: number
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
232
|
+
*/
|
|
233
|
+
timeoutInSeconds?: number
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
237
|
+
*/
|
|
238
|
+
simulate?: boolean
|
|
239
|
+
},
|
|
240
|
+
) => Promise<AssembledTransaction<null>>
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Construct and simulate a set_pool_operator 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.
|
|
244
|
+
*/
|
|
245
|
+
set_pool_operator: (
|
|
246
|
+
{ addr, is_operator }: { addr: string; is_operator: boolean },
|
|
247
|
+
options?: {
|
|
248
|
+
/**
|
|
249
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
250
|
+
*/
|
|
251
|
+
fee?: number
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
255
|
+
*/
|
|
256
|
+
timeoutInSeconds?: number
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
260
|
+
*/
|
|
261
|
+
simulate?: boolean
|
|
262
|
+
},
|
|
263
|
+
) => Promise<AssembledTransaction<null>>
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Construct and simulate a set_pool_status 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.
|
|
267
|
+
*/
|
|
268
|
+
set_pool_status: (
|
|
269
|
+
{ status }: { status: PoolStatus },
|
|
270
|
+
options?: {
|
|
271
|
+
/**
|
|
272
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
273
|
+
*/
|
|
274
|
+
fee?: number
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
278
|
+
*/
|
|
279
|
+
timeoutInSeconds?: number
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
283
|
+
*/
|
|
284
|
+
simulate?: boolean
|
|
285
|
+
},
|
|
286
|
+
) => Promise<AssembledTransaction<null>>
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Construct and simulate a set_epoch 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.
|
|
290
|
+
*/
|
|
291
|
+
set_epoch: (
|
|
292
|
+
{ epoch }: { epoch: CurrentEpoch },
|
|
293
|
+
options?: {
|
|
294
|
+
/**
|
|
295
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
296
|
+
*/
|
|
297
|
+
fee?: number
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
301
|
+
*/
|
|
302
|
+
timeoutInSeconds?: number
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
306
|
+
*/
|
|
307
|
+
simulate?: boolean
|
|
308
|
+
},
|
|
309
|
+
) => Promise<AssembledTransaction<null>>
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Construct and simulate a set_admin_rnr 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.
|
|
313
|
+
*/
|
|
314
|
+
set_admin_rnr: (
|
|
315
|
+
{
|
|
316
|
+
pool_owner_reward_rate,
|
|
317
|
+
pool_owner_liquidity_rate,
|
|
318
|
+
ea_reward_rate,
|
|
319
|
+
ea_liquidity_rate,
|
|
320
|
+
}: {
|
|
321
|
+
pool_owner_reward_rate: u32
|
|
322
|
+
pool_owner_liquidity_rate: u32
|
|
323
|
+
ea_reward_rate: u32
|
|
324
|
+
ea_liquidity_rate: u32
|
|
325
|
+
},
|
|
326
|
+
options?: {
|
|
327
|
+
/**
|
|
328
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
329
|
+
*/
|
|
330
|
+
fee?: number
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
334
|
+
*/
|
|
335
|
+
timeoutInSeconds?: number
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
339
|
+
*/
|
|
340
|
+
simulate?: boolean
|
|
341
|
+
},
|
|
342
|
+
) => Promise<AssembledTransaction<null>>
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Construct and simulate a set_pool_settings 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.
|
|
346
|
+
*/
|
|
347
|
+
set_pool_settings: (
|
|
348
|
+
{
|
|
349
|
+
max_credit_line,
|
|
350
|
+
min_deposit_amount,
|
|
351
|
+
pay_period_duration,
|
|
352
|
+
late_payment_grace_period_days,
|
|
353
|
+
default_grace_period_days,
|
|
354
|
+
principal_only_payment_allowed,
|
|
355
|
+
}: {
|
|
356
|
+
max_credit_line: u128
|
|
357
|
+
min_deposit_amount: u128
|
|
358
|
+
pay_period_duration: PayPeriodDuration
|
|
359
|
+
late_payment_grace_period_days: u32
|
|
360
|
+
default_grace_period_days: u32
|
|
361
|
+
principal_only_payment_allowed: boolean
|
|
362
|
+
},
|
|
363
|
+
options?: {
|
|
364
|
+
/**
|
|
365
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
366
|
+
*/
|
|
367
|
+
fee?: number
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
371
|
+
*/
|
|
372
|
+
timeoutInSeconds?: number
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
376
|
+
*/
|
|
377
|
+
simulate?: boolean
|
|
378
|
+
},
|
|
379
|
+
) => Promise<AssembledTransaction<null>>
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Construct and simulate a set_lp_config 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.
|
|
383
|
+
*/
|
|
384
|
+
set_lp_config: (
|
|
385
|
+
{
|
|
386
|
+
liquidity_cap,
|
|
387
|
+
max_senior_junior_ratio,
|
|
388
|
+
fixed_senior_yield_bps,
|
|
389
|
+
tranches_risk_adjustment_bps,
|
|
390
|
+
withdrawal_lockout_period_days,
|
|
391
|
+
}: {
|
|
392
|
+
liquidity_cap: u128
|
|
393
|
+
max_senior_junior_ratio: u32
|
|
394
|
+
fixed_senior_yield_bps: u32
|
|
395
|
+
tranches_risk_adjustment_bps: u32
|
|
396
|
+
withdrawal_lockout_period_days: u32
|
|
397
|
+
},
|
|
398
|
+
options?: {
|
|
399
|
+
/**
|
|
400
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
401
|
+
*/
|
|
402
|
+
fee?: number
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
406
|
+
*/
|
|
407
|
+
timeoutInSeconds?: number
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
411
|
+
*/
|
|
412
|
+
simulate?: boolean
|
|
413
|
+
},
|
|
414
|
+
) => Promise<AssembledTransaction<null>>
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Construct and simulate a set_fee_structure 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.
|
|
418
|
+
*/
|
|
419
|
+
set_fee_structure: (
|
|
420
|
+
{
|
|
421
|
+
yield_bps,
|
|
422
|
+
late_fee_bps,
|
|
423
|
+
front_loading_fee_flat,
|
|
424
|
+
front_loading_fee_bps,
|
|
425
|
+
}: {
|
|
426
|
+
yield_bps: u32
|
|
427
|
+
late_fee_bps: u32
|
|
428
|
+
front_loading_fee_flat: u128
|
|
429
|
+
front_loading_fee_bps: u32
|
|
430
|
+
},
|
|
431
|
+
options?: {
|
|
432
|
+
/**
|
|
433
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
434
|
+
*/
|
|
435
|
+
fee?: number
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
439
|
+
*/
|
|
440
|
+
timeoutInSeconds?: number
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
444
|
+
*/
|
|
445
|
+
simulate?: boolean
|
|
446
|
+
},
|
|
447
|
+
) => Promise<AssembledTransaction<null>>
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Construct and simulate a send_tokens 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.
|
|
451
|
+
*/
|
|
452
|
+
send_tokens: (
|
|
453
|
+
{ to, amount, caller }: { to: string; amount: u128; caller: string },
|
|
454
|
+
options?: {
|
|
455
|
+
/**
|
|
456
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
457
|
+
*/
|
|
458
|
+
fee?: number
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
462
|
+
*/
|
|
463
|
+
timeoutInSeconds?: number
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
467
|
+
*/
|
|
468
|
+
simulate?: boolean
|
|
469
|
+
},
|
|
470
|
+
) => Promise<AssembledTransaction<null>>
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Construct and simulate a add_tranche_assets 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.
|
|
474
|
+
*/
|
|
475
|
+
add_tranche_assets: (
|
|
476
|
+
{ addr, amount }: { addr: string; amount: u128 },
|
|
477
|
+
options?: {
|
|
478
|
+
/**
|
|
479
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
480
|
+
*/
|
|
481
|
+
fee?: number
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
485
|
+
*/
|
|
486
|
+
timeoutInSeconds?: number
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
490
|
+
*/
|
|
491
|
+
simulate?: boolean
|
|
492
|
+
},
|
|
493
|
+
) => Promise<AssembledTransaction<null>>
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Construct and simulate a reduce_tranche_assets 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.
|
|
497
|
+
*/
|
|
498
|
+
reduce_tranche_assets: (
|
|
499
|
+
{ addr, amount }: { addr: string; amount: u128 },
|
|
500
|
+
options?: {
|
|
501
|
+
/**
|
|
502
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
503
|
+
*/
|
|
504
|
+
fee?: number
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
508
|
+
*/
|
|
509
|
+
timeoutInSeconds?: number
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
513
|
+
*/
|
|
514
|
+
simulate?: boolean
|
|
515
|
+
},
|
|
516
|
+
) => Promise<AssembledTransaction<null>>
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Construct and simulate a update_assets 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.
|
|
520
|
+
*/
|
|
521
|
+
update_assets: (
|
|
522
|
+
{
|
|
523
|
+
junior_assets,
|
|
524
|
+
senior_assets,
|
|
525
|
+
}: { junior_assets: u128; senior_assets: u128 },
|
|
526
|
+
options?: {
|
|
527
|
+
/**
|
|
528
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
529
|
+
*/
|
|
530
|
+
fee?: number
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
534
|
+
*/
|
|
535
|
+
timeoutInSeconds?: number
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
539
|
+
*/
|
|
540
|
+
simulate?: boolean
|
|
541
|
+
},
|
|
542
|
+
) => Promise<AssembledTransaction<null>>
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Construct and simulate a get_pool_settings 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.
|
|
546
|
+
*/
|
|
547
|
+
get_pool_settings: (options?: {
|
|
548
|
+
/**
|
|
549
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
550
|
+
*/
|
|
551
|
+
fee?: number
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
555
|
+
*/
|
|
556
|
+
timeoutInSeconds?: number
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
560
|
+
*/
|
|
561
|
+
simulate?: boolean
|
|
562
|
+
}) => Promise<AssembledTransaction<PoolSettings>>
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* Construct and simulate a get_lp_config 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.
|
|
566
|
+
*/
|
|
567
|
+
get_lp_config: (options?: {
|
|
568
|
+
/**
|
|
569
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
570
|
+
*/
|
|
571
|
+
fee?: number
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
575
|
+
*/
|
|
576
|
+
timeoutInSeconds?: number
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
580
|
+
*/
|
|
581
|
+
simulate?: boolean
|
|
582
|
+
}) => Promise<AssembledTransaction<LPConfig>>
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Construct and simulate a get_fee_structure 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.
|
|
586
|
+
*/
|
|
587
|
+
get_fee_structure: (options?: {
|
|
588
|
+
/**
|
|
589
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
590
|
+
*/
|
|
591
|
+
fee?: number
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
595
|
+
*/
|
|
596
|
+
timeoutInSeconds?: number
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
600
|
+
*/
|
|
601
|
+
simulate?: boolean
|
|
602
|
+
}) => Promise<AssembledTransaction<FeeStructure>>
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Construct and simulate a get_admin_rnr 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_admin_rnr: (options?: {
|
|
608
|
+
/**
|
|
609
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
610
|
+
*/
|
|
611
|
+
fee?: number
|
|
612
|
+
|
|
613
|
+
/**
|
|
614
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
615
|
+
*/
|
|
616
|
+
timeoutInSeconds?: number
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
620
|
+
*/
|
|
621
|
+
simulate?: boolean
|
|
622
|
+
}) => Promise<AssembledTransaction<AdminRnR>>
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Construct and simulate a pool_owner 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.
|
|
626
|
+
*/
|
|
627
|
+
pool_owner: (options?: {
|
|
628
|
+
/**
|
|
629
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
630
|
+
*/
|
|
631
|
+
fee?: number
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
635
|
+
*/
|
|
636
|
+
timeoutInSeconds?: number
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
640
|
+
*/
|
|
641
|
+
simulate?: boolean
|
|
642
|
+
}) => Promise<AssembledTransaction<string>>
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* Construct and simulate a is_pool_owner_or_huma_owner 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.
|
|
646
|
+
*/
|
|
647
|
+
is_pool_owner_or_huma_owner: (
|
|
648
|
+
{ addr }: { addr: string },
|
|
649
|
+
options?: {
|
|
650
|
+
/**
|
|
651
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
652
|
+
*/
|
|
653
|
+
fee?: number
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
657
|
+
*/
|
|
658
|
+
timeoutInSeconds?: number
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
662
|
+
*/
|
|
663
|
+
simulate?: boolean
|
|
664
|
+
},
|
|
665
|
+
) => Promise<AssembledTransaction<boolean>>
|
|
666
|
+
|
|
667
|
+
/**
|
|
668
|
+
* Construct and simulate a is_pool_operator 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.
|
|
669
|
+
*/
|
|
670
|
+
is_pool_operator: (
|
|
671
|
+
{ addr }: { addr: string },
|
|
672
|
+
options?: {
|
|
673
|
+
/**
|
|
674
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
675
|
+
*/
|
|
676
|
+
fee?: number
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
680
|
+
*/
|
|
681
|
+
timeoutInSeconds?: number
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
685
|
+
*/
|
|
686
|
+
simulate?: boolean
|
|
687
|
+
},
|
|
688
|
+
) => Promise<AssembledTransaction<boolean>>
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* Construct and simulate a is_protocol_and_pool_on 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.
|
|
692
|
+
*/
|
|
693
|
+
is_protocol_and_pool_on: (options?: {
|
|
694
|
+
/**
|
|
695
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
696
|
+
*/
|
|
697
|
+
fee?: number
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
701
|
+
*/
|
|
702
|
+
timeoutInSeconds?: number
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
706
|
+
*/
|
|
707
|
+
simulate?: boolean
|
|
708
|
+
}) => Promise<AssembledTransaction<boolean>>
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Construct and simulate a get_evaluation_agent 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.
|
|
712
|
+
*/
|
|
713
|
+
get_evaluation_agent: (options?: {
|
|
714
|
+
/**
|
|
715
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
716
|
+
*/
|
|
717
|
+
fee?: number
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
721
|
+
*/
|
|
722
|
+
timeoutInSeconds?: number
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
726
|
+
*/
|
|
727
|
+
simulate?: boolean
|
|
728
|
+
}) => Promise<AssembledTransaction<string>>
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Construct and simulate a get_sentinel 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.
|
|
732
|
+
*/
|
|
733
|
+
get_sentinel: (options?: {
|
|
734
|
+
/**
|
|
735
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
736
|
+
*/
|
|
737
|
+
fee?: number
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
741
|
+
*/
|
|
742
|
+
timeoutInSeconds?: number
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
746
|
+
*/
|
|
747
|
+
simulate?: boolean
|
|
748
|
+
}) => Promise<AssembledTransaction<string>>
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Construct and simulate a pool_owner_treasury 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.
|
|
752
|
+
*/
|
|
753
|
+
pool_owner_treasury: (options?: {
|
|
754
|
+
/**
|
|
755
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
756
|
+
*/
|
|
757
|
+
fee?: number
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
761
|
+
*/
|
|
762
|
+
timeoutInSeconds?: number
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
766
|
+
*/
|
|
767
|
+
simulate?: boolean
|
|
768
|
+
}) => Promise<AssembledTransaction<string>>
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Construct and simulate a get_pool_status 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.
|
|
772
|
+
*/
|
|
773
|
+
get_pool_status: (options?: {
|
|
774
|
+
/**
|
|
775
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
776
|
+
*/
|
|
777
|
+
fee?: number
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
781
|
+
*/
|
|
782
|
+
timeoutInSeconds?: number
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
786
|
+
*/
|
|
787
|
+
simulate?: boolean
|
|
788
|
+
}) => Promise<AssembledTransaction<PoolStatus>>
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Construct and simulate a get_current_epoch 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.
|
|
792
|
+
*/
|
|
793
|
+
get_current_epoch: (options?: {
|
|
794
|
+
/**
|
|
795
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
796
|
+
*/
|
|
797
|
+
fee?: number
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
801
|
+
*/
|
|
802
|
+
timeoutInSeconds?: number
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
806
|
+
*/
|
|
807
|
+
simulate?: boolean
|
|
808
|
+
}) => Promise<AssembledTransaction<CurrentEpoch>>
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Construct and simulate a get_tranche_assets_by_addr 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.
|
|
812
|
+
*/
|
|
813
|
+
get_tranche_assets_by_addr: (
|
|
814
|
+
{ addr }: { addr: string },
|
|
815
|
+
options?: {
|
|
816
|
+
/**
|
|
817
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
818
|
+
*/
|
|
819
|
+
fee?: number
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
823
|
+
*/
|
|
824
|
+
timeoutInSeconds?: number
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
828
|
+
*/
|
|
829
|
+
simulate?: boolean
|
|
830
|
+
},
|
|
831
|
+
) => Promise<AssembledTransaction<u128>>
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Construct and simulate a get_tranche_assets 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.
|
|
835
|
+
*/
|
|
836
|
+
get_tranche_assets: (options?: {
|
|
837
|
+
/**
|
|
838
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
839
|
+
*/
|
|
840
|
+
fee?: number
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
844
|
+
*/
|
|
845
|
+
timeoutInSeconds?: number
|
|
846
|
+
|
|
847
|
+
/**
|
|
848
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
849
|
+
*/
|
|
850
|
+
simulate?: boolean
|
|
851
|
+
}) => Promise<AssembledTransaction<TrancheAssets>>
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Construct and simulate a get_tranche_addresses 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.
|
|
855
|
+
*/
|
|
856
|
+
get_tranche_addresses: (options?: {
|
|
857
|
+
/**
|
|
858
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
859
|
+
*/
|
|
860
|
+
fee?: number
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
864
|
+
*/
|
|
865
|
+
timeoutInSeconds?: number
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
869
|
+
*/
|
|
870
|
+
simulate?: boolean
|
|
871
|
+
}) => Promise<AssembledTransaction<TrancheAddresses>>
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Construct and simulate a check_liquidity_requirements 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.
|
|
875
|
+
*/
|
|
876
|
+
check_liquidity_requirements: (
|
|
877
|
+
{
|
|
878
|
+
lender,
|
|
879
|
+
tranche_vault,
|
|
880
|
+
balance,
|
|
881
|
+
}: { lender: string; tranche_vault: string; balance: u128 },
|
|
882
|
+
options?: {
|
|
883
|
+
/**
|
|
884
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
885
|
+
*/
|
|
886
|
+
fee?: number
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
890
|
+
*/
|
|
891
|
+
timeoutInSeconds?: number
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
895
|
+
*/
|
|
896
|
+
simulate?: boolean
|
|
897
|
+
},
|
|
898
|
+
) => Promise<AssembledTransaction<null>>
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Construct and simulate a get_underlying_token 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.
|
|
902
|
+
*/
|
|
903
|
+
get_underlying_token: (options?: {
|
|
904
|
+
/**
|
|
905
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
906
|
+
*/
|
|
907
|
+
fee?: number
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
911
|
+
*/
|
|
912
|
+
timeoutInSeconds?: number
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
916
|
+
*/
|
|
917
|
+
simulate?: boolean
|
|
918
|
+
}) => Promise<AssembledTransaction<string>>
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Construct and simulate a get_available_balance 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.
|
|
922
|
+
*/
|
|
923
|
+
get_available_balance: (options?: {
|
|
924
|
+
/**
|
|
925
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
926
|
+
*/
|
|
927
|
+
fee?: number
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
931
|
+
*/
|
|
932
|
+
timeoutInSeconds?: number
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
936
|
+
*/
|
|
937
|
+
simulate?: boolean
|
|
938
|
+
}) => Promise<AssembledTransaction<u128>>
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* Construct and simulate a reduce_admin_fees_reserve 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.
|
|
942
|
+
*/
|
|
943
|
+
reduce_admin_fees_reserve: (
|
|
944
|
+
{
|
|
945
|
+
caller,
|
|
946
|
+
amount,
|
|
947
|
+
increase,
|
|
948
|
+
}: { caller: string; amount: u128; increase: boolean },
|
|
949
|
+
options?: {
|
|
950
|
+
/**
|
|
951
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
952
|
+
*/
|
|
953
|
+
fee?: number
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
957
|
+
*/
|
|
958
|
+
timeoutInSeconds?: number
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
962
|
+
*/
|
|
963
|
+
simulate?: boolean
|
|
964
|
+
},
|
|
965
|
+
) => Promise<AssembledTransaction<null>>
|
|
966
|
+
}
|
|
967
|
+
export class Client extends ContractClient {
|
|
968
|
+
constructor(public readonly options: ContractClientOptions) {
|
|
969
|
+
super(
|
|
970
|
+
new ContractSpec([
|
|
971
|
+
'AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAABAAAAAAAAAAFYWRkcnMAAAAAAAPqAAAAEwAAAAAAAAALcHJvdG9jb2xfb24AAAAAAQAAAAAAAAALcG9vbF9zdGF0dXMAAAAH0AAAAApQb29sU3RhdHVzAAAAAAAAAAAADXRyYW5jaGVfYWRkcnMAAAAAAAPqAAAD6AAAABMAAAAA',
|
|
972
|
+
'AAAAAAAAAAAAAAAQc2V0X3Bvb2xfbWFuYWdlcgAAAAEAAAAAAAAABGFkZHIAAAATAAAAAA==',
|
|
973
|
+
'AAAAAAAAAAAAAAAPc2V0X2h1bWFfY29uZmlnAAAAAAQAAAAAAAAAC2h1bWFfY29uZmlnAAAAABMAAAAAAAAACmh1bWFfb3duZXIAAAAAABMAAAAAAAAACH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V9icHNfZWEAAAAAAAQAAAAAAAAAGnJld2FyZF9yYXRlX2Jwc19wb29sX293bmVyAAAAAAAE',
|
|
1017
|
+
'AAAAAQAAAAAAAAAAAAAAEFRyYW5jaGVBZGRyZXNzZXMAAAABAAAAAAAAAAVhZGRycwAAAAAAA+oAAAPoAAAAEw==',
|
|
1018
|
+
'AAAAAQAAAAAAAAAAAAAADVRyYW5jaGVBc3NldHMAAAAAAAABAAAAAAAAAAZhc3NldHMAAAAAA+oAAAAK',
|
|
1019
|
+
]),
|
|
1020
|
+
options,
|
|
1021
|
+
)
|
|
1022
|
+
}
|
|
1023
|
+
public readonly fromJSON = {
|
|
1024
|
+
initialize: this.txFromJSON<null>,
|
|
1025
|
+
set_pool_manager: this.txFromJSON<null>,
|
|
1026
|
+
set_huma_config: this.txFromJSON<null>,
|
|
1027
|
+
set_admins: this.txFromJSON<null>,
|
|
1028
|
+
set_tranche_addresses: this.txFromJSON<null>,
|
|
1029
|
+
set_pool_operator: this.txFromJSON<null>,
|
|
1030
|
+
set_pool_status: this.txFromJSON<null>,
|
|
1031
|
+
set_epoch: this.txFromJSON<null>,
|
|
1032
|
+
set_admin_rnr: this.txFromJSON<null>,
|
|
1033
|
+
set_pool_settings: this.txFromJSON<null>,
|
|
1034
|
+
set_lp_config: this.txFromJSON<null>,
|
|
1035
|
+
set_fee_structure: this.txFromJSON<null>,
|
|
1036
|
+
send_tokens: this.txFromJSON<null>,
|
|
1037
|
+
add_tranche_assets: this.txFromJSON<null>,
|
|
1038
|
+
reduce_tranche_assets: this.txFromJSON<null>,
|
|
1039
|
+
update_assets: this.txFromJSON<null>,
|
|
1040
|
+
get_pool_settings: this.txFromJSON<PoolSettings>,
|
|
1041
|
+
get_lp_config: this.txFromJSON<LPConfig>,
|
|
1042
|
+
get_fee_structure: this.txFromJSON<FeeStructure>,
|
|
1043
|
+
get_admin_rnr: this.txFromJSON<AdminRnR>,
|
|
1044
|
+
pool_owner: this.txFromJSON<string>,
|
|
1045
|
+
is_pool_owner_or_huma_owner: this.txFromJSON<boolean>,
|
|
1046
|
+
is_pool_operator: this.txFromJSON<boolean>,
|
|
1047
|
+
is_protocol_and_pool_on: this.txFromJSON<boolean>,
|
|
1048
|
+
get_evaluation_agent: this.txFromJSON<string>,
|
|
1049
|
+
get_sentinel: this.txFromJSON<string>,
|
|
1050
|
+
pool_owner_treasury: this.txFromJSON<string>,
|
|
1051
|
+
get_pool_status: this.txFromJSON<PoolStatus>,
|
|
1052
|
+
get_current_epoch: this.txFromJSON<CurrentEpoch>,
|
|
1053
|
+
get_tranche_assets_by_addr: this.txFromJSON<u128>,
|
|
1054
|
+
get_tranche_assets: this.txFromJSON<TrancheAssets>,
|
|
1055
|
+
get_tranche_addresses: this.txFromJSON<TrancheAddresses>,
|
|
1056
|
+
check_liquidity_requirements: this.txFromJSON<null>,
|
|
1057
|
+
get_underlying_token: this.txFromJSON<string>,
|
|
1058
|
+
get_available_balance: this.txFromJSON<u128>,
|
|
1059
|
+
reduce_admin_fees_reserve: this.txFromJSON<null>,
|
|
1060
|
+
}
|
|
1061
|
+
}
|