@haneullabs/deepbook-v3 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +984 -0
- package/README.md +1 -0
- package/dist/cjs/client.d.ts +861 -0
- package/dist/cjs/client.js +1982 -0
- package/dist/cjs/client.js.map +7 -0
- package/dist/cjs/contracts/deepbook/account.d.ts +105 -0
- package/dist/cjs/contracts/deepbook/account.js +163 -0
- package/dist/cjs/contracts/deepbook/account.js.map +7 -0
- package/dist/cjs/contracts/deepbook/balance_manager.d.ts +268 -0
- package/dist/cjs/contracts/deepbook/balance_manager.js +361 -0
- package/dist/cjs/contracts/deepbook/balance_manager.js.map +7 -0
- package/dist/cjs/contracts/deepbook/balances.d.ts +10 -0
- package/dist/cjs/contracts/deepbook/balances.js +35 -0
- package/dist/cjs/contracts/deepbook/balances.js.map +7 -0
- package/dist/cjs/contracts/deepbook/big_vector.d.ts +62 -0
- package/dist/cjs/contracts/deepbook/big_vector.js +80 -0
- package/dist/cjs/contracts/deepbook/big_vector.js.map +7 -0
- package/dist/cjs/contracts/deepbook/book.d.ts +34 -0
- package/dist/cjs/contracts/deepbook/book.js +50 -0
- package/dist/cjs/contracts/deepbook/book.js.map +7 -0
- package/dist/cjs/contracts/deepbook/constants.d.ts +176 -0
- package/dist/cjs/contracts/deepbook/constants.js +338 -0
- package/dist/cjs/contracts/deepbook/constants.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deep_price.d.ts +60 -0
- package/dist/cjs/contracts/deepbook/deep_price.js +87 -0
- package/dist/cjs/contracts/deepbook/deep_price.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.d.ts +14 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js +42 -0
- package/dist/cjs/contracts/deepbook/deps/std/type_name.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.d.ts +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js +47 -0
- package/dist/cjs/contracts/deepbook/deps/sui/bag.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.d.ts +9 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/balance.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.d.ts +5 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.js +33 -0
- package/dist/cjs/contracts/deepbook/deps/sui/object.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.d.ts +28 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.js +47 -0
- package/dist/cjs/contracts/deepbook/deps/sui/table.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.d.ts +27 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js +45 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.d.ts +15 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js +35 -0
- package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js.map +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.d.ts +7 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js +45 -0
- package/dist/cjs/contracts/deepbook/deps/sui/versioned.js.map +7 -0
- package/dist/cjs/contracts/deepbook/ewma.d.ts +17 -0
- package/dist/cjs/contracts/deepbook/ewma.js +39 -0
- package/dist/cjs/contracts/deepbook/ewma.js.map +7 -0
- package/dist/cjs/contracts/deepbook/fill.d.ts +153 -0
- package/dist/cjs/contracts/deepbook/fill.js +251 -0
- package/dist/cjs/contracts/deepbook/fill.js.map +7 -0
- package/dist/cjs/contracts/deepbook/governance.d.ts +63 -0
- package/dist/cjs/contracts/deepbook/governance.js +79 -0
- package/dist/cjs/contracts/deepbook/governance.js.map +7 -0
- package/dist/cjs/contracts/deepbook/history.d.ts +60 -0
- package/dist/cjs/contracts/deepbook/history.js +78 -0
- package/dist/cjs/contracts/deepbook/history.js.map +7 -0
- package/dist/cjs/contracts/deepbook/math.d.ts +94 -0
- package/dist/cjs/contracts/deepbook/math.js +132 -0
- package/dist/cjs/contracts/deepbook/math.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order.d.ts +135 -0
- package/dist/cjs/contracts/deepbook/order.js +218 -0
- package/dist/cjs/contracts/deepbook/order.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order_info.d.ts +296 -0
- package/dist/cjs/contracts/deepbook/order_info.js +386 -0
- package/dist/cjs/contracts/deepbook/order_info.js.map +7 -0
- package/dist/cjs/contracts/deepbook/order_query.d.ts +85 -0
- package/dist/cjs/contracts/deepbook/order_query.js +96 -0
- package/dist/cjs/contracts/deepbook/order_query.js.map +7 -0
- package/dist/cjs/contracts/deepbook/pool.d.ts +1218 -0
- package/dist/cjs/contracts/deepbook/pool.js +1236 -0
- package/dist/cjs/contracts/deepbook/pool.js.map +7 -0
- package/dist/cjs/contracts/deepbook/registry.d.ts +134 -0
- package/dist/cjs/contracts/deepbook/registry.js +182 -0
- package/dist/cjs/contracts/deepbook/registry.js.map +7 -0
- package/dist/cjs/contracts/deepbook/state.d.ts +117 -0
- package/dist/cjs/contracts/deepbook/state.js +104 -0
- package/dist/cjs/contracts/deepbook/state.js.map +7 -0
- package/dist/cjs/contracts/deepbook/trade_params.d.ts +7 -0
- package/dist/cjs/contracts/deepbook/trade_params.js +35 -0
- package/dist/cjs/contracts/deepbook/trade_params.js.map +7 -0
- package/dist/cjs/contracts/deepbook/vault.d.ts +30 -0
- package/dist/cjs/contracts/deepbook/vault.js +65 -0
- package/dist/cjs/contracts/deepbook/vault.js.map +7 -0
- package/dist/cjs/contracts/utils/index.d.ts +25 -0
- package/dist/cjs/contracts/utils/index.js +148 -0
- package/dist/cjs/contracts/utils/index.js.map +7 -0
- package/dist/cjs/index.d.ts +23 -0
- package/dist/cjs/index.js +81 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/pyth/PriceServiceConnection.d.ts +26 -0
- package/dist/cjs/pyth/PriceServiceConnection.js +68 -0
- package/dist/cjs/pyth/PriceServiceConnection.js.map +7 -0
- package/dist/cjs/pyth/pyth-helpers.d.ts +7 -0
- package/dist/cjs/pyth/pyth-helpers.js +36 -0
- package/dist/cjs/pyth/pyth-helpers.js.map +7 -0
- package/dist/cjs/pyth/pyth.d.ts +65 -0
- package/dist/cjs/pyth/pyth.js +269 -0
- package/dist/cjs/pyth/pyth.js.map +7 -0
- package/dist/cjs/transactions/balanceManager.d.ts +168 -0
- package/dist/cjs/transactions/balanceManager.js +384 -0
- package/dist/cjs/transactions/balanceManager.js.map +7 -0
- package/dist/cjs/transactions/deepbook.d.ts +477 -0
- package/dist/cjs/transactions/deepbook.js +1335 -0
- package/dist/cjs/transactions/deepbook.js.map +7 -0
- package/dist/cjs/transactions/deepbookAdmin.d.ts +105 -0
- package/dist/cjs/transactions/deepbookAdmin.js +334 -0
- package/dist/cjs/transactions/deepbookAdmin.js.map +7 -0
- package/dist/cjs/transactions/flashLoans.d.ts +56 -0
- package/dist/cjs/transactions/flashLoans.js +124 -0
- package/dist/cjs/transactions/flashLoans.js.map +7 -0
- package/dist/cjs/transactions/governance.d.ts +42 -0
- package/dist/cjs/transactions/governance.js +135 -0
- package/dist/cjs/transactions/governance.js.map +7 -0
- package/dist/cjs/transactions/marginAdmin.d.ts +133 -0
- package/dist/cjs/transactions/marginAdmin.js +393 -0
- package/dist/cjs/transactions/marginAdmin.js.map +7 -0
- package/dist/cjs/transactions/marginLiquidations.d.ts +61 -0
- package/dist/cjs/transactions/marginLiquidations.js +173 -0
- package/dist/cjs/transactions/marginLiquidations.js.map +7 -0
- package/dist/cjs/transactions/marginMaintainer.d.ts +80 -0
- package/dist/cjs/transactions/marginMaintainer.js +251 -0
- package/dist/cjs/transactions/marginMaintainer.js.map +7 -0
- package/dist/cjs/transactions/marginManager.d.ts +236 -0
- package/dist/cjs/transactions/marginManager.js +688 -0
- package/dist/cjs/transactions/marginManager.js.map +7 -0
- package/dist/cjs/transactions/marginPool.d.ts +134 -0
- package/dist/cjs/transactions/marginPool.js +330 -0
- package/dist/cjs/transactions/marginPool.js.map +7 -0
- package/dist/cjs/transactions/marginRegistry.d.ts +94 -0
- package/dist/cjs/transactions/marginRegistry.js +221 -0
- package/dist/cjs/transactions/marginRegistry.js.map +7 -0
- package/dist/cjs/transactions/marginTPSL.d.ts +93 -0
- package/dist/cjs/transactions/marginTPSL.js +286 -0
- package/dist/cjs/transactions/marginTPSL.js.map +7 -0
- package/dist/cjs/transactions/poolProxy.d.ts +104 -0
- package/dist/cjs/transactions/poolProxy.js +435 -0
- package/dist/cjs/transactions/poolProxy.js.map +7 -0
- package/dist/cjs/types/bcs.d.ts +5 -0
- package/dist/cjs/types/bcs.js +33 -0
- package/dist/cjs/types/bcs.js.map +7 -0
- package/dist/cjs/types/index.d.ts +218 -0
- package/dist/cjs/types/index.js +38 -0
- package/dist/cjs/types/index.js.map +7 -0
- package/dist/cjs/utils/config.d.ts +65 -0
- package/dist/cjs/utils/config.js +144 -0
- package/dist/cjs/utils/config.js.map +7 -0
- package/dist/cjs/utils/constants.d.ts +76 -0
- package/dist/cjs/utils/constants.js +382 -0
- package/dist/cjs/utils/constants.js.map +7 -0
- package/dist/cjs/utils/errors.d.ts +42 -0
- package/dist/cjs/utils/errors.js +70 -0
- package/dist/cjs/utils/errors.js.map +7 -0
- package/dist/cjs/utils/validation.d.ts +50 -0
- package/dist/cjs/utils/validation.js +67 -0
- package/dist/cjs/utils/validation.js.map +7 -0
- package/dist/esm/client.d.ts +861 -0
- package/dist/esm/client.js +1967 -0
- package/dist/esm/client.js.map +7 -0
- package/dist/esm/contracts/deepbook/account.d.ts +105 -0
- package/dist/esm/contracts/deepbook/account.js +133 -0
- package/dist/esm/contracts/deepbook/account.js.map +7 -0
- package/dist/esm/contracts/deepbook/balance_manager.d.ts +268 -0
- package/dist/esm/contracts/deepbook/balance_manager.js +331 -0
- package/dist/esm/contracts/deepbook/balance_manager.js.map +7 -0
- package/dist/esm/contracts/deepbook/balances.d.ts +10 -0
- package/dist/esm/contracts/deepbook/balances.js +15 -0
- package/dist/esm/contracts/deepbook/balances.js.map +7 -0
- package/dist/esm/contracts/deepbook/big_vector.d.ts +62 -0
- package/dist/esm/contracts/deepbook/big_vector.js +50 -0
- package/dist/esm/contracts/deepbook/big_vector.js.map +7 -0
- package/dist/esm/contracts/deepbook/book.d.ts +34 -0
- package/dist/esm/contracts/deepbook/book.js +20 -0
- package/dist/esm/contracts/deepbook/book.js.map +7 -0
- package/dist/esm/contracts/deepbook/constants.d.ts +176 -0
- package/dist/esm/contracts/deepbook/constants.js +318 -0
- package/dist/esm/contracts/deepbook/constants.js.map +7 -0
- package/dist/esm/contracts/deepbook/deep_price.d.ts +60 -0
- package/dist/esm/contracts/deepbook/deep_price.js +67 -0
- package/dist/esm/contracts/deepbook/deep_price.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.d.ts +14 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.js +22 -0
- package/dist/esm/contracts/deepbook/deps/std/type_name.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.d.ts +33 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.js +17 -0
- package/dist/esm/contracts/deepbook/deps/sui/bag.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.d.ts +9 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.js +13 -0
- package/dist/esm/contracts/deepbook/deps/sui/balance.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.d.ts +5 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.js +13 -0
- package/dist/esm/contracts/deepbook/deps/sui/object.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.d.ts +28 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.js +17 -0
- package/dist/esm/contracts/deepbook/deps/sui/table.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.d.ts +27 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js +25 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_map.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.d.ts +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/vec_set.js.map +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.d.ts +7 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js +15 -0
- package/dist/esm/contracts/deepbook/deps/sui/versioned.js.map +7 -0
- package/dist/esm/contracts/deepbook/ewma.d.ts +17 -0
- package/dist/esm/contracts/deepbook/ewma.js +19 -0
- package/dist/esm/contracts/deepbook/ewma.js.map +7 -0
- package/dist/esm/contracts/deepbook/fill.d.ts +153 -0
- package/dist/esm/contracts/deepbook/fill.js +221 -0
- package/dist/esm/contracts/deepbook/fill.js.map +7 -0
- package/dist/esm/contracts/deepbook/governance.d.ts +63 -0
- package/dist/esm/contracts/deepbook/governance.js +49 -0
- package/dist/esm/contracts/deepbook/governance.js.map +7 -0
- package/dist/esm/contracts/deepbook/history.d.ts +60 -0
- package/dist/esm/contracts/deepbook/history.js +48 -0
- package/dist/esm/contracts/deepbook/history.js.map +7 -0
- package/dist/esm/contracts/deepbook/math.d.ts +94 -0
- package/dist/esm/contracts/deepbook/math.js +112 -0
- package/dist/esm/contracts/deepbook/math.js.map +7 -0
- package/dist/esm/contracts/deepbook/order.d.ts +135 -0
- package/dist/esm/contracts/deepbook/order.js +188 -0
- package/dist/esm/contracts/deepbook/order.js.map +7 -0
- package/dist/esm/contracts/deepbook/order_info.d.ts +296 -0
- package/dist/esm/contracts/deepbook/order_info.js +356 -0
- package/dist/esm/contracts/deepbook/order_info.js.map +7 -0
- package/dist/esm/contracts/deepbook/order_query.d.ts +85 -0
- package/dist/esm/contracts/deepbook/order_query.js +66 -0
- package/dist/esm/contracts/deepbook/order_query.js.map +7 -0
- package/dist/esm/contracts/deepbook/pool.d.ts +1218 -0
- package/dist/esm/contracts/deepbook/pool.js +1206 -0
- package/dist/esm/contracts/deepbook/pool.js.map +7 -0
- package/dist/esm/contracts/deepbook/registry.d.ts +134 -0
- package/dist/esm/contracts/deepbook/registry.js +152 -0
- package/dist/esm/contracts/deepbook/registry.js.map +7 -0
- package/dist/esm/contracts/deepbook/state.d.ts +117 -0
- package/dist/esm/contracts/deepbook/state.js +74 -0
- package/dist/esm/contracts/deepbook/state.js.map +7 -0
- package/dist/esm/contracts/deepbook/trade_params.d.ts +7 -0
- package/dist/esm/contracts/deepbook/trade_params.js +15 -0
- package/dist/esm/contracts/deepbook/trade_params.js.map +7 -0
- package/dist/esm/contracts/deepbook/vault.d.ts +30 -0
- package/dist/esm/contracts/deepbook/vault.js +35 -0
- package/dist/esm/contracts/deepbook/vault.js.map +7 -0
- package/dist/esm/contracts/utils/index.d.ts +25 -0
- package/dist/esm/contracts/utils/index.js +128 -0
- package/dist/esm/contracts/utils/index.js.map +7 -0
- package/dist/esm/index.d.ts +23 -0
- package/dist/esm/index.js +81 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/pyth/PriceServiceConnection.d.ts +26 -0
- package/dist/esm/pyth/PriceServiceConnection.js +38 -0
- package/dist/esm/pyth/PriceServiceConnection.js.map +7 -0
- package/dist/esm/pyth/pyth-helpers.d.ts +7 -0
- package/dist/esm/pyth/pyth-helpers.js +16 -0
- package/dist/esm/pyth/pyth-helpers.js.map +7 -0
- package/dist/esm/pyth/pyth.d.ts +65 -0
- package/dist/esm/pyth/pyth.js +249 -0
- package/dist/esm/pyth/pyth.js.map +7 -0
- package/dist/esm/transactions/balanceManager.d.ts +168 -0
- package/dist/esm/transactions/balanceManager.js +364 -0
- package/dist/esm/transactions/balanceManager.js.map +7 -0
- package/dist/esm/transactions/deepbook.d.ts +477 -0
- package/dist/esm/transactions/deepbook.js +1321 -0
- package/dist/esm/transactions/deepbook.js.map +7 -0
- package/dist/esm/transactions/deepbookAdmin.d.ts +105 -0
- package/dist/esm/transactions/deepbookAdmin.js +314 -0
- package/dist/esm/transactions/deepbookAdmin.js.map +7 -0
- package/dist/esm/transactions/flashLoans.d.ts +56 -0
- package/dist/esm/transactions/flashLoans.js +104 -0
- package/dist/esm/transactions/flashLoans.js.map +7 -0
- package/dist/esm/transactions/governance.d.ts +42 -0
- package/dist/esm/transactions/governance.js +115 -0
- package/dist/esm/transactions/governance.js.map +7 -0
- package/dist/esm/transactions/marginAdmin.d.ts +133 -0
- package/dist/esm/transactions/marginAdmin.js +373 -0
- package/dist/esm/transactions/marginAdmin.js.map +7 -0
- package/dist/esm/transactions/marginLiquidations.d.ts +61 -0
- package/dist/esm/transactions/marginLiquidations.js +153 -0
- package/dist/esm/transactions/marginLiquidations.js.map +7 -0
- package/dist/esm/transactions/marginMaintainer.d.ts +80 -0
- package/dist/esm/transactions/marginMaintainer.js +231 -0
- package/dist/esm/transactions/marginMaintainer.js.map +7 -0
- package/dist/esm/transactions/marginManager.d.ts +236 -0
- package/dist/esm/transactions/marginManager.js +668 -0
- package/dist/esm/transactions/marginManager.js.map +7 -0
- package/dist/esm/transactions/marginPool.d.ts +134 -0
- package/dist/esm/transactions/marginPool.js +310 -0
- package/dist/esm/transactions/marginPool.js.map +7 -0
- package/dist/esm/transactions/marginRegistry.d.ts +94 -0
- package/dist/esm/transactions/marginRegistry.js +201 -0
- package/dist/esm/transactions/marginRegistry.js.map +7 -0
- package/dist/esm/transactions/marginTPSL.d.ts +93 -0
- package/dist/esm/transactions/marginTPSL.js +266 -0
- package/dist/esm/transactions/marginTPSL.js.map +7 -0
- package/dist/esm/transactions/poolProxy.d.ts +104 -0
- package/dist/esm/transactions/poolProxy.js +415 -0
- package/dist/esm/transactions/poolProxy.js.map +7 -0
- package/dist/esm/types/bcs.d.ts +5 -0
- package/dist/esm/types/bcs.js +13 -0
- package/dist/esm/types/bcs.js.map +7 -0
- package/dist/esm/types/index.d.ts +218 -0
- package/dist/esm/types/index.js +18 -0
- package/dist/esm/types/index.js.map +7 -0
- package/dist/esm/utils/config.d.ts +65 -0
- package/dist/esm/utils/config.js +135 -0
- package/dist/esm/utils/config.js.map +7 -0
- package/dist/esm/utils/constants.d.ts +76 -0
- package/dist/esm/utils/constants.js +362 -0
- package/dist/esm/utils/constants.js.map +7 -0
- package/dist/esm/utils/errors.d.ts +42 -0
- package/dist/esm/utils/errors.js +50 -0
- package/dist/esm/utils/errors.js.map +7 -0
- package/dist/esm/utils/validation.d.ts +50 -0
- package/dist/esm/utils/validation.js +47 -0
- package/dist/esm/utils/validation.js.map +7 -0
- package/dist/tsconfig.esm.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -0
- package/src/client.ts +2451 -0
- package/src/contracts/deepbook/account.ts +199 -0
- package/src/contracts/deepbook/balance_manager.ts +532 -0
- package/src/contracts/deepbook/balances.ts +19 -0
- package/src/contracts/deepbook/big_vector.ts +74 -0
- package/src/contracts/deepbook/book.ts +24 -0
- package/src/contracts/deepbook/constants.ts +458 -0
- package/src/contracts/deepbook/deep_price.ts +84 -0
- package/src/contracts/deepbook/deps/std/type_name.ts +23 -0
- package/src/contracts/deepbook/deps/sui/bag.ts +41 -0
- package/src/contracts/deepbook/deps/sui/balance.ts +18 -0
- package/src/contracts/deepbook/deps/sui/object.ts +14 -0
- package/src/contracts/deepbook/deps/sui/table.ts +36 -0
- package/src/contracts/deepbook/deps/sui/vec_map.ts +33 -0
- package/src/contracts/deepbook/deps/sui/vec_set.ts +22 -0
- package/src/contracts/deepbook/deps/sui/versioned.ts +13 -0
- package/src/contracts/deepbook/ewma.ts +26 -0
- package/src/contracts/deepbook/fill.ts +336 -0
- package/src/contracts/deepbook/governance.ts +52 -0
- package/src/contracts/deepbook/history.ts +51 -0
- package/src/contracts/deepbook/math.ts +210 -0
- package/src/contracts/deepbook/order.ts +269 -0
- package/src/contracts/deepbook/order_info.ts +513 -0
- package/src/contracts/deepbook/order_query.ts +115 -0
- package/src/contracts/deepbook/pool.ts +2269 -0
- package/src/contracts/deepbook/registry.ts +242 -0
- package/src/contracts/deepbook/state.ts +74 -0
- package/src/contracts/deepbook/trade_params.ts +16 -0
- package/src/contracts/deepbook/vault.ts +37 -0
- package/src/contracts/utils/index.ts +184 -0
- package/src/index.ts +95 -0
- package/src/pyth/PriceServiceConnection.ts +48 -0
- package/src/pyth/pyth-helpers.ts +23 -0
- package/src/pyth/pyth.ts +305 -0
- package/src/transactions/balanceManager.ts +399 -0
- package/src/transactions/deepbook.ts +1519 -0
- package/src/transactions/deepbookAdmin.ts +332 -0
- package/src/transactions/flashLoans.ts +123 -0
- package/src/transactions/governance.ts +123 -0
- package/src/transactions/marginAdmin.ts +396 -0
- package/src/transactions/marginLiquidations.ts +175 -0
- package/src/transactions/marginMaintainer.ts +280 -0
- package/src/transactions/marginManager.ts +708 -0
- package/src/transactions/marginPool.ts +339 -0
- package/src/transactions/marginRegistry.ts +212 -0
- package/src/transactions/marginTPSL.ts +296 -0
- package/src/transactions/poolProxy.ts +438 -0
- package/src/types/bcs.ts +8 -0
- package/src/types/index.ts +255 -0
- package/src/utils/config.ts +177 -0
- package/src/utils/constants.ts +374 -0
- package/src/utils/errors.ts +67 -0
- package/src/utils/validation.ts +91 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var bag_exports = {};
|
|
30
|
+
__export(bag_exports, {
|
|
31
|
+
Bag: () => Bag
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(bag_exports);
|
|
34
|
+
var import_utils = require("../../../utils/index.js");
|
|
35
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
36
|
+
var object = __toESM(require("./object.js"));
|
|
37
|
+
const $moduleName = "0x2::bag";
|
|
38
|
+
const Bag = new import_utils.MoveStruct({
|
|
39
|
+
name: `${$moduleName}::Bag`,
|
|
40
|
+
fields: {
|
|
41
|
+
/** the ID of this bag */
|
|
42
|
+
id: object.UID,
|
|
43
|
+
/** the number of key-value pairs in the bag */
|
|
44
|
+
size: import_bcs.bcs.u64()
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=bag.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/bag.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * A bag is a heterogeneous map-like collection. The collection is similar to\n * `sui::table` in that its keys and values are not stored within the `Bag` value,\n * but instead are stored using Sui's object system. The `Bag` struct acts only as\n * a handle into the object system to retrieve those keys and values. Note that\n * this means that `Bag` values with exactly the same key-value mapping will not be\n * equal, with `==`, at runtime. For example\n *\n * ```\n * let bag1 = bag::new();\n * let bag2 = bag::new();\n * bag::add(&mut bag1, 0, false);\n * bag::add(&mut bag1, 1, true);\n * bag::add(&mut bag2, 0, false);\n * bag::add(&mut bag2, 1, true);\n * // bag1 does not equal bag2, despite having the same entries\n * assert!(&bag1 != &bag2);\n * ```\n *\n * At it's core, `sui::bag` is a wrapper around `UID` that allows for access to\n * `sui::dynamic_field` while preventing accidentally stranding field values. A\n * `UID` can be deleted, even if it has dynamic fields associated with it, but a\n * bag, on the other hand, must be empty to be destroyed.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as object from './object.js';\nconst $moduleName = '0x2::bag';\nexport const Bag = new MoveStruct({\n\tname: `${$moduleName}::Bag`,\n\tfields: {\n\t\t/** the ID of this bag */\n\t\tid: object.UID,\n\t\t/** the number of key-value pairs in the bag */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BA,mBAA2B;AAC3B,iBAAoB;AACpB,aAAwB;AACxB,MAAM,cAAc;AACb,MAAM,MAAM,IAAI,wBAAW;AAAA,EACjC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA;AAAA,IAEP,IAAI,OAAO;AAAA;AAAA,IAEX,MAAM,eAAI,IAAI;AAAA,EACf;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A storable handler for Balances in general. Is used in the `Coin` module to
|
|
3
|
+
* allow balance operations and can be used to implement custom coins with `Supply`
|
|
4
|
+
* and `Balance`s.
|
|
5
|
+
*/
|
|
6
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
7
|
+
export declare const Balance: MoveStruct<{
|
|
8
|
+
value: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
9
|
+
}, "0x2::balance::Balance">;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var balance_exports = {};
|
|
20
|
+
__export(balance_exports, {
|
|
21
|
+
Balance: () => Balance
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(balance_exports);
|
|
24
|
+
var import_utils = require("../../../utils/index.js");
|
|
25
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
26
|
+
const $moduleName = "0x2::balance";
|
|
27
|
+
const Balance = new import_utils.MoveStruct({
|
|
28
|
+
name: `${$moduleName}::Balance`,
|
|
29
|
+
fields: {
|
|
30
|
+
value: import_bcs.bcs.u64()
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=balance.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/balance.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * A storable handler for Balances in general. Is used in the `Coin` module to\n * allow balance operations and can be used to implement custom coins with `Supply`\n * and `Balance`s.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::balance';\nexport const Balance = new MoveStruct({\n\tname: `${$moduleName}::Balance`,\n\tfields: {\n\t\tvalue: bcs.u64(),\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,mBAA2B;AAC3B,iBAAoB;AACpB,MAAM,cAAc;AACb,MAAM,UAAU,IAAI,wBAAW;AAAA,EACrC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,OAAO,eAAI,IAAI;AAAA,EAChB;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var object_exports = {};
|
|
20
|
+
__export(object_exports, {
|
|
21
|
+
UID: () => UID
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(object_exports);
|
|
24
|
+
var import_utils = require("../../../utils/index.js");
|
|
25
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
26
|
+
const $moduleName = "0x2::object";
|
|
27
|
+
const UID = new import_utils.MoveStruct({
|
|
28
|
+
name: `${$moduleName}::UID`,
|
|
29
|
+
fields: {
|
|
30
|
+
id: import_bcs.bcs.Address
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=object.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/object.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui object identifiers */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::object';\nexport const UID = new MoveStruct({\n\tname: `${$moduleName}::UID`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAA2B;AAC3B,iBAAoB;AACpB,MAAM,cAAc;AACb,MAAM,MAAM,IAAI,wBAAW;AAAA,EACjC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,IAAI,eAAI;AAAA,EACT;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A table is a map-like collection. But unlike a traditional collection, it's keys
|
|
3
|
+
* and values are not stored within the `Table` value, but instead are stored using
|
|
4
|
+
* Sui's object system. The `Table` struct acts only as a handle into the object
|
|
5
|
+
* system to retrieve those keys and values. Note that this means that `Table`
|
|
6
|
+
* values with exactly the same key-value mapping will not be equal, with `==`, at
|
|
7
|
+
* runtime. For example
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* let table1 = table::new<u64, bool>();
|
|
11
|
+
* let table2 = table::new<u64, bool>();
|
|
12
|
+
* table::add(&mut table1, 0, false);
|
|
13
|
+
* table::add(&mut table1, 1, true);
|
|
14
|
+
* table::add(&mut table2, 0, false);
|
|
15
|
+
* table::add(&mut table2, 1, true);
|
|
16
|
+
* // table1 does not equal table2, despite having the same entries
|
|
17
|
+
* assert!(&table1 != &table2);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
21
|
+
export declare const Table: MoveStruct<{
|
|
22
|
+
/** the ID of this table */
|
|
23
|
+
id: MoveStruct<{
|
|
24
|
+
id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
25
|
+
}, "0x2::object::UID">;
|
|
26
|
+
/** the number of key-value pairs in the table */
|
|
27
|
+
size: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
}, "0x2::table::Table">;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var table_exports = {};
|
|
30
|
+
__export(table_exports, {
|
|
31
|
+
Table: () => Table
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(table_exports);
|
|
34
|
+
var import_utils = require("../../../utils/index.js");
|
|
35
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
36
|
+
var object = __toESM(require("./object.js"));
|
|
37
|
+
const $moduleName = "0x2::table";
|
|
38
|
+
const Table = new import_utils.MoveStruct({
|
|
39
|
+
name: `${$moduleName}::Table`,
|
|
40
|
+
fields: {
|
|
41
|
+
/** the ID of this table */
|
|
42
|
+
id: object.UID,
|
|
43
|
+
/** the number of key-value pairs in the table */
|
|
44
|
+
size: import_bcs.bcs.u64()
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/table.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * A table is a map-like collection. But unlike a traditional collection, it's keys\n * and values are not stored within the `Table` value, but instead are stored using\n * Sui's object system. The `Table` struct acts only as a handle into the object\n * system to retrieve those keys and values. Note that this means that `Table`\n * values with exactly the same key-value mapping will not be equal, with `==`, at\n * runtime. For example\n *\n * ```\n * let table1 = table::new<u64, bool>();\n * let table2 = table::new<u64, bool>();\n * table::add(&mut table1, 0, false);\n * table::add(&mut table1, 1, true);\n * table::add(&mut table2, 0, false);\n * table::add(&mut table2, 1, true);\n * // table1 does not equal table2, despite having the same entries\n * assert!(&table1 != &table2);\n * ```\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as object from './object.js';\nconst $moduleName = '0x2::table';\nexport const Table = new MoveStruct({\n\tname: `${$moduleName}::Table`,\n\tfields: {\n\t\t/** the ID of this table */\n\t\tid: object.UID,\n\t\t/** the number of key-value pairs in the table */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBA,mBAA2B;AAC3B,iBAAoB;AACpB,aAAwB;AACxB,MAAM,cAAc;AACb,MAAM,QAAQ,IAAI,wBAAW;AAAA,EACnC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA;AAAA,IAEP,IAAI,OAAO;AAAA;AAAA,IAEX,MAAM,eAAI,IAAI;AAAA,EACf;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BcsType } from '@haneullabs/haneul/bcs';
|
|
2
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
3
|
+
/** An entry in the map */
|
|
4
|
+
export declare function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]): MoveStruct<{
|
|
5
|
+
key: K;
|
|
6
|
+
value: V;
|
|
7
|
+
}, `0x2::vec_map::Entry<${K["name"]}, ${V["name"]}>`>;
|
|
8
|
+
/**
|
|
9
|
+
* A map data structure backed by a vector. The map is guaranteed not to contain
|
|
10
|
+
* duplicate keys, but entries are _not_ sorted by key--entries are included in
|
|
11
|
+
* insertion order. All operations are O(N) in the size of the map--the intention
|
|
12
|
+
* of this data structure is only to provide the convenience of programming against
|
|
13
|
+
* a map API. Large maps should use handwritten parent/child relationships instead.
|
|
14
|
+
* Maps that need sorted iteration rather than insertion order iteration should
|
|
15
|
+
* also be handwritten.
|
|
16
|
+
*/
|
|
17
|
+
export declare function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]): MoveStruct<{
|
|
18
|
+
contents: BcsType<{
|
|
19
|
+
key: K extends BcsType<infer U, any, string> ? U : never;
|
|
20
|
+
value: V extends BcsType<infer U, any, string> ? U : never;
|
|
21
|
+
}[], Iterable<{
|
|
22
|
+
key: K extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
23
|
+
value: V extends BcsType<any, infer U_1, string> ? U_1 : never;
|
|
24
|
+
}> & {
|
|
25
|
+
length: number;
|
|
26
|
+
}, string>;
|
|
27
|
+
}, `0x2::vec_map::VecMap<${K["name"]}, ${V["name"]}>`>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var vec_map_exports = {};
|
|
20
|
+
__export(vec_map_exports, {
|
|
21
|
+
Entry: () => Entry,
|
|
22
|
+
VecMap: () => VecMap
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(vec_map_exports);
|
|
25
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
26
|
+
var import_utils = require("../../../utils/index.js");
|
|
27
|
+
const $moduleName = "0x2::vec_map";
|
|
28
|
+
function Entry(...typeParameters) {
|
|
29
|
+
return new import_utils.MoveStruct({
|
|
30
|
+
name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`,
|
|
31
|
+
fields: {
|
|
32
|
+
key: typeParameters[0],
|
|
33
|
+
value: typeParameters[1]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function VecMap(...typeParameters) {
|
|
38
|
+
return new import_utils.MoveStruct({
|
|
39
|
+
name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`,
|
|
40
|
+
fields: {
|
|
41
|
+
contents: import_bcs.bcs.vector(Entry(typeParameters[0], typeParameters[1]))
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=vec_map.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/vec_map.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport type { BcsType } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_map';\n/** An entry in the map */\nexport function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tkey: typeParameters[0],\n\t\t\tvalue: typeParameters[1],\n\t\t},\n\t});\n}\n/**\n * A map data structure backed by a vector. The map is guaranteed not to contain\n * duplicate keys, but entries are _not_ sorted by key--entries are included in\n * insertion order. All operations are O(N) in the size of the map--the intention\n * of this data structure is only to provide the convenience of programming against\n * a map API. Large maps should use handwritten parent/child relationships instead.\n * Maps that need sorted iteration rather than insertion order iteration should\n * also be handwritten.\n */\nexport function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(Entry(typeParameters[0], typeParameters[1])),\n\t\t},\n\t});\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;AAEpB,mBAA2B;AAC3B,MAAM,cAAc;AAEb,SAAS,SAAyD,gBAAwB;AAChG,SAAO,IAAI,wBAAW;AAAA,IACrB,MAAM,GAAG,WAAW,WAAW,eAAe,CAAC,EAAE,IAAiB,KAAK,eAAe,CAAC,EAAE,IAAiB;AAAA,IAC1G,QAAQ;AAAA,MACP,KAAK,eAAe,CAAC;AAAA,MACrB,OAAO,eAAe,CAAC;AAAA,IACxB;AAAA,EACD,CAAC;AACF;AAUO,SAAS,UAA0D,gBAAwB;AACjG,SAAO,IAAI,wBAAW;AAAA,IACrB,MAAM,GAAG,WAAW,YAAY,eAAe,CAAC,EAAE,IAAiB,KAAK,eAAe,CAAC,EAAE,IAAiB;AAAA,IAC3G,QAAQ;AAAA,MACP,UAAU,eAAI,OAAO,MAAM,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;AAAA,IACjE;AAAA,EACD,CAAC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BcsType } from '@haneullabs/haneul/bcs';
|
|
2
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A set data structure backed by a vector. The set is guaranteed not to contain
|
|
5
|
+
* duplicate keys. All operations are O(N) in the size of the set
|
|
6
|
+
*
|
|
7
|
+
* - the intention of this data structure is only to provide the convenience of
|
|
8
|
+
* programming against a set API. Sets that need sorted iteration rather than
|
|
9
|
+
* insertion order iteration should be handwritten.
|
|
10
|
+
*/
|
|
11
|
+
export declare function VecSet<K extends BcsType<any>>(...typeParameters: [K]): MoveStruct<{
|
|
12
|
+
contents: BcsType<import("@haneullabs/bcs").InferBcsType<K>[], Iterable<import("@haneullabs/bcs").InferBcsInput<K>> & {
|
|
13
|
+
length: number;
|
|
14
|
+
}, string>;
|
|
15
|
+
}, `0x2::vec_set::VecSet<${K["name"]}>`>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var vec_set_exports = {};
|
|
20
|
+
__export(vec_set_exports, {
|
|
21
|
+
VecSet: () => VecSet
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(vec_set_exports);
|
|
24
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
25
|
+
var import_utils = require("../../../utils/index.js");
|
|
26
|
+
const $moduleName = "0x2::vec_set";
|
|
27
|
+
function VecSet(...typeParameters) {
|
|
28
|
+
return new import_utils.MoveStruct({
|
|
29
|
+
name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
|
|
30
|
+
fields: {
|
|
31
|
+
contents: import_bcs.bcs.vector(typeParameters[0])
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=vec_set.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/vec_set.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport type { BcsType } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_set';\n/**\n * A set data structure backed by a vector. The set is guaranteed not to contain\n * duplicate keys. All operations are O(N) in the size of the set\n *\n * - the intention of this data structure is only to provide the convenience of\n * programming against a set API. Sets that need sorted iteration rather than\n * insertion order iteration should be handwritten.\n */\nexport function VecSet<K extends BcsType<any>>(...typeParameters: [K]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecSet<${typeParameters[0].name as K['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(typeParameters[0]),\n\t\t},\n\t});\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;AAEpB,mBAA2B;AAC3B,MAAM,cAAc;AASb,SAAS,UAAkC,gBAAqB;AACtE,SAAO,IAAI,wBAAW;AAAA,IACrB,MAAM,GAAG,WAAW,YAAY,eAAe,CAAC,EAAE,IAAiB;AAAA,IACnE,QAAQ;AAAA,MACP,UAAU,eAAI,OAAO,eAAe,CAAC,CAAC;AAAA,IACvC;AAAA,EACD,CAAC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MoveStruct } from '../../../utils/index.js';
|
|
2
|
+
export declare const Versioned: MoveStruct<{
|
|
3
|
+
id: MoveStruct<{
|
|
4
|
+
id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
5
|
+
}, "0x2::object::UID">;
|
|
6
|
+
version: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
7
|
+
}, "0x2::versioned::Versioned">;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var versioned_exports = {};
|
|
30
|
+
__export(versioned_exports, {
|
|
31
|
+
Versioned: () => Versioned
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(versioned_exports);
|
|
34
|
+
var import_utils = require("../../../utils/index.js");
|
|
35
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
36
|
+
var object = __toESM(require("./object.js"));
|
|
37
|
+
const $moduleName = "0x2::versioned";
|
|
38
|
+
const Versioned = new import_utils.MoveStruct({
|
|
39
|
+
name: `${$moduleName}::Versioned`,
|
|
40
|
+
fields: {
|
|
41
|
+
id: object.UID,
|
|
42
|
+
version: import_bcs.bcs.u64()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=versioned.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/contracts/deepbook/deps/sui/versioned.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as object from './object.js';\nconst $moduleName = '0x2::versioned';\nexport const Versioned = new MoveStruct({\n\tname: `${$moduleName}::Versioned`,\n\tfields: {\n\t\tid: object.UID,\n\t\tversion: bcs.u64(),\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2B;AAC3B,iBAAoB;AACpB,aAAwB;AACxB,MAAM,cAAc;AACb,MAAM,YAAY,IAAI,wBAAW;AAAA,EACvC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,IAAI,OAAO;AAAA,IACX,SAAS,eAAI,IAAI;AAAA,EAClB;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Exponentially Weighted Moving Average (EWMA) state for DeepBook This state
|
|
3
|
+
* is used to calculate the smoothed mean and variance of gas prices and apply a
|
|
4
|
+
* penalty to taker fees based on the Z-score of the current gas price relative to
|
|
5
|
+
* the smoothed mean and variance. The state is enabled by default and can be
|
|
6
|
+
* configured with different parameters.
|
|
7
|
+
*/
|
|
8
|
+
import { MoveStruct } from '../utils/index.js';
|
|
9
|
+
export declare const EWMAState: MoveStruct<{
|
|
10
|
+
mean: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
11
|
+
variance: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
12
|
+
alpha: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
13
|
+
z_score_threshold: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
14
|
+
additional_taker_fee: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
15
|
+
last_updated_timestamp: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
16
|
+
enabled: import("@haneullabs/haneul/bcs").BcsType<boolean, boolean, "bool">;
|
|
17
|
+
}, "@deepbook/core::ewma::EWMAState">;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ewma_exports = {};
|
|
20
|
+
__export(ewma_exports, {
|
|
21
|
+
EWMAState: () => EWMAState
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ewma_exports);
|
|
24
|
+
var import_utils = require("../utils/index.js");
|
|
25
|
+
var import_bcs = require("@haneullabs/haneul/bcs");
|
|
26
|
+
const $moduleName = "@deepbook/core::ewma";
|
|
27
|
+
const EWMAState = new import_utils.MoveStruct({
|
|
28
|
+
name: `${$moduleName}::EWMAState`,
|
|
29
|
+
fields: {
|
|
30
|
+
mean: import_bcs.bcs.u64(),
|
|
31
|
+
variance: import_bcs.bcs.u64(),
|
|
32
|
+
alpha: import_bcs.bcs.u64(),
|
|
33
|
+
z_score_threshold: import_bcs.bcs.u64(),
|
|
34
|
+
additional_taker_fee: import_bcs.bcs.u64(),
|
|
35
|
+
last_updated_timestamp: import_bcs.bcs.u64(),
|
|
36
|
+
enabled: import_bcs.bcs.bool()
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=ewma.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/contracts/deepbook/ewma.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * The Exponentially Weighted Moving Average (EWMA) state for DeepBook This state\n * is used to calculate the smoothed mean and variance of gas prices and apply a\n * penalty to taker fees based on the Z-score of the current gas price relative to\n * the smoothed mean and variance. The state is enabled by default and can be\n * configured with different parameters.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '@deepbook/core::ewma';\nexport const EWMAState = new MoveStruct({\n\tname: `${$moduleName}::EWMAState`,\n\tfields: {\n\t\tmean: bcs.u64(),\n\t\tvariance: bcs.u64(),\n\t\talpha: bcs.u64(),\n\t\tz_score_threshold: bcs.u64(),\n\t\tadditional_taker_fee: bcs.u64(),\n\t\tlast_updated_timestamp: bcs.u64(),\n\t\tenabled: bcs.bool(),\n\t},\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,mBAA2B;AAC3B,iBAAoB;AACpB,MAAM,cAAc;AACb,MAAM,YAAY,IAAI,wBAAW;AAAA,EACvC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,MAAM,eAAI,IAAI;AAAA,IACd,UAAU,eAAI,IAAI;AAAA,IAClB,OAAO,eAAI,IAAI;AAAA,IACf,mBAAmB,eAAI,IAAI;AAAA,IAC3B,sBAAsB,eAAI,IAAI;AAAA,IAC9B,wBAAwB,eAAI,IAAI;AAAA,IAChC,SAAS,eAAI,KAAK;AAAA,EACnB;AACD,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|