@huma-finance/soroban-pool-manager 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 +622 -0
- package/dist/cjs/index.js +118 -0
- package/dist/esm/index.d.ts +622 -0
- package/dist/esm/index.js +100 -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 +622 -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 +798 -0
- package/tsconfig.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# tb-poolManager JS
|
|
2
|
+
|
|
3
|
+
JS library for interacting with [Soroban](https://soroban.stellar.org/) smart contract `tb-poolManager` via Soroban RPC.
|
|
4
|
+
|
|
5
|
+
This library was automatically generated by Soroban CLI using a command similar to:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
soroban contract bindings ts \
|
|
9
|
+
--rpc-url https://soroban-testnet.stellar.org:443 \
|
|
10
|
+
--network-passphrase "Test SDF Network ; September 2015" \
|
|
11
|
+
--contract-id CC7TGDDRSA2R7F6RIW3POEZSH22RG7DYNZX6GY2YGQ2O33E5BZWSMPDT \
|
|
12
|
+
--output-dir ./path/to/tb-poolManager
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The network passphrase and contract ID are exported from [index.ts](./src/index.ts) in the `networks` constant. If you are the one who generated this library and you know that this contract is also deployed to other networks, feel free to update `networks` with other valid options. This will help your contract consumers use this library more easily.
|
|
16
|
+
|
|
17
|
+
# To publish or not to publish
|
|
18
|
+
|
|
19
|
+
This library is suitable for publishing to NPM. You can publish it to NPM using the `npm publish` command.
|
|
20
|
+
|
|
21
|
+
But you don't need to publish this library to NPM to use it. You can add it to your project's `package.json` using a file path:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"tb-poolManager": "./path/to/this/folder"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
However, we've actually encountered [frustration](https://github.com/stellar/soroban-example-dapp/pull/117#discussion_r1232873560) using local libraries with NPM in this way. Though it seems a bit messy, we suggest generating the library directly to your `node_modules` folder automatically after each install by using a `postinstall` script. We've had the least trouble with this approach. NPM will automatically remove what it sees as erroneous directories during the `install` step, and then regenerate them when it gets to your `postinstall` step, which will keep the library up-to-date with your contract.
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
"scripts": {
|
|
33
|
+
"postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org:443 --network-passphrase \"Test SDF Network ; September 2015\" --id CC7TGDDRSA2R7F6RIW3POEZSH22RG7DYNZX6GY2YGQ2O33E5BZWSMPDT --name tb-poolManager"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Obviously you need to adjust the above command based on the actual command you used to generate the library.
|
|
38
|
+
|
|
39
|
+
# Use it
|
|
40
|
+
|
|
41
|
+
Now that you have your library up-to-date and added to your project, you can import it in a file and see inline documentation for all of its exported methods:
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { Contract, networks } from "tb-poolManager"
|
|
45
|
+
|
|
46
|
+
const contract = new Contract({
|
|
47
|
+
...networks.futurenet, // for example; check which networks this library exports
|
|
48
|
+
rpcUrl: '...', // use your own, or find one for testing at https://soroban.stellar.org/docs/reference/rpc#public-rpc-providers
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
contract.|
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
As long as your editor is configured to show JavaScript/TypeScript documentation, you can pause your typing at that `|` to get a list of all exports and inline-documentation for each. It exports a separate [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function for each method in the smart contract, with documentation for each generated from the comments the contract's author included in the original source code.
|
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { AssembledTransaction, ContractClient, ContractClientOptions } from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
2
|
+
import type { u32, u64, u128, Option } from '@stellar/stellar-sdk/lib/contract_client';
|
|
3
|
+
export * from '@stellar/stellar-sdk';
|
|
4
|
+
export * from '@stellar/stellar-sdk/lib/contract_client/index.js';
|
|
5
|
+
export * from '@stellar/stellar-sdk/lib/rust_types/index.js';
|
|
6
|
+
export declare const networks: {
|
|
7
|
+
readonly testnet: {
|
|
8
|
+
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
9
|
+
readonly contractId: "CC7TGDDRSA2R7F6RIW3POEZSH22RG7DYNZX6GY2YGQ2O33E5BZWSMPDT";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ClientDataKey = {
|
|
13
|
+
tag: 'HumaConfig';
|
|
14
|
+
values: void;
|
|
15
|
+
} | {
|
|
16
|
+
tag: 'PoolStorage';
|
|
17
|
+
values: void;
|
|
18
|
+
} | {
|
|
19
|
+
tag: 'Pool';
|
|
20
|
+
values: void;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Event indicating that a new epoch has started.
|
|
24
|
+
* # Fields:
|
|
25
|
+
* * `epoch_id` - The ID of the epoch that just started.
|
|
26
|
+
* * `end_time` - The time when the current epoch should end.
|
|
27
|
+
*/
|
|
28
|
+
export interface NewEpochStartedEvent {
|
|
29
|
+
end_time: u64;
|
|
30
|
+
epoch_id: u64;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Event indicating that the current epoch has closed.
|
|
34
|
+
* # Fields:
|
|
35
|
+
* * `epoch_id` - The ID of the epoch that just closed.
|
|
36
|
+
*/
|
|
37
|
+
export interface EpochClosedEvent {
|
|
38
|
+
epoch_id: u64;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Event indicating that the epoch has been processed after the pool is closed.
|
|
42
|
+
* # Fields:
|
|
43
|
+
* * `epoch_id` - The ID of the epoch that has been processed.
|
|
44
|
+
*/
|
|
45
|
+
export interface EpochProcessedAfterPoolClosureEvent {
|
|
46
|
+
epoch_id: u64;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Event indicating that pending redemption requests have been processed.
|
|
50
|
+
* # Fields:
|
|
51
|
+
* * `senior_tranche_assets` - The total amount of assets in the senior tranche.
|
|
52
|
+
* * `senior_tranche_price` - The LP token price of the senior tranche.
|
|
53
|
+
* * `junior_tranche_assets` - The total amount of assets in the junior tranche.
|
|
54
|
+
* * `junior_tranche_price` - The LP token price of the junior tranche.
|
|
55
|
+
* * `unprocessed_amount` - The amount of assets requested for redemption but not fulfilled.
|
|
56
|
+
*/
|
|
57
|
+
export interface RedemptionRequestsProcessedEvent {
|
|
58
|
+
junior_tranche_assets: u128;
|
|
59
|
+
junior_tranche_price: u128;
|
|
60
|
+
senior_tranche_assets: u128;
|
|
61
|
+
senior_tranche_price: u128;
|
|
62
|
+
unprocessed_amount: u128;
|
|
63
|
+
}
|
|
64
|
+
export declare const Errors: {
|
|
65
|
+
1: {
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
72: {
|
|
69
|
+
message: string;
|
|
70
|
+
};
|
|
71
|
+
21: {
|
|
72
|
+
message: string;
|
|
73
|
+
};
|
|
74
|
+
101: {
|
|
75
|
+
message: string;
|
|
76
|
+
};
|
|
77
|
+
301: {
|
|
78
|
+
message: string;
|
|
79
|
+
};
|
|
80
|
+
54: {
|
|
81
|
+
message: string;
|
|
82
|
+
};
|
|
83
|
+
302: {
|
|
84
|
+
message: string;
|
|
85
|
+
};
|
|
86
|
+
91: {
|
|
87
|
+
message: string;
|
|
88
|
+
};
|
|
89
|
+
92: {
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
92
|
+
93: {
|
|
93
|
+
message: string;
|
|
94
|
+
};
|
|
95
|
+
53: {
|
|
96
|
+
message: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Event indicating that the pool has been enabled.
|
|
101
|
+
* # Fields:
|
|
102
|
+
* * `by` - The address that enabled the pool.
|
|
103
|
+
*/
|
|
104
|
+
export interface PoolEnabledEvent {
|
|
105
|
+
by: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Event indicating that the pool has been disabled.
|
|
109
|
+
* # Fields:
|
|
110
|
+
* * `by` - The address that disabled the pool.
|
|
111
|
+
*/
|
|
112
|
+
export interface PoolDisabledEvent {
|
|
113
|
+
by: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Event indicating that the pool has been closed.
|
|
117
|
+
* # Fields:
|
|
118
|
+
* * `by` - The address that closed the pool.
|
|
119
|
+
*/
|
|
120
|
+
export interface PoolClosedEvent {
|
|
121
|
+
by: string;
|
|
122
|
+
}
|
|
123
|
+
export type PayPeriodDuration = {
|
|
124
|
+
tag: 'Monthly';
|
|
125
|
+
values: void;
|
|
126
|
+
} | {
|
|
127
|
+
tag: 'Quarterly';
|
|
128
|
+
values: void;
|
|
129
|
+
} | {
|
|
130
|
+
tag: 'SemiAnnually';
|
|
131
|
+
values: void;
|
|
132
|
+
};
|
|
133
|
+
export interface PoolSettings {
|
|
134
|
+
default_grace_period_days: u32;
|
|
135
|
+
late_payment_grace_period_days: u32;
|
|
136
|
+
max_credit_line: u128;
|
|
137
|
+
min_deposit_amount: u128;
|
|
138
|
+
pay_period_duration: PayPeriodDuration;
|
|
139
|
+
principal_only_payment_allowed: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface LPConfig {
|
|
142
|
+
fixed_senior_yield_bps: u32;
|
|
143
|
+
liquidity_cap: u128;
|
|
144
|
+
max_senior_junior_ratio: u32;
|
|
145
|
+
tranches_risk_adjustment_bps: u32;
|
|
146
|
+
withdrawal_lockout_period_days: u32;
|
|
147
|
+
}
|
|
148
|
+
export interface FeeStructure {
|
|
149
|
+
front_loading_fee_bps: u32;
|
|
150
|
+
front_loading_fee_flat: u128;
|
|
151
|
+
late_fee_bps: u32;
|
|
152
|
+
yield_bps: u32;
|
|
153
|
+
}
|
|
154
|
+
export type PoolStatus = {
|
|
155
|
+
tag: 'Off';
|
|
156
|
+
values: void;
|
|
157
|
+
} | {
|
|
158
|
+
tag: 'On';
|
|
159
|
+
values: void;
|
|
160
|
+
} | {
|
|
161
|
+
tag: 'Closed';
|
|
162
|
+
values: void;
|
|
163
|
+
};
|
|
164
|
+
export interface CurrentEpoch {
|
|
165
|
+
end_time: u64;
|
|
166
|
+
id: u64;
|
|
167
|
+
}
|
|
168
|
+
export interface AdminRnR {
|
|
169
|
+
liquidity_rate_bps_ea: u32;
|
|
170
|
+
liquidity_rate_bps_pool_owner: u32;
|
|
171
|
+
reward_rate_bps_ea: u32;
|
|
172
|
+
reward_rate_bps_pool_owner: u32;
|
|
173
|
+
}
|
|
174
|
+
export interface TrancheAddresses {
|
|
175
|
+
addrs: Array<Option<string>>;
|
|
176
|
+
}
|
|
177
|
+
export interface TrancheAssets {
|
|
178
|
+
assets: Array<u128>;
|
|
179
|
+
}
|
|
180
|
+
export interface EpochRedemptionSummary {
|
|
181
|
+
epoch_id: u64;
|
|
182
|
+
total_amount_processed: u128;
|
|
183
|
+
total_shares_processed: u128;
|
|
184
|
+
total_shares_requested: u128;
|
|
185
|
+
}
|
|
186
|
+
export interface Client {
|
|
187
|
+
/**
|
|
188
|
+
* 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.
|
|
189
|
+
*/
|
|
190
|
+
initialize: ({ pool_name, huma_config, pool_storage, pool, }: {
|
|
191
|
+
pool_name: string;
|
|
192
|
+
huma_config: string;
|
|
193
|
+
pool_storage: string;
|
|
194
|
+
pool: string;
|
|
195
|
+
}, options?: {
|
|
196
|
+
/**
|
|
197
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
198
|
+
*/
|
|
199
|
+
fee?: number;
|
|
200
|
+
/**
|
|
201
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
202
|
+
*/
|
|
203
|
+
timeoutInSeconds?: number;
|
|
204
|
+
/**
|
|
205
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
206
|
+
*/
|
|
207
|
+
simulate?: boolean;
|
|
208
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
209
|
+
/**
|
|
210
|
+
* Construct and simulate a set_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.
|
|
211
|
+
*/
|
|
212
|
+
set_pool: ({ caller, pool }: {
|
|
213
|
+
caller: string;
|
|
214
|
+
pool: string;
|
|
215
|
+
}, options?: {
|
|
216
|
+
/**
|
|
217
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
218
|
+
*/
|
|
219
|
+
fee?: number;
|
|
220
|
+
/**
|
|
221
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
222
|
+
*/
|
|
223
|
+
timeoutInSeconds?: number;
|
|
224
|
+
/**
|
|
225
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
226
|
+
*/
|
|
227
|
+
simulate?: boolean;
|
|
228
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
229
|
+
/**
|
|
230
|
+
* Construct and simulate a set_pool_storage 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.
|
|
231
|
+
*/
|
|
232
|
+
set_pool_storage: ({ caller, addr }: {
|
|
233
|
+
caller: string;
|
|
234
|
+
addr: string;
|
|
235
|
+
}, options?: {
|
|
236
|
+
/**
|
|
237
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
238
|
+
*/
|
|
239
|
+
fee?: number;
|
|
240
|
+
/**
|
|
241
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
242
|
+
*/
|
|
243
|
+
timeoutInSeconds?: number;
|
|
244
|
+
/**
|
|
245
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
246
|
+
*/
|
|
247
|
+
simulate?: boolean;
|
|
248
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
249
|
+
/**
|
|
250
|
+
* 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.
|
|
251
|
+
*/
|
|
252
|
+
set_huma_config: ({ huma_config }: {
|
|
253
|
+
huma_config: string;
|
|
254
|
+
}, options?: {
|
|
255
|
+
/**
|
|
256
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
257
|
+
*/
|
|
258
|
+
fee?: number;
|
|
259
|
+
/**
|
|
260
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
261
|
+
*/
|
|
262
|
+
timeoutInSeconds?: number;
|
|
263
|
+
/**
|
|
264
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
265
|
+
*/
|
|
266
|
+
simulate?: boolean;
|
|
267
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
268
|
+
/**
|
|
269
|
+
* Construct and simulate a set_pool_name 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.
|
|
270
|
+
*/
|
|
271
|
+
set_pool_name: ({ caller, name }: {
|
|
272
|
+
caller: string;
|
|
273
|
+
name: string;
|
|
274
|
+
}, options?: {
|
|
275
|
+
/**
|
|
276
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
277
|
+
*/
|
|
278
|
+
fee?: number;
|
|
279
|
+
/**
|
|
280
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
281
|
+
*/
|
|
282
|
+
timeoutInSeconds?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
285
|
+
*/
|
|
286
|
+
simulate?: boolean;
|
|
287
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
288
|
+
/**
|
|
289
|
+
* 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.
|
|
290
|
+
*/
|
|
291
|
+
set_admins: ({ caller, pool_owner, pool_owner_treasury, ea, }: {
|
|
292
|
+
caller: string;
|
|
293
|
+
pool_owner: string;
|
|
294
|
+
pool_owner_treasury: string;
|
|
295
|
+
ea: string;
|
|
296
|
+
}, options?: {
|
|
297
|
+
/**
|
|
298
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
299
|
+
*/
|
|
300
|
+
fee?: number;
|
|
301
|
+
/**
|
|
302
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
303
|
+
*/
|
|
304
|
+
timeoutInSeconds?: number;
|
|
305
|
+
/**
|
|
306
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
307
|
+
*/
|
|
308
|
+
simulate?: boolean;
|
|
309
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
310
|
+
/**
|
|
311
|
+
* 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.
|
|
312
|
+
*/
|
|
313
|
+
set_tranche_addresses: ({ caller, junior_addr, senior_addr, }: {
|
|
314
|
+
caller: string;
|
|
315
|
+
junior_addr: string;
|
|
316
|
+
senior_addr: Option<string>;
|
|
317
|
+
}, options?: {
|
|
318
|
+
/**
|
|
319
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
320
|
+
*/
|
|
321
|
+
fee?: number;
|
|
322
|
+
/**
|
|
323
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
324
|
+
*/
|
|
325
|
+
timeoutInSeconds?: number;
|
|
326
|
+
/**
|
|
327
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
328
|
+
*/
|
|
329
|
+
simulate?: boolean;
|
|
330
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
331
|
+
/**
|
|
332
|
+
* 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.
|
|
333
|
+
*/
|
|
334
|
+
set_admin_rnr: ({ caller, pool_owner_reward_rate, pool_owner_liquidity_rate, ea_reward_rate, ea_liquidity_rate, }: {
|
|
335
|
+
caller: string;
|
|
336
|
+
pool_owner_reward_rate: u32;
|
|
337
|
+
pool_owner_liquidity_rate: u32;
|
|
338
|
+
ea_reward_rate: u32;
|
|
339
|
+
ea_liquidity_rate: u32;
|
|
340
|
+
}, options?: {
|
|
341
|
+
/**
|
|
342
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
343
|
+
*/
|
|
344
|
+
fee?: number;
|
|
345
|
+
/**
|
|
346
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
347
|
+
*/
|
|
348
|
+
timeoutInSeconds?: number;
|
|
349
|
+
/**
|
|
350
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
351
|
+
*/
|
|
352
|
+
simulate?: boolean;
|
|
353
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
354
|
+
/**
|
|
355
|
+
* 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.
|
|
356
|
+
*/
|
|
357
|
+
set_pool_settings: ({ caller, max_credit_line, min_deposit_amount, pay_period_duration, late_payment_grace_period_days, default_grace_period_days, principal_only_payment_allowed, }: {
|
|
358
|
+
caller: string;
|
|
359
|
+
max_credit_line: u128;
|
|
360
|
+
min_deposit_amount: u128;
|
|
361
|
+
pay_period_duration: PayPeriodDuration;
|
|
362
|
+
late_payment_grace_period_days: u32;
|
|
363
|
+
default_grace_period_days: u32;
|
|
364
|
+
principal_only_payment_allowed: boolean;
|
|
365
|
+
}, options?: {
|
|
366
|
+
/**
|
|
367
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
368
|
+
*/
|
|
369
|
+
fee?: number;
|
|
370
|
+
/**
|
|
371
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
372
|
+
*/
|
|
373
|
+
timeoutInSeconds?: number;
|
|
374
|
+
/**
|
|
375
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
376
|
+
*/
|
|
377
|
+
simulate?: boolean;
|
|
378
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
379
|
+
/**
|
|
380
|
+
* 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.
|
|
381
|
+
*/
|
|
382
|
+
set_lp_config: ({ caller, liquidity_cap, max_senior_junior_ratio, fixed_senior_yield_bps, tranches_risk_adjustment_bps, withdrawal_lockout_period_days, }: {
|
|
383
|
+
caller: string;
|
|
384
|
+
liquidity_cap: u128;
|
|
385
|
+
max_senior_junior_ratio: u32;
|
|
386
|
+
fixed_senior_yield_bps: u32;
|
|
387
|
+
tranches_risk_adjustment_bps: u32;
|
|
388
|
+
withdrawal_lockout_period_days: u32;
|
|
389
|
+
}, options?: {
|
|
390
|
+
/**
|
|
391
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
392
|
+
*/
|
|
393
|
+
fee?: number;
|
|
394
|
+
/**
|
|
395
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
396
|
+
*/
|
|
397
|
+
timeoutInSeconds?: number;
|
|
398
|
+
/**
|
|
399
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
400
|
+
*/
|
|
401
|
+
simulate?: boolean;
|
|
402
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
403
|
+
/**
|
|
404
|
+
* 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.
|
|
405
|
+
*/
|
|
406
|
+
set_fee_structure: ({ caller, yield_bps, late_fee_bps, front_loading_fee_flat, front_loading_fee_bps, }: {
|
|
407
|
+
caller: string;
|
|
408
|
+
yield_bps: u32;
|
|
409
|
+
late_fee_bps: u32;
|
|
410
|
+
front_loading_fee_flat: u128;
|
|
411
|
+
front_loading_fee_bps: u32;
|
|
412
|
+
}, options?: {
|
|
413
|
+
/**
|
|
414
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
415
|
+
*/
|
|
416
|
+
fee?: number;
|
|
417
|
+
/**
|
|
418
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
419
|
+
*/
|
|
420
|
+
timeoutInSeconds?: number;
|
|
421
|
+
/**
|
|
422
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
423
|
+
*/
|
|
424
|
+
simulate?: boolean;
|
|
425
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
426
|
+
/**
|
|
427
|
+
* Construct and simulate a add_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.
|
|
428
|
+
*/
|
|
429
|
+
add_pool_operator: ({ addr }: {
|
|
430
|
+
addr: string;
|
|
431
|
+
}, options?: {
|
|
432
|
+
/**
|
|
433
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
434
|
+
*/
|
|
435
|
+
fee?: number;
|
|
436
|
+
/**
|
|
437
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
438
|
+
*/
|
|
439
|
+
timeoutInSeconds?: number;
|
|
440
|
+
/**
|
|
441
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
442
|
+
*/
|
|
443
|
+
simulate?: boolean;
|
|
444
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
445
|
+
/**
|
|
446
|
+
* Construct and simulate a remove_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.
|
|
447
|
+
*/
|
|
448
|
+
remove_pool_operator: ({ addr }: {
|
|
449
|
+
addr: string;
|
|
450
|
+
}, options?: {
|
|
451
|
+
/**
|
|
452
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
453
|
+
*/
|
|
454
|
+
fee?: number;
|
|
455
|
+
/**
|
|
456
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
457
|
+
*/
|
|
458
|
+
timeoutInSeconds?: number;
|
|
459
|
+
/**
|
|
460
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
461
|
+
*/
|
|
462
|
+
simulate?: boolean;
|
|
463
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
464
|
+
/**
|
|
465
|
+
* Construct and simulate a enable_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.
|
|
466
|
+
*/
|
|
467
|
+
enable_pool: ({ caller }: {
|
|
468
|
+
caller: string;
|
|
469
|
+
}, options?: {
|
|
470
|
+
/**
|
|
471
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
472
|
+
*/
|
|
473
|
+
fee?: number;
|
|
474
|
+
/**
|
|
475
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
476
|
+
*/
|
|
477
|
+
timeoutInSeconds?: number;
|
|
478
|
+
/**
|
|
479
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
480
|
+
*/
|
|
481
|
+
simulate?: boolean;
|
|
482
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
483
|
+
/**
|
|
484
|
+
* Construct and simulate a disable_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.
|
|
485
|
+
*/
|
|
486
|
+
disable_pool: ({ caller }: {
|
|
487
|
+
caller: string;
|
|
488
|
+
}, options?: {
|
|
489
|
+
/**
|
|
490
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
491
|
+
*/
|
|
492
|
+
fee?: number;
|
|
493
|
+
/**
|
|
494
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
495
|
+
*/
|
|
496
|
+
timeoutInSeconds?: number;
|
|
497
|
+
/**
|
|
498
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
499
|
+
*/
|
|
500
|
+
simulate?: boolean;
|
|
501
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
502
|
+
/**
|
|
503
|
+
* Construct and simulate a close_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.
|
|
504
|
+
*/
|
|
505
|
+
close_pool: ({ caller }: {
|
|
506
|
+
caller: string;
|
|
507
|
+
}, options?: {
|
|
508
|
+
/**
|
|
509
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
510
|
+
*/
|
|
511
|
+
fee?: number;
|
|
512
|
+
/**
|
|
513
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
514
|
+
*/
|
|
515
|
+
timeoutInSeconds?: number;
|
|
516
|
+
/**
|
|
517
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
518
|
+
*/
|
|
519
|
+
simulate?: boolean;
|
|
520
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
521
|
+
/**
|
|
522
|
+
* Construct and simulate a close_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.
|
|
523
|
+
*/
|
|
524
|
+
close_epoch: (options?: {
|
|
525
|
+
/**
|
|
526
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
527
|
+
*/
|
|
528
|
+
fee?: number;
|
|
529
|
+
/**
|
|
530
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
531
|
+
*/
|
|
532
|
+
timeoutInSeconds?: number;
|
|
533
|
+
/**
|
|
534
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
535
|
+
*/
|
|
536
|
+
simulate?: boolean;
|
|
537
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
538
|
+
/**
|
|
539
|
+
* Construct and simulate a withdraw_protocol_fees 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.
|
|
540
|
+
*/
|
|
541
|
+
withdraw_protocol_fees: ({ amount }: {
|
|
542
|
+
amount: u128;
|
|
543
|
+
}, options?: {
|
|
544
|
+
/**
|
|
545
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
546
|
+
*/
|
|
547
|
+
fee?: number;
|
|
548
|
+
/**
|
|
549
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
550
|
+
*/
|
|
551
|
+
timeoutInSeconds?: number;
|
|
552
|
+
/**
|
|
553
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
554
|
+
*/
|
|
555
|
+
simulate?: boolean;
|
|
556
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
557
|
+
/**
|
|
558
|
+
* Construct and simulate a withdraw_pool_owner_fees 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.
|
|
559
|
+
*/
|
|
560
|
+
withdraw_pool_owner_fees: ({ amount }: {
|
|
561
|
+
amount: u128;
|
|
562
|
+
}, options?: {
|
|
563
|
+
/**
|
|
564
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
565
|
+
*/
|
|
566
|
+
fee?: number;
|
|
567
|
+
/**
|
|
568
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
569
|
+
*/
|
|
570
|
+
timeoutInSeconds?: number;
|
|
571
|
+
/**
|
|
572
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
573
|
+
*/
|
|
574
|
+
simulate?: boolean;
|
|
575
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
576
|
+
/**
|
|
577
|
+
* Construct and simulate a withdraw_ea_fees 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.
|
|
578
|
+
*/
|
|
579
|
+
withdraw_ea_fees: ({ caller, amount }: {
|
|
580
|
+
caller: string;
|
|
581
|
+
amount: u128;
|
|
582
|
+
}, options?: {
|
|
583
|
+
/**
|
|
584
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
585
|
+
*/
|
|
586
|
+
fee?: number;
|
|
587
|
+
/**
|
|
588
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
589
|
+
*/
|
|
590
|
+
timeoutInSeconds?: number;
|
|
591
|
+
/**
|
|
592
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
593
|
+
*/
|
|
594
|
+
simulate?: boolean;
|
|
595
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
596
|
+
}
|
|
597
|
+
export declare class Client extends ContractClient {
|
|
598
|
+
readonly options: ContractClientOptions;
|
|
599
|
+
constructor(options: ContractClientOptions);
|
|
600
|
+
readonly fromJSON: {
|
|
601
|
+
initialize: (json: string) => AssembledTransaction<null>;
|
|
602
|
+
set_pool: (json: string) => AssembledTransaction<null>;
|
|
603
|
+
set_pool_storage: (json: string) => AssembledTransaction<null>;
|
|
604
|
+
set_huma_config: (json: string) => AssembledTransaction<null>;
|
|
605
|
+
set_pool_name: (json: string) => AssembledTransaction<null>;
|
|
606
|
+
set_admins: (json: string) => AssembledTransaction<null>;
|
|
607
|
+
set_tranche_addresses: (json: string) => AssembledTransaction<null>;
|
|
608
|
+
set_admin_rnr: (json: string) => AssembledTransaction<null>;
|
|
609
|
+
set_pool_settings: (json: string) => AssembledTransaction<null>;
|
|
610
|
+
set_lp_config: (json: string) => AssembledTransaction<null>;
|
|
611
|
+
set_fee_structure: (json: string) => AssembledTransaction<null>;
|
|
612
|
+
add_pool_operator: (json: string) => AssembledTransaction<null>;
|
|
613
|
+
remove_pool_operator: (json: string) => AssembledTransaction<null>;
|
|
614
|
+
enable_pool: (json: string) => AssembledTransaction<null>;
|
|
615
|
+
disable_pool: (json: string) => AssembledTransaction<null>;
|
|
616
|
+
close_pool: (json: string) => AssembledTransaction<null>;
|
|
617
|
+
close_epoch: (json: string) => AssembledTransaction<null>;
|
|
618
|
+
withdraw_protocol_fees: (json: string) => AssembledTransaction<null>;
|
|
619
|
+
withdraw_pool_owner_fees: (json: string) => AssembledTransaction<null>;
|
|
620
|
+
withdraw_ea_fees: (json: string) => AssembledTransaction<null>;
|
|
621
|
+
};
|
|
622
|
+
}
|