@huma-finance/soroban-pool 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/src/index.ts ADDED
@@ -0,0 +1,536 @@
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: 'CC2GGLIHX5E75QIXB7G27EOC47V74PXA33KGYDQH4DFISIVZPWQRBVJV',
35
+ },
36
+ } as const
37
+
38
+ export type ClientDataKey =
39
+ | { tag: 'HumaConfig'; values: void }
40
+ | { tag: 'PoolStorage'; values: void }
41
+ | { tag: 'Credit'; values: void }
42
+ | { tag: 'PoolManager'; values: void }
43
+
44
+ /**
45
+ * Event for the distribution of profit in the pool.
46
+ * # Fields:
47
+ * * `profit` - The amount of profit distributed.
48
+ * * `senior_total_assets` - The total amount of senior assets post profit distribution.
49
+ * * `junior_total_assets` - The total amount of junior assets post profit distribution.
50
+ */
51
+ export interface ProfitDistributedEvent {
52
+ junior_total_assets: u128
53
+ profit: u128
54
+ senior_total_assets: u128
55
+ }
56
+
57
+ /**
58
+ * Event for the distribution of loss in the pool.
59
+ * # Fields:
60
+ * * `loss` - The amount of loss distributed.
61
+ * * `senior_total_assets` - The total amount of senior assets post loss distribution.
62
+ * * `junior_total_assets` - The total amount of junior assets post loss distribution.
63
+ * * `senior_total_loss` - The total amount of loss the senior tranche suffered post loss distribution.
64
+ * * `junior_total_loss` - The total amount of loss the junior tranche suffered post loss distribution.
65
+ */
66
+ export interface LossDistributedEvent {
67
+ junior_total_assets: u128
68
+ junior_total_loss: u128
69
+ loss: u128
70
+ senior_total_assets: u128
71
+ senior_total_loss: u128
72
+ }
73
+
74
+ /**
75
+ * Event for the distribution of loss recovery in the pool.
76
+ * # Fields:
77
+ * * `loss_recovery` - The amount of loss recovery distributed.
78
+ * * `senior_total_assets` - The total amount of senior assets post loss recovery distribution.
79
+ * * `junior_total_assets` - The total amount of junior assets post loss recovery distribution.
80
+ * * `senior_total_loss` - The remaining amount of loss the senior tranche suffered post loss recovery distribution.
81
+ * * `junior_total_loss` - The remaining amount of loss the junior tranche suffered post loss recovery distribution.
82
+ */
83
+ export interface LossRecoveryDistributedEvent {
84
+ junior_total_assets: u128
85
+ junior_total_loss: u128
86
+ loss_recovery: u128
87
+ senior_total_assets: u128
88
+ senior_total_loss: u128
89
+ }
90
+
91
+ export interface TranchesPolicyTypeChangedEvent {
92
+ policy_type: TranchesPolicyType
93
+ }
94
+
95
+ /**
96
+ * The senior yield tracker has been refreshed.
97
+ * # Fields:
98
+ * * `total_assets` - The total assets in the senior tranche after the refresh.
99
+ * * `unpaid_yield` - The amount of unpaid yield to the senior tranche after the refresh.
100
+ * * `last_updated_date` - The last time the tracker was updated after the refresh.
101
+ */
102
+ export interface YieldTrackerRefreshedEvent {
103
+ last_updated_date: u64
104
+ total_assets: u128
105
+ unpaid_yield: u128
106
+ }
107
+
108
+ export type FixedSeniorYieldTranchesPolicyDataKey = {
109
+ tag: 'SeniorYieldTracker'
110
+ values: void
111
+ }
112
+
113
+ export interface SeniorYieldTracker {
114
+ last_updated_date: u64
115
+ total_assets: u128
116
+ unpaid_yield: u128
117
+ }
118
+
119
+ export interface FixedSeniorYieldTranchesPolicy {
120
+ placeholder: boolean
121
+ }
122
+
123
+ export interface RiskAdjustedTranchesPolicy {
124
+ placeholder: boolean
125
+ }
126
+
127
+ export type TranchesPolicyType =
128
+ | { tag: 'FixedSeniorYield'; values: void }
129
+ | { tag: 'RiskAdjusted'; values: void }
130
+
131
+ export interface TrancheLosses {
132
+ losses: Array<u128>
133
+ }
134
+
135
+ export interface AccruedIncomes {
136
+ ea_income: u128
137
+ pool_owner_income: u128
138
+ protocol_income: u128
139
+ }
140
+
141
+ export type PayPeriodDuration =
142
+ | { tag: 'Monthly'; values: void }
143
+ | { tag: 'Quarterly'; values: void }
144
+ | { tag: 'SemiAnnually'; values: void }
145
+
146
+ export interface PoolSettings {
147
+ default_grace_period_days: u32
148
+ late_payment_grace_period_days: u32
149
+ max_credit_line: u128
150
+ min_deposit_amount: u128
151
+ pay_period_duration: PayPeriodDuration
152
+ principal_only_payment_allowed: boolean
153
+ }
154
+
155
+ export interface LPConfig {
156
+ fixed_senior_yield_bps: u32
157
+ liquidity_cap: u128
158
+ max_senior_junior_ratio: u32
159
+ tranches_risk_adjustment_bps: u32
160
+ withdrawal_lockout_period_days: u32
161
+ }
162
+
163
+ export interface FeeStructure {
164
+ front_loading_fee_bps: u32
165
+ front_loading_fee_flat: u128
166
+ late_fee_bps: u32
167
+ yield_bps: u32
168
+ }
169
+
170
+ export type PoolStatus =
171
+ | { tag: 'Off'; values: void }
172
+ | { tag: 'On'; values: void }
173
+ | { tag: 'Closed'; values: void }
174
+
175
+ export interface CurrentEpoch {
176
+ end_time: u64
177
+ id: u64
178
+ }
179
+
180
+ export interface AdminRnR {
181
+ liquidity_rate_bps_ea: u32
182
+ liquidity_rate_bps_pool_owner: u32
183
+ reward_rate_bps_ea: u32
184
+ reward_rate_bps_pool_owner: u32
185
+ }
186
+
187
+ export interface TrancheAddresses {
188
+ addrs: Array<Option<string>>
189
+ }
190
+
191
+ export interface TrancheAssets {
192
+ assets: Array<u128>
193
+ }
194
+
195
+ export interface Client {
196
+ /**
197
+ * 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.
198
+ */
199
+ initialize: (
200
+ {
201
+ huma_config,
202
+ pool_manager,
203
+ pool_storage,
204
+ credit,
205
+ tranches_policy,
206
+ }: {
207
+ huma_config: string
208
+ pool_manager: string
209
+ pool_storage: string
210
+ credit: string
211
+ tranches_policy: TranchesPolicyType
212
+ },
213
+ options?: {
214
+ /**
215
+ * The fee to pay for the transaction. Default: BASE_FEE
216
+ */
217
+ fee?: number
218
+
219
+ /**
220
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
221
+ */
222
+ timeoutInSeconds?: number
223
+
224
+ /**
225
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
226
+ */
227
+ simulate?: boolean
228
+ },
229
+ ) => Promise<AssembledTransaction<null>>
230
+
231
+ /**
232
+ * 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.
233
+ */
234
+ set_huma_config: (
235
+ { addr, caller }: { addr: string; caller: string },
236
+ options?: {
237
+ /**
238
+ * The fee to pay for the transaction. Default: BASE_FEE
239
+ */
240
+ fee?: number
241
+
242
+ /**
243
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
244
+ */
245
+ timeoutInSeconds?: number
246
+
247
+ /**
248
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
249
+ */
250
+ simulate?: boolean
251
+ },
252
+ ) => Promise<AssembledTransaction<null>>
253
+
254
+ /**
255
+ * 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.
256
+ */
257
+ set_pool_storage: (
258
+ { addr, caller }: { addr: string; caller: string },
259
+ options?: {
260
+ /**
261
+ * The fee to pay for the transaction. Default: BASE_FEE
262
+ */
263
+ fee?: number
264
+
265
+ /**
266
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
267
+ */
268
+ timeoutInSeconds?: number
269
+
270
+ /**
271
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
272
+ */
273
+ simulate?: boolean
274
+ },
275
+ ) => Promise<AssembledTransaction<null>>
276
+
277
+ /**
278
+ * Construct and simulate a set_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.
279
+ */
280
+ set_credit: (
281
+ { addr, caller }: { addr: string; caller: string },
282
+ options?: {
283
+ /**
284
+ * The fee to pay for the transaction. Default: BASE_FEE
285
+ */
286
+ fee?: number
287
+
288
+ /**
289
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
290
+ */
291
+ timeoutInSeconds?: number
292
+
293
+ /**
294
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
295
+ */
296
+ simulate?: boolean
297
+ },
298
+ ) => Promise<AssembledTransaction<null>>
299
+
300
+ /**
301
+ * 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.
302
+ */
303
+ set_pool_manager: (
304
+ { addr, caller }: { addr: string; caller: string },
305
+ options?: {
306
+ /**
307
+ * The fee to pay for the transaction. Default: BASE_FEE
308
+ */
309
+ fee?: number
310
+
311
+ /**
312
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
313
+ */
314
+ timeoutInSeconds?: number
315
+
316
+ /**
317
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
318
+ */
319
+ simulate?: boolean
320
+ },
321
+ ) => Promise<AssembledTransaction<null>>
322
+
323
+ /**
324
+ * Construct and simulate a set_tranches_policy_type 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.
325
+ */
326
+ set_tranches_policy_type: (
327
+ {
328
+ caller,
329
+ policy_type,
330
+ }: { caller: string; policy_type: TranchesPolicyType },
331
+ options?: {
332
+ /**
333
+ * The fee to pay for the transaction. Default: BASE_FEE
334
+ */
335
+ fee?: number
336
+
337
+ /**
338
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
339
+ */
340
+ timeoutInSeconds?: number
341
+
342
+ /**
343
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
344
+ */
345
+ simulate?: boolean
346
+ },
347
+ ) => Promise<AssembledTransaction<null>>
348
+
349
+ /**
350
+ * Construct and simulate a distribute_profit 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.
351
+ */
352
+ distribute_profit: (
353
+ { profit }: { profit: u128 },
354
+ options?: {
355
+ /**
356
+ * The fee to pay for the transaction. Default: BASE_FEE
357
+ */
358
+ fee?: number
359
+
360
+ /**
361
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
362
+ */
363
+ timeoutInSeconds?: number
364
+
365
+ /**
366
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
367
+ */
368
+ simulate?: boolean
369
+ },
370
+ ) => Promise<AssembledTransaction<null>>
371
+
372
+ /**
373
+ * Construct and simulate a distribute_loss transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
374
+ */
375
+ distribute_loss: (
376
+ { loss }: { loss: u128 },
377
+ options?: {
378
+ /**
379
+ * The fee to pay for the transaction. Default: BASE_FEE
380
+ */
381
+ fee?: number
382
+
383
+ /**
384
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
385
+ */
386
+ timeoutInSeconds?: number
387
+
388
+ /**
389
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
390
+ */
391
+ simulate?: boolean
392
+ },
393
+ ) => Promise<AssembledTransaction<null>>
394
+
395
+ /**
396
+ * Construct and simulate a distribute_loss_recovery 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.
397
+ */
398
+ distribute_loss_recovery: (
399
+ { loss_recovery }: { loss_recovery: u128 },
400
+ options?: {
401
+ /**
402
+ * The fee to pay for the transaction. Default: BASE_FEE
403
+ */
404
+ fee?: number
405
+
406
+ /**
407
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
408
+ */
409
+ timeoutInSeconds?: number
410
+
411
+ /**
412
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
413
+ */
414
+ simulate?: boolean
415
+ },
416
+ ) => Promise<AssembledTransaction<null>>
417
+
418
+ /**
419
+ * Construct and simulate a get_protocol_income_accrued 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.
420
+ */
421
+ get_protocol_income_accrued: (options?: {
422
+ /**
423
+ * The fee to pay for the transaction. Default: BASE_FEE
424
+ */
425
+ fee?: number
426
+
427
+ /**
428
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
429
+ */
430
+ timeoutInSeconds?: number
431
+
432
+ /**
433
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
434
+ */
435
+ simulate?: boolean
436
+ }) => Promise<AssembledTransaction<u128>>
437
+
438
+ /**
439
+ * Construct and simulate a get_pool_owner_income_accrued 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.
440
+ */
441
+ get_pool_owner_income_accrued: (options?: {
442
+ /**
443
+ * The fee to pay for the transaction. Default: BASE_FEE
444
+ */
445
+ fee?: number
446
+
447
+ /**
448
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
449
+ */
450
+ timeoutInSeconds?: number
451
+
452
+ /**
453
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
454
+ */
455
+ simulate?: boolean
456
+ }) => Promise<AssembledTransaction<u128>>
457
+
458
+ /**
459
+ * Construct and simulate a get_ea_income_accrued 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.
460
+ */
461
+ get_ea_income_accrued: (options?: {
462
+ /**
463
+ * The fee to pay for the transaction. Default: BASE_FEE
464
+ */
465
+ fee?: number
466
+
467
+ /**
468
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
469
+ */
470
+ timeoutInSeconds?: number
471
+
472
+ /**
473
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
474
+ */
475
+ simulate?: boolean
476
+ }) => Promise<AssembledTransaction<u128>>
477
+ }
478
+ export class Client extends ContractClient {
479
+ constructor(public readonly options: ContractClientOptions) {
480
+ super(
481
+ new ContractSpec([
482
+ 'AAAAAgAAAAAAAAAAAAAADUNsaWVudERhdGFLZXkAAAAAAAAEAAAAAAAAAAAAAAAKSHVtYUNvbmZpZwAAAAAAAAAAAAAAAAALUG9vbFN0b3JhZ2UAAAAAAAAAAAAAAAAGQ3JlZGl0AAAAAAAAAAAAAAAAAAtQb29sTWFuYWdlcgA=',
483
+ 'AAAAAAAAAAAAAAAKaW5pdGlhbGl6ZQAAAAAABQAAAAAAAAALaHVtYV9jb25maWcAAAAAEwAAAAAAAAAMcG9vbF9tYW5hZ2VyAAAAEwAAAAAAAAAMcG9vbF9zdG9yYWdlAAAAEwAAAAAAAAAGY3JlZGl0AAAAAAATAAAAAAAAAA90cmFuY2hlc19wb2xpY3kAAAAH0AAAABJUcmFuY2hlc1BvbGlje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mdfZmVlX2ZsYXQAAAAAAAoAAAAAAAAADGxhdGVfZmVlX2JwcwAAAAQAAAAAAAAACXlpZWxkX2JwcwAAAAAAAAQ=',
513
+ 'AAAAAgAAAAAAAAAAAAAAClBvb2xTdGF0dXMAAAAAAAMAAAAAAAAAAAAAAANPZmYAAAAAAAAAAAAAAAACT24AAAAAAAAAAAAAAAAABkNsb3NlZAAA',
514
+ 'AAAAAQAAAAAAAAAAAAAADEN1cnJlbnRFcG9jaAAAAAIAAAAAAAAACGVuZF90aW1lAAAABgAAAAAAAAACaWQAAAAAAAY=',
515
+ 'AAAAAQAAAAAAAAAAAAAACEFkbWluUm5SAAAABAAAAAAAAAAVbGlxdWlkaXR5X3JhdGVfYnBzX2VhAAAAAAAABAAAAAAAAAAdbGlxdWlkaXR5X3JhdGVfYnBzX3Bvb2xfb3duZXIAAAAAAAAEAAAAAAAAABJyZXdhcmRfcmF0ZV9icHNfZWEAAAAAAAQAAAAAAAAAGnJld2FyZF9yYXRlX2Jwc19wb29sX293bmVyAAAAAAAE',
516
+ 'AAAAAQAAAAAAAAAAAAAAEFRyYW5jaGVBZGRyZXNzZXMAAAABAAAAAAAAAAVhZGRycwAAAAAAA+oAAAPoAAAAEw==',
517
+ 'AAAAAQAAAAAAAAAAAAAADVRyYW5jaGVBc3NldHMAAAAAAAABAAAAAAAAAAZhc3NldHMAAAAAA+oAAAAK',
518
+ ]),
519
+ options,
520
+ )
521
+ }
522
+ public readonly fromJSON = {
523
+ initialize: this.txFromJSON<null>,
524
+ set_huma_config: this.txFromJSON<null>,
525
+ set_pool_storage: this.txFromJSON<null>,
526
+ set_credit: this.txFromJSON<null>,
527
+ set_pool_manager: this.txFromJSON<null>,
528
+ set_tranches_policy_type: this.txFromJSON<null>,
529
+ distribute_profit: this.txFromJSON<null>,
530
+ distribute_loss: this.txFromJSON<null>,
531
+ distribute_loss_recovery: this.txFromJSON<null>,
532
+ get_protocol_income_accrued: this.txFromJSON<u128>,
533
+ get_pool_owner_income_accrued: this.txFromJSON<u128>,
534
+ get_ea_income_accrued: this.txFromJSON<u128>,
535
+ }
536
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "include": ["src/**/*"],
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "rootDir": "./src",
8
+ "outDir": "dist",
9
+ "moduleResolution": "node",
10
+ "declaration": true,
11
+ "strictNullChecks": true,
12
+ "skipLibCheck": true
13
+ }
14
+ }