@mysten/deepbook-v3 1.5.8 → 1.6.2
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 +73 -0
- package/dist/client.d.mts +5 -0
- package/dist/client.d.mts.map +1 -1
- package/dist/client.mjs +7 -0
- package/dist/client.mjs.map +1 -1
- package/dist/contracts/deepbook/account.d.mts +18 -18
- package/dist/contracts/deepbook/account.d.mts.map +1 -1
- package/dist/contracts/deepbook/balance_manager.mjs +413 -0
- package/dist/contracts/deepbook/balance_manager.mjs.map +1 -0
- package/dist/contracts/deepbook/big_vector.mjs +43 -0
- package/dist/contracts/deepbook/big_vector.mjs.map +1 -0
- package/dist/contracts/deepbook/book.mjs +29 -0
- package/dist/contracts/deepbook/book.mjs.map +1 -0
- package/dist/contracts/deepbook/deep_price.d.mts +3 -3
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -1
- package/dist/contracts/deepbook/deep_price.mjs +1 -1
- package/dist/contracts/deepbook/deps/std/type_name.mjs +17 -0
- package/dist/contracts/deepbook/deps/std/type_name.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/sui/bag.mjs +43 -0
- package/dist/contracts/deepbook/deps/sui/bag.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/sui/balance.mjs +21 -0
- package/dist/contracts/deepbook/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/sui/table.mjs +38 -0
- package/dist/contracts/deepbook/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/sui/versioned.mjs +19 -0
- package/dist/contracts/deepbook/deps/sui/versioned.mjs.map +1 -0
- package/dist/contracts/deepbook/governance.mjs +49 -0
- package/dist/contracts/deepbook/governance.mjs.map +1 -0
- package/dist/contracts/deepbook/history.mjs +56 -0
- package/dist/contracts/deepbook/history.mjs.map +1 -0
- package/dist/contracts/deepbook/order.d.mts +12 -12
- package/dist/contracts/deepbook/pool.mjs +1739 -0
- package/dist/contracts/deepbook/pool.mjs.map +1 -0
- package/dist/contracts/deepbook/registry.mjs +295 -0
- package/dist/contracts/deepbook/registry.mjs.map +1 -0
- package/dist/contracts/deepbook/state.mjs +89 -0
- package/dist/contracts/deepbook/state.mjs.map +1 -0
- package/dist/contracts/deepbook/trade_params.mjs +21 -0
- package/dist/contracts/deepbook/trade_params.mjs.map +1 -0
- package/dist/contracts/deepbook/vault.mjs +42 -0
- package/dist/contracts/deepbook/vault.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/deepbook/balance_manager.mjs +53 -0
- package/dist/contracts/deepbook_margin/deps/deepbook/balance_manager.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/std/type_name.mjs +17 -0
- package/dist/contracts/deepbook_margin/deps/std/type_name.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/bag.mjs +43 -0
- package/dist/contracts/deepbook_margin/deps/sui/bag.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/balance.mjs +21 -0
- package/dist/contracts/deepbook_margin/deps/sui/balance.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/table.mjs +38 -0
- package/dist/contracts/deepbook_margin/deps/sui/table.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/vec_map.mjs +37 -0
- package/dist/contracts/deepbook_margin/deps/sui/vec_map.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/vec_set.mjs +26 -0
- package/dist/contracts/deepbook_margin/deps/sui/vec_set.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/deps/sui/versioned.mjs +19 -0
- package/dist/contracts/deepbook_margin/deps/sui/versioned.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/margin_manager.mjs +989 -0
- package/dist/contracts/deepbook_margin/margin_manager.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/margin_pool.mjs +550 -0
- package/dist/contracts/deepbook_margin/margin_pool.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/margin_registry.mjs +786 -0
- package/dist/contracts/deepbook_margin/margin_registry.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/margin_state.mjs +30 -0
- package/dist/contracts/deepbook_margin/margin_state.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/oracle.mjs +82 -0
- package/dist/contracts/deepbook_margin/oracle.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/pool_proxy.mjs +644 -0
- package/dist/contracts/deepbook_margin/pool_proxy.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/position_manager.mjs +32 -0
- package/dist/contracts/deepbook_margin/position_manager.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/protocol_config.mjs +122 -0
- package/dist/contracts/deepbook_margin/protocol_config.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/protocol_fees.mjs +58 -0
- package/dist/contracts/deepbook_margin/protocol_fees.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/rate_limiter.mjs +26 -0
- package/dist/contracts/deepbook_margin/rate_limiter.mjs.map +1 -0
- package/dist/contracts/deepbook_margin/tpsl.mjs +171 -0
- package/dist/contracts/deepbook_margin/tpsl.mjs.map +1 -0
- package/dist/contracts/margin_liquidation/deps/sui/bag.mjs +43 -0
- package/dist/contracts/margin_liquidation/deps/sui/bag.mjs.map +1 -0
- package/dist/contracts/margin_liquidation/liquidation_vault.mjs +179 -0
- package/dist/contracts/margin_liquidation/liquidation_vault.mjs.map +1 -0
- package/dist/contracts/utils/index.d.mts +1 -1
- package/dist/contracts/utils/index.mjs +92 -3
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/dist/queries/registryQueries.mjs +13 -0
- package/dist/queries/registryQueries.mjs.map +1 -1
- package/dist/transactions/balanceManager.d.mts.map +1 -1
- package/dist/transactions/balanceManager.mjs +119 -100
- package/dist/transactions/balanceManager.mjs.map +1 -1
- package/dist/transactions/deepbook.d.mts.map +1 -1
- package/dist/transactions/deepbook.mjs +464 -439
- package/dist/transactions/deepbook.mjs.map +1 -1
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -1
- package/dist/transactions/deepbookAdmin.mjs +151 -135
- package/dist/transactions/deepbookAdmin.mjs.map +1 -1
- package/dist/transactions/flashLoans.d.mts.map +1 -1
- package/dist/transactions/flashLoans.mjs +29 -22
- package/dist/transactions/flashLoans.mjs.map +1 -1
- package/dist/transactions/governance.d.mts.map +1 -1
- package/dist/transactions/governance.mjs +34 -33
- package/dist/transactions/governance.mjs.map +1 -1
- package/dist/transactions/marginAdmin.d.mts +17 -7
- package/dist/transactions/marginAdmin.d.mts.map +1 -1
- package/dist/transactions/marginAdmin.mjs +186 -169
- package/dist/transactions/marginAdmin.mjs.map +1 -1
- package/dist/transactions/marginLiquidations.d.mts +3 -3
- package/dist/transactions/marginLiquidations.d.mts.map +1 -1
- package/dist/transactions/marginLiquidations.mjs +53 -54
- package/dist/transactions/marginLiquidations.mjs.map +1 -1
- package/dist/transactions/marginMaintainer.d.mts +5 -5
- package/dist/transactions/marginMaintainer.d.mts.map +1 -1
- package/dist/transactions/marginMaintainer.mjs +83 -83
- package/dist/transactions/marginMaintainer.mjs.map +1 -1
- package/dist/transactions/marginManager.d.mts +32 -32
- package/dist/transactions/marginManager.d.mts.map +1 -1
- package/dist/transactions/marginManager.mjs +330 -317
- package/dist/transactions/marginManager.mjs.map +1 -1
- package/dist/transactions/marginPool.d.mts +18 -18
- package/dist/transactions/marginPool.d.mts.map +1 -1
- package/dist/transactions/marginPool.mjs +93 -89
- package/dist/transactions/marginPool.mjs.map +1 -1
- package/dist/transactions/marginRegistry.d.mts +22 -15
- package/dist/transactions/marginRegistry.d.mts.map +1 -1
- package/dist/transactions/marginRegistry.mjs +101 -68
- package/dist/transactions/marginRegistry.mjs.map +1 -1
- package/dist/transactions/marginTPSL.d.mts +27 -9
- package/dist/transactions/marginTPSL.d.mts.map +1 -1
- package/dist/transactions/marginTPSL.mjs +108 -82
- package/dist/transactions/marginTPSL.mjs.map +1 -1
- package/dist/transactions/poolProxy.d.mts +37 -5
- package/dist/transactions/poolProxy.d.mts.map +1 -1
- package/dist/transactions/poolProxy.mjs +269 -189
- package/dist/transactions/poolProxy.mjs.map +1 -1
- package/dist/utils/constants.mjs +4 -4
- package/dist/utils/constants.mjs.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +8 -0
- package/src/contracts/deepbook/balance_manager.ts +46 -5
- package/src/contracts/deepbook/constants.ts +13 -0
- package/src/contracts/deepbook/pool.ts +133 -0
- package/src/contracts/deepbook/registry.ts +136 -1
- package/src/contracts/deepbook_margin/deps/deepbook/balance_manager.ts +49 -0
- package/src/contracts/deepbook_margin/deps/std/type_name.ts +24 -0
- package/src/contracts/deepbook_margin/deps/sui/bag.ts +41 -0
- package/src/contracts/deepbook_margin/deps/sui/balance.ts +19 -0
- package/src/contracts/deepbook_margin/deps/sui/table.ts +36 -0
- package/src/contracts/deepbook_margin/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook_margin/deps/sui/vec_set.ts +22 -0
- package/src/contracts/deepbook_margin/deps/sui/versioned.ts +13 -0
- package/src/contracts/deepbook_margin/margin_constants.ts +329 -0
- package/src/contracts/deepbook_margin/margin_manager.ts +1772 -0
- package/src/contracts/deepbook_margin/margin_pool.ts +1129 -0
- package/src/contracts/deepbook_margin/margin_registry.ts +1207 -0
- package/src/contracts/deepbook_margin/margin_state.ts +26 -0
- package/src/contracts/deepbook_margin/oracle.ts +99 -0
- package/src/contracts/deepbook_margin/pool_proxy.ts +1298 -0
- package/src/contracts/deepbook_margin/position_manager.ts +28 -0
- package/src/contracts/deepbook_margin/protocol_config.ts +163 -0
- package/src/contracts/deepbook_margin/protocol_fees.ts +153 -0
- package/src/contracts/deepbook_margin/rate_limiter.ts +80 -0
- package/src/contracts/deepbook_margin/tpsl.ts +559 -0
- package/src/contracts/margin_liquidation/deps/sui/bag.ts +41 -0
- package/src/contracts/margin_liquidation/liquidation_vault.ts +401 -0
- package/src/queries/registryQueries.ts +15 -0
- package/src/transactions/balanceManager.ts +140 -90
- package/src/transactions/deepbook.ts +586 -494
- package/src/transactions/deepbookAdmin.ts +154 -146
- package/src/transactions/flashLoans.ts +29 -20
- package/src/transactions/governance.ts +50 -37
- package/src/transactions/marginAdmin.ts +247 -188
- package/src/transactions/marginLiquidations.ts +70 -55
- package/src/transactions/marginMaintainer.ts +106 -88
- package/src/transactions/marginManager.ts +414 -348
- package/src/transactions/marginPool.ts +140 -103
- package/src/transactions/marginRegistry.ts +103 -70
- package/src/transactions/marginTPSL.ts +151 -87
- package/src/transactions/poolProxy.ts +384 -205
- package/src/utils/constants.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,78 @@
|
|
|
1
1
|
# @mysten/deepbook-v3
|
|
2
2
|
|
|
3
|
+
## 1.6.2
|
|
4
|
+
|
|
5
|
+
## 1.6.1
|
|
6
|
+
|
|
7
|
+
### Patch Changes
|
|
8
|
+
|
|
9
|
+
- e39857a: Internal refactor: the core transaction builders (`deepbook`, `balanceManager`,
|
|
10
|
+
`deepbookAdmin`, `flashLoans`, `governance`) now delegate to generated `@deepbook/core` codegen
|
|
11
|
+
bindings with named arguments instead of positional `moveCall` argument arrays, removing the risk
|
|
12
|
+
of transposing same-typed arguments. This completes the codegen migration begun for the margin
|
|
13
|
+
surface; unit conversion, coin plumbing, and trade-proof composition stay in the facade, so it is
|
|
14
|
+
a pure construction-layer change.
|
|
15
|
+
|
|
16
|
+
No API or behavior change: every migrated builder emits a byte-identical transaction, verified by
|
|
17
|
+
a new PTB snapshot test (`test/unit/transactions/core-ptb-snapshot.test.ts`). Two builders whose
|
|
18
|
+
calls don't map to a generated binding (`createAndShareBalanceManager` — `balance_manager::new` is
|
|
19
|
+
called zero-arg but the current-source binding adds an `Owner`; and `shareBalanceManager` — a
|
|
20
|
+
`0x2::transfer` framework call) are intentionally left as positional `moveCall`s.
|
|
21
|
+
|
|
22
|
+
## 1.6.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- 9e40665: Sync with deepbook_margin v6.
|
|
27
|
+
|
|
28
|
+
New margin entry points (live on mainnet at `0x8af25e44`):
|
|
29
|
+
|
|
30
|
+
- `poolProxy.placeMarketOrderAndRepayLoan`, `poolProxy.placeReduceOnlyLimitOrderAndRepayLoan`,
|
|
31
|
+
`poolProxy.placeReduceOnlyMarketOrderAndRepayLoan` — repay the loan from the fill proceeds
|
|
32
|
+
before the risk check, so the gate is the net post-repay `risk_ratio` rather than the borrow
|
|
33
|
+
floor.
|
|
34
|
+
- `marginTPSL.executeConditionalOrdersV3` — deleveraging conditional execution, letting a
|
|
35
|
+
stop-loss fire in the `liquidation..min_borrow` band. `executeConditionalOrders` (v2) is
|
|
36
|
+
unchanged.
|
|
37
|
+
- `marginAdmin.setMinOpenRiskRatio` and `getMinOpenRiskRatio` — the position-opening risk floor,
|
|
38
|
+
distinct from the borrow floor.
|
|
39
|
+
|
|
40
|
+
These builders are constructed via generated codegen bindings with **named** arguments rather than
|
|
41
|
+
positional `moveCall` arrays — `deepbook_margin` was added to `sui-codegen.config.ts`, so
|
|
42
|
+
`src/contracts/deepbook_margin` is now generated. The human-unit conversion (`convertQuantity`,
|
|
43
|
+
`convertPrice`, `convertRate`) stays in the facade; codegen handles call construction, removing
|
|
44
|
+
the risk of transposing same-typed arguments (e.g. base/quote oracles and margin pools).
|
|
45
|
+
|
|
46
|
+
Package IDs updated to match `Published.toml`: mainnet margin v5 → v6, testnet core v17 → v20,
|
|
47
|
+
testnet margin → v14. Testnet `MARGIN_V1` (used to build `MarginApp` type tags) pointed at an
|
|
48
|
+
abandoned package lineage and is corrected to the real original ID `0xb8620c24…`.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 6af1e2e: Internal refactor: the margin transaction builders now delegate to generated codegen
|
|
53
|
+
bindings with named arguments instead of positional `moveCall` argument arrays, removing the risk
|
|
54
|
+
of transposing same-typed arguments (base/quote oracles, base/quote margin pools).
|
|
55
|
+
`deepbook_margin` and `margin_liquidation` were added to `sui-codegen.config.ts`; human-unit
|
|
56
|
+
conversion and coin plumbing stay in the facade, so this is a pure construction-layer change.
|
|
57
|
+
|
|
58
|
+
No API or behavior change: every migrated builder emits a byte-identical transaction, verified by
|
|
59
|
+
a new PTB snapshot test (`test/unit/transactions/margin-ptb-snapshot.test.ts`). Two builders whose
|
|
60
|
+
command/input interleaving does not reduce cleanly (`marginPool.supplyToMarginPool`,
|
|
61
|
+
`marginAdmin.revokeMaintainerCap`) are intentionally left as positional `moveCall`s.
|
|
62
|
+
|
|
63
|
+
## 1.5.9
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- c4cc6ed: Fix `MarginManagerContract.repayBase` and `repayQuote` mishandling `amount = 0`. The
|
|
68
|
+
previous truthy guard (`amount ? … : null`) collapsed `0` onto the `Option::None` branch, causing
|
|
69
|
+
`repay_base(mgr, 0)` / `repay_quote(mgr, 0)` to repay the full outstanding debt using whatever
|
|
70
|
+
balance of the asset was held in the balance manager — rather than being a no-op as the numeric
|
|
71
|
+
argument suggests. The check now uses `amount !== undefined`, so `0` correctly serializes as
|
|
72
|
+
`Option::Some(0)` and only an omitted argument becomes `None`. Also switches the `Option<u64>`
|
|
73
|
+
argument from `tx.object.option` to `tx.pure.option` to avoid an extra `0x1::option::some/none`
|
|
74
|
+
PTB command, matching `marginLiquidations.ts` and `marginPool.ts`.
|
|
75
|
+
|
|
3
76
|
## 1.5.8
|
|
4
77
|
|
|
5
78
|
## 1.5.7
|
package/dist/client.d.mts
CHANGED
|
@@ -225,6 +225,11 @@ declare class DeepBookClient {
|
|
|
225
225
|
getQuoteMarginPoolId(poolKey: string): Promise<string>;
|
|
226
226
|
getMinWithdrawRiskRatio(poolKey: string): Promise<number>;
|
|
227
227
|
getMinBorrowRiskRatio(poolKey: string): Promise<number>;
|
|
228
|
+
/**
|
|
229
|
+
* Minimum risk ratio required to open a new position on the pool. Gates
|
|
230
|
+
* position opening, unlike `getMinBorrowRiskRatio`, which gates borrowing.
|
|
231
|
+
*/
|
|
232
|
+
getMinOpenRiskRatio(poolKey: string): Promise<number>;
|
|
228
233
|
getLiquidationRiskRatio(poolKey: string): Promise<number>;
|
|
229
234
|
getTargetLiquidationRiskRatio(poolKey: string): Promise<number>;
|
|
230
235
|
getUserLiquidationReward(poolKey: string): Promise<number>;
|
package/dist/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;UA+DiB,wBAAA,SAAiC,iBAAA;AAAA,UAEjC,eAAA;EAChB,OAAA;EACA,eAAA;IAAA,CAAqB,GAAA,WAAc,cAAA;EAAA;EACnC,cAAA;IAAA,CAAoB,GAAA,WAAc,aAAA;EAAA;EAClC,KAAA,GAAQ,OAAA;EACR,KAAA,GAAQ,OAAA;EACR,QAAA;EACA,cAAA;EACA,mBAAA;EACA,UAAA,GAAa,kBAAA;EACb,IAAA;IAAS,WAAA;IAAqB,eAAA;EAAA;EAC9B,IAAA,GAAO,IAAA;AAAA;AAAA,UAGS,qBAAA,SAA8B,eAAA;EAC9C,MAAA,EAAQ,wBAAA;EACR,OAAA,EAAS,cAAA,CAAe,OAAA;AAAA;AAAA,iBAGT,QAAA,kCAAA,CAAA;EACf,IAAA;EAAA,GACG;AAAA,GACD,eAAA,CAAgB,IAAA,IAAQ,qBAAA,CAAsB,wBAAA,EAA0B,IAAA,EAAM,cAAA;;;;cAgBpE,cAAA;EAAA;EAaZ,cAAA,EAAgB,sBAAA;EAChB,QAAA,EAAU,gBAAA;EACV,aAAA,EAAe,qBAAA;EACf,UAAA,EAAY,iBAAA;EACZ,UAAA,EAAY,kBAAA;EACZ,WAAA,EAAa,mBAAA;EACb,gBAAA,EAAkB,wBAAA;EAClB,UAAA,EAAY,kBAAA;EACZ,aAAA,EAAe,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B,OAAA;EAIzB,mBAAA,CAAA,GAAuB,OAAA;EAMvB,aAAA,CAAc,cAAA,WAAyB,cAAA;AAAA"}
|
package/dist/client.mjs
CHANGED
|
@@ -365,6 +365,13 @@ var DeepBookClient = class {
|
|
|
365
365
|
getMinBorrowRiskRatio(poolKey) {
|
|
366
366
|
return this.#registryQueries.getMinBorrowRiskRatio(poolKey);
|
|
367
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Minimum risk ratio required to open a new position on the pool. Gates
|
|
370
|
+
* position opening, unlike `getMinBorrowRiskRatio`, which gates borrowing.
|
|
371
|
+
*/
|
|
372
|
+
getMinOpenRiskRatio(poolKey) {
|
|
373
|
+
return this.#registryQueries.getMinOpenRiskRatio(poolKey);
|
|
374
|
+
}
|
|
368
375
|
getLiquidationRiskRatio(poolKey) {
|
|
369
376
|
return this.#registryQueries.getLiquidationRiskRatio(poolKey);
|
|
370
377
|
}
|
package/dist/client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":["#balanceManagerQueries","#poolQueries","#quantityQueries","#orderQueries","#accountQueries","#referralQueries","#priceFeedQueries","#marginPoolQueries","#marginManagerQueries","#tpslQueries","#registryQueries"],"sources":["../src/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ClientWithCoreApi, SuiClientRegistration, SuiClientTypes } from '@mysten/sui/client';\nimport type { Transaction } from '@mysten/sui/transactions';\n\nimport type { QueryContext } from './queries/context.js';\nimport { AccountQueries } from './queries/accountQueries.js';\nimport { BalanceManagerQueries } from './queries/balanceManagerQueries.js';\nimport { MarginManagerQueries } from './queries/marginManagerQueries.js';\nimport { MarginPoolQueries } from './queries/marginPoolQueries.js';\nimport { OrderQueries } from './queries/orderQueries.js';\nimport { PoolQueries } from './queries/poolQueries.js';\nimport { PriceFeedQueries } from './queries/priceFeedQueries.js';\nimport { QuantityQueries } from './queries/quantityQueries.js';\nimport { ReferralQueries } from './queries/referralQueries.js';\nimport { RegistryQueries } from './queries/registryQueries.js';\nimport { TPSLQueries } from './queries/tpslQueries.js';\nimport { BalanceManagerContract } from './transactions/balanceManager.js';\nimport { DeepBookContract } from './transactions/deepbook.js';\nimport { DeepBookAdminContract } from './transactions/deepbookAdmin.js';\nimport { FlashLoanContract } from './transactions/flashLoans.js';\nimport { GovernanceContract } from './transactions/governance.js';\nimport { MarginAdminContract } from './transactions/marginAdmin.js';\nimport { MarginLiquidationsContract } from './transactions/marginLiquidations.js';\nimport { MarginMaintainerContract } from './transactions/marginMaintainer.js';\nimport { MarginManagerContract } from './transactions/marginManager.js';\nimport { MarginPoolContract } from './transactions/marginPool.js';\nimport { MarginRegistryContract } from './transactions/marginRegistry.js';\nimport { MarginTPSLContract } from './transactions/marginTPSL.js';\nimport { PoolProxyContract } from './transactions/poolProxy.js';\nimport type {\n\tAccountInfo,\n\tBalanceManager,\n\tBaseQuantityIn,\n\tBaseQuantityOut,\n\tBorrowedShares,\n\tCanPlaceLimitOrderParams,\n\tCanPlaceMarketOrderParams,\n\tDecodedOrderId,\n\tLevel2Range,\n\tLevel2TicksFromMid,\n\tLockedBalances,\n\tManagerBalance,\n\tMarginManager,\n\tMarginManagerAssets,\n\tMarginManagerBalancesResult,\n\tMarginManagerDebts,\n\tMarginManagerState,\n\tOrderDeepRequiredResult,\n\tPoolBookParams,\n\tPoolDeepPrice,\n\tPoolTradeParams,\n\tQuantityOut,\n\tQuoteQuantityIn,\n\tQuoteQuantityOut,\n\tReferralBalances,\n\tVaultBalances,\n} from './types/index.js';\nimport { DeepBookConfig } from './utils/config.js';\nimport type { CoinMap, DeepbookPackageIds, PoolMap } from './utils/constants.js';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nexport interface DeepBookCompatibleClient extends ClientWithCoreApi {}\n\nexport interface DeepBookOptions<Name = 'deepbook'> {\n\taddress: string;\n\tbalanceManagers?: { [key: string]: BalanceManager };\n\tmarginManagers?: { [key: string]: MarginManager };\n\tcoins?: CoinMap;\n\tpools?: PoolMap;\n\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\tpackageIds?: DeepbookPackageIds;\n\tpyth?: { pythStateId: string; wormholeStateId: string };\n\tname?: Name;\n}\n\nexport interface DeepBookClientOptions extends DeepBookOptions {\n\tclient: DeepBookCompatibleClient;\n\tnetwork: SuiClientTypes.Network;\n}\n\nexport function deepbook<Name extends string = 'deepbook'>({\n\tname = 'deepbook' as Name,\n\t...options\n}: DeepBookOptions<Name>): SuiClientRegistration<DeepBookCompatibleClient, Name, DeepBookClient> {\n\treturn {\n\t\tname,\n\t\tregister: (client) => {\n\t\t\treturn new DeepBookClient({\n\t\t\t\tclient,\n\t\t\t\tnetwork: client.network,\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n\n/**\n * DeepBookClient class for managing DeepBook operations.\n */\nexport class DeepBookClient {\n\t#balanceManagerQueries: BalanceManagerQueries;\n\t#poolQueries: PoolQueries;\n\t#quantityQueries: QuantityQueries;\n\t#orderQueries: OrderQueries;\n\t#accountQueries: AccountQueries;\n\t#referralQueries: ReferralQueries;\n\t#priceFeedQueries: PriceFeedQueries;\n\t#marginPoolQueries: MarginPoolQueries;\n\t#marginManagerQueries: MarginManagerQueries;\n\t#tpslQueries: TPSLQueries;\n\t#registryQueries: RegistryQueries;\n\n\tbalanceManager: BalanceManagerContract;\n\tdeepBook: DeepBookContract;\n\tdeepBookAdmin: DeepBookAdminContract;\n\tflashLoans: FlashLoanContract;\n\tgovernance: GovernanceContract;\n\tmarginAdmin: MarginAdminContract;\n\tmarginMaintainer: MarginMaintainerContract;\n\tmarginPool: MarginPoolContract;\n\tmarginManager: MarginManagerContract;\n\tmarginRegistry: MarginRegistryContract;\n\tmarginLiquidations: MarginLiquidationsContract;\n\tpoolProxy: PoolProxyContract;\n\tmarginTPSL: MarginTPSLContract;\n\n\t/**\n\t * Creates a new DeepBookClient instance\n\t */\n\tconstructor({\n\t\tclient,\n\t\taddress,\n\t\tnetwork,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t\tpackageIds,\n\t\tpyth,\n\t}: DeepBookClientOptions) {\n\t\tconst normalizedAddress = normalizeSuiAddress(address);\n\t\tconst config = new DeepBookConfig({\n\t\t\taddress: normalizedAddress,\n\t\t\tnetwork,\n\t\t\tbalanceManagers,\n\t\t\tmarginManagers,\n\t\t\tcoins,\n\t\t\tpools,\n\t\t\tadminCap,\n\t\t\tmarginAdminCap,\n\t\t\tmarginMaintainerCap,\n\t\t\tpackageIds,\n\t\t\tpyth,\n\t\t});\n\n\t\tthis.balanceManager = new BalanceManagerContract(config);\n\t\tthis.deepBook = new DeepBookContract(config);\n\t\tthis.deepBookAdmin = new DeepBookAdminContract(config);\n\t\tthis.flashLoans = new FlashLoanContract(config);\n\t\tthis.governance = new GovernanceContract(config);\n\t\tthis.marginAdmin = new MarginAdminContract(config);\n\t\tthis.marginMaintainer = new MarginMaintainerContract(config);\n\t\tthis.marginPool = new MarginPoolContract(config);\n\t\tthis.marginManager = new MarginManagerContract(config);\n\t\tthis.marginRegistry = new MarginRegistryContract(config);\n\t\tthis.marginLiquidations = new MarginLiquidationsContract(config);\n\t\tthis.poolProxy = new PoolProxyContract(config);\n\t\tthis.marginTPSL = new MarginTPSLContract(config);\n\n\t\tconst ctx: QueryContext = {\n\t\t\tclient,\n\t\t\tconfig,\n\t\t\taddress: normalizedAddress,\n\t\t\tbalanceManager: this.balanceManager,\n\t\t\tdeepBook: this.deepBook,\n\t\t\tmarginManager: this.marginManager,\n\t\t\tmarginPool: this.marginPool,\n\t\t\tmarginRegistry: this.marginRegistry,\n\t\t\tmarginTPSL: this.marginTPSL,\n\t\t};\n\n\t\tthis.#balanceManagerQueries = new BalanceManagerQueries(ctx);\n\t\tthis.#poolQueries = new PoolQueries(ctx);\n\t\tthis.#quantityQueries = new QuantityQueries(ctx);\n\t\tthis.#orderQueries = new OrderQueries(ctx);\n\t\tthis.#accountQueries = new AccountQueries(ctx);\n\t\tthis.#referralQueries = new ReferralQueries(ctx);\n\t\tthis.#priceFeedQueries = new PriceFeedQueries(ctx);\n\t\tthis.#marginPoolQueries = new MarginPoolQueries(ctx);\n\t\tthis.#marginManagerQueries = new MarginManagerQueries(ctx);\n\t\tthis.#tpslQueries = new TPSLQueries(ctx);\n\t\tthis.#registryQueries = new RegistryQueries(ctx);\n\t}\n\n\t// === Balance Manager Queries ===\n\n\tcheckManagerBalance(managerKey: string, coinKey: string): Promise<ManagerBalance> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalance(managerKey, coinKey);\n\t}\n\n\tcheckManagerBalanceWithAddress(managerAddress: string, coinKey: string): Promise<ManagerBalance> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalanceWithAddress(managerAddress, coinKey);\n\t}\n\n\tcheckManagerBalancesWithAddress(\n\t\tmanagerAddresses: string[],\n\t\tcoinKeys: string[],\n\t): Promise<Record<string, Record<string, number>>> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalancesWithAddress(managerAddresses, coinKeys);\n\t}\n\n\tgetBalanceManagerIds(owner: string): Promise<string[]> {\n\t\treturn this.#balanceManagerQueries.getBalanceManagerIds(owner);\n\t}\n\n\taccountExists(poolKey: string, managerKey: string): Promise<boolean> {\n\t\treturn this.#balanceManagerQueries.accountExists(poolKey, managerKey);\n\t}\n\n\t// === Pool Queries ===\n\n\twhitelisted(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.whitelisted(poolKey);\n\t}\n\n\tvaultBalances(poolKey: string): Promise<VaultBalances> {\n\t\treturn this.#poolQueries.vaultBalances(poolKey);\n\t}\n\n\tgetPoolIdByAssets(baseType: string, quoteType: string): Promise<string> {\n\t\treturn this.#poolQueries.getPoolIdByAssets(baseType, quoteType);\n\t}\n\n\tmidPrice(poolKey: string): Promise<number> {\n\t\treturn this.#poolQueries.midPrice(poolKey);\n\t}\n\n\tpoolTradeParams(poolKey: string): Promise<PoolTradeParams> {\n\t\treturn this.#poolQueries.poolTradeParams(poolKey);\n\t}\n\n\tpoolBookParams(poolKey: string): Promise<PoolBookParams> {\n\t\treturn this.#poolQueries.poolBookParams(poolKey);\n\t}\n\n\tstablePool(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.stablePool(poolKey);\n\t}\n\n\tregisteredPool(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.registeredPool(poolKey);\n\t}\n\n\tpoolTradeParamsNext(poolKey: string): Promise<PoolTradeParams> {\n\t\treturn this.#poolQueries.poolTradeParamsNext(poolKey);\n\t}\n\n\tquorum(poolKey: string): Promise<number> {\n\t\treturn this.#poolQueries.quorum(poolKey);\n\t}\n\n\tpoolId(poolKey: string): Promise<string> {\n\t\treturn this.#poolQueries.poolId(poolKey);\n\t}\n\n\tcanPlaceLimitOrder(params: CanPlaceLimitOrderParams): Promise<boolean> {\n\t\treturn this.#poolQueries.canPlaceLimitOrder(params);\n\t}\n\n\tcanPlaceMarketOrder(params: CanPlaceMarketOrderParams): Promise<boolean> {\n\t\treturn this.#poolQueries.canPlaceMarketOrder(params);\n\t}\n\n\tcheckMarketOrderParams(poolKey: string, quantity: number | bigint): Promise<boolean> {\n\t\treturn this.#poolQueries.checkMarketOrderParams(poolKey, quantity);\n\t}\n\n\tcheckLimitOrderParams(\n\t\tpoolKey: string,\n\t\tprice: number | bigint,\n\t\tquantity: number | bigint,\n\t\texpireTimestamp: number,\n\t): Promise<boolean> {\n\t\treturn this.#poolQueries.checkLimitOrderParams(poolKey, price, quantity, expireTimestamp);\n\t}\n\n\t// === Quantity Queries ===\n\n\tgetQuoteQuantityOut(poolKey: string, baseQuantity: number | bigint): Promise<QuoteQuantityOut> {\n\t\treturn this.#quantityQueries.getQuoteQuantityOut(poolKey, baseQuantity);\n\t}\n\n\tgetBaseQuantityOut(poolKey: string, quoteQuantity: number | bigint): Promise<BaseQuantityOut> {\n\t\treturn this.#quantityQueries.getBaseQuantityOut(poolKey, quoteQuantity);\n\t}\n\n\tgetQuantityOut(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<QuantityOut> {\n\t\treturn this.#quantityQueries.getQuantityOut(poolKey, baseQuantity, quoteQuantity);\n\t}\n\n\tgetQuoteQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t): Promise<QuoteQuantityOut> {\n\t\treturn this.#quantityQueries.getQuoteQuantityOutInputFee(poolKey, baseQuantity);\n\t}\n\n\tgetBaseQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<BaseQuantityOut> {\n\t\treturn this.#quantityQueries.getBaseQuantityOutInputFee(poolKey, quoteQuantity);\n\t}\n\n\tgetQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<QuantityOut> {\n\t\treturn this.#quantityQueries.getQuantityOutInputFee(poolKey, baseQuantity, quoteQuantity);\n\t}\n\n\tgetBaseQuantityIn(\n\t\tpoolKey: string,\n\t\ttargetQuoteQuantity: number | bigint,\n\t\tpayWithDeep: boolean,\n\t): Promise<BaseQuantityIn> {\n\t\treturn this.#quantityQueries.getBaseQuantityIn(poolKey, targetQuoteQuantity, payWithDeep);\n\t}\n\n\tgetQuoteQuantityIn(\n\t\tpoolKey: string,\n\t\ttargetBaseQuantity: number | bigint,\n\t\tpayWithDeep: boolean,\n\t): Promise<QuoteQuantityIn> {\n\t\treturn this.#quantityQueries.getQuoteQuantityIn(poolKey, targetBaseQuantity, payWithDeep);\n\t}\n\n\tgetOrderDeepRequired(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tprice: number | bigint,\n\t): Promise<OrderDeepRequiredResult> {\n\t\treturn this.#quantityQueries.getOrderDeepRequired(poolKey, baseQuantity, price);\n\t}\n\n\t// === Order Queries ===\n\n\taccountOpenOrders(poolKey: string, managerKey: string): Promise<string[]> {\n\t\treturn this.#orderQueries.accountOpenOrders(poolKey, managerKey);\n\t}\n\n\tgetOrder(poolKey: string, orderId: string) {\n\t\treturn this.#orderQueries.getOrder(poolKey, orderId);\n\t}\n\n\tgetOrderNormalized(poolKey: string, orderId: string) {\n\t\treturn this.#orderQueries.getOrderNormalized(poolKey, orderId);\n\t}\n\n\tgetOrders(poolKey: string, orderIds: string[]) {\n\t\treturn this.#orderQueries.getOrders(poolKey, orderIds);\n\t}\n\n\tgetLevel2Range(\n\t\tpoolKey: string,\n\t\tpriceLow: number | bigint,\n\t\tpriceHigh: number | bigint,\n\t\tisBid: boolean,\n\t): Promise<Level2Range> {\n\t\treturn this.#orderQueries.getLevel2Range(poolKey, priceLow, priceHigh, isBid);\n\t}\n\n\tgetLevel2TicksFromMid(poolKey: string, ticks: number): Promise<Level2TicksFromMid> {\n\t\treturn this.#orderQueries.getLevel2TicksFromMid(poolKey, ticks);\n\t}\n\n\tgetAccountOrderDetails(poolKey: string, managerKey: string) {\n\t\treturn this.#orderQueries.getAccountOrderDetails(poolKey, managerKey);\n\t}\n\n\t// === Account Queries ===\n\n\taccount(poolKey: string, managerKey: string): Promise<AccountInfo> {\n\t\treturn this.#accountQueries.account(poolKey, managerKey);\n\t}\n\n\tlockedBalance(poolKey: string, balanceManagerKey: string): Promise<LockedBalances> {\n\t\treturn this.#accountQueries.lockedBalance(poolKey, balanceManagerKey);\n\t}\n\n\tgetPoolDeepPrice(poolKey: string): Promise<PoolDeepPrice> {\n\t\treturn this.#accountQueries.getPoolDeepPrice(poolKey);\n\t}\n\n\t// === Referral Queries ===\n\n\tbalanceManagerReferralOwner(referral: string): Promise<string> {\n\t\treturn this.#referralQueries.balanceManagerReferralOwner(referral);\n\t}\n\n\tgetPoolReferralBalances(poolKey: string, referral: string): Promise<ReferralBalances> {\n\t\treturn this.#referralQueries.getPoolReferralBalances(poolKey, referral);\n\t}\n\n\tbalanceManagerReferralPoolId(referral: string): Promise<string> {\n\t\treturn this.#referralQueries.balanceManagerReferralPoolId(referral);\n\t}\n\n\tpoolReferralMultiplier(poolKey: string, referral: string): Promise<number> {\n\t\treturn this.#referralQueries.poolReferralMultiplier(poolKey, referral);\n\t}\n\n\tgetBalanceManagerReferralId(managerKey: string, poolKey: string): Promise<string | null> {\n\t\treturn this.#referralQueries.getBalanceManagerReferralId(managerKey, poolKey);\n\t}\n\n\t// === Price Feed Queries ===\n\n\tgetPriceInfoObject(tx: Transaction, coinKey: string): Promise<string> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObject(tx, coinKey);\n\t}\n\n\tgetPriceInfoObjects(tx: Transaction, coinKeys: string[]): Promise<Record<string, string>> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObjects(tx, coinKeys);\n\t}\n\n\tgetPriceInfoObjectAge(coinKey: string): Promise<number> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObjectAge(coinKey);\n\t}\n\n\t// === Margin Pool Queries ===\n\n\tgetMarginPoolId(coinKey: string): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolId(coinKey);\n\t}\n\n\tisDeepbookPoolAllowed(coinKey: string, deepbookPoolId: string): Promise<boolean> {\n\t\treturn this.#marginPoolQueries.isDeepbookPoolAllowed(coinKey, deepbookPoolId);\n\t}\n\n\tgetMarginPoolTotalSupply(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolTotalSupply(coinKey, decimals);\n\t}\n\n\tgetMarginPoolSupplyShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolSupplyShares(coinKey, decimals);\n\t}\n\n\tgetMarginPoolTotalBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolTotalBorrow(coinKey, decimals);\n\t}\n\n\tgetMarginPoolBorrowShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolBorrowShares(coinKey, decimals);\n\t}\n\n\tgetMarginPoolLastUpdateTimestamp(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolLastUpdateTimestamp(coinKey);\n\t}\n\n\tgetMarginPoolSupplyCap(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolSupplyCap(coinKey, decimals);\n\t}\n\n\tgetMarginPoolMaxUtilizationRate(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolMaxUtilizationRate(coinKey);\n\t}\n\n\tgetMarginPoolProtocolSpread(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolProtocolSpread(coinKey);\n\t}\n\n\tgetMarginPoolMinBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolMinBorrow(coinKey, decimals);\n\t}\n\n\tgetMarginPoolInterestRate(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolInterestRate(coinKey);\n\t}\n\n\tgetUserSupplyShares(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\treturn this.#marginPoolQueries.getUserSupplyShares(coinKey, supplierCapId, decimals);\n\t}\n\n\tgetUserSupplyAmount(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\treturn this.#marginPoolQueries.getUserSupplyAmount(coinKey, supplierCapId, decimals);\n\t}\n\n\t// === Margin Manager Queries ===\n\n\tgetMarginManagerOwner(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerOwner(marginManagerKey);\n\t}\n\n\tgetMarginManagerDeepbookPool(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDeepbookPool(marginManagerKey);\n\t}\n\n\tgetMarginManagerMarginPoolId(marginManagerKey: string): Promise<string | null> {\n\t\treturn this.#marginManagerQueries.getMarginManagerMarginPoolId(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedShares(marginManagerKey: string): Promise<BorrowedShares> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedBaseShares(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedBaseShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedQuoteShares(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedQuoteShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerHasBaseDebt(marginManagerKey: string): Promise<boolean> {\n\t\treturn this.#marginManagerQueries.getMarginManagerHasBaseDebt(marginManagerKey);\n\t}\n\n\tgetMarginManagerBalanceManagerId(marginManagerAddress: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBalanceManagerId(marginManagerAddress);\n\t}\n\n\tgetMarginManagerAssets(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerAssets> {\n\t\treturn this.#marginManagerQueries.getMarginManagerAssets(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerDebts(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerDebts> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDebts(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerState(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerState> {\n\t\treturn this.#marginManagerQueries.getMarginManagerState(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerStates(\n\t\tmarginManagers: Record<string, string>,\n\t\tdecimals: number = 6,\n\t): Promise<Record<string, MarginManagerState>> {\n\t\treturn this.#marginManagerQueries.getMarginManagerStates(marginManagers, decimals);\n\t}\n\n\tgetMarginManagerBaseBalance(marginManagerKey: string, decimals: number = 9): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBaseBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerQuoteBalance(marginManagerKey: string, decimals: number = 9): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerQuoteBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerDeepBalance(marginManagerKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDeepBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerBalances(\n\t\tmarginManagers: Record<string, string>,\n\t\tdecimals: number = 9,\n\t): Promise<Record<string, MarginManagerBalancesResult>> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBalances(marginManagers, decimals);\n\t}\n\n\t// === TPSL Queries ===\n\n\tgetConditionalOrderIds(marginManagerKey: string): Promise<string[]> {\n\t\treturn this.#tpslQueries.getConditionalOrderIds(marginManagerKey);\n\t}\n\n\tgetLowestTriggerAbovePrice(marginManagerKey: string): Promise<bigint> {\n\t\treturn this.#tpslQueries.getLowestTriggerAbovePrice(marginManagerKey);\n\t}\n\n\tgetHighestTriggerBelowPrice(marginManagerKey: string): Promise<bigint> {\n\t\treturn this.#tpslQueries.getHighestTriggerBelowPrice(marginManagerKey);\n\t}\n\n\t// === Registry Queries ===\n\n\tisPoolEnabledForMargin(poolKey: string): Promise<boolean> {\n\t\treturn this.#registryQueries.isPoolEnabledForMargin(poolKey);\n\t}\n\n\tgetMarginManagerIdsForOwner(owner: string): Promise<string[]> {\n\t\treturn this.#registryQueries.getMarginManagerIdsForOwner(owner);\n\t}\n\n\tgetBaseMarginPoolId(poolKey: string): Promise<string> {\n\t\treturn this.#registryQueries.getBaseMarginPoolId(poolKey);\n\t}\n\n\tgetQuoteMarginPoolId(poolKey: string): Promise<string> {\n\t\treturn this.#registryQueries.getQuoteMarginPoolId(poolKey);\n\t}\n\n\tgetMinWithdrawRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getMinWithdrawRiskRatio(poolKey);\n\t}\n\n\tgetMinBorrowRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getMinBorrowRiskRatio(poolKey);\n\t}\n\n\tgetLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getLiquidationRiskRatio(poolKey);\n\t}\n\n\tgetTargetLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getTargetLiquidationRiskRatio(poolKey);\n\t}\n\n\tgetUserLiquidationReward(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getUserLiquidationReward(poolKey);\n\t}\n\n\tgetPoolLiquidationReward(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getPoolLiquidationReward(poolKey);\n\t}\n\n\tgetAllowedMaintainers(): Promise<string[]> {\n\t\treturn this.#registryQueries.getAllowedMaintainers();\n\t}\n\n\tgetAllowedPauseCaps(): Promise<string[]> {\n\t\treturn this.#registryQueries.getAllowedPauseCaps();\n\t}\n\n\t// === Synchronous Utilities ===\n\n\tdecodeOrderId(encodedOrderId: bigint): DecodedOrderId {\n\t\tconst isBid = encodedOrderId >> 127n === 0n;\n\t\tconst price = Number((encodedOrderId >> 64n) & ((1n << 63n) - 1n));\n\t\tconst orderId = Number(encodedOrderId & ((1n << 64n) - 1n));\n\n\t\treturn { isBid, price, orderId };\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,SAAgB,SAA2C,EAC1D,OAAO,YACP,GAAG,WAC6F;AAChG,QAAO;EACN;EACA,WAAW,WAAW;AACrB,UAAO,IAAI,eAAe;IACzB;IACA,SAAS,OAAO;IAChB,GAAG;IACH,CAAC;;EAEH;;;;;AAMF,IAAa,iBAAb,MAA4B;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;CAmBA,YAAY,EACX,QACA,SACA,SACA,iBACA,g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uBAAuB,SAAmC;AACzD,SAAO,MAAKC,gBAAiB,uBAAuB,QAAQ;;CAG7D,4BAA4B,OAAkC;AAC7D,SAAO,MAAKA,gBAAiB,4BAA4B,MAAM;;CAGhE,oBAAoB,SAAkC;AACrD,SAAO,MAAKA,gBAAiB,oBAAoB,QAAQ;;CAG1D,qBAAqB,SAAkC;AACtD,SAAO,MAAKA,gBAAiB,qBAAqB,QAAQ;;CAG3D,wBAAwB,SAAkC;AACzD,SAAO,MAAKA,gBAAiB,wBAAwB,QAAQ;;CAG9D,sBAAsB,SAAkC;AACvD,SAAO,MAAKA,gBAAiB,sBAAsB,QAAQ;;CAG5D,wBAAwB,SAAkC;AACzD,SAAO,MAAKA,gBAAiB,wBAAwB,QAAQ;;CAG9D,8BAA8B,SAAkC;AAC/D,SAAO,MAAKA,gBAAiB,8BAA8B,QAAQ;;CAGpE,yBAAyB,SAAkC;AAC1D,SAAO,MAAKA,gBAAiB,yBAAyB,QAAQ;;CAG/D,yBAAyB,SAAkC;AAC1D,SAAO,MAAKA,gBAAiB,yBAAyB,QAAQ;;CAG/D,wBAA2C;AAC1C,SAAO,MAAKA,gBAAiB,uBAAuB;;CAGrD,sBAAyC;AACxC,SAAO,MAAKA,gBAAiB,qBAAqB;;CAKnD,cAAc,gBAAwC;AAKrD,SAAO;GAAE,OAJK,kBAAkB,SAAS;GAIzB,OAHF,OAAQ,kBAAkB,OAAS,MAAM,OAAO,GAAI;GAG3C,SAFP,OAAO,kBAAmB,MAAM,OAAO,GAAI;GAE3B"}
|
|
1
|
+
{"version":3,"file":"client.mjs","names":["#balanceManagerQueries","#poolQueries","#quantityQueries","#orderQueries","#accountQueries","#referralQueries","#priceFeedQueries","#marginPoolQueries","#marginManagerQueries","#tpslQueries","#registryQueries"],"sources":["../src/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ClientWithCoreApi, SuiClientRegistration, SuiClientTypes } from '@mysten/sui/client';\nimport type { Transaction } from '@mysten/sui/transactions';\n\nimport type { QueryContext } from './queries/context.js';\nimport { AccountQueries } from './queries/accountQueries.js';\nimport { BalanceManagerQueries } from './queries/balanceManagerQueries.js';\nimport { MarginManagerQueries } from './queries/marginManagerQueries.js';\nimport { MarginPoolQueries } from './queries/marginPoolQueries.js';\nimport { OrderQueries } from './queries/orderQueries.js';\nimport { PoolQueries } from './queries/poolQueries.js';\nimport { PriceFeedQueries } from './queries/priceFeedQueries.js';\nimport { QuantityQueries } from './queries/quantityQueries.js';\nimport { ReferralQueries } from './queries/referralQueries.js';\nimport { RegistryQueries } from './queries/registryQueries.js';\nimport { TPSLQueries } from './queries/tpslQueries.js';\nimport { BalanceManagerContract } from './transactions/balanceManager.js';\nimport { DeepBookContract } from './transactions/deepbook.js';\nimport { DeepBookAdminContract } from './transactions/deepbookAdmin.js';\nimport { FlashLoanContract } from './transactions/flashLoans.js';\nimport { GovernanceContract } from './transactions/governance.js';\nimport { MarginAdminContract } from './transactions/marginAdmin.js';\nimport { MarginLiquidationsContract } from './transactions/marginLiquidations.js';\nimport { MarginMaintainerContract } from './transactions/marginMaintainer.js';\nimport { MarginManagerContract } from './transactions/marginManager.js';\nimport { MarginPoolContract } from './transactions/marginPool.js';\nimport { MarginRegistryContract } from './transactions/marginRegistry.js';\nimport { MarginTPSLContract } from './transactions/marginTPSL.js';\nimport { PoolProxyContract } from './transactions/poolProxy.js';\nimport type {\n\tAccountInfo,\n\tBalanceManager,\n\tBaseQuantityIn,\n\tBaseQuantityOut,\n\tBorrowedShares,\n\tCanPlaceLimitOrderParams,\n\tCanPlaceMarketOrderParams,\n\tDecodedOrderId,\n\tLevel2Range,\n\tLevel2TicksFromMid,\n\tLockedBalances,\n\tManagerBalance,\n\tMarginManager,\n\tMarginManagerAssets,\n\tMarginManagerBalancesResult,\n\tMarginManagerDebts,\n\tMarginManagerState,\n\tOrderDeepRequiredResult,\n\tPoolBookParams,\n\tPoolDeepPrice,\n\tPoolTradeParams,\n\tQuantityOut,\n\tQuoteQuantityIn,\n\tQuoteQuantityOut,\n\tReferralBalances,\n\tVaultBalances,\n} from './types/index.js';\nimport { DeepBookConfig } from './utils/config.js';\nimport type { CoinMap, DeepbookPackageIds, PoolMap } from './utils/constants.js';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nexport interface DeepBookCompatibleClient extends ClientWithCoreApi {}\n\nexport interface DeepBookOptions<Name = 'deepbook'> {\n\taddress: string;\n\tbalanceManagers?: { [key: string]: BalanceManager };\n\tmarginManagers?: { [key: string]: MarginManager };\n\tcoins?: CoinMap;\n\tpools?: PoolMap;\n\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\tpackageIds?: DeepbookPackageIds;\n\tpyth?: { pythStateId: string; wormholeStateId: string };\n\tname?: Name;\n}\n\nexport interface DeepBookClientOptions extends DeepBookOptions {\n\tclient: DeepBookCompatibleClient;\n\tnetwork: SuiClientTypes.Network;\n}\n\nexport function deepbook<Name extends string = 'deepbook'>({\n\tname = 'deepbook' as Name,\n\t...options\n}: DeepBookOptions<Name>): SuiClientRegistration<DeepBookCompatibleClient, Name, DeepBookClient> {\n\treturn {\n\t\tname,\n\t\tregister: (client) => {\n\t\t\treturn new DeepBookClient({\n\t\t\t\tclient,\n\t\t\t\tnetwork: client.network,\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n\n/**\n * DeepBookClient class for managing DeepBook operations.\n */\nexport class DeepBookClient {\n\t#balanceManagerQueries: BalanceManagerQueries;\n\t#poolQueries: PoolQueries;\n\t#quantityQueries: QuantityQueries;\n\t#orderQueries: OrderQueries;\n\t#accountQueries: AccountQueries;\n\t#referralQueries: ReferralQueries;\n\t#priceFeedQueries: PriceFeedQueries;\n\t#marginPoolQueries: MarginPoolQueries;\n\t#marginManagerQueries: MarginManagerQueries;\n\t#tpslQueries: TPSLQueries;\n\t#registryQueries: RegistryQueries;\n\n\tbalanceManager: BalanceManagerContract;\n\tdeepBook: DeepBookContract;\n\tdeepBookAdmin: DeepBookAdminContract;\n\tflashLoans: FlashLoanContract;\n\tgovernance: GovernanceContract;\n\tmarginAdmin: MarginAdminContract;\n\tmarginMaintainer: MarginMaintainerContract;\n\tmarginPool: MarginPoolContract;\n\tmarginManager: MarginManagerContract;\n\tmarginRegistry: MarginRegistryContract;\n\tmarginLiquidations: MarginLiquidationsContract;\n\tpoolProxy: PoolProxyContract;\n\tmarginTPSL: MarginTPSLContract;\n\n\t/**\n\t * Creates a new DeepBookClient instance\n\t */\n\tconstructor({\n\t\tclient,\n\t\taddress,\n\t\tnetwork,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t\tpackageIds,\n\t\tpyth,\n\t}: DeepBookClientOptions) {\n\t\tconst normalizedAddress = normalizeSuiAddress(address);\n\t\tconst config = new DeepBookConfig({\n\t\t\taddress: normalizedAddress,\n\t\t\tnetwork,\n\t\t\tbalanceManagers,\n\t\t\tmarginManagers,\n\t\t\tcoins,\n\t\t\tpools,\n\t\t\tadminCap,\n\t\t\tmarginAdminCap,\n\t\t\tmarginMaintainerCap,\n\t\t\tpackageIds,\n\t\t\tpyth,\n\t\t});\n\n\t\tthis.balanceManager = new BalanceManagerContract(config);\n\t\tthis.deepBook = new DeepBookContract(config);\n\t\tthis.deepBookAdmin = new DeepBookAdminContract(config);\n\t\tthis.flashLoans = new FlashLoanContract(config);\n\t\tthis.governance = new GovernanceContract(config);\n\t\tthis.marginAdmin = new MarginAdminContract(config);\n\t\tthis.marginMaintainer = new MarginMaintainerContract(config);\n\t\tthis.marginPool = new MarginPoolContract(config);\n\t\tthis.marginManager = new MarginManagerContract(config);\n\t\tthis.marginRegistry = new MarginRegistryContract(config);\n\t\tthis.marginLiquidations = new MarginLiquidationsContract(config);\n\t\tthis.poolProxy = new PoolProxyContract(config);\n\t\tthis.marginTPSL = new MarginTPSLContract(config);\n\n\t\tconst ctx: QueryContext = {\n\t\t\tclient,\n\t\t\tconfig,\n\t\t\taddress: normalizedAddress,\n\t\t\tbalanceManager: this.balanceManager,\n\t\t\tdeepBook: this.deepBook,\n\t\t\tmarginManager: this.marginManager,\n\t\t\tmarginPool: this.marginPool,\n\t\t\tmarginRegistry: this.marginRegistry,\n\t\t\tmarginTPSL: this.marginTPSL,\n\t\t};\n\n\t\tthis.#balanceManagerQueries = new BalanceManagerQueries(ctx);\n\t\tthis.#poolQueries = new PoolQueries(ctx);\n\t\tthis.#quantityQueries = new QuantityQueries(ctx);\n\t\tthis.#orderQueries = new OrderQueries(ctx);\n\t\tthis.#accountQueries = new AccountQueries(ctx);\n\t\tthis.#referralQueries = new ReferralQueries(ctx);\n\t\tthis.#priceFeedQueries = new PriceFeedQueries(ctx);\n\t\tthis.#marginPoolQueries = new MarginPoolQueries(ctx);\n\t\tthis.#marginManagerQueries = new MarginManagerQueries(ctx);\n\t\tthis.#tpslQueries = new TPSLQueries(ctx);\n\t\tthis.#registryQueries = new RegistryQueries(ctx);\n\t}\n\n\t// === Balance Manager Queries ===\n\n\tcheckManagerBalance(managerKey: string, coinKey: string): Promise<ManagerBalance> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalance(managerKey, coinKey);\n\t}\n\n\tcheckManagerBalanceWithAddress(managerAddress: string, coinKey: string): Promise<ManagerBalance> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalanceWithAddress(managerAddress, coinKey);\n\t}\n\n\tcheckManagerBalancesWithAddress(\n\t\tmanagerAddresses: string[],\n\t\tcoinKeys: string[],\n\t): Promise<Record<string, Record<string, number>>> {\n\t\treturn this.#balanceManagerQueries.checkManagerBalancesWithAddress(managerAddresses, coinKeys);\n\t}\n\n\tgetBalanceManagerIds(owner: string): Promise<string[]> {\n\t\treturn this.#balanceManagerQueries.getBalanceManagerIds(owner);\n\t}\n\n\taccountExists(poolKey: string, managerKey: string): Promise<boolean> {\n\t\treturn this.#balanceManagerQueries.accountExists(poolKey, managerKey);\n\t}\n\n\t// === Pool Queries ===\n\n\twhitelisted(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.whitelisted(poolKey);\n\t}\n\n\tvaultBalances(poolKey: string): Promise<VaultBalances> {\n\t\treturn this.#poolQueries.vaultBalances(poolKey);\n\t}\n\n\tgetPoolIdByAssets(baseType: string, quoteType: string): Promise<string> {\n\t\treturn this.#poolQueries.getPoolIdByAssets(baseType, quoteType);\n\t}\n\n\tmidPrice(poolKey: string): Promise<number> {\n\t\treturn this.#poolQueries.midPrice(poolKey);\n\t}\n\n\tpoolTradeParams(poolKey: string): Promise<PoolTradeParams> {\n\t\treturn this.#poolQueries.poolTradeParams(poolKey);\n\t}\n\n\tpoolBookParams(poolKey: string): Promise<PoolBookParams> {\n\t\treturn this.#poolQueries.poolBookParams(poolKey);\n\t}\n\n\tstablePool(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.stablePool(poolKey);\n\t}\n\n\tregisteredPool(poolKey: string): Promise<boolean> {\n\t\treturn this.#poolQueries.registeredPool(poolKey);\n\t}\n\n\tpoolTradeParamsNext(poolKey: string): Promise<PoolTradeParams> {\n\t\treturn this.#poolQueries.poolTradeParamsNext(poolKey);\n\t}\n\n\tquorum(poolKey: string): Promise<number> {\n\t\treturn this.#poolQueries.quorum(poolKey);\n\t}\n\n\tpoolId(poolKey: string): Promise<string> {\n\t\treturn this.#poolQueries.poolId(poolKey);\n\t}\n\n\tcanPlaceLimitOrder(params: CanPlaceLimitOrderParams): Promise<boolean> {\n\t\treturn this.#poolQueries.canPlaceLimitOrder(params);\n\t}\n\n\tcanPlaceMarketOrder(params: CanPlaceMarketOrderParams): Promise<boolean> {\n\t\treturn this.#poolQueries.canPlaceMarketOrder(params);\n\t}\n\n\tcheckMarketOrderParams(poolKey: string, quantity: number | bigint): Promise<boolean> {\n\t\treturn this.#poolQueries.checkMarketOrderParams(poolKey, quantity);\n\t}\n\n\tcheckLimitOrderParams(\n\t\tpoolKey: string,\n\t\tprice: number | bigint,\n\t\tquantity: number | bigint,\n\t\texpireTimestamp: number,\n\t): Promise<boolean> {\n\t\treturn this.#poolQueries.checkLimitOrderParams(poolKey, price, quantity, expireTimestamp);\n\t}\n\n\t// === Quantity Queries ===\n\n\tgetQuoteQuantityOut(poolKey: string, baseQuantity: number | bigint): Promise<QuoteQuantityOut> {\n\t\treturn this.#quantityQueries.getQuoteQuantityOut(poolKey, baseQuantity);\n\t}\n\n\tgetBaseQuantityOut(poolKey: string, quoteQuantity: number | bigint): Promise<BaseQuantityOut> {\n\t\treturn this.#quantityQueries.getBaseQuantityOut(poolKey, quoteQuantity);\n\t}\n\n\tgetQuantityOut(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<QuantityOut> {\n\t\treturn this.#quantityQueries.getQuantityOut(poolKey, baseQuantity, quoteQuantity);\n\t}\n\n\tgetQuoteQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t): Promise<QuoteQuantityOut> {\n\t\treturn this.#quantityQueries.getQuoteQuantityOutInputFee(poolKey, baseQuantity);\n\t}\n\n\tgetBaseQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<BaseQuantityOut> {\n\t\treturn this.#quantityQueries.getBaseQuantityOutInputFee(poolKey, quoteQuantity);\n\t}\n\n\tgetQuantityOutInputFee(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tquoteQuantity: number | bigint,\n\t): Promise<QuantityOut> {\n\t\treturn this.#quantityQueries.getQuantityOutInputFee(poolKey, baseQuantity, quoteQuantity);\n\t}\n\n\tgetBaseQuantityIn(\n\t\tpoolKey: string,\n\t\ttargetQuoteQuantity: number | bigint,\n\t\tpayWithDeep: boolean,\n\t): Promise<BaseQuantityIn> {\n\t\treturn this.#quantityQueries.getBaseQuantityIn(poolKey, targetQuoteQuantity, payWithDeep);\n\t}\n\n\tgetQuoteQuantityIn(\n\t\tpoolKey: string,\n\t\ttargetBaseQuantity: number | bigint,\n\t\tpayWithDeep: boolean,\n\t): Promise<QuoteQuantityIn> {\n\t\treturn this.#quantityQueries.getQuoteQuantityIn(poolKey, targetBaseQuantity, payWithDeep);\n\t}\n\n\tgetOrderDeepRequired(\n\t\tpoolKey: string,\n\t\tbaseQuantity: number | bigint,\n\t\tprice: number | bigint,\n\t): Promise<OrderDeepRequiredResult> {\n\t\treturn this.#quantityQueries.getOrderDeepRequired(poolKey, baseQuantity, price);\n\t}\n\n\t// === Order Queries ===\n\n\taccountOpenOrders(poolKey: string, managerKey: string): Promise<string[]> {\n\t\treturn this.#orderQueries.accountOpenOrders(poolKey, managerKey);\n\t}\n\n\tgetOrder(poolKey: string, orderId: string) {\n\t\treturn this.#orderQueries.getOrder(poolKey, orderId);\n\t}\n\n\tgetOrderNormalized(poolKey: string, orderId: string) {\n\t\treturn this.#orderQueries.getOrderNormalized(poolKey, orderId);\n\t}\n\n\tgetOrders(poolKey: string, orderIds: string[]) {\n\t\treturn this.#orderQueries.getOrders(poolKey, orderIds);\n\t}\n\n\tgetLevel2Range(\n\t\tpoolKey: string,\n\t\tpriceLow: number | bigint,\n\t\tpriceHigh: number | bigint,\n\t\tisBid: boolean,\n\t): Promise<Level2Range> {\n\t\treturn this.#orderQueries.getLevel2Range(poolKey, priceLow, priceHigh, isBid);\n\t}\n\n\tgetLevel2TicksFromMid(poolKey: string, ticks: number): Promise<Level2TicksFromMid> {\n\t\treturn this.#orderQueries.getLevel2TicksFromMid(poolKey, ticks);\n\t}\n\n\tgetAccountOrderDetails(poolKey: string, managerKey: string) {\n\t\treturn this.#orderQueries.getAccountOrderDetails(poolKey, managerKey);\n\t}\n\n\t// === Account Queries ===\n\n\taccount(poolKey: string, managerKey: string): Promise<AccountInfo> {\n\t\treturn this.#accountQueries.account(poolKey, managerKey);\n\t}\n\n\tlockedBalance(poolKey: string, balanceManagerKey: string): Promise<LockedBalances> {\n\t\treturn this.#accountQueries.lockedBalance(poolKey, balanceManagerKey);\n\t}\n\n\tgetPoolDeepPrice(poolKey: string): Promise<PoolDeepPrice> {\n\t\treturn this.#accountQueries.getPoolDeepPrice(poolKey);\n\t}\n\n\t// === Referral Queries ===\n\n\tbalanceManagerReferralOwner(referral: string): Promise<string> {\n\t\treturn this.#referralQueries.balanceManagerReferralOwner(referral);\n\t}\n\n\tgetPoolReferralBalances(poolKey: string, referral: string): Promise<ReferralBalances> {\n\t\treturn this.#referralQueries.getPoolReferralBalances(poolKey, referral);\n\t}\n\n\tbalanceManagerReferralPoolId(referral: string): Promise<string> {\n\t\treturn this.#referralQueries.balanceManagerReferralPoolId(referral);\n\t}\n\n\tpoolReferralMultiplier(poolKey: string, referral: string): Promise<number> {\n\t\treturn this.#referralQueries.poolReferralMultiplier(poolKey, referral);\n\t}\n\n\tgetBalanceManagerReferralId(managerKey: string, poolKey: string): Promise<string | null> {\n\t\treturn this.#referralQueries.getBalanceManagerReferralId(managerKey, poolKey);\n\t}\n\n\t// === Price Feed Queries ===\n\n\tgetPriceInfoObject(tx: Transaction, coinKey: string): Promise<string> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObject(tx, coinKey);\n\t}\n\n\tgetPriceInfoObjects(tx: Transaction, coinKeys: string[]): Promise<Record<string, string>> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObjects(tx, coinKeys);\n\t}\n\n\tgetPriceInfoObjectAge(coinKey: string): Promise<number> {\n\t\treturn this.#priceFeedQueries.getPriceInfoObjectAge(coinKey);\n\t}\n\n\t// === Margin Pool Queries ===\n\n\tgetMarginPoolId(coinKey: string): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolId(coinKey);\n\t}\n\n\tisDeepbookPoolAllowed(coinKey: string, deepbookPoolId: string): Promise<boolean> {\n\t\treturn this.#marginPoolQueries.isDeepbookPoolAllowed(coinKey, deepbookPoolId);\n\t}\n\n\tgetMarginPoolTotalSupply(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolTotalSupply(coinKey, decimals);\n\t}\n\n\tgetMarginPoolSupplyShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolSupplyShares(coinKey, decimals);\n\t}\n\n\tgetMarginPoolTotalBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolTotalBorrow(coinKey, decimals);\n\t}\n\n\tgetMarginPoolBorrowShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolBorrowShares(coinKey, decimals);\n\t}\n\n\tgetMarginPoolLastUpdateTimestamp(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolLastUpdateTimestamp(coinKey);\n\t}\n\n\tgetMarginPoolSupplyCap(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolSupplyCap(coinKey, decimals);\n\t}\n\n\tgetMarginPoolMaxUtilizationRate(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolMaxUtilizationRate(coinKey);\n\t}\n\n\tgetMarginPoolProtocolSpread(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolProtocolSpread(coinKey);\n\t}\n\n\tgetMarginPoolMinBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginPoolQueries.getMarginPoolMinBorrow(coinKey, decimals);\n\t}\n\n\tgetMarginPoolInterestRate(coinKey: string): Promise<number> {\n\t\treturn this.#marginPoolQueries.getMarginPoolInterestRate(coinKey);\n\t}\n\n\tgetUserSupplyShares(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\treturn this.#marginPoolQueries.getUserSupplyShares(coinKey, supplierCapId, decimals);\n\t}\n\n\tgetUserSupplyAmount(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\treturn this.#marginPoolQueries.getUserSupplyAmount(coinKey, supplierCapId, decimals);\n\t}\n\n\t// === Margin Manager Queries ===\n\n\tgetMarginManagerOwner(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerOwner(marginManagerKey);\n\t}\n\n\tgetMarginManagerDeepbookPool(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDeepbookPool(marginManagerKey);\n\t}\n\n\tgetMarginManagerMarginPoolId(marginManagerKey: string): Promise<string | null> {\n\t\treturn this.#marginManagerQueries.getMarginManagerMarginPoolId(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedShares(marginManagerKey: string): Promise<BorrowedShares> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedBaseShares(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedBaseShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerBorrowedQuoteShares(marginManagerKey: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBorrowedQuoteShares(marginManagerKey);\n\t}\n\n\tgetMarginManagerHasBaseDebt(marginManagerKey: string): Promise<boolean> {\n\t\treturn this.#marginManagerQueries.getMarginManagerHasBaseDebt(marginManagerKey);\n\t}\n\n\tgetMarginManagerBalanceManagerId(marginManagerAddress: string): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBalanceManagerId(marginManagerAddress);\n\t}\n\n\tgetMarginManagerAssets(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerAssets> {\n\t\treturn this.#marginManagerQueries.getMarginManagerAssets(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerDebts(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerDebts> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDebts(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerState(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<MarginManagerState> {\n\t\treturn this.#marginManagerQueries.getMarginManagerState(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerStates(\n\t\tmarginManagers: Record<string, string>,\n\t\tdecimals: number = 6,\n\t): Promise<Record<string, MarginManagerState>> {\n\t\treturn this.#marginManagerQueries.getMarginManagerStates(marginManagers, decimals);\n\t}\n\n\tgetMarginManagerBaseBalance(marginManagerKey: string, decimals: number = 9): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBaseBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerQuoteBalance(marginManagerKey: string, decimals: number = 9): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerQuoteBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerDeepBalance(marginManagerKey: string, decimals: number = 6): Promise<string> {\n\t\treturn this.#marginManagerQueries.getMarginManagerDeepBalance(marginManagerKey, decimals);\n\t}\n\n\tgetMarginManagerBalances(\n\t\tmarginManagers: Record<string, string>,\n\t\tdecimals: number = 9,\n\t): Promise<Record<string, MarginManagerBalancesResult>> {\n\t\treturn this.#marginManagerQueries.getMarginManagerBalances(marginManagers, decimals);\n\t}\n\n\t// === TPSL Queries ===\n\n\tgetConditionalOrderIds(marginManagerKey: string): Promise<string[]> {\n\t\treturn this.#tpslQueries.getConditionalOrderIds(marginManagerKey);\n\t}\n\n\tgetLowestTriggerAbovePrice(marginManagerKey: string): Promise<bigint> {\n\t\treturn this.#tpslQueries.getLowestTriggerAbovePrice(marginManagerKey);\n\t}\n\n\tgetHighestTriggerBelowPrice(marginManagerKey: string): Promise<bigint> {\n\t\treturn this.#tpslQueries.getHighestTriggerBelowPrice(marginManagerKey);\n\t}\n\n\t// === Registry Queries ===\n\n\tisPoolEnabledForMargin(poolKey: string): Promise<boolean> {\n\t\treturn this.#registryQueries.isPoolEnabledForMargin(poolKey);\n\t}\n\n\tgetMarginManagerIdsForOwner(owner: string): Promise<string[]> {\n\t\treturn this.#registryQueries.getMarginManagerIdsForOwner(owner);\n\t}\n\n\tgetBaseMarginPoolId(poolKey: string): Promise<string> {\n\t\treturn this.#registryQueries.getBaseMarginPoolId(poolKey);\n\t}\n\n\tgetQuoteMarginPoolId(poolKey: string): Promise<string> {\n\t\treturn this.#registryQueries.getQuoteMarginPoolId(poolKey);\n\t}\n\n\tgetMinWithdrawRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getMinWithdrawRiskRatio(poolKey);\n\t}\n\n\tgetMinBorrowRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getMinBorrowRiskRatio(poolKey);\n\t}\n\n\t/**\n\t * Minimum risk ratio required to open a new position on the pool. Gates\n\t * position opening, unlike `getMinBorrowRiskRatio`, which gates borrowing.\n\t */\n\tgetMinOpenRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getMinOpenRiskRatio(poolKey);\n\t}\n\n\tgetLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getLiquidationRiskRatio(poolKey);\n\t}\n\n\tgetTargetLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getTargetLiquidationRiskRatio(poolKey);\n\t}\n\n\tgetUserLiquidationReward(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getUserLiquidationReward(poolKey);\n\t}\n\n\tgetPoolLiquidationReward(poolKey: string): Promise<number> {\n\t\treturn this.#registryQueries.getPoolLiquidationReward(poolKey);\n\t}\n\n\tgetAllowedMaintainers(): Promise<string[]> {\n\t\treturn this.#registryQueries.getAllowedMaintainers();\n\t}\n\n\tgetAllowedPauseCaps(): Promise<string[]> {\n\t\treturn this.#registryQueries.getAllowedPauseCaps();\n\t}\n\n\t// === Synchronous Utilities ===\n\n\tdecodeOrderId(encodedOrderId: bigint): DecodedOrderId {\n\t\tconst isBid = encodedOrderId >> 127n === 0n;\n\t\tconst price = Number((encodedOrderId >> 64n) & ((1n << 63n) - 1n));\n\t\tconst orderId = Number(encodedOrderId & ((1n << 64n) - 1n));\n\n\t\treturn { isBid, price, orderId };\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFA,SAAgB,SAA2C,EAC1D,OAAO,YACP,GAAG,WAC6F;AAChG,QAAO;EACN;EACA,WAAW,WAAW;AACrB,UAAO,IAAI,eAAe;IACzB;IACA,SAAS,OAAO;IAChB,GAAG;IACH,CAAC;;EAEH;;;;;AAMF,IAAa,iBAAb,MAA4B;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;CAmBA,YAAY,EACX,QACA,SACA,SACA,iBACA,gBACA,OACA,OACA,UACA,gBACA,qBACA,YACA,QACyB;EACzB,MAAM,oBAAoB,oBAAoB,QAAQ;EACtD,MAAM,SAAS,IAAI,eAAe;GACjC,SAAS;GACT;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,CAAC;AAEF,OAAK,iBAAiB,IAAI,uBAAuB,OAAO;AACxD,OAAK,WAAW,IAAI,iBAAiB,OAAO;AAC5C,OAAK,gBAAgB,IAAI,sBAAsB,OAAO;AACtD,OAAK,aAAa,IAAI,kBAAkB,OAAO;AAC/C,OAAK,aAAa,IAAI,mBAAmB,OAAO;AAChD,OAAK,cAAc,IAAI,oBAAoB,OAAO;AAClD,OAAK,mBAAmB,IAAI,yBAAyB,OAAO;AAC5D,OAAK,aAAa,IAAI,mBAAmB,OAAO;AAChD,OAAK,gBAAgB,IAAI,sBAAsB,OAAO;AACtD,OAAK,iBAAiB,IAAI,uBAAuB,OAAO;AACxD,OAAK,qBAAqB,IAAI,2BAA2B,OAAO;AAChE,OAAK,YAAY,IAAI,kBAAkB,OAAO;AAC9C,OAAK,aAAa,IAAI,mBAAmB,OAAO;EAEhD,MAAM,MAAoB;G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AiB,yBAAyB,QAAQ;;CAG/D,wBAA2C;AAC1C,SAAO,MAAKA,gBAAiB,uBAAuB;;CAGrD,sBAAyC;AACxC,SAAO,MAAKA,gBAAiB,qBAAqB;;CAKnD,cAAc,gBAAwC;AAKrD,SAAO;GAAE,OAJK,kBAAkB,SAAS;GAIzB,OAHF,OAAQ,kBAAkB,OAAS,MAAM,OAAO,GAAI;GAG3C,SAFP,OAAO,kBAAmB,MAAM,OAAO,GAAI;GAE3B"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { MoveStruct } from "../utils/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_sui_bcs0 from "@mysten/sui/bcs";
|
|
3
3
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
4
4
|
|
|
5
5
|
//#region src/contracts/deepbook/account.d.ts
|
|
6
6
|
declare const Account: MoveStruct<{
|
|
7
|
-
epoch:
|
|
7
|
+
epoch: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
8
8
|
open_orders: MoveStruct<{
|
|
9
|
-
contents:
|
|
9
|
+
contents: _mysten_sui_bcs0.BcsType<string[], Iterable<string | number | bigint> & {
|
|
10
10
|
length: number;
|
|
11
11
|
}, string>;
|
|
12
12
|
}, "0x2::vec_set::VecSet<u128>">;
|
|
13
|
-
taker_volume:
|
|
14
|
-
maker_volume:
|
|
15
|
-
active_stake:
|
|
16
|
-
inactive_stake:
|
|
17
|
-
created_proposal:
|
|
18
|
-
voted_proposal:
|
|
13
|
+
taker_volume: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u128">;
|
|
14
|
+
maker_volume: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u128">;
|
|
15
|
+
active_stake: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
16
|
+
inactive_stake: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
17
|
+
created_proposal: _mysten_sui_bcs0.BcsType<boolean, boolean, "bool">;
|
|
18
|
+
voted_proposal: _mysten_sui_bcs0.BcsType<string | null, string | Uint8Array<ArrayBufferLike> | null | undefined, "Option<bytes[32]>">;
|
|
19
19
|
unclaimed_rebates: MoveStruct<{
|
|
20
|
-
base:
|
|
21
|
-
quote:
|
|
22
|
-
deep:
|
|
20
|
+
base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
21
|
+
quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
22
|
+
deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
23
23
|
}, "@deepbook/core::balances::Balances">;
|
|
24
24
|
settled_balances: MoveStruct<{
|
|
25
|
-
base:
|
|
26
|
-
quote:
|
|
27
|
-
deep:
|
|
25
|
+
base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
26
|
+
quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
27
|
+
deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
28
28
|
}, "@deepbook/core::balances::Balances">;
|
|
29
29
|
owed_balances: MoveStruct<{
|
|
30
|
-
base:
|
|
31
|
-
quote:
|
|
32
|
-
deep:
|
|
30
|
+
base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
31
|
+
quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
32
|
+
deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
33
33
|
}, "@deepbook/core::balances::Balances">;
|
|
34
34
|
}, "@deepbook/core::account::Account">;
|
|
35
35
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"mappings":";;;;;cAYa,OAAA,EAAO,UAAA;SAelB,
|
|
1
|
+
{"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"mappings":";;;;;cAYa,OAAA,EAAO,UAAA;SAelB,gBAAA,CAAA,OAAA"}
|