@huma-finance/soroban-pool 0.0.15-beta.53 → 0.0.15-beta.59

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.
@@ -0,0 +1,364 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Buffer } from "buffer";
4
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from "@stellar/stellar-sdk/contract";
5
+ import type { u32, u64, u128, Option } from "@stellar/stellar-sdk/contract";
6
+ export * from "@stellar/stellar-sdk";
7
+ export * as contract from "@stellar/stellar-sdk/contract";
8
+ export * as rpc from "@stellar/stellar-sdk/rpc";
9
+ export declare const networks: {
10
+ readonly unknown: {
11
+ readonly networkPassphrase: "Public Global Stellar Network ; September 2015";
12
+ readonly contractId: "CAOYBU6OQWAF3OZBHW5N6ID7TPAKZBJ27XR63IGTXMWEI3NSNTCYI6SH";
13
+ };
14
+ };
15
+ export interface HumaConfigChangedEvent {
16
+ huma_config: string;
17
+ }
18
+ export interface PoolAddressesChangedEvent {
19
+ credit: string;
20
+ credit_manager: string;
21
+ pool_storage: string;
22
+ }
23
+ export type ClientDataKey = {
24
+ tag: "HumaConfig";
25
+ values: void;
26
+ } | {
27
+ tag: "PoolStorage";
28
+ values: void;
29
+ } | {
30
+ tag: "Credit";
31
+ values: void;
32
+ } | {
33
+ tag: "CreditManager";
34
+ values: void;
35
+ };
36
+ export interface ProfitDistributedEvent {
37
+ junior_total_assets: u128;
38
+ profit: u128;
39
+ senior_total_assets: u128;
40
+ }
41
+ export interface LossDistributedEvent {
42
+ junior_total_assets: u128;
43
+ junior_total_loss: u128;
44
+ loss: u128;
45
+ senior_total_assets: u128;
46
+ senior_total_loss: u128;
47
+ }
48
+ export interface LossRecoveryDistributedEvent {
49
+ junior_total_assets: u128;
50
+ junior_total_loss: u128;
51
+ loss_recovery: u128;
52
+ senior_total_assets: u128;
53
+ senior_total_loss: u128;
54
+ }
55
+ export interface TrancheLosses {
56
+ losses: Array<u128>;
57
+ }
58
+ export interface AccruedIncomes {
59
+ ea_income: u128;
60
+ pool_owner_income: u128;
61
+ protocol_income: u128;
62
+ }
63
+ export type PayPeriodDuration = {
64
+ tag: "Monthly";
65
+ values: void;
66
+ } | {
67
+ tag: "Quarterly";
68
+ values: void;
69
+ } | {
70
+ tag: "SemiAnnually";
71
+ values: void;
72
+ };
73
+ export declare const Errors: {
74
+ 801: {
75
+ message: string;
76
+ };
77
+ 1: {
78
+ message: string;
79
+ };
80
+ 2: {
81
+ message: string;
82
+ };
83
+ 3: {
84
+ message: string;
85
+ };
86
+ 4: {
87
+ message: string;
88
+ };
89
+ 5: {
90
+ message: string;
91
+ };
92
+ 6: {
93
+ message: string;
94
+ };
95
+ 7: {
96
+ message: string;
97
+ };
98
+ };
99
+ export type TranchesPolicyType = {
100
+ tag: "FixedSeniorYield";
101
+ values: void;
102
+ } | {
103
+ tag: "RiskAdjusted";
104
+ values: void;
105
+ };
106
+ export interface PoolSettings {
107
+ default_grace_period_days: u32;
108
+ late_payment_grace_period_days: u32;
109
+ max_credit_line: u128;
110
+ min_deposit_amount: u128;
111
+ pay_period_duration: PayPeriodDuration;
112
+ principal_only_payment_allowed: boolean;
113
+ }
114
+ export interface LPConfig {
115
+ auto_redemption_after_lockup: boolean;
116
+ fixed_senior_yield_bps: u32;
117
+ liquidity_cap: u128;
118
+ max_senior_junior_ratio: u32;
119
+ tranches_risk_adjustment_bps: u32;
120
+ withdrawal_lockout_period_days: u32;
121
+ }
122
+ export interface FeeStructure {
123
+ front_loading_fee_bps: u32;
124
+ front_loading_fee_flat: u128;
125
+ late_fee_bps: u32;
126
+ yield_bps: u32;
127
+ }
128
+ export type PoolStatus = {
129
+ tag: "Off";
130
+ values: void;
131
+ } | {
132
+ tag: "On";
133
+ values: void;
134
+ } | {
135
+ tag: "Closed";
136
+ values: void;
137
+ };
138
+ export interface Epoch {
139
+ end_time: u64;
140
+ id: u64;
141
+ }
142
+ export interface AdminRnR {
143
+ liquidity_rate_bps_ea: u32;
144
+ liquidity_rate_bps_pool_owner: u32;
145
+ reward_rate_bps_ea: u32;
146
+ reward_rate_bps_pool_owner: u32;
147
+ }
148
+ export interface TrancheAddresses {
149
+ addrs: Array<Option<string>>;
150
+ }
151
+ export interface TrancheAssets {
152
+ assets: Array<u128>;
153
+ }
154
+ export interface Client {
155
+ /**
156
+ * 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.
157
+ */
158
+ initialize: ({ huma_config, pool_storage, credit_manager, credit, }: {
159
+ huma_config: string;
160
+ pool_storage: string;
161
+ credit_manager: string;
162
+ credit: string;
163
+ }, options?: {
164
+ /**
165
+ * The fee to pay for the transaction. Default: BASE_FEE
166
+ */
167
+ fee?: number;
168
+ /**
169
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
170
+ */
171
+ timeoutInSeconds?: number;
172
+ /**
173
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
174
+ */
175
+ simulate?: boolean;
176
+ }) => Promise<AssembledTransaction<null>>;
177
+ /**
178
+ * 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.
179
+ */
180
+ set_huma_config: ({ huma_config }: {
181
+ huma_config: string;
182
+ }, options?: {
183
+ /**
184
+ * The fee to pay for the transaction. Default: BASE_FEE
185
+ */
186
+ fee?: number;
187
+ /**
188
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
189
+ */
190
+ timeoutInSeconds?: number;
191
+ /**
192
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
193
+ */
194
+ simulate?: boolean;
195
+ }) => Promise<AssembledTransaction<null>>;
196
+ /**
197
+ * 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.
198
+ */
199
+ set_contract_addrs: ({ caller, pool_storage, credit, credit_manager, }: {
200
+ caller: string;
201
+ pool_storage: string;
202
+ credit: string;
203
+ credit_manager: string;
204
+ }, options?: {
205
+ /**
206
+ * The fee to pay for the transaction. Default: BASE_FEE
207
+ */
208
+ fee?: number;
209
+ /**
210
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
211
+ */
212
+ timeoutInSeconds?: number;
213
+ /**
214
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
215
+ */
216
+ simulate?: boolean;
217
+ }) => Promise<AssembledTransaction<null>>;
218
+ /**
219
+ * 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.
220
+ */
221
+ distribute_profit: ({ caller, profit }: {
222
+ caller: string;
223
+ profit: u128;
224
+ }, options?: {
225
+ /**
226
+ * The fee to pay for the transaction. Default: BASE_FEE
227
+ */
228
+ fee?: number;
229
+ /**
230
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
231
+ */
232
+ timeoutInSeconds?: number;
233
+ /**
234
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
235
+ */
236
+ simulate?: boolean;
237
+ }) => Promise<AssembledTransaction<null>>;
238
+ /**
239
+ * 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.
240
+ */
241
+ distribute_loss: ({ caller, loss }: {
242
+ caller: string;
243
+ loss: u128;
244
+ }, options?: {
245
+ /**
246
+ * The fee to pay for the transaction. Default: BASE_FEE
247
+ */
248
+ fee?: number;
249
+ /**
250
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
251
+ */
252
+ timeoutInSeconds?: number;
253
+ /**
254
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
255
+ */
256
+ simulate?: boolean;
257
+ }) => Promise<AssembledTransaction<null>>;
258
+ /**
259
+ * 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.
260
+ */
261
+ distribute_loss_recovery: ({ caller, loss_recovery }: {
262
+ caller: string;
263
+ loss_recovery: u128;
264
+ }, options?: {
265
+ /**
266
+ * The fee to pay for the transaction. Default: BASE_FEE
267
+ */
268
+ fee?: number;
269
+ /**
270
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
271
+ */
272
+ timeoutInSeconds?: number;
273
+ /**
274
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
275
+ */
276
+ simulate?: boolean;
277
+ }) => Promise<AssembledTransaction<null>>;
278
+ /**
279
+ * 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.
280
+ */
281
+ upgrade: ({ new_wasm_hash }: {
282
+ new_wasm_hash: Buffer;
283
+ }, options?: {
284
+ /**
285
+ * The fee to pay for the transaction. Default: BASE_FEE
286
+ */
287
+ fee?: number;
288
+ /**
289
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
290
+ */
291
+ timeoutInSeconds?: number;
292
+ /**
293
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
294
+ */
295
+ simulate?: boolean;
296
+ }) => Promise<AssembledTransaction<null>>;
297
+ /**
298
+ * 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.
299
+ */
300
+ get_protocol_income_accrued: (options?: {
301
+ /**
302
+ * The fee to pay for the transaction. Default: BASE_FEE
303
+ */
304
+ fee?: number;
305
+ /**
306
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
307
+ */
308
+ timeoutInSeconds?: number;
309
+ /**
310
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
311
+ */
312
+ simulate?: boolean;
313
+ }) => Promise<AssembledTransaction<u128>>;
314
+ /**
315
+ * 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.
316
+ */
317
+ get_pool_owner_income_accrued: (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<u128>>;
331
+ /**
332
+ * 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.
333
+ */
334
+ get_ea_income_accrued: (options?: {
335
+ /**
336
+ * The fee to pay for the transaction. Default: BASE_FEE
337
+ */
338
+ fee?: number;
339
+ /**
340
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
341
+ */
342
+ timeoutInSeconds?: number;
343
+ /**
344
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
345
+ */
346
+ simulate?: boolean;
347
+ }) => Promise<AssembledTransaction<u128>>;
348
+ }
349
+ export declare class Client extends ContractClient {
350
+ readonly options: ContractClientOptions;
351
+ constructor(options: ContractClientOptions);
352
+ readonly fromJSON: {
353
+ initialize: (json: string) => AssembledTransaction<null>;
354
+ set_huma_config: (json: string) => AssembledTransaction<null>;
355
+ set_contract_addrs: (json: string) => AssembledTransaction<null>;
356
+ distribute_profit: (json: string) => AssembledTransaction<null>;
357
+ distribute_loss: (json: string) => AssembledTransaction<null>;
358
+ distribute_loss_recovery: (json: string) => AssembledTransaction<null>;
359
+ upgrade: (json: string) => AssembledTransaction<null>;
360
+ get_protocol_income_accrued: (json: string) => AssembledTransaction<bigint>;
361
+ get_pool_owner_income_accrued: (json: string) => AssembledTransaction<bigint>;
362
+ get_ea_income_accrued: (json: string) => AssembledTransaction<bigint>;
363
+ };
364
+ }
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.Client = exports.Errors = exports.networks = exports.rpc = exports.contract = void 0;
30
+ const buffer_1 = require("buffer");
31
+ const contract_1 = require("@stellar/stellar-sdk/contract");
32
+ __exportStar(require("@stellar/stellar-sdk"), exports);
33
+ exports.contract = __importStar(require("@stellar/stellar-sdk/contract"));
34
+ exports.rpc = __importStar(require("@stellar/stellar-sdk/rpc"));
35
+ if (typeof window !== "undefined") {
36
+ //@ts-ignore Buffer exists
37
+ window.Buffer = window.Buffer || buffer_1.Buffer;
38
+ }
39
+ exports.networks = {
40
+ unknown: {
41
+ networkPassphrase: "Public Global Stellar Network ; September 2015",
42
+ contractId: "CAOYBU6OQWAF3OZBHW5N6ID7TPAKZBJ27XR63IGTXMWEI3NSNTCYI6SH",
43
+ },
44
+ };
45
+ exports.Errors = {
46
+ 801: { message: "StartDateLaterThanEndDate" },
47
+ 1: { message: "AlreadyInitialized" },
48
+ 2: { message: "ProtocolIsPausedOrPoolIsNotOn" },
49
+ 3: { message: "PoolOwnerOrHumaOwnerRequired" },
50
+ 4: { message: "PoolOperatorRequired" },
51
+ 5: { message: "AuthorizedContractCallerRequired" },
52
+ 6: { message: "UnsupportedFunction" },
53
+ 7: { message: "ZeroAmountProvided" },
54
+ };
55
+ class Client extends contract_1.Client {
56
+ options;
57
+ constructor(options) {
58
+ super(new contract_1.Spec([
59
+ "AAAAAQAAAAAAAAAAAAAAFkh1bWFDb25maWdDaGFuZ2VkRXZlbnQAAAAAAAEAAAAAAAAAC2h1bWFfY29uZmlnAAAAABM=",
60
+ "AAAAAQAAAAAAAAAAAAAAGVBvb2xBZGRyZXNzZXNDaGFuZ2VkRXZlbnQAAAAAAAADAAAAAAAAAAZjcmVkaXQAAAAAABMAAAAAAAAADmNyZWRpdF9tYW5hZ2VyAAAAAAATAAAAAAAAAAxwb29sX3N0b3JhZ2UAAAAT",
61
+ "AAAAAgAAAAAAAAAAAAAADUNsaWVudERhdGFLZXkAAAAAAAAEAAAAAAAAAAAAAAAKSHVtYUNvbmZpZwAAAAAAAAAAAAAAAAALUG9vbFN0b3JhZ2UAAAAAAAAAAAAAAAAGQ3JlZGl0AAAAAAAAAAAAAAAAAA1DcmVkaXRNYW5hZ2VyAAAA",
62
+ "AAAAAAAAAAAAAAAKaW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AAAAAAAAAAEFRyYW5jaGVBZGRyZXNzZXMAAAABAAAAAAAAAAVhZGRycwAAAAAAA+oAAAPoAAAAEw==",
88
+ "AAAAAQAAAAAAAAAAAAAADVRyYW5jaGVBc3NldHMAAAAAAAABAAAAAAAAAAZhc3NldHMAAAAAA+oAAAAK",
89
+ ]), options);
90
+ this.options = options;
91
+ }
92
+ fromJSON = {
93
+ initialize: (this.txFromJSON),
94
+ set_huma_config: (this.txFromJSON),
95
+ set_contract_addrs: (this.txFromJSON),
96
+ distribute_profit: (this.txFromJSON),
97
+ distribute_loss: (this.txFromJSON),
98
+ distribute_loss_recovery: (this.txFromJSON),
99
+ upgrade: (this.txFromJSON),
100
+ get_protocol_income_accrued: (this.txFromJSON),
101
+ get_pool_owner_income_accrued: (this.txFromJSON),
102
+ get_ea_income_accrued: (this.txFromJSON),
103
+ };
104
+ }
105
+ exports.Client = Client;
package/package.json CHANGED
@@ -1,11 +1,16 @@
1
1
  {
2
- "version": "0.0.15-beta.53+48bcde7",
2
+ "version": "0.0.15-beta.59+40fd4aa",
3
3
  "name": "@huma-finance/soroban-pool",
4
- "exports": "./dist/index.js",
4
+ "exports": {
5
+ ".": {
6
+ "require": "./dist/cjs/index.js",
7
+ "import": "./dist/index.js"
8
+ }
9
+ },
5
10
  "typings": "dist/index.d.ts",
6
11
  "scripts": {
7
- "build": "tsc",
8
- "clean": "tsc --build --clean"
12
+ "build": "tsc --project ./tsconfig.json && tsc --project ./tsconfig.cjs.json",
13
+ "clean": "tsc --build --clean && rm -rf dist"
9
14
  },
10
15
  "dependencies": {
11
16
  "@stellar/stellar-sdk": "12.1.0",
@@ -18,5 +23,5 @@
18
23
  "access": "public",
19
24
  "registry": "https://registry.npmjs.org/"
20
25
  },
21
- "gitHead": "48bcde79da9c4bdb4f1057dbe42dd290116d3f96"
26
+ "gitHead": "40fd4aa4c664fa6ece33dd926437e8bfdbe346d1"
22
27
  }
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "target": "ESNext",
5
+ "rootDir": "./src",
6
+ "outDir": "./dist/cjs" /* Redirect output structure to the directory. */,
7
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "resolveJsonModule": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "paths": {
14
+ "@stellar/stellar-sdk/contract": [
15
+ "../../node_modules/@stellar/stellar-sdk/lib/contract"
16
+ ],
17
+ "@stellar/stellar-sdk/rpc": [
18
+ "../../node_modules/@stellar/stellar-sdk/lib/rpc"
19
+ ]
20
+ }
21
+ }
22
+ }