@huma-finance/soroban-pool-manager 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 +69 -367
- package/dist/cjs/index.js +15 -6
- package/dist/index.d.ts +69 -367
- package/dist/index.js +15 -6
- package/package.json +4 -4
- package/src/index.ts +66 -419
- 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: "CCNKUA62K3T4FQTFOGOVHZNS7UJ36UWYHS727TYSKSWTJ3LVZJOBFMVL";
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export interface PoolManagerAddressesChangedEvent {
|
|
@@ -64,7 +64,7 @@ export interface RedemptionRequestsProcessedEvent {
|
|
|
64
64
|
senior_tranche_price: u128;
|
|
65
65
|
unprocessed_amount: u128;
|
|
66
66
|
}
|
|
67
|
-
export declare const
|
|
67
|
+
export declare const PoolManagerError: {
|
|
68
68
|
301: {
|
|
69
69
|
message: string;
|
|
70
70
|
};
|
|
@@ -86,30 +86,6 @@ export declare const Errors: {
|
|
|
86
86
|
307: {
|
|
87
87
|
message: string;
|
|
88
88
|
};
|
|
89
|
-
801: {
|
|
90
|
-
message: string;
|
|
91
|
-
};
|
|
92
|
-
1: {
|
|
93
|
-
message: string;
|
|
94
|
-
};
|
|
95
|
-
2: {
|
|
96
|
-
message: string;
|
|
97
|
-
};
|
|
98
|
-
3: {
|
|
99
|
-
message: string;
|
|
100
|
-
};
|
|
101
|
-
4: {
|
|
102
|
-
message: string;
|
|
103
|
-
};
|
|
104
|
-
5: {
|
|
105
|
-
message: string;
|
|
106
|
-
};
|
|
107
|
-
6: {
|
|
108
|
-
message: string;
|
|
109
|
-
};
|
|
110
|
-
7: {
|
|
111
|
-
message: string;
|
|
112
|
-
};
|
|
113
89
|
};
|
|
114
90
|
export interface PoolEnabledEvent {
|
|
115
91
|
by: string;
|
|
@@ -193,6 +169,34 @@ export type PayPeriodDuration = {
|
|
|
193
169
|
tag: "SemiAnnually";
|
|
194
170
|
values: void;
|
|
195
171
|
};
|
|
172
|
+
export declare const CalendarError: {
|
|
173
|
+
801: {
|
|
174
|
+
message: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
export declare const CommonError: {
|
|
178
|
+
1: {
|
|
179
|
+
message: string;
|
|
180
|
+
};
|
|
181
|
+
2: {
|
|
182
|
+
message: string;
|
|
183
|
+
};
|
|
184
|
+
3: {
|
|
185
|
+
message: string;
|
|
186
|
+
};
|
|
187
|
+
4: {
|
|
188
|
+
message: string;
|
|
189
|
+
};
|
|
190
|
+
5: {
|
|
191
|
+
message: string;
|
|
192
|
+
};
|
|
193
|
+
6: {
|
|
194
|
+
message: string;
|
|
195
|
+
};
|
|
196
|
+
7: {
|
|
197
|
+
message: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
196
200
|
export type TranchesPolicyType = {
|
|
197
201
|
tag: "FixedSeniorYield";
|
|
198
202
|
values: void;
|
|
@@ -263,39 +267,13 @@ export interface Client {
|
|
|
263
267
|
huma_config: string;
|
|
264
268
|
pool_storage: string;
|
|
265
269
|
pool: string;
|
|
266
|
-
}, options?:
|
|
267
|
-
/**
|
|
268
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
269
|
-
*/
|
|
270
|
-
fee?: number;
|
|
271
|
-
/**
|
|
272
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
273
|
-
*/
|
|
274
|
-
timeoutInSeconds?: number;
|
|
275
|
-
/**
|
|
276
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
277
|
-
*/
|
|
278
|
-
simulate?: boolean;
|
|
279
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
270
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
280
271
|
/**
|
|
281
272
|
* 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.
|
|
282
273
|
*/
|
|
283
274
|
set_huma_config: ({ huma_config }: {
|
|
284
275
|
huma_config: string;
|
|
285
|
-
}, options?:
|
|
286
|
-
/**
|
|
287
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
288
|
-
*/
|
|
289
|
-
fee?: number;
|
|
290
|
-
/**
|
|
291
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
292
|
-
*/
|
|
293
|
-
timeoutInSeconds?: number;
|
|
294
|
-
/**
|
|
295
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
296
|
-
*/
|
|
297
|
-
simulate?: boolean;
|
|
298
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
276
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
299
277
|
/**
|
|
300
278
|
* 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.
|
|
301
279
|
*/
|
|
@@ -303,20 +281,7 @@ export interface Client {
|
|
|
303
281
|
caller: string;
|
|
304
282
|
pool_storage: string;
|
|
305
283
|
pool: string;
|
|
306
|
-
}, options?:
|
|
307
|
-
/**
|
|
308
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
309
|
-
*/
|
|
310
|
-
fee?: number;
|
|
311
|
-
/**
|
|
312
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
313
|
-
*/
|
|
314
|
-
timeoutInSeconds?: number;
|
|
315
|
-
/**
|
|
316
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
317
|
-
*/
|
|
318
|
-
simulate?: boolean;
|
|
319
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
284
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
320
285
|
/**
|
|
321
286
|
* 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.
|
|
322
287
|
*/
|
|
@@ -325,100 +290,35 @@ export interface Client {
|
|
|
325
290
|
pool: string;
|
|
326
291
|
pool_manager: string;
|
|
327
292
|
credit: string;
|
|
328
|
-
}, options?:
|
|
329
|
-
/**
|
|
330
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
331
|
-
*/
|
|
332
|
-
fee?: number;
|
|
333
|
-
/**
|
|
334
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
335
|
-
*/
|
|
336
|
-
timeoutInSeconds?: number;
|
|
337
|
-
/**
|
|
338
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
339
|
-
*/
|
|
340
|
-
simulate?: boolean;
|
|
341
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
293
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
342
294
|
/**
|
|
343
295
|
* Construct and simulate a set_pool_name transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
344
296
|
*/
|
|
345
297
|
set_pool_name: ({ caller, name }: {
|
|
346
298
|
caller: string;
|
|
347
299
|
name: string;
|
|
348
|
-
}, options?:
|
|
349
|
-
/**
|
|
350
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
351
|
-
*/
|
|
352
|
-
fee?: number;
|
|
353
|
-
/**
|
|
354
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
355
|
-
*/
|
|
356
|
-
timeoutInSeconds?: number;
|
|
357
|
-
/**
|
|
358
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
359
|
-
*/
|
|
360
|
-
simulate?: boolean;
|
|
361
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
300
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
362
301
|
/**
|
|
363
302
|
* Construct and simulate a set_pool_owner 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.
|
|
364
303
|
*/
|
|
365
304
|
set_pool_owner: ({ caller, addr }: {
|
|
366
305
|
caller: string;
|
|
367
306
|
addr: string;
|
|
368
|
-
}, options?:
|
|
369
|
-
/**
|
|
370
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
371
|
-
*/
|
|
372
|
-
fee?: number;
|
|
373
|
-
/**
|
|
374
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
375
|
-
*/
|
|
376
|
-
timeoutInSeconds?: number;
|
|
377
|
-
/**
|
|
378
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
379
|
-
*/
|
|
380
|
-
simulate?: boolean;
|
|
381
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
307
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
382
308
|
/**
|
|
383
309
|
* Construct and simulate a set_pool_owner_treasury 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.
|
|
384
310
|
*/
|
|
385
311
|
set_pool_owner_treasury: ({ caller, addr }: {
|
|
386
312
|
caller: string;
|
|
387
313
|
addr: string;
|
|
388
|
-
}, options?:
|
|
389
|
-
/**
|
|
390
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
391
|
-
*/
|
|
392
|
-
fee?: number;
|
|
393
|
-
/**
|
|
394
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
395
|
-
*/
|
|
396
|
-
timeoutInSeconds?: number;
|
|
397
|
-
/**
|
|
398
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
399
|
-
*/
|
|
400
|
-
simulate?: boolean;
|
|
401
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
314
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
402
315
|
/**
|
|
403
316
|
* Construct and simulate a set_evaluation_agent 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.
|
|
404
317
|
*/
|
|
405
318
|
set_evaluation_agent: ({ caller, addr }: {
|
|
406
319
|
caller: string;
|
|
407
320
|
addr: string;
|
|
408
|
-
}, options?:
|
|
409
|
-
/**
|
|
410
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
411
|
-
*/
|
|
412
|
-
fee?: number;
|
|
413
|
-
/**
|
|
414
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
415
|
-
*/
|
|
416
|
-
timeoutInSeconds?: number;
|
|
417
|
-
/**
|
|
418
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
419
|
-
*/
|
|
420
|
-
simulate?: boolean;
|
|
421
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
321
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
422
322
|
/**
|
|
423
323
|
* Construct and simulate a set_tranche_addresses transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
424
324
|
*/
|
|
@@ -426,20 +326,7 @@ export interface Client {
|
|
|
426
326
|
caller: string;
|
|
427
327
|
junior_addr: string;
|
|
428
328
|
senior_addr: Option<string>;
|
|
429
|
-
}, options?:
|
|
430
|
-
/**
|
|
431
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
432
|
-
*/
|
|
433
|
-
fee?: number;
|
|
434
|
-
/**
|
|
435
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
436
|
-
*/
|
|
437
|
-
timeoutInSeconds?: number;
|
|
438
|
-
/**
|
|
439
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
440
|
-
*/
|
|
441
|
-
simulate?: boolean;
|
|
442
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
329
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
443
330
|
/**
|
|
444
331
|
* Construct and simulate a set_admin_rnr transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
445
332
|
*/
|
|
@@ -449,20 +336,7 @@ export interface Client {
|
|
|
449
336
|
pool_owner_liquidity_rate: u32;
|
|
450
337
|
ea_reward_rate: u32;
|
|
451
338
|
ea_liquidity_rate: u32;
|
|
452
|
-
}, options?:
|
|
453
|
-
/**
|
|
454
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
455
|
-
*/
|
|
456
|
-
fee?: number;
|
|
457
|
-
/**
|
|
458
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
459
|
-
*/
|
|
460
|
-
timeoutInSeconds?: number;
|
|
461
|
-
/**
|
|
462
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
463
|
-
*/
|
|
464
|
-
simulate?: boolean;
|
|
465
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
339
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
466
340
|
/**
|
|
467
341
|
* Construct and simulate a set_pool_settings transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
468
342
|
*/
|
|
@@ -474,20 +348,7 @@ export interface Client {
|
|
|
474
348
|
late_payment_grace_period_days: u32;
|
|
475
349
|
default_grace_period_days: u32;
|
|
476
350
|
principal_only_payment_allowed: boolean;
|
|
477
|
-
}, options?:
|
|
478
|
-
/**
|
|
479
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
480
|
-
*/
|
|
481
|
-
fee?: number;
|
|
482
|
-
/**
|
|
483
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
484
|
-
*/
|
|
485
|
-
timeoutInSeconds?: number;
|
|
486
|
-
/**
|
|
487
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
488
|
-
*/
|
|
489
|
-
simulate?: boolean;
|
|
490
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
351
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
491
352
|
/**
|
|
492
353
|
* Construct and simulate a set_lp_config transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
493
354
|
*/
|
|
@@ -499,20 +360,7 @@ export interface Client {
|
|
|
499
360
|
tranches_risk_adjustment_bps: u32;
|
|
500
361
|
withdrawal_lockout_period_days: u32;
|
|
501
362
|
auto_redemption_after_lockup: boolean;
|
|
502
|
-
}, options?:
|
|
503
|
-
/**
|
|
504
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
505
|
-
*/
|
|
506
|
-
fee?: number;
|
|
507
|
-
/**
|
|
508
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
509
|
-
*/
|
|
510
|
-
timeoutInSeconds?: number;
|
|
511
|
-
/**
|
|
512
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
513
|
-
*/
|
|
514
|
-
simulate?: boolean;
|
|
515
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
363
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
516
364
|
/**
|
|
517
365
|
* Construct and simulate a set_fee_structure transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
518
366
|
*/
|
|
@@ -522,232 +370,86 @@ export interface Client {
|
|
|
522
370
|
late_fee_bps: u32;
|
|
523
371
|
front_loading_fee_flat: u128;
|
|
524
372
|
front_loading_fee_bps: u32;
|
|
525
|
-
}, options?:
|
|
526
|
-
/**
|
|
527
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
528
|
-
*/
|
|
529
|
-
fee?: number;
|
|
530
|
-
/**
|
|
531
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
532
|
-
*/
|
|
533
|
-
timeoutInSeconds?: number;
|
|
534
|
-
/**
|
|
535
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
536
|
-
*/
|
|
537
|
-
simulate?: boolean;
|
|
538
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
373
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
539
374
|
/**
|
|
540
375
|
* 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.
|
|
541
376
|
*/
|
|
542
377
|
set_tranches_policy_type: ({ caller, policy_type }: {
|
|
543
378
|
caller: string;
|
|
544
379
|
policy_type: TranchesPolicyType;
|
|
545
|
-
}, options?:
|
|
546
|
-
/**
|
|
547
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
548
|
-
*/
|
|
549
|
-
fee?: number;
|
|
550
|
-
/**
|
|
551
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
552
|
-
*/
|
|
553
|
-
timeoutInSeconds?: number;
|
|
554
|
-
/**
|
|
555
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
556
|
-
*/
|
|
557
|
-
simulate?: boolean;
|
|
558
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
380
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
559
381
|
/**
|
|
560
382
|
* Construct and simulate a add_pool_operator transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
561
383
|
*/
|
|
562
384
|
add_pool_operator: ({ addr }: {
|
|
563
385
|
addr: string;
|
|
564
|
-
}, options?:
|
|
565
|
-
/**
|
|
566
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
567
|
-
*/
|
|
568
|
-
fee?: number;
|
|
569
|
-
/**
|
|
570
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
571
|
-
*/
|
|
572
|
-
timeoutInSeconds?: number;
|
|
573
|
-
/**
|
|
574
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
575
|
-
*/
|
|
576
|
-
simulate?: boolean;
|
|
577
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
386
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
578
387
|
/**
|
|
579
388
|
* Construct and simulate a remove_pool_operator transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
580
389
|
*/
|
|
581
390
|
remove_pool_operator: ({ addr }: {
|
|
582
391
|
addr: string;
|
|
583
|
-
}, options?:
|
|
584
|
-
/**
|
|
585
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
586
|
-
*/
|
|
587
|
-
fee?: number;
|
|
588
|
-
/**
|
|
589
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
590
|
-
*/
|
|
591
|
-
timeoutInSeconds?: number;
|
|
592
|
-
/**
|
|
593
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
594
|
-
*/
|
|
595
|
-
simulate?: boolean;
|
|
596
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
392
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
597
393
|
/**
|
|
598
394
|
* Construct and simulate a enable_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
599
395
|
*/
|
|
600
396
|
enable_pool: ({ caller }: {
|
|
601
397
|
caller: string;
|
|
602
|
-
}, options?:
|
|
603
|
-
/**
|
|
604
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
605
|
-
*/
|
|
606
|
-
fee?: number;
|
|
607
|
-
/**
|
|
608
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
609
|
-
*/
|
|
610
|
-
timeoutInSeconds?: number;
|
|
611
|
-
/**
|
|
612
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
613
|
-
*/
|
|
614
|
-
simulate?: boolean;
|
|
615
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
398
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
616
399
|
/**
|
|
617
400
|
* Construct and simulate a disable_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
618
401
|
*/
|
|
619
402
|
disable_pool: ({ caller }: {
|
|
620
403
|
caller: string;
|
|
621
|
-
}, options?:
|
|
622
|
-
/**
|
|
623
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
624
|
-
*/
|
|
625
|
-
fee?: number;
|
|
626
|
-
/**
|
|
627
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
628
|
-
*/
|
|
629
|
-
timeoutInSeconds?: number;
|
|
630
|
-
/**
|
|
631
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
632
|
-
*/
|
|
633
|
-
simulate?: boolean;
|
|
634
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
404
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
635
405
|
/**
|
|
636
406
|
* Construct and simulate a close_pool transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
637
407
|
*/
|
|
638
408
|
close_pool: ({ caller }: {
|
|
639
409
|
caller: string;
|
|
640
|
-
}, options?:
|
|
641
|
-
/**
|
|
642
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
643
|
-
*/
|
|
644
|
-
fee?: number;
|
|
645
|
-
/**
|
|
646
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
647
|
-
*/
|
|
648
|
-
timeoutInSeconds?: number;
|
|
649
|
-
/**
|
|
650
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
651
|
-
*/
|
|
652
|
-
simulate?: boolean;
|
|
653
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
410
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
654
411
|
/**
|
|
655
412
|
* Construct and simulate a close_epoch transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
656
413
|
*/
|
|
657
|
-
close_epoch: (options?:
|
|
658
|
-
/**
|
|
659
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
660
|
-
*/
|
|
661
|
-
fee?: number;
|
|
662
|
-
/**
|
|
663
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
664
|
-
*/
|
|
665
|
-
timeoutInSeconds?: number;
|
|
666
|
-
/**
|
|
667
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
668
|
-
*/
|
|
669
|
-
simulate?: boolean;
|
|
670
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
414
|
+
close_epoch: (options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
671
415
|
/**
|
|
672
416
|
* Construct and simulate a withdraw_protocol_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
673
417
|
*/
|
|
674
418
|
withdraw_protocol_fees: ({ amount }: {
|
|
675
419
|
amount: u128;
|
|
676
|
-
}, options?:
|
|
677
|
-
/**
|
|
678
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
679
|
-
*/
|
|
680
|
-
fee?: number;
|
|
681
|
-
/**
|
|
682
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
683
|
-
*/
|
|
684
|
-
timeoutInSeconds?: number;
|
|
685
|
-
/**
|
|
686
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
687
|
-
*/
|
|
688
|
-
simulate?: boolean;
|
|
689
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
420
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
690
421
|
/**
|
|
691
422
|
* Construct and simulate a withdraw_pool_owner_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
692
423
|
*/
|
|
693
424
|
withdraw_pool_owner_fees: ({ amount }: {
|
|
694
425
|
amount: u128;
|
|
695
|
-
}, options?:
|
|
696
|
-
/**
|
|
697
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
698
|
-
*/
|
|
699
|
-
fee?: number;
|
|
700
|
-
/**
|
|
701
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
702
|
-
*/
|
|
703
|
-
timeoutInSeconds?: number;
|
|
704
|
-
/**
|
|
705
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
706
|
-
*/
|
|
707
|
-
simulate?: boolean;
|
|
708
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
426
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
709
427
|
/**
|
|
710
428
|
* Construct and simulate a withdraw_ea_fees transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
711
429
|
*/
|
|
712
430
|
withdraw_ea_fees: ({ caller, amount }: {
|
|
713
431
|
caller: string;
|
|
714
432
|
amount: u128;
|
|
715
|
-
}, options?:
|
|
716
|
-
/**
|
|
717
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
718
|
-
*/
|
|
719
|
-
fee?: number;
|
|
720
|
-
/**
|
|
721
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
722
|
-
*/
|
|
723
|
-
timeoutInSeconds?: number;
|
|
724
|
-
/**
|
|
725
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
726
|
-
*/
|
|
727
|
-
simulate?: boolean;
|
|
728
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
433
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
729
434
|
/**
|
|
730
435
|
* 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.
|
|
731
436
|
*/
|
|
732
437
|
upgrade: ({ new_wasm_hash }: {
|
|
733
438
|
new_wasm_hash: Buffer;
|
|
734
|
-
}, options?:
|
|
735
|
-
/**
|
|
736
|
-
* The fee to pay for the transaction. Default: BASE_FEE
|
|
737
|
-
*/
|
|
738
|
-
fee?: number;
|
|
739
|
-
/**
|
|
740
|
-
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
741
|
-
*/
|
|
742
|
-
timeoutInSeconds?: number;
|
|
743
|
-
/**
|
|
744
|
-
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
745
|
-
*/
|
|
746
|
-
simulate?: boolean;
|
|
747
|
-
}) => Promise<AssembledTransaction<null>>;
|
|
439
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
748
440
|
}
|
|
749
441
|
export declare class Client extends ContractClient {
|
|
750
442
|
readonly options: ContractClientOptions;
|
|
443
|
+
static deploy<T = Client>(
|
|
444
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
445
|
+
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
446
|
+
/** The hash of the Wasm blob, which must already be installed on-chain. */
|
|
447
|
+
wasmHash: Buffer | string;
|
|
448
|
+
/** Salt used to generate the contract's ID. Passed through to {@link Operation.createCustomContract}. Default: random. */
|
|
449
|
+
salt?: Buffer | Uint8Array;
|
|
450
|
+
/** The format used to decode `wasmHash`, if it's provided as a string. */
|
|
451
|
+
format?: "hex" | "base64";
|
|
452
|
+
}): Promise<AssembledTransaction<T>>;
|
|
751
453
|
constructor(options: ContractClientOptions);
|
|
752
454
|
readonly fromJSON: {
|
|
753
455
|
initialize: (json: string) => AssembledTransaction<null>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,31 +36,35 @@ 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.PoolManagerError = 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: "CCNKUA62K3T4FQTFOGOVHZNS7UJ36UWYHS727TYSKSWTJ3LVZJOBFMVL",
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
exports.
|
|
55
|
+
exports.PoolManagerError = {
|
|
56
56
|
301: { message: "PoolOwnerOrEARequired" },
|
|
57
57
|
302: { message: "AdminRewardRateTooHigh" },
|
|
58
58
|
303: { message: "MinDepositAmountTooLow" },
|
|
59
59
|
304: { message: "LatePaymentGracePeriodTooLong" },
|
|
60
60
|
305: { message: "InsufficientAmountForRequest" },
|
|
61
61
|
306: { message: "InvalidBasisPointHigherThan10000" },
|
|
62
|
-
307: { message: "EpochClosedTooEarly" }
|
|
63
|
-
|
|
62
|
+
307: { message: "EpochClosedTooEarly" }
|
|
63
|
+
};
|
|
64
|
+
exports.CalendarError = {
|
|
65
|
+
801: { message: "StartDateLaterThanEndDate" }
|
|
66
|
+
};
|
|
67
|
+
exports.CommonError = {
|
|
64
68
|
1: { message: "AlreadyInitialized" },
|
|
65
69
|
2: { message: "ProtocolIsPausedOrPoolIsNotOn" },
|
|
66
70
|
3: { message: "PoolOwnerOrHumaOwnerRequired" },
|
|
@@ -71,6 +75,11 @@ exports.Errors = {
|
|
|
71
75
|
};
|
|
72
76
|
class Client extends contract_1.Client {
|
|
73
77
|
options;
|
|
78
|
+
static async deploy(
|
|
79
|
+
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
80
|
+
options) {
|
|
81
|
+
return contract_1.Client.deploy(null, options);
|
|
82
|
+
}
|
|
74
83
|
constructor(options) {
|
|
75
84
|
super(new contract_1.Spec(["AAAAAQAAAAAAAAAAAAAAIFBvb2xNYW5hZ2VyQWRkcmVzc2VzQ2hhbmdlZEV2ZW50AAAAAgAAAAAAAAAEcG9vbAAAABMAAAAAAAAADHBvb2xfc3RvcmFnZQAAABM=",
|
|
76
85
|
"AAAAAQAAAAAAAAAAAAAAIFBvb2xTdG9yYWdlQWRkcmVzc2VzQ2hhbmdlZEV2ZW50AAAAAwAAAAAAAAAGY3JlZGl0AAAAAAATAAAAAAAAAARwb29sAAAAEwAAAAAAAAAMcG9vbF9tYW5hZ2VyAAAAEw==",
|