@mysten/deepbook-v3 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbookAdmin.d.mts +2 -2
- package/dist/transactions/marginAdmin.d.mts +7 -7
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginManager.d.mts +24 -24
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginRegistry.d.mts +15 -15
- package/dist/transactions/marginRegistry.d.mts.map +1 -1
- package/dist/transactions/marginTPSL.d.mts +9 -9
- package/dist/transactions/poolProxy.d.mts +5 -5
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CanPlaceLimitOrderParams, CanPlaceMarketOrderParams, CreatePermissionlessPoolParams, PlaceLimitOrderParams, PlaceMarketOrderParams, SwapParams, SwapWithManagerParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions10 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/deepbook.d.ts
|
|
@@ -358,40 +358,40 @@ declare class DeepBookContract {
|
|
|
358
358
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the balances for
|
|
359
359
|
* @returns A function that takes a Transaction object
|
|
360
360
|
*/
|
|
361
|
-
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
361
|
+
getPoolReferralBalances: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
362
362
|
/**
|
|
363
363
|
* @description Get the multiplier for a referral (DeepBookPoolReferral)
|
|
364
364
|
* @param {string} poolKey The key to identify the pool
|
|
365
365
|
* @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for
|
|
366
366
|
* @returns A function that takes a Transaction object
|
|
367
367
|
*/
|
|
368
|
-
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) =>
|
|
368
|
+
poolReferralMultiplier: (poolKey: string, referral: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
369
369
|
/**
|
|
370
370
|
* @description Check if a pool is a stable pool
|
|
371
371
|
* @param {string} poolKey The key to identify the pool
|
|
372
372
|
* @returns A function that takes a Transaction object
|
|
373
373
|
*/
|
|
374
|
-
stablePool: (poolKey: string) => (tx: Transaction) =>
|
|
374
|
+
stablePool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
375
375
|
/**
|
|
376
376
|
* @description Check if a pool is registered
|
|
377
377
|
* @param {string} poolKey The key to identify the pool
|
|
378
378
|
* @returns A function that takes a Transaction object
|
|
379
379
|
*/
|
|
380
|
-
registeredPool: (poolKey: string) => (tx: Transaction) =>
|
|
380
|
+
registeredPool: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
381
381
|
/**
|
|
382
382
|
* @description Get the quote quantity out for a given base quantity using input token as fee
|
|
383
383
|
* @param {string} poolKey The key to identify the pool
|
|
384
384
|
* @param {number} baseQuantity Base quantity to convert
|
|
385
385
|
* @returns A function that takes a Transaction object
|
|
386
386
|
*/
|
|
387
|
-
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number) => (tx: Transaction) =>
|
|
387
|
+
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
388
388
|
/**
|
|
389
389
|
* @description Get the base quantity out for a given quote quantity using input token as fee
|
|
390
390
|
* @param {string} poolKey The key to identify the pool
|
|
391
391
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
392
392
|
* @returns A function that takes a Transaction object
|
|
393
393
|
*/
|
|
394
|
-
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number) => (tx: Transaction) =>
|
|
394
|
+
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
395
395
|
/**
|
|
396
396
|
* @description Get the quantity out for a given base or quote quantity using input token as fee
|
|
397
397
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -399,7 +399,7 @@ declare class DeepBookContract {
|
|
|
399
399
|
* @param {number} quoteQuantity Quote quantity to convert
|
|
400
400
|
* @returns A function that takes a Transaction object
|
|
401
401
|
*/
|
|
402
|
-
getQuantityOutInputFee: (poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) =>
|
|
402
|
+
getQuantityOutInputFee: (poolKey: string, baseQuantity: number, quoteQuantity: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
403
403
|
/**
|
|
404
404
|
* @description Get the base quantity needed to receive a target quote quantity
|
|
405
405
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -407,7 +407,7 @@ declare class DeepBookContract {
|
|
|
407
407
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
408
408
|
* @returns A function that takes a Transaction object
|
|
409
409
|
*/
|
|
410
|
-
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number, payWithDeep: boolean) => (tx: Transaction) =>
|
|
410
|
+
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
411
411
|
/**
|
|
412
412
|
* @description Get the quote quantity needed to receive a target base quantity
|
|
413
413
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -415,14 +415,14 @@ declare class DeepBookContract {
|
|
|
415
415
|
* @param {boolean} payWithDeep Whether to pay fees with DEEP
|
|
416
416
|
* @returns A function that takes a Transaction object
|
|
417
417
|
*/
|
|
418
|
-
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number, payWithDeep: boolean) => (tx: Transaction) =>
|
|
418
|
+
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
419
419
|
/**
|
|
420
420
|
* @description Get account order details for a balance manager
|
|
421
421
|
* @param {string} poolKey The key to identify the pool
|
|
422
422
|
* @param {string} managerKey Key of the balance manager
|
|
423
423
|
* @returns A function that takes a Transaction object
|
|
424
424
|
*/
|
|
425
|
-
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
425
|
+
getAccountOrderDetails: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
426
426
|
/**
|
|
427
427
|
* @description Get the DEEP required for an order
|
|
428
428
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -430,51 +430,51 @@ declare class DeepBookContract {
|
|
|
430
430
|
* @param {number} price Price
|
|
431
431
|
* @returns A function that takes a Transaction object
|
|
432
432
|
*/
|
|
433
|
-
getOrderDeepRequired: (poolKey: string, baseQuantity: number, price: number) => (tx: Transaction) =>
|
|
433
|
+
getOrderDeepRequired: (poolKey: string, baseQuantity: number, price: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
434
434
|
/**
|
|
435
435
|
* @description Check if account exists for a balance manager
|
|
436
436
|
* @param {string} poolKey The key to identify the pool
|
|
437
437
|
* @param {string} managerKey Key of the balance manager
|
|
438
438
|
* @returns A function that takes a Transaction object
|
|
439
439
|
*/
|
|
440
|
-
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) =>
|
|
440
|
+
accountExists: (poolKey: string, managerKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
441
441
|
/**
|
|
442
442
|
* @description Get the next epoch trade parameters for a pool
|
|
443
443
|
* @param {string} poolKey The key to identify the pool
|
|
444
444
|
* @returns A function that takes a Transaction object
|
|
445
445
|
*/
|
|
446
|
-
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) =>
|
|
446
|
+
poolTradeParamsNext: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
447
447
|
/**
|
|
448
448
|
* @description Get the quorum for a pool
|
|
449
449
|
* @param {string} poolKey The key to identify the pool
|
|
450
450
|
* @returns A function that takes a Transaction object
|
|
451
451
|
*/
|
|
452
|
-
quorum: (poolKey: string) => (tx: Transaction) =>
|
|
452
|
+
quorum: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
453
453
|
/**
|
|
454
454
|
* @description Get the pool ID
|
|
455
455
|
* @param {string} poolKey The key to identify the pool
|
|
456
456
|
* @returns A function that takes a Transaction object
|
|
457
457
|
*/
|
|
458
|
-
poolId: (poolKey: string) => (tx: Transaction) =>
|
|
458
|
+
poolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
459
459
|
/**
|
|
460
460
|
* @description Check if a limit order can be placed
|
|
461
461
|
* @param {CanPlaceLimitOrderParams} params Parameters for checking limit order validity
|
|
462
462
|
* @returns A function that takes a Transaction object
|
|
463
463
|
*/
|
|
464
|
-
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) =>
|
|
464
|
+
canPlaceLimitOrder: (params: CanPlaceLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
465
465
|
/**
|
|
466
466
|
* @description Check if a market order can be placed
|
|
467
467
|
* @param {CanPlaceMarketOrderParams} params Parameters for checking market order validity
|
|
468
468
|
* @returns A function that takes a Transaction object
|
|
469
469
|
*/
|
|
470
|
-
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) =>
|
|
470
|
+
canPlaceMarketOrder: (params: CanPlaceMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
471
471
|
/**
|
|
472
472
|
* @description Check if market order params are valid
|
|
473
473
|
* @param {string} poolKey The key to identify the pool
|
|
474
474
|
* @param {number} quantity Quantity
|
|
475
475
|
* @returns A function that takes a Transaction object
|
|
476
476
|
*/
|
|
477
|
-
checkMarketOrderParams: (poolKey: string, quantity: number) => (tx: Transaction) =>
|
|
477
|
+
checkMarketOrderParams: (poolKey: string, quantity: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
478
478
|
/**
|
|
479
479
|
* @description Check if limit order params are valid
|
|
480
480
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -483,7 +483,7 @@ declare class DeepBookContract {
|
|
|
483
483
|
* @param {number} expireTimestamp Expiration timestamp
|
|
484
484
|
* @returns A function that takes a Transaction object
|
|
485
485
|
*/
|
|
486
|
-
checkLimitOrderParams: (poolKey: string, price: number, quantity: number, expireTimestamp: number) => (tx: Transaction) =>
|
|
486
|
+
checkLimitOrderParams: (poolKey: string, price: number, quantity: number, expireTimestamp: number) => (tx: Transaction) => _mysten_sui_transactions10.TransactionResult;
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
export { DeepBookContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CreatePoolAdminParams, SetEwmaParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions29 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/deepbookAdmin.d.ts
|
|
@@ -104,7 +104,7 @@ declare class DeepBookAdminContract {
|
|
|
104
104
|
* @description Deauthorize the MarginApp by removing its authorization key
|
|
105
105
|
* @returns A function that takes a Transaction object and returns a bool
|
|
106
106
|
*/
|
|
107
|
-
deauthorizeMarginApp: () => (tx: Transaction) =>
|
|
107
|
+
deauthorizeMarginApp: () => (tx: Transaction) => _mysten_sui_transactions29.TransactionResult;
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
export { DeepBookAdminContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PoolConfigParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions30 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginAdmin.d.ts
|
|
@@ -18,7 +18,7 @@ declare class MarginAdminContract {
|
|
|
18
18
|
* @description Mint a maintainer cap
|
|
19
19
|
* @returns A function that takes a Transaction object
|
|
20
20
|
*/
|
|
21
|
-
mintMaintainerCap: () => (tx: Transaction) =>
|
|
21
|
+
mintMaintainerCap: () => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
22
22
|
/**
|
|
23
23
|
* @description Revoke a maintainer cap
|
|
24
24
|
* @returns A function that takes a Transaction object
|
|
@@ -81,7 +81,7 @@ declare class MarginAdminContract {
|
|
|
81
81
|
* @param {PoolConfigParams} poolConfigParams The parameters for the pool config
|
|
82
82
|
* @returns A function that takes a Transaction object
|
|
83
83
|
*/
|
|
84
|
-
newPoolConfig: (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) =>
|
|
84
|
+
newPoolConfig: (poolKey: string, poolConfigParams: PoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
85
85
|
/**
|
|
86
86
|
* @description Create a new pool config with leverage
|
|
87
87
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -96,7 +96,7 @@ declare class MarginAdminContract {
|
|
|
96
96
|
* @param {number} maxEwmaDifferenceBps The maximum EWMA difference in basis points
|
|
97
97
|
* @returns A function that takes a Transaction object
|
|
98
98
|
*/
|
|
99
|
-
newCoinTypeData: (coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number) => (tx: Transaction) =>
|
|
99
|
+
newCoinTypeData: (coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number) => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
100
100
|
/**
|
|
101
101
|
* @description Create a new Pyth config
|
|
102
102
|
* @param {Array<{coinKey: string, maxConfBps: number, maxEwmaDifferenceBps: number}>} coinSetups The coins with their oracle config to be added to the Pyth config
|
|
@@ -107,12 +107,12 @@ declare class MarginAdminContract {
|
|
|
107
107
|
coinKey: string;
|
|
108
108
|
maxConfBps: number;
|
|
109
109
|
maxEwmaDifferenceBps: number;
|
|
110
|
-
}>, maxAgeSeconds: number) => (tx: Transaction) =>
|
|
110
|
+
}>, maxAgeSeconds: number) => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
111
111
|
/**
|
|
112
112
|
* @description Mint a pause cap
|
|
113
113
|
* @returns A function that takes a Transaction object
|
|
114
114
|
*/
|
|
115
|
-
mintPauseCap: () => (tx: Transaction) =>
|
|
115
|
+
mintPauseCap: () => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
116
116
|
/**
|
|
117
117
|
* @description Revoke a pause cap
|
|
118
118
|
* @param {string} pauseCapId The ID of the pause cap to revoke
|
|
@@ -132,7 +132,7 @@ declare class MarginAdminContract {
|
|
|
132
132
|
* @param {string} coinKey The key to identify the margin pool
|
|
133
133
|
* @returns A function that takes a Transaction object and returns a Coin<Asset>
|
|
134
134
|
*/
|
|
135
|
-
adminWithdrawDefaultReferralFees: (coinKey: string) => (tx: Transaction) =>
|
|
135
|
+
adminWithdrawDefaultReferralFees: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions30.TransactionResult;
|
|
136
136
|
}
|
|
137
137
|
//#endregion
|
|
138
138
|
export { MarginAdminContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions106 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/marginLiquidations.d.ts
|
|
@@ -35,7 +35,7 @@ declare class MarginLiquidationsContract {
|
|
|
35
35
|
* @param {number} amount The amount to withdraw
|
|
36
36
|
* @returns A function that takes a Transaction object and returns the withdrawn coin
|
|
37
37
|
*/
|
|
38
|
-
withdraw: (vaultId: string, liquidationAdminCap: string, coinKey: string, amount: number) => (tx: Transaction) =>
|
|
38
|
+
withdraw: (vaultId: string, liquidationAdminCap: string, coinKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions106.TransactionResult;
|
|
39
39
|
/**
|
|
40
40
|
* @description Liquidate a margin manager by repaying base debt
|
|
41
41
|
* @param {string} vaultId The liquidation vault object ID
|
|
@@ -60,7 +60,7 @@ declare class MarginLiquidationsContract {
|
|
|
60
60
|
* @param {string} coinKey The key to identify the coin type
|
|
61
61
|
* @returns A function that takes a Transaction object
|
|
62
62
|
*/
|
|
63
|
-
balance: (vaultId: string, coinKey: string) => (tx: Transaction) =>
|
|
63
|
+
balance: (vaultId: string, coinKey: string) => (tx: Transaction) => _mysten_sui_transactions106.TransactionResult;
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
export { MarginLiquidationsContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InterestConfigParams, MarginPoolConfigParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions36 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginMaintainer.d.ts
|
|
@@ -27,27 +27,27 @@ declare class MarginMaintainerContract {
|
|
|
27
27
|
* @param {InterestConfigParams} interestConfig The configuration for the interest
|
|
28
28
|
* @returns A function that takes a Transaction object
|
|
29
29
|
*/
|
|
30
|
-
newProtocolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams, interestConfig: InterestConfigParams) => (tx: Transaction) =>
|
|
30
|
+
newProtocolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams, interestConfig: InterestConfigParams) => (tx: Transaction) => _mysten_sui_transactions36.TransactionResult;
|
|
31
31
|
/**
|
|
32
32
|
* @description Create a new margin pool config
|
|
33
33
|
* @param {string} coinKey The key to identify the coin
|
|
34
34
|
* @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool
|
|
35
35
|
* @returns A function that takes a Transaction object
|
|
36
36
|
*/
|
|
37
|
-
newMarginPoolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams) => (tx: Transaction) =>
|
|
37
|
+
newMarginPoolConfig: (coinKey: string, marginPoolConfig: MarginPoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions36.TransactionResult;
|
|
38
38
|
/**
|
|
39
39
|
* @description Create a new margin pool config with rate limit
|
|
40
40
|
* @param {string} coinKey The key to identify the coin
|
|
41
41
|
* @param {MarginPoolConfigParams} marginPoolConfig The configuration for the margin pool with rate limit
|
|
42
42
|
* @returns A function that takes a Transaction object
|
|
43
43
|
*/
|
|
44
|
-
newMarginPoolConfigWithRateLimit: (coinKey: string, marginPoolConfig: Required<Pick<MarginPoolConfigParams, "rateLimitCapacity" | "rateLimitRefillRatePerMs" | "rateLimitEnabled">> & MarginPoolConfigParams) => (tx: Transaction) =>
|
|
44
|
+
newMarginPoolConfigWithRateLimit: (coinKey: string, marginPoolConfig: Required<Pick<MarginPoolConfigParams, "rateLimitCapacity" | "rateLimitRefillRatePerMs" | "rateLimitEnabled">> & MarginPoolConfigParams) => (tx: Transaction) => _mysten_sui_transactions36.TransactionResult;
|
|
45
45
|
/**
|
|
46
46
|
* @description Create a new interest config
|
|
47
47
|
* @param {InterestConfigParams} interestConfig The configuration for the interest
|
|
48
48
|
* @returns A function that takes a Transaction object
|
|
49
49
|
*/
|
|
50
|
-
newInterestConfig: (interestConfig: InterestConfigParams) => (tx: Transaction) =>
|
|
50
|
+
newInterestConfig: (interestConfig: InterestConfigParams) => (tx: Transaction) => _mysten_sui_transactions36.TransactionResult;
|
|
51
51
|
/**
|
|
52
52
|
* @description Enable a deepbook pool for loan
|
|
53
53
|
* @param {string} deepbookPoolKey The key to identify the deepbook pool
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DepositDuringInitParams, DepositParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions40 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginManager.d.ts
|
|
@@ -73,49 +73,49 @@ declare class MarginManagerContract {
|
|
|
73
73
|
* @param {number} amount The amount to withdraw
|
|
74
74
|
* @returns A function that takes a Transaction object
|
|
75
75
|
*/
|
|
76
|
-
withdrawBase: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
76
|
+
withdrawBase: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
77
77
|
/**
|
|
78
78
|
* @description Withdraw quote from a margin manager
|
|
79
79
|
* @param {string} managerKey The key to identify the manager
|
|
80
80
|
* @param {number} amount The amount to withdraw
|
|
81
81
|
* @returns A function that takes a Transaction object
|
|
82
82
|
*/
|
|
83
|
-
withdrawQuote: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
83
|
+
withdrawQuote: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
84
84
|
/**
|
|
85
85
|
* @description Withdraw deep from a margin manager
|
|
86
86
|
* @param {string} managerKey The key to identify the manager
|
|
87
87
|
* @param {number} amount The amount to withdraw
|
|
88
88
|
* @returns A function that takes a Transaction object
|
|
89
89
|
*/
|
|
90
|
-
withdrawDeep: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
90
|
+
withdrawDeep: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
91
91
|
/**
|
|
92
92
|
* @description Borrow base from a margin manager
|
|
93
93
|
* @param {string} managerKey The key to identify the manager
|
|
94
94
|
* @param {number} amount The amount to borrow
|
|
95
95
|
* @returns A function that takes a Transaction object
|
|
96
96
|
*/
|
|
97
|
-
borrowBase: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
97
|
+
borrowBase: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
98
98
|
/**
|
|
99
99
|
* @description Borrow quote from a margin manager
|
|
100
100
|
* @param {string} managerKey The key to identify the manager
|
|
101
101
|
* @param {number} amount The amount to borrow
|
|
102
102
|
* @returns A function that takes a Transaction object
|
|
103
103
|
*/
|
|
104
|
-
borrowQuote: (managerKey: string, amount: number) => (tx: Transaction) =>
|
|
104
|
+
borrowQuote: (managerKey: string, amount: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
105
105
|
/**
|
|
106
106
|
* @description Repay base from a margin manager
|
|
107
107
|
* @param {string} managerKey The key to identify the manager
|
|
108
108
|
* @param {number} amount The amount to repay
|
|
109
109
|
* @returns A function that takes a Transaction object
|
|
110
110
|
*/
|
|
111
|
-
repayBase: (managerKey: string, amount?: number) => (tx: Transaction) =>
|
|
111
|
+
repayBase: (managerKey: string, amount?: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
112
112
|
/**
|
|
113
113
|
* @description Repay quote from a margin manager
|
|
114
114
|
* @param {string} managerKey The key to identify the manager
|
|
115
115
|
* @param {number} amount The amount to repay
|
|
116
116
|
* @returns A function that takes a Transaction object
|
|
117
117
|
*/
|
|
118
|
-
repayQuote: (managerKey: string, amount?: number) => (tx: Transaction) =>
|
|
118
|
+
repayQuote: (managerKey: string, amount?: number) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
119
119
|
/**
|
|
120
120
|
* @description Liquidate a margin manager
|
|
121
121
|
* @param {string} managerAddress The address of the manager to liquidate
|
|
@@ -124,7 +124,7 @@ declare class MarginManagerContract {
|
|
|
124
124
|
* @param {TransactionArgument} repayCoin The coin to repay
|
|
125
125
|
* @returns A function that takes a Transaction object
|
|
126
126
|
*/
|
|
127
|
-
liquidate: (managerAddress: string, poolKey: string, debtIsBase: boolean, repayCoin: TransactionArgument) => (tx: Transaction) =>
|
|
127
|
+
liquidate: (managerAddress: string, poolKey: string, debtIsBase: boolean, repayCoin: TransactionArgument) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
128
128
|
/**
|
|
129
129
|
* @description Set the referral for a margin manager (DeepBookPoolReferral)
|
|
130
130
|
* @param {string} managerKey The key to identify the margin manager
|
|
@@ -145,63 +145,63 @@ declare class MarginManagerContract {
|
|
|
145
145
|
* @param {string} marginManagerId The ID of the margin manager
|
|
146
146
|
* @returns A function that takes a Transaction object
|
|
147
147
|
*/
|
|
148
|
-
ownerByPoolKey: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
148
|
+
ownerByPoolKey: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
149
149
|
/**
|
|
150
150
|
* @description Get the DeepBook pool ID associated with a margin manager
|
|
151
151
|
* @param {string} poolKey The key to identify the pool
|
|
152
152
|
* @param {string} marginManagerId The ID of the margin manager
|
|
153
153
|
* @returns A function that takes a Transaction object
|
|
154
154
|
*/
|
|
155
|
-
deepbookPool: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
155
|
+
deepbookPool: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
156
156
|
/**
|
|
157
157
|
* @description Get the margin pool ID (if any) associated with a margin manager
|
|
158
158
|
* @param {string} poolKey The key to identify the pool
|
|
159
159
|
* @param {string} marginManagerId The ID of the margin manager
|
|
160
160
|
* @returns A function that takes a Transaction object
|
|
161
161
|
*/
|
|
162
|
-
marginPoolId: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
162
|
+
marginPoolId: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
163
163
|
/**
|
|
164
164
|
* @description Get borrowed shares for both base and quote assets
|
|
165
165
|
* @param {string} poolKey The key to identify the pool
|
|
166
166
|
* @param {string} marginManagerId The ID of the margin manager
|
|
167
167
|
* @returns A function that takes a Transaction object
|
|
168
168
|
*/
|
|
169
|
-
borrowedShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
169
|
+
borrowedShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
170
170
|
/**
|
|
171
171
|
* @description Get borrowed base shares
|
|
172
172
|
* @param {string} poolKey The key to identify the pool
|
|
173
173
|
* @param {string} marginManagerId The ID of the margin manager
|
|
174
174
|
* @returns A function that takes a Transaction object
|
|
175
175
|
*/
|
|
176
|
-
borrowedBaseShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
176
|
+
borrowedBaseShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
177
177
|
/**
|
|
178
178
|
* @description Get borrowed quote shares
|
|
179
179
|
* @param {string} poolKey The key to identify the pool
|
|
180
180
|
* @param {string} marginManagerId The ID of the margin manager
|
|
181
181
|
* @returns A function that takes a Transaction object
|
|
182
182
|
*/
|
|
183
|
-
borrowedQuoteShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
183
|
+
borrowedQuoteShares: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
184
184
|
/**
|
|
185
185
|
* @description Check if margin manager has base asset debt
|
|
186
186
|
* @param {string} poolKey The key to identify the pool
|
|
187
187
|
* @param {string} marginManagerId The ID of the margin manager
|
|
188
188
|
* @returns A function that takes a Transaction object
|
|
189
189
|
*/
|
|
190
|
-
hasBaseDebt: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
190
|
+
hasBaseDebt: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
191
191
|
/**
|
|
192
192
|
* @description Get the balance manager ID for a margin manager
|
|
193
193
|
* @param {string} poolKey The key to identify the pool
|
|
194
194
|
* @param {string} marginManagerId The ID of the margin manager
|
|
195
195
|
* @returns A function that takes a Transaction object
|
|
196
196
|
*/
|
|
197
|
-
balanceManager: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
197
|
+
balanceManager: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
198
198
|
/**
|
|
199
199
|
* @description Calculate assets (base and quote) for a margin manager
|
|
200
200
|
* @param {string} poolKey The key to identify the pool
|
|
201
201
|
* @param {string} marginManagerId The ID of the margin manager
|
|
202
202
|
* @returns A function that takes a Transaction object
|
|
203
203
|
*/
|
|
204
|
-
calculateAssets: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
204
|
+
calculateAssets: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
205
205
|
/**
|
|
206
206
|
* @description Calculate debts (base and quote) for a margin manager
|
|
207
207
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -209,7 +209,7 @@ declare class MarginManagerContract {
|
|
|
209
209
|
* @param {string} marginManagerId The ID of the margin manager
|
|
210
210
|
* @returns A function that takes a Transaction object
|
|
211
211
|
*/
|
|
212
|
-
calculateDebts: (poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
212
|
+
calculateDebts: (poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
213
213
|
/**
|
|
214
214
|
* @description Get comprehensive state information for a margin manager
|
|
215
215
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -219,28 +219,28 @@ declare class MarginManagerContract {
|
|
|
219
219
|
* base_debt, quote_debt, base_pyth_price, base_pyth_decimals,
|
|
220
220
|
* quote_pyth_price, quote_pyth_decimals)
|
|
221
221
|
*/
|
|
222
|
-
managerState: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
222
|
+
managerState: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
223
223
|
/**
|
|
224
224
|
* @description Get the base asset balance of a margin manager
|
|
225
225
|
* @param {string} poolKey The key to identify the pool
|
|
226
226
|
* @param {string} marginManagerId The ID of the margin manager
|
|
227
227
|
* @returns A function that takes a Transaction object
|
|
228
228
|
*/
|
|
229
|
-
baseBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
229
|
+
baseBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
230
230
|
/**
|
|
231
231
|
* @description Get the quote asset balance of a margin manager
|
|
232
232
|
* @param {string} poolKey The key to identify the pool
|
|
233
233
|
* @param {string} marginManagerId The ID of the margin manager
|
|
234
234
|
* @returns A function that takes a Transaction object
|
|
235
235
|
*/
|
|
236
|
-
quoteBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
236
|
+
quoteBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
237
237
|
/**
|
|
238
238
|
* @description Get the DEEP token balance of a margin manager
|
|
239
239
|
* @param {string} poolKey The key to identify the pool
|
|
240
240
|
* @param {string} marginManagerId The ID of the margin manager
|
|
241
241
|
* @returns A function that takes a Transaction object
|
|
242
242
|
*/
|
|
243
|
-
deepBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
243
|
+
deepBalance: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
244
244
|
/**
|
|
245
245
|
* @description Get account order details for a margin manager.
|
|
246
246
|
* This retrieves the balance manager from the margin manager and calls get_account_order_details.
|
|
@@ -248,7 +248,7 @@ declare class MarginManagerContract {
|
|
|
248
248
|
* @param {string} marginManagerId The ID of the margin manager
|
|
249
249
|
* @returns A function that takes a Transaction object
|
|
250
250
|
*/
|
|
251
|
-
getMarginAccountOrderDetails: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
251
|
+
getMarginAccountOrderDetails: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions40.TransactionResult;
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
254
|
export { MarginManagerContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions63 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/marginPool.d.ts
|
|
@@ -16,7 +16,7 @@ declare class MarginPoolContract {
|
|
|
16
16
|
* @description Mint a supplier cap for margin pool
|
|
17
17
|
* @returns A function that takes a Transaction object
|
|
18
18
|
*/
|
|
19
|
-
mintSupplierCap: () => (tx: Transaction) =>
|
|
19
|
+
mintSupplierCap: () => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
20
20
|
/**
|
|
21
21
|
* @description Supply to a margin pool
|
|
22
22
|
* @param {string} coinKey The key to identify the pool
|
|
@@ -33,7 +33,7 @@ declare class MarginPoolContract {
|
|
|
33
33
|
* @param {number} [amountToWithdraw] The amount to withdraw. If omitted, withdraws all.
|
|
34
34
|
* @returns A function that takes a Transaction object
|
|
35
35
|
*/
|
|
36
|
-
withdrawFromMarginPool: (coinKey: string, supplierCap: TransactionObjectArgument, amountToWithdraw?: number) => (tx: Transaction) =>
|
|
36
|
+
withdrawFromMarginPool: (coinKey: string, supplierCap: TransactionObjectArgument, amountToWithdraw?: number) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
37
37
|
/**
|
|
38
38
|
* @description Mint a referral for a margin pool
|
|
39
39
|
* @param {string} coinKey The key to identify the pool
|
|
@@ -46,94 +46,94 @@ declare class MarginPoolContract {
|
|
|
46
46
|
* @param {string} referralId The ID of the referral
|
|
47
47
|
* @returns A function that takes a Transaction object
|
|
48
48
|
*/
|
|
49
|
-
withdrawReferralFees: (coinKey: string, referralId: string) => (tx: Transaction) =>
|
|
49
|
+
withdrawReferralFees: (coinKey: string, referralId: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
50
50
|
/**
|
|
51
51
|
* @description Get the margin pool ID
|
|
52
52
|
* @param {string} coinKey The key to identify the pool
|
|
53
53
|
* @returns A function that takes a Transaction object
|
|
54
54
|
*/
|
|
55
|
-
getId: (coinKey: string) => (tx: Transaction) =>
|
|
55
|
+
getId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
56
56
|
/**
|
|
57
57
|
* @description Check if a deepbook pool is allowed for borrowing
|
|
58
58
|
* @param {string} coinKey The key to identify the margin pool
|
|
59
59
|
* @param {string} deepbookPoolId The ID of the deepbook pool
|
|
60
60
|
* @returns A function that takes a Transaction object
|
|
61
61
|
*/
|
|
62
|
-
deepbookPoolAllowed: (coinKey: string, deepbookPoolId: string) => (tx: Transaction) =>
|
|
62
|
+
deepbookPoolAllowed: (coinKey: string, deepbookPoolId: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
63
63
|
/**
|
|
64
64
|
* @description Get the total supply amount
|
|
65
65
|
* @param {string} coinKey The key to identify the pool
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
totalSupply: (coinKey: string) => (tx: Transaction) =>
|
|
68
|
+
totalSupply: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Get the total supply shares
|
|
71
71
|
* @param {string} coinKey The key to identify the pool
|
|
72
72
|
* @returns A function that takes a Transaction object
|
|
73
73
|
*/
|
|
74
|
-
supplyShares: (coinKey: string) => (tx: Transaction) =>
|
|
74
|
+
supplyShares: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
75
75
|
/**
|
|
76
76
|
* @description Get the total borrow amount
|
|
77
77
|
* @param {string} coinKey The key to identify the pool
|
|
78
78
|
* @returns A function that takes a Transaction object
|
|
79
79
|
*/
|
|
80
|
-
totalBorrow: (coinKey: string) => (tx: Transaction) =>
|
|
80
|
+
totalBorrow: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
81
81
|
/**
|
|
82
82
|
* @description Get the total borrow shares
|
|
83
83
|
* @param {string} coinKey The key to identify the pool
|
|
84
84
|
* @returns A function that takes a Transaction object
|
|
85
85
|
*/
|
|
86
|
-
borrowShares: (coinKey: string) => (tx: Transaction) =>
|
|
86
|
+
borrowShares: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
87
87
|
/**
|
|
88
88
|
* @description Get the last update timestamp
|
|
89
89
|
* @param {string} coinKey The key to identify the pool
|
|
90
90
|
* @returns A function that takes a Transaction object
|
|
91
91
|
*/
|
|
92
|
-
lastUpdateTimestamp: (coinKey: string) => (tx: Transaction) =>
|
|
92
|
+
lastUpdateTimestamp: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
93
93
|
/**
|
|
94
94
|
* @description Get the supply cap
|
|
95
95
|
* @param {string} coinKey The key to identify the pool
|
|
96
96
|
* @returns A function that takes a Transaction object
|
|
97
97
|
*/
|
|
98
|
-
supplyCap: (coinKey: string) => (tx: Transaction) =>
|
|
98
|
+
supplyCap: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
99
99
|
/**
|
|
100
100
|
* @description Get the max utilization rate
|
|
101
101
|
* @param {string} coinKey The key to identify the pool
|
|
102
102
|
* @returns A function that takes a Transaction object
|
|
103
103
|
*/
|
|
104
|
-
maxUtilizationRate: (coinKey: string) => (tx: Transaction) =>
|
|
104
|
+
maxUtilizationRate: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
105
105
|
/**
|
|
106
106
|
* @description Get the protocol spread
|
|
107
107
|
* @param {string} coinKey The key to identify the pool
|
|
108
108
|
* @returns A function that takes a Transaction object
|
|
109
109
|
*/
|
|
110
|
-
protocolSpread: (coinKey: string) => (tx: Transaction) =>
|
|
110
|
+
protocolSpread: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
111
111
|
/**
|
|
112
112
|
* @description Get the minimum borrow amount
|
|
113
113
|
* @param {string} coinKey The key to identify the pool
|
|
114
114
|
* @returns A function that takes a Transaction object
|
|
115
115
|
*/
|
|
116
|
-
minBorrow: (coinKey: string) => (tx: Transaction) =>
|
|
116
|
+
minBorrow: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
117
117
|
/**
|
|
118
118
|
* @description Get the current interest rate
|
|
119
119
|
* @param {string} coinKey The key to identify the pool
|
|
120
120
|
* @returns A function that takes a Transaction object
|
|
121
121
|
*/
|
|
122
|
-
interestRate: (coinKey: string) => (tx: Transaction) =>
|
|
122
|
+
interestRate: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
123
123
|
/**
|
|
124
124
|
* @description Get user supply shares for a supplier cap
|
|
125
125
|
* @param {string} coinKey The key to identify the pool
|
|
126
126
|
* @param {string} supplierCapId The ID of the supplier cap
|
|
127
127
|
* @returns A function that takes a Transaction object
|
|
128
128
|
*/
|
|
129
|
-
userSupplyShares: (coinKey: string, supplierCapId: string) => (tx: Transaction) =>
|
|
129
|
+
userSupplyShares: (coinKey: string, supplierCapId: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
130
130
|
/**
|
|
131
131
|
* @description Get user supply amount for a supplier cap
|
|
132
132
|
* @param {string} coinKey The key to identify the pool
|
|
133
133
|
* @param {string} supplierCapId The ID of the supplier cap
|
|
134
134
|
* @returns A function that takes a Transaction object
|
|
135
135
|
*/
|
|
136
|
-
userSupplyAmount: (coinKey: string, supplierCapId: string) => (tx: Transaction) =>
|
|
136
|
+
userSupplyAmount: (coinKey: string, supplierCapId: string) => (tx: Transaction) => _mysten_sui_transactions63.TransactionResult;
|
|
137
137
|
}
|
|
138
138
|
//#endregion
|
|
139
139
|
export { MarginPoolContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions92 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/marginRegistry.d.ts
|
|
@@ -17,83 +17,83 @@ declare class MarginRegistryContract {
|
|
|
17
17
|
* @param {string} poolKey The key to identify the pool
|
|
18
18
|
* @returns A function that takes a Transaction object
|
|
19
19
|
*/
|
|
20
|
-
poolEnabled: (poolKey: string) => (tx: Transaction) =>
|
|
20
|
+
poolEnabled: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
21
21
|
/**
|
|
22
22
|
* @description Get the margin pool ID for a given asset
|
|
23
23
|
* @param {string} coinKey The key to identify the coin
|
|
24
24
|
* @returns A function that takes a Transaction object
|
|
25
25
|
*/
|
|
26
|
-
getMarginPoolId: (coinKey: string) => (tx: Transaction) =>
|
|
26
|
+
getMarginPoolId: (coinKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
27
27
|
/**
|
|
28
28
|
* @description Get the margin pool IDs (base and quote) for a deepbook pool
|
|
29
29
|
* @param {string} poolKey The key to identify the pool
|
|
30
30
|
* @returns A function that takes a Transaction object
|
|
31
31
|
*/
|
|
32
|
-
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) =>
|
|
32
|
+
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
33
33
|
/**
|
|
34
34
|
* @description Get the margin manager IDs for a given owner
|
|
35
35
|
* @param {string} owner The owner address
|
|
36
36
|
* @returns A function that takes a Transaction object
|
|
37
37
|
*/
|
|
38
|
-
getMarginManagerIds: (owner: string) => (tx: Transaction) =>
|
|
38
|
+
getMarginManagerIds: (owner: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
39
39
|
/**
|
|
40
40
|
* @description Get the base margin pool ID for a deepbook pool
|
|
41
41
|
* @param {string} poolKey The key to identify the pool
|
|
42
42
|
* @returns A function that takes a Transaction object
|
|
43
43
|
*/
|
|
44
|
-
baseMarginPoolId: (poolKey: string) => (tx: Transaction) =>
|
|
44
|
+
baseMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
45
45
|
/**
|
|
46
46
|
* @description Get the quote margin pool ID for a deepbook pool
|
|
47
47
|
* @param {string} poolKey The key to identify the pool
|
|
48
48
|
* @returns A function that takes a Transaction object
|
|
49
49
|
*/
|
|
50
|
-
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) =>
|
|
50
|
+
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
51
51
|
/**
|
|
52
52
|
* @description Get the minimum withdraw risk ratio for a deepbook pool
|
|
53
53
|
* @param {string} poolKey The key to identify the pool
|
|
54
54
|
* @returns A function that takes a Transaction object
|
|
55
55
|
*/
|
|
56
|
-
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
56
|
+
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
57
57
|
/**
|
|
58
58
|
* @description Get the minimum borrow risk ratio for a deepbook pool
|
|
59
59
|
* @param {string} poolKey The key to identify the pool
|
|
60
60
|
* @returns A function that takes a Transaction object
|
|
61
61
|
*/
|
|
62
|
-
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
62
|
+
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
63
63
|
/**
|
|
64
64
|
* @description Get the liquidation risk ratio for a deepbook pool
|
|
65
65
|
* @param {string} poolKey The key to identify the pool
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
68
|
+
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Get the target liquidation risk ratio for a deepbook pool
|
|
71
71
|
* @param {string} poolKey The key to identify the pool
|
|
72
72
|
* @returns A function that takes a Transaction object
|
|
73
73
|
*/
|
|
74
|
-
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) =>
|
|
74
|
+
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
75
75
|
/**
|
|
76
76
|
* @description Get the user liquidation reward for a deepbook pool
|
|
77
77
|
* @param {string} poolKey The key to identify the pool
|
|
78
78
|
* @returns A function that takes a Transaction object
|
|
79
79
|
*/
|
|
80
|
-
userLiquidationReward: (poolKey: string) => (tx: Transaction) =>
|
|
80
|
+
userLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
81
81
|
/**
|
|
82
82
|
* @description Get the pool liquidation reward for a deepbook pool
|
|
83
83
|
* @param {string} poolKey The key to identify the pool
|
|
84
84
|
* @returns A function that takes a Transaction object
|
|
85
85
|
*/
|
|
86
|
-
poolLiquidationReward: (poolKey: string) => (tx: Transaction) =>
|
|
86
|
+
poolLiquidationReward: (poolKey: string) => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
87
87
|
/**
|
|
88
88
|
* @description Get all allowed maintainer cap IDs
|
|
89
89
|
* @returns A function that takes a Transaction object
|
|
90
90
|
*/
|
|
91
|
-
allowedMaintainers: () => (tx: Transaction) =>
|
|
91
|
+
allowedMaintainers: () => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
92
92
|
/**
|
|
93
93
|
* @description Get all allowed pause cap IDs
|
|
94
94
|
* @returns A function that takes a Transaction object
|
|
95
95
|
*/
|
|
96
|
-
allowedPauseCaps: () => (tx: Transaction) =>
|
|
96
|
+
allowedPauseCaps: () => (tx: Transaction) => _mysten_sui_transactions92.TransactionResult;
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
export { MarginRegistryContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginRegistry.d.mts","names":[],"sources":["../../src/transactions/marginRegistry.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASa,cAAA,sBAAA,CAAsB;EAMd,CAAA,OAAA;EASoB;;;EAgBe,WAAA,CAAA,MAAA,EAzBnC,cAyBmC;EAcE;;;;;EA2BD,WAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EAzDhB,WAyDgB,EAAA,GAzDL,
|
|
1
|
+
{"version":3,"file":"marginRegistry.d.mts","names":[],"sources":["../../src/transactions/marginRegistry.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASa,cAAA,sBAAA,CAAsB;EAMd,CAAA,OAAA;EASoB;;;EAgBe,WAAA,CAAA,MAAA,EAzBnC,cAyBmC;EAcE;;;;;EA2BD,WAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EAzDhB,WAyDgB,EAAA,GAzDL,0BAAA,CAAA,iBAyDK;EAcV;;;;;EA4BY,eAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EAnFd,WAmFc,EAAA,GAnFH,0BAAA,CAAA,iBAmFG;EAcT;;;;;EA4BY,4BAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EA/GJ,WA+GI,EAAA,GA/GO,0BAAA,CAAA,iBA+GP;EAcX;;;;;EAyBT,mBAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EAxIK,WAwIL,EAAA,GAxIgB,0BAAA,CAAA,iBAwIhB;EAAA;;;;;8CA3HI,gBAAW,0BAAA,CAAA;;;;;;+CAcV,gBAAW,0BAAA,CAAA;;;;;;kDAcR,gBAAW,0BAAA,CAAA;;;;;;gDAcb,gBAAW,0BAAA,CAAA;;;;;;kDAcT,gBAAW,0BAAA,CAAA;;;;;;wDAcL,gBAAW,0BAAA,CAAA;;;;;;mDAchB,gBAAW,0BAAA,CAAA;;;;;;mDAcX,gBAAW,0BAAA,CAAA;;;;;iCAa7B,gBAAW,0BAAA,CAAA;;;;;+BAYb,gBAAW,0BAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AddConditionalOrderParams, PendingLimitOrderParams, PendingMarketOrderParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions84 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/marginTPSL.d.ts
|
|
@@ -20,21 +20,21 @@ declare class MarginTPSLContract {
|
|
|
20
20
|
* @param {number} triggerPrice The price at which to trigger the order
|
|
21
21
|
* @returns A function that takes a Transaction object
|
|
22
22
|
*/
|
|
23
|
-
newCondition: (poolKey: string, triggerBelowPrice: boolean, triggerPrice: number) => (tx: Transaction) =>
|
|
23
|
+
newCondition: (poolKey: string, triggerBelowPrice: boolean, triggerPrice: number) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
24
24
|
/**
|
|
25
25
|
* @description Create a new pending limit order for use in conditional orders
|
|
26
26
|
* @param {string} poolKey The key to identify the pool
|
|
27
27
|
* @param {PendingLimitOrderParams} params Parameters for the pending limit order
|
|
28
28
|
* @returns A function that takes a Transaction object
|
|
29
29
|
*/
|
|
30
|
-
newPendingLimitOrder: (poolKey: string, params: PendingLimitOrderParams) => (tx: Transaction) =>
|
|
30
|
+
newPendingLimitOrder: (poolKey: string, params: PendingLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
31
31
|
/**
|
|
32
32
|
* @description Create a new pending market order for use in conditional orders
|
|
33
33
|
* @param {string} poolKey The key to identify the pool
|
|
34
34
|
* @param {PendingMarketOrderParams} params Parameters for the pending market order
|
|
35
35
|
* @returns A function that takes a Transaction object
|
|
36
36
|
*/
|
|
37
|
-
newPendingMarketOrder: (poolKey: string, params: PendingMarketOrderParams) => (tx: Transaction) =>
|
|
37
|
+
newPendingMarketOrder: (poolKey: string, params: PendingMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
38
38
|
/**
|
|
39
39
|
* @description Add a conditional order (take profit or stop loss)
|
|
40
40
|
* @param {AddConditionalOrderParams} params Parameters for adding the conditional order
|
|
@@ -62,14 +62,14 @@ declare class MarginTPSLContract {
|
|
|
62
62
|
* @param {number} maxOrdersToExecute Maximum number of orders to execute in this call
|
|
63
63
|
* @returns A function that takes a Transaction object
|
|
64
64
|
*/
|
|
65
|
-
executeConditionalOrders: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) =>
|
|
65
|
+
executeConditionalOrders: (managerAddress: string, poolKey: string, maxOrdersToExecute: number) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
66
66
|
/**
|
|
67
67
|
* @description Get all conditional order IDs for a margin manager
|
|
68
68
|
* @param {string} poolKey The key to identify the pool
|
|
69
69
|
* @param {string} marginManagerId The ID of the margin manager
|
|
70
70
|
* @returns A function that takes a Transaction object
|
|
71
71
|
*/
|
|
72
|
-
conditionalOrderIds: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
72
|
+
conditionalOrderIds: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
73
73
|
/**
|
|
74
74
|
* @description Get a specific conditional order by ID
|
|
75
75
|
* @param {string} poolKey The key to identify the pool
|
|
@@ -77,7 +77,7 @@ declare class MarginTPSLContract {
|
|
|
77
77
|
* @param {string} conditionalOrderId The ID of the conditional order
|
|
78
78
|
* @returns A function that takes a Transaction object
|
|
79
79
|
*/
|
|
80
|
-
conditionalOrder: (poolKey: string, marginManagerId: string, conditionalOrderId: string) => (tx: Transaction) =>
|
|
80
|
+
conditionalOrder: (poolKey: string, marginManagerId: string, conditionalOrderId: string) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
81
81
|
/**
|
|
82
82
|
* @description Get the lowest trigger price for trigger_above orders
|
|
83
83
|
* Returns constants::max_u64() if there are no trigger_above orders
|
|
@@ -85,7 +85,7 @@ declare class MarginTPSLContract {
|
|
|
85
85
|
* @param {string} marginManagerId The ID of the margin manager
|
|
86
86
|
* @returns A function that takes a Transaction object
|
|
87
87
|
*/
|
|
88
|
-
lowestTriggerAbovePrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
88
|
+
lowestTriggerAbovePrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
89
89
|
/**
|
|
90
90
|
* @description Get the highest trigger price for trigger_below orders
|
|
91
91
|
* Returns 0 if there are no trigger_below orders
|
|
@@ -93,7 +93,7 @@ declare class MarginTPSLContract {
|
|
|
93
93
|
* @param {string} marginManagerId The ID of the margin manager
|
|
94
94
|
* @returns A function that takes a Transaction object
|
|
95
95
|
*/
|
|
96
|
-
highestTriggerBelowPrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) =>
|
|
96
|
+
highestTriggerBelowPrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => _mysten_sui_transactions84.TransactionResult;
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
export { MarginTPSLContract };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MarginProposalParams, PlaceMarginLimitOrderParams, PlaceMarginMarketOrderParams } from "../types/index.mjs";
|
|
2
2
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _mysten_sui_transactions80 from "@mysten/sui/transactions";
|
|
4
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
5
5
|
|
|
6
6
|
//#region src/transactions/poolProxy.d.ts
|
|
@@ -18,25 +18,25 @@ declare class PoolProxyContract {
|
|
|
18
18
|
* @param {PlaceMarginLimitOrderParams} params Parameters for placing a limit order
|
|
19
19
|
* @returns A function that takes a Transaction object
|
|
20
20
|
*/
|
|
21
|
-
placeLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) =>
|
|
21
|
+
placeLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions80.TransactionResult;
|
|
22
22
|
/**
|
|
23
23
|
* @description Place a market order
|
|
24
24
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a market order
|
|
25
25
|
* @returns A function that takes a Transaction object
|
|
26
26
|
*/
|
|
27
|
-
placeMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
27
|
+
placeMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions80.TransactionResult;
|
|
28
28
|
/**
|
|
29
29
|
* @description Place a reduce only limit order
|
|
30
30
|
* @param {PlaceMarginLimitOrderParams} params Parameters for placing a reduce only limit order
|
|
31
31
|
* @returns A function that takes a Transaction object
|
|
32
32
|
*/
|
|
33
|
-
placeReduceOnlyLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) =>
|
|
33
|
+
placeReduceOnlyLimitOrder: (params: PlaceMarginLimitOrderParams) => (tx: Transaction) => _mysten_sui_transactions80.TransactionResult;
|
|
34
34
|
/**
|
|
35
35
|
* @description Place a reduce only market order
|
|
36
36
|
* @param {PlaceMarginMarketOrderParams} params Parameters for placing a reduce only market order
|
|
37
37
|
* @returns A function that takes a Transaction object
|
|
38
38
|
*/
|
|
39
|
-
placeReduceOnlyMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) =>
|
|
39
|
+
placeReduceOnlyMarketOrder: (params: PlaceMarginMarketOrderParams) => (tx: Transaction) => _mysten_sui_transactions80.TransactionResult;
|
|
40
40
|
/**
|
|
41
41
|
* @description Modify an existing order
|
|
42
42
|
* @param {string} marginManagerKey The key to identify the MarginManager
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@mysten/deepbook-v3",
|
|
3
3
|
"author": "Mysten Labs <build@mystenlabs.com>",
|
|
4
4
|
"description": "Sui Deepbook SDK",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.7",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.mjs",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.mts",
|
|
13
|
-
"import": "./dist/index.mjs"
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"@noble/hashes": "^2.0.1",
|
|
33
34
|
"axios": "^1.13.5",
|
|
34
35
|
"axios-retry": "^4.5.0",
|
|
35
|
-
"@mysten/bcs": "^2.0.
|
|
36
|
+
"@mysten/bcs": "^2.0.2"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@iarna/toml": "^2.2.5",
|
|
@@ -45,11 +46,11 @@
|
|
|
45
46
|
"vite": "^7.3.1",
|
|
46
47
|
"vitest": "^4.0.17",
|
|
47
48
|
"wait-on": "^9.0.3",
|
|
48
|
-
"@mysten/
|
|
49
|
-
"@mysten/
|
|
49
|
+
"@mysten/codegen": "^0.8.1",
|
|
50
|
+
"@mysten/sui": "^2.3.2"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
|
-
"@mysten/sui": "^2.3.
|
|
53
|
+
"@mysten/sui": "^2.3.2"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|
|
55
56
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|