@haneullabs/deepbook-v3 0.1.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 +342 -81
- package/dist/client.d.mts +238 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +397 -0
- package/dist/client.mjs.map +1 -0
- package/dist/contracts/deepbook/account.d.mts +37 -0
- package/dist/contracts/deepbook/account.d.mts.map +1 -0
- package/dist/contracts/deepbook/account.mjs +31 -0
- package/dist/contracts/deepbook/account.mjs.map +1 -0
- package/dist/contracts/deepbook/balances.d.mts +12 -0
- package/dist/contracts/deepbook/balances.d.mts.map +1 -0
- package/dist/contracts/deepbook/balances.mjs +24 -0
- package/dist/contracts/deepbook/balances.mjs.map +1 -0
- package/dist/contracts/deepbook/deep_price.d.mts +12 -0
- package/dist/contracts/deepbook/deep_price.d.mts.map +1 -0
- package/dist/contracts/deepbook/deep_price.mjs +49 -0
- package/dist/contracts/deepbook/deep_price.mjs.map +1 -0
- package/dist/contracts/deepbook/deps/haneul/vec_set.d.mts +21 -0
- package/dist/contracts/deepbook/deps/haneul/vec_set.d.mts.map +1 -0
- package/dist/contracts/deepbook/deps/haneul/vec_set.mjs +26 -0
- package/dist/contracts/deepbook/deps/haneul/vec_set.mjs.map +1 -0
- package/dist/contracts/deepbook/order.d.mts +23 -0
- package/dist/contracts/deepbook/order.d.mts.map +1 -0
- package/dist/contracts/deepbook/order.mjs +63 -0
- package/dist/contracts/deepbook/order.mjs.map +1 -0
- package/dist/contracts/pyth/data_source.mjs +20 -0
- package/dist/contracts/pyth/data_source.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +21 -0
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +19 -0
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs +16 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs +16 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs +16 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs.map +1 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs +16 -0
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs.map +1 -0
- package/dist/contracts/pyth/i64.mjs +19 -0
- package/dist/contracts/pyth/i64.mjs.map +1 -0
- package/dist/contracts/pyth/price.mjs +22 -0
- package/dist/contracts/pyth/price.mjs.map +1 -0
- package/dist/contracts/pyth/price_feed.mjs +21 -0
- package/dist/contracts/pyth/price_feed.mjs.map +1 -0
- package/dist/contracts/pyth/price_identifier.mjs +16 -0
- package/dist/contracts/pyth/price_identifier.mjs.map +1 -0
- package/dist/contracts/pyth/price_info.mjs +28 -0
- package/dist/contracts/pyth/price_info.mjs.map +1 -0
- package/dist/contracts/pyth/state.mjs +36 -0
- package/dist/contracts/pyth/state.mjs.map +1 -0
- package/dist/contracts/utils/index.d.mts +34 -0
- package/dist/contracts/utils/index.d.mts.map +1 -0
- package/dist/contracts/utils/index.mjs +35 -0
- package/dist/contracts/utils/index.mjs.map +1 -0
- package/dist/contracts/wormhole/bytes32.mjs +16 -0
- package/dist/contracts/wormhole/bytes32.mjs.map +1 -0
- package/dist/contracts/wormhole/consumed_vaas.mjs +16 -0
- package/dist/contracts/wormhole/consumed_vaas.mjs.map +1 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +16 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +21 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +19 -0
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -0
- package/dist/contracts/wormhole/external_address.mjs +16 -0
- package/dist/contracts/wormhole/external_address.mjs.map +1 -0
- package/dist/contracts/wormhole/fee_collector.mjs +20 -0
- package/dist/contracts/wormhole/fee_collector.mjs.map +1 -0
- package/dist/contracts/wormhole/set.mjs +16 -0
- package/dist/contracts/wormhole/set.mjs.map +1 -0
- package/dist/contracts/wormhole/state.mjs +31 -0
- package/dist/contracts/wormhole/state.mjs.map +1 -0
- package/dist/index.d.mts +25 -0
- package/dist/index.mjs +26 -0
- package/dist/pyth/PriceServiceConnection.d.mts +26 -0
- package/dist/pyth/PriceServiceConnection.d.mts.map +1 -0
- package/dist/pyth/PriceServiceConnection.mjs +35 -0
- package/dist/pyth/PriceServiceConnection.mjs.map +1 -0
- package/dist/pyth/pyth-helpers.mjs +18 -0
- package/dist/pyth/pyth-helpers.mjs.map +1 -0
- package/dist/pyth/pyth.d.mts +69 -0
- package/dist/pyth/pyth.d.mts.map +1 -0
- package/dist/pyth/pyth.mjs +220 -0
- package/dist/pyth/pyth.mjs.map +1 -0
- package/dist/queries/accountQueries.mjs +104 -0
- package/dist/queries/accountQueries.mjs.map +1 -0
- package/dist/queries/balanceManagerQueries.mjs +113 -0
- package/dist/queries/balanceManagerQueries.mjs.map +1 -0
- package/dist/queries/context.mjs +15 -0
- package/dist/queries/context.mjs.map +1 -0
- package/dist/queries/marginManagerQueries.mjs +365 -0
- package/dist/queries/marginManagerQueries.mjs.map +1 -0
- package/dist/queries/marginPoolQueries.mjs +184 -0
- package/dist/queries/marginPoolQueries.mjs.map +1 -0
- package/dist/queries/orderQueries.mjs +165 -0
- package/dist/queries/orderQueries.mjs.map +1 -0
- package/dist/queries/poolQueries.mjs +234 -0
- package/dist/queries/poolQueries.mjs.map +1 -0
- package/dist/queries/priceFeedQueries.mjs +83 -0
- package/dist/queries/priceFeedQueries.mjs.map +1 -0
- package/dist/queries/quantityQueries.mjs +216 -0
- package/dist/queries/quantityQueries.mjs.map +1 -0
- package/dist/queries/referralQueries.mjs +96 -0
- package/dist/queries/referralQueries.mjs.map +1 -0
- package/dist/queries/registryQueries.mjs +162 -0
- package/dist/queries/registryQueries.mjs.map +1 -0
- package/dist/queries/tpslQueries.mjs +62 -0
- package/dist/queries/tpslQueries.mjs.map +1 -0
- package/dist/transactions/balanceManager.d.mts +174 -0
- package/dist/transactions/balanceManager.d.mts.map +1 -0
- package/dist/transactions/balanceManager.mjs +234 -0
- package/dist/transactions/balanceManager.mjs.map +1 -0
- package/dist/transactions/deepbook.d.mts +490 -0
- package/dist/transactions/deepbook.d.mts.map +1 -0
- package/dist/transactions/deepbook.mjs +979 -0
- package/dist/transactions/deepbook.mjs.map +1 -0
- package/dist/transactions/deepbookAdmin.d.mts +111 -0
- package/dist/transactions/deepbookAdmin.d.mts.map +1 -0
- package/dist/transactions/deepbookAdmin.mjs +222 -0
- package/dist/transactions/deepbookAdmin.mjs.map +1 -0
- package/dist/transactions/flashLoans.d.mts +61 -0
- package/dist/transactions/flashLoans.d.mts.map +1 -0
- package/dist/transactions/flashLoans.mjs +77 -0
- package/dist/transactions/flashLoans.mjs.map +1 -0
- package/dist/transactions/governance.d.mts +47 -0
- package/dist/transactions/governance.d.mts.map +1 -0
- package/dist/transactions/governance.mjs +91 -0
- package/dist/transactions/governance.mjs.map +1 -0
- package/dist/transactions/marginAdmin.d.mts +138 -0
- package/dist/transactions/marginAdmin.d.mts.map +1 -0
- package/dist/transactions/marginAdmin.mjs +250 -0
- package/dist/transactions/marginAdmin.mjs.map +1 -0
- package/dist/transactions/marginLiquidations.d.mts +67 -0
- package/dist/transactions/marginLiquidations.d.mts.map +1 -0
- package/dist/transactions/marginLiquidations.mjs +110 -0
- package/dist/transactions/marginLiquidations.mjs.map +1 -0
- package/dist/transactions/marginMaintainer.d.mts +86 -0
- package/dist/transactions/marginMaintainer.d.mts.map +1 -0
- package/dist/transactions/marginMaintainer.mjs +161 -0
- package/dist/transactions/marginMaintainer.mjs.map +1 -0
- package/dist/transactions/marginManager.d.mts +247 -0
- package/dist/transactions/marginManager.d.mts.map +1 -0
- package/dist/transactions/marginManager.mjs +548 -0
- package/dist/transactions/marginManager.mjs.map +1 -0
- package/dist/transactions/marginPool.d.mts +140 -0
- package/dist/transactions/marginPool.d.mts.map +1 -0
- package/dist/transactions/marginPool.mjs +207 -0
- package/dist/transactions/marginPool.mjs.map +1 -0
- package/dist/transactions/marginRegistry.d.mts +100 -0
- package/dist/transactions/marginRegistry.d.mts.map +1 -0
- package/dist/transactions/marginRegistry.mjs +128 -0
- package/dist/transactions/marginRegistry.mjs.map +1 -0
- package/dist/transactions/marginTPSL.d.mts +100 -0
- package/dist/transactions/marginTPSL.d.mts.map +1 -0
- package/dist/transactions/marginTPSL.mjs +173 -0
- package/dist/transactions/marginTPSL.mjs.map +1 -0
- package/dist/transactions/poolProxy.d.mts +123 -0
- package/dist/transactions/poolProxy.d.mts.map +1 -0
- package/dist/transactions/poolProxy.mjs +336 -0
- package/dist/transactions/poolProxy.mjs.map +1 -0
- package/dist/types/bcs.d.mts +5 -0
- package/dist/types/bcs.mjs +7 -0
- package/dist/types/index.d.mts +374 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/index.mjs +18 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/config.d.mts +90 -0
- package/dist/utils/config.d.mts.map +1 -0
- package/dist/utils/config.mjs +104 -0
- package/dist/utils/config.mjs.map +1 -0
- package/dist/utils/constants.d.mts +93 -0
- package/dist/utils/constants.d.mts.map +1 -0
- package/dist/utils/constants.mjs +408 -0
- package/dist/utils/constants.mjs.map +1 -0
- package/dist/utils/conversion.mjs +26 -0
- package/dist/utils/conversion.mjs.map +1 -0
- package/dist/utils/errors.d.mts +46 -0
- package/dist/utils/errors.d.mts.map +1 -0
- package/dist/utils/errors.mjs +59 -0
- package/dist/utils/errors.mjs.map +1 -0
- package/dist/{cjs/utils/validation.d.ts → utils/validation.d.mts} +11 -7
- package/dist/utils/validation.d.mts.map +1 -0
- package/dist/utils/validation.mjs +76 -0
- package/dist/utils/validation.mjs.map +1 -0
- package/package.json +30 -26
- package/src/client.ts +467 -2255
- package/src/contracts/deepbook/account.ts +15 -15
- package/src/contracts/deepbook/balance_manager.ts +343 -57
- package/src/contracts/deepbook/balances.ts +3 -2
- package/src/contracts/deepbook/big_vector.ts +6 -7
- package/src/contracts/deepbook/book.ts +3 -2
- package/src/contracts/deepbook/constants.ts +95 -3
- package/src/contracts/deepbook/deep_price.ts +7 -7
- package/src/contracts/deepbook/deps/{sui → haneul}/bag.ts +8 -8
- package/src/contracts/deepbook/deps/{sui → haneul}/balance.ts +4 -3
- package/src/contracts/deepbook/deps/{sui → haneul}/table.ts +6 -6
- package/src/contracts/deepbook/deps/{sui → haneul}/vec_map.ts +4 -4
- package/src/contracts/deepbook/deps/{sui → haneul}/vec_set.ts +4 -4
- package/src/contracts/deepbook/deps/{sui → haneul}/versioned.ts +4 -4
- package/src/contracts/deepbook/deps/std/type_name.ts +3 -2
- package/src/contracts/deepbook/ewma.ts +14 -3
- package/src/contracts/deepbook/fill.ts +21 -21
- package/src/contracts/deepbook/governance.ts +4 -3
- package/src/contracts/deepbook/history.ts +4 -3
- package/src/contracts/deepbook/math.ts +15 -15
- package/src/contracts/deepbook/order.ts +16 -16
- package/src/contracts/deepbook/order_info.ts +39 -27
- package/src/contracts/deepbook/order_query.ts +12 -12
- package/src/contracts/deepbook/pool.ts +883 -526
- package/src/contracts/deepbook/registry.ts +149 -38
- package/src/contracts/deepbook/state.ts +14 -3
- package/src/contracts/deepbook/trade_params.ts +3 -2
- package/src/contracts/deepbook/vault.ts +5 -4
- package/src/contracts/pyth/batch_price_attestation.ts +92 -0
- package/src/contracts/pyth/contract_upgrade.ts +54 -0
- package/src/contracts/pyth/data_source.ts +64 -0
- package/src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts +15 -0
- package/src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts +13 -0
- package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.ts +12 -0
- package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.ts +13 -0
- package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.ts +13 -0
- package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.ts +12 -0
- package/src/contracts/pyth/deserialize.ts +117 -0
- package/src/contracts/pyth/event.ts +20 -0
- package/src/contracts/pyth/governance.ts +113 -0
- package/src/contracts/pyth/governance_action.ts +130 -0
- package/src/contracts/pyth/governance_instruction.ts +98 -0
- package/src/contracts/pyth/hot_potato_vector.ts +70 -0
- package/src/contracts/pyth/i64.ts +94 -0
- package/src/contracts/pyth/merkle_tree.ts +41 -0
- package/src/contracts/pyth/migrate.ts +29 -0
- package/src/contracts/pyth/price.ts +102 -0
- package/src/contracts/pyth/price_feed.ts +101 -0
- package/src/contracts/pyth/price_identifier.ts +46 -0
- package/src/contracts/pyth/price_info.ts +220 -0
- package/src/contracts/pyth/price_status.ts +74 -0
- package/src/contracts/pyth/pyth.ts +236 -0
- package/src/contracts/pyth/set.ts +93 -0
- package/src/contracts/pyth/set_data_sources.ts +14 -0
- package/src/contracts/pyth/set_fee_recipient.ts +13 -0
- package/src/contracts/pyth/set_governance_data_source.ts +16 -0
- package/src/contracts/pyth/set_stale_price_threshold.ts +13 -0
- package/src/contracts/pyth/set_update_fee.ts +14 -0
- package/src/contracts/pyth/setup.ts +12 -0
- package/src/contracts/pyth/state.ts +227 -0
- package/src/contracts/pyth/version_control.ts +25 -0
- package/src/contracts/utils/index.ts +100 -50
- package/src/contracts/wormhole/bytes32.ts +12 -0
- package/src/contracts/wormhole/consumed_vaas.ts +13 -0
- package/src/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.ts +12 -0
- package/src/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts +15 -0
- package/src/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts +13 -0
- package/src/contracts/wormhole/external_address.ts +13 -0
- package/src/contracts/wormhole/fee_collector.ts +15 -0
- package/src/contracts/wormhole/set.ts +12 -0
- package/src/contracts/wormhole/state.ts +25 -0
- package/src/index.ts +44 -3
- package/src/pyth/pyth.ts +51 -50
- package/src/queries/accountQueries.ts +117 -0
- package/src/queries/balanceManagerQueries.ts +156 -0
- package/src/queries/context.ts +44 -0
- package/src/queries/index.ts +16 -0
- package/src/queries/marginManagerQueries.ts +575 -0
- package/src/queries/marginPoolQueries.ts +226 -0
- package/src/queries/orderQueries.ts +202 -0
- package/src/queries/poolQueries.ts +266 -0
- package/src/queries/priceFeedQueries.ts +141 -0
- package/src/queries/quantityQueries.ts +266 -0
- package/src/queries/referralQueries.ts +112 -0
- package/src/queries/registryQueries.ts +185 -0
- package/src/queries/tpslQueries.ts +88 -0
- package/src/transactions/balanceManager.ts +5 -4
- package/src/transactions/deepbook.ts +117 -84
- package/src/transactions/deepbookAdmin.ts +10 -9
- package/src/transactions/flashLoans.ts +5 -4
- package/src/transactions/governance.ts +5 -4
- package/src/transactions/marginAdmin.ts +12 -8
- package/src/transactions/marginLiquidations.ts +5 -4
- package/src/transactions/marginMaintainer.ts +28 -16
- package/src/transactions/marginManager.ts +78 -29
- package/src/transactions/marginPool.ts +7 -7
- package/src/transactions/marginTPSL.ts +16 -11
- package/src/transactions/poolProxy.ts +62 -11
- package/src/types/bcs.ts +1 -1
- package/src/types/index.ts +217 -53
- package/src/utils/config.ts +38 -17
- package/src/utils/constants.ts +73 -18
- package/src/utils/conversion.ts +33 -0
- package/src/utils/validation.ts +1 -1
- package/dist/cjs/client.d.ts +0 -861
- package/dist/cjs/client.js +0 -1982
- package/dist/cjs/client.js.map +0 -7
- package/dist/cjs/contracts/deepbook/account.d.ts +0 -105
- package/dist/cjs/contracts/deepbook/account.js +0 -163
- package/dist/cjs/contracts/deepbook/account.js.map +0 -7
- package/dist/cjs/contracts/deepbook/balance_manager.d.ts +0 -268
- package/dist/cjs/contracts/deepbook/balance_manager.js +0 -361
- package/dist/cjs/contracts/deepbook/balance_manager.js.map +0 -7
- package/dist/cjs/contracts/deepbook/balances.d.ts +0 -10
- package/dist/cjs/contracts/deepbook/balances.js +0 -35
- package/dist/cjs/contracts/deepbook/balances.js.map +0 -7
- package/dist/cjs/contracts/deepbook/big_vector.d.ts +0 -62
- package/dist/cjs/contracts/deepbook/big_vector.js +0 -80
- package/dist/cjs/contracts/deepbook/big_vector.js.map +0 -7
- package/dist/cjs/contracts/deepbook/book.d.ts +0 -34
- package/dist/cjs/contracts/deepbook/book.js +0 -50
- package/dist/cjs/contracts/deepbook/book.js.map +0 -7
- package/dist/cjs/contracts/deepbook/constants.d.ts +0 -176
- package/dist/cjs/contracts/deepbook/constants.js +0 -338
- package/dist/cjs/contracts/deepbook/constants.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deep_price.d.ts +0 -60
- package/dist/cjs/contracts/deepbook/deep_price.js +0 -87
- package/dist/cjs/contracts/deepbook/deep_price.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/std/type_name.d.ts +0 -14
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js +0 -42
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/bag.d.ts +0 -33
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js +0 -47
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/balance.d.ts +0 -9
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js +0 -33
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/object.d.ts +0 -5
- package/dist/cjs/contracts/deepbook/deps/sui/object.js +0 -33
- package/dist/cjs/contracts/deepbook/deps/sui/object.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/table.d.ts +0 -28
- package/dist/cjs/contracts/deepbook/deps/sui/table.js +0 -47
- package/dist/cjs/contracts/deepbook/deps/sui/table.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.d.ts +0 -27
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js +0 -45
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.d.ts +0 -15
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js +0 -35
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js.map +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.d.ts +0 -7
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js +0 -45
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js.map +0 -7
- package/dist/cjs/contracts/deepbook/ewma.d.ts +0 -17
- package/dist/cjs/contracts/deepbook/ewma.js +0 -39
- package/dist/cjs/contracts/deepbook/ewma.js.map +0 -7
- package/dist/cjs/contracts/deepbook/fill.d.ts +0 -153
- package/dist/cjs/contracts/deepbook/fill.js +0 -251
- package/dist/cjs/contracts/deepbook/fill.js.map +0 -7
- package/dist/cjs/contracts/deepbook/governance.d.ts +0 -63
- package/dist/cjs/contracts/deepbook/governance.js +0 -79
- package/dist/cjs/contracts/deepbook/governance.js.map +0 -7
- package/dist/cjs/contracts/deepbook/history.d.ts +0 -60
- package/dist/cjs/contracts/deepbook/history.js +0 -78
- package/dist/cjs/contracts/deepbook/history.js.map +0 -7
- package/dist/cjs/contracts/deepbook/math.d.ts +0 -94
- package/dist/cjs/contracts/deepbook/math.js +0 -132
- package/dist/cjs/contracts/deepbook/math.js.map +0 -7
- package/dist/cjs/contracts/deepbook/order.d.ts +0 -135
- package/dist/cjs/contracts/deepbook/order.js +0 -218
- package/dist/cjs/contracts/deepbook/order.js.map +0 -7
- package/dist/cjs/contracts/deepbook/order_info.d.ts +0 -296
- package/dist/cjs/contracts/deepbook/order_info.js +0 -386
- package/dist/cjs/contracts/deepbook/order_info.js.map +0 -7
- package/dist/cjs/contracts/deepbook/order_query.d.ts +0 -85
- package/dist/cjs/contracts/deepbook/order_query.js +0 -96
- package/dist/cjs/contracts/deepbook/order_query.js.map +0 -7
- package/dist/cjs/contracts/deepbook/pool.d.ts +0 -1218
- package/dist/cjs/contracts/deepbook/pool.js +0 -1236
- package/dist/cjs/contracts/deepbook/pool.js.map +0 -7
- package/dist/cjs/contracts/deepbook/registry.d.ts +0 -134
- package/dist/cjs/contracts/deepbook/registry.js +0 -182
- package/dist/cjs/contracts/deepbook/registry.js.map +0 -7
- package/dist/cjs/contracts/deepbook/state.d.ts +0 -117
- package/dist/cjs/contracts/deepbook/state.js +0 -104
- package/dist/cjs/contracts/deepbook/state.js.map +0 -7
- package/dist/cjs/contracts/deepbook/trade_params.d.ts +0 -7
- package/dist/cjs/contracts/deepbook/trade_params.js +0 -35
- package/dist/cjs/contracts/deepbook/trade_params.js.map +0 -7
- package/dist/cjs/contracts/deepbook/vault.d.ts +0 -30
- package/dist/cjs/contracts/deepbook/vault.js +0 -65
- package/dist/cjs/contracts/deepbook/vault.js.map +0 -7
- package/dist/cjs/contracts/utils/index.d.ts +0 -25
- package/dist/cjs/contracts/utils/index.js +0 -148
- package/dist/cjs/contracts/utils/index.js.map +0 -7
- package/dist/cjs/index.d.ts +0 -23
- package/dist/cjs/index.js +0 -81
- package/dist/cjs/index.js.map +0 -7
- package/dist/cjs/package.json +0 -4
- package/dist/cjs/pyth/PriceServiceConnection.d.ts +0 -26
- package/dist/cjs/pyth/PriceServiceConnection.js +0 -68
- package/dist/cjs/pyth/PriceServiceConnection.js.map +0 -7
- package/dist/cjs/pyth/pyth-helpers.d.ts +0 -7
- package/dist/cjs/pyth/pyth-helpers.js +0 -36
- package/dist/cjs/pyth/pyth-helpers.js.map +0 -7
- package/dist/cjs/pyth/pyth.d.ts +0 -65
- package/dist/cjs/pyth/pyth.js +0 -269
- package/dist/cjs/pyth/pyth.js.map +0 -7
- package/dist/cjs/transactions/balanceManager.d.ts +0 -168
- package/dist/cjs/transactions/balanceManager.js +0 -384
- package/dist/cjs/transactions/balanceManager.js.map +0 -7
- package/dist/cjs/transactions/deepbook.d.ts +0 -477
- package/dist/cjs/transactions/deepbook.js +0 -1335
- package/dist/cjs/transactions/deepbook.js.map +0 -7
- package/dist/cjs/transactions/deepbookAdmin.d.ts +0 -105
- package/dist/cjs/transactions/deepbookAdmin.js +0 -334
- package/dist/cjs/transactions/deepbookAdmin.js.map +0 -7
- package/dist/cjs/transactions/flashLoans.d.ts +0 -56
- package/dist/cjs/transactions/flashLoans.js +0 -124
- package/dist/cjs/transactions/flashLoans.js.map +0 -7
- package/dist/cjs/transactions/governance.d.ts +0 -42
- package/dist/cjs/transactions/governance.js +0 -135
- package/dist/cjs/transactions/governance.js.map +0 -7
- package/dist/cjs/transactions/marginAdmin.d.ts +0 -133
- package/dist/cjs/transactions/marginAdmin.js +0 -393
- package/dist/cjs/transactions/marginAdmin.js.map +0 -7
- package/dist/cjs/transactions/marginLiquidations.d.ts +0 -61
- package/dist/cjs/transactions/marginLiquidations.js +0 -173
- package/dist/cjs/transactions/marginLiquidations.js.map +0 -7
- package/dist/cjs/transactions/marginMaintainer.d.ts +0 -80
- package/dist/cjs/transactions/marginMaintainer.js +0 -251
- package/dist/cjs/transactions/marginMaintainer.js.map +0 -7
- package/dist/cjs/transactions/marginManager.d.ts +0 -236
- package/dist/cjs/transactions/marginManager.js +0 -688
- package/dist/cjs/transactions/marginManager.js.map +0 -7
- package/dist/cjs/transactions/marginPool.d.ts +0 -134
- package/dist/cjs/transactions/marginPool.js +0 -330
- package/dist/cjs/transactions/marginPool.js.map +0 -7
- package/dist/cjs/transactions/marginRegistry.d.ts +0 -94
- package/dist/cjs/transactions/marginRegistry.js +0 -221
- package/dist/cjs/transactions/marginRegistry.js.map +0 -7
- package/dist/cjs/transactions/marginTPSL.d.ts +0 -93
- package/dist/cjs/transactions/marginTPSL.js +0 -286
- package/dist/cjs/transactions/marginTPSL.js.map +0 -7
- package/dist/cjs/transactions/poolProxy.d.ts +0 -104
- package/dist/cjs/transactions/poolProxy.js +0 -435
- package/dist/cjs/transactions/poolProxy.js.map +0 -7
- package/dist/cjs/types/bcs.d.ts +0 -5
- package/dist/cjs/types/bcs.js +0 -33
- package/dist/cjs/types/bcs.js.map +0 -7
- package/dist/cjs/types/index.d.ts +0 -218
- package/dist/cjs/types/index.js +0 -38
- package/dist/cjs/types/index.js.map +0 -7
- package/dist/cjs/utils/config.d.ts +0 -65
- package/dist/cjs/utils/config.js +0 -144
- package/dist/cjs/utils/config.js.map +0 -7
- package/dist/cjs/utils/constants.d.ts +0 -76
- package/dist/cjs/utils/constants.js +0 -382
- package/dist/cjs/utils/constants.js.map +0 -7
- package/dist/cjs/utils/errors.d.ts +0 -42
- package/dist/cjs/utils/errors.js +0 -70
- package/dist/cjs/utils/errors.js.map +0 -7
- package/dist/cjs/utils/validation.js +0 -67
- package/dist/cjs/utils/validation.js.map +0 -7
- package/dist/esm/client.d.ts +0 -861
- package/dist/esm/client.js +0 -1967
- package/dist/esm/client.js.map +0 -7
- package/dist/esm/contracts/deepbook/account.d.ts +0 -105
- package/dist/esm/contracts/deepbook/account.js +0 -133
- package/dist/esm/contracts/deepbook/account.js.map +0 -7
- package/dist/esm/contracts/deepbook/balance_manager.d.ts +0 -268
- package/dist/esm/contracts/deepbook/balance_manager.js +0 -331
- package/dist/esm/contracts/deepbook/balance_manager.js.map +0 -7
- package/dist/esm/contracts/deepbook/balances.d.ts +0 -10
- package/dist/esm/contracts/deepbook/balances.js +0 -15
- package/dist/esm/contracts/deepbook/balances.js.map +0 -7
- package/dist/esm/contracts/deepbook/big_vector.d.ts +0 -62
- package/dist/esm/contracts/deepbook/big_vector.js +0 -50
- package/dist/esm/contracts/deepbook/big_vector.js.map +0 -7
- package/dist/esm/contracts/deepbook/book.d.ts +0 -34
- package/dist/esm/contracts/deepbook/book.js +0 -20
- package/dist/esm/contracts/deepbook/book.js.map +0 -7
- package/dist/esm/contracts/deepbook/constants.d.ts +0 -176
- package/dist/esm/contracts/deepbook/constants.js +0 -318
- package/dist/esm/contracts/deepbook/constants.js.map +0 -7
- package/dist/esm/contracts/deepbook/deep_price.d.ts +0 -60
- package/dist/esm/contracts/deepbook/deep_price.js +0 -67
- package/dist/esm/contracts/deepbook/deep_price.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/std/type_name.d.ts +0 -14
- package/dist/esm/contracts/deepbook/deps/std/type_name.js +0 -22
- package/dist/esm/contracts/deepbook/deps/std/type_name.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/bag.d.ts +0 -33
- package/dist/esm/contracts/deepbook/deps/sui/bag.js +0 -17
- package/dist/esm/contracts/deepbook/deps/sui/bag.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/balance.d.ts +0 -9
- package/dist/esm/contracts/deepbook/deps/sui/balance.js +0 -13
- package/dist/esm/contracts/deepbook/deps/sui/balance.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/object.d.ts +0 -5
- package/dist/esm/contracts/deepbook/deps/sui/object.js +0 -13
- package/dist/esm/contracts/deepbook/deps/sui/object.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/table.d.ts +0 -28
- package/dist/esm/contracts/deepbook/deps/sui/table.js +0 -17
- package/dist/esm/contracts/deepbook/deps/sui/table.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.d.ts +0 -27
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js +0 -25
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.d.ts +0 -15
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js +0 -15
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js.map +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/versioned.d.ts +0 -7
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js +0 -15
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js.map +0 -7
- package/dist/esm/contracts/deepbook/ewma.d.ts +0 -17
- package/dist/esm/contracts/deepbook/ewma.js +0 -19
- package/dist/esm/contracts/deepbook/ewma.js.map +0 -7
- package/dist/esm/contracts/deepbook/fill.d.ts +0 -153
- package/dist/esm/contracts/deepbook/fill.js +0 -221
- package/dist/esm/contracts/deepbook/fill.js.map +0 -7
- package/dist/esm/contracts/deepbook/governance.d.ts +0 -63
- package/dist/esm/contracts/deepbook/governance.js +0 -49
- package/dist/esm/contracts/deepbook/governance.js.map +0 -7
- package/dist/esm/contracts/deepbook/history.d.ts +0 -60
- package/dist/esm/contracts/deepbook/history.js +0 -48
- package/dist/esm/contracts/deepbook/history.js.map +0 -7
- package/dist/esm/contracts/deepbook/math.d.ts +0 -94
- package/dist/esm/contracts/deepbook/math.js +0 -112
- package/dist/esm/contracts/deepbook/math.js.map +0 -7
- package/dist/esm/contracts/deepbook/order.d.ts +0 -135
- package/dist/esm/contracts/deepbook/order.js +0 -188
- package/dist/esm/contracts/deepbook/order.js.map +0 -7
- package/dist/esm/contracts/deepbook/order_info.d.ts +0 -296
- package/dist/esm/contracts/deepbook/order_info.js +0 -356
- package/dist/esm/contracts/deepbook/order_info.js.map +0 -7
- package/dist/esm/contracts/deepbook/order_query.d.ts +0 -85
- package/dist/esm/contracts/deepbook/order_query.js +0 -66
- package/dist/esm/contracts/deepbook/order_query.js.map +0 -7
- package/dist/esm/contracts/deepbook/pool.d.ts +0 -1218
- package/dist/esm/contracts/deepbook/pool.js +0 -1206
- package/dist/esm/contracts/deepbook/pool.js.map +0 -7
- package/dist/esm/contracts/deepbook/registry.d.ts +0 -134
- package/dist/esm/contracts/deepbook/registry.js +0 -152
- package/dist/esm/contracts/deepbook/registry.js.map +0 -7
- package/dist/esm/contracts/deepbook/state.d.ts +0 -117
- package/dist/esm/contracts/deepbook/state.js +0 -74
- package/dist/esm/contracts/deepbook/state.js.map +0 -7
- package/dist/esm/contracts/deepbook/trade_params.d.ts +0 -7
- package/dist/esm/contracts/deepbook/trade_params.js +0 -15
- package/dist/esm/contracts/deepbook/trade_params.js.map +0 -7
- package/dist/esm/contracts/deepbook/vault.d.ts +0 -30
- package/dist/esm/contracts/deepbook/vault.js +0 -35
- package/dist/esm/contracts/deepbook/vault.js.map +0 -7
- package/dist/esm/contracts/utils/index.d.ts +0 -25
- package/dist/esm/contracts/utils/index.js +0 -128
- package/dist/esm/contracts/utils/index.js.map +0 -7
- package/dist/esm/index.d.ts +0 -23
- package/dist/esm/index.js +0 -81
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/package.json +0 -4
- package/dist/esm/pyth/PriceServiceConnection.d.ts +0 -26
- package/dist/esm/pyth/PriceServiceConnection.js +0 -38
- package/dist/esm/pyth/PriceServiceConnection.js.map +0 -7
- package/dist/esm/pyth/pyth-helpers.d.ts +0 -7
- package/dist/esm/pyth/pyth-helpers.js +0 -16
- package/dist/esm/pyth/pyth-helpers.js.map +0 -7
- package/dist/esm/pyth/pyth.d.ts +0 -65
- package/dist/esm/pyth/pyth.js +0 -249
- package/dist/esm/pyth/pyth.js.map +0 -7
- package/dist/esm/transactions/balanceManager.d.ts +0 -168
- package/dist/esm/transactions/balanceManager.js +0 -364
- package/dist/esm/transactions/balanceManager.js.map +0 -7
- package/dist/esm/transactions/deepbook.d.ts +0 -477
- package/dist/esm/transactions/deepbook.js +0 -1321
- package/dist/esm/transactions/deepbook.js.map +0 -7
- package/dist/esm/transactions/deepbookAdmin.d.ts +0 -105
- package/dist/esm/transactions/deepbookAdmin.js +0 -314
- package/dist/esm/transactions/deepbookAdmin.js.map +0 -7
- package/dist/esm/transactions/flashLoans.d.ts +0 -56
- package/dist/esm/transactions/flashLoans.js +0 -104
- package/dist/esm/transactions/flashLoans.js.map +0 -7
- package/dist/esm/transactions/governance.d.ts +0 -42
- package/dist/esm/transactions/governance.js +0 -115
- package/dist/esm/transactions/governance.js.map +0 -7
- package/dist/esm/transactions/marginAdmin.d.ts +0 -133
- package/dist/esm/transactions/marginAdmin.js +0 -373
- package/dist/esm/transactions/marginAdmin.js.map +0 -7
- package/dist/esm/transactions/marginLiquidations.d.ts +0 -61
- package/dist/esm/transactions/marginLiquidations.js +0 -153
- package/dist/esm/transactions/marginLiquidations.js.map +0 -7
- package/dist/esm/transactions/marginMaintainer.d.ts +0 -80
- package/dist/esm/transactions/marginMaintainer.js +0 -231
- package/dist/esm/transactions/marginMaintainer.js.map +0 -7
- package/dist/esm/transactions/marginManager.d.ts +0 -236
- package/dist/esm/transactions/marginManager.js +0 -668
- package/dist/esm/transactions/marginManager.js.map +0 -7
- package/dist/esm/transactions/marginPool.d.ts +0 -134
- package/dist/esm/transactions/marginPool.js +0 -310
- package/dist/esm/transactions/marginPool.js.map +0 -7
- package/dist/esm/transactions/marginRegistry.d.ts +0 -94
- package/dist/esm/transactions/marginRegistry.js +0 -201
- package/dist/esm/transactions/marginRegistry.js.map +0 -7
- package/dist/esm/transactions/marginTPSL.d.ts +0 -93
- package/dist/esm/transactions/marginTPSL.js +0 -266
- package/dist/esm/transactions/marginTPSL.js.map +0 -7
- package/dist/esm/transactions/poolProxy.d.ts +0 -104
- package/dist/esm/transactions/poolProxy.js +0 -415
- package/dist/esm/transactions/poolProxy.js.map +0 -7
- package/dist/esm/types/bcs.d.ts +0 -5
- package/dist/esm/types/bcs.js +0 -13
- package/dist/esm/types/bcs.js.map +0 -7
- package/dist/esm/types/index.d.ts +0 -218
- package/dist/esm/types/index.js +0 -18
- package/dist/esm/types/index.js.map +0 -7
- package/dist/esm/utils/config.d.ts +0 -65
- package/dist/esm/utils/config.js +0 -135
- package/dist/esm/utils/config.js.map +0 -7
- package/dist/esm/utils/constants.d.ts +0 -76
- package/dist/esm/utils/constants.js +0 -362
- package/dist/esm/utils/constants.js.map +0 -7
- package/dist/esm/utils/errors.d.ts +0 -42
- package/dist/esm/utils/errors.js +0 -50
- package/dist/esm/utils/errors.js.map +0 -7
- package/dist/esm/utils/validation.d.ts +0 -50
- package/dist/esm/utils/validation.js +0 -47
- package/dist/esm/utils/validation.js.map +0 -7
- package/dist/tsconfig.esm.tsbuildinfo +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/src/contracts/deepbook/deps/sui/object.ts +0 -14
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { AccountInfo, BalanceManager, BaseQuantityIn, BaseQuantityOut, BorrowedShares, CanPlaceLimitOrderParams, CanPlaceMarketOrderParams, DecodedOrderId, Level2Range, Level2TicksFromMid, LockedBalances, ManagerBalance, MarginManager, MarginManagerAssets, MarginManagerBalancesResult, MarginManagerDebts, MarginManagerState, OrderDeepRequiredResult, PoolBookParams, PoolDeepPrice, PoolTradeParams, QuantityOut, QuoteQuantityIn, QuoteQuantityOut, ReferralBalances, VaultBalances } from "./types/index.mjs";
|
|
2
|
+
import { CoinMap, DeepbookPackageIds, PoolMap } from "./utils/constants.mjs";
|
|
3
|
+
import { BalanceManagerContract } from "./transactions/balanceManager.mjs";
|
|
4
|
+
import { DeepBookContract } from "./transactions/deepbook.mjs";
|
|
5
|
+
import { DeepBookAdminContract } from "./transactions/deepbookAdmin.mjs";
|
|
6
|
+
import { FlashLoanContract } from "./transactions/flashLoans.mjs";
|
|
7
|
+
import { GovernanceContract } from "./transactions/governance.mjs";
|
|
8
|
+
import { MarginAdminContract } from "./transactions/marginAdmin.mjs";
|
|
9
|
+
import { MarginLiquidationsContract } from "./transactions/marginLiquidations.mjs";
|
|
10
|
+
import { MarginMaintainerContract } from "./transactions/marginMaintainer.mjs";
|
|
11
|
+
import { MarginManagerContract } from "./transactions/marginManager.mjs";
|
|
12
|
+
import { MarginPoolContract } from "./transactions/marginPool.mjs";
|
|
13
|
+
import { MarginRegistryContract } from "./transactions/marginRegistry.mjs";
|
|
14
|
+
import { MarginTPSLContract } from "./transactions/marginTPSL.mjs";
|
|
15
|
+
import { PoolProxyContract } from "./transactions/poolProxy.mjs";
|
|
16
|
+
import { Transaction } from "@haneullabs/haneul/transactions";
|
|
17
|
+
import { ClientWithCoreApi, HaneulClientRegistration, HaneulClientTypes } from "@haneullabs/haneul/client";
|
|
18
|
+
|
|
19
|
+
//#region src/client.d.ts
|
|
20
|
+
interface DeepBookCompatibleClient extends ClientWithCoreApi {}
|
|
21
|
+
interface DeepBookOptions<Name = 'deepbook'> {
|
|
22
|
+
address: string;
|
|
23
|
+
balanceManagers?: {
|
|
24
|
+
[key: string]: BalanceManager;
|
|
25
|
+
};
|
|
26
|
+
marginManagers?: {
|
|
27
|
+
[key: string]: MarginManager;
|
|
28
|
+
};
|
|
29
|
+
coins?: CoinMap;
|
|
30
|
+
pools?: PoolMap;
|
|
31
|
+
adminCap?: string;
|
|
32
|
+
marginAdminCap?: string;
|
|
33
|
+
marginMaintainerCap?: string;
|
|
34
|
+
packageIds?: DeepbookPackageIds;
|
|
35
|
+
pyth?: {
|
|
36
|
+
pythStateId: string;
|
|
37
|
+
wormholeStateId: string;
|
|
38
|
+
};
|
|
39
|
+
name?: Name;
|
|
40
|
+
}
|
|
41
|
+
interface DeepBookClientOptions extends DeepBookOptions {
|
|
42
|
+
client: DeepBookCompatibleClient;
|
|
43
|
+
network: HaneulClientTypes.Network;
|
|
44
|
+
}
|
|
45
|
+
declare function deepbook<Name extends string = 'deepbook'>({
|
|
46
|
+
name,
|
|
47
|
+
...options
|
|
48
|
+
}: DeepBookOptions<Name>): HaneulClientRegistration<DeepBookCompatibleClient, Name, DeepBookClient>;
|
|
49
|
+
/**
|
|
50
|
+
* DeepBookClient class for managing DeepBook operations.
|
|
51
|
+
*/
|
|
52
|
+
declare class DeepBookClient {
|
|
53
|
+
#private;
|
|
54
|
+
balanceManager: BalanceManagerContract;
|
|
55
|
+
deepBook: DeepBookContract;
|
|
56
|
+
deepBookAdmin: DeepBookAdminContract;
|
|
57
|
+
flashLoans: FlashLoanContract;
|
|
58
|
+
governance: GovernanceContract;
|
|
59
|
+
marginAdmin: MarginAdminContract;
|
|
60
|
+
marginMaintainer: MarginMaintainerContract;
|
|
61
|
+
marginPool: MarginPoolContract;
|
|
62
|
+
marginManager: MarginManagerContract;
|
|
63
|
+
marginRegistry: MarginRegistryContract;
|
|
64
|
+
marginLiquidations: MarginLiquidationsContract;
|
|
65
|
+
poolProxy: PoolProxyContract;
|
|
66
|
+
marginTPSL: MarginTPSLContract;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new DeepBookClient instance
|
|
69
|
+
*/
|
|
70
|
+
constructor({
|
|
71
|
+
client,
|
|
72
|
+
address,
|
|
73
|
+
network,
|
|
74
|
+
balanceManagers,
|
|
75
|
+
marginManagers,
|
|
76
|
+
coins,
|
|
77
|
+
pools,
|
|
78
|
+
adminCap,
|
|
79
|
+
marginAdminCap,
|
|
80
|
+
marginMaintainerCap,
|
|
81
|
+
packageIds,
|
|
82
|
+
pyth
|
|
83
|
+
}: DeepBookClientOptions);
|
|
84
|
+
checkManagerBalance(managerKey: string, coinKey: string): Promise<ManagerBalance>;
|
|
85
|
+
checkManagerBalanceWithAddress(managerAddress: string, coinKey: string): Promise<ManagerBalance>;
|
|
86
|
+
checkManagerBalancesWithAddress(managerAddresses: string[], coinKeys: string[]): Promise<Record<string, Record<string, number>>>;
|
|
87
|
+
getBalanceManagerIds(owner: string): Promise<string[]>;
|
|
88
|
+
accountExists(poolKey: string, managerKey: string): Promise<boolean>;
|
|
89
|
+
whitelisted(poolKey: string): Promise<boolean>;
|
|
90
|
+
vaultBalances(poolKey: string): Promise<VaultBalances>;
|
|
91
|
+
getPoolIdByAssets(baseType: string, quoteType: string): Promise<string>;
|
|
92
|
+
midPrice(poolKey: string): Promise<number>;
|
|
93
|
+
poolTradeParams(poolKey: string): Promise<PoolTradeParams>;
|
|
94
|
+
poolBookParams(poolKey: string): Promise<PoolBookParams>;
|
|
95
|
+
stablePool(poolKey: string): Promise<boolean>;
|
|
96
|
+
registeredPool(poolKey: string): Promise<boolean>;
|
|
97
|
+
poolTradeParamsNext(poolKey: string): Promise<PoolTradeParams>;
|
|
98
|
+
quorum(poolKey: string): Promise<number>;
|
|
99
|
+
poolId(poolKey: string): Promise<string>;
|
|
100
|
+
canPlaceLimitOrder(params: CanPlaceLimitOrderParams): Promise<boolean>;
|
|
101
|
+
canPlaceMarketOrder(params: CanPlaceMarketOrderParams): Promise<boolean>;
|
|
102
|
+
checkMarketOrderParams(poolKey: string, quantity: number | bigint): Promise<boolean>;
|
|
103
|
+
checkLimitOrderParams(poolKey: string, price: number | bigint, quantity: number | bigint, expireTimestamp: number): Promise<boolean>;
|
|
104
|
+
getQuoteQuantityOut(poolKey: string, baseQuantity: number | bigint): Promise<QuoteQuantityOut>;
|
|
105
|
+
getBaseQuantityOut(poolKey: string, quoteQuantity: number | bigint): Promise<BaseQuantityOut>;
|
|
106
|
+
getQuantityOut(poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint): Promise<QuantityOut>;
|
|
107
|
+
getQuoteQuantityOutInputFee(poolKey: string, baseQuantity: number | bigint): Promise<QuoteQuantityOut>;
|
|
108
|
+
getBaseQuantityOutInputFee(poolKey: string, quoteQuantity: number | bigint): Promise<BaseQuantityOut>;
|
|
109
|
+
getQuantityOutInputFee(poolKey: string, baseQuantity: number | bigint, quoteQuantity: number | bigint): Promise<QuantityOut>;
|
|
110
|
+
getBaseQuantityIn(poolKey: string, targetQuoteQuantity: number | bigint, payWithDeep: boolean): Promise<BaseQuantityIn>;
|
|
111
|
+
getQuoteQuantityIn(poolKey: string, targetBaseQuantity: number | bigint, payWithDeep: boolean): Promise<QuoteQuantityIn>;
|
|
112
|
+
getOrderDeepRequired(poolKey: string, baseQuantity: number | bigint, price: number | bigint): Promise<OrderDeepRequiredResult>;
|
|
113
|
+
accountOpenOrders(poolKey: string, managerKey: string): Promise<string[]>;
|
|
114
|
+
getOrder(poolKey: string, orderId: string): Promise<{
|
|
115
|
+
balance_manager_id: string;
|
|
116
|
+
order_id: string;
|
|
117
|
+
client_order_id: string;
|
|
118
|
+
quantity: string;
|
|
119
|
+
filled_quantity: string;
|
|
120
|
+
fee_is_deep: boolean;
|
|
121
|
+
order_deep_price: {
|
|
122
|
+
asset_is_base: boolean;
|
|
123
|
+
deep_per_asset: string;
|
|
124
|
+
};
|
|
125
|
+
epoch: string;
|
|
126
|
+
status: number;
|
|
127
|
+
expire_timestamp: string;
|
|
128
|
+
} | null>;
|
|
129
|
+
getOrderNormalized(poolKey: string, orderId: string): Promise<{
|
|
130
|
+
quantity: string;
|
|
131
|
+
filled_quantity: string;
|
|
132
|
+
order_deep_price: {
|
|
133
|
+
deep_per_asset: string;
|
|
134
|
+
asset_is_base: boolean;
|
|
135
|
+
};
|
|
136
|
+
isBid: boolean;
|
|
137
|
+
normalized_price: string;
|
|
138
|
+
balance_manager_id: string;
|
|
139
|
+
order_id: string;
|
|
140
|
+
client_order_id: string;
|
|
141
|
+
fee_is_deep: boolean;
|
|
142
|
+
epoch: string;
|
|
143
|
+
status: number;
|
|
144
|
+
expire_timestamp: string;
|
|
145
|
+
} | null>;
|
|
146
|
+
getOrders(poolKey: string, orderIds: string[]): Promise<{
|
|
147
|
+
balance_manager_id: string;
|
|
148
|
+
order_id: string;
|
|
149
|
+
client_order_id: string;
|
|
150
|
+
quantity: string;
|
|
151
|
+
filled_quantity: string;
|
|
152
|
+
fee_is_deep: boolean;
|
|
153
|
+
order_deep_price: {
|
|
154
|
+
asset_is_base: boolean;
|
|
155
|
+
deep_per_asset: string;
|
|
156
|
+
};
|
|
157
|
+
epoch: string;
|
|
158
|
+
status: number;
|
|
159
|
+
expire_timestamp: string;
|
|
160
|
+
}[] | null>;
|
|
161
|
+
getLevel2Range(poolKey: string, priceLow: number | bigint, priceHigh: number | bigint, isBid: boolean): Promise<Level2Range>;
|
|
162
|
+
getLevel2TicksFromMid(poolKey: string, ticks: number): Promise<Level2TicksFromMid>;
|
|
163
|
+
getAccountOrderDetails(poolKey: string, managerKey: string): Promise<[] | {
|
|
164
|
+
balance_manager_id: string;
|
|
165
|
+
order_id: string;
|
|
166
|
+
client_order_id: string;
|
|
167
|
+
quantity: string;
|
|
168
|
+
filled_quantity: string;
|
|
169
|
+
fee_is_deep: boolean;
|
|
170
|
+
order_deep_price: {
|
|
171
|
+
asset_is_base: boolean;
|
|
172
|
+
deep_per_asset: string;
|
|
173
|
+
};
|
|
174
|
+
epoch: string;
|
|
175
|
+
status: number;
|
|
176
|
+
expire_timestamp: string;
|
|
177
|
+
}[]>;
|
|
178
|
+
account(poolKey: string, managerKey: string): Promise<AccountInfo>;
|
|
179
|
+
lockedBalance(poolKey: string, balanceManagerKey: string): Promise<LockedBalances>;
|
|
180
|
+
getPoolDeepPrice(poolKey: string): Promise<PoolDeepPrice>;
|
|
181
|
+
balanceManagerReferralOwner(referral: string): Promise<string>;
|
|
182
|
+
getPoolReferralBalances(poolKey: string, referral: string): Promise<ReferralBalances>;
|
|
183
|
+
balanceManagerReferralPoolId(referral: string): Promise<string>;
|
|
184
|
+
poolReferralMultiplier(poolKey: string, referral: string): Promise<number>;
|
|
185
|
+
getBalanceManagerReferralId(managerKey: string, poolKey: string): Promise<string | null>;
|
|
186
|
+
getPriceInfoObject(tx: Transaction, coinKey: string): Promise<string>;
|
|
187
|
+
getPriceInfoObjects(tx: Transaction, coinKeys: string[]): Promise<Record<string, string>>;
|
|
188
|
+
getPriceInfoObjectAge(coinKey: string): Promise<number>;
|
|
189
|
+
getMarginPoolId(coinKey: string): Promise<string>;
|
|
190
|
+
isDeepbookPoolAllowed(coinKey: string, deepbookPoolId: string): Promise<boolean>;
|
|
191
|
+
getMarginPoolTotalSupply(coinKey: string, decimals?: number): Promise<string>;
|
|
192
|
+
getMarginPoolSupplyShares(coinKey: string, decimals?: number): Promise<string>;
|
|
193
|
+
getMarginPoolTotalBorrow(coinKey: string, decimals?: number): Promise<string>;
|
|
194
|
+
getMarginPoolBorrowShares(coinKey: string, decimals?: number): Promise<string>;
|
|
195
|
+
getMarginPoolLastUpdateTimestamp(coinKey: string): Promise<number>;
|
|
196
|
+
getMarginPoolSupplyCap(coinKey: string, decimals?: number): Promise<string>;
|
|
197
|
+
getMarginPoolMaxUtilizationRate(coinKey: string): Promise<number>;
|
|
198
|
+
getMarginPoolProtocolSpread(coinKey: string): Promise<number>;
|
|
199
|
+
getMarginPoolMinBorrow(coinKey: string, decimals?: number): Promise<string>;
|
|
200
|
+
getMarginPoolInterestRate(coinKey: string): Promise<number>;
|
|
201
|
+
getUserSupplyShares(coinKey: string, supplierCapId: string, decimals?: number): Promise<string>;
|
|
202
|
+
getUserSupplyAmount(coinKey: string, supplierCapId: string, decimals?: number): Promise<string>;
|
|
203
|
+
getMarginManagerOwner(marginManagerKey: string): Promise<string>;
|
|
204
|
+
getMarginManagerDeepbookPool(marginManagerKey: string): Promise<string>;
|
|
205
|
+
getMarginManagerMarginPoolId(marginManagerKey: string): Promise<string | null>;
|
|
206
|
+
getMarginManagerBorrowedShares(marginManagerKey: string): Promise<BorrowedShares>;
|
|
207
|
+
getMarginManagerBorrowedBaseShares(marginManagerKey: string): Promise<string>;
|
|
208
|
+
getMarginManagerBorrowedQuoteShares(marginManagerKey: string): Promise<string>;
|
|
209
|
+
getMarginManagerHasBaseDebt(marginManagerKey: string): Promise<boolean>;
|
|
210
|
+
getMarginManagerBalanceManagerId(marginManagerAddress: string): Promise<string>;
|
|
211
|
+
getMarginManagerAssets(marginManagerKey: string, decimals?: number): Promise<MarginManagerAssets>;
|
|
212
|
+
getMarginManagerDebts(marginManagerKey: string, decimals?: number): Promise<MarginManagerDebts>;
|
|
213
|
+
getMarginManagerState(marginManagerKey: string, decimals?: number): Promise<MarginManagerState>;
|
|
214
|
+
getMarginManagerStates(marginManagers: Record<string, string>, decimals?: number): Promise<Record<string, MarginManagerState>>;
|
|
215
|
+
getMarginManagerBaseBalance(marginManagerKey: string, decimals?: number): Promise<string>;
|
|
216
|
+
getMarginManagerQuoteBalance(marginManagerKey: string, decimals?: number): Promise<string>;
|
|
217
|
+
getMarginManagerDeepBalance(marginManagerKey: string, decimals?: number): Promise<string>;
|
|
218
|
+
getMarginManagerBalances(marginManagers: Record<string, string>, decimals?: number): Promise<Record<string, MarginManagerBalancesResult>>;
|
|
219
|
+
getConditionalOrderIds(marginManagerKey: string): Promise<string[]>;
|
|
220
|
+
getLowestTriggerAbovePrice(marginManagerKey: string): Promise<bigint>;
|
|
221
|
+
getHighestTriggerBelowPrice(marginManagerKey: string): Promise<bigint>;
|
|
222
|
+
isPoolEnabledForMargin(poolKey: string): Promise<boolean>;
|
|
223
|
+
getMarginManagerIdsForOwner(owner: string): Promise<string[]>;
|
|
224
|
+
getBaseMarginPoolId(poolKey: string): Promise<string>;
|
|
225
|
+
getQuoteMarginPoolId(poolKey: string): Promise<string>;
|
|
226
|
+
getMinWithdrawRiskRatio(poolKey: string): Promise<number>;
|
|
227
|
+
getMinBorrowRiskRatio(poolKey: string): Promise<number>;
|
|
228
|
+
getLiquidationRiskRatio(poolKey: string): Promise<number>;
|
|
229
|
+
getTargetLiquidationRiskRatio(poolKey: string): Promise<number>;
|
|
230
|
+
getUserLiquidationReward(poolKey: string): Promise<number>;
|
|
231
|
+
getPoolLiquidationReward(poolKey: string): Promise<number>;
|
|
232
|
+
getAllowedMaintainers(): Promise<string[]>;
|
|
233
|
+
getAllowedPauseCaps(): Promise<string[]>;
|
|
234
|
+
decodeOrderId(encodedOrderId: bigint): DecodedOrderId;
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
export { DeepBookClient, DeepBookClientOptions, DeepBookCompatibleClient, DeepBookOptions, deepbook };
|
|
238
|
+
//# sourceMappingURL=client.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":"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"}
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { BalanceManagerContract } from "./transactions/balanceManager.mjs";
|
|
2
|
+
import { DeepBookConfig } from "./utils/config.mjs";
|
|
3
|
+
import { AccountQueries } from "./queries/accountQueries.mjs";
|
|
4
|
+
import { BalanceManagerQueries } from "./queries/balanceManagerQueries.mjs";
|
|
5
|
+
import { MarginManagerQueries } from "./queries/marginManagerQueries.mjs";
|
|
6
|
+
import { MarginPoolQueries } from "./queries/marginPoolQueries.mjs";
|
|
7
|
+
import { OrderQueries } from "./queries/orderQueries.mjs";
|
|
8
|
+
import { PoolQueries } from "./queries/poolQueries.mjs";
|
|
9
|
+
import { PriceFeedQueries } from "./queries/priceFeedQueries.mjs";
|
|
10
|
+
import { QuantityQueries } from "./queries/quantityQueries.mjs";
|
|
11
|
+
import { ReferralQueries } from "./queries/referralQueries.mjs";
|
|
12
|
+
import { RegistryQueries } from "./queries/registryQueries.mjs";
|
|
13
|
+
import { TPSLQueries } from "./queries/tpslQueries.mjs";
|
|
14
|
+
import { DeepBookContract } from "./transactions/deepbook.mjs";
|
|
15
|
+
import { DeepBookAdminContract } from "./transactions/deepbookAdmin.mjs";
|
|
16
|
+
import { FlashLoanContract } from "./transactions/flashLoans.mjs";
|
|
17
|
+
import { GovernanceContract } from "./transactions/governance.mjs";
|
|
18
|
+
import { MarginAdminContract } from "./transactions/marginAdmin.mjs";
|
|
19
|
+
import { MarginLiquidationsContract } from "./transactions/marginLiquidations.mjs";
|
|
20
|
+
import { MarginMaintainerContract } from "./transactions/marginMaintainer.mjs";
|
|
21
|
+
import { MarginManagerContract } from "./transactions/marginManager.mjs";
|
|
22
|
+
import { MarginPoolContract } from "./transactions/marginPool.mjs";
|
|
23
|
+
import { MarginRegistryContract } from "./transactions/marginRegistry.mjs";
|
|
24
|
+
import { MarginTPSLContract } from "./transactions/marginTPSL.mjs";
|
|
25
|
+
import { PoolProxyContract } from "./transactions/poolProxy.mjs";
|
|
26
|
+
import { normalizeHaneulAddress } from "@haneullabs/haneul/utils";
|
|
27
|
+
|
|
28
|
+
//#region src/client.ts
|
|
29
|
+
function deepbook({ name = "deepbook", ...options }) {
|
|
30
|
+
return {
|
|
31
|
+
name,
|
|
32
|
+
register: (client) => {
|
|
33
|
+
return new DeepBookClient({
|
|
34
|
+
client,
|
|
35
|
+
network: client.network,
|
|
36
|
+
...options
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* DeepBookClient class for managing DeepBook operations.
|
|
43
|
+
*/
|
|
44
|
+
var DeepBookClient = class {
|
|
45
|
+
#balanceManagerQueries;
|
|
46
|
+
#poolQueries;
|
|
47
|
+
#quantityQueries;
|
|
48
|
+
#orderQueries;
|
|
49
|
+
#accountQueries;
|
|
50
|
+
#referralQueries;
|
|
51
|
+
#priceFeedQueries;
|
|
52
|
+
#marginPoolQueries;
|
|
53
|
+
#marginManagerQueries;
|
|
54
|
+
#tpslQueries;
|
|
55
|
+
#registryQueries;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new DeepBookClient instance
|
|
58
|
+
*/
|
|
59
|
+
constructor({ client, address, network, balanceManagers, marginManagers, coins, pools, adminCap, marginAdminCap, marginMaintainerCap, packageIds, pyth }) {
|
|
60
|
+
const normalizedAddress = normalizeHaneulAddress(address);
|
|
61
|
+
const config = new DeepBookConfig({
|
|
62
|
+
address: normalizedAddress,
|
|
63
|
+
network,
|
|
64
|
+
balanceManagers,
|
|
65
|
+
marginManagers,
|
|
66
|
+
coins,
|
|
67
|
+
pools,
|
|
68
|
+
adminCap,
|
|
69
|
+
marginAdminCap,
|
|
70
|
+
marginMaintainerCap,
|
|
71
|
+
packageIds,
|
|
72
|
+
pyth
|
|
73
|
+
});
|
|
74
|
+
this.balanceManager = new BalanceManagerContract(config);
|
|
75
|
+
this.deepBook = new DeepBookContract(config);
|
|
76
|
+
this.deepBookAdmin = new DeepBookAdminContract(config);
|
|
77
|
+
this.flashLoans = new FlashLoanContract(config);
|
|
78
|
+
this.governance = new GovernanceContract(config);
|
|
79
|
+
this.marginAdmin = new MarginAdminContract(config);
|
|
80
|
+
this.marginMaintainer = new MarginMaintainerContract(config);
|
|
81
|
+
this.marginPool = new MarginPoolContract(config);
|
|
82
|
+
this.marginManager = new MarginManagerContract(config);
|
|
83
|
+
this.marginRegistry = new MarginRegistryContract(config);
|
|
84
|
+
this.marginLiquidations = new MarginLiquidationsContract(config);
|
|
85
|
+
this.poolProxy = new PoolProxyContract(config);
|
|
86
|
+
this.marginTPSL = new MarginTPSLContract(config);
|
|
87
|
+
const ctx = {
|
|
88
|
+
client,
|
|
89
|
+
config,
|
|
90
|
+
address: normalizedAddress,
|
|
91
|
+
balanceManager: this.balanceManager,
|
|
92
|
+
deepBook: this.deepBook,
|
|
93
|
+
marginManager: this.marginManager,
|
|
94
|
+
marginPool: this.marginPool,
|
|
95
|
+
marginRegistry: this.marginRegistry,
|
|
96
|
+
marginTPSL: this.marginTPSL
|
|
97
|
+
};
|
|
98
|
+
this.#balanceManagerQueries = new BalanceManagerQueries(ctx);
|
|
99
|
+
this.#poolQueries = new PoolQueries(ctx);
|
|
100
|
+
this.#quantityQueries = new QuantityQueries(ctx);
|
|
101
|
+
this.#orderQueries = new OrderQueries(ctx);
|
|
102
|
+
this.#accountQueries = new AccountQueries(ctx);
|
|
103
|
+
this.#referralQueries = new ReferralQueries(ctx);
|
|
104
|
+
this.#priceFeedQueries = new PriceFeedQueries(ctx);
|
|
105
|
+
this.#marginPoolQueries = new MarginPoolQueries(ctx);
|
|
106
|
+
this.#marginManagerQueries = new MarginManagerQueries(ctx);
|
|
107
|
+
this.#tpslQueries = new TPSLQueries(ctx);
|
|
108
|
+
this.#registryQueries = new RegistryQueries(ctx);
|
|
109
|
+
}
|
|
110
|
+
checkManagerBalance(managerKey, coinKey) {
|
|
111
|
+
return this.#balanceManagerQueries.checkManagerBalance(managerKey, coinKey);
|
|
112
|
+
}
|
|
113
|
+
checkManagerBalanceWithAddress(managerAddress, coinKey) {
|
|
114
|
+
return this.#balanceManagerQueries.checkManagerBalanceWithAddress(managerAddress, coinKey);
|
|
115
|
+
}
|
|
116
|
+
checkManagerBalancesWithAddress(managerAddresses, coinKeys) {
|
|
117
|
+
return this.#balanceManagerQueries.checkManagerBalancesWithAddress(managerAddresses, coinKeys);
|
|
118
|
+
}
|
|
119
|
+
getBalanceManagerIds(owner) {
|
|
120
|
+
return this.#balanceManagerQueries.getBalanceManagerIds(owner);
|
|
121
|
+
}
|
|
122
|
+
accountExists(poolKey, managerKey) {
|
|
123
|
+
return this.#balanceManagerQueries.accountExists(poolKey, managerKey);
|
|
124
|
+
}
|
|
125
|
+
whitelisted(poolKey) {
|
|
126
|
+
return this.#poolQueries.whitelisted(poolKey);
|
|
127
|
+
}
|
|
128
|
+
vaultBalances(poolKey) {
|
|
129
|
+
return this.#poolQueries.vaultBalances(poolKey);
|
|
130
|
+
}
|
|
131
|
+
getPoolIdByAssets(baseType, quoteType) {
|
|
132
|
+
return this.#poolQueries.getPoolIdByAssets(baseType, quoteType);
|
|
133
|
+
}
|
|
134
|
+
midPrice(poolKey) {
|
|
135
|
+
return this.#poolQueries.midPrice(poolKey);
|
|
136
|
+
}
|
|
137
|
+
poolTradeParams(poolKey) {
|
|
138
|
+
return this.#poolQueries.poolTradeParams(poolKey);
|
|
139
|
+
}
|
|
140
|
+
poolBookParams(poolKey) {
|
|
141
|
+
return this.#poolQueries.poolBookParams(poolKey);
|
|
142
|
+
}
|
|
143
|
+
stablePool(poolKey) {
|
|
144
|
+
return this.#poolQueries.stablePool(poolKey);
|
|
145
|
+
}
|
|
146
|
+
registeredPool(poolKey) {
|
|
147
|
+
return this.#poolQueries.registeredPool(poolKey);
|
|
148
|
+
}
|
|
149
|
+
poolTradeParamsNext(poolKey) {
|
|
150
|
+
return this.#poolQueries.poolTradeParamsNext(poolKey);
|
|
151
|
+
}
|
|
152
|
+
quorum(poolKey) {
|
|
153
|
+
return this.#poolQueries.quorum(poolKey);
|
|
154
|
+
}
|
|
155
|
+
poolId(poolKey) {
|
|
156
|
+
return this.#poolQueries.poolId(poolKey);
|
|
157
|
+
}
|
|
158
|
+
canPlaceLimitOrder(params) {
|
|
159
|
+
return this.#poolQueries.canPlaceLimitOrder(params);
|
|
160
|
+
}
|
|
161
|
+
canPlaceMarketOrder(params) {
|
|
162
|
+
return this.#poolQueries.canPlaceMarketOrder(params);
|
|
163
|
+
}
|
|
164
|
+
checkMarketOrderParams(poolKey, quantity) {
|
|
165
|
+
return this.#poolQueries.checkMarketOrderParams(poolKey, quantity);
|
|
166
|
+
}
|
|
167
|
+
checkLimitOrderParams(poolKey, price, quantity, expireTimestamp) {
|
|
168
|
+
return this.#poolQueries.checkLimitOrderParams(poolKey, price, quantity, expireTimestamp);
|
|
169
|
+
}
|
|
170
|
+
getQuoteQuantityOut(poolKey, baseQuantity) {
|
|
171
|
+
return this.#quantityQueries.getQuoteQuantityOut(poolKey, baseQuantity);
|
|
172
|
+
}
|
|
173
|
+
getBaseQuantityOut(poolKey, quoteQuantity) {
|
|
174
|
+
return this.#quantityQueries.getBaseQuantityOut(poolKey, quoteQuantity);
|
|
175
|
+
}
|
|
176
|
+
getQuantityOut(poolKey, baseQuantity, quoteQuantity) {
|
|
177
|
+
return this.#quantityQueries.getQuantityOut(poolKey, baseQuantity, quoteQuantity);
|
|
178
|
+
}
|
|
179
|
+
getQuoteQuantityOutInputFee(poolKey, baseQuantity) {
|
|
180
|
+
return this.#quantityQueries.getQuoteQuantityOutInputFee(poolKey, baseQuantity);
|
|
181
|
+
}
|
|
182
|
+
getBaseQuantityOutInputFee(poolKey, quoteQuantity) {
|
|
183
|
+
return this.#quantityQueries.getBaseQuantityOutInputFee(poolKey, quoteQuantity);
|
|
184
|
+
}
|
|
185
|
+
getQuantityOutInputFee(poolKey, baseQuantity, quoteQuantity) {
|
|
186
|
+
return this.#quantityQueries.getQuantityOutInputFee(poolKey, baseQuantity, quoteQuantity);
|
|
187
|
+
}
|
|
188
|
+
getBaseQuantityIn(poolKey, targetQuoteQuantity, payWithDeep) {
|
|
189
|
+
return this.#quantityQueries.getBaseQuantityIn(poolKey, targetQuoteQuantity, payWithDeep);
|
|
190
|
+
}
|
|
191
|
+
getQuoteQuantityIn(poolKey, targetBaseQuantity, payWithDeep) {
|
|
192
|
+
return this.#quantityQueries.getQuoteQuantityIn(poolKey, targetBaseQuantity, payWithDeep);
|
|
193
|
+
}
|
|
194
|
+
getOrderDeepRequired(poolKey, baseQuantity, price) {
|
|
195
|
+
return this.#quantityQueries.getOrderDeepRequired(poolKey, baseQuantity, price);
|
|
196
|
+
}
|
|
197
|
+
accountOpenOrders(poolKey, managerKey) {
|
|
198
|
+
return this.#orderQueries.accountOpenOrders(poolKey, managerKey);
|
|
199
|
+
}
|
|
200
|
+
getOrder(poolKey, orderId) {
|
|
201
|
+
return this.#orderQueries.getOrder(poolKey, orderId);
|
|
202
|
+
}
|
|
203
|
+
getOrderNormalized(poolKey, orderId) {
|
|
204
|
+
return this.#orderQueries.getOrderNormalized(poolKey, orderId);
|
|
205
|
+
}
|
|
206
|
+
getOrders(poolKey, orderIds) {
|
|
207
|
+
return this.#orderQueries.getOrders(poolKey, orderIds);
|
|
208
|
+
}
|
|
209
|
+
getLevel2Range(poolKey, priceLow, priceHigh, isBid) {
|
|
210
|
+
return this.#orderQueries.getLevel2Range(poolKey, priceLow, priceHigh, isBid);
|
|
211
|
+
}
|
|
212
|
+
getLevel2TicksFromMid(poolKey, ticks) {
|
|
213
|
+
return this.#orderQueries.getLevel2TicksFromMid(poolKey, ticks);
|
|
214
|
+
}
|
|
215
|
+
getAccountOrderDetails(poolKey, managerKey) {
|
|
216
|
+
return this.#orderQueries.getAccountOrderDetails(poolKey, managerKey);
|
|
217
|
+
}
|
|
218
|
+
account(poolKey, managerKey) {
|
|
219
|
+
return this.#accountQueries.account(poolKey, managerKey);
|
|
220
|
+
}
|
|
221
|
+
lockedBalance(poolKey, balanceManagerKey) {
|
|
222
|
+
return this.#accountQueries.lockedBalance(poolKey, balanceManagerKey);
|
|
223
|
+
}
|
|
224
|
+
getPoolDeepPrice(poolKey) {
|
|
225
|
+
return this.#accountQueries.getPoolDeepPrice(poolKey);
|
|
226
|
+
}
|
|
227
|
+
balanceManagerReferralOwner(referral) {
|
|
228
|
+
return this.#referralQueries.balanceManagerReferralOwner(referral);
|
|
229
|
+
}
|
|
230
|
+
getPoolReferralBalances(poolKey, referral) {
|
|
231
|
+
return this.#referralQueries.getPoolReferralBalances(poolKey, referral);
|
|
232
|
+
}
|
|
233
|
+
balanceManagerReferralPoolId(referral) {
|
|
234
|
+
return this.#referralQueries.balanceManagerReferralPoolId(referral);
|
|
235
|
+
}
|
|
236
|
+
poolReferralMultiplier(poolKey, referral) {
|
|
237
|
+
return this.#referralQueries.poolReferralMultiplier(poolKey, referral);
|
|
238
|
+
}
|
|
239
|
+
getBalanceManagerReferralId(managerKey, poolKey) {
|
|
240
|
+
return this.#referralQueries.getBalanceManagerReferralId(managerKey, poolKey);
|
|
241
|
+
}
|
|
242
|
+
getPriceInfoObject(tx, coinKey) {
|
|
243
|
+
return this.#priceFeedQueries.getPriceInfoObject(tx, coinKey);
|
|
244
|
+
}
|
|
245
|
+
getPriceInfoObjects(tx, coinKeys) {
|
|
246
|
+
return this.#priceFeedQueries.getPriceInfoObjects(tx, coinKeys);
|
|
247
|
+
}
|
|
248
|
+
getPriceInfoObjectAge(coinKey) {
|
|
249
|
+
return this.#priceFeedQueries.getPriceInfoObjectAge(coinKey);
|
|
250
|
+
}
|
|
251
|
+
getMarginPoolId(coinKey) {
|
|
252
|
+
return this.#marginPoolQueries.getMarginPoolId(coinKey);
|
|
253
|
+
}
|
|
254
|
+
isDeepbookPoolAllowed(coinKey, deepbookPoolId) {
|
|
255
|
+
return this.#marginPoolQueries.isDeepbookPoolAllowed(coinKey, deepbookPoolId);
|
|
256
|
+
}
|
|
257
|
+
getMarginPoolTotalSupply(coinKey, decimals = 6) {
|
|
258
|
+
return this.#marginPoolQueries.getMarginPoolTotalSupply(coinKey, decimals);
|
|
259
|
+
}
|
|
260
|
+
getMarginPoolSupplyShares(coinKey, decimals = 6) {
|
|
261
|
+
return this.#marginPoolQueries.getMarginPoolSupplyShares(coinKey, decimals);
|
|
262
|
+
}
|
|
263
|
+
getMarginPoolTotalBorrow(coinKey, decimals = 6) {
|
|
264
|
+
return this.#marginPoolQueries.getMarginPoolTotalBorrow(coinKey, decimals);
|
|
265
|
+
}
|
|
266
|
+
getMarginPoolBorrowShares(coinKey, decimals = 6) {
|
|
267
|
+
return this.#marginPoolQueries.getMarginPoolBorrowShares(coinKey, decimals);
|
|
268
|
+
}
|
|
269
|
+
getMarginPoolLastUpdateTimestamp(coinKey) {
|
|
270
|
+
return this.#marginPoolQueries.getMarginPoolLastUpdateTimestamp(coinKey);
|
|
271
|
+
}
|
|
272
|
+
getMarginPoolSupplyCap(coinKey, decimals = 6) {
|
|
273
|
+
return this.#marginPoolQueries.getMarginPoolSupplyCap(coinKey, decimals);
|
|
274
|
+
}
|
|
275
|
+
getMarginPoolMaxUtilizationRate(coinKey) {
|
|
276
|
+
return this.#marginPoolQueries.getMarginPoolMaxUtilizationRate(coinKey);
|
|
277
|
+
}
|
|
278
|
+
getMarginPoolProtocolSpread(coinKey) {
|
|
279
|
+
return this.#marginPoolQueries.getMarginPoolProtocolSpread(coinKey);
|
|
280
|
+
}
|
|
281
|
+
getMarginPoolMinBorrow(coinKey, decimals = 6) {
|
|
282
|
+
return this.#marginPoolQueries.getMarginPoolMinBorrow(coinKey, decimals);
|
|
283
|
+
}
|
|
284
|
+
getMarginPoolInterestRate(coinKey) {
|
|
285
|
+
return this.#marginPoolQueries.getMarginPoolInterestRate(coinKey);
|
|
286
|
+
}
|
|
287
|
+
getUserSupplyShares(coinKey, supplierCapId, decimals = 6) {
|
|
288
|
+
return this.#marginPoolQueries.getUserSupplyShares(coinKey, supplierCapId, decimals);
|
|
289
|
+
}
|
|
290
|
+
getUserSupplyAmount(coinKey, supplierCapId, decimals = 6) {
|
|
291
|
+
return this.#marginPoolQueries.getUserSupplyAmount(coinKey, supplierCapId, decimals);
|
|
292
|
+
}
|
|
293
|
+
getMarginManagerOwner(marginManagerKey) {
|
|
294
|
+
return this.#marginManagerQueries.getMarginManagerOwner(marginManagerKey);
|
|
295
|
+
}
|
|
296
|
+
getMarginManagerDeepbookPool(marginManagerKey) {
|
|
297
|
+
return this.#marginManagerQueries.getMarginManagerDeepbookPool(marginManagerKey);
|
|
298
|
+
}
|
|
299
|
+
getMarginManagerMarginPoolId(marginManagerKey) {
|
|
300
|
+
return this.#marginManagerQueries.getMarginManagerMarginPoolId(marginManagerKey);
|
|
301
|
+
}
|
|
302
|
+
getMarginManagerBorrowedShares(marginManagerKey) {
|
|
303
|
+
return this.#marginManagerQueries.getMarginManagerBorrowedShares(marginManagerKey);
|
|
304
|
+
}
|
|
305
|
+
getMarginManagerBorrowedBaseShares(marginManagerKey) {
|
|
306
|
+
return this.#marginManagerQueries.getMarginManagerBorrowedBaseShares(marginManagerKey);
|
|
307
|
+
}
|
|
308
|
+
getMarginManagerBorrowedQuoteShares(marginManagerKey) {
|
|
309
|
+
return this.#marginManagerQueries.getMarginManagerBorrowedQuoteShares(marginManagerKey);
|
|
310
|
+
}
|
|
311
|
+
getMarginManagerHasBaseDebt(marginManagerKey) {
|
|
312
|
+
return this.#marginManagerQueries.getMarginManagerHasBaseDebt(marginManagerKey);
|
|
313
|
+
}
|
|
314
|
+
getMarginManagerBalanceManagerId(marginManagerAddress) {
|
|
315
|
+
return this.#marginManagerQueries.getMarginManagerBalanceManagerId(marginManagerAddress);
|
|
316
|
+
}
|
|
317
|
+
getMarginManagerAssets(marginManagerKey, decimals = 6) {
|
|
318
|
+
return this.#marginManagerQueries.getMarginManagerAssets(marginManagerKey, decimals);
|
|
319
|
+
}
|
|
320
|
+
getMarginManagerDebts(marginManagerKey, decimals = 6) {
|
|
321
|
+
return this.#marginManagerQueries.getMarginManagerDebts(marginManagerKey, decimals);
|
|
322
|
+
}
|
|
323
|
+
getMarginManagerState(marginManagerKey, decimals = 6) {
|
|
324
|
+
return this.#marginManagerQueries.getMarginManagerState(marginManagerKey, decimals);
|
|
325
|
+
}
|
|
326
|
+
getMarginManagerStates(marginManagers, decimals = 6) {
|
|
327
|
+
return this.#marginManagerQueries.getMarginManagerStates(marginManagers, decimals);
|
|
328
|
+
}
|
|
329
|
+
getMarginManagerBaseBalance(marginManagerKey, decimals = 9) {
|
|
330
|
+
return this.#marginManagerQueries.getMarginManagerBaseBalance(marginManagerKey, decimals);
|
|
331
|
+
}
|
|
332
|
+
getMarginManagerQuoteBalance(marginManagerKey, decimals = 9) {
|
|
333
|
+
return this.#marginManagerQueries.getMarginManagerQuoteBalance(marginManagerKey, decimals);
|
|
334
|
+
}
|
|
335
|
+
getMarginManagerDeepBalance(marginManagerKey, decimals = 6) {
|
|
336
|
+
return this.#marginManagerQueries.getMarginManagerDeepBalance(marginManagerKey, decimals);
|
|
337
|
+
}
|
|
338
|
+
getMarginManagerBalances(marginManagers, decimals = 9) {
|
|
339
|
+
return this.#marginManagerQueries.getMarginManagerBalances(marginManagers, decimals);
|
|
340
|
+
}
|
|
341
|
+
getConditionalOrderIds(marginManagerKey) {
|
|
342
|
+
return this.#tpslQueries.getConditionalOrderIds(marginManagerKey);
|
|
343
|
+
}
|
|
344
|
+
getLowestTriggerAbovePrice(marginManagerKey) {
|
|
345
|
+
return this.#tpslQueries.getLowestTriggerAbovePrice(marginManagerKey);
|
|
346
|
+
}
|
|
347
|
+
getHighestTriggerBelowPrice(marginManagerKey) {
|
|
348
|
+
return this.#tpslQueries.getHighestTriggerBelowPrice(marginManagerKey);
|
|
349
|
+
}
|
|
350
|
+
isPoolEnabledForMargin(poolKey) {
|
|
351
|
+
return this.#registryQueries.isPoolEnabledForMargin(poolKey);
|
|
352
|
+
}
|
|
353
|
+
getMarginManagerIdsForOwner(owner) {
|
|
354
|
+
return this.#registryQueries.getMarginManagerIdsForOwner(owner);
|
|
355
|
+
}
|
|
356
|
+
getBaseMarginPoolId(poolKey) {
|
|
357
|
+
return this.#registryQueries.getBaseMarginPoolId(poolKey);
|
|
358
|
+
}
|
|
359
|
+
getQuoteMarginPoolId(poolKey) {
|
|
360
|
+
return this.#registryQueries.getQuoteMarginPoolId(poolKey);
|
|
361
|
+
}
|
|
362
|
+
getMinWithdrawRiskRatio(poolKey) {
|
|
363
|
+
return this.#registryQueries.getMinWithdrawRiskRatio(poolKey);
|
|
364
|
+
}
|
|
365
|
+
getMinBorrowRiskRatio(poolKey) {
|
|
366
|
+
return this.#registryQueries.getMinBorrowRiskRatio(poolKey);
|
|
367
|
+
}
|
|
368
|
+
getLiquidationRiskRatio(poolKey) {
|
|
369
|
+
return this.#registryQueries.getLiquidationRiskRatio(poolKey);
|
|
370
|
+
}
|
|
371
|
+
getTargetLiquidationRiskRatio(poolKey) {
|
|
372
|
+
return this.#registryQueries.getTargetLiquidationRiskRatio(poolKey);
|
|
373
|
+
}
|
|
374
|
+
getUserLiquidationReward(poolKey) {
|
|
375
|
+
return this.#registryQueries.getUserLiquidationReward(poolKey);
|
|
376
|
+
}
|
|
377
|
+
getPoolLiquidationReward(poolKey) {
|
|
378
|
+
return this.#registryQueries.getPoolLiquidationReward(poolKey);
|
|
379
|
+
}
|
|
380
|
+
getAllowedMaintainers() {
|
|
381
|
+
return this.#registryQueries.getAllowedMaintainers();
|
|
382
|
+
}
|
|
383
|
+
getAllowedPauseCaps() {
|
|
384
|
+
return this.#registryQueries.getAllowedPauseCaps();
|
|
385
|
+
}
|
|
386
|
+
decodeOrderId(encodedOrderId) {
|
|
387
|
+
return {
|
|
388
|
+
isBid: encodedOrderId >> 127n === 0n,
|
|
389
|
+
price: Number(encodedOrderId >> 64n & (1n << 63n) - 1n),
|
|
390
|
+
orderId: Number(encodedOrderId & (1n << 64n) - 1n)
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
//#endregion
|
|
396
|
+
export { DeepBookClient, deepbook };
|
|
397
|
+
//# sourceMappingURL=client.mjs.map
|