@huma-finance/soroban-credit-manager 0.0.11-beta.7

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 ADDED
@@ -0,0 +1,54 @@
1
+ # tb-creditManager JS
2
+
3
+ JS library for interacting with [Soroban](https://soroban.stellar.org/) smart contract `tb-creditManager` 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 CASGH7RO7Q4H3JOMACIFKIVZDIL7AFHYELXB5JQ6VWTMQ7IMO6GEBRQ5 \
12
+ --output-dir ./path/to/tb-creditManager
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-creditManager": "./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 CASGH7RO7Q4H3JOMACIFKIVZDIL7AFHYELXB5JQ6VWTMQ7IMO6GEBRQ5 --name tb-creditManager"
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-creditManager"
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,629 @@
1
+ /// <reference types="node" />
2
+ import { Buffer } from "buffer";
3
+ import { AssembledTransaction, ContractClient, ContractClientOptions } from "@stellar/stellar-sdk/lib/contract_client/index.js";
4
+ import type { u32, u64, u128, Option } from "@stellar/stellar-sdk/lib/contract_client";
5
+ export * from "@stellar/stellar-sdk";
6
+ export * from "@stellar/stellar-sdk/lib/contract_client/index.js";
7
+ export * from "@stellar/stellar-sdk/lib/rust_types/index.js";
8
+ export declare const networks: {
9
+ readonly testnet: {
10
+ readonly networkPassphrase: "Test SDF Network ; September 2015";
11
+ readonly contractId: "CASGH7RO7Q4H3JOMACIFKIVZDIL7AFHYELXB5JQ6VWTMQ7IMO6GEBRQ5";
12
+ };
13
+ };
14
+ export type ClientDataKey = {
15
+ tag: "Pool";
16
+ values: void;
17
+ } | {
18
+ tag: "PoolStorage";
19
+ values: void;
20
+ } | {
21
+ tag: "CreditStorage";
22
+ values: void;
23
+ };
24
+ export interface CreditManagerAddressesChangedEvent {
25
+ credit_storage: string;
26
+ pool: string;
27
+ pool_storage: string;
28
+ }
29
+ export interface CreditStorageAddressesChangedEvent {
30
+ credit: string;
31
+ credit_manager: string;
32
+ }
33
+ /**
34
+ * A credit has been approved.
35
+ * # Fields:
36
+ * * `borrower` - The address of the borrower.
37
+ * * `credit_hash` - The hash of the credit.
38
+ * * `credit_limit` - The maximum amount that can be borrowed.
39
+ * * `period_duration` - The duration of each pay period, e.g., monthly, quarterly, or semi-annually.
40
+ * * `remaining_periods` - The number of periods before the credit expires.
41
+ * * `yield_bps` - The expected yield expressed in basis points, where 1% is 100, and 100% is 10,000.
42
+ * * `committed_amount` - The amount that the borrower has committed to use. If the used credit
43
+ * is less than this amount, the borrower will be charged yield using this amount.
44
+ * * `designated_start_date` - The date after which the credit can start.
45
+ * * `revolving` - A flag indicating if repeated borrowing is allowed.
46
+ */
47
+ export interface CreditApprovedEvent {
48
+ borrower: string;
49
+ committed_amount: u128;
50
+ credit_hash: Buffer;
51
+ credit_limit: u128;
52
+ designated_start_date: u64;
53
+ period_duration: PayPeriodDuration;
54
+ remaining_periods: u32;
55
+ revolving: boolean;
56
+ yield_bps: u32;
57
+ }
58
+ /**
59
+ * A credit with a committed amount has started.
60
+ * # Fields:
61
+ * * `credit_hash` - The hash of the credit.
62
+ */
63
+ export interface CommittedCreditStartedEvent {
64
+ credit_hash: Buffer;
65
+ }
66
+ /**
67
+ * An existing credit has been closed by an admin.
68
+ * # Fields:
69
+ * * `credit_hash` - The hash of the credit.
70
+ */
71
+ export interface CreditClosedByAdminEvent {
72
+ credit_hash: Buffer;
73
+ }
74
+ /**
75
+ * The credit has been marked as Defaulted.
76
+ * # Fields:
77
+ * * `credit_hash` - The hash of the credit.
78
+ * * `principal_loss` - The principal losses to be written off because of the default.
79
+ * * `yield_loss` - The unpaid yield due to be written off.
80
+ * * `fees_loss` - The unpaid fees to be written off.
81
+ */
82
+ export interface DefaultTriggeredEvent {
83
+ credit_hash: Buffer;
84
+ fees_loss: u128;
85
+ principal_loss: u128;
86
+ yield_loss: u128;
87
+ }
88
+ /**
89
+ * The expiration (maturity) date of a credit has been extended.
90
+ * # Fields:
91
+ * * `credit_hash` - The hash of the credit.
92
+ * * `old_remaining_periods` - The number of remaining pay periods before the extension.
93
+ * * `new_remaining_periods` - The number of remaining pay periods after the extension.
94
+ */
95
+ export interface RemainingPeriodsExtendedEvent {
96
+ credit_hash: Buffer;
97
+ new_remaining_periods: u32;
98
+ old_remaining_periods: u32;
99
+ }
100
+ /**
101
+ * The yield of a credit has been updated.
102
+ * # Fields:
103
+ * * `credit_hash` - The credit hash.
104
+ * * `old_yield_bps` - The old yield in basis points before the update.
105
+ * * `new_yield_bps` - The new yield in basis points after the update.
106
+ */
107
+ export interface YieldUpdatedEvent {
108
+ credit_hash: Buffer;
109
+ new_yield_bps: u32;
110
+ old_yield_bps: u32;
111
+ }
112
+ /**
113
+ * The credit limit and committed amount of a credit have been updated.
114
+ * # Fields:
115
+ * * `credit_hash` - The credit hash.
116
+ * * `old_credit_limit` - The old credit limit before the update.
117
+ * * `new_credit_limit` - The new credit limit after the update.
118
+ * * `old_committed_amount` - The old committed amount before the update.
119
+ * * `new_committed_amount` - The new committed amount after the update.
120
+ */
121
+ export interface LimitAndCommitmentUpdatedEvent {
122
+ credit_hash: Buffer;
123
+ new_committed_amount: u128;
124
+ new_credit_limit: u128;
125
+ old_committed_amount: u128;
126
+ old_credit_limit: u128;
127
+ }
128
+ /**
129
+ * Part or all of the late fee due of a credit has been waived.
130
+ * # Fields:
131
+ * * `credit_hash` - The credit hash.
132
+ * * `old_late_fee` - The amount of late fee before the update.
133
+ * * `new_late_fee` - The amount of late fee after the update.
134
+ */
135
+ export interface LateFeeWaivedEvent {
136
+ credit_hash: Buffer;
137
+ new_late_fee: u128;
138
+ old_late_fee: u128;
139
+ }
140
+ export declare const Errors: {
141
+ 701: {
142
+ message: string;
143
+ };
144
+ 702: {
145
+ message: string;
146
+ };
147
+ 703: {
148
+ message: string;
149
+ };
150
+ 704: {
151
+ message: string;
152
+ };
153
+ 705: {
154
+ message: string;
155
+ };
156
+ 706: {
157
+ message: string;
158
+ };
159
+ 707: {
160
+ message: string;
161
+ };
162
+ 708: {
163
+ message: string;
164
+ };
165
+ 709: {
166
+ message: string;
167
+ };
168
+ 710: {
169
+ message: string;
170
+ };
171
+ 711: {
172
+ message: string;
173
+ };
174
+ 712: {
175
+ message: string;
176
+ };
177
+ 713: {
178
+ message: string;
179
+ };
180
+ 714: {
181
+ message: string;
182
+ };
183
+ 715: {
184
+ message: string;
185
+ };
186
+ };
187
+ export type PayPeriodDuration = {
188
+ tag: "Monthly";
189
+ values: void;
190
+ } | {
191
+ tag: "Quarterly";
192
+ values: void;
193
+ } | {
194
+ tag: "SemiAnnually";
195
+ values: void;
196
+ };
197
+ /**
198
+ * Account billing info refreshed with the updated due amount and date.
199
+ * # Fields:
200
+ * * `credit_hash` - The hash of the credit.
201
+ * * `new_due_date` - The updated due date of the bill.
202
+ * * `next_due` - The amount of next due on the bill.
203
+ * * `total_past_due` - The total amount of past due on the bill.
204
+ */
205
+ export interface BillRefreshedEvent {
206
+ credit_hash: Buffer;
207
+ new_due_date: u64;
208
+ next_due: u128;
209
+ total_past_due: u128;
210
+ }
211
+ export type CreditState = {
212
+ tag: "Deleted";
213
+ values: void;
214
+ } | {
215
+ tag: "Approved";
216
+ values: void;
217
+ } | {
218
+ tag: "GoodStanding";
219
+ values: void;
220
+ } | {
221
+ tag: "Delayed";
222
+ values: void;
223
+ } | {
224
+ tag: "Defaulted";
225
+ values: void;
226
+ };
227
+ /**
228
+ * `CreditConfig` keeps track of the static settings of a credit.
229
+ * A `CreditConfig` is created after the approval of each credit.
230
+ * # Fields:
231
+ * * `credit_limit` - The maximum amount that can be borrowed.
232
+ * * `committed_amount` - The amount that the borrower has committed to use. If the used credit
233
+ * is less than this amount, the borrower will be charged yield using this amount.
234
+ * * `pay_period_duration` - The duration of each pay period, e.g., monthly, quarterly, or semi-annually.
235
+ * * `num_of_periods` - The number of periods before the credit expires.
236
+ * * `yield_bps` - The expected yield expressed in basis points, where 1% is 100, and 100% is 10,000. It means different things
237
+ * for different credit types:
238
+ * 1. For credit line, it is APR.
239
+ * 2. For factoring, it is factoring fee for the given period.
240
+ * 3. For dynamic yield credit, it is the estimated APY.
241
+ * * `revolving` - A flag indicating if repeated borrowing is allowed.
242
+ */
243
+ export interface CreditConfig {
244
+ committed_amount: u128;
245
+ credit_limit: u128;
246
+ num_periods: u32;
247
+ pay_period_duration: PayPeriodDuration;
248
+ revolving: boolean;
249
+ yield_bps: u32;
250
+ }
251
+ export interface CreditRecord {
252
+ missed_periods: u32;
253
+ next_due: u128;
254
+ next_due_date: u64;
255
+ remaining_periods: u32;
256
+ state: CreditState;
257
+ total_past_due: u128;
258
+ unbilled_principal: u128;
259
+ yield_due: u128;
260
+ }
261
+ export interface DueDetail {
262
+ accrued: u128;
263
+ committed: u128;
264
+ late_fee: u128;
265
+ late_fee_updated_date: u64;
266
+ paid: u128;
267
+ principal_past_due: u128;
268
+ yield_past_due: u128;
269
+ }
270
+ export type TranchesPolicyType = {
271
+ tag: "FixedSeniorYield";
272
+ values: void;
273
+ } | {
274
+ tag: "RiskAdjusted";
275
+ values: void;
276
+ };
277
+ export interface PoolSettings {
278
+ default_grace_period_days: u32;
279
+ late_payment_grace_period_days: u32;
280
+ max_credit_line: u128;
281
+ min_deposit_amount: u128;
282
+ pay_period_duration: PayPeriodDuration;
283
+ principal_only_payment_allowed: boolean;
284
+ }
285
+ export interface LPConfig {
286
+ fixed_senior_yield_bps: u32;
287
+ liquidity_cap: u128;
288
+ max_senior_junior_ratio: u32;
289
+ tranches_risk_adjustment_bps: u32;
290
+ withdrawal_lockout_period_days: u32;
291
+ }
292
+ export interface FeeStructure {
293
+ front_loading_fee_bps: u32;
294
+ front_loading_fee_flat: u128;
295
+ late_fee_bps: u32;
296
+ yield_bps: u32;
297
+ }
298
+ export type PoolStatus = {
299
+ tag: "Off";
300
+ values: void;
301
+ } | {
302
+ tag: "On";
303
+ values: void;
304
+ } | {
305
+ tag: "Closed";
306
+ values: void;
307
+ };
308
+ export interface Epoch {
309
+ end_time: u64;
310
+ id: u64;
311
+ }
312
+ export interface AdminRnR {
313
+ liquidity_rate_bps_ea: u32;
314
+ liquidity_rate_bps_pool_owner: u32;
315
+ reward_rate_bps_ea: u32;
316
+ reward_rate_bps_pool_owner: u32;
317
+ }
318
+ export interface TrancheAddresses {
319
+ addrs: Array<Option<string>>;
320
+ }
321
+ export interface TrancheAssets {
322
+ assets: Array<u128>;
323
+ }
324
+ export interface Client {
325
+ /**
326
+ * 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.
327
+ */
328
+ initialize: ({ pool, pool_storage, credit_storage, }: {
329
+ pool: string;
330
+ pool_storage: string;
331
+ credit_storage: string;
332
+ }, options?: {
333
+ /**
334
+ * The fee to pay for the transaction. Default: BASE_FEE
335
+ */
336
+ fee?: number;
337
+ /**
338
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
339
+ */
340
+ timeoutInSeconds?: number;
341
+ /**
342
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
343
+ */
344
+ simulate?: boolean;
345
+ }) => Promise<AssembledTransaction<null>>;
346
+ /**
347
+ * Construct and simulate a set_contract_addrs 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.
348
+ */
349
+ set_contract_addrs: ({ pool_storage, pool, credit_storage, }: {
350
+ pool_storage: string;
351
+ pool: string;
352
+ credit_storage: string;
353
+ }, options?: {
354
+ /**
355
+ * The fee to pay for the transaction. Default: BASE_FEE
356
+ */
357
+ fee?: number;
358
+ /**
359
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
360
+ */
361
+ timeoutInSeconds?: number;
362
+ /**
363
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
364
+ */
365
+ simulate?: boolean;
366
+ }) => Promise<AssembledTransaction<null>>;
367
+ /**
368
+ * Construct and simulate a set_storage_contract_addrs 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.
369
+ */
370
+ set_storage_contract_addrs: ({ credit, credit_manager }: {
371
+ credit: string;
372
+ credit_manager: string;
373
+ }, options?: {
374
+ /**
375
+ * The fee to pay for the transaction. Default: BASE_FEE
376
+ */
377
+ fee?: number;
378
+ /**
379
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
380
+ */
381
+ timeoutInSeconds?: number;
382
+ /**
383
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
384
+ */
385
+ simulate?: boolean;
386
+ }) => Promise<AssembledTransaction<null>>;
387
+ /**
388
+ * Construct and simulate a approve_borrower 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.
389
+ */
390
+ approve_borrower: ({ borrower, credit_limit, num_periods, yield_bps, committed_amount, designated_start_date, revolving, }: {
391
+ borrower: string;
392
+ credit_limit: u128;
393
+ num_periods: u32;
394
+ yield_bps: u32;
395
+ committed_amount: u128;
396
+ designated_start_date: u64;
397
+ revolving: boolean;
398
+ }, options?: {
399
+ /**
400
+ * The fee to pay for the transaction. Default: BASE_FEE
401
+ */
402
+ fee?: number;
403
+ /**
404
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
405
+ */
406
+ timeoutInSeconds?: number;
407
+ /**
408
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
409
+ */
410
+ simulate?: boolean;
411
+ }) => Promise<AssembledTransaction<null>>;
412
+ /**
413
+ * Construct and simulate a start_committed_credit 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.
414
+ */
415
+ start_committed_credit: ({ caller, borrower }: {
416
+ caller: string;
417
+ borrower: string;
418
+ }, options?: {
419
+ /**
420
+ * The fee to pay for the transaction. Default: BASE_FEE
421
+ */
422
+ fee?: number;
423
+ /**
424
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
425
+ */
426
+ timeoutInSeconds?: number;
427
+ /**
428
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
429
+ */
430
+ simulate?: boolean;
431
+ }) => Promise<AssembledTransaction<null>>;
432
+ /**
433
+ * Construct and simulate a refresh_credit 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.
434
+ */
435
+ refresh_credit: ({ borrower }: {
436
+ borrower: string;
437
+ }, options?: {
438
+ /**
439
+ * The fee to pay for the transaction. Default: BASE_FEE
440
+ */
441
+ fee?: number;
442
+ /**
443
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
444
+ */
445
+ timeoutInSeconds?: number;
446
+ /**
447
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
448
+ */
449
+ simulate?: boolean;
450
+ }) => Promise<AssembledTransaction<null>>;
451
+ /**
452
+ * Construct and simulate a is_default_ready 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.
453
+ */
454
+ is_default_ready: ({ borrower }: {
455
+ borrower: string;
456
+ }, options?: {
457
+ /**
458
+ * The fee to pay for the transaction. Default: BASE_FEE
459
+ */
460
+ fee?: number;
461
+ /**
462
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
463
+ */
464
+ timeoutInSeconds?: number;
465
+ /**
466
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
467
+ */
468
+ simulate?: boolean;
469
+ }) => Promise<AssembledTransaction<boolean>>;
470
+ /**
471
+ * Construct and simulate a trigger_default 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.
472
+ */
473
+ trigger_default: ({ borrower }: {
474
+ borrower: string;
475
+ }, options?: {
476
+ /**
477
+ * The fee to pay for the transaction. Default: BASE_FEE
478
+ */
479
+ fee?: number;
480
+ /**
481
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
482
+ */
483
+ timeoutInSeconds?: number;
484
+ /**
485
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
486
+ */
487
+ simulate?: boolean;
488
+ }) => Promise<AssembledTransaction<readonly [u128, u128, u128]>>;
489
+ /**
490
+ * Construct and simulate a update_yield 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.
491
+ */
492
+ update_yield: ({ borrower, new_yield_bps }: {
493
+ borrower: string;
494
+ new_yield_bps: u32;
495
+ }, options?: {
496
+ /**
497
+ * The fee to pay for the transaction. Default: BASE_FEE
498
+ */
499
+ fee?: number;
500
+ /**
501
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
502
+ */
503
+ timeoutInSeconds?: number;
504
+ /**
505
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
506
+ */
507
+ simulate?: boolean;
508
+ }) => Promise<AssembledTransaction<null>>;
509
+ /**
510
+ * Construct and simulate a extend_remaining_period 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.
511
+ */
512
+ extend_remaining_period: ({ borrower, num_of_periods }: {
513
+ borrower: string;
514
+ num_of_periods: u32;
515
+ }, options?: {
516
+ /**
517
+ * The fee to pay for the transaction. Default: BASE_FEE
518
+ */
519
+ fee?: number;
520
+ /**
521
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
522
+ */
523
+ timeoutInSeconds?: number;
524
+ /**
525
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
526
+ */
527
+ simulate?: boolean;
528
+ }) => Promise<AssembledTransaction<null>>;
529
+ /**
530
+ * Construct and simulate a update_limit_and_commitment 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.
531
+ */
532
+ update_limit_and_commitment: ({ borrower, new_credit_limit, new_committed_amount, }: {
533
+ borrower: string;
534
+ new_credit_limit: u128;
535
+ new_committed_amount: u128;
536
+ }, options?: {
537
+ /**
538
+ * The fee to pay for the transaction. Default: BASE_FEE
539
+ */
540
+ fee?: number;
541
+ /**
542
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
543
+ */
544
+ timeoutInSeconds?: number;
545
+ /**
546
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
547
+ */
548
+ simulate?: boolean;
549
+ }) => Promise<AssembledTransaction<null>>;
550
+ /**
551
+ * Construct and simulate a waive_late_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.
552
+ */
553
+ waive_late_fee: ({ borrower, amount }: {
554
+ borrower: string;
555
+ amount: u128;
556
+ }, 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<u128>>;
570
+ /**
571
+ * Construct and simulate a close_credit 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
+ close_credit: ({ caller, borrower }: {
574
+ caller: string;
575
+ borrower: string;
576
+ }, options?: {
577
+ /**
578
+ * The fee to pay for the transaction. Default: BASE_FEE
579
+ */
580
+ fee?: number;
581
+ /**
582
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
583
+ */
584
+ timeoutInSeconds?: number;
585
+ /**
586
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
587
+ */
588
+ simulate?: boolean;
589
+ }) => Promise<AssembledTransaction<null>>;
590
+ /**
591
+ * 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.
592
+ */
593
+ upgrade: ({ new_wasm_hash }: {
594
+ new_wasm_hash: Buffer;
595
+ }, options?: {
596
+ /**
597
+ * The fee to pay for the transaction. Default: BASE_FEE
598
+ */
599
+ fee?: number;
600
+ /**
601
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
602
+ */
603
+ timeoutInSeconds?: number;
604
+ /**
605
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
606
+ */
607
+ simulate?: boolean;
608
+ }) => Promise<AssembledTransaction<null>>;
609
+ }
610
+ export declare class Client extends ContractClient {
611
+ readonly options: ContractClientOptions;
612
+ constructor(options: ContractClientOptions);
613
+ readonly fromJSON: {
614
+ initialize: (json: string) => AssembledTransaction<null>;
615
+ set_contract_addrs: (json: string) => AssembledTransaction<null>;
616
+ set_storage_contract_addrs: (json: string) => AssembledTransaction<null>;
617
+ approve_borrower: (json: string) => AssembledTransaction<null>;
618
+ start_committed_credit: (json: string) => AssembledTransaction<null>;
619
+ refresh_credit: (json: string) => AssembledTransaction<null>;
620
+ is_default_ready: (json: string) => AssembledTransaction<boolean>;
621
+ trigger_default: (json: string) => AssembledTransaction<readonly [bigint, bigint, bigint]>;
622
+ update_yield: (json: string) => AssembledTransaction<null>;
623
+ extend_remaining_period: (json: string) => AssembledTransaction<null>;
624
+ update_limit_and_commitment: (json: string) => AssembledTransaction<null>;
625
+ waive_late_fee: (json: string) => AssembledTransaction<bigint>;
626
+ close_credit: (json: string) => AssembledTransaction<null>;
627
+ upgrade: (json: string) => AssembledTransaction<null>;
628
+ };
629
+ }