@mysten/deepbook-v3 1.2.0 → 1.2.1
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 +11 -0
- package/dist/transactions/balanceManager.d.mts +12 -12
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/deepbook.d.mts +20 -20
- package/dist/transactions/deepbookAdmin.d.mts +2 -2
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginLiquidations.d.mts.map +1 -1
- package/dist/transactions/marginManager.d.mts +23 -23
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginManager.mjs +5 -1
- package/dist/transactions/marginManager.mjs.map +1 -1
- package/dist/transactions/marginRegistry.d.mts +15 -15
- package/dist/utils/constants.d.mts +4 -0
- package/dist/utils/constants.d.mts.map +1 -1
- package/dist/utils/constants.mjs +12 -5
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +5 -5
- package/src/transactions/marginManager.ts +1 -1
- package/src/utils/constants.ts +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 1.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1e0aef8: Fix missing DebtType type argument in marginManager.liquidate() to match the on-chain
|
|
8
|
+
function's 3-type-parameter signature.
|
|
9
|
+
- Updated dependencies [43e69f8]
|
|
10
|
+
- Updated dependencies [e51dc5d]
|
|
11
|
+
- @mysten/bcs@2.0.3
|
|
12
|
+
- @mysten/sui@2.8.0
|
|
13
|
+
|
|
3
14
|
## 1.2.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions21 from "@mysten/sui/transactions";
|
|
3
3
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/transactions/balanceManager.d.ts
|
|
@@ -21,7 +21,7 @@ declare class BalanceManagerContract {
|
|
|
21
21
|
* @description Create a new BalanceManager, manually set the owner. Returns the manager.
|
|
22
22
|
* @returns A function that takes a Transaction object
|
|
23
23
|
*/
|
|
24
|
-
createBalanceManagerWithOwner: (ownerAddress: string) => (tx: Transaction) =>
|
|
24
|
+
createBalanceManagerWithOwner: (ownerAddress: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
25
25
|
/**
|
|
26
26
|
* @description Share the BalanceManager
|
|
27
27
|
* @param {TransactionArgument} manager The BalanceManager to share
|
|
@@ -65,38 +65,38 @@ declare class BalanceManagerContract {
|
|
|
65
65
|
* @param {string} managerKey The key of the BalanceManager
|
|
66
66
|
* @returns A function that takes a Transaction object
|
|
67
67
|
*/
|
|
68
|
-
generateProof: (managerKey: string) => (tx: Transaction) =>
|
|
68
|
+
generateProof: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
69
69
|
/**
|
|
70
70
|
* @description Generate a trade proof as the owner
|
|
71
71
|
* @param {string} managerId The ID of the BalanceManager
|
|
72
72
|
* @returns A function that takes a Transaction object
|
|
73
73
|
*/
|
|
74
|
-
generateProofAsOwner: (managerId: string) => (tx: Transaction) =>
|
|
74
|
+
generateProofAsOwner: (managerId: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
75
75
|
/**
|
|
76
76
|
* @description Generate a trade proof as a trader
|
|
77
77
|
* @param {string} managerId The ID of the BalanceManager
|
|
78
78
|
* @param {string} tradeCapId The ID of the tradeCap
|
|
79
79
|
* @returns A function that takes a Transaction object
|
|
80
80
|
*/
|
|
81
|
-
generateProofAsTrader: (managerId: string, tradeCapId: string) => (tx: Transaction) =>
|
|
81
|
+
generateProofAsTrader: (managerId: string, tradeCapId: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
82
82
|
/**
|
|
83
83
|
* @description Mint a TradeCap
|
|
84
84
|
* @param {string} managerKey The name of the BalanceManager
|
|
85
85
|
* @returns A function that takes a Transaction object
|
|
86
86
|
*/
|
|
87
|
-
mintTradeCap: (managerKey: string) => (tx: Transaction) =>
|
|
87
|
+
mintTradeCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
88
88
|
/**
|
|
89
89
|
* @description Mint a DepositCap
|
|
90
90
|
* @param {string} managerKey The name of the BalanceManager
|
|
91
91
|
* @returns A function that takes a Transaction object
|
|
92
92
|
*/
|
|
93
|
-
mintDepositCap: (managerKey: string) => (tx: Transaction) =>
|
|
93
|
+
mintDepositCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
94
94
|
/**
|
|
95
95
|
* @description Mint a WithdrawalCap
|
|
96
96
|
* @param {string} managerKey The name of the BalanceManager
|
|
97
97
|
* @returns A function that takes a Transaction object
|
|
98
98
|
*/
|
|
99
|
-
mintWithdrawalCap: (managerKey: string) => (tx: Transaction) =>
|
|
99
|
+
mintWithdrawalCap: (managerKey: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
100
100
|
/**
|
|
101
101
|
* @description Deposit using the DepositCap
|
|
102
102
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -112,7 +112,7 @@ declare class BalanceManagerContract {
|
|
|
112
112
|
* @param {number} amountToWithdraw The amount to withdraw
|
|
113
113
|
* @returns A function that takes a Transaction object
|
|
114
114
|
*/
|
|
115
|
-
withdrawWithCap: (managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) =>
|
|
115
|
+
withdrawWithCap: (managerKey: string, coinKey: string, amountToWithdraw: number) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
116
116
|
/**
|
|
117
117
|
* @description Set the referral for the BalanceManager for a specific pool
|
|
118
118
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -147,20 +147,20 @@ declare class BalanceManagerContract {
|
|
|
147
147
|
* @param {string} referralId The ID of the referral to get the owner of
|
|
148
148
|
* @returns A function that takes a Transaction object
|
|
149
149
|
*/
|
|
150
|
-
balanceManagerReferralOwner: (referralId: string) => (tx: Transaction) =>
|
|
150
|
+
balanceManagerReferralOwner: (referralId: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
151
151
|
/**
|
|
152
152
|
* @description Get the pool ID associated with a referral (DeepBookPoolReferral)
|
|
153
153
|
* @param {string} referralId The ID of the referral to get the pool ID of
|
|
154
154
|
* @returns A function that takes a Transaction object
|
|
155
155
|
*/
|
|
156
|
-
balanceManagerReferralPoolId: (referralId: string) => (tx: Transaction) =>
|
|
156
|
+
balanceManagerReferralPoolId: (referralId: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
157
157
|
/**
|
|
158
158
|
* @description Get the referral ID from the balance manager for a specific pool
|
|
159
159
|
* @param {string} managerKey The name of the BalanceManager
|
|
160
160
|
* @param {string} poolKey Key of the pool to get the referral for
|
|
161
161
|
* @returns A function that takes a Transaction object
|
|
162
162
|
*/
|
|
163
|
-
getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) =>
|
|
163
|
+
getBalanceManagerReferralId: (managerKey: string, poolKey: string) => (tx: Transaction) => _mysten_sui_transactions21.TransactionResult;
|
|
164
164
|
/**
|
|
165
165
|
* @description Revoke a TradeCap. This also revokes the associated DepositCap and WithdrawCap.
|
|
166
166
|
* @param {string} managerKey The name of the BalanceManager
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balanceManager.d.mts","names":[],"sources":["../../src/transactions/balanceManager.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAWa,cAAA,sBAAA,CAAsB;EAMd,CAAA,OAAA;EAQsB;;;EA4BV,WAAA,CAAA,MAAA,EApCZ,cAoCY;EAA6B;;;;EAkFO,4BAAA,EAAA,GAAA,GAAA,CA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BAAA,CAAA;;;;;;kDAcR,gBAAW,0BAAA,CAAA;;;;;;;;yFAiBY;;;;;;;;2FA6BC,gBAAW,0BAAA,CAAA;;;;;;;;8EAyBlC,6BAA6B;;;;;;;;+EAgB9B,6BAA6B;uDASxB;;;;;;sCAajB;;;;;;mCAaH;;;;;;4DAayB,gBAAW,0BAAA,CAAA;;;;;;6DAYV,gBAAW,0BAAA,CAAA;;;;;;;6EAaK,gBAAW,0BAAA,CAAA;;;;;;;mEAerB"}
|
|
@@ -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_transactions32 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_transactions32.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_transactions32.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_transactions32.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_transactions32.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 | bigint) => (tx: Transaction) =>
|
|
387
|
+
getQuoteQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions32.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 | bigint) => (tx: Transaction) =>
|
|
394
|
+
getBaseQuantityOutInputFee: (poolKey: string, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions32.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 | bigint, quoteQuantity: number | bigint) => (tx: Transaction) =>
|
|
402
|
+
getQuantityOutInputFee: (poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions32.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 | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
410
|
+
getBaseQuantityIn: (poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions32.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 | bigint, payWithDeep: boolean) => (tx: Transaction) =>
|
|
418
|
+
getQuoteQuantityIn: (poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean) => (tx: Transaction) => _mysten_sui_transactions32.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_transactions32.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 | bigint, price: number | bigint) => (tx: Transaction) =>
|
|
433
|
+
getOrderDeepRequired: (poolKey: string, baseQuantity: number | bigint, price: number | bigint) => (tx: Transaction) => _mysten_sui_transactions32.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_transactions32.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_transactions32.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_transactions32.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_transactions32.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_transactions32.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_transactions32.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 | bigint) => (tx: Transaction) =>
|
|
477
|
+
checkMarketOrderParams: (poolKey: string, quantity: number | bigint) => (tx: Transaction) => _mysten_sui_transactions32.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 | bigint, quantity: number | bigint, expireTimestamp: number) => (tx: Transaction) =>
|
|
486
|
+
checkLimitOrderParams: (poolKey: string, price: number | bigint, quantity: number | bigint, expireTimestamp: number) => (tx: Transaction) => _mysten_sui_transactions32.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_transactions51 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_transactions51.TransactionResult;
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
export { DeepBookAdminContract };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions91 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_transactions91.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_transactions91.TransactionResult;
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
export { MarginLiquidationsContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginLiquidations.d.mts","names":[],"sources":["../../src/transactions/marginLiquidations.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAWa,cAAA,0BAAA,CAA0B;EAMlB,CAAA,OAAA;EAS2C;;;EAwC9C,WAAA,CAAA,MAAA,EAjDG,cAiDH;EAuBX;;;;;gEA/DyD;;;;;;;;;mGAiBzD;;;;;;;;;oGAuBA,gBAAW,
|
|
1
|
+
{"version":3,"file":"marginLiquidations.d.mts","names":[],"sources":["../../src/transactions/marginLiquidations.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAWa,cAAA,0BAAA,CAA0B;EAMlB,CAAA,OAAA;EAS2C;;;EAwC9C,WAAA,CAAA,MAAA,EAjDG,cAiDH;EAuBX;;;;;gEA/DyD;;;;;;;;;mGAiBzD;;;;;;;;;oGAuBA,gBAAW,0BAAA,CAAA;;;;;;;;;0GAuBX;;;;;;;;;2GAwCA;;;;;;;sDAsC+C,gBAAW,0BAAA,CAAA"}
|
|
@@ -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_transactions0 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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.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_transactions0.TransactionResult;
|
|
244
244
|
}
|
|
245
245
|
//#endregion
|
|
246
246
|
export { MarginManagerContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginManager.d.mts","names":[],"sources":["../../src/transactions/marginManager.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAYa,cAAA,qBAAA,CAAqB;EAMb,CAAA,OAAA;EASyB;;;EA8CiB,WAAA,CAAA,MAAA,EAvD1C,cAuD0C;EACxD;;;;;EAsFkB,gBAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EArIqB,WAqIrB,EAAA,GAAA,IAAA;EAAuB;;;;;EAgGc,+BAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,EAAA,EAhND,WAgNC,EAAA,GAAA;IAAW,OAAA,EAAA;MA8BZ,YAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA;MAAW,KAAA,EAAA,cAAA;IA+Bb,CAAA;IAAW,WAAA,EAAA;MA4BV,YAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA;MAAW,KAAA,EAAA,cAAA;IA4BZ,CAAA;EAAW,CAAA;EA4BV;;;;;;;EA0GS,kBAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAlbxC,mBAkbwC,EAAA,WAAA,EAlbN,mBAkbM,EAAA,GAAA,CAAA,EAAA,EAjb9D,WAib8D,EAAA,GAAA,IAAA;EAAW;;;;;;EAmDA,2BAAA,EAAA,CAAA,MAAA,EAndxC,uBAmdwC,EAAA,GAAA,CAAA,EAAA,EAndP,WAmdO,EAAA,GAAA,IAAA;EAiBP;;;;;EAkCI,WAAA,EAAA,CAAA,MAAA,EAjerD,aAieqD,EAAA,GAAA,CAAA,EAAA,EAje9B,WAie8B,EAAA,GAAA,IAAA;EAiBR;;;;;EAoCY,YAAA,EAAA,CAAA,MAAA,EAtfxD,aAsfwD,EAAA,GAAA,CAAA,EAAA,EAtfjC,WAsfiC,EAAA,GAAA,IAAA;EAsB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|
|
354
|
+
quoteCoin.type,
|
|
355
|
+
debtIsBase ? baseCoin.type : quoteCoin.type
|
|
356
|
+
]
|
|
353
357
|
});
|
|
354
358
|
};
|
|
355
359
|
this.setMarginManagerReferral = (managerKey, referral) => (tx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marginManager.mjs","names":["#config"],"sources":["../../src/transactions/marginManager.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\nimport { coinWithBalance } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\nimport type { DepositParams, DepositDuringInitParams } from '../types/index.js';\nimport { convertQuantity } from '../utils/conversion.js';\n\n/**\n * MarginManagerContract class for managing MarginManager operations.\n */\nexport class MarginManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for MarginManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create a new margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tnewMarginManager = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(this.#config.REGISTRY_ID),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new margin manager with an initializer\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tnewMarginManagerWithInitializer = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst [manager, initializer] = tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new_with_initializer`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(this.#config.REGISTRY_ID),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t\treturn { manager, initializer };\n\t};\n\n\t/**\n\t * @description Share a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {TransactionArgument} manager The margin manager to share\n\t * @param {TransactionArgument} initializer The initializer for the manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareMarginManager =\n\t\t(poolKey: string, manager: TransactionArgument, initializer: TransactionArgument) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::share`,\n\t\t\t\targuments: [manager, initializer],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Deposit into a margin manager during initialization (before sharing).\n\t * Use this when you need to deposit funds into a newly created manager in the same transaction.\n\t * @param {DepositDuringInitParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositDuringInitialization = (params: DepositDuringInitParams) => (tx: Transaction) => {\n\t\tconst { manager, poolKey, coinType } = params;\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t// Get the deposit coin from config using the coinType key (e.g., 'SUI', 'DBUSDC', 'DEEP')\n\t\tconst depositCoin = this.#config.getCoin(coinType);\n\n\t\t// If amount is provided, create a coin with balance; otherwise use the provided coin\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: depositCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, depositCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\tmanager,\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, depositCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit base into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositBase = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: baseCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, baseCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit quote into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositQuote = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: quoteCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, quoteCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit deep into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositDeep = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: deepCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, deepCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawBase = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, baseCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawQuote = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, quoteCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw deep from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawDeep = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, deepCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Borrow base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to borrow\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowBase = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, baseCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Borrow quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to borrow\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowQuote = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, quoteCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Repay base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\trepayBase = (managerKey: string, amount?: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object.option({\n\t\t\t\t\ttype: 'u64',\n\t\t\t\t\tvalue: amount ? tx.pure.u64(convertQuantity(amount, baseCoin.scalar)) : null,\n\t\t\t\t}),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Repay quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\trepayQuote = (managerKey: string, amount?: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object.option({\n\t\t\t\t\ttype: 'u64',\n\t\t\t\t\tvalue: amount ? tx.pure.u64(convertQuantity(amount, quoteCoin.scalar)) : null,\n\t\t\t\t}),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Liquidate a margin manager\n\t * @param {string} managerAddress The address of the manager to liquidate\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {boolean} debtIsBase Whether the debt is in base\n\t * @param {TransactionArgument} repayCoin The coin to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\tliquidate =\n\t\t(\n\t\t\tmanagerAddress: string,\n\t\t\tpoolKey: string,\n\t\t\tdebtIsBase: boolean,\n\t\t\trepayCoin: TransactionArgument,\n\t\t) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\t\tconst marginPool = debtIsBase ? baseMarginPool : quoteMarginPool;\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::liquidate`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(managerAddress),\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\t\ttx.object(marginPool.address),\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\trepayCoin,\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for a margin manager (DeepBookPoolReferral)\n\t * @param {string} managerKey The key to identify the margin manager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetMarginManagerReferral = (managerKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::set_margin_manager_referral`,\n\t\t\targuments: [tx.object(manager.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Unset the referral for a margin manager\n\t * @param {string} managerKey The key to identify the margin manager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetMarginManagerReferral = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::unset_margin_manager_referral`,\n\t\t\targuments: [tx.object(manager.address), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t// === Read-Only Functions ===\n\n\t/**\n\t * @description Get the owner address of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\townerByPoolKey = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::owner`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DeepBook pool ID associated with a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tdeepbookPool = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deepbook_pool`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the margin pool ID (if any) associated with a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmarginPoolId = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::margin_pool_id`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed shares for both base and quote assets\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed base shares\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedBaseShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_base_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed quote shares\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedQuoteShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_quote_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if margin manager has base asset debt\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\thasBaseDebt = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::has_base_debt`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balance manager ID for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManager = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::balance_manager`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Calculate assets (base and quote) for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcalculateAssets = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::calculate_assets`,\n\t\t\targuments: [tx.object(marginManagerId), tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Calculate debts (base and quote) for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} coinKey The key to identify the debt coin (base or quote)\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcalculateDebts =\n\t\t(poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst debtCoin = this.#config.getCoin(coinKey);\n\t\t\tconst marginPool = this.#config.getMarginPool(coinKey);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::calculate_debts`,\n\t\t\t\targuments: [tx.object(marginManagerId), tx.object(marginPool.address), tx.object.clock()],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, debtCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get comprehensive state information for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t * @returns Returns (manager_id, deepbook_pool_id, risk_ratio, base_asset, quote_asset,\n\t * base_debt, quote_debt, base_pyth_price, base_pyth_decimals,\n\t * quote_pyth_price, quote_pyth_decimals)\n\t */\n\tmanagerState = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::manager_state`,\n\t\t\targuments: [\n\t\t\t\ttx.object(marginManagerId),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base asset balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tbaseBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::base_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote asset balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tquoteBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::quote_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DEEP token balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tdeepBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deep_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n}\n"],"mappings":";;;;;;;AAYA,IAAa,wBAAb,MAAmC;CAClC;;;;CAKA,YAAY,QAAwB;2BAShB,aAAqB,OAAoB;GAC5D,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,MAAG,SAAS;IACX,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,KAAK,QAAQ;KACvB,GAAG,OAAO,MAAKA,OAAQ,YAAY;KACnC,GAAG,OAAO,MAAKA,OAAQ,mBAAmB;KAC1C,GAAG,OAAO,OAAO;KACjB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;0CAQgC,aAAqB,OAAoB;GAC3E,MAAM,OAA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-License-Identifier: Apache-2.0\nimport type { Transaction, TransactionArgument } from '@mysten/sui/transactions';\nimport { coinWithBalance } from '@mysten/sui/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\nimport type { DepositParams, DepositDuringInitParams } from '../types/index.js';\nimport { convertQuantity } from '../utils/conversion.js';\n\n/**\n * MarginManagerContract class for managing MarginManager operations.\n */\nexport class MarginManagerContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for MarginManagerContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Create a new margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tnewMarginManager = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(this.#config.REGISTRY_ID),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Create a new margin manager with an initializer\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tnewMarginManagerWithInitializer = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst [manager, initializer] = tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::new_with_initializer`,\n\t\t\targuments: [\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(this.#config.REGISTRY_ID),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t\treturn { manager, initializer };\n\t};\n\n\t/**\n\t * @description Share a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {TransactionArgument} manager The margin manager to share\n\t * @param {TransactionArgument} initializer The initializer for the manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tshareMarginManager =\n\t\t(poolKey: string, manager: TransactionArgument, initializer: TransactionArgument) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\ttx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::share`,\n\t\t\t\targuments: [manager, initializer],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Deposit into a margin manager during initialization (before sharing).\n\t * Use this when you need to deposit funds into a newly created manager in the same transaction.\n\t * @param {DepositDuringInitParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositDuringInitialization = (params: DepositDuringInitParams) => (tx: Transaction) => {\n\t\tconst { manager, poolKey, coinType } = params;\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t// Get the deposit coin from config using the coinType key (e.g., 'SUI', 'DBUSDC', 'DEEP')\n\t\tconst depositCoin = this.#config.getCoin(coinType);\n\n\t\t// If amount is provided, create a coin with balance; otherwise use the provided coin\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: depositCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, depositCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\tmanager,\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, depositCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit base into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositBase = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: baseCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, baseCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit quote into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositQuote = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: quoteCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, quoteCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Deposit deep into a margin manager\n\t * @param {DepositParams} params The deposit parameters\n\t * @returns A function that takes a Transaction object\n\t */\n\tdepositDeep = (params: DepositParams) => (tx: Transaction) => {\n\t\tconst { managerKey } = params;\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst coin =\n\t\t\t'amount' in params && params.amount !== undefined\n\t\t\t\t? coinWithBalance({\n\t\t\t\t\t\ttype: deepCoin.type,\n\t\t\t\t\t\tbalance: convertQuantity(params.amount, deepCoin.scalar),\n\t\t\t\t\t})\n\t\t\t\t: params.coin;\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deposit`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\tcoin,\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawBase = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, baseCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, baseCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawQuote = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, quoteCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Withdraw deep from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to withdraw\n\t * @returns A function that takes a Transaction object\n\t */\n\twithdrawDeep = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::withdraw`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, deepCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, deepCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Borrow base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to borrow\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowBase = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, baseCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Borrow quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to borrow\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowQuote = (managerKey: string, amount: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrow_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.pure.u64(convertQuantity(amount, quoteCoin.scalar)),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Repay base from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\trepayBase = (managerKey: string, amount?: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_base`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object.option({\n\t\t\t\t\ttype: 'u64',\n\t\t\t\t\tvalue: amount ? tx.pure.u64(convertQuantity(amount, baseCoin.scalar)) : null,\n\t\t\t\t}),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Repay quote from a margin manager\n\t * @param {string} managerKey The key to identify the manager\n\t * @param {number} amount The amount to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\trepayQuote = (managerKey: string, amount?: number) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::repay_quote`,\n\t\t\targuments: [\n\t\t\t\ttx.object(manager.address),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object.option({\n\t\t\t\t\ttype: 'u64',\n\t\t\t\t\tvalue: amount ? tx.pure.u64(convertQuantity(amount, quoteCoin.scalar)) : null,\n\t\t\t\t}),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Liquidate a margin manager\n\t * @param {string} managerAddress The address of the manager to liquidate\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {boolean} debtIsBase Whether the debt is in base\n\t * @param {TransactionArgument} repayCoin The coin to repay\n\t * @returns A function that takes a Transaction object\n\t */\n\tliquidate =\n\t\t(\n\t\t\tmanagerAddress: string,\n\t\t\tpoolKey: string,\n\t\t\tdebtIsBase: boolean,\n\t\t\trepayCoin: TransactionArgument,\n\t\t) =>\n\t\t(tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\t\tconst marginPool = debtIsBase ? baseMarginPool : quoteMarginPool;\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::liquidate`,\n\t\t\t\targuments: [\n\t\t\t\t\ttx.object(managerAddress),\n\t\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\t\ttx.object(marginPool.address),\n\t\t\t\t\ttx.object(pool.address),\n\t\t\t\t\trepayCoin,\n\t\t\t\t\ttx.object.clock(),\n\t\t\t\t],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, debtIsBase ? baseCoin.type : quoteCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Set the referral for a margin manager (DeepBookPoolReferral)\n\t * @param {string} managerKey The key to identify the margin manager\n\t * @param {string} referral The referral (DeepBookPoolReferral) to set\n\t * @returns A function that takes a Transaction object\n\t */\n\tsetMarginManagerReferral = (managerKey: string, referral: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::set_margin_manager_referral`,\n\t\t\targuments: [tx.object(manager.address), tx.object(referral)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Unset the referral for a margin manager\n\t * @param {string} managerKey The key to identify the margin manager\n\t * @param {string} poolKey The key of the pool to unset the referral for\n\t * @returns A function that takes a Transaction object\n\t */\n\tunsetMarginManagerReferral = (managerKey: string, poolKey: string) => (tx: Transaction) => {\n\t\tconst manager = this.#config.getMarginManager(managerKey);\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::unset_margin_manager_referral`,\n\t\t\targuments: [tx.object(manager.address), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t// === Read-Only Functions ===\n\n\t/**\n\t * @description Get the owner address of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\townerByPoolKey = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::owner`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DeepBook pool ID associated with a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tdeepbookPool = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deepbook_pool`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the margin pool ID (if any) associated with a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tmarginPoolId = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::margin_pool_id`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed shares for both base and quote assets\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed base shares\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedBaseShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_base_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get borrowed quote shares\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tborrowedQuoteShares = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::borrowed_quote_shares`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Check if margin manager has base asset debt\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\thasBaseDebt = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::has_base_debt`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the balance manager ID for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tbalanceManager = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::balance_manager`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Calculate assets (base and quote) for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcalculateAssets = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::calculate_assets`,\n\t\t\targuments: [tx.object(marginManagerId), tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Calculate debts (base and quote) for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} coinKey The key to identify the debt coin (base or quote)\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tcalculateDebts =\n\t\t(poolKey: string, coinKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\t\tconst pool = this.#config.getPool(poolKey);\n\t\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\t\tconst debtCoin = this.#config.getCoin(coinKey);\n\t\t\tconst marginPool = this.#config.getMarginPool(coinKey);\n\t\t\treturn tx.moveCall({\n\t\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::calculate_debts`,\n\t\t\t\targuments: [tx.object(marginManagerId), tx.object(marginPool.address), tx.object.clock()],\n\t\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type, debtCoin.type],\n\t\t\t});\n\t\t};\n\n\t/**\n\t * @description Get comprehensive state information for a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t * @returns Returns (manager_id, deepbook_pool_id, risk_ratio, base_asset, quote_asset,\n\t * base_debt, quote_debt, base_pyth_price, base_pyth_decimals,\n\t * quote_pyth_price, quote_pyth_decimals)\n\t */\n\tmanagerState = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst baseMarginPool = this.#config.getMarginPool(pool.baseCoin);\n\t\tconst quoteMarginPool = this.#config.getMarginPool(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::manager_state`,\n\t\t\targuments: [\n\t\t\t\ttx.object(marginManagerId),\n\t\t\t\ttx.object(this.#config.MARGIN_REGISTRY_ID),\n\t\t\t\ttx.object(baseCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(quoteCoin.priceInfoObjectId!),\n\t\t\t\ttx.object(pool.address),\n\t\t\t\ttx.object(baseMarginPool.address),\n\t\t\t\ttx.object(quoteMarginPool.address),\n\t\t\t\ttx.object.clock(),\n\t\t\t],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base asset balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tbaseBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::base_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote asset balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tquoteBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::quote_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the DEEP token balance of a margin manager\n\t * @param {string} poolKey The key to identify the pool\n\t * @param {string} marginManagerId The ID of the margin manager\n\t * @returns A function that takes a Transaction object\n\t */\n\tdeepBalance = (poolKey: string, marginManagerId: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_manager::deep_balance`,\n\t\t\targuments: [tx.object(marginManagerId)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n}\n"],"mappings":";;;;;;;AAYA,IAAa,wBAAb,MAAmC;CAClC;;;;CAKA,YAAY,QAAwB;2BAShB,aAAqB,OAAoB;GAC5D,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,MAAG,SAAS;IACX,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,KAAK,QAAQ;KACvB,GAAG,OAAO,MAAKA,OAAQ,YAAY;KACnC,GAAG,OAAO,MAAKA,OAAQ,mBAAmB;KAC1C,GAAG,OAAO,OAAO;KACjB;IACD,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;0CAQgC,aAAqB,OAAoB;GAC3E,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;GACtD,MAAM,CAAC,SAAS,eAAe,GAAG,SAAS;IAC1C,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW;KACV,GAAG,OAAO,KAAK,QAAQ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D,UAAO,GAAG,SAAS;IAClB,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW,CAAC,GAAG,OAAO,gBAAgB,CAAC;IACvC,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;uBASa,SAAiB,qBAA6B,OAAoB;GACjF,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,UAAO,GAAG,SAAS;IAClB,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW,CAAC,GAAG,OAAO,gBAAgB,CAAC;IACvC,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;sBASY,SAAiB,qBAA6B,OAAoB;GAChF,MAAM,OAAO,MAAKA,OAAQ,QAAQ,QAAQ;GAC1C,MAAM,WAAW,MAAKA,OAAQ,QAAQ,KAAK,SAAS;GACpD,MAAM,YAAY,MAAKA,OAAQ,QAAQ,KAAK,UAAU;AACtD,UAAO,GAAG,SAAS;IAClB,QAAQ,GAAG,MAAKA,OAAQ,kBAAkB;IAC1C,WAAW,CAAC,GAAG,OAAO,gBAAgB,CAAC;IACvC,eAAe,CAAC,SAAS,MAAM,UAAU,KAAK;IAC9C,CAAC;;AA/tBF,QAAKA,SAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepBookConfig } from "../utils/config.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_transactions93 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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.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_transactions93.TransactionResult;
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
export { MarginRegistryContract };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":[],"mappings":";;;KAKY,OAAA,GAAU,eAAe;KACzB,OAAA,GAAU,eAAe;AADzB,KAEA,aAAA,GAAgB,MAFN,CAAA,MAAM,EAEe,UAFf,CAAA;AAChB,UAEK,kBAAA,CAFK;EACV,mBAAa,CAAA,EAAA,MAAkB;EAC1B,WAAA,CAAA,EAAA,MAAA;EASJ,gBAAA,CAAA,EAAA,MAOiB;EAEjB,iBAAA,CAAA,EAOiB,MAAA;EAEjB,kBA2CZ,CAAA,EAAA,MA3C0B;EA6Cd,
|
|
1
|
+
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":[],"mappings":";;;KAKY,OAAA,GAAU,eAAe;KACzB,OAAA,GAAU,eAAe;AADzB,KAEA,aAAA,GAAgB,MAFN,CAAA,MAAM,EAEe,UAFf,CAAA;AAChB,UAEK,kBAAA,CAFK;EACV,mBAAa,CAAA,EAAA,MAAkB;EAC1B,WAAA,CAAA,EAAA,MAAA;EASJ,gBAAA,CAAA,EAAA,MAOiB;EAEjB,iBAAA,CAAA,EAOiB,MAAA;EAEjB,kBA2CZ,CAAA,EAAA,MA3C0B;EA6Cd,sBA+HZ,CAAA,EAAA,MA/H0B;AAiI3B;AAsCa,cAtOA,iBAsOc,EAyH1B;EAEY,mBAAA,EAiBZ,MAAA;EAEY,WAAA,EAAA,MAAA;EA+BA,gBAAA,EAAA,MAGZ;EAEY,iBAAA,EAAA,MAGZ;;;;cAlZY;;;;;;;;cASA,cAAc;cA6Cd,cAAc;cAiId,cAAc;cAsCd,cAAc;cA2Hd;;;;;;;;;;;;;;;;;;cAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BA;;;;cAKA"}
|
package/dist/utils/constants.mjs
CHANGED
|
@@ -108,6 +108,14 @@ const mainnetCoins = {
|
|
|
108
108
|
currencyId: "0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc",
|
|
109
109
|
priceInfoObjectId: "0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b"
|
|
110
110
|
},
|
|
111
|
+
USDSUI: {
|
|
112
|
+
address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
|
|
113
|
+
type: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,
|
|
114
|
+
scalar: 1e6,
|
|
115
|
+
feed: "0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a",
|
|
116
|
+
currencyId: "0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731",
|
|
117
|
+
priceInfoObjectId: "0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425"
|
|
118
|
+
},
|
|
111
119
|
WUSDC: {
|
|
112
120
|
address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
|
|
113
121
|
type: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,
|
|
@@ -177,11 +185,6 @@ const mainnetCoins = {
|
|
|
177
185
|
address: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,
|
|
178
186
|
type: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,
|
|
179
187
|
scalar: 1e6
|
|
180
|
-
},
|
|
181
|
-
USDSUI: {
|
|
182
|
-
address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
|
|
183
|
-
type: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,
|
|
184
|
-
scalar: 1e6
|
|
185
188
|
}
|
|
186
189
|
};
|
|
187
190
|
const testnetPools = {
|
|
@@ -385,6 +388,10 @@ const mainnetMarginPools = {
|
|
|
385
388
|
XBTC: {
|
|
386
389
|
address: "0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4",
|
|
387
390
|
type: "0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC"
|
|
391
|
+
},
|
|
392
|
+
USDSUI: {
|
|
393
|
+
address: "0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c",
|
|
394
|
+
type: "0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI"
|
|
388
395
|
}
|
|
389
396
|
};
|
|
390
397
|
const testnetPythConfigs = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\n\tDEEPBOOK_PACKAGE_ID?: string;\n\tREGISTRY_ID?: string;\n\tDEEP_TREASURY_ID?: string;\n\tMARGIN_PACKAGE_ID?: string;\n\tMARGIN_REGISTRY_ID?: string;\n\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x55718c06706bee34c9f3c39f662f10be354a4dcc719699ad72091dc343b641b8',\n} satisfies DeepbookPackageIds;\n\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758', // DEEP uses HFT feed on testnet\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\tpriceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',\n};\n"],"mappings":";AAiBA,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR,MAAM;EACN,YAAY;EACZ,mBAAmB;EACnB;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EAC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EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB"}
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { Coin, Pool, MarginPool } from '../types/index.js';\n\nexport type CoinMap = Record<string, Coin>;\nexport type PoolMap = Record<string, Pool>;\nexport type MarginPoolMap = Record<string, MarginPool>;\nexport interface DeepbookPackageIds {\n\tDEEPBOOK_PACKAGE_ID?: string;\n\tREGISTRY_ID?: string;\n\tDEEP_TREASURY_ID?: string;\n\tMARGIN_PACKAGE_ID?: string;\n\tMARGIN_REGISTRY_ID?: string;\n\tLIQUIDATION_PACKAGE_ID?: string;\n}\n\nexport const testnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x22be4cade64bf2d02412c7e8d0e8beea2f78828b948118d46735315409371a3c',\n\tREGISTRY_ID: '0x7c256edbda983a2cd6f946655f4bf3f00a41043993781f8674a7046e8c0e11d1',\n\tDEEP_TREASURY_ID: '0x69fffdae0075f8f71f4fa793549c11079266910e8905169845af1f5d00e09dcb',\n\tMARGIN_PACKAGE_ID: '0xd6a42f4df4db73d68cbeb52be66698d2fe6a9464f45ad113ca52b0c6ebd918b6',\n\tMARGIN_REGISTRY_ID: '0x48d7640dfae2c6e9ceeada197a7a1643984b5a24c55a0c6c023dac77e0339f75',\n\tLIQUIDATION_PACKAGE_ID: '0x8d69c3ef3ef580e5bf87b933ce28de19a5d0323588d1a44b9c60b4001741aa24',\n} satisfies DeepbookPackageIds;\n\nexport const mainnetPackageIds = {\n\tDEEPBOOK_PACKAGE_ID: '0x337f4f4f6567fcd778d5454f27c16c70e2f274cc6377ea6249ddf491482ef497',\n\tREGISTRY_ID: '0xaf16199a2dff736e9f07a845f23c5da6df6f756eddb631aed9d24a93efc4549d',\n\tDEEP_TREASURY_ID: '0x032abf8948dda67a271bcc18e776dbbcfb0d58c8d288a700ff0d5521e57a1ffe',\n\tMARGIN_PACKAGE_ID: '0xfbd322126f1452fd4c89aedbaeb9fd0c44df9b5cedbe70d76bf80dc086031377',\n\tMARGIN_REGISTRY_ID: '0x0e40998b359a9ccbab22a98ed21bd4346abf19158bc7980c8291908086b3a742',\n\tLIQUIDATION_PACKAGE_ID: '0x55718c06706bee34c9f3c39f662f10be354a4dcc719699ad72091dc343b641b8',\n} satisfies DeepbookPackageIds;\n\nexport const testnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8`,\n\t\ttype: `0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x99137a18354efa7fb6840889d059fdb04c46a6ce21be97ab60d9ad93e91ac758', // DEEP uses HFT feed on testnet\n\t\tcurrencyId: '0xbf1b77e244f649c736a44898585cc8ac939fbb0bbdf1d8d2a183978cc312e613',\n\t\tpriceInfoObjectId: '0x3d52fffa2cd9e54b39bb36d282bdda560b15b8b4fdf4766a3c58499ef172bafc',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x50c67b3fd225db8912a424dd4baed60ffdde625ed2feaaf283724f9608fea266',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x1ebb295c789cc42b3b2a1606482cd1c7124076a0f5676718501fda8c7fd075a0',\n\t},\n\tDBUSDC: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x41f3625971ca2ed2263e78573fe5ce23e13d2558ed3f2e47ab0f84fb9e7ae722',\n\t\tcurrencyId: '0x509db0f9283c9ee4fdc5b99028a439d3639f49e9709e3d7a6de14b3bfdb0c784',\n\t\tpriceInfoObjectId: '0x9c4dd4008297ffa5e480684b8100ec21cc934405ed9a25d4e4d7b6259aad9c81',\n\t},\n\tDBTC: {\n\t\taddress: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86`,\n\t\ttype: `0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xf9c0172ba10dfa4d19088d94f5bf61d3b54d5bd7483a322a982e1373ee8ea31b',\n\t\tcurrencyId: '0x3ef2afa2126704bf721b9c8495d94288f6bd090fc454fe3e1613eb765a8a348f',\n\t\tpriceInfoObjectId: '0x72431a238277695d3f31e4425225a4462674ee6cceeea9d66447b210755fffba',\n\t},\n\tDBUSDT: {\n\t\taddress: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7`,\n\t\ttype: `0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDT::DBUSDT`,\n\t\tscalar: 1000000,\n\t},\n\tWAL: {\n\t\taddress: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76`,\n\t\ttype: `0x9ef7676a9f81937a52ae4b2af8d511a28a0b080477c0c2db40b0ab8882240d76::wal::WAL`,\n\t\tscalar: 1000000000,\n\t},\n};\n\nexport const mainnetCoins: CoinMap = {\n\tDEEP: {\n\t\taddress: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270`,\n\t\ttype: `0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',\n\t\tcurrencyId: '0x3f2afb7c5f245870a8b8a3808e6dd7042446a0e7504e9d2795372da053858cd9',\n\t\tpriceInfoObjectId: '0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed',\n\t},\n\tSUI: {\n\t\taddress: `0x0000000000000000000000000000000000000000000000000000000000000002`,\n\t\ttype: `0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',\n\t\tcurrencyId: '0xf256d3fb6a50eaa748d94335b34f2982fbc3b63ceec78cafaa29ebc9ebaf2bbc',\n\t\tpriceInfoObjectId: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',\n\t},\n\tUSDC: {\n\t\taddress: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7`,\n\t\ttype: `0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',\n\t\tcurrencyId: '0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a',\n\t\tpriceInfoObjectId: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',\n\t},\n\tWAL: {\n\t\taddress: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59`,\n\t\ttype: `0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL`,\n\t\tscalar: 1000000000,\n\t\tfeed: '0xeba0732395fae9dec4bae12e52760b35fc1c5671e2da8b449c9af4efe5d54341',\n\t\tcurrencyId: '0xb6a0c0bacb1c87c3be4dff20c22ef1012125b5724b5b0ff424f852a2651b23fa',\n\t\tpriceInfoObjectId: '0xeb7e669f74d976c0b99b6ef9801e3a77716a95f1a15754e0f1399ce3fb60973d',\n\t},\n\tSUIUSDE: {\n\t\taddress: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402`,\n\t\ttype: `0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE`,\n\t\tscalar: 1000000,\n\t\tfeed: '0x8cead549d0e770dea8fdf5e018a85d59585265cf8bff16ba83962fc7996dbb7f',\n\t\tcurrencyId: '0x44f0959110bd9e5e91af0483364c42075ac19f173b28f708989f419ef3560576',\n\t\tpriceInfoObjectId: '0x9b2028bfc829127d2e5ead1691dc3002de9e9b8d8076b4915e5ecc7d9b99d63f',\n\t},\n\tXBTC: {\n\t\taddress: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50`,\n\t\ttype: `0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC`,\n\t\tscalar: 100000000,\n\t\tfeed: '0xae8f269ed9c4bed616c99a98cf6dfe562bd3202e7f91821a471ff854713851b4',\n\t\tcurrencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',\n\t\tpriceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',\n\t},\n\tUSDSUI: {\n\t\taddress: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,\n\t\ttype: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,\n\t\tscalar: 1000000,\n\t\tfeed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',\n\t\tcurrencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',\n\t\tpriceInfoObjectId: '0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425',\n\t},\n\tWUSDC: {\n\t\taddress: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,\n\t\ttype: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tWETH: {\n\t\taddress: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5`,\n\t\ttype: `0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tBETH: {\n\t\taddress: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29`,\n\t\ttype: `0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH`,\n\t\tscalar: 100000000,\n\t},\n\tWBTC: {\n\t\taddress: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881`,\n\t\ttype: `0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN`,\n\t\tscalar: 100000000,\n\t},\n\tWUSDT: {\n\t\taddress: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c`,\n\t\ttype: `0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN`,\n\t\tscalar: 1000000,\n\t},\n\tNS: {\n\t\taddress: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178`,\n\t\ttype: `0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS`,\n\t\tscalar: 1000000,\n\t},\n\tTYPUS: {\n\t\taddress: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385`,\n\t\ttype: `0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS`,\n\t\tscalar: 1000000000,\n\t},\n\tAUSD: {\n\t\taddress: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2`,\n\t\ttype: `0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD`,\n\t\tscalar: 1000000,\n\t},\n\tDRF: {\n\t\taddress: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e`,\n\t\ttype: `0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF`,\n\t\tscalar: 1000000,\n\t},\n\tSEND: {\n\t\taddress: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7`,\n\t\ttype: `0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND`,\n\t\tscalar: 1000000,\n\t},\n\tIKA: {\n\t\taddress: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa`,\n\t\ttype: `0x7262fb2f7a3a14c888c438a3cd9b912469a58cf60f367352c46584262e8299aa::ika::IKA`,\n\t\tscalar: 1000000000,\n\t},\n\tALKIMI: {\n\t\taddress: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489`,\n\t\ttype: `0x1a8f4bc33f8ef7fbc851f156857aa65d397a6a6fd27a7ac2ca717b51f2fd9489::alkimi::ALKIMI`,\n\t\tscalar: 1000000000,\n\t},\n\tLZWBTC: {\n\t\taddress: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942`,\n\t\ttype: `0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC`,\n\t\tscalar: 100000000,\n\t},\n\tUSDT: {\n\t\taddress: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068`,\n\t\ttype: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,\n\t\tscalar: 1000000,\n\t},\n};\n\nexport const testnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0x48c95963e9eac37a316b7ae04a0deb761bcdcc2b67912374d6036e7f0e9bae9f`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_DBUSDC: {\n\t\taddress: `0x1c19362ca52b8ffd7a33cee805a67d40f31e6ba303753fd3a4cfdfacea7163a5`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDEEP_DBUSDC: {\n\t\taddress: `0xe86b991f8632217505fd859445f9803967ac84a9d4a1219065bf191fcb74b622`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tDBUSDT_DBUSDC: {\n\t\taddress: `0x83970bb02e3636efdff8c141ab06af5e3c9a22e2f74d7f02a9c3430d0d10c1ca`,\n\t\tbaseCoin: 'DBUSDT',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_DBUSDC: {\n\t\taddress: `0xeb524b6aea0ec4b494878582e0b78924208339d360b62aec4a8ecd4031520dbb`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x8c1c1b186c4fddab1ebd53e0895a36c1d1b3b9a77cd34e607bef49a38af0150a`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tDBTC_DBUSDC: {\n\t\taddress: `0x0dce0aa771074eb83d1f4a29d48be8248d4d2190976a5241f66b43ec18fa34de`,\n\t\tbaseCoin: 'DBTC',\n\t\tquoteCoin: 'DBUSDC',\n\t},\n};\n\nexport const mainnetPools: PoolMap = {\n\tDEEP_SUI: {\n\t\taddress: `0xb663828d6217467c8a1838a03793da896cbe745b150ebd57d82f814ca579fc22`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_USDC: {\n\t\taddress: `0xe05dafb5133bcffb8d59f4e12465dc0e9faeaa05e3e342a08fe135800e3e4407`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDEEP_USDC: {\n\t\taddress: `0xf948981b806057580f91622417534f491da5f61aeaf33d0ed8e69fd5691c95ce`,\n\t\tbaseCoin: 'DEEP',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDT_USDC: {\n\t\taddress: `0x4e2ca3988246e1d50b9bf209abb9c1cbfec65bd95afdacc620a36c67bdb8452f`,\n\t\tbaseCoin: 'WUSDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWUSDC_USDC: {\n\t\taddress: `0xa0b9ebefb38c963fd115f52d71fa64501b79d1adcb5270563f92ce0442376545`,\n\t\tbaseCoin: 'WUSDC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tBETH_USDC: {\n\t\taddress: `0x1109352b9112717bd2a7c3eb9a416fff1ba6951760f5bdd5424cf5e4e5b3e65c`,\n\t\tbaseCoin: 'BETH',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_USDC: {\n\t\taddress: `0x0c0fdd4008740d81a8a7d4281322aee71a1b62c449eb5b142656753d89ebc060`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'USDC',\n\t},\n\tNS_SUI: {\n\t\taddress: `0x27c4fdb3b846aa3ae4a65ef5127a309aa3c1f466671471a806d8912a18b253e8`,\n\t\tbaseCoin: 'NS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tTYPUS_SUI: {\n\t\taddress: `0xe8e56f377ab5a261449b92ac42c8ddaacd5671e9fec2179d7933dd1a91200eec`,\n\t\tbaseCoin: 'TYPUS',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSUI_AUSD: {\n\t\taddress: `0x183df694ebc852a5f90a959f0f563b82ac9691e42357e9a9fe961d71a1b809c8`,\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'AUSD',\n\t},\n\tAUSD_USDC: {\n\t\taddress: `0x5661fc7f88fbeb8cb881150a810758cf13700bb4e1f31274a244581b37c303c3`,\n\t\tbaseCoin: 'AUSD',\n\t\tquoteCoin: 'USDC',\n\t},\n\tDRF_SUI: {\n\t\taddress: `0x126865a0197d6ab44bfd15fd052da6db92fd2eb831ff9663451bbfa1219e2af2`,\n\t\tbaseCoin: 'DRF',\n\t\tquoteCoin: 'SUI',\n\t},\n\tSEND_USDC: {\n\t\taddress: `0x1fe7b99c28ded39774f37327b509d58e2be7fff94899c06d22b407496a6fa990`,\n\t\tbaseCoin: 'SEND',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_USDC: {\n\t\taddress: `0x56a1c985c1f1123181d6b881714793689321ba24301b3585eec427436eb1c76d`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'USDC',\n\t},\n\tWAL_SUI: {\n\t\taddress: `0x81f5339934c83ea19dd6bcc75c52e83509629a5f71d3257428c2ce47cc94d08b`,\n\t\tbaseCoin: 'WAL',\n\t\tquoteCoin: 'SUI',\n\t},\n\tXBTC_USDC: {\n\t\taddress: `0x20b9a3ec7a02d4f344aa1ebc5774b7b0ccafa9a5d76230662fdc0300bb215307`,\n\t\tbaseCoin: 'XBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tIKA_USDC: {\n\t\taddress: `0xfa732993af2b60d04d7049511f801e79426b2b6a5103e22769c0cead982b0f47`,\n\t\tbaseCoin: 'IKA',\n\t\tquoteCoin: 'USDC',\n\t},\n\tALKIMI_SUI: {\n\t\taddress: `0x84752993c6dc6fce70e25ddeb4daddb6592d6b9b0912a0a91c07cfff5a721d89`,\n\t\tbaseCoin: 'ALKIMI',\n\t\tquoteCoin: 'SUI',\n\t},\n\tLZWBTC_USDC: {\n\t\taddress: `0xf5142aafa24866107df628bf92d0358c7da6acc46c2f10951690fd2b8570f117`,\n\t\tbaseCoin: 'LZWBTC',\n\t\tquoteCoin: 'USDC',\n\t},\n\tUSDT_USDC: {\n\t\taddress: '0xfc28a2fb22579c16d672a1152039cbf671e5f4b9f103feddff4ea06ef3c2bc25',\n\t\tbaseCoin: 'USDT',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUIUSDE_USDC: {\n\t\taddress: '0x0fac1cebf35bde899cd9ecdd4371e0e33f44ba83b8a2902d69186646afa3a94b',\n\t\tbaseCoin: 'SUIUSDE',\n\t\tquoteCoin: 'USDC',\n\t},\n\tSUI_SUIUSDE: {\n\t\taddress: '0x034f3a42e7348de2084406db7a725f9d9d132a56c68324713e6e623601fb4fd7',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'SUIUSDE',\n\t},\n\tSUI_USDSUI: {\n\t\taddress: '0x826eeacb2799726334aa580396338891205a41cf9344655e526aae6ddd5dc03f',\n\t\tbaseCoin: 'SUI',\n\t\tquoteCoin: 'USDSUI',\n\t},\n\tUSDSUI_USDC: {\n\t\taddress: '0xa374264d43e6baa5aa8b35ff18ff24fdba7443b4bcb884cb4c2f568d32cdac36',\n\t\tbaseCoin: 'USDSUI',\n\t\tquoteCoin: 'USDC',\n\t},\n};\n\nexport const testnetMarginPools = {\n\tSUI: {\n\t\taddress: '0xcdbbe6a72e639b647296788e2e4b1cac5cea4246028ba388ba1332ff9a382eea',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tDBUSDC: {\n\t\taddress: '0xf08568da93834e1ee04f09902ac7b1e78d3fdf113ab4d2106c7265e95318b14d',\n\t\ttype: '0xf7152c05930480cd740d7311b5b8b45c6f488e3a53a11c3f74a6fac36a52e0d7::DBUSDC::DBUSDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x610640613f21d9e688d6f8103d17df22315c32e0c80590ce64951a1991378b55',\n\t\ttype: '0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP',\n\t},\n\tDBTC: {\n\t\taddress: '0xf3440b4aafcc8b12fc4b242e9590c52873b8238a0d0e52fbf9dae61d2970796a',\n\t\ttype: '0x6502dae813dbe5e42643c119a6450a518481f03063febc7e20238e43b6ea9e86::dbtc::DBTC',\n\t},\n};\n\nexport const mainnetMarginPools = {\n\tSUI: {\n\t\taddress: '0x53041c6f86c4782aabbfc1d4fe234a6d37160310c7ee740c915f0a01b7127344',\n\t\ttype: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',\n\t},\n\tUSDC: {\n\t\taddress: '0xba473d9ae278f10af75c50a8fa341e9c6a1c087dc91a3f23e8048baf67d0754f',\n\t\ttype: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',\n\t},\n\tDEEP: {\n\t\taddress: '0x1d723c5cd113296868b55208f2ab5a905184950dd59c48eb7345607d6b5e6af7',\n\t\ttype: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP',\n\t},\n\tWAL: {\n\t\taddress: '0x38decd3dbb62bd4723144349bf57bc403b393aee86a51596846a824a1e0c2c01',\n\t\ttype: '0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL',\n\t},\n\tSUIUSDE: {\n\t\taddress: '0xbb990ca04a7743e6c0a25a7fb16f60fc6f6d8bf213624ff03a63f1bb04c3a12f',\n\t\ttype: '0x41d587e5336f1c86cad50d38a7136db99333bb9bda91cea4ba69115defeb1402::sui_usde::SUI_USDE',\n\t},\n\tXBTC: {\n\t\taddress: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',\n\t\ttype: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',\n\t},\n\tUSDSUI: {\n\t\taddress: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',\n\t\ttype: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',\n\t},\n};\n\nexport const testnetPythConfigs = {\n\tpythStateId: '0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c',\n\twormholeStateId: '0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790',\n};\n\nexport const mainnetPythConfigs = {\n\tpythStateId: '0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8',\n\twormholeStateId: '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',\n};\n"],"mappings":";AAiBA,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,oBAAoB;CAChC,qBAAqB;CACrB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,oBAAoB;CACpB,wBAAwB;CACxB;AAED,MAAa,eAAwB;CACpC,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ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;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,IAAI;EACH,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,OAAO;EACN,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN,QAAQ;EACR;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,eAAe;EACd,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,eAAwB;CACpC,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,QAAQ;EACP,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,SAAS;EACR,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,UAAU;EACT,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,WAAW;EACV,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,cAAc;EACb,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,YAAY;EACX,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD,aAAa;EACZ,SAAS;EACT,UAAU;EACV,WAAW;EACX;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,KAAK;EACJ,SAAS;EACT,MAAM;EACN;CACD,SAAS;EACR,SAAS;EACT,MAAM;EACN;CACD,MAAM;EACL,SAAS;EACT,MAAM;EACN;CACD,QAAQ;EACP,SAAS;EACT,MAAM;EACN;CACD;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB;AAED,MAAa,qBAAqB;CACjC,aAAa;CACb,iBAAiB;CACjB"}
|
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.2.
|
|
5
|
+
"version": "1.2.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "./dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@noble/hashes": "^2.0.1",
|
|
34
34
|
"axios": "^1.13.5",
|
|
35
35
|
"axios-retry": "^4.5.0",
|
|
36
|
-
"@mysten/bcs": "^2.0.
|
|
36
|
+
"@mysten/bcs": "^2.0.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@iarna/toml": "^2.2.5",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"vite": "^7.3.1",
|
|
47
47
|
"vitest": "^4.0.17",
|
|
48
48
|
"wait-on": "^9.0.3",
|
|
49
|
-
"@mysten/codegen": "^0.8.
|
|
50
|
-
"@mysten/sui": "^2.
|
|
49
|
+
"@mysten/codegen": "^0.8.3",
|
|
50
|
+
"@mysten/sui": "^2.8.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@mysten/sui": "^2.
|
|
53
|
+
"@mysten/sui": "^2.8.0"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"clean": "rm -rf tsconfig.tsbuildinfo ./dist",
|
package/src/utils/constants.ts
CHANGED
|
@@ -127,6 +127,14 @@ export const mainnetCoins: CoinMap = {
|
|
|
127
127
|
currencyId: '0x907bb173bffab7c57bbd3350a633aa32c8770937b496d7d88874087b59200bcc',
|
|
128
128
|
priceInfoObjectId: '0xa4b9db1866ee6e2a156e8c36fc66be0f68f232388ebb578c949c2c6beb50128b',
|
|
129
129
|
},
|
|
130
|
+
USDSUI: {
|
|
131
|
+
address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
|
|
132
|
+
type: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,
|
|
133
|
+
scalar: 1000000,
|
|
134
|
+
feed: '0xd510fcdb3a63f35d3bb118d5db3afc5815a3f13bc55d48abb893b63f0315902a',
|
|
135
|
+
currencyId: '0x535e826a2acddab687c81cb6c6166553b479f61a9023800ec0020baba8d94731',
|
|
136
|
+
priceInfoObjectId: '0x68644a3ab7a1aab113a4a68b6115a5b51eba4cb6aaac2d99b734be2e5e748425',
|
|
137
|
+
},
|
|
130
138
|
WUSDC: {
|
|
131
139
|
address: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf`,
|
|
132
140
|
type: `0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN`,
|
|
@@ -197,11 +205,6 @@ export const mainnetCoins: CoinMap = {
|
|
|
197
205
|
type: `0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT`,
|
|
198
206
|
scalar: 1000000,
|
|
199
207
|
},
|
|
200
|
-
USDSUI: {
|
|
201
|
-
address: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1`,
|
|
202
|
-
type: `0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI`,
|
|
203
|
-
scalar: 1000000,
|
|
204
|
-
},
|
|
205
208
|
};
|
|
206
209
|
|
|
207
210
|
export const testnetPools: PoolMap = {
|
|
@@ -409,6 +412,10 @@ export const mainnetMarginPools = {
|
|
|
409
412
|
address: '0x14dfbf54400e0b97e892349310d392bef6d187c2b6709d9b246b8f41c9a13de4',
|
|
410
413
|
type: '0x876a4b7bce8aeaef60464c11f4026903e9afacab79b9b142686158aa86560b50::xbtc::XBTC',
|
|
411
414
|
},
|
|
415
|
+
USDSUI: {
|
|
416
|
+
address: '0x78a0ddd02745d9b500fb7e9aae2ff8b665d974f00fd1f6060d59f4a8e891402c',
|
|
417
|
+
type: '0x44f838219cf67b058f3b37907b655f226153c18e33dfcd0da559a844fea9b1c1::usdsui::USDSUI',
|
|
418
|
+
},
|
|
412
419
|
};
|
|
413
420
|
|
|
414
421
|
export const testnetPythConfigs = {
|