@haneullabs/deepbook-v3 0.1.0
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 +984 -0
- package/README.md +1 -0
- package/dist/cjs/client.d.ts +861 -0
- package/dist/cjs/client.js +1982 -0
- package/dist/cjs/client.js.map +7 -0
- package/dist/cjs/contracts/deepbook/account.d.ts +105 -0
- package/dist/cjs/contracts/deepbook/account.js +163 -0
- package/dist/cjs/contracts/deepbook/account.js.map +7 -0
- package/dist/cjs/contracts/deepbook/balance_manager.d.ts +268 -0
- package/dist/cjs/contracts/deepbook/balance_manager.js +361 -0
- package/dist/cjs/contracts/deepbook/balance_manager.js.map +7 -0
- package/dist/cjs/contracts/deepbook/balances.d.ts +10 -0
- package/dist/cjs/contracts/deepbook/balances.js +35 -0
- package/dist/cjs/contracts/deepbook/balances.js.map +7 -0
- package/dist/cjs/contracts/deepbook/big_vector.d.ts +62 -0
- package/dist/cjs/contracts/deepbook/big_vector.js +80 -0
- package/dist/cjs/contracts/deepbook/big_vector.js.map +7 -0
- package/dist/cjs/contracts/deepbook/book.d.ts +34 -0
- package/dist/cjs/contracts/deepbook/book.js +50 -0
- package/dist/cjs/contracts/deepbook/book.js.map +7 -0
- package/dist/cjs/contracts/deepbook/constants.d.ts +176 -0
- package/dist/cjs/contracts/deepbook/constants.js +338 -0
- package/dist/cjs/contracts/deepbook/constants.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deep_price.d.ts +60 -0
- package/dist/cjs/contracts/deepbook/deep_price.js +87 -0
- package/dist/cjs/contracts/deepbook/deep_price.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.d.ts +14 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js +42 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.d.ts +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js +47 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.d.ts +9 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.d.ts +5 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.js +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.d.ts +28 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.js +47 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.d.ts +27 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js +45 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.d.ts +15 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js +35 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.d.ts +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js +45 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js.map +7 -0
- package/dist/cjs/contracts/deepbook/ewma.d.ts +17 -0
- package/dist/cjs/contracts/deepbook/ewma.js +39 -0
- package/dist/cjs/contracts/deepbook/ewma.js.map +7 -0
- package/dist/cjs/contracts/deepbook/fill.d.ts +153 -0
- package/dist/cjs/contracts/deepbook/fill.js +251 -0
- package/dist/cjs/contracts/deepbook/fill.js.map +7 -0
- package/dist/cjs/contracts/deepbook/governance.d.ts +63 -0
- package/dist/cjs/contracts/deepbook/governance.js +79 -0
- package/dist/cjs/contracts/deepbook/governance.js.map +7 -0
- package/dist/cjs/contracts/deepbook/history.d.ts +60 -0
- package/dist/cjs/contracts/deepbook/history.js +78 -0
- package/dist/cjs/contracts/deepbook/history.js.map +7 -0
- package/dist/cjs/contracts/deepbook/math.d.ts +94 -0
- package/dist/cjs/contracts/deepbook/math.js +132 -0
- package/dist/cjs/contracts/deepbook/math.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order.d.ts +135 -0
- package/dist/cjs/contracts/deepbook/order.js +218 -0
- package/dist/cjs/contracts/deepbook/order.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order_info.d.ts +296 -0
- package/dist/cjs/contracts/deepbook/order_info.js +386 -0
- package/dist/cjs/contracts/deepbook/order_info.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order_query.d.ts +85 -0
- package/dist/cjs/contracts/deepbook/order_query.js +96 -0
- package/dist/cjs/contracts/deepbook/order_query.js.map +7 -0
- package/dist/cjs/contracts/deepbook/pool.d.ts +1218 -0
- package/dist/cjs/contracts/deepbook/pool.js +1236 -0
- package/dist/cjs/contracts/deepbook/pool.js.map +7 -0
- package/dist/cjs/contracts/deepbook/registry.d.ts +134 -0
- package/dist/cjs/contracts/deepbook/registry.js +182 -0
- package/dist/cjs/contracts/deepbook/registry.js.map +7 -0
- package/dist/cjs/contracts/deepbook/state.d.ts +117 -0
- package/dist/cjs/contracts/deepbook/state.js +104 -0
- package/dist/cjs/contracts/deepbook/state.js.map +7 -0
- package/dist/cjs/contracts/deepbook/trade_params.d.ts +7 -0
- package/dist/cjs/contracts/deepbook/trade_params.js +35 -0
- package/dist/cjs/contracts/deepbook/trade_params.js.map +7 -0
- package/dist/cjs/contracts/deepbook/vault.d.ts +30 -0
- package/dist/cjs/contracts/deepbook/vault.js +65 -0
- package/dist/cjs/contracts/deepbook/vault.js.map +7 -0
- package/dist/cjs/contracts/utils/index.d.ts +25 -0
- package/dist/cjs/contracts/utils/index.js +148 -0
- package/dist/cjs/contracts/utils/index.js.map +7 -0
- package/dist/cjs/index.d.ts +23 -0
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/pyth/PriceServiceConnection.d.ts +26 -0
- package/dist/cjs/pyth/PriceServiceConnection.js +68 -0
- package/dist/cjs/pyth/PriceServiceConnection.js.map +7 -0
- package/dist/cjs/pyth/pyth-helpers.d.ts +7 -0
- package/dist/cjs/pyth/pyth-helpers.js +36 -0
- package/dist/cjs/pyth/pyth-helpers.js.map +7 -0
- package/dist/cjs/pyth/pyth.d.ts +65 -0
- package/dist/cjs/pyth/pyth.js +269 -0
- package/dist/cjs/pyth/pyth.js.map +7 -0
- package/dist/cjs/transactions/balanceManager.d.ts +168 -0
- package/dist/cjs/transactions/balanceManager.js +384 -0
- package/dist/cjs/transactions/balanceManager.js.map +7 -0
- package/dist/cjs/transactions/deepbook.d.ts +477 -0
- package/dist/cjs/transactions/deepbook.js +1335 -0
- package/dist/cjs/transactions/deepbook.js.map +7 -0
- package/dist/cjs/transactions/deepbookAdmin.d.ts +105 -0
- package/dist/cjs/transactions/deepbookAdmin.js +334 -0
- package/dist/cjs/transactions/deepbookAdmin.js.map +7 -0
- package/dist/cjs/transactions/flashLoans.d.ts +56 -0
- package/dist/cjs/transactions/flashLoans.js +124 -0
- package/dist/cjs/transactions/flashLoans.js.map +7 -0
- package/dist/cjs/transactions/governance.d.ts +42 -0
- package/dist/cjs/transactions/governance.js +135 -0
- package/dist/cjs/transactions/governance.js.map +7 -0
- package/dist/cjs/transactions/marginAdmin.d.ts +133 -0
- package/dist/cjs/transactions/marginAdmin.js +393 -0
- package/dist/cjs/transactions/marginAdmin.js.map +7 -0
- package/dist/cjs/transactions/marginLiquidations.d.ts +61 -0
- package/dist/cjs/transactions/marginLiquidations.js +173 -0
- package/dist/cjs/transactions/marginLiquidations.js.map +7 -0
- package/dist/cjs/transactions/marginMaintainer.d.ts +80 -0
- package/dist/cjs/transactions/marginMaintainer.js +251 -0
- package/dist/cjs/transactions/marginMaintainer.js.map +7 -0
- package/dist/cjs/transactions/marginManager.d.ts +236 -0
- package/dist/cjs/transactions/marginManager.js +688 -0
- package/dist/cjs/transactions/marginManager.js.map +7 -0
- package/dist/cjs/transactions/marginPool.d.ts +134 -0
- package/dist/cjs/transactions/marginPool.js +330 -0
- package/dist/cjs/transactions/marginPool.js.map +7 -0
- package/dist/cjs/transactions/marginRegistry.d.ts +94 -0
- package/dist/cjs/transactions/marginRegistry.js +221 -0
- package/dist/cjs/transactions/marginRegistry.js.map +7 -0
- package/dist/cjs/transactions/marginTPSL.d.ts +93 -0
- package/dist/cjs/transactions/marginTPSL.js +286 -0
- package/dist/cjs/transactions/marginTPSL.js.map +7 -0
- package/dist/cjs/transactions/poolProxy.d.ts +104 -0
- package/dist/cjs/transactions/poolProxy.js +435 -0
- package/dist/cjs/transactions/poolProxy.js.map +7 -0
- package/dist/cjs/types/bcs.d.ts +5 -0
- package/dist/cjs/types/bcs.js +33 -0
- package/dist/cjs/types/bcs.js.map +7 -0
- package/dist/cjs/types/index.d.ts +218 -0
- package/dist/cjs/types/index.js +38 -0
- package/dist/cjs/types/index.js.map +7 -0
- package/dist/cjs/utils/config.d.ts +65 -0
- package/dist/cjs/utils/config.js +144 -0
- package/dist/cjs/utils/config.js.map +7 -0
- package/dist/cjs/utils/constants.d.ts +76 -0
- package/dist/cjs/utils/constants.js +382 -0
- package/dist/cjs/utils/constants.js.map +7 -0
- package/dist/cjs/utils/errors.d.ts +42 -0
- package/dist/cjs/utils/errors.js +70 -0
- package/dist/cjs/utils/errors.js.map +7 -0
- package/dist/cjs/utils/validation.d.ts +50 -0
- package/dist/cjs/utils/validation.js +67 -0
- package/dist/cjs/utils/validation.js.map +7 -0
- package/dist/esm/client.d.ts +861 -0
- package/dist/esm/client.js +1967 -0
- package/dist/esm/client.js.map +7 -0
- package/dist/esm/contracts/deepbook/account.d.ts +105 -0
- package/dist/esm/contracts/deepbook/account.js +133 -0
- package/dist/esm/contracts/deepbook/account.js.map +7 -0
- package/dist/esm/contracts/deepbook/balance_manager.d.ts +268 -0
- package/dist/esm/contracts/deepbook/balance_manager.js +331 -0
- package/dist/esm/contracts/deepbook/balance_manager.js.map +7 -0
- package/dist/esm/contracts/deepbook/balances.d.ts +10 -0
- package/dist/esm/contracts/deepbook/balances.js +15 -0
- package/dist/esm/contracts/deepbook/balances.js.map +7 -0
- package/dist/esm/contracts/deepbook/big_vector.d.ts +62 -0
- package/dist/esm/contracts/deepbook/big_vector.js +50 -0
- package/dist/esm/contracts/deepbook/big_vector.js.map +7 -0
- package/dist/esm/contracts/deepbook/book.d.ts +34 -0
- package/dist/esm/contracts/deepbook/book.js +20 -0
- package/dist/esm/contracts/deepbook/book.js.map +7 -0
- package/dist/esm/contracts/deepbook/constants.d.ts +176 -0
- package/dist/esm/contracts/deepbook/constants.js +318 -0
- package/dist/esm/contracts/deepbook/constants.js.map +7 -0
- package/dist/esm/contracts/deepbook/deep_price.d.ts +60 -0
- package/dist/esm/contracts/deepbook/deep_price.js +67 -0
- package/dist/esm/contracts/deepbook/deep_price.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.d.ts +14 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.js +22 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.d.ts +33 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.js +17 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.d.ts +9 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.js +13 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.d.ts +5 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.js +13 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.d.ts +28 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.js +17 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.d.ts +27 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js +25 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.d.ts +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.d.ts +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js.map +7 -0
- package/dist/esm/contracts/deepbook/ewma.d.ts +17 -0
- package/dist/esm/contracts/deepbook/ewma.js +19 -0
- package/dist/esm/contracts/deepbook/ewma.js.map +7 -0
- package/dist/esm/contracts/deepbook/fill.d.ts +153 -0
- package/dist/esm/contracts/deepbook/fill.js +221 -0
- package/dist/esm/contracts/deepbook/fill.js.map +7 -0
- package/dist/esm/contracts/deepbook/governance.d.ts +63 -0
- package/dist/esm/contracts/deepbook/governance.js +49 -0
- package/dist/esm/contracts/deepbook/governance.js.map +7 -0
- package/dist/esm/contracts/deepbook/history.d.ts +60 -0
- package/dist/esm/contracts/deepbook/history.js +48 -0
- package/dist/esm/contracts/deepbook/history.js.map +7 -0
- package/dist/esm/contracts/deepbook/math.d.ts +94 -0
- package/dist/esm/contracts/deepbook/math.js +112 -0
- package/dist/esm/contracts/deepbook/math.js.map +7 -0
- package/dist/esm/contracts/deepbook/order.d.ts +135 -0
- package/dist/esm/contracts/deepbook/order.js +188 -0
- package/dist/esm/contracts/deepbook/order.js.map +7 -0
- package/dist/esm/contracts/deepbook/order_info.d.ts +296 -0
- package/dist/esm/contracts/deepbook/order_info.js +356 -0
- package/dist/esm/contracts/deepbook/order_info.js.map +7 -0
- package/dist/esm/contracts/deepbook/order_query.d.ts +85 -0
- package/dist/esm/contracts/deepbook/order_query.js +66 -0
- package/dist/esm/contracts/deepbook/order_query.js.map +7 -0
- package/dist/esm/contracts/deepbook/pool.d.ts +1218 -0
- package/dist/esm/contracts/deepbook/pool.js +1206 -0
- package/dist/esm/contracts/deepbook/pool.js.map +7 -0
- package/dist/esm/contracts/deepbook/registry.d.ts +134 -0
- package/dist/esm/contracts/deepbook/registry.js +152 -0
- package/dist/esm/contracts/deepbook/registry.js.map +7 -0
- package/dist/esm/contracts/deepbook/state.d.ts +117 -0
- package/dist/esm/contracts/deepbook/state.js +74 -0
- package/dist/esm/contracts/deepbook/state.js.map +7 -0
- package/dist/esm/contracts/deepbook/trade_params.d.ts +7 -0
- package/dist/esm/contracts/deepbook/trade_params.js +15 -0
- package/dist/esm/contracts/deepbook/trade_params.js.map +7 -0
- package/dist/esm/contracts/deepbook/vault.d.ts +30 -0
- package/dist/esm/contracts/deepbook/vault.js +35 -0
- package/dist/esm/contracts/deepbook/vault.js.map +7 -0
- package/dist/esm/contracts/utils/index.d.ts +25 -0
- package/dist/esm/contracts/utils/index.js +128 -0
- package/dist/esm/contracts/utils/index.js.map +7 -0
- package/dist/esm/index.d.ts +23 -0
- package/dist/esm/index.js +81 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/pyth/PriceServiceConnection.d.ts +26 -0
- package/dist/esm/pyth/PriceServiceConnection.js +38 -0
- package/dist/esm/pyth/PriceServiceConnection.js.map +7 -0
- package/dist/esm/pyth/pyth-helpers.d.ts +7 -0
- package/dist/esm/pyth/pyth-helpers.js +16 -0
- package/dist/esm/pyth/pyth-helpers.js.map +7 -0
- package/dist/esm/pyth/pyth.d.ts +65 -0
- package/dist/esm/pyth/pyth.js +249 -0
- package/dist/esm/pyth/pyth.js.map +7 -0
- package/dist/esm/transactions/balanceManager.d.ts +168 -0
- package/dist/esm/transactions/balanceManager.js +364 -0
- package/dist/esm/transactions/balanceManager.js.map +7 -0
- package/dist/esm/transactions/deepbook.d.ts +477 -0
- package/dist/esm/transactions/deepbook.js +1321 -0
- package/dist/esm/transactions/deepbook.js.map +7 -0
- package/dist/esm/transactions/deepbookAdmin.d.ts +105 -0
- package/dist/esm/transactions/deepbookAdmin.js +314 -0
- package/dist/esm/transactions/deepbookAdmin.js.map +7 -0
- package/dist/esm/transactions/flashLoans.d.ts +56 -0
- package/dist/esm/transactions/flashLoans.js +104 -0
- package/dist/esm/transactions/flashLoans.js.map +7 -0
- package/dist/esm/transactions/governance.d.ts +42 -0
- package/dist/esm/transactions/governance.js +115 -0
- package/dist/esm/transactions/governance.js.map +7 -0
- package/dist/esm/transactions/marginAdmin.d.ts +133 -0
- package/dist/esm/transactions/marginAdmin.js +373 -0
- package/dist/esm/transactions/marginAdmin.js.map +7 -0
- package/dist/esm/transactions/marginLiquidations.d.ts +61 -0
- package/dist/esm/transactions/marginLiquidations.js +153 -0
- package/dist/esm/transactions/marginLiquidations.js.map +7 -0
- package/dist/esm/transactions/marginMaintainer.d.ts +80 -0
- package/dist/esm/transactions/marginMaintainer.js +231 -0
- package/dist/esm/transactions/marginMaintainer.js.map +7 -0
- package/dist/esm/transactions/marginManager.d.ts +236 -0
- package/dist/esm/transactions/marginManager.js +668 -0
- package/dist/esm/transactions/marginManager.js.map +7 -0
- package/dist/esm/transactions/marginPool.d.ts +134 -0
- package/dist/esm/transactions/marginPool.js +310 -0
- package/dist/esm/transactions/marginPool.js.map +7 -0
- package/dist/esm/transactions/marginRegistry.d.ts +94 -0
- package/dist/esm/transactions/marginRegistry.js +201 -0
- package/dist/esm/transactions/marginRegistry.js.map +7 -0
- package/dist/esm/transactions/marginTPSL.d.ts +93 -0
- package/dist/esm/transactions/marginTPSL.js +266 -0
- package/dist/esm/transactions/marginTPSL.js.map +7 -0
- package/dist/esm/transactions/poolProxy.d.ts +104 -0
- package/dist/esm/transactions/poolProxy.js +415 -0
- package/dist/esm/transactions/poolProxy.js.map +7 -0
- package/dist/esm/types/bcs.d.ts +5 -0
- package/dist/esm/types/bcs.js +13 -0
- package/dist/esm/types/bcs.js.map +7 -0
- package/dist/esm/types/index.d.ts +218 -0
- package/dist/esm/types/index.js +18 -0
- package/dist/esm/types/index.js.map +7 -0
- package/dist/esm/utils/config.d.ts +65 -0
- package/dist/esm/utils/config.js +135 -0
- package/dist/esm/utils/config.js.map +7 -0
- package/dist/esm/utils/constants.d.ts +76 -0
- package/dist/esm/utils/constants.js +362 -0
- package/dist/esm/utils/constants.js.map +7 -0
- package/dist/esm/utils/errors.d.ts +42 -0
- package/dist/esm/utils/errors.js +50 -0
- package/dist/esm/utils/errors.js.map +7 -0
- package/dist/esm/utils/validation.d.ts +50 -0
- package/dist/esm/utils/validation.js +47 -0
- package/dist/esm/utils/validation.js.map +7 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/client.ts +2451 -0
- package/src/contracts/deepbook/account.ts +199 -0
- package/src/contracts/deepbook/balance_manager.ts +532 -0
- package/src/contracts/deepbook/balances.ts +19 -0
- package/src/contracts/deepbook/big_vector.ts +74 -0
- package/src/contracts/deepbook/book.ts +24 -0
- package/src/contracts/deepbook/constants.ts +458 -0
- package/src/contracts/deepbook/deep_price.ts +84 -0
- package/src/contracts/deepbook/deps/std/type_name.ts +23 -0
- package/src/contracts/deepbook/deps/sui/bag.ts +41 -0
- package/src/contracts/deepbook/deps/sui/balance.ts +18 -0
- package/src/contracts/deepbook/deps/sui/object.ts +14 -0
- package/src/contracts/deepbook/deps/sui/table.ts +36 -0
- package/src/contracts/deepbook/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook/deps/sui/vec_set.ts +22 -0
- package/src/contracts/deepbook/deps/sui/versioned.ts +13 -0
- package/src/contracts/deepbook/ewma.ts +26 -0
- package/src/contracts/deepbook/fill.ts +336 -0
- package/src/contracts/deepbook/governance.ts +52 -0
- package/src/contracts/deepbook/history.ts +51 -0
- package/src/contracts/deepbook/math.ts +210 -0
- package/src/contracts/deepbook/order.ts +269 -0
- package/src/contracts/deepbook/order_info.ts +513 -0
- package/src/contracts/deepbook/order_query.ts +115 -0
- package/src/contracts/deepbook/pool.ts +2269 -0
- package/src/contracts/deepbook/registry.ts +242 -0
- package/src/contracts/deepbook/state.ts +74 -0
- package/src/contracts/deepbook/trade_params.ts +16 -0
- package/src/contracts/deepbook/vault.ts +37 -0
- package/src/contracts/utils/index.ts +184 -0
- package/src/index.ts +95 -0
- package/src/pyth/PriceServiceConnection.ts +48 -0
- package/src/pyth/pyth-helpers.ts +23 -0
- package/src/pyth/pyth.ts +305 -0
- package/src/transactions/balanceManager.ts +399 -0
- package/src/transactions/deepbook.ts +1519 -0
- package/src/transactions/deepbookAdmin.ts +332 -0
- package/src/transactions/flashLoans.ts +123 -0
- package/src/transactions/governance.ts +123 -0
- package/src/transactions/marginAdmin.ts +396 -0
- package/src/transactions/marginLiquidations.ts +175 -0
- package/src/transactions/marginMaintainer.ts +280 -0
- package/src/transactions/marginManager.ts +708 -0
- package/src/transactions/marginPool.ts +339 -0
- package/src/transactions/marginRegistry.ts +212 -0
- package/src/transactions/marginTPSL.ts +296 -0
- package/src/transactions/poolProxy.ts +438 -0
- package/src/types/bcs.ts +8 -0
- package/src/types/index.ts +255 -0
- package/src/utils/config.ts +177 -0
- package/src/utils/constants.ts +374 -0
- package/src/utils/errors.ts +67 -0
- package/src/utils/validation.ts +91 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { Transaction } from '@haneullabs/haneul/transactions';
|
|
2
|
+
import type { DeepBookConfig } from '../utils/config.js';
|
|
3
|
+
/**
|
|
4
|
+
* MarginRegistryContract class for managing MarginRegistry read-only operations.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MarginRegistryContract {
|
|
7
|
+
#private;
|
|
8
|
+
/**
|
|
9
|
+
* @param {DeepBookConfig} config Configuration for MarginRegistryContract
|
|
10
|
+
*/
|
|
11
|
+
constructor(config: DeepBookConfig);
|
|
12
|
+
/**
|
|
13
|
+
* @description Check if a deepbook pool is enabled for margin trading
|
|
14
|
+
* @param {string} poolKey The key to identify the pool
|
|
15
|
+
* @returns A function that takes a Transaction object
|
|
16
|
+
*/
|
|
17
|
+
poolEnabled: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
18
|
+
/**
|
|
19
|
+
* @description Get the margin pool ID for a given asset
|
|
20
|
+
* @param {string} coinKey The key to identify the coin
|
|
21
|
+
* @returns A function that takes a Transaction object
|
|
22
|
+
*/
|
|
23
|
+
getMarginPoolId: (coinKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
24
|
+
/**
|
|
25
|
+
* @description Get the margin pool IDs (base and quote) for a deepbook pool
|
|
26
|
+
* @param {string} poolKey The key to identify the pool
|
|
27
|
+
* @returns A function that takes a Transaction object
|
|
28
|
+
*/
|
|
29
|
+
getDeepbookPoolMarginPoolIds: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
30
|
+
/**
|
|
31
|
+
* @description Get the margin manager IDs for a given owner
|
|
32
|
+
* @param {string} owner The owner address
|
|
33
|
+
* @returns A function that takes a Transaction object
|
|
34
|
+
*/
|
|
35
|
+
getMarginManagerIds: (owner: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
36
|
+
/**
|
|
37
|
+
* @description Get the base margin pool ID for a deepbook pool
|
|
38
|
+
* @param {string} poolKey The key to identify the pool
|
|
39
|
+
* @returns A function that takes a Transaction object
|
|
40
|
+
*/
|
|
41
|
+
baseMarginPoolId: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
42
|
+
/**
|
|
43
|
+
* @description Get the quote margin pool ID for a deepbook pool
|
|
44
|
+
* @param {string} poolKey The key to identify the pool
|
|
45
|
+
* @returns A function that takes a Transaction object
|
|
46
|
+
*/
|
|
47
|
+
quoteMarginPoolId: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
48
|
+
/**
|
|
49
|
+
* @description Get the minimum withdraw risk ratio for a deepbook pool
|
|
50
|
+
* @param {string} poolKey The key to identify the pool
|
|
51
|
+
* @returns A function that takes a Transaction object
|
|
52
|
+
*/
|
|
53
|
+
minWithdrawRiskRatio: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
54
|
+
/**
|
|
55
|
+
* @description Get the minimum borrow risk ratio for a deepbook pool
|
|
56
|
+
* @param {string} poolKey The key to identify the pool
|
|
57
|
+
* @returns A function that takes a Transaction object
|
|
58
|
+
*/
|
|
59
|
+
minBorrowRiskRatio: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
60
|
+
/**
|
|
61
|
+
* @description Get the liquidation risk ratio for a deepbook pool
|
|
62
|
+
* @param {string} poolKey The key to identify the pool
|
|
63
|
+
* @returns A function that takes a Transaction object
|
|
64
|
+
*/
|
|
65
|
+
liquidationRiskRatio: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
66
|
+
/**
|
|
67
|
+
* @description Get the target liquidation risk ratio for a deepbook pool
|
|
68
|
+
* @param {string} poolKey The key to identify the pool
|
|
69
|
+
* @returns A function that takes a Transaction object
|
|
70
|
+
*/
|
|
71
|
+
targetLiquidationRiskRatio: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
72
|
+
/**
|
|
73
|
+
* @description Get the user liquidation reward for a deepbook pool
|
|
74
|
+
* @param {string} poolKey The key to identify the pool
|
|
75
|
+
* @returns A function that takes a Transaction object
|
|
76
|
+
*/
|
|
77
|
+
userLiquidationReward: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
78
|
+
/**
|
|
79
|
+
* @description Get the pool liquidation reward for a deepbook pool
|
|
80
|
+
* @param {string} poolKey The key to identify the pool
|
|
81
|
+
* @returns A function that takes a Transaction object
|
|
82
|
+
*/
|
|
83
|
+
poolLiquidationReward: (poolKey: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
84
|
+
/**
|
|
85
|
+
* @description Get all allowed maintainer cap IDs
|
|
86
|
+
* @returns A function that takes a Transaction object
|
|
87
|
+
*/
|
|
88
|
+
allowedMaintainers: () => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
89
|
+
/**
|
|
90
|
+
* @description Get all allowed pause cap IDs
|
|
91
|
+
* @returns A function that takes a Transaction object
|
|
92
|
+
*/
|
|
93
|
+
allowedPauseCaps: () => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
94
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
23
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
24
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
25
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
26
|
+
var marginRegistry_exports = {};
|
|
27
|
+
__export(marginRegistry_exports, {
|
|
28
|
+
MarginRegistryContract: () => MarginRegistryContract
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(marginRegistry_exports);
|
|
31
|
+
var _config;
|
|
32
|
+
class MarginRegistryContract {
|
|
33
|
+
/**
|
|
34
|
+
* @param {DeepBookConfig} config Configuration for MarginRegistryContract
|
|
35
|
+
*/
|
|
36
|
+
constructor(config) {
|
|
37
|
+
__privateAdd(this, _config);
|
|
38
|
+
/**
|
|
39
|
+
* @description Check if a deepbook pool is enabled for margin trading
|
|
40
|
+
* @param {string} poolKey The key to identify the pool
|
|
41
|
+
* @returns A function that takes a Transaction object
|
|
42
|
+
*/
|
|
43
|
+
this.poolEnabled = (poolKey) => (tx) => {
|
|
44
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
45
|
+
const baseCoin = __privateGet(this, _config).getCoin(pool.baseCoin);
|
|
46
|
+
const quoteCoin = __privateGet(this, _config).getCoin(pool.quoteCoin);
|
|
47
|
+
return tx.moveCall({
|
|
48
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::pool_enabled`,
|
|
49
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.object(pool.address)],
|
|
50
|
+
typeArguments: [baseCoin.type, quoteCoin.type]
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @description Get the margin pool ID for a given asset
|
|
55
|
+
* @param {string} coinKey The key to identify the coin
|
|
56
|
+
* @returns A function that takes a Transaction object
|
|
57
|
+
*/
|
|
58
|
+
this.getMarginPoolId = (coinKey) => (tx) => {
|
|
59
|
+
const coin = __privateGet(this, _config).getCoin(coinKey);
|
|
60
|
+
return tx.moveCall({
|
|
61
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::get_margin_pool_id`,
|
|
62
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID)],
|
|
63
|
+
typeArguments: [coin.type]
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* @description Get the margin pool IDs (base and quote) for a deepbook pool
|
|
68
|
+
* @param {string} poolKey The key to identify the pool
|
|
69
|
+
* @returns A function that takes a Transaction object
|
|
70
|
+
*/
|
|
71
|
+
this.getDeepbookPoolMarginPoolIds = (poolKey) => (tx) => {
|
|
72
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
73
|
+
return tx.moveCall({
|
|
74
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::get_deepbook_pool_margin_pool_ids`,
|
|
75
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
76
|
+
typeArguments: []
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* @description Get the margin manager IDs for a given owner
|
|
81
|
+
* @param {string} owner The owner address
|
|
82
|
+
* @returns A function that takes a Transaction object
|
|
83
|
+
*/
|
|
84
|
+
this.getMarginManagerIds = (owner) => (tx) => {
|
|
85
|
+
return tx.moveCall({
|
|
86
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::get_margin_manager_ids`,
|
|
87
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.address(owner)],
|
|
88
|
+
typeArguments: []
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* @description Get the base margin pool ID for a deepbook pool
|
|
93
|
+
* @param {string} poolKey The key to identify the pool
|
|
94
|
+
* @returns A function that takes a Transaction object
|
|
95
|
+
*/
|
|
96
|
+
this.baseMarginPoolId = (poolKey) => (tx) => {
|
|
97
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
98
|
+
return tx.moveCall({
|
|
99
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::base_margin_pool_id`,
|
|
100
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
101
|
+
typeArguments: []
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* @description Get the quote margin pool ID for a deepbook pool
|
|
106
|
+
* @param {string} poolKey The key to identify the pool
|
|
107
|
+
* @returns A function that takes a Transaction object
|
|
108
|
+
*/
|
|
109
|
+
this.quoteMarginPoolId = (poolKey) => (tx) => {
|
|
110
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
111
|
+
return tx.moveCall({
|
|
112
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::quote_margin_pool_id`,
|
|
113
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
114
|
+
typeArguments: []
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* @description Get the minimum withdraw risk ratio for a deepbook pool
|
|
119
|
+
* @param {string} poolKey The key to identify the pool
|
|
120
|
+
* @returns A function that takes a Transaction object
|
|
121
|
+
*/
|
|
122
|
+
this.minWithdrawRiskRatio = (poolKey) => (tx) => {
|
|
123
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
124
|
+
return tx.moveCall({
|
|
125
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::min_withdraw_risk_ratio`,
|
|
126
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
127
|
+
typeArguments: []
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* @description Get the minimum borrow risk ratio for a deepbook pool
|
|
132
|
+
* @param {string} poolKey The key to identify the pool
|
|
133
|
+
* @returns A function that takes a Transaction object
|
|
134
|
+
*/
|
|
135
|
+
this.minBorrowRiskRatio = (poolKey) => (tx) => {
|
|
136
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
137
|
+
return tx.moveCall({
|
|
138
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::min_borrow_risk_ratio`,
|
|
139
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
140
|
+
typeArguments: []
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* @description Get the liquidation risk ratio for a deepbook pool
|
|
145
|
+
* @param {string} poolKey The key to identify the pool
|
|
146
|
+
* @returns A function that takes a Transaction object
|
|
147
|
+
*/
|
|
148
|
+
this.liquidationRiskRatio = (poolKey) => (tx) => {
|
|
149
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
150
|
+
return tx.moveCall({
|
|
151
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::liquidation_risk_ratio`,
|
|
152
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
153
|
+
typeArguments: []
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* @description Get the target liquidation risk ratio for a deepbook pool
|
|
158
|
+
* @param {string} poolKey The key to identify the pool
|
|
159
|
+
* @returns A function that takes a Transaction object
|
|
160
|
+
*/
|
|
161
|
+
this.targetLiquidationRiskRatio = (poolKey) => (tx) => {
|
|
162
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
163
|
+
return tx.moveCall({
|
|
164
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::target_liquidation_risk_ratio`,
|
|
165
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
166
|
+
typeArguments: []
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* @description Get the user liquidation reward for a deepbook pool
|
|
171
|
+
* @param {string} poolKey The key to identify the pool
|
|
172
|
+
* @returns A function that takes a Transaction object
|
|
173
|
+
*/
|
|
174
|
+
this.userLiquidationReward = (poolKey) => (tx) => {
|
|
175
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
176
|
+
return tx.moveCall({
|
|
177
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::user_liquidation_reward`,
|
|
178
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
179
|
+
typeArguments: []
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* @description Get the pool liquidation reward for a deepbook pool
|
|
184
|
+
* @param {string} poolKey The key to identify the pool
|
|
185
|
+
* @returns A function that takes a Transaction object
|
|
186
|
+
*/
|
|
187
|
+
this.poolLiquidationReward = (poolKey) => (tx) => {
|
|
188
|
+
const pool = __privateGet(this, _config).getPool(poolKey);
|
|
189
|
+
return tx.moveCall({
|
|
190
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::pool_liquidation_reward`,
|
|
191
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],
|
|
192
|
+
typeArguments: []
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* @description Get all allowed maintainer cap IDs
|
|
197
|
+
* @returns A function that takes a Transaction object
|
|
198
|
+
*/
|
|
199
|
+
this.allowedMaintainers = () => (tx) => {
|
|
200
|
+
return tx.moveCall({
|
|
201
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::allowed_maintainers`,
|
|
202
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID)],
|
|
203
|
+
typeArguments: []
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* @description Get all allowed pause cap IDs
|
|
208
|
+
* @returns A function that takes a Transaction object
|
|
209
|
+
*/
|
|
210
|
+
this.allowedPauseCaps = () => (tx) => {
|
|
211
|
+
return tx.moveCall({
|
|
212
|
+
target: `${__privateGet(this, _config).MARGIN_PACKAGE_ID}::margin_registry::allowed_pause_caps`,
|
|
213
|
+
arguments: [tx.object(__privateGet(this, _config).MARGIN_REGISTRY_ID)],
|
|
214
|
+
typeArguments: []
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
__privateSet(this, _config, config);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
_config = new WeakMap();
|
|
221
|
+
//# sourceMappingURL=marginRegistry.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/transactions/marginRegistry.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport type { Transaction } from '@haneullabs/haneul/transactions';\n\nimport type { DeepBookConfig } from '../utils/config.js';\n\n/**\n * MarginRegistryContract class for managing MarginRegistry read-only operations.\n */\nexport class MarginRegistryContract {\n\t#config: DeepBookConfig;\n\n\t/**\n\t * @param {DeepBookConfig} config Configuration for MarginRegistryContract\n\t */\n\tconstructor(config: DeepBookConfig) {\n\t\tthis.#config = config;\n\t}\n\n\t/**\n\t * @description Check if a deepbook pool is enabled for margin trading\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolEnabled = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::pool_enabled`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.object(pool.address)],\n\t\t\ttypeArguments: [baseCoin.type, quoteCoin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the margin pool ID for a given asset\n\t * @param {string} coinKey The key to identify the coin\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetMarginPoolId = (coinKey: string) => (tx: Transaction) => {\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::get_margin_pool_id`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID)],\n\t\t\ttypeArguments: [coin.type],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the margin pool IDs (base and quote) for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetDeepbookPoolMarginPoolIds = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::get_deepbook_pool_margin_pool_ids`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the margin manager IDs for a given owner\n\t * @param {string} owner The owner address\n\t * @returns A function that takes a Transaction object\n\t */\n\tgetMarginManagerIds = (owner: string) => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::get_margin_manager_ids`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.address(owner)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the base margin pool ID for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tbaseMarginPoolId = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::base_margin_pool_id`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the quote margin pool ID for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tquoteMarginPoolId = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::quote_margin_pool_id`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the minimum withdraw risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tminWithdrawRiskRatio = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::min_withdraw_risk_ratio`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the minimum borrow risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tminBorrowRiskRatio = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::min_borrow_risk_ratio`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the liquidation risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tliquidationRiskRatio = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::liquidation_risk_ratio`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the target liquidation risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\ttargetLiquidationRiskRatio = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::target_liquidation_risk_ratio`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the user liquidation reward for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tuserLiquidationReward = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::user_liquidation_reward`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get the pool liquidation reward for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns A function that takes a Transaction object\n\t */\n\tpoolLiquidationReward = (poolKey: string) => (tx: Transaction) => {\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::pool_liquidation_reward`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID), tx.pure.id(pool.address)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get all allowed maintainer cap IDs\n\t * @returns A function that takes a Transaction object\n\t */\n\tallowedMaintainers = () => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::allowed_maintainers`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n\n\t/**\n\t * @description Get all allowed pause cap IDs\n\t * @returns A function that takes a Transaction object\n\t */\n\tallowedPauseCaps = () => (tx: Transaction) => {\n\t\treturn tx.moveCall({\n\t\t\ttarget: `${this.#config.MARGIN_PACKAGE_ID}::margin_registry::allowed_pause_caps`,\n\t\t\targuments: [tx.object(this.#config.MARGIN_REGISTRY_ID)],\n\t\t\ttypeArguments: [],\n\t\t});\n\t};\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Transaction } from '@haneullabs/haneul/transactions';
|
|
2
|
+
import type { DeepBookConfig } from '../utils/config.js';
|
|
3
|
+
import type { PendingLimitOrderParams, PendingMarketOrderParams, AddConditionalOrderParams } from '../types/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* MarginTPSLContract class for managing Take Profit / Stop Loss operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MarginTPSLContract {
|
|
8
|
+
#private;
|
|
9
|
+
/**
|
|
10
|
+
* @param {DeepBookConfig} config Configuration for MarginTPSLContract
|
|
11
|
+
*/
|
|
12
|
+
constructor(config: DeepBookConfig);
|
|
13
|
+
/**
|
|
14
|
+
* @description Create a new condition for a conditional order
|
|
15
|
+
* @param {string} poolKey The key to identify the pool
|
|
16
|
+
* @param {boolean} triggerBelowPrice Whether to trigger when price is below trigger price
|
|
17
|
+
* @param {number} triggerPrice The price at which to trigger the order
|
|
18
|
+
* @returns A function that takes a Transaction object
|
|
19
|
+
*/
|
|
20
|
+
newCondition: (poolKey: string, triggerBelowPrice: boolean, triggerPrice: number) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
21
|
+
/**
|
|
22
|
+
* @description Create a new pending limit order for use in conditional orders
|
|
23
|
+
* @param {string} poolKey The key to identify the pool
|
|
24
|
+
* @param {PendingLimitOrderParams} params Parameters for the pending limit order
|
|
25
|
+
* @returns A function that takes a Transaction object
|
|
26
|
+
*/
|
|
27
|
+
newPendingLimitOrder: (poolKey: string, params: PendingLimitOrderParams) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
28
|
+
/**
|
|
29
|
+
* @description Create a new pending market order for use in conditional orders
|
|
30
|
+
* @param {string} poolKey The key to identify the pool
|
|
31
|
+
* @param {PendingMarketOrderParams} params Parameters for the pending market order
|
|
32
|
+
* @returns A function that takes a Transaction object
|
|
33
|
+
*/
|
|
34
|
+
newPendingMarketOrder: (poolKey: string, params: PendingMarketOrderParams) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
35
|
+
/**
|
|
36
|
+
* @description Add a conditional order (take profit or stop loss)
|
|
37
|
+
* @param {AddConditionalOrderParams} params Parameters for adding the conditional order
|
|
38
|
+
* @returns A function that takes a Transaction object
|
|
39
|
+
*/
|
|
40
|
+
addConditionalOrder: (params: AddConditionalOrderParams) => (tx: Transaction) => void;
|
|
41
|
+
/**
|
|
42
|
+
* @description Cancel all conditional orders for a margin manager
|
|
43
|
+
* @param {string} marginManagerKey The key to identify the margin manager
|
|
44
|
+
* @returns A function that takes a Transaction object
|
|
45
|
+
*/
|
|
46
|
+
cancelAllConditionalOrders: (marginManagerKey: string) => (tx: Transaction) => void;
|
|
47
|
+
/**
|
|
48
|
+
* @description Cancel a specific conditional order
|
|
49
|
+
* @param {string} marginManagerKey The key to identify the margin manager
|
|
50
|
+
* @param {string} conditionalOrderId The ID of the conditional order to cancel
|
|
51
|
+
* @returns A function that takes a Transaction object
|
|
52
|
+
*/
|
|
53
|
+
cancelConditionalOrder: (marginManagerKey: string, conditionalOrderId: string) => (tx: Transaction) => void;
|
|
54
|
+
/**
|
|
55
|
+
* @description Execute conditional orders that have been triggered
|
|
56
|
+
* This is a permissionless function that can be called by anyone
|
|
57
|
+
* @param {string} marginManagerKey The key to identify the margin manager
|
|
58
|
+
* @param {number} maxOrdersToExecute Maximum number of orders to execute in this call
|
|
59
|
+
* @returns A function that takes a Transaction object
|
|
60
|
+
*/
|
|
61
|
+
executeConditionalOrders: (marginManagerKey: string, maxOrdersToExecute: number) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
62
|
+
/**
|
|
63
|
+
* @description Get all conditional order IDs for a margin manager
|
|
64
|
+
* @param {string} poolKey The key to identify the pool
|
|
65
|
+
* @param {string} marginManagerId The ID of the margin manager
|
|
66
|
+
* @returns A function that takes a Transaction object
|
|
67
|
+
*/
|
|
68
|
+
conditionalOrderIds: (poolKey: string, marginManagerId: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
69
|
+
/**
|
|
70
|
+
* @description Get a specific conditional order by ID
|
|
71
|
+
* @param {string} poolKey The key to identify the pool
|
|
72
|
+
* @param {string} marginManagerId The ID of the margin manager
|
|
73
|
+
* @param {string} conditionalOrderId The ID of the conditional order
|
|
74
|
+
* @returns A function that takes a Transaction object
|
|
75
|
+
*/
|
|
76
|
+
conditionalOrder: (poolKey: string, marginManagerId: string, conditionalOrderId: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
77
|
+
/**
|
|
78
|
+
* @description Get the lowest trigger price for trigger_above orders
|
|
79
|
+
* Returns constants::max_u64() if there are no trigger_above orders
|
|
80
|
+
* @param {string} poolKey The key to identify the pool
|
|
81
|
+
* @param {string} marginManagerId The ID of the margin manager
|
|
82
|
+
* @returns A function that takes a Transaction object
|
|
83
|
+
*/
|
|
84
|
+
lowestTriggerAbovePrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
85
|
+
/**
|
|
86
|
+
* @description Get the highest trigger price for trigger_below orders
|
|
87
|
+
* Returns 0 if there are no trigger_below orders
|
|
88
|
+
* @param {string} poolKey The key to identify the pool
|
|
89
|
+
* @param {string} marginManagerId The ID of the margin manager
|
|
90
|
+
* @returns A function that takes a Transaction object
|
|
91
|
+
*/
|
|
92
|
+
highestTriggerBelowPrice: (poolKey: string, marginManagerId: string) => (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
|
|
93
|
+
}
|