@huma-finance/soroban-pool 0.0.31 → 0.0.32-beta.179
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/dist/cjs/index.d.ts +29 -147
- package/dist/cjs/index.js +12 -5
- package/dist/index.d.ts +29 -147
- package/dist/index.js +12 -5
- package/package.json +4 -4
- package/src/index.ts +40 -179
- package/tsconfig.cjs.json +2 -10
- package/tsconfig.tsbuildinfo +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from
|
|
3
|
-
import type { u32, u64, u128, Option } from
|
|
4
|
-
export * from
|
|
5
|
-
export * as contract from
|
|
6
|
-
export * as rpc from
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
import type { u32, u64, u128, Option } from "@stellar/stellar-sdk/contract";
|
|
4
|
+
export * from "@stellar/stellar-sdk";
|
|
5
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
6
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
7
7
|
export declare const networks: {
|
|
8
8
|
readonly testnet: {
|
|
9
9
|
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
10
|
-
readonly contractId: "
|
|
10
|
+
readonly contractId: "CDREMNHXG3UJEKTARVE3G3BPOM3Y5U65T6NYYYWAYM6BSHGXNUQW6TTY";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export interface HumaConfigChangedEvent {
|
|
@@ -68,10 +68,12 @@ export type PayPeriodDuration = {
|
|
|
68
68
|
tag: "SemiAnnually";
|
|
69
69
|
values: void;
|
|
70
70
|
};
|
|
71
|
-
export declare const
|
|
71
|
+
export declare const CalendarError: {
|
|
72
72
|
801: {
|
|
73
73
|
message: string;
|
|
74
74
|
};
|
|
75
|
+
};
|
|
76
|
+
export declare const CommonError: {
|
|
75
77
|
1: {
|
|
76
78
|
message: string;
|
|
77
79
|
};
|
|
@@ -158,39 +160,13 @@ export interface Client {
|
|
|
158
160
|
pool_storage: string;
|
|
159
161
|
credit_manager: string;
|
|
160
162
|
credit: string;
|
|
161
|
-
}, options?:
|
|
162
|
-
/**
|
|
163
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
164
|
-
*/
|
|
165
|
-
fee?: number;
|
|
166
|
-
/**
|
|
167
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
168
|
-
*/
|
|
169
|
-
timeoutInSeconds?: number;
|
|
170
|
-
/**
|
|
171
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
172
|
-
*/
|
|
173
|
-
simulate?: boolean;
|
|
174
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
163
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
175
164
|
/**
|
|
176
165
|
* 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.
|
|
177
166
|
*/
|
|
178
167
|
set_huma_config: ({ huma_config }: {
|
|
179
168
|
huma_config: string;
|
|
180
|
-
}, options?:
|
|
181
|
-
/**
|
|
182
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
183
|
-
*/
|
|
184
|
-
fee?: number;
|
|
185
|
-
/**
|
|
186
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
187
|
-
*/
|
|
188
|
-
timeoutInSeconds?: number;
|
|
189
|
-
/**
|
|
190
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
191
|
-
*/
|
|
192
|
-
simulate?: boolean;
|
|
193
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
169
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
194
170
|
/**
|
|
195
171
|
* 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.
|
|
196
172
|
*/
|
|
@@ -199,153 +175,59 @@ export interface Client {
|
|
|
199
175
|
pool_storage: string;
|
|
200
176
|
credit: string;
|
|
201
177
|
credit_manager: string;
|
|
202
|
-
}, options?:
|
|
203
|
-
/**
|
|
204
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
205
|
-
*/
|
|
206
|
-
fee?: number;
|
|
207
|
-
/**
|
|
208
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
209
|
-
*/
|
|
210
|
-
timeoutInSeconds?: number;
|
|
211
|
-
/**
|
|
212
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
213
|
-
*/
|
|
214
|
-
simulate?: boolean;
|
|
215
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
178
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
216
179
|
/**
|
|
217
180
|
* 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.
|
|
218
181
|
*/
|
|
219
182
|
distribute_profit: ({ caller, profit }: {
|
|
220
183
|
caller: string;
|
|
221
184
|
profit: u128;
|
|
222
|
-
}, options?:
|
|
223
|
-
/**
|
|
224
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
225
|
-
*/
|
|
226
|
-
fee?: number;
|
|
227
|
-
/**
|
|
228
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
229
|
-
*/
|
|
230
|
-
timeoutInSeconds?: number;
|
|
231
|
-
/**
|
|
232
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
233
|
-
*/
|
|
234
|
-
simulate?: boolean;
|
|
235
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
185
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
236
186
|
/**
|
|
237
187
|
* 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.
|
|
238
188
|
*/
|
|
239
189
|
distribute_loss: ({ caller, loss }: {
|
|
240
190
|
caller: string;
|
|
241
191
|
loss: u128;
|
|
242
|
-
}, options?:
|
|
243
|
-
/**
|
|
244
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
245
|
-
*/
|
|
246
|
-
fee?: number;
|
|
247
|
-
/**
|
|
248
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
249
|
-
*/
|
|
250
|
-
timeoutInSeconds?: number;
|
|
251
|
-
/**
|
|
252
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
253
|
-
*/
|
|
254
|
-
simulate?: boolean;
|
|
255
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
192
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
256
193
|
/**
|
|
257
194
|
* 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.
|
|
258
195
|
*/
|
|
259
196
|
distribute_loss_recovery: ({ caller, loss_recovery }: {
|
|
260
197
|
caller: string;
|
|
261
198
|
loss_recovery: u128;
|
|
262
|
-
}, options?:
|
|
263
|
-
/**
|
|
264
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
265
|
-
*/
|
|
266
|
-
fee?: number;
|
|
267
|
-
/**
|
|
268
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
269
|
-
*/
|
|
270
|
-
timeoutInSeconds?: number;
|
|
271
|
-
/**
|
|
272
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
273
|
-
*/
|
|
274
|
-
simulate?: boolean;
|
|
275
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
199
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
276
200
|
/**
|
|
277
201
|
* 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.
|
|
278
202
|
*/
|
|
279
203
|
upgrade: ({ new_wasm_hash }: {
|
|
280
204
|
new_wasm_hash: Buffer;
|
|
281
|
-
}, options?:
|
|
282
|
-
/**
|
|
283
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
284
|
-
*/
|
|
285
|
-
fee?: number;
|
|
286
|
-
/**
|
|
287
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
288
|
-
*/
|
|
289
|
-
timeoutInSeconds?: number;
|
|
290
|
-
/**
|
|
291
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
292
|
-
*/
|
|
293
|
-
simulate?: boolean;
|
|
294
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
205
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
295
206
|
/**
|
|
296
207
|
* 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.
|
|
297
208
|
*/
|
|
298
|
-
get_protocol_income_accrued: (options?:
|
|
299
|
-
/**
|
|
300
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
301
|
-
*/
|
|
302
|
-
fee?: number;
|
|
303
|
-
/**
|
|
304
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
305
|
-
*/
|
|
306
|
-
timeoutInSeconds?: number;
|
|
307
|
-
/**
|
|
308
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
309
|
-
*/
|
|
310
|
-
simulate?: boolean;
|
|
311
|
-
}) => Promise<AssembledTransaction<u128>>;
|
|
209
|
+
get_protocol_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
312
210
|
/**
|
|
313
211
|
* 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.
|
|
314
212
|
*/
|
|
315
|
-
get_pool_owner_income_accrued: (options?:
|
|
316
|
-
/**
|
|
317
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
318
|
-
*/
|
|
319
|
-
fee?: number;
|
|
320
|
-
/**
|
|
321
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
322
|
-
*/
|
|
323
|
-
timeoutInSeconds?: number;
|
|
324
|
-
/**
|
|
325
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
326
|
-
*/
|
|
327
|
-
simulate?: boolean;
|
|
328
|
-
}) => Promise<AssembledTransaction<u128>>;
|
|
213
|
+
get_pool_owner_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
329
214
|
/**
|
|
330
215
|
* 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.
|
|
331
216
|
*/
|
|
332
|
-
get_ea_income_accrued: (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<u128>>;
|
|
217
|
+
get_ea_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
346
218
|
}
|
|
347
219
|
export declare class Client extends ContractClient {
|
|
348
220
|
readonly options: ContractClientOptions;
|
|
221
|
+
static deploy<T = Client>(
|
|
222
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
223
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
224
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
225
|
+
wasmHash: Buffer | string;
|
|
226
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
227
|
+
salt?: Buffer | Uint8Array;
|
|
228
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
229
|
+
format?: "hex" | "base64";
|
|
230
|
+
}): Promise<AssembledTransaction<T>>;
|
|
349
231
|
constructor(options: ContractClientOptions);
|
|
350
232
|
readonly fromJSON: {
|
|
351
233
|
initialize: (json: string) => AssembledTransaction<null>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,24 +36,26 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Client = exports.
|
|
39
|
+
exports.Client = exports.CommonError = exports.CalendarError = exports.networks = exports.rpc = exports.contract = void 0;
|
|
40
40
|
const buffer_1 = require("buffer");
|
|
41
41
|
const contract_1 = require("@stellar/stellar-sdk/contract");
|
|
42
42
|
__exportStar(require("@stellar/stellar-sdk"), exports);
|
|
43
43
|
exports.contract = __importStar(require("@stellar/stellar-sdk/contract"));
|
|
44
44
|
exports.rpc = __importStar(require("@stellar/stellar-sdk/rpc"));
|
|
45
|
-
if (typeof window !==
|
|
45
|
+
if (typeof window !== "undefined") {
|
|
46
46
|
//@ts-ignore Buffer exists
|
|
47
47
|
window.Buffer = window.Buffer || buffer_1.Buffer;
|
|
48
48
|
}
|
|
49
49
|
exports.networks = {
|
|
50
50
|
testnet: {
|
|
51
51
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
52
|
-
contractId: "
|
|
52
|
+
contractId: "CDREMNHXG3UJEKTARVE3G3BPOM3Y5U65T6NYYYWAYM6BSHGXNUQW6TTY",
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
exports.
|
|
56
|
-
801: { message: "StartDateLaterThanEndDate" }
|
|
55
|
+
exports.CalendarError = {
|
|
56
|
+
801: { message: "StartDateLaterThanEndDate" }
|
|
57
|
+
};
|
|
58
|
+
exports.CommonError = {
|
|
57
59
|
1: { message: "AlreadyInitialized" },
|
|
58
60
|
2: { message: "ProtocolIsPausedOrPoolIsNotOn" },
|
|
59
61
|
3: { message: "PoolOwnerOrHumaOwnerRequired" },
|
|
@@ -64,6 +66,11 @@ exports.Errors = {
|
|
|
64
66
|
};
|
|
65
67
|
class Client extends contract_1.Client {
|
|
66
68
|
options;
|
|
69
|
+
static async deploy(
|
|
70
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
71
|
+
options) {
|
|
72
|
+
return contract_1.Client.deploy(null, options);
|
|
73
|
+
}
|
|
67
74
|
constructor(options) {
|
|
68
75
|
super(new contract_1.Spec(["AAAAAQAAAAAAAAAAAAAAFkh1bWFDb25maWdDaGFuZ2VkRXZlbnQAAAAAAAEAAAAAAAAAC2h1bWFfY29uZmlnAAAAABM=",
|
|
69
76
|
"AAAAAQAAAAAAAAAAAAAAGVBvb2xBZGRyZXNzZXNDaGFuZ2VkRXZlbnQAAAAAAAADAAAAAAAAAAZjcmVkaXQAAAAAABMAAAAAAAAADmNyZWRpdF9tYW5hZ2VyAAAAAAATAAAAAAAAAAxwb29sX3N0b3JhZ2UAAAAT",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from
|
|
3
|
-
import type { u32, u64, u128, Option } from
|
|
4
|
-
export * from
|
|
5
|
-
export * as contract from
|
|
6
|
-
export * as rpc from
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
import type { u32, u64, u128, Option } from "@stellar/stellar-sdk/contract";
|
|
4
|
+
export * from "@stellar/stellar-sdk";
|
|
5
|
+
export * as contract from "@stellar/stellar-sdk/contract";
|
|
6
|
+
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
7
7
|
export declare const networks: {
|
|
8
8
|
readonly testnet: {
|
|
9
9
|
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
10
|
-
readonly contractId: "
|
|
10
|
+
readonly contractId: "CDREMNHXG3UJEKTARVE3G3BPOM3Y5U65T6NYYYWAYM6BSHGXNUQW6TTY";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export interface HumaConfigChangedEvent {
|
|
@@ -68,10 +68,12 @@ export type PayPeriodDuration = {
|
|
|
68
68
|
tag: "SemiAnnually";
|
|
69
69
|
values: void;
|
|
70
70
|
};
|
|
71
|
-
export declare const
|
|
71
|
+
export declare const CalendarError: {
|
|
72
72
|
801: {
|
|
73
73
|
message: string;
|
|
74
74
|
};
|
|
75
|
+
};
|
|
76
|
+
export declare const CommonError: {
|
|
75
77
|
1: {
|
|
76
78
|
message: string;
|
|
77
79
|
};
|
|
@@ -158,39 +160,13 @@ export interface Client {
|
|
|
158
160
|
pool_storage: string;
|
|
159
161
|
credit_manager: string;
|
|
160
162
|
credit: string;
|
|
161
|
-
}, options?:
|
|
162
|
-
/**
|
|
163
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
164
|
-
*/
|
|
165
|
-
fee?: number;
|
|
166
|
-
/**
|
|
167
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
168
|
-
*/
|
|
169
|
-
timeoutInSeconds?: number;
|
|
170
|
-
/**
|
|
171
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
172
|
-
*/
|
|
173
|
-
simulate?: boolean;
|
|
174
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
163
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
175
164
|
/**
|
|
176
165
|
* 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.
|
|
177
166
|
*/
|
|
178
167
|
set_huma_config: ({ huma_config }: {
|
|
179
168
|
huma_config: string;
|
|
180
|
-
}, options?:
|
|
181
|
-
/**
|
|
182
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
183
|
-
*/
|
|
184
|
-
fee?: number;
|
|
185
|
-
/**
|
|
186
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
187
|
-
*/
|
|
188
|
-
timeoutInSeconds?: number;
|
|
189
|
-
/**
|
|
190
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
191
|
-
*/
|
|
192
|
-
simulate?: boolean;
|
|
193
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
169
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
194
170
|
/**
|
|
195
171
|
* 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.
|
|
196
172
|
*/
|
|
@@ -199,153 +175,59 @@ export interface Client {
|
|
|
199
175
|
pool_storage: string;
|
|
200
176
|
credit: string;
|
|
201
177
|
credit_manager: string;
|
|
202
|
-
}, options?:
|
|
203
|
-
/**
|
|
204
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
205
|
-
*/
|
|
206
|
-
fee?: number;
|
|
207
|
-
/**
|
|
208
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
209
|
-
*/
|
|
210
|
-
timeoutInSeconds?: number;
|
|
211
|
-
/**
|
|
212
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
213
|
-
*/
|
|
214
|
-
simulate?: boolean;
|
|
215
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
178
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
216
179
|
/**
|
|
217
180
|
* 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.
|
|
218
181
|
*/
|
|
219
182
|
distribute_profit: ({ caller, profit }: {
|
|
220
183
|
caller: string;
|
|
221
184
|
profit: u128;
|
|
222
|
-
}, options?:
|
|
223
|
-
/**
|
|
224
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
225
|
-
*/
|
|
226
|
-
fee?: number;
|
|
227
|
-
/**
|
|
228
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
229
|
-
*/
|
|
230
|
-
timeoutInSeconds?: number;
|
|
231
|
-
/**
|
|
232
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
233
|
-
*/
|
|
234
|
-
simulate?: boolean;
|
|
235
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
185
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
236
186
|
/**
|
|
237
187
|
* 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.
|
|
238
188
|
*/
|
|
239
189
|
distribute_loss: ({ caller, loss }: {
|
|
240
190
|
caller: string;
|
|
241
191
|
loss: u128;
|
|
242
|
-
}, options?:
|
|
243
|
-
/**
|
|
244
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
245
|
-
*/
|
|
246
|
-
fee?: number;
|
|
247
|
-
/**
|
|
248
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
249
|
-
*/
|
|
250
|
-
timeoutInSeconds?: number;
|
|
251
|
-
/**
|
|
252
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
253
|
-
*/
|
|
254
|
-
simulate?: boolean;
|
|
255
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
192
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
256
193
|
/**
|
|
257
194
|
* 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.
|
|
258
195
|
*/
|
|
259
196
|
distribute_loss_recovery: ({ caller, loss_recovery }: {
|
|
260
197
|
caller: string;
|
|
261
198
|
loss_recovery: u128;
|
|
262
|
-
}, options?:
|
|
263
|
-
/**
|
|
264
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
265
|
-
*/
|
|
266
|
-
fee?: number;
|
|
267
|
-
/**
|
|
268
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
269
|
-
*/
|
|
270
|
-
timeoutInSeconds?: number;
|
|
271
|
-
/**
|
|
272
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
273
|
-
*/
|
|
274
|
-
simulate?: boolean;
|
|
275
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
199
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
276
200
|
/**
|
|
277
201
|
* 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.
|
|
278
202
|
*/
|
|
279
203
|
upgrade: ({ new_wasm_hash }: {
|
|
280
204
|
new_wasm_hash: Buffer;
|
|
281
|
-
}, options?:
|
|
282
|
-
/**
|
|
283
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
284
|
-
*/
|
|
285
|
-
fee?: number;
|
|
286
|
-
/**
|
|
287
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
288
|
-
*/
|
|
289
|
-
timeoutInSeconds?: number;
|
|
290
|
-
/**
|
|
291
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
292
|
-
*/
|
|
293
|
-
simulate?: boolean;
|
|
294
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
205
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
295
206
|
/**
|
|
296
207
|
* 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.
|
|
297
208
|
*/
|
|
298
|
-
get_protocol_income_accrued: (options?:
|
|
299
|
-
/**
|
|
300
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
301
|
-
*/
|
|
302
|
-
fee?: number;
|
|
303
|
-
/**
|
|
304
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
305
|
-
*/
|
|
306
|
-
timeoutInSeconds?: number;
|
|
307
|
-
/**
|
|
308
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
309
|
-
*/
|
|
310
|
-
simulate?: boolean;
|
|
311
|
-
}) => Promise<AssembledTransaction<u128>>;
|
|
209
|
+
get_protocol_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
312
210
|
/**
|
|
313
211
|
* 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.
|
|
314
212
|
*/
|
|
315
|
-
get_pool_owner_income_accrued: (options?:
|
|
316
|
-
/**
|
|
317
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
318
|
-
*/
|
|
319
|
-
fee?: number;
|
|
320
|
-
/**
|
|
321
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
322
|
-
*/
|
|
323
|
-
timeoutInSeconds?: number;
|
|
324
|
-
/**
|
|
325
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
326
|
-
*/
|
|
327
|
-
simulate?: boolean;
|
|
328
|
-
}) => Promise<AssembledTransaction<u128>>;
|
|
213
|
+
get_pool_owner_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
329
214
|
/**
|
|
330
215
|
* 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.
|
|
331
216
|
*/
|
|
332
|
-
get_ea_income_accrued: (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<u128>>;
|
|
217
|
+
get_ea_income_accrued: (options?: MethodOptions) => Promise<AssembledTransaction<u128>>;
|
|
346
218
|
}
|
|
347
219
|
export declare class Client extends ContractClient {
|
|
348
220
|
readonly options: ContractClientOptions;
|
|
221
|
+
static deploy<T = Client>(
|
|
222
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
223
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
224
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
225
|
+
wasmHash: Buffer | string;
|
|
226
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
227
|
+
salt?: Buffer | Uint8Array;
|
|
228
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
229
|
+
format?: "hex" | "base64";
|
|
230
|
+
}): Promise<AssembledTransaction<T>>;
|
|
349
231
|
constructor(options: ContractClientOptions);
|
|
350
232
|
readonly fromJSON: {
|
|
351
233
|
initialize: (json: string) => AssembledTransaction<null>;
|
package/dist/index.js
CHANGED
|
@@ -36,24 +36,26 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Client = exports.
|
|
39
|
+
exports.Client = exports.CommonError = exports.CalendarError = exports.networks = exports.rpc = exports.contract = void 0;
|
|
40
40
|
const buffer_1 = require("buffer");
|
|
41
41
|
const contract_1 = require("@stellar/stellar-sdk/contract");
|
|
42
42
|
__exportStar(require("@stellar/stellar-sdk"), exports);
|
|
43
43
|
exports.contract = __importStar(require("@stellar/stellar-sdk/contract"));
|
|
44
44
|
exports.rpc = __importStar(require("@stellar/stellar-sdk/rpc"));
|
|
45
|
-
if (typeof window !==
|
|
45
|
+
if (typeof window !== "undefined") {
|
|
46
46
|
//@ts-ignore Buffer exists
|
|
47
47
|
window.Buffer = window.Buffer || buffer_1.Buffer;
|
|
48
48
|
}
|
|
49
49
|
exports.networks = {
|
|
50
50
|
testnet: {
|
|
51
51
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
52
|
-
contractId: "
|
|
52
|
+
contractId: "CDREMNHXG3UJEKTARVE3G3BPOM3Y5U65T6NYYYWAYM6BSHGXNUQW6TTY",
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
exports.
|
|
56
|
-
801: { message: "StartDateLaterThanEndDate" }
|
|
55
|
+
exports.CalendarError = {
|
|
56
|
+
801: { message: "StartDateLaterThanEndDate" }
|
|
57
|
+
};
|
|
58
|
+
exports.CommonError = {
|
|
57
59
|
1: { message: "AlreadyInitialized" },
|
|
58
60
|
2: { message: "ProtocolIsPausedOrPoolIsNotOn" },
|
|
59
61
|
3: { message: "PoolOwnerOrHumaOwnerRequired" },
|
|
@@ -64,6 +66,11 @@ exports.Errors = {
|
|
|
64
66
|
};
|
|
65
67
|
class Client extends contract_1.Client {
|
|
66
68
|
options;
|
|
69
|
+
static async deploy(
|
|
70
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
71
|
+
options) {
|
|
72
|
+
return contract_1.Client.deploy(null, options);
|
|
73
|
+
}
|
|
67
74
|
constructor(options) {
|
|
68
75
|
super(new contract_1.Spec(["AAAAAQAAAAAAAAAAAAAAFkh1bWFDb25maWdDaGFuZ2VkRXZlbnQAAAAAAAEAAAAAAAAAC2h1bWFfY29uZmlnAAAAABM=",
|
|
69
76
|
"AAAAAQAAAAAAAAAAAAAAGVBvb2xBZGRyZXNzZXNDaGFuZ2VkRXZlbnQAAAAAAAADAAAAAAAAAAZjcmVkaXQAAAAAABMAAAAAAAAADmNyZWRpdF9tYW5hZ2VyAAAAAAATAAAAAAAAAAxwb29sX3N0b3JhZ2UAAAAT",
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.32-beta.179+f7a6261",
|
|
3
3
|
"name": "@huma-finance/soroban-pool",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"clean": "tsc --build --clean && rm -rf dist"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@stellar/stellar-sdk": "
|
|
20
|
+
"@stellar/stellar-sdk": "16.0.1",
|
|
21
21
|
"buffer": "6.0.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"typescript": "
|
|
24
|
+
"typescript": "5.9.3"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public",
|
|
28
28
|
"registry": "https://registry.npmjs.org/"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "f7a6261638d56a260c4333bc22052583f5b593ea"
|
|
31
31
|
}
|