@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
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
3
4
|
|
|
4
5
|
/** Public-facing interface for the package. */
|
|
5
6
|
|
|
6
|
-
import { MoveStruct, normalizeMoveArguments } from '../utils/index.js';
|
|
7
|
-
import type { RawTransactionArgument } from '../utils/index.js';
|
|
7
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
8
8
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
9
|
-
import type
|
|
10
|
-
import
|
|
11
|
-
import * as
|
|
12
|
-
import * as versioned from './deps/sui/versioned.js';
|
|
13
|
-
import * as vec_set from './deps/sui/vec_set.js';
|
|
9
|
+
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
10
|
+
import * as versioned from './deps/haneul/versioned.js';
|
|
11
|
+
import * as vec_set from './deps/haneul/vec_set.js';
|
|
14
12
|
import * as book from './book.js';
|
|
15
13
|
import * as state from './state.js';
|
|
16
14
|
import * as vault from './vault.js';
|
|
17
15
|
import * as deep_price from './deep_price.js';
|
|
16
|
+
import * as balance from './deps/haneul/balance.js';
|
|
18
17
|
const $moduleName = '@deepbook/core::pool';
|
|
19
18
|
export const Pool = new MoveStruct({
|
|
20
|
-
name: `${$moduleName}::Pool
|
|
19
|
+
name: `${$moduleName}::Pool<phantom BaseAsset, phantom QuoteAsset>`,
|
|
21
20
|
fields: {
|
|
22
|
-
id:
|
|
21
|
+
id: bcs.Address,
|
|
23
22
|
inner: versioned.Versioned,
|
|
24
23
|
},
|
|
25
24
|
});
|
|
26
25
|
export const PoolInner = new MoveStruct({
|
|
27
|
-
name: `${$moduleName}::PoolInner
|
|
26
|
+
name: `${$moduleName}::PoolInner<phantom BaseAsset, phantom QuoteAsset>`,
|
|
28
27
|
fields: {
|
|
29
28
|
allowed_versions: vec_set.VecSet(bcs.u64()),
|
|
30
29
|
pool_id: bcs.Address,
|
|
@@ -36,7 +35,7 @@ export const PoolInner = new MoveStruct({
|
|
|
36
35
|
},
|
|
37
36
|
});
|
|
38
37
|
export const PoolCreated = new MoveStruct({
|
|
39
|
-
name: `${$moduleName}::PoolCreated
|
|
38
|
+
name: `${$moduleName}::PoolCreated<phantom BaseAsset, phantom QuoteAsset>`,
|
|
40
39
|
fields: {
|
|
41
40
|
pool_id: bcs.Address,
|
|
42
41
|
taker_fee: bcs.u64(),
|
|
@@ -49,7 +48,7 @@ export const PoolCreated = new MoveStruct({
|
|
|
49
48
|
},
|
|
50
49
|
});
|
|
51
50
|
export const BookParamsUpdated = new MoveStruct({
|
|
52
|
-
name: `${$moduleName}::BookParamsUpdated
|
|
51
|
+
name: `${$moduleName}::BookParamsUpdated<phantom BaseAsset, phantom QuoteAsset>`,
|
|
53
52
|
fields: {
|
|
54
53
|
pool_id: bcs.Address,
|
|
55
54
|
tick_size: bcs.u64(),
|
|
@@ -59,22 +58,50 @@ export const BookParamsUpdated = new MoveStruct({
|
|
|
59
58
|
},
|
|
60
59
|
});
|
|
61
60
|
export const DeepBurned = new MoveStruct({
|
|
62
|
-
name: `${$moduleName}::DeepBurned
|
|
61
|
+
name: `${$moduleName}::DeepBurned<phantom BaseAsset, phantom QuoteAsset>`,
|
|
63
62
|
fields: {
|
|
64
63
|
pool_id: bcs.Address,
|
|
65
64
|
deep_burned: bcs.u64(),
|
|
66
65
|
},
|
|
67
66
|
});
|
|
68
|
-
export const
|
|
69
|
-
name: `${$moduleName}::
|
|
67
|
+
export const ReferralRewards = new MoveStruct({
|
|
68
|
+
name: `${$moduleName}::ReferralRewards<phantom BaseAsset, phantom QuoteAsset>`,
|
|
70
69
|
fields: {
|
|
71
|
-
|
|
70
|
+
multiplier: bcs.u64(),
|
|
71
|
+
base: balance.Balance,
|
|
72
|
+
quote: balance.Balance,
|
|
73
|
+
deep: balance.Balance,
|
|
72
74
|
},
|
|
73
75
|
});
|
|
74
|
-
export const
|
|
75
|
-
name: `${$moduleName}::
|
|
76
|
+
export const ReferralClaimedEvent = new MoveStruct({
|
|
77
|
+
name: `${$moduleName}::ReferralClaimedEvent<phantom BaseAsset, phantom QuoteAsset>`,
|
|
76
78
|
fields: {
|
|
77
|
-
|
|
79
|
+
referral_id: bcs.Address,
|
|
80
|
+
owner: bcs.Address,
|
|
81
|
+
base_amount: bcs.u64(),
|
|
82
|
+
quote_amount: bcs.u64(),
|
|
83
|
+
deep_amount: bcs.u64(),
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
export const ReferralClaimed = new MoveStruct({
|
|
87
|
+
name: `${$moduleName}::ReferralClaimed`,
|
|
88
|
+
fields: {
|
|
89
|
+
pool_id: bcs.Address,
|
|
90
|
+
referral_id: bcs.Address,
|
|
91
|
+
owner: bcs.Address,
|
|
92
|
+
base_amount: bcs.u64(),
|
|
93
|
+
quote_amount: bcs.u64(),
|
|
94
|
+
deep_amount: bcs.u64(),
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
export const ReferralFeeEvent = new MoveStruct({
|
|
98
|
+
name: `${$moduleName}::ReferralFeeEvent`,
|
|
99
|
+
fields: {
|
|
100
|
+
pool_id: bcs.Address,
|
|
101
|
+
referral_id: bcs.Address,
|
|
102
|
+
base_fee: bcs.u64(),
|
|
103
|
+
quote_fee: bcs.u64(),
|
|
104
|
+
deep_fee: bcs.u64(),
|
|
78
105
|
},
|
|
79
106
|
});
|
|
80
107
|
export interface CreatePermissionlessPoolArguments {
|
|
@@ -104,13 +131,7 @@ export interface CreatePermissionlessPoolOptions {
|
|
|
104
131
|
*/
|
|
105
132
|
export function createPermissionlessPool(options: CreatePermissionlessPoolOptions) {
|
|
106
133
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
107
|
-
const argumentsTypes = [
|
|
108
|
-
`${packageAddress}::registry::Registry`,
|
|
109
|
-
'u64',
|
|
110
|
-
'u64',
|
|
111
|
-
'u64',
|
|
112
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${packageAddress}::deep::DEEP>`,
|
|
113
|
-
] satisfies string[];
|
|
134
|
+
const argumentsTypes = [null, 'u64', 'u64', 'u64', null] satisfies (string | null)[];
|
|
114
135
|
const parameterNames = ['registry', 'tickSize', 'lotSize', 'minSize', 'creationFee'];
|
|
115
136
|
return (tx: Transaction) =>
|
|
116
137
|
tx.moveCall({
|
|
@@ -160,9 +181,9 @@ export interface PlaceLimitOrderOptions {
|
|
|
160
181
|
export function placeLimitOrder(options: PlaceLimitOrderOptions) {
|
|
161
182
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
162
183
|
const argumentsTypes = [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
184
|
+
null,
|
|
185
|
+
null,
|
|
186
|
+
null,
|
|
166
187
|
'u64',
|
|
167
188
|
'u8',
|
|
168
189
|
'u8',
|
|
@@ -171,8 +192,8 @@ export function placeLimitOrder(options: PlaceLimitOrderOptions) {
|
|
|
171
192
|
'bool',
|
|
172
193
|
'bool',
|
|
173
194
|
'u64',
|
|
174
|
-
'
|
|
175
|
-
] satisfies string[];
|
|
195
|
+
'0x2::clock::Clock',
|
|
196
|
+
] satisfies (string | null)[];
|
|
176
197
|
const parameterNames = [
|
|
177
198
|
'self',
|
|
178
199
|
'balanceManager',
|
|
@@ -185,7 +206,6 @@ export function placeLimitOrder(options: PlaceLimitOrderOptions) {
|
|
|
185
206
|
'isBid',
|
|
186
207
|
'payWithDeep',
|
|
187
208
|
'expireTimestamp',
|
|
188
|
-
'clock',
|
|
189
209
|
];
|
|
190
210
|
return (tx: Transaction) =>
|
|
191
211
|
tx.moveCall({
|
|
@@ -230,16 +250,16 @@ export interface PlaceMarketOrderOptions {
|
|
|
230
250
|
export function placeMarketOrder(options: PlaceMarketOrderOptions) {
|
|
231
251
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
232
252
|
const argumentsTypes = [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
253
|
+
null,
|
|
254
|
+
null,
|
|
255
|
+
null,
|
|
236
256
|
'u64',
|
|
237
257
|
'u8',
|
|
238
258
|
'u64',
|
|
239
259
|
'bool',
|
|
240
260
|
'bool',
|
|
241
|
-
'
|
|
242
|
-
] satisfies string[];
|
|
261
|
+
'0x2::clock::Clock',
|
|
262
|
+
] satisfies (string | null)[];
|
|
243
263
|
const parameterNames = [
|
|
244
264
|
'self',
|
|
245
265
|
'balanceManager',
|
|
@@ -249,7 +269,6 @@ export function placeMarketOrder(options: PlaceMarketOrderOptions) {
|
|
|
249
269
|
'quantity',
|
|
250
270
|
'isBid',
|
|
251
271
|
'payWithDeep',
|
|
252
|
-
'clock',
|
|
253
272
|
];
|
|
254
273
|
return (tx: Transaction) =>
|
|
255
274
|
tx.moveCall({
|
|
@@ -284,20 +303,72 @@ export interface SwapExactBaseForQuoteOptions {
|
|
|
284
303
|
* quantity may be left over, if the input quantity is not divisible by lot size.
|
|
285
304
|
*/
|
|
286
305
|
export function swapExactBaseForQuote(options: SwapExactBaseForQuoteOptions) {
|
|
306
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
307
|
+
const argumentsTypes = [null, null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
308
|
+
const parameterNames = ['self', 'baseIn', 'deepIn', 'minQuoteOut'];
|
|
309
|
+
return (tx: Transaction) =>
|
|
310
|
+
tx.moveCall({
|
|
311
|
+
package: packageAddress,
|
|
312
|
+
module: 'pool',
|
|
313
|
+
function: 'swap_exact_base_for_quote',
|
|
314
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
315
|
+
typeArguments: options.typeArguments,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
export interface SwapExactBaseForQuoteWithManagerArguments {
|
|
319
|
+
self: RawTransactionArgument<string>;
|
|
320
|
+
balanceManager: RawTransactionArgument<string>;
|
|
321
|
+
tradeCap: RawTransactionArgument<string>;
|
|
322
|
+
depositCap: RawTransactionArgument<string>;
|
|
323
|
+
withdrawCap: RawTransactionArgument<string>;
|
|
324
|
+
baseIn: RawTransactionArgument<string>;
|
|
325
|
+
minQuoteOut: RawTransactionArgument<number | bigint>;
|
|
326
|
+
}
|
|
327
|
+
export interface SwapExactBaseForQuoteWithManagerOptions {
|
|
328
|
+
package?: string;
|
|
329
|
+
arguments:
|
|
330
|
+
| SwapExactBaseForQuoteWithManagerArguments
|
|
331
|
+
| [
|
|
332
|
+
self: RawTransactionArgument<string>,
|
|
333
|
+
balanceManager: RawTransactionArgument<string>,
|
|
334
|
+
tradeCap: RawTransactionArgument<string>,
|
|
335
|
+
depositCap: RawTransactionArgument<string>,
|
|
336
|
+
withdrawCap: RawTransactionArgument<string>,
|
|
337
|
+
baseIn: RawTransactionArgument<string>,
|
|
338
|
+
minQuoteOut: RawTransactionArgument<number | bigint>,
|
|
339
|
+
];
|
|
340
|
+
typeArguments: [string, string];
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Swap exact base for quote with a `balance_manager`. Assumes fees are paid in
|
|
344
|
+
* DEEP. Assumes balance manager has enough DEEP for fees.
|
|
345
|
+
*/
|
|
346
|
+
export function swapExactBaseForQuoteWithManager(options: SwapExactBaseForQuoteWithManagerOptions) {
|
|
287
347
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
288
348
|
const argumentsTypes = [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
349
|
+
null,
|
|
350
|
+
null,
|
|
351
|
+
null,
|
|
352
|
+
null,
|
|
353
|
+
null,
|
|
354
|
+
null,
|
|
292
355
|
'u64',
|
|
293
|
-
'
|
|
294
|
-
] satisfies string[];
|
|
295
|
-
const parameterNames = [
|
|
356
|
+
'0x2::clock::Clock',
|
|
357
|
+
] satisfies (string | null)[];
|
|
358
|
+
const parameterNames = [
|
|
359
|
+
'self',
|
|
360
|
+
'balanceManager',
|
|
361
|
+
'tradeCap',
|
|
362
|
+
'depositCap',
|
|
363
|
+
'withdrawCap',
|
|
364
|
+
'baseIn',
|
|
365
|
+
'minQuoteOut',
|
|
366
|
+
];
|
|
296
367
|
return (tx: Transaction) =>
|
|
297
368
|
tx.moveCall({
|
|
298
369
|
package: packageAddress,
|
|
299
370
|
module: 'pool',
|
|
300
|
-
function: '
|
|
371
|
+
function: 'swap_exact_base_for_quote_with_manager',
|
|
301
372
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
302
373
|
typeArguments: options.typeArguments,
|
|
303
374
|
});
|
|
@@ -327,20 +398,72 @@ export interface SwapExactQuoteForBaseOptions {
|
|
|
327
398
|
* size.
|
|
328
399
|
*/
|
|
329
400
|
export function swapExactQuoteForBase(options: SwapExactQuoteForBaseOptions) {
|
|
401
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
402
|
+
const argumentsTypes = [null, null, null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
403
|
+
const parameterNames = ['self', 'quoteIn', 'deepIn', 'minBaseOut'];
|
|
404
|
+
return (tx: Transaction) =>
|
|
405
|
+
tx.moveCall({
|
|
406
|
+
package: packageAddress,
|
|
407
|
+
module: 'pool',
|
|
408
|
+
function: 'swap_exact_quote_for_base',
|
|
409
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
410
|
+
typeArguments: options.typeArguments,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
export interface SwapExactQuoteForBaseWithManagerArguments {
|
|
414
|
+
self: RawTransactionArgument<string>;
|
|
415
|
+
balanceManager: RawTransactionArgument<string>;
|
|
416
|
+
tradeCap: RawTransactionArgument<string>;
|
|
417
|
+
depositCap: RawTransactionArgument<string>;
|
|
418
|
+
withdrawCap: RawTransactionArgument<string>;
|
|
419
|
+
quoteIn: RawTransactionArgument<string>;
|
|
420
|
+
minBaseOut: RawTransactionArgument<number | bigint>;
|
|
421
|
+
}
|
|
422
|
+
export interface SwapExactQuoteForBaseWithManagerOptions {
|
|
423
|
+
package?: string;
|
|
424
|
+
arguments:
|
|
425
|
+
| SwapExactQuoteForBaseWithManagerArguments
|
|
426
|
+
| [
|
|
427
|
+
self: RawTransactionArgument<string>,
|
|
428
|
+
balanceManager: RawTransactionArgument<string>,
|
|
429
|
+
tradeCap: RawTransactionArgument<string>,
|
|
430
|
+
depositCap: RawTransactionArgument<string>,
|
|
431
|
+
withdrawCap: RawTransactionArgument<string>,
|
|
432
|
+
quoteIn: RawTransactionArgument<string>,
|
|
433
|
+
minBaseOut: RawTransactionArgument<number | bigint>,
|
|
434
|
+
];
|
|
435
|
+
typeArguments: [string, string];
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Swap exact quote for base with a `balance_manager`. Assumes fees are paid in
|
|
439
|
+
* DEEP. Assumes balance manager has enough DEEP for fees.
|
|
440
|
+
*/
|
|
441
|
+
export function swapExactQuoteForBaseWithManager(options: SwapExactQuoteForBaseWithManagerOptions) {
|
|
330
442
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
331
443
|
const argumentsTypes = [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
444
|
+
null,
|
|
445
|
+
null,
|
|
446
|
+
null,
|
|
447
|
+
null,
|
|
448
|
+
null,
|
|
449
|
+
null,
|
|
335
450
|
'u64',
|
|
336
|
-
'
|
|
337
|
-
] satisfies string[];
|
|
338
|
-
const parameterNames = [
|
|
451
|
+
'0x2::clock::Clock',
|
|
452
|
+
] satisfies (string | null)[];
|
|
453
|
+
const parameterNames = [
|
|
454
|
+
'self',
|
|
455
|
+
'balanceManager',
|
|
456
|
+
'tradeCap',
|
|
457
|
+
'depositCap',
|
|
458
|
+
'withdrawCap',
|
|
459
|
+
'quoteIn',
|
|
460
|
+
'minBaseOut',
|
|
461
|
+
];
|
|
339
462
|
return (tx: Transaction) =>
|
|
340
463
|
tx.moveCall({
|
|
341
464
|
package: packageAddress,
|
|
342
465
|
module: 'pool',
|
|
343
|
-
function: '
|
|
466
|
+
function: 'swap_exact_quote_for_base_with_manager',
|
|
344
467
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
345
468
|
typeArguments: options.typeArguments,
|
|
346
469
|
});
|
|
@@ -367,21 +490,79 @@ export interface SwapExactQuantityOptions {
|
|
|
367
490
|
}
|
|
368
491
|
/** Swap exact quantity without needing a balance_manager. */
|
|
369
492
|
export function swapExactQuantity(options: SwapExactQuantityOptions) {
|
|
493
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
494
|
+
const argumentsTypes = [null, null, null, null, 'u64', '0x2::clock::Clock'] satisfies (
|
|
495
|
+
| string
|
|
496
|
+
| null
|
|
497
|
+
)[];
|
|
498
|
+
const parameterNames = ['self', 'baseIn', 'quoteIn', 'deepIn', 'minOut'];
|
|
499
|
+
return (tx: Transaction) =>
|
|
500
|
+
tx.moveCall({
|
|
501
|
+
package: packageAddress,
|
|
502
|
+
module: 'pool',
|
|
503
|
+
function: 'swap_exact_quantity',
|
|
504
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
505
|
+
typeArguments: options.typeArguments,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
export interface SwapExactQuantityWithManagerArguments {
|
|
509
|
+
self: RawTransactionArgument<string>;
|
|
510
|
+
balanceManager: RawTransactionArgument<string>;
|
|
511
|
+
tradeCap: RawTransactionArgument<string>;
|
|
512
|
+
depositCap: RawTransactionArgument<string>;
|
|
513
|
+
withdrawCap: RawTransactionArgument<string>;
|
|
514
|
+
baseIn: RawTransactionArgument<string>;
|
|
515
|
+
quoteIn: RawTransactionArgument<string>;
|
|
516
|
+
minOut: RawTransactionArgument<number | bigint>;
|
|
517
|
+
}
|
|
518
|
+
export interface SwapExactQuantityWithManagerOptions {
|
|
519
|
+
package?: string;
|
|
520
|
+
arguments:
|
|
521
|
+
| SwapExactQuantityWithManagerArguments
|
|
522
|
+
| [
|
|
523
|
+
self: RawTransactionArgument<string>,
|
|
524
|
+
balanceManager: RawTransactionArgument<string>,
|
|
525
|
+
tradeCap: RawTransactionArgument<string>,
|
|
526
|
+
depositCap: RawTransactionArgument<string>,
|
|
527
|
+
withdrawCap: RawTransactionArgument<string>,
|
|
528
|
+
baseIn: RawTransactionArgument<string>,
|
|
529
|
+
quoteIn: RawTransactionArgument<string>,
|
|
530
|
+
minOut: RawTransactionArgument<number | bigint>,
|
|
531
|
+
];
|
|
532
|
+
typeArguments: [string, string];
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Swap exact quantity with a `balance_manager`. Assumes fees are paid in DEEP.
|
|
536
|
+
* Assumes balance manager has enough DEEP for fees.
|
|
537
|
+
*/
|
|
538
|
+
export function swapExactQuantityWithManager(options: SwapExactQuantityWithManagerOptions) {
|
|
370
539
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
371
540
|
const argumentsTypes = [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
541
|
+
null,
|
|
542
|
+
null,
|
|
543
|
+
null,
|
|
544
|
+
null,
|
|
545
|
+
null,
|
|
546
|
+
null,
|
|
547
|
+
null,
|
|
376
548
|
'u64',
|
|
377
|
-
'
|
|
378
|
-
] satisfies string[];
|
|
379
|
-
const parameterNames = [
|
|
549
|
+
'0x2::clock::Clock',
|
|
550
|
+
] satisfies (string | null)[];
|
|
551
|
+
const parameterNames = [
|
|
552
|
+
'self',
|
|
553
|
+
'balanceManager',
|
|
554
|
+
'tradeCap',
|
|
555
|
+
'depositCap',
|
|
556
|
+
'withdrawCap',
|
|
557
|
+
'baseIn',
|
|
558
|
+
'quoteIn',
|
|
559
|
+
'minOut',
|
|
560
|
+
];
|
|
380
561
|
return (tx: Transaction) =>
|
|
381
562
|
tx.moveCall({
|
|
382
563
|
package: packageAddress,
|
|
383
564
|
module: 'pool',
|
|
384
|
-
function: '
|
|
565
|
+
function: 'swap_exact_quantity_with_manager',
|
|
385
566
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
386
567
|
typeArguments: options.typeArguments,
|
|
387
568
|
});
|
|
@@ -413,22 +594,11 @@ export interface ModifyOrderOptions {
|
|
|
413
594
|
*/
|
|
414
595
|
export function modifyOrder(options: ModifyOrderOptions) {
|
|
415
596
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
416
|
-
const argumentsTypes = [
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
'u64',
|
|
422
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
423
|
-
] satisfies string[];
|
|
424
|
-
const parameterNames = [
|
|
425
|
-
'self',
|
|
426
|
-
'balanceManager',
|
|
427
|
-
'tradeProof',
|
|
428
|
-
'orderId',
|
|
429
|
-
'newQuantity',
|
|
430
|
-
'clock',
|
|
431
|
-
];
|
|
597
|
+
const argumentsTypes = [null, null, null, 'u128', 'u64', '0x2::clock::Clock'] satisfies (
|
|
598
|
+
| string
|
|
599
|
+
| null
|
|
600
|
+
)[];
|
|
601
|
+
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'orderId', 'newQuantity'];
|
|
432
602
|
return (tx: Transaction) =>
|
|
433
603
|
tx.moveCall({
|
|
434
604
|
package: packageAddress,
|
|
@@ -464,14 +634,11 @@ export interface CancelOrderOptions {
|
|
|
464
634
|
*/
|
|
465
635
|
export function cancelOrder(options: CancelOrderOptions) {
|
|
466
636
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
467
|
-
const argumentsTypes = [
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
473
|
-
] satisfies string[];
|
|
474
|
-
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'orderId', 'clock'];
|
|
637
|
+
const argumentsTypes = [null, null, null, 'u128', '0x2::clock::Clock'] satisfies (
|
|
638
|
+
| string
|
|
639
|
+
| null
|
|
640
|
+
)[];
|
|
641
|
+
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'orderId'];
|
|
475
642
|
return (tx: Transaction) =>
|
|
476
643
|
tx.moveCall({
|
|
477
644
|
package: packageAddress,
|
|
@@ -507,14 +674,11 @@ export interface CancelOrdersOptions {
|
|
|
507
674
|
*/
|
|
508
675
|
export function cancelOrders(options: CancelOrdersOptions) {
|
|
509
676
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
510
|
-
const argumentsTypes = [
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
516
|
-
] satisfies string[];
|
|
517
|
-
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'orderIds', 'clock'];
|
|
677
|
+
const argumentsTypes = [null, null, null, 'vector<u128>', '0x2::clock::Clock'] satisfies (
|
|
678
|
+
| string
|
|
679
|
+
| null
|
|
680
|
+
)[];
|
|
681
|
+
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'orderIds'];
|
|
518
682
|
return (tx: Transaction) =>
|
|
519
683
|
tx.moveCall({
|
|
520
684
|
package: packageAddress,
|
|
@@ -543,13 +707,8 @@ export interface CancelAllOrdersOptions {
|
|
|
543
707
|
/** Cancel all open orders placed by the balance manager in the pool. */
|
|
544
708
|
export function cancelAllOrders(options: CancelAllOrdersOptions) {
|
|
545
709
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
546
|
-
const argumentsTypes = [
|
|
547
|
-
|
|
548
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
549
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
550
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
551
|
-
] satisfies string[];
|
|
552
|
-
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'clock'];
|
|
710
|
+
const argumentsTypes = [null, null, null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
711
|
+
const parameterNames = ['self', 'balanceManager', 'tradeProof'];
|
|
553
712
|
return (tx: Transaction) =>
|
|
554
713
|
tx.moveCall({
|
|
555
714
|
package: packageAddress,
|
|
@@ -578,11 +737,7 @@ export interface WithdrawSettledAmountsOptions {
|
|
|
578
737
|
/** Withdraw settled amounts to the `balance_manager`. */
|
|
579
738
|
export function withdrawSettledAmounts(options: WithdrawSettledAmountsOptions) {
|
|
580
739
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
581
|
-
const argumentsTypes = [
|
|
582
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
583
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
584
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
585
|
-
] satisfies string[];
|
|
740
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
586
741
|
const parameterNames = ['self', 'balanceManager', 'tradeProof'];
|
|
587
742
|
return (tx: Transaction) =>
|
|
588
743
|
tx.moveCall({
|
|
@@ -593,6 +748,33 @@ export function withdrawSettledAmounts(options: WithdrawSettledAmountsOptions) {
|
|
|
593
748
|
typeArguments: options.typeArguments,
|
|
594
749
|
});
|
|
595
750
|
}
|
|
751
|
+
export interface WithdrawSettledAmountsPermissionlessArguments {
|
|
752
|
+
self: RawTransactionArgument<string>;
|
|
753
|
+
balanceManager: RawTransactionArgument<string>;
|
|
754
|
+
}
|
|
755
|
+
export interface WithdrawSettledAmountsPermissionlessOptions {
|
|
756
|
+
package?: string;
|
|
757
|
+
arguments:
|
|
758
|
+
| WithdrawSettledAmountsPermissionlessArguments
|
|
759
|
+
| [self: RawTransactionArgument<string>, balanceManager: RawTransactionArgument<string>];
|
|
760
|
+
typeArguments: [string, string];
|
|
761
|
+
}
|
|
762
|
+
/** Withdraw settled amounts permissionlessly to the `balance_manager`. */
|
|
763
|
+
export function withdrawSettledAmountsPermissionless(
|
|
764
|
+
options: WithdrawSettledAmountsPermissionlessOptions,
|
|
765
|
+
) {
|
|
766
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
767
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
768
|
+
const parameterNames = ['self', 'balanceManager'];
|
|
769
|
+
return (tx: Transaction) =>
|
|
770
|
+
tx.moveCall({
|
|
771
|
+
package: packageAddress,
|
|
772
|
+
module: 'pool',
|
|
773
|
+
function: 'withdraw_settled_amounts_permissionless',
|
|
774
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
775
|
+
typeArguments: options.typeArguments,
|
|
776
|
+
});
|
|
777
|
+
}
|
|
596
778
|
export interface StakeArguments {
|
|
597
779
|
self: RawTransactionArgument<string>;
|
|
598
780
|
balanceManager: RawTransactionArgument<string>;
|
|
@@ -617,12 +799,7 @@ export interface StakeOptions {
|
|
|
617
799
|
*/
|
|
618
800
|
export function stake(options: StakeOptions) {
|
|
619
801
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
620
|
-
const argumentsTypes = [
|
|
621
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
622
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
623
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
624
|
-
'u64',
|
|
625
|
-
] satisfies string[];
|
|
802
|
+
const argumentsTypes = [null, null, null, 'u64'] satisfies (string | null)[];
|
|
626
803
|
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'amount'];
|
|
627
804
|
return (tx: Transaction) =>
|
|
628
805
|
tx.moveCall({
|
|
@@ -656,11 +833,7 @@ export interface UnstakeOptions {
|
|
|
656
833
|
*/
|
|
657
834
|
export function unstake(options: UnstakeOptions) {
|
|
658
835
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
659
|
-
const argumentsTypes = [
|
|
660
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
661
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
662
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
663
|
-
] satisfies string[];
|
|
836
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
664
837
|
const parameterNames = ['self', 'balanceManager', 'tradeProof'];
|
|
665
838
|
return (tx: Transaction) =>
|
|
666
839
|
tx.moveCall({
|
|
@@ -702,14 +875,7 @@ export interface SubmitProposalOptions {
|
|
|
702
875
|
*/
|
|
703
876
|
export function submitProposal(options: SubmitProposalOptions) {
|
|
704
877
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
705
|
-
const argumentsTypes = [
|
|
706
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
707
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
708
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
709
|
-
'u64',
|
|
710
|
-
'u64',
|
|
711
|
-
'u64',
|
|
712
|
-
] satisfies string[];
|
|
878
|
+
const argumentsTypes = [null, null, null, 'u64', 'u64', 'u64'] satisfies (string | null)[];
|
|
713
879
|
const parameterNames = [
|
|
714
880
|
'self',
|
|
715
881
|
'balanceManager',
|
|
@@ -752,12 +918,7 @@ export interface VoteOptions {
|
|
|
752
918
|
*/
|
|
753
919
|
export function vote(options: VoteOptions) {
|
|
754
920
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
755
|
-
const argumentsTypes = [
|
|
756
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
757
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
758
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
759
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::object::ID',
|
|
760
|
-
] satisfies string[];
|
|
921
|
+
const argumentsTypes = [null, null, null, '0x2::object::ID'] satisfies (string | null)[];
|
|
761
922
|
const parameterNames = ['self', 'balanceManager', 'tradeProof', 'proposalId'];
|
|
762
923
|
return (tx: Transaction) =>
|
|
763
924
|
tx.moveCall({
|
|
@@ -790,11 +951,7 @@ export interface ClaimRebatesOptions {
|
|
|
790
951
|
*/
|
|
791
952
|
export function claimRebates(options: ClaimRebatesOptions) {
|
|
792
953
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
793
|
-
const argumentsTypes = [
|
|
794
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
795
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
796
|
-
`${packageAddress}::balance_manager::TradeProof`,
|
|
797
|
-
] satisfies string[];
|
|
954
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
798
955
|
const parameterNames = ['self', 'balanceManager', 'tradeProof'];
|
|
799
956
|
return (tx: Transaction) =>
|
|
800
957
|
tx.moveCall({
|
|
@@ -822,10 +979,7 @@ export interface BorrowFlashloanBaseOptions {
|
|
|
822
979
|
*/
|
|
823
980
|
export function borrowFlashloanBase(options: BorrowFlashloanBaseOptions) {
|
|
824
981
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
825
|
-
const argumentsTypes = [
|
|
826
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
827
|
-
'u64',
|
|
828
|
-
] satisfies string[];
|
|
982
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
829
983
|
const parameterNames = ['self', 'baseAmount'];
|
|
830
984
|
return (tx: Transaction) =>
|
|
831
985
|
tx.moveCall({
|
|
@@ -853,10 +1007,7 @@ export interface BorrowFlashloanQuoteOptions {
|
|
|
853
1007
|
*/
|
|
854
1008
|
export function borrowFlashloanQuote(options: BorrowFlashloanQuoteOptions) {
|
|
855
1009
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
856
|
-
const argumentsTypes = [
|
|
857
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
858
|
-
'u64',
|
|
859
|
-
] satisfies string[];
|
|
1010
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
860
1011
|
const parameterNames = ['self', 'quoteAmount'];
|
|
861
1012
|
return (tx: Transaction) =>
|
|
862
1013
|
tx.moveCall({
|
|
@@ -889,11 +1040,7 @@ export interface ReturnFlashloanBaseOptions {
|
|
|
889
1040
|
*/
|
|
890
1041
|
export function returnFlashloanBase(options: ReturnFlashloanBaseOptions) {
|
|
891
1042
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
892
|
-
const argumentsTypes = [
|
|
893
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
894
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[0]}>`,
|
|
895
|
-
`${packageAddress}::vault::FlashLoan`,
|
|
896
|
-
] satisfies string[];
|
|
1043
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
897
1044
|
const parameterNames = ['self', 'coin', 'flashLoan'];
|
|
898
1045
|
return (tx: Transaction) =>
|
|
899
1046
|
tx.moveCall({
|
|
@@ -926,11 +1073,7 @@ export interface ReturnFlashloanQuoteOptions {
|
|
|
926
1073
|
*/
|
|
927
1074
|
export function returnFlashloanQuote(options: ReturnFlashloanQuoteOptions) {
|
|
928
1075
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
929
|
-
const argumentsTypes = [
|
|
930
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
931
|
-
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::Coin<${options.typeArguments[1]}>`,
|
|
932
|
-
`${packageAddress}::vault::FlashLoan`,
|
|
933
|
-
] satisfies string[];
|
|
1076
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
934
1077
|
const parameterNames = ['self', 'coin', 'flashLoan'];
|
|
935
1078
|
return (tx: Transaction) =>
|
|
936
1079
|
tx.moveCall({
|
|
@@ -958,12 +1101,8 @@ export interface AddDeepPricePointOptions {
|
|
|
958
1101
|
*/
|
|
959
1102
|
export function addDeepPricePoint(options: AddDeepPricePointOptions) {
|
|
960
1103
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
961
|
-
const argumentsTypes = [
|
|
962
|
-
|
|
963
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[2]}, ${options.typeArguments[3]}>`,
|
|
964
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
965
|
-
] satisfies string[];
|
|
966
|
-
const parameterNames = ['targetPool', 'referencePool', 'clock'];
|
|
1104
|
+
const argumentsTypes = [null, null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1105
|
+
const parameterNames = ['targetPool', 'referencePool'];
|
|
967
1106
|
return (tx: Transaction) =>
|
|
968
1107
|
tx.moveCall({
|
|
969
1108
|
package: packageAddress,
|
|
@@ -987,10 +1126,7 @@ export interface BurnDeepOptions {
|
|
|
987
1126
|
/** Burns DEEP tokens from the pool. Amount to burn is within history */
|
|
988
1127
|
export function burnDeep(options: BurnDeepOptions) {
|
|
989
1128
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
990
|
-
const argumentsTypes = [
|
|
991
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
992
|
-
`${packageAddress}::deep::ProtectedTreasury`,
|
|
993
|
-
] satisfies string[];
|
|
1129
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
994
1130
|
const parameterNames = ['self', 'treasuryCap'];
|
|
995
1131
|
return (tx: Transaction) =>
|
|
996
1132
|
tx.moveCall({
|
|
@@ -1001,295 +1137,377 @@ export function burnDeep(options: BurnDeepOptions) {
|
|
|
1001
1137
|
typeArguments: options.typeArguments,
|
|
1002
1138
|
});
|
|
1003
1139
|
}
|
|
1004
|
-
export interface
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
lotSize: RawTransactionArgument<number | bigint>;
|
|
1008
|
-
minSize: RawTransactionArgument<number | bigint>;
|
|
1009
|
-
whitelistedPool: RawTransactionArgument<boolean>;
|
|
1010
|
-
stablePool: RawTransactionArgument<boolean>;
|
|
1011
|
-
Cap: RawTransactionArgument<string>;
|
|
1140
|
+
export interface MintReferralArguments {
|
|
1141
|
+
self: RawTransactionArgument<string>;
|
|
1142
|
+
multiplier: RawTransactionArgument<number | bigint>;
|
|
1012
1143
|
}
|
|
1013
|
-
export interface
|
|
1144
|
+
export interface MintReferralOptions {
|
|
1014
1145
|
package?: string;
|
|
1015
1146
|
arguments:
|
|
1016
|
-
|
|
|
1147
|
+
| MintReferralArguments
|
|
1148
|
+
| [self: RawTransactionArgument<string>, multiplier: RawTransactionArgument<number | bigint>];
|
|
1149
|
+
typeArguments: [string, string];
|
|
1150
|
+
}
|
|
1151
|
+
/** Mint a DeepBookReferral and set the additional bps for the referral. */
|
|
1152
|
+
export function mintReferral(options: MintReferralOptions) {
|
|
1153
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1154
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
1155
|
+
const parameterNames = ['self', 'multiplier'];
|
|
1156
|
+
return (tx: Transaction) =>
|
|
1157
|
+
tx.moveCall({
|
|
1158
|
+
package: packageAddress,
|
|
1159
|
+
module: 'pool',
|
|
1160
|
+
function: 'mint_referral',
|
|
1161
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1162
|
+
typeArguments: options.typeArguments,
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
export interface UpdateReferralMultiplierArguments {
|
|
1166
|
+
Self: RawTransactionArgument<string>;
|
|
1167
|
+
Referral: RawTransactionArgument<string>;
|
|
1168
|
+
Multiplier: RawTransactionArgument<number | bigint>;
|
|
1169
|
+
}
|
|
1170
|
+
export interface UpdateReferralMultiplierOptions {
|
|
1171
|
+
package?: string;
|
|
1172
|
+
arguments:
|
|
1173
|
+
| UpdateReferralMultiplierArguments
|
|
1017
1174
|
| [
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
minSize: RawTransactionArgument<number | bigint>,
|
|
1022
|
-
whitelistedPool: RawTransactionArgument<boolean>,
|
|
1023
|
-
stablePool: RawTransactionArgument<boolean>,
|
|
1024
|
-
Cap: RawTransactionArgument<string>,
|
|
1175
|
+
Self: RawTransactionArgument<string>,
|
|
1176
|
+
Referral: RawTransactionArgument<string>,
|
|
1177
|
+
Multiplier: RawTransactionArgument<number | bigint>,
|
|
1025
1178
|
];
|
|
1026
1179
|
typeArguments: [string, string];
|
|
1027
1180
|
}
|
|
1028
|
-
|
|
1029
|
-
* Create a new pool. The pool is registered in the registry. Checks are performed
|
|
1030
|
-
* to ensure the tick size, lot size, and min size are valid. Returns the id of the
|
|
1031
|
-
* pool created
|
|
1032
|
-
*/
|
|
1033
|
-
export function createPoolAdmin(options: CreatePoolAdminOptions) {
|
|
1181
|
+
export function updateReferralMultiplier(options: UpdateReferralMultiplierOptions) {
|
|
1034
1182
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1035
|
-
const argumentsTypes = [
|
|
1036
|
-
|
|
1037
|
-
'u64',
|
|
1038
|
-
'u64',
|
|
1039
|
-
'u64',
|
|
1040
|
-
'bool',
|
|
1041
|
-
'bool',
|
|
1042
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1043
|
-
] satisfies string[];
|
|
1044
|
-
const parameterNames = [
|
|
1045
|
-
'registry',
|
|
1046
|
-
'tickSize',
|
|
1047
|
-
'lotSize',
|
|
1048
|
-
'minSize',
|
|
1049
|
-
'whitelistedPool',
|
|
1050
|
-
'stablePool',
|
|
1051
|
-
'Cap',
|
|
1052
|
-
];
|
|
1183
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
1184
|
+
const parameterNames = ['Self', 'Referral', 'Multiplier'];
|
|
1053
1185
|
return (tx: Transaction) =>
|
|
1054
1186
|
tx.moveCall({
|
|
1055
1187
|
package: packageAddress,
|
|
1056
1188
|
module: 'pool',
|
|
1057
|
-
function: '
|
|
1189
|
+
function: 'update_referral_multiplier',
|
|
1058
1190
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1059
1191
|
typeArguments: options.typeArguments,
|
|
1060
1192
|
});
|
|
1061
1193
|
}
|
|
1062
|
-
export interface
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1194
|
+
export interface UpdateDeepbookReferralMultiplierArguments {
|
|
1195
|
+
Self: RawTransactionArgument<string>;
|
|
1196
|
+
Referral: RawTransactionArgument<string>;
|
|
1197
|
+
Multiplier: RawTransactionArgument<number | bigint>;
|
|
1066
1198
|
}
|
|
1067
|
-
export interface
|
|
1199
|
+
export interface UpdateDeepbookReferralMultiplierOptions {
|
|
1068
1200
|
package?: string;
|
|
1069
1201
|
arguments:
|
|
1070
|
-
|
|
|
1202
|
+
| UpdateDeepbookReferralMultiplierArguments
|
|
1071
1203
|
| [
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1204
|
+
Self: RawTransactionArgument<string>,
|
|
1205
|
+
Referral: RawTransactionArgument<string>,
|
|
1206
|
+
Multiplier: RawTransactionArgument<number | bigint>,
|
|
1075
1207
|
];
|
|
1076
1208
|
typeArguments: [string, string];
|
|
1077
1209
|
}
|
|
1078
|
-
|
|
1079
|
-
export function unregisterPoolAdmin(options: UnregisterPoolAdminOptions) {
|
|
1210
|
+
export function updateDeepbookReferralMultiplier(options: UpdateDeepbookReferralMultiplierOptions) {
|
|
1080
1211
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1081
|
-
const argumentsTypes = [
|
|
1082
|
-
|
|
1083
|
-
`${packageAddress}::registry::Registry`,
|
|
1084
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1085
|
-
] satisfies string[];
|
|
1086
|
-
const parameterNames = ['self', 'registry', 'Cap'];
|
|
1212
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
1213
|
+
const parameterNames = ['Self', 'Referral', 'Multiplier'];
|
|
1087
1214
|
return (tx: Transaction) =>
|
|
1088
1215
|
tx.moveCall({
|
|
1089
1216
|
package: packageAddress,
|
|
1090
1217
|
module: 'pool',
|
|
1091
|
-
function: '
|
|
1218
|
+
function: 'update_deepbook_referral_multiplier',
|
|
1092
1219
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1093
1220
|
typeArguments: options.typeArguments,
|
|
1094
1221
|
});
|
|
1095
1222
|
}
|
|
1096
|
-
export interface
|
|
1223
|
+
export interface UpdatePoolReferralMultiplierArguments {
|
|
1097
1224
|
self: RawTransactionArgument<string>;
|
|
1098
|
-
|
|
1099
|
-
|
|
1225
|
+
referral: RawTransactionArgument<string>;
|
|
1226
|
+
multiplier: RawTransactionArgument<number | bigint>;
|
|
1100
1227
|
}
|
|
1101
|
-
export interface
|
|
1228
|
+
export interface UpdatePoolReferralMultiplierOptions {
|
|
1102
1229
|
package?: string;
|
|
1103
1230
|
arguments:
|
|
1104
|
-
|
|
|
1231
|
+
| UpdatePoolReferralMultiplierArguments
|
|
1105
1232
|
| [
|
|
1106
1233
|
self: RawTransactionArgument<string>,
|
|
1107
|
-
|
|
1108
|
-
|
|
1234
|
+
referral: RawTransactionArgument<string>,
|
|
1235
|
+
multiplier: RawTransactionArgument<number | bigint>,
|
|
1109
1236
|
];
|
|
1110
1237
|
typeArguments: [string, string];
|
|
1111
1238
|
}
|
|
1112
|
-
/**
|
|
1113
|
-
|
|
1114
|
-
* update the allowed versions This function does not have version restrictions
|
|
1115
|
-
*/
|
|
1116
|
-
export function updateAllowedVersions(options: UpdateAllowedVersionsOptions) {
|
|
1239
|
+
/** Update the multiplier for the referral. */
|
|
1240
|
+
export function updatePoolReferralMultiplier(options: UpdatePoolReferralMultiplierOptions) {
|
|
1117
1241
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1118
|
-
const argumentsTypes = [
|
|
1119
|
-
|
|
1120
|
-
`${packageAddress}::registry::Registry`,
|
|
1121
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1122
|
-
] satisfies string[];
|
|
1123
|
-
const parameterNames = ['self', 'registry', 'Cap'];
|
|
1242
|
+
const argumentsTypes = [null, null, 'u64'] satisfies (string | null)[];
|
|
1243
|
+
const parameterNames = ['self', 'referral', 'multiplier'];
|
|
1124
1244
|
return (tx: Transaction) =>
|
|
1125
1245
|
tx.moveCall({
|
|
1126
1246
|
package: packageAddress,
|
|
1127
1247
|
module: 'pool',
|
|
1128
|
-
function: '
|
|
1248
|
+
function: 'update_pool_referral_multiplier',
|
|
1129
1249
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1130
1250
|
typeArguments: options.typeArguments,
|
|
1131
1251
|
});
|
|
1132
1252
|
}
|
|
1133
|
-
export interface
|
|
1134
|
-
|
|
1135
|
-
|
|
1253
|
+
export interface ClaimReferralRewardsArguments {
|
|
1254
|
+
Self: RawTransactionArgument<string>;
|
|
1255
|
+
Referral: RawTransactionArgument<string>;
|
|
1136
1256
|
}
|
|
1137
|
-
export interface
|
|
1257
|
+
export interface ClaimReferralRewardsOptions {
|
|
1138
1258
|
package?: string;
|
|
1139
1259
|
arguments:
|
|
1140
|
-
|
|
|
1141
|
-
| [
|
|
1260
|
+
| ClaimReferralRewardsArguments
|
|
1261
|
+
| [Self: RawTransactionArgument<string>, Referral: RawTransactionArgument<string>];
|
|
1142
1262
|
typeArguments: [string, string];
|
|
1143
1263
|
}
|
|
1144
|
-
|
|
1145
|
-
* Takes the registry and updates the allowed version within pool Permissionless
|
|
1146
|
-
* equivalent of `update_allowed_versions` This function does not have version
|
|
1147
|
-
* restrictions
|
|
1148
|
-
*/
|
|
1149
|
-
export function updatePoolAllowedVersions(options: UpdatePoolAllowedVersionsOptions) {
|
|
1264
|
+
export function claimReferralRewards(options: ClaimReferralRewardsOptions) {
|
|
1150
1265
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1151
|
-
const argumentsTypes = [
|
|
1152
|
-
|
|
1153
|
-
`${packageAddress}::registry::Registry`,
|
|
1154
|
-
] satisfies string[];
|
|
1155
|
-
const parameterNames = ['self', 'registry'];
|
|
1266
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
1267
|
+
const parameterNames = ['Self', 'Referral'];
|
|
1156
1268
|
return (tx: Transaction) =>
|
|
1157
1269
|
tx.moveCall({
|
|
1158
1270
|
package: packageAddress,
|
|
1159
1271
|
module: 'pool',
|
|
1160
|
-
function: '
|
|
1272
|
+
function: 'claim_referral_rewards',
|
|
1161
1273
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1162
1274
|
typeArguments: options.typeArguments,
|
|
1163
1275
|
});
|
|
1164
1276
|
}
|
|
1165
|
-
export interface
|
|
1277
|
+
export interface ClaimPoolReferralRewardsArguments {
|
|
1166
1278
|
self: RawTransactionArgument<string>;
|
|
1167
|
-
|
|
1279
|
+
referral: RawTransactionArgument<string>;
|
|
1280
|
+
}
|
|
1281
|
+
export interface ClaimPoolReferralRewardsOptions {
|
|
1282
|
+
package?: string;
|
|
1283
|
+
arguments:
|
|
1284
|
+
| ClaimPoolReferralRewardsArguments
|
|
1285
|
+
| [self: RawTransactionArgument<string>, referral: RawTransactionArgument<string>];
|
|
1286
|
+
typeArguments: [string, string];
|
|
1287
|
+
}
|
|
1288
|
+
/** Claim the rewards for the referral. */
|
|
1289
|
+
export function claimPoolReferralRewards(options: ClaimPoolReferralRewardsOptions) {
|
|
1290
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1291
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
1292
|
+
const parameterNames = ['self', 'referral'];
|
|
1293
|
+
return (tx: Transaction) =>
|
|
1294
|
+
tx.moveCall({
|
|
1295
|
+
package: packageAddress,
|
|
1296
|
+
module: 'pool',
|
|
1297
|
+
function: 'claim_pool_referral_rewards',
|
|
1298
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1299
|
+
typeArguments: options.typeArguments,
|
|
1300
|
+
});
|
|
1301
|
+
}
|
|
1302
|
+
export interface CreatePoolAdminArguments {
|
|
1303
|
+
registry: RawTransactionArgument<string>;
|
|
1304
|
+
tickSize: RawTransactionArgument<number | bigint>;
|
|
1305
|
+
lotSize: RawTransactionArgument<number | bigint>;
|
|
1306
|
+
minSize: RawTransactionArgument<number | bigint>;
|
|
1307
|
+
whitelistedPool: RawTransactionArgument<boolean>;
|
|
1308
|
+
stablePool: RawTransactionArgument<boolean>;
|
|
1168
1309
|
Cap: RawTransactionArgument<string>;
|
|
1169
1310
|
}
|
|
1170
|
-
export interface
|
|
1311
|
+
export interface CreatePoolAdminOptions {
|
|
1171
1312
|
package?: string;
|
|
1172
1313
|
arguments:
|
|
1173
|
-
|
|
|
1314
|
+
| CreatePoolAdminArguments
|
|
1315
|
+
| [
|
|
1316
|
+
registry: RawTransactionArgument<string>,
|
|
1317
|
+
tickSize: RawTransactionArgument<number | bigint>,
|
|
1318
|
+
lotSize: RawTransactionArgument<number | bigint>,
|
|
1319
|
+
minSize: RawTransactionArgument<number | bigint>,
|
|
1320
|
+
whitelistedPool: RawTransactionArgument<boolean>,
|
|
1321
|
+
stablePool: RawTransactionArgument<boolean>,
|
|
1322
|
+
Cap: RawTransactionArgument<string>,
|
|
1323
|
+
];
|
|
1324
|
+
typeArguments: [string, string];
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Create a new pool. The pool is registered in the registry. Checks are performed
|
|
1328
|
+
* to ensure the tick size, lot size, and min size are valid. Returns the id of the
|
|
1329
|
+
* pool created
|
|
1330
|
+
*/
|
|
1331
|
+
export function createPoolAdmin(options: CreatePoolAdminOptions) {
|
|
1332
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1333
|
+
const argumentsTypes = [null, 'u64', 'u64', 'u64', 'bool', 'bool', null] satisfies (
|
|
1334
|
+
| string
|
|
1335
|
+
| null
|
|
1336
|
+
)[];
|
|
1337
|
+
const parameterNames = [
|
|
1338
|
+
'registry',
|
|
1339
|
+
'tickSize',
|
|
1340
|
+
'lotSize',
|
|
1341
|
+
'minSize',
|
|
1342
|
+
'whitelistedPool',
|
|
1343
|
+
'stablePool',
|
|
1344
|
+
'Cap',
|
|
1345
|
+
];
|
|
1346
|
+
return (tx: Transaction) =>
|
|
1347
|
+
tx.moveCall({
|
|
1348
|
+
package: packageAddress,
|
|
1349
|
+
module: 'pool',
|
|
1350
|
+
function: 'create_pool_admin',
|
|
1351
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1352
|
+
typeArguments: options.typeArguments,
|
|
1353
|
+
});
|
|
1354
|
+
}
|
|
1355
|
+
export interface UnregisterPoolAdminArguments {
|
|
1356
|
+
self: RawTransactionArgument<string>;
|
|
1357
|
+
registry: RawTransactionArgument<string>;
|
|
1358
|
+
Cap: RawTransactionArgument<string>;
|
|
1359
|
+
}
|
|
1360
|
+
export interface UnregisterPoolAdminOptions {
|
|
1361
|
+
package?: string;
|
|
1362
|
+
arguments:
|
|
1363
|
+
| UnregisterPoolAdminArguments
|
|
1174
1364
|
| [
|
|
1175
1365
|
self: RawTransactionArgument<string>,
|
|
1176
|
-
|
|
1366
|
+
registry: RawTransactionArgument<string>,
|
|
1177
1367
|
Cap: RawTransactionArgument<string>,
|
|
1178
1368
|
];
|
|
1179
1369
|
typeArguments: [string, string];
|
|
1180
1370
|
}
|
|
1181
|
-
/**
|
|
1182
|
-
export function
|
|
1371
|
+
/** Unregister a pool in case it needs to be redeployed. */
|
|
1372
|
+
export function unregisterPoolAdmin(options: UnregisterPoolAdminOptions) {
|
|
1183
1373
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1184
|
-
const argumentsTypes = [
|
|
1185
|
-
|
|
1186
|
-
'u64',
|
|
1187
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1188
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1189
|
-
] satisfies string[];
|
|
1190
|
-
const parameterNames = ['self', 'newTickSize', 'Cap', 'clock'];
|
|
1374
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
1375
|
+
const parameterNames = ['self', 'registry', 'Cap'];
|
|
1191
1376
|
return (tx: Transaction) =>
|
|
1192
1377
|
tx.moveCall({
|
|
1193
1378
|
package: packageAddress,
|
|
1194
1379
|
module: 'pool',
|
|
1195
|
-
function: '
|
|
1380
|
+
function: 'unregister_pool_admin',
|
|
1196
1381
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1197
1382
|
typeArguments: options.typeArguments,
|
|
1198
1383
|
});
|
|
1199
1384
|
}
|
|
1200
|
-
export interface
|
|
1385
|
+
export interface UpdateAllowedVersionsArguments {
|
|
1201
1386
|
self: RawTransactionArgument<string>;
|
|
1202
|
-
|
|
1203
|
-
newMinSize: RawTransactionArgument<number | bigint>;
|
|
1387
|
+
registry: RawTransactionArgument<string>;
|
|
1204
1388
|
Cap: RawTransactionArgument<string>;
|
|
1205
1389
|
}
|
|
1206
|
-
export interface
|
|
1390
|
+
export interface UpdateAllowedVersionsOptions {
|
|
1207
1391
|
package?: string;
|
|
1208
1392
|
arguments:
|
|
1209
|
-
|
|
|
1393
|
+
| UpdateAllowedVersionsArguments
|
|
1210
1394
|
| [
|
|
1211
1395
|
self: RawTransactionArgument<string>,
|
|
1212
|
-
|
|
1213
|
-
newMinSize: RawTransactionArgument<number | bigint>,
|
|
1396
|
+
registry: RawTransactionArgument<string>,
|
|
1214
1397
|
Cap: RawTransactionArgument<string>,
|
|
1215
1398
|
];
|
|
1216
1399
|
typeArguments: [string, string];
|
|
1217
1400
|
}
|
|
1218
1401
|
/**
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1402
|
+
* Takes the registry and updates the allowed version within pool Only admin can
|
|
1403
|
+
* update the allowed versions This function does not have version restrictions
|
|
1221
1404
|
*/
|
|
1222
|
-
export function
|
|
1405
|
+
export function updateAllowedVersions(options: UpdateAllowedVersionsOptions) {
|
|
1223
1406
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1224
|
-
const argumentsTypes = [
|
|
1225
|
-
|
|
1226
|
-
'u64',
|
|
1227
|
-
'u64',
|
|
1228
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1229
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1230
|
-
] satisfies string[];
|
|
1231
|
-
const parameterNames = ['self', 'newLotSize', 'newMinSize', 'Cap', 'clock'];
|
|
1407
|
+
const argumentsTypes = [null, null, null] satisfies (string | null)[];
|
|
1408
|
+
const parameterNames = ['self', 'registry', 'Cap'];
|
|
1232
1409
|
return (tx: Transaction) =>
|
|
1233
1410
|
tx.moveCall({
|
|
1234
1411
|
package: packageAddress,
|
|
1235
1412
|
module: 'pool',
|
|
1236
|
-
function: '
|
|
1413
|
+
function: 'update_allowed_versions',
|
|
1237
1414
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1238
1415
|
typeArguments: options.typeArguments,
|
|
1239
1416
|
});
|
|
1240
1417
|
}
|
|
1241
|
-
export interface
|
|
1418
|
+
export interface UpdatePoolAllowedVersionsArguments {
|
|
1242
1419
|
self: RawTransactionArgument<string>;
|
|
1420
|
+
registry: RawTransactionArgument<string>;
|
|
1421
|
+
}
|
|
1422
|
+
export interface UpdatePoolAllowedVersionsOptions {
|
|
1423
|
+
package?: string;
|
|
1424
|
+
arguments:
|
|
1425
|
+
| UpdatePoolAllowedVersionsArguments
|
|
1426
|
+
| [self: RawTransactionArgument<string>, registry: RawTransactionArgument<string>];
|
|
1427
|
+
typeArguments: [string, string];
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* Takes the registry and updates the allowed version within pool Permissionless
|
|
1431
|
+
* equivalent of `update_allowed_versions` This function does not have version
|
|
1432
|
+
* restrictions
|
|
1433
|
+
*/
|
|
1434
|
+
export function updatePoolAllowedVersions(options: UpdatePoolAllowedVersionsOptions) {
|
|
1435
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1436
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
1437
|
+
const parameterNames = ['self', 'registry'];
|
|
1438
|
+
return (tx: Transaction) =>
|
|
1439
|
+
tx.moveCall({
|
|
1440
|
+
package: packageAddress,
|
|
1441
|
+
module: 'pool',
|
|
1442
|
+
function: 'update_pool_allowed_versions',
|
|
1443
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1444
|
+
typeArguments: options.typeArguments,
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
export interface AdjustTickSizeAdminArguments {
|
|
1448
|
+
self: RawTransactionArgument<string>;
|
|
1449
|
+
newTickSize: RawTransactionArgument<number | bigint>;
|
|
1243
1450
|
Cap: RawTransactionArgument<string>;
|
|
1244
1451
|
}
|
|
1245
|
-
export interface
|
|
1452
|
+
export interface AdjustTickSizeAdminOptions {
|
|
1246
1453
|
package?: string;
|
|
1247
1454
|
arguments:
|
|
1248
|
-
|
|
|
1249
|
-
| [
|
|
1250
|
-
|
|
1455
|
+
| AdjustTickSizeAdminArguments
|
|
1456
|
+
| [
|
|
1457
|
+
self: RawTransactionArgument<string>,
|
|
1458
|
+
newTickSize: RawTransactionArgument<number | bigint>,
|
|
1459
|
+
Cap: RawTransactionArgument<string>,
|
|
1460
|
+
];
|
|
1461
|
+
typeArguments: [string, string];
|
|
1251
1462
|
}
|
|
1252
|
-
/**
|
|
1253
|
-
export function
|
|
1463
|
+
/** Adjust the tick size of the pool. Only admin can adjust the tick size. */
|
|
1464
|
+
export function adjustTickSizeAdmin(options: AdjustTickSizeAdminOptions) {
|
|
1254
1465
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1255
|
-
const argumentsTypes = [
|
|
1256
|
-
|
|
1257
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1258
|
-
] satisfies string[];
|
|
1259
|
-
const parameterNames = ['self', 'Cap'];
|
|
1466
|
+
const argumentsTypes = [null, 'u64', null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1467
|
+
const parameterNames = ['self', 'newTickSize', 'Cap'];
|
|
1260
1468
|
return (tx: Transaction) =>
|
|
1261
1469
|
tx.moveCall({
|
|
1262
1470
|
package: packageAddress,
|
|
1263
1471
|
module: 'pool',
|
|
1264
|
-
function: '
|
|
1472
|
+
function: 'adjust_tick_size_admin',
|
|
1265
1473
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1266
1474
|
typeArguments: options.typeArguments,
|
|
1267
1475
|
});
|
|
1268
1476
|
}
|
|
1269
|
-
export interface
|
|
1477
|
+
export interface AdjustMinLotSizeAdminArguments {
|
|
1270
1478
|
self: RawTransactionArgument<string>;
|
|
1479
|
+
newLotSize: RawTransactionArgument<number | bigint>;
|
|
1480
|
+
newMinSize: RawTransactionArgument<number | bigint>;
|
|
1271
1481
|
Cap: RawTransactionArgument<string>;
|
|
1272
1482
|
}
|
|
1273
|
-
export interface
|
|
1483
|
+
export interface AdjustMinLotSizeAdminOptions {
|
|
1274
1484
|
package?: string;
|
|
1275
1485
|
arguments:
|
|
1276
|
-
|
|
|
1277
|
-
| [
|
|
1278
|
-
|
|
1486
|
+
| AdjustMinLotSizeAdminArguments
|
|
1487
|
+
| [
|
|
1488
|
+
self: RawTransactionArgument<string>,
|
|
1489
|
+
newLotSize: RawTransactionArgument<number | bigint>,
|
|
1490
|
+
newMinSize: RawTransactionArgument<number | bigint>,
|
|
1491
|
+
Cap: RawTransactionArgument<string>,
|
|
1492
|
+
];
|
|
1493
|
+
typeArguments: [string, string];
|
|
1279
1494
|
}
|
|
1280
|
-
/**
|
|
1281
|
-
|
|
1495
|
+
/**
|
|
1496
|
+
* Adjust and lot size and min size of the pool. New lot size must be smaller than
|
|
1497
|
+
* current lot size. Only admin can adjust the min size and lot size.
|
|
1498
|
+
*/
|
|
1499
|
+
export function adjustMinLotSizeAdmin(options: AdjustMinLotSizeAdminOptions) {
|
|
1282
1500
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1283
|
-
const argumentsTypes = [
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
const parameterNames = ['self', 'Cap'];
|
|
1501
|
+
const argumentsTypes = [null, 'u64', 'u64', null, '0x2::clock::Clock'] satisfies (
|
|
1502
|
+
| string
|
|
1503
|
+
| null
|
|
1504
|
+
)[];
|
|
1505
|
+
const parameterNames = ['self', 'newLotSize', 'newMinSize', 'Cap'];
|
|
1288
1506
|
return (tx: Transaction) =>
|
|
1289
1507
|
tx.moveCall({
|
|
1290
1508
|
package: packageAddress,
|
|
1291
1509
|
module: 'pool',
|
|
1292
|
-
function: '
|
|
1510
|
+
function: 'adjust_min_lot_size_admin',
|
|
1293
1511
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1294
1512
|
typeArguments: options.typeArguments,
|
|
1295
1513
|
});
|
|
@@ -1316,13 +1534,8 @@ export interface EnableEwmaStateOptions {
|
|
|
1316
1534
|
*/
|
|
1317
1535
|
export function enableEwmaState(options: EnableEwmaStateOptions) {
|
|
1318
1536
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1319
|
-
const argumentsTypes = [
|
|
1320
|
-
|
|
1321
|
-
`${packageAddress}::registry::DeepbookAdminCap`,
|
|
1322
|
-
'bool',
|
|
1323
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1324
|
-
] satisfies string[];
|
|
1325
|
-
const parameterNames = ['self', 'Cap', 'enable', 'clock'];
|
|
1537
|
+
const argumentsTypes = [null, null, 'bool', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1538
|
+
const parameterNames = ['self', 'Cap', 'enable'];
|
|
1326
1539
|
return (tx: Transaction) =>
|
|
1327
1540
|
tx.moveCall({
|
|
1328
1541
|
package: packageAddress,
|
|
@@ -1355,15 +1568,11 @@ export interface SetEwmaParamsOptions {
|
|
|
1355
1568
|
/** Set the EWMA parameters for the pool. Only admin can set the parameters. */
|
|
1356
1569
|
export function setEwmaParams(options: SetEwmaParamsOptions) {
|
|
1357
1570
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1358
|
-
const argumentsTypes = [
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
'u64',
|
|
1364
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1365
|
-
] satisfies string[];
|
|
1366
|
-
const parameterNames = ['self', 'Cap', 'alpha', 'zScoreThreshold', 'additionalTakerFee', 'clock'];
|
|
1571
|
+
const argumentsTypes = [null, null, 'u64', 'u64', 'u64', '0x2::clock::Clock'] satisfies (
|
|
1572
|
+
| string
|
|
1573
|
+
| null
|
|
1574
|
+
)[];
|
|
1575
|
+
const parameterNames = ['self', 'Cap', 'alpha', 'zScoreThreshold', 'additionalTakerFee'];
|
|
1367
1576
|
return (tx: Transaction) =>
|
|
1368
1577
|
tx.moveCall({
|
|
1369
1578
|
package: packageAddress,
|
|
@@ -1373,39 +1582,6 @@ export function setEwmaParams(options: SetEwmaParamsOptions) {
|
|
|
1373
1582
|
typeArguments: options.typeArguments,
|
|
1374
1583
|
});
|
|
1375
1584
|
}
|
|
1376
|
-
export interface UpdateMarginStatusArguments<A extends BcsType<any>> {
|
|
1377
|
-
self: RawTransactionArgument<string>;
|
|
1378
|
-
_: RawTransactionArgument<A>;
|
|
1379
|
-
enable: RawTransactionArgument<boolean>;
|
|
1380
|
-
}
|
|
1381
|
-
export interface UpdateMarginStatusOptions<A extends BcsType<any>> {
|
|
1382
|
-
package?: string;
|
|
1383
|
-
arguments:
|
|
1384
|
-
| UpdateMarginStatusArguments<A>
|
|
1385
|
-
| [
|
|
1386
|
-
self: RawTransactionArgument<string>,
|
|
1387
|
-
_: RawTransactionArgument<A>,
|
|
1388
|
-
enable: RawTransactionArgument<boolean>,
|
|
1389
|
-
];
|
|
1390
|
-
typeArguments: [string, string, string];
|
|
1391
|
-
}
|
|
1392
|
-
export function updateMarginStatus<A extends BcsType<any>>(options: UpdateMarginStatusOptions<A>) {
|
|
1393
|
-
const packageAddress = options.package ?? '@deepbook/core';
|
|
1394
|
-
const argumentsTypes = [
|
|
1395
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[1]}, ${options.typeArguments[2]}>`,
|
|
1396
|
-
`${options.typeArguments[0]}`,
|
|
1397
|
-
'bool',
|
|
1398
|
-
] satisfies string[];
|
|
1399
|
-
const parameterNames = ['self', '_', 'enable'];
|
|
1400
|
-
return (tx: Transaction) =>
|
|
1401
|
-
tx.moveCall({
|
|
1402
|
-
package: packageAddress,
|
|
1403
|
-
module: 'pool',
|
|
1404
|
-
function: 'update_margin_status',
|
|
1405
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1406
|
-
typeArguments: options.typeArguments,
|
|
1407
|
-
});
|
|
1408
|
-
}
|
|
1409
1585
|
export interface WhitelistedArguments {
|
|
1410
1586
|
self: RawTransactionArgument<string>;
|
|
1411
1587
|
}
|
|
@@ -1417,9 +1593,7 @@ export interface WhitelistedOptions {
|
|
|
1417
1593
|
/** Accessor to check if the pool is whitelisted. */
|
|
1418
1594
|
export function whitelisted(options: WhitelistedOptions) {
|
|
1419
1595
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1420
|
-
const argumentsTypes = [
|
|
1421
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1422
|
-
] satisfies string[];
|
|
1596
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1423
1597
|
const parameterNames = ['self'];
|
|
1424
1598
|
return (tx: Transaction) =>
|
|
1425
1599
|
tx.moveCall({
|
|
@@ -1441,9 +1615,7 @@ export interface StablePoolOptions {
|
|
|
1441
1615
|
/** Accessor to check if the pool is a stablecoin pool. */
|
|
1442
1616
|
export function stablePool(options: StablePoolOptions) {
|
|
1443
1617
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1444
|
-
const argumentsTypes = [
|
|
1445
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1446
|
-
] satisfies string[];
|
|
1618
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1447
1619
|
const parameterNames = ['self'];
|
|
1448
1620
|
return (tx: Transaction) =>
|
|
1449
1621
|
tx.moveCall({
|
|
@@ -1464,9 +1636,7 @@ export interface RegisteredPoolOptions {
|
|
|
1464
1636
|
}
|
|
1465
1637
|
export function registeredPool(options: RegisteredPoolOptions) {
|
|
1466
1638
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1467
|
-
const argumentsTypes = [
|
|
1468
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1469
|
-
] satisfies string[];
|
|
1639
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1470
1640
|
const parameterNames = ['self'];
|
|
1471
1641
|
return (tx: Transaction) =>
|
|
1472
1642
|
tx.moveCall({
|
|
@@ -1494,12 +1664,8 @@ export interface GetQuoteQuantityOutOptions {
|
|
|
1494
1664
|
*/
|
|
1495
1665
|
export function getQuoteQuantityOut(options: GetQuoteQuantityOutOptions) {
|
|
1496
1666
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1497
|
-
const argumentsTypes = [
|
|
1498
|
-
|
|
1499
|
-
'u64',
|
|
1500
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1501
|
-
] satisfies string[];
|
|
1502
|
-
const parameterNames = ['self', 'baseQuantity', 'clock'];
|
|
1667
|
+
const argumentsTypes = [null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1668
|
+
const parameterNames = ['self', 'baseQuantity'];
|
|
1503
1669
|
return (tx: Transaction) =>
|
|
1504
1670
|
tx.moveCall({
|
|
1505
1671
|
package: packageAddress,
|
|
@@ -1529,12 +1695,8 @@ export interface GetBaseQuantityOutOptions {
|
|
|
1529
1695
|
*/
|
|
1530
1696
|
export function getBaseQuantityOut(options: GetBaseQuantityOutOptions) {
|
|
1531
1697
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1532
|
-
const argumentsTypes = [
|
|
1533
|
-
|
|
1534
|
-
'u64',
|
|
1535
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1536
|
-
] satisfies string[];
|
|
1537
|
-
const parameterNames = ['self', 'quoteQuantity', 'clock'];
|
|
1698
|
+
const argumentsTypes = [null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1699
|
+
const parameterNames = ['self', 'quoteQuantity'];
|
|
1538
1700
|
return (tx: Transaction) =>
|
|
1539
1701
|
tx.moveCall({
|
|
1540
1702
|
package: packageAddress,
|
|
@@ -1561,12 +1723,8 @@ export interface GetQuoteQuantityOutInputFeeOptions {
|
|
|
1561
1723
|
*/
|
|
1562
1724
|
export function getQuoteQuantityOutInputFee(options: GetQuoteQuantityOutInputFeeOptions) {
|
|
1563
1725
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1564
|
-
const argumentsTypes = [
|
|
1565
|
-
|
|
1566
|
-
'u64',
|
|
1567
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1568
|
-
] satisfies string[];
|
|
1569
|
-
const parameterNames = ['self', 'baseQuantity', 'clock'];
|
|
1726
|
+
const argumentsTypes = [null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1727
|
+
const parameterNames = ['self', 'baseQuantity'];
|
|
1570
1728
|
return (tx: Transaction) =>
|
|
1571
1729
|
tx.moveCall({
|
|
1572
1730
|
package: packageAddress,
|
|
@@ -1596,12 +1754,8 @@ export interface GetBaseQuantityOutInputFeeOptions {
|
|
|
1596
1754
|
*/
|
|
1597
1755
|
export function getBaseQuantityOutInputFee(options: GetBaseQuantityOutInputFeeOptions) {
|
|
1598
1756
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1599
|
-
const argumentsTypes = [
|
|
1600
|
-
|
|
1601
|
-
'u64',
|
|
1602
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1603
|
-
] satisfies string[];
|
|
1604
|
-
const parameterNames = ['self', 'quoteQuantity', 'clock'];
|
|
1757
|
+
const argumentsTypes = [null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1758
|
+
const parameterNames = ['self', 'quoteQuantity'];
|
|
1605
1759
|
return (tx: Transaction) =>
|
|
1606
1760
|
tx.moveCall({
|
|
1607
1761
|
package: packageAddress,
|
|
@@ -1635,13 +1789,8 @@ export interface GetQuantityOutOptions {
|
|
|
1635
1789
|
*/
|
|
1636
1790
|
export function getQuantityOut(options: GetQuantityOutOptions) {
|
|
1637
1791
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1638
|
-
const argumentsTypes = [
|
|
1639
|
-
|
|
1640
|
-
'u64',
|
|
1641
|
-
'u64',
|
|
1642
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1643
|
-
] satisfies string[];
|
|
1644
|
-
const parameterNames = ['self', 'baseQuantity', 'quoteQuantity', 'clock'];
|
|
1792
|
+
const argumentsTypes = [null, 'u64', 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1793
|
+
const parameterNames = ['self', 'baseQuantity', 'quoteQuantity'];
|
|
1645
1794
|
return (tx: Transaction) =>
|
|
1646
1795
|
tx.moveCall({
|
|
1647
1796
|
package: packageAddress,
|
|
@@ -1675,13 +1824,8 @@ export interface GetQuantityOutInputFeeOptions {
|
|
|
1675
1824
|
*/
|
|
1676
1825
|
export function getQuantityOutInputFee(options: GetQuantityOutInputFeeOptions) {
|
|
1677
1826
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1678
|
-
const argumentsTypes = [
|
|
1679
|
-
|
|
1680
|
-
'u64',
|
|
1681
|
-
'u64',
|
|
1682
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1683
|
-
] satisfies string[];
|
|
1684
|
-
const parameterNames = ['self', 'baseQuantity', 'quoteQuantity', 'clock'];
|
|
1827
|
+
const argumentsTypes = [null, 'u64', 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1828
|
+
const parameterNames = ['self', 'baseQuantity', 'quoteQuantity'];
|
|
1685
1829
|
return (tx: Transaction) =>
|
|
1686
1830
|
tx.moveCall({
|
|
1687
1831
|
package: packageAddress,
|
|
@@ -1691,6 +1835,76 @@ export function getQuantityOutInputFee(options: GetQuantityOutInputFeeOptions) {
|
|
|
1691
1835
|
typeArguments: options.typeArguments,
|
|
1692
1836
|
});
|
|
1693
1837
|
}
|
|
1838
|
+
export interface GetBaseQuantityInArguments {
|
|
1839
|
+
self: RawTransactionArgument<string>;
|
|
1840
|
+
targetQuoteQuantity: RawTransactionArgument<number | bigint>;
|
|
1841
|
+
payWithDeep: RawTransactionArgument<boolean>;
|
|
1842
|
+
}
|
|
1843
|
+
export interface GetBaseQuantityInOptions {
|
|
1844
|
+
package?: string;
|
|
1845
|
+
arguments:
|
|
1846
|
+
| GetBaseQuantityInArguments
|
|
1847
|
+
| [
|
|
1848
|
+
self: RawTransactionArgument<string>,
|
|
1849
|
+
targetQuoteQuantity: RawTransactionArgument<number | bigint>,
|
|
1850
|
+
payWithDeep: RawTransactionArgument<boolean>,
|
|
1851
|
+
];
|
|
1852
|
+
typeArguments: [string, string];
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* Dry run to determine the base quantity needed to sell to receive a target quote
|
|
1856
|
+
* quantity. Returns (base_quantity_in, actual_quote_quantity_out,
|
|
1857
|
+
* deep_quantity_required) Returns (0, 0, 0) if insufficient liquidity or if result
|
|
1858
|
+
* would be below min_size.
|
|
1859
|
+
*/
|
|
1860
|
+
export function getBaseQuantityIn(options: GetBaseQuantityInOptions) {
|
|
1861
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1862
|
+
const argumentsTypes = [null, 'u64', 'bool', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1863
|
+
const parameterNames = ['self', 'targetQuoteQuantity', 'payWithDeep'];
|
|
1864
|
+
return (tx: Transaction) =>
|
|
1865
|
+
tx.moveCall({
|
|
1866
|
+
package: packageAddress,
|
|
1867
|
+
module: 'pool',
|
|
1868
|
+
function: 'get_base_quantity_in',
|
|
1869
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1870
|
+
typeArguments: options.typeArguments,
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
export interface GetQuoteQuantityInArguments {
|
|
1874
|
+
self: RawTransactionArgument<string>;
|
|
1875
|
+
targetBaseQuantity: RawTransactionArgument<number | bigint>;
|
|
1876
|
+
payWithDeep: RawTransactionArgument<boolean>;
|
|
1877
|
+
}
|
|
1878
|
+
export interface GetQuoteQuantityInOptions {
|
|
1879
|
+
package?: string;
|
|
1880
|
+
arguments:
|
|
1881
|
+
| GetQuoteQuantityInArguments
|
|
1882
|
+
| [
|
|
1883
|
+
self: RawTransactionArgument<string>,
|
|
1884
|
+
targetBaseQuantity: RawTransactionArgument<number | bigint>,
|
|
1885
|
+
payWithDeep: RawTransactionArgument<boolean>,
|
|
1886
|
+
];
|
|
1887
|
+
typeArguments: [string, string];
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Dry run to determine the quote quantity needed to buy a target base quantity.
|
|
1891
|
+
* Returns (actual_base_quantity_out, quote_quantity_in, deep_quantity_required)
|
|
1892
|
+
* Returns (0, 0, 0) if insufficient liquidity or if result would be below
|
|
1893
|
+
* min_size.
|
|
1894
|
+
*/
|
|
1895
|
+
export function getQuoteQuantityIn(options: GetQuoteQuantityInOptions) {
|
|
1896
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
1897
|
+
const argumentsTypes = [null, 'u64', 'bool', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1898
|
+
const parameterNames = ['self', 'targetBaseQuantity', 'payWithDeep'];
|
|
1899
|
+
return (tx: Transaction) =>
|
|
1900
|
+
tx.moveCall({
|
|
1901
|
+
package: packageAddress,
|
|
1902
|
+
module: 'pool',
|
|
1903
|
+
function: 'get_quote_quantity_in',
|
|
1904
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
1905
|
+
typeArguments: options.typeArguments,
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1694
1908
|
export interface MidPriceArguments {
|
|
1695
1909
|
self: RawTransactionArgument<string>;
|
|
1696
1910
|
}
|
|
@@ -1702,11 +1916,8 @@ export interface MidPriceOptions {
|
|
|
1702
1916
|
/** Returns the mid price of the pool. */
|
|
1703
1917
|
export function midPrice(options: MidPriceOptions) {
|
|
1704
1918
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1705
|
-
const argumentsTypes = [
|
|
1706
|
-
|
|
1707
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1708
|
-
] satisfies string[];
|
|
1709
|
-
const parameterNames = ['self', 'clock'];
|
|
1919
|
+
const argumentsTypes = [null, '0x2::clock::Clock'] satisfies (string | null)[];
|
|
1920
|
+
const parameterNames = ['self'];
|
|
1710
1921
|
return (tx: Transaction) =>
|
|
1711
1922
|
tx.moveCall({
|
|
1712
1923
|
package: packageAddress,
|
|
@@ -1730,10 +1941,7 @@ export interface AccountOpenOrdersOptions {
|
|
|
1730
1941
|
/** Returns the order_id for all open order for the balance_manager in the pool. */
|
|
1731
1942
|
export function accountOpenOrders(options: AccountOpenOrdersOptions) {
|
|
1732
1943
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1733
|
-
const argumentsTypes = [
|
|
1734
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1735
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
1736
|
-
] satisfies string[];
|
|
1944
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
1737
1945
|
const parameterNames = ['self', 'balanceManager'];
|
|
1738
1946
|
return (tx: Transaction) =>
|
|
1739
1947
|
tx.moveCall({
|
|
@@ -1769,14 +1977,11 @@ export interface GetLevel2RangeOptions {
|
|
|
1769
1977
|
*/
|
|
1770
1978
|
export function getLevel2Range(options: GetLevel2RangeOptions) {
|
|
1771
1979
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1772
|
-
const argumentsTypes = [
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1778
|
-
] satisfies string[];
|
|
1779
|
-
const parameterNames = ['self', 'priceLow', 'priceHigh', 'isBid', 'clock'];
|
|
1980
|
+
const argumentsTypes = [null, 'u64', 'u64', 'bool', '0x2::clock::Clock'] satisfies (
|
|
1981
|
+
| string
|
|
1982
|
+
| null
|
|
1983
|
+
)[];
|
|
1984
|
+
const parameterNames = ['self', 'priceLow', 'priceHigh', 'isBid'];
|
|
1780
1985
|
return (tx: Transaction) =>
|
|
1781
1986
|
tx.moveCall({
|
|
1782
1987
|
package: packageAddress,
|
|
@@ -1806,12 +2011,8 @@ export interface GetLevel2TicksFromMidOptions {
|
|
|
1806
2011
|
*/
|
|
1807
2012
|
export function getLevel2TicksFromMid(options: GetLevel2TicksFromMidOptions) {
|
|
1808
2013
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1809
|
-
const argumentsTypes = [
|
|
1810
|
-
|
|
1811
|
-
'u64',
|
|
1812
|
-
'0x0000000000000000000000000000000000000000000000000000000000000002::clock::Clock',
|
|
1813
|
-
] satisfies string[];
|
|
1814
|
-
const parameterNames = ['self', 'ticks', 'clock'];
|
|
2014
|
+
const argumentsTypes = [null, 'u64', '0x2::clock::Clock'] satisfies (string | null)[];
|
|
2015
|
+
const parameterNames = ['self', 'ticks'];
|
|
1815
2016
|
return (tx: Transaction) =>
|
|
1816
2017
|
tx.moveCall({
|
|
1817
2018
|
package: packageAddress,
|
|
@@ -1832,9 +2033,7 @@ export interface VaultBalancesOptions {
|
|
|
1832
2033
|
/** Get all balances held in this pool. */
|
|
1833
2034
|
export function vaultBalances(options: VaultBalancesOptions) {
|
|
1834
2035
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1835
|
-
const argumentsTypes = [
|
|
1836
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1837
|
-
] satisfies string[];
|
|
2036
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1838
2037
|
const parameterNames = ['self'];
|
|
1839
2038
|
return (tx: Transaction) =>
|
|
1840
2039
|
tx.moveCall({
|
|
@@ -1856,7 +2055,7 @@ export interface GetPoolIdByAssetOptions {
|
|
|
1856
2055
|
/** Get the ID of the pool given the asset types. */
|
|
1857
2056
|
export function getPoolIdByAsset(options: GetPoolIdByAssetOptions) {
|
|
1858
2057
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1859
|
-
const argumentsTypes = [
|
|
2058
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1860
2059
|
const parameterNames = ['registry'];
|
|
1861
2060
|
return (tx: Transaction) =>
|
|
1862
2061
|
tx.moveCall({
|
|
@@ -1881,10 +2080,7 @@ export interface GetOrderOptions {
|
|
|
1881
2080
|
/** Get the Order struct */
|
|
1882
2081
|
export function getOrder(options: GetOrderOptions) {
|
|
1883
2082
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1884
|
-
const argumentsTypes = [
|
|
1885
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1886
|
-
'u128',
|
|
1887
|
-
] satisfies string[];
|
|
2083
|
+
const argumentsTypes = [null, 'u128'] satisfies (string | null)[];
|
|
1888
2084
|
const parameterNames = ['self', 'orderId'];
|
|
1889
2085
|
return (tx: Transaction) =>
|
|
1890
2086
|
tx.moveCall({
|
|
@@ -1909,10 +2105,7 @@ export interface GetOrdersOptions {
|
|
|
1909
2105
|
/** Get multiple orders given a vector of order_ids. */
|
|
1910
2106
|
export function getOrders(options: GetOrdersOptions) {
|
|
1911
2107
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1912
|
-
const argumentsTypes = [
|
|
1913
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1914
|
-
'vector<u128>',
|
|
1915
|
-
] satisfies string[];
|
|
2108
|
+
const argumentsTypes = [null, 'vector<u128>'] satisfies (string | null)[];
|
|
1916
2109
|
const parameterNames = ['self', 'orderIds'];
|
|
1917
2110
|
return (tx: Transaction) =>
|
|
1918
2111
|
tx.moveCall({
|
|
@@ -1937,10 +2130,7 @@ export interface GetAccountOrderDetailsOptions {
|
|
|
1937
2130
|
/** Return a copy of all orders that are in the book for this account. */
|
|
1938
2131
|
export function getAccountOrderDetails(options: GetAccountOrderDetailsOptions) {
|
|
1939
2132
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1940
|
-
const argumentsTypes = [
|
|
1941
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1942
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
1943
|
-
] satisfies string[];
|
|
2133
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
1944
2134
|
const parameterNames = ['self', 'balanceManager'];
|
|
1945
2135
|
return (tx: Transaction) =>
|
|
1946
2136
|
tx.moveCall({
|
|
@@ -1962,9 +2152,7 @@ export interface GetOrderDeepPriceOptions {
|
|
|
1962
2152
|
/** Return the DEEP price for the pool. */
|
|
1963
2153
|
export function getOrderDeepPrice(options: GetOrderDeepPriceOptions) {
|
|
1964
2154
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
1965
|
-
const argumentsTypes = [
|
|
1966
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
1967
|
-
] satisfies string[];
|
|
2155
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
1968
2156
|
const parameterNames = ['self'];
|
|
1969
2157
|
return (tx: Transaction) =>
|
|
1970
2158
|
tx.moveCall({
|
|
@@ -1998,11 +2186,7 @@ export interface GetOrderDeepRequiredOptions {
|
|
|
1998
2186
|
*/
|
|
1999
2187
|
export function getOrderDeepRequired(options: GetOrderDeepRequiredOptions) {
|
|
2000
2188
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2001
|
-
const argumentsTypes = [
|
|
2002
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2003
|
-
'u64',
|
|
2004
|
-
'u64',
|
|
2005
|
-
] satisfies string[];
|
|
2189
|
+
const argumentsTypes = [null, 'u64', 'u64'] satisfies (string | null)[];
|
|
2006
2190
|
const parameterNames = ['self', 'baseQuantity', 'price'];
|
|
2007
2191
|
return (tx: Transaction) =>
|
|
2008
2192
|
tx.moveCall({
|
|
@@ -2030,10 +2214,7 @@ export interface LockedBalanceOptions {
|
|
|
2030
2214
|
*/
|
|
2031
2215
|
export function lockedBalance(options: LockedBalanceOptions) {
|
|
2032
2216
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2033
|
-
const argumentsTypes = [
|
|
2034
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2035
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
2036
|
-
] satisfies string[];
|
|
2217
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2037
2218
|
const parameterNames = ['self', 'balanceManager'];
|
|
2038
2219
|
return (tx: Transaction) =>
|
|
2039
2220
|
tx.moveCall({
|
|
@@ -2044,6 +2225,173 @@ export function lockedBalance(options: LockedBalanceOptions) {
|
|
|
2044
2225
|
typeArguments: options.typeArguments,
|
|
2045
2226
|
});
|
|
2046
2227
|
}
|
|
2228
|
+
export interface CanPlaceLimitOrderArguments {
|
|
2229
|
+
self: RawTransactionArgument<string>;
|
|
2230
|
+
balanceManager: RawTransactionArgument<string>;
|
|
2231
|
+
price: RawTransactionArgument<number | bigint>;
|
|
2232
|
+
quantity: RawTransactionArgument<number | bigint>;
|
|
2233
|
+
isBid: RawTransactionArgument<boolean>;
|
|
2234
|
+
payWithDeep: RawTransactionArgument<boolean>;
|
|
2235
|
+
expireTimestamp: RawTransactionArgument<number | bigint>;
|
|
2236
|
+
}
|
|
2237
|
+
export interface CanPlaceLimitOrderOptions {
|
|
2238
|
+
package?: string;
|
|
2239
|
+
arguments:
|
|
2240
|
+
| CanPlaceLimitOrderArguments
|
|
2241
|
+
| [
|
|
2242
|
+
self: RawTransactionArgument<string>,
|
|
2243
|
+
balanceManager: RawTransactionArgument<string>,
|
|
2244
|
+
price: RawTransactionArgument<number | bigint>,
|
|
2245
|
+
quantity: RawTransactionArgument<number | bigint>,
|
|
2246
|
+
isBid: RawTransactionArgument<boolean>,
|
|
2247
|
+
payWithDeep: RawTransactionArgument<boolean>,
|
|
2248
|
+
expireTimestamp: RawTransactionArgument<number | bigint>,
|
|
2249
|
+
];
|
|
2250
|
+
typeArguments: [string, string];
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Check if a limit order can be placed based on balance manager balances. Returns
|
|
2254
|
+
* true if the balance manager has sufficient balance (accounting for fees) to
|
|
2255
|
+
* place the order, false otherwise. Assumes the limit order is a taker order as a
|
|
2256
|
+
* worst case scenario.
|
|
2257
|
+
*/
|
|
2258
|
+
export function canPlaceLimitOrder(options: CanPlaceLimitOrderOptions) {
|
|
2259
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
2260
|
+
const argumentsTypes = [
|
|
2261
|
+
null,
|
|
2262
|
+
null,
|
|
2263
|
+
'u64',
|
|
2264
|
+
'u64',
|
|
2265
|
+
'bool',
|
|
2266
|
+
'bool',
|
|
2267
|
+
'u64',
|
|
2268
|
+
'0x2::clock::Clock',
|
|
2269
|
+
] satisfies (string | null)[];
|
|
2270
|
+
const parameterNames = [
|
|
2271
|
+
'self',
|
|
2272
|
+
'balanceManager',
|
|
2273
|
+
'price',
|
|
2274
|
+
'quantity',
|
|
2275
|
+
'isBid',
|
|
2276
|
+
'payWithDeep',
|
|
2277
|
+
'expireTimestamp',
|
|
2278
|
+
];
|
|
2279
|
+
return (tx: Transaction) =>
|
|
2280
|
+
tx.moveCall({
|
|
2281
|
+
package: packageAddress,
|
|
2282
|
+
module: 'pool',
|
|
2283
|
+
function: 'can_place_limit_order',
|
|
2284
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2285
|
+
typeArguments: options.typeArguments,
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2288
|
+
export interface CanPlaceMarketOrderArguments {
|
|
2289
|
+
self: RawTransactionArgument<string>;
|
|
2290
|
+
balanceManager: RawTransactionArgument<string>;
|
|
2291
|
+
quantity: RawTransactionArgument<number | bigint>;
|
|
2292
|
+
isBid: RawTransactionArgument<boolean>;
|
|
2293
|
+
payWithDeep: RawTransactionArgument<boolean>;
|
|
2294
|
+
}
|
|
2295
|
+
export interface CanPlaceMarketOrderOptions {
|
|
2296
|
+
package?: string;
|
|
2297
|
+
arguments:
|
|
2298
|
+
| CanPlaceMarketOrderArguments
|
|
2299
|
+
| [
|
|
2300
|
+
self: RawTransactionArgument<string>,
|
|
2301
|
+
balanceManager: RawTransactionArgument<string>,
|
|
2302
|
+
quantity: RawTransactionArgument<number | bigint>,
|
|
2303
|
+
isBid: RawTransactionArgument<boolean>,
|
|
2304
|
+
payWithDeep: RawTransactionArgument<boolean>,
|
|
2305
|
+
];
|
|
2306
|
+
typeArguments: [string, string];
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Check if a market order can be placed based on balance manager balances. Returns
|
|
2310
|
+
* true if the balance manager has sufficient balance (accounting for fees) to
|
|
2311
|
+
* place the order, false otherwise. Does not account for discounted taker fees
|
|
2312
|
+
*/
|
|
2313
|
+
export function canPlaceMarketOrder(options: CanPlaceMarketOrderOptions) {
|
|
2314
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
2315
|
+
const argumentsTypes = [null, null, 'u64', 'bool', 'bool', '0x2::clock::Clock'] satisfies (
|
|
2316
|
+
| string
|
|
2317
|
+
| null
|
|
2318
|
+
)[];
|
|
2319
|
+
const parameterNames = ['self', 'balanceManager', 'quantity', 'isBid', 'payWithDeep'];
|
|
2320
|
+
return (tx: Transaction) =>
|
|
2321
|
+
tx.moveCall({
|
|
2322
|
+
package: packageAddress,
|
|
2323
|
+
module: 'pool',
|
|
2324
|
+
function: 'can_place_market_order',
|
|
2325
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2326
|
+
typeArguments: options.typeArguments,
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
export interface CheckMarketOrderParamsArguments {
|
|
2330
|
+
self: RawTransactionArgument<string>;
|
|
2331
|
+
quantity: RawTransactionArgument<number | bigint>;
|
|
2332
|
+
}
|
|
2333
|
+
export interface CheckMarketOrderParamsOptions {
|
|
2334
|
+
package?: string;
|
|
2335
|
+
arguments:
|
|
2336
|
+
| CheckMarketOrderParamsArguments
|
|
2337
|
+
| [self: RawTransactionArgument<string>, quantity: RawTransactionArgument<number | bigint>];
|
|
2338
|
+
typeArguments: [string, string];
|
|
2339
|
+
}
|
|
2340
|
+
/**
|
|
2341
|
+
* Check if a market order can be placed based on pool book params. Returns true if
|
|
2342
|
+
* the order parameters are valid, false otherwise.
|
|
2343
|
+
*/
|
|
2344
|
+
export function checkMarketOrderParams(options: CheckMarketOrderParamsOptions) {
|
|
2345
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
2346
|
+
const argumentsTypes = [null, 'u64'] satisfies (string | null)[];
|
|
2347
|
+
const parameterNames = ['self', 'quantity'];
|
|
2348
|
+
return (tx: Transaction) =>
|
|
2349
|
+
tx.moveCall({
|
|
2350
|
+
package: packageAddress,
|
|
2351
|
+
module: 'pool',
|
|
2352
|
+
function: 'check_market_order_params',
|
|
2353
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2354
|
+
typeArguments: options.typeArguments,
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
export interface CheckLimitOrderParamsArguments {
|
|
2358
|
+
self: RawTransactionArgument<string>;
|
|
2359
|
+
price: RawTransactionArgument<number | bigint>;
|
|
2360
|
+
quantity: RawTransactionArgument<number | bigint>;
|
|
2361
|
+
expireTimestamp: RawTransactionArgument<number | bigint>;
|
|
2362
|
+
}
|
|
2363
|
+
export interface CheckLimitOrderParamsOptions {
|
|
2364
|
+
package?: string;
|
|
2365
|
+
arguments:
|
|
2366
|
+
| CheckLimitOrderParamsArguments
|
|
2367
|
+
| [
|
|
2368
|
+
self: RawTransactionArgument<string>,
|
|
2369
|
+
price: RawTransactionArgument<number | bigint>,
|
|
2370
|
+
quantity: RawTransactionArgument<number | bigint>,
|
|
2371
|
+
expireTimestamp: RawTransactionArgument<number | bigint>,
|
|
2372
|
+
];
|
|
2373
|
+
typeArguments: [string, string];
|
|
2374
|
+
}
|
|
2375
|
+
/**
|
|
2376
|
+
* Check if a limit order can be placed based on pool book params. Returns true if
|
|
2377
|
+
* the order parameters are valid, false otherwise.
|
|
2378
|
+
*/
|
|
2379
|
+
export function checkLimitOrderParams(options: CheckLimitOrderParamsOptions) {
|
|
2380
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
2381
|
+
const argumentsTypes = [null, 'u64', 'u64', 'u64', '0x2::clock::Clock'] satisfies (
|
|
2382
|
+
| string
|
|
2383
|
+
| null
|
|
2384
|
+
)[];
|
|
2385
|
+
const parameterNames = ['self', 'price', 'quantity', 'expireTimestamp'];
|
|
2386
|
+
return (tx: Transaction) =>
|
|
2387
|
+
tx.moveCall({
|
|
2388
|
+
package: packageAddress,
|
|
2389
|
+
module: 'pool',
|
|
2390
|
+
function: 'check_limit_order_params',
|
|
2391
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2392
|
+
typeArguments: options.typeArguments,
|
|
2393
|
+
});
|
|
2394
|
+
}
|
|
2047
2395
|
export interface PoolTradeParamsArguments {
|
|
2048
2396
|
self: RawTransactionArgument<string>;
|
|
2049
2397
|
}
|
|
@@ -2052,12 +2400,13 @@ export interface PoolTradeParamsOptions {
|
|
|
2052
2400
|
arguments: PoolTradeParamsArguments | [self: RawTransactionArgument<string>];
|
|
2053
2401
|
typeArguments: [string, string];
|
|
2054
2402
|
}
|
|
2055
|
-
/**
|
|
2403
|
+
/**
|
|
2404
|
+
* Returns the trade params for the pool. Returns (taker_fee, maker_fee,
|
|
2405
|
+
* stake_required)
|
|
2406
|
+
*/
|
|
2056
2407
|
export function poolTradeParams(options: PoolTradeParamsOptions) {
|
|
2057
2408
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2058
|
-
const argumentsTypes = [
|
|
2059
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2060
|
-
] satisfies string[];
|
|
2409
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
2061
2410
|
const parameterNames = ['self'];
|
|
2062
2411
|
return (tx: Transaction) =>
|
|
2063
2412
|
tx.moveCall({
|
|
@@ -2079,9 +2428,7 @@ export interface PoolTradeParamsNextOptions {
|
|
|
2079
2428
|
/** Returns the currently leading trade params for the next epoch for the pool */
|
|
2080
2429
|
export function poolTradeParamsNext(options: PoolTradeParamsNextOptions) {
|
|
2081
2430
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2082
|
-
const argumentsTypes = [
|
|
2083
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2084
|
-
] satisfies string[];
|
|
2431
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
2085
2432
|
const parameterNames = ['self'];
|
|
2086
2433
|
return (tx: Transaction) =>
|
|
2087
2434
|
tx.moveCall({
|
|
@@ -2103,9 +2450,7 @@ export interface PoolBookParamsOptions {
|
|
|
2103
2450
|
/** Returns the tick size, lot size, and min size for the pool. */
|
|
2104
2451
|
export function poolBookParams(options: PoolBookParamsOptions) {
|
|
2105
2452
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2106
|
-
const argumentsTypes = [
|
|
2107
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2108
|
-
] satisfies string[];
|
|
2453
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
2109
2454
|
const parameterNames = ['self'];
|
|
2110
2455
|
return (tx: Transaction) =>
|
|
2111
2456
|
tx.moveCall({
|
|
@@ -2116,6 +2461,30 @@ export function poolBookParams(options: PoolBookParamsOptions) {
|
|
|
2116
2461
|
typeArguments: options.typeArguments,
|
|
2117
2462
|
});
|
|
2118
2463
|
}
|
|
2464
|
+
export interface AccountExistsArguments {
|
|
2465
|
+
self: RawTransactionArgument<string>;
|
|
2466
|
+
balanceManager: RawTransactionArgument<string>;
|
|
2467
|
+
}
|
|
2468
|
+
export interface AccountExistsOptions {
|
|
2469
|
+
package?: string;
|
|
2470
|
+
arguments:
|
|
2471
|
+
| AccountExistsArguments
|
|
2472
|
+
| [self: RawTransactionArgument<string>, balanceManager: RawTransactionArgument<string>];
|
|
2473
|
+
typeArguments: [string, string];
|
|
2474
|
+
}
|
|
2475
|
+
export function accountExists(options: AccountExistsOptions) {
|
|
2476
|
+
const packageAddress = options.package ?? '@deepbook/core';
|
|
2477
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2478
|
+
const parameterNames = ['self', 'balanceManager'];
|
|
2479
|
+
return (tx: Transaction) =>
|
|
2480
|
+
tx.moveCall({
|
|
2481
|
+
package: packageAddress,
|
|
2482
|
+
module: 'pool',
|
|
2483
|
+
function: 'account_exists',
|
|
2484
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2485
|
+
typeArguments: options.typeArguments,
|
|
2486
|
+
});
|
|
2487
|
+
}
|
|
2119
2488
|
export interface AccountArguments {
|
|
2120
2489
|
self: RawTransactionArgument<string>;
|
|
2121
2490
|
balanceManager: RawTransactionArgument<string>;
|
|
@@ -2129,10 +2498,7 @@ export interface AccountOptions {
|
|
|
2129
2498
|
}
|
|
2130
2499
|
export function account(options: AccountOptions) {
|
|
2131
2500
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2132
|
-
const argumentsTypes = [
|
|
2133
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2134
|
-
`${packageAddress}::balance_manager::BalanceManager`,
|
|
2135
|
-
] satisfies string[];
|
|
2501
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2136
2502
|
const parameterNames = ['self', 'balanceManager'];
|
|
2137
2503
|
return (tx: Transaction) =>
|
|
2138
2504
|
tx.moveCall({
|
|
@@ -2154,9 +2520,7 @@ export interface QuorumOptions {
|
|
|
2154
2520
|
/** Returns the quorum needed to pass proposal in the current epoch */
|
|
2155
2521
|
export function quorum(options: QuorumOptions) {
|
|
2156
2522
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2157
|
-
const argumentsTypes = [
|
|
2158
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2159
|
-
] satisfies string[];
|
|
2523
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
2160
2524
|
const parameterNames = ['self'];
|
|
2161
2525
|
return (tx: Transaction) =>
|
|
2162
2526
|
tx.moveCall({
|
|
@@ -2177,9 +2541,7 @@ export interface IdOptions {
|
|
|
2177
2541
|
}
|
|
2178
2542
|
export function id(options: IdOptions) {
|
|
2179
2543
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2180
|
-
const argumentsTypes = [
|
|
2181
|
-
`${packageAddress}::pool::Pool<${options.typeArguments[0]}, ${options.typeArguments[1]}>`,
|
|
2182
|
-
] satisfies string[];
|
|
2544
|
+
const argumentsTypes = [null] satisfies (string | null)[];
|
|
2183
2545
|
const parameterNames = ['self'];
|
|
2184
2546
|
return (tx: Transaction) =>
|
|
2185
2547
|
tx.moveCall({
|
|
@@ -2190,79 +2552,74 @@ export function id(options: IdOptions) {
|
|
|
2190
2552
|
typeArguments: options.typeArguments,
|
|
2191
2553
|
});
|
|
2192
2554
|
}
|
|
2193
|
-
export interface
|
|
2194
|
-
|
|
2555
|
+
export interface GetReferralBalancesArguments {
|
|
2556
|
+
Self: RawTransactionArgument<string>;
|
|
2557
|
+
Referral: RawTransactionArgument<string>;
|
|
2195
2558
|
}
|
|
2196
|
-
export interface
|
|
2559
|
+
export interface GetReferralBalancesOptions {
|
|
2197
2560
|
package?: string;
|
|
2198
|
-
arguments:
|
|
2561
|
+
arguments:
|
|
2562
|
+
| GetReferralBalancesArguments
|
|
2563
|
+
| [Self: RawTransactionArgument<string>, Referral: RawTransactionArgument<string>];
|
|
2199
2564
|
typeArguments: [string, string];
|
|
2200
2565
|
}
|
|
2201
|
-
export function
|
|
2566
|
+
export function getReferralBalances(options: GetReferralBalancesOptions) {
|
|
2202
2567
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2203
|
-
const argumentsTypes = [
|
|
2204
|
-
|
|
2205
|
-
] satisfies string[];
|
|
2206
|
-
const parameterNames = ['self'];
|
|
2568
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2569
|
+
const parameterNames = ['Self', 'Referral'];
|
|
2207
2570
|
return (tx: Transaction) =>
|
|
2208
2571
|
tx.moveCall({
|
|
2209
2572
|
package: packageAddress,
|
|
2210
2573
|
module: 'pool',
|
|
2211
|
-
function: '
|
|
2574
|
+
function: 'get_referral_balances',
|
|
2212
2575
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2213
2576
|
typeArguments: options.typeArguments,
|
|
2214
2577
|
});
|
|
2215
2578
|
}
|
|
2216
|
-
export interface
|
|
2579
|
+
export interface GetPoolReferralBalancesArguments {
|
|
2217
2580
|
self: RawTransactionArgument<string>;
|
|
2581
|
+
referral: RawTransactionArgument<string>;
|
|
2218
2582
|
}
|
|
2219
|
-
export interface
|
|
2583
|
+
export interface GetPoolReferralBalancesOptions {
|
|
2220
2584
|
package?: string;
|
|
2221
|
-
arguments:
|
|
2222
|
-
|
|
2585
|
+
arguments:
|
|
2586
|
+
| GetPoolReferralBalancesArguments
|
|
2587
|
+
| [self: RawTransactionArgument<string>, referral: RawTransactionArgument<string>];
|
|
2588
|
+
typeArguments: [string, string];
|
|
2223
2589
|
}
|
|
2224
|
-
|
|
2225
|
-
* Check if an application is authorized to access protected features of DeepBook
|
|
2226
|
-
* core.
|
|
2227
|
-
*/
|
|
2228
|
-
export function isAppAuthorized(options: IsAppAuthorizedOptions) {
|
|
2590
|
+
export function getPoolReferralBalances(options: GetPoolReferralBalancesOptions) {
|
|
2229
2591
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2230
|
-
const argumentsTypes = [
|
|
2231
|
-
|
|
2232
|
-
] satisfies string[];
|
|
2233
|
-
const parameterNames = ['self'];
|
|
2592
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2593
|
+
const parameterNames = ['self', 'referral'];
|
|
2234
2594
|
return (tx: Transaction) =>
|
|
2235
2595
|
tx.moveCall({
|
|
2236
2596
|
package: packageAddress,
|
|
2237
2597
|
module: 'pool',
|
|
2238
|
-
function: '
|
|
2598
|
+
function: 'get_pool_referral_balances',
|
|
2239
2599
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2240
2600
|
typeArguments: options.typeArguments,
|
|
2241
2601
|
});
|
|
2242
2602
|
}
|
|
2243
|
-
export interface
|
|
2603
|
+
export interface PoolReferralMultiplierArguments {
|
|
2244
2604
|
self: RawTransactionArgument<string>;
|
|
2605
|
+
referral: RawTransactionArgument<string>;
|
|
2245
2606
|
}
|
|
2246
|
-
export interface
|
|
2607
|
+
export interface PoolReferralMultiplierOptions {
|
|
2247
2608
|
package?: string;
|
|
2248
|
-
arguments:
|
|
2249
|
-
|
|
2609
|
+
arguments:
|
|
2610
|
+
| PoolReferralMultiplierArguments
|
|
2611
|
+
| [self: RawTransactionArgument<string>, referral: RawTransactionArgument<string>];
|
|
2612
|
+
typeArguments: [string, string];
|
|
2250
2613
|
}
|
|
2251
|
-
|
|
2252
|
-
* Assert that an application is authorized to access protected features of
|
|
2253
|
-
* DeepBook core. Aborts with `EAppNotAuthorized` if not.
|
|
2254
|
-
*/
|
|
2255
|
-
export function assertAppIsAuthorized(options: AssertAppIsAuthorizedOptions) {
|
|
2614
|
+
export function poolReferralMultiplier(options: PoolReferralMultiplierOptions) {
|
|
2256
2615
|
const packageAddress = options.package ?? '@deepbook/core';
|
|
2257
|
-
const argumentsTypes = [
|
|
2258
|
-
|
|
2259
|
-
] satisfies string[];
|
|
2260
|
-
const parameterNames = ['self'];
|
|
2616
|
+
const argumentsTypes = [null, null] satisfies (string | null)[];
|
|
2617
|
+
const parameterNames = ['self', 'referral'];
|
|
2261
2618
|
return (tx: Transaction) =>
|
|
2262
2619
|
tx.moveCall({
|
|
2263
2620
|
package: packageAddress,
|
|
2264
2621
|
module: 'pool',
|
|
2265
|
-
function: '
|
|
2622
|
+
function: 'pool_referral_multiplier',
|
|
2266
2623
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
2267
2624
|
typeArguments: options.typeArguments,
|
|
2268
2625
|
});
|