aftermath-ts-sdk 0.0.162 → 0.0.164
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/dist/general/api/dynamicFieldsApiHelpers.d.ts +29 -6
- package/dist/general/api/dynamicFieldsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/dynamicFieldsApiHelpers.js +31 -31
- package/dist/general/api/eventsApiHelpers.d.ts +23 -8
- package/dist/general/api/eventsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/eventsApiHelpers.js +38 -33
- package/dist/general/api/inspectionsApiHelpers.js +9 -9
- package/dist/general/api/objectsApiHelpers.d.ts +150 -110
- package/dist/general/api/objectsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/objectsApiHelpers.js +32 -27
- package/dist/general/api/rpcApiHelpers.js +9 -9
- package/dist/general/api/transactionsApiHelpers.d.ts +9 -4
- package/dist/general/api/transactionsApiHelpers.d.ts.map +1 -1
- package/dist/general/api/transactionsApiHelpers.js +28 -19
- package/dist/general/historicalData/historicalData.js +6 -6
- package/dist/general/historicalData/historicalDataApi.js +6 -6
- package/dist/general/historicalData/historicalDataApiInterface.d.ts +2 -1
- package/dist/general/historicalData/historicalDataApiInterface.d.ts.map +1 -1
- package/dist/general/prices/coingecko/coinGeckoApiHelpers.js +24 -24
- package/dist/general/prices/coingecko/coinGeckoPricesApi.js +15 -15
- package/dist/general/prices/placeholder/placeholderPricesApi.d.ts.map +1 -1
- package/dist/general/prices/placeholder/placeholderPricesApi.js +40 -33
- package/dist/general/prices/prices.js +6 -6
- package/dist/general/prices/pyth/pythPricesApi.js +12 -12
- package/dist/general/prices/pyth/pythPricesApiHelpers.js +12 -12
- package/dist/general/providers/aftermath.d.ts +4 -2
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +22 -20
- package/dist/general/providers/aftermathApi.d.ts +4 -2
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +34 -32
- package/dist/general/types/configTypes.d.ts +94 -14
- package/dist/general/types/configTypes.d.ts.map +1 -1
- package/dist/general/types/generalTypes.d.ts +12 -1
- package/dist/general/types/generalTypes.d.ts.map +1 -1
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +11 -9
- package/dist/general/utils/casting.d.ts +4 -4
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +22 -22
- package/dist/general/utils/fixed.d.ts +5 -0
- package/dist/general/utils/fixed.d.ts.map +1 -1
- package/dist/general/utils/fixed.js +4 -0
- package/dist/general/utils/helpers.js +21 -21
- package/dist/general/wallet/wallet.js +6 -6
- package/dist/general/wallet/walletApi.js +12 -12
- package/dist/packages/capys/capy.d.ts +4 -4
- package/dist/packages/capys/capy.d.ts.map +1 -1
- package/dist/packages/capys/capy.js +15 -15
- package/dist/packages/coin/api/coinApi.d.ts +18 -5
- package/dist/packages/coin/api/coinApi.d.ts.map +1 -1
- package/dist/packages/coin/api/coinApi.js +109 -15
- package/dist/packages/coin/coin.d.ts +4 -5
- package/dist/packages/coin/coin.d.ts.map +1 -1
- package/dist/packages/coin/coin.js +28 -28
- package/dist/packages/coin/coinTypes.d.ts +4 -0
- package/dist/packages/coin/coinTypes.d.ts.map +1 -1
- package/dist/packages/{referralVault/api/referralVaultApiHelpers.d.ts → external/baySwap/baySwapApi.d.ts} +49 -77
- package/dist/packages/external/baySwap/baySwapApi.d.ts.map +1 -0
- package/dist/packages/external/baySwap/baySwapApi.js +176 -0
- package/dist/packages/external/baySwap/baySwapTypes.d.ts +29 -0
- package/dist/packages/external/baySwap/baySwapTypes.d.ts.map +1 -0
- package/dist/packages/external/baySwap/baySwapTypes.js +15 -0
- package/dist/packages/external/{deepBook/deepBookApiHelper.d.ts → blueMove/blueMoveApi.d.ts} +42 -87
- package/dist/packages/external/blueMove/blueMoveApi.d.ts.map +1 -0
- package/dist/packages/external/blueMove/blueMoveApi.js +249 -0
- package/dist/packages/external/blueMove/blueMoveTypes.d.ts +87 -0
- package/dist/packages/external/blueMove/blueMoveTypes.d.ts.map +1 -0
- package/dist/packages/external/blueMove/blueMoveTypes.js +13 -0
- package/dist/packages/external/cetus/cetusApi.d.ts +240 -11
- package/dist/packages/external/cetus/cetusApi.d.ts.map +1 -1
- package/dist/packages/external/cetus/cetusApi.js +295 -28
- package/dist/packages/external/deepBook/deepBookApi.d.ts +406 -5
- package/dist/packages/external/deepBook/deepBookApi.d.ts.map +1 -1
- package/dist/packages/external/deepBook/deepBookApi.js +332 -35
- package/dist/packages/external/deepBook/deepBookTypes.d.ts +4 -6
- package/dist/packages/external/deepBook/deepBookTypes.d.ts.map +1 -1
- package/dist/packages/external/deepBook/deepBookTypes.js +2 -2
- package/dist/packages/{faucet/api/faucetApiHelpers.d.ts → external/interest/interestApi.d.ts} +45 -19
- package/dist/packages/external/interest/interestApi.d.ts.map +1 -0
- package/dist/packages/external/interest/interestApi.js +178 -0
- package/dist/packages/external/interest/interestTypes.d.ts +37 -0
- package/dist/packages/external/interest/interestTypes.d.ts.map +1 -0
- package/dist/packages/external/interest/interestTypes.js +12 -0
- package/dist/packages/external/kriya/kriyaApi.d.ts +148 -0
- package/dist/packages/external/kriya/kriyaApi.d.ts.map +1 -0
- package/dist/packages/external/kriya/kriyaApi.js +191 -0
- package/dist/packages/external/kriya/kriyaTypes.d.ts +59 -0
- package/dist/packages/external/kriya/kriyaTypes.d.ts.map +1 -0
- package/dist/packages/external/kriya/kriyaTypes.js +16 -0
- package/dist/packages/external/suiswap/suiswapApi.d.ts +145 -0
- package/dist/packages/external/suiswap/suiswapApi.d.ts.map +1 -0
- package/dist/packages/external/suiswap/suiswapApi.js +197 -0
- package/dist/packages/external/suiswap/suiswapTypes.d.ts +75 -0
- package/dist/packages/external/suiswap/suiswapTypes.d.ts.map +1 -0
- package/dist/packages/external/suiswap/suiswapTypes.js +10 -0
- package/dist/packages/external/turbos/turbosApi.d.ts +206 -8
- package/dist/packages/external/turbos/turbosApi.d.ts.map +1 -1
- package/dist/packages/external/turbos/turbosApi.js +471 -27
- package/dist/packages/farms/farmsStakedPosition.d.ts +20 -0
- package/dist/packages/farms/farmsStakedPosition.d.ts.map +1 -0
- package/dist/packages/farms/farmsStakedPosition.js +63 -0
- package/dist/packages/farms/farmsStakingPool.d.ts +9 -0
- package/dist/packages/farms/farmsStakingPool.d.ts.map +1 -0
- package/dist/packages/farms/farmsStakingPool.js +20 -0
- package/dist/packages/farms/farmsTypes.d.ts +37 -0
- package/dist/packages/farms/farmsTypes.d.ts.map +1 -0
- package/dist/packages/farms/index.d.ts +3 -0
- package/dist/packages/farms/index.d.ts.map +1 -0
- package/dist/packages/{capys → farms}/index.js +2 -3
- package/dist/packages/faucet/api/faucetApi.d.ts +117 -8
- package/dist/packages/faucet/api/faucetApi.d.ts.map +1 -1
- package/dist/packages/faucet/api/faucetApi.js +112 -27
- package/dist/packages/faucet/api/faucetApiCasting.js +3 -3
- package/dist/packages/faucet/faucet.js +15 -15
- package/dist/packages/index.d.ts +3 -1
- package/dist/packages/index.d.ts.map +1 -1
- package/dist/packages/index.js +3 -1
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts +168 -16
- package/dist/packages/nftAmm/api/nftAmmApi.d.ts.map +1 -1
- package/dist/packages/nftAmm/api/nftAmmApi.js +227 -33
- package/dist/packages/nftAmm/api/nftAmmApiCasting.js +12 -12
- package/dist/packages/nftAmm/nftAmm.js +12 -12
- package/dist/packages/nftAmm/nftAmmMarket.js +15 -15
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts +650 -0
- package/dist/packages/perpetuals/api/perpetualsApi.d.ts.map +1 -0
- package/dist/packages/perpetuals/api/perpetualsApi.js +387 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.d.ts +22 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.d.ts.map +1 -0
- package/dist/packages/perpetuals/api/perpetualsCasting.js +201 -0
- package/dist/packages/perpetuals/index.d.ts +4 -0
- package/dist/packages/perpetuals/index.d.ts.map +1 -0
- package/dist/{external/nojo → packages/perpetuals}/index.js +3 -5
- package/dist/packages/perpetuals/perpetuals.d.ts +17 -0
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetuals.js +50 -0
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +22 -0
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetualsAccount.js +65 -0
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +20 -0
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -0
- package/dist/packages/perpetuals/perpetualsMarket.js +52 -0
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +184 -0
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/comparators.d.ts +4 -0
- package/dist/packages/perpetuals/utils/comparators.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/comparators.js +25 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.d.ts +7 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/critBitTreeUtils.js +40 -0
- package/dist/packages/perpetuals/utils/helpers.d.ts +5 -0
- package/dist/packages/perpetuals/utils/helpers.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/helpers.js +9 -0
- package/dist/packages/perpetuals/utils/index.d.ts +4 -0
- package/dist/packages/perpetuals/utils/index.d.ts.map +1 -0
- package/dist/packages/perpetuals/utils/index.js +19 -0
- package/dist/packages/pools/api/poolsApi.d.ts +261 -35
- package/dist/packages/pools/api/poolsApi.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.js +621 -130
- package/dist/packages/pools/api/poolsApiCasting.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApiCasting.js +10 -7
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts +4 -1
- package/dist/packages/pools/api/poolsApiCastingTypes.d.ts.map +1 -1
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +22 -19
- package/dist/packages/pools/pools.js +34 -34
- package/dist/packages/pools/poolsTypes.d.ts +9 -1
- package/dist/packages/pools/poolsTypes.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.d.ts.map +1 -1
- package/dist/packages/pools/utils/cmmmCalculations.js +81 -77
- package/dist/packages/referralVault/api/referralVaultApi.d.ts +166 -4
- package/dist/packages/referralVault/api/referralVaultApi.d.ts.map +1 -1
- package/dist/packages/referralVault/api/referralVaultApi.js +80 -14
- package/dist/packages/referralVault/referralVault.js +9 -9
- package/dist/packages/router/api/routerApi.d.ts +14 -5
- package/dist/packages/router/api/routerApi.d.ts.map +1 -1
- package/dist/packages/router/api/routerApi.js +40 -25
- package/dist/packages/router/api/routerApiCasting.d.ts +6 -0
- package/dist/packages/router/api/routerApiCasting.d.ts.map +1 -0
- package/dist/packages/router/api/routerApiCasting.js +22 -0
- package/dist/packages/router/api/routerApiCastingTypes.d.ts +11 -0
- package/dist/packages/router/api/routerApiCastingTypes.d.ts.map +1 -0
- package/dist/packages/router/api/routerApiHelpers.js +30 -30
- package/dist/packages/router/api/routerAsyncApiHelpers.js +18 -18
- package/dist/packages/router/api/routerSynchronousApiHelpers.d.ts +88 -3
- package/dist/packages/router/api/routerSynchronousApiHelpers.d.ts.map +1 -1
- package/dist/packages/router/api/routerSynchronousApiHelpers.js +125 -28
- package/dist/packages/router/router.d.ts +2 -1
- package/dist/packages/router/router.d.ts.map +1 -1
- package/dist/packages/router/router.js +23 -15
- package/dist/packages/router/routerTypes.d.ts +19 -5
- package/dist/packages/router/routerTypes.d.ts.map +1 -1
- package/dist/packages/router/routerTypes.js +5 -1
- package/dist/packages/router/utils/async/routerAsyncApiInterface.d.ts +1 -8
- package/dist/packages/router/utils/async/routerAsyncApiInterface.d.ts.map +1 -1
- package/dist/packages/router/utils/async/routerAsyncGraph.js +15 -15
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/interfaces/routerPoolInterface.js +30 -14
- package/dist/packages/router/utils/synchronous/routerGraph.js +36 -36
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/aftermathRouterPool.js +18 -16
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/baySwapRouterPool.js +217 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/blueMoveRouterPool.js +221 -0
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/cetusRouterPool.js +11 -11
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/deepBookRouterPool.js +16 -16
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.d.ts +96 -0
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/interestRouterPool.js +174 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.d.ts +102 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/kriyaRouterPool.js +216 -0
- package/dist/packages/router/utils/synchronous/routerPools/{nojoRouterPool.d.ts → suiswapRouterPool.d.ts} +35 -14
- package/dist/packages/router/utils/synchronous/routerPools/suiswapRouterPool.d.ts.map +1 -0
- package/dist/packages/router/utils/synchronous/routerPools/suiswapRouterPool.js +217 -0
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.d.ts +5 -2
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.d.ts.map +1 -1
- package/dist/packages/router/utils/synchronous/routerPools/turbosRouterPool.js +11 -11
- package/dist/packages/staking/api/stakingApi.d.ts +173 -10
- package/dist/packages/staking/api/stakingApi.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApi.js +373 -32
- package/dist/packages/staking/api/stakingApiCasting.d.ts.map +1 -1
- package/dist/packages/staking/api/stakingApiCasting.js +6 -6
- package/dist/packages/staking/staking.js +18 -18
- package/dist/packages/sui/api/suiApi.d.ts +0 -2
- package/dist/packages/sui/api/suiApi.d.ts.map +1 -1
- package/dist/packages/sui/api/suiApi.js +9 -9
- package/dist/packages/sui/sui.js +9 -9
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts +80 -0
- package/dist/packages/suiFrens/api/suiFrensApi.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApi.js +564 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts +13 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApiCasting.js +108 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts +51 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.d.ts.map +1 -0
- package/dist/packages/suiFrens/api/suiFrensApiCastingTypes.js +2 -0
- package/dist/packages/suiFrens/index.d.ts +4 -0
- package/dist/packages/suiFrens/index.d.ts.map +1 -0
- package/dist/packages/suiFrens/index.js +19 -0
- package/dist/packages/suiFrens/stakedSuiFrenReceipt.d.ts +13 -0
- package/dist/packages/suiFrens/stakedSuiFrenReceipt.d.ts.map +1 -0
- package/dist/packages/{capys/stakedCapyReceipt.js → suiFrens/stakedSuiFrenReceipt.js} +21 -21
- package/dist/packages/suiFrens/suiFren.d.ts +10 -0
- package/dist/packages/suiFrens/suiFren.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFren.js +39 -0
- package/dist/packages/suiFrens/suiFrens.d.ts +32 -0
- package/dist/packages/suiFrens/suiFrens.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFrens.js +143 -0
- package/dist/packages/suiFrens/suiFrensTypes.d.ts +89 -0
- package/dist/packages/suiFrens/suiFrensTypes.d.ts.map +1 -0
- package/dist/packages/suiFrens/suiFrensTypes.js +2 -0
- package/dist/types.d.ts +3 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -2
- package/package.json +12 -5
- package/dist/external/nojo/amm/index.d.ts +0 -2
- package/dist/external/nojo/amm/index.d.ts.map +0 -1
- package/dist/external/nojo/amm/index.js +0 -4
- package/dist/external/nojo/amm/init.d.ts +0 -3
- package/dist/external/nojo/amm/init.d.ts.map +0 -1
- package/dist/external/nojo/amm/init.js +0 -31
- package/dist/external/nojo/amm/pool/errors.d.ts +0 -41
- package/dist/external/nojo/amm/pool/errors.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/errors.js +0 -75
- package/dist/external/nojo/amm/pool/functions.d.ts +0 -356
- package/dist/external/nojo/amm/pool/functions.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/functions.js +0 -173
- package/dist/external/nojo/amm/pool/structs.d.ts +0 -94
- package/dist/external/nojo/amm/pool/structs.d.ts.map +0 -1
- package/dist/external/nojo/amm/pool/structs.js +0 -278
- package/dist/external/nojo/amm/util/functions.d.ts +0 -359
- package/dist/external/nojo/amm/util/functions.d.ts.map +0 -1
- package/dist/external/nojo/amm/util/functions.js +0 -198
- package/dist/external/nojo/framework/balance.d.ts +0 -19
- package/dist/external/nojo/framework/balance.d.ts.map +0 -1
- package/dist/external/nojo/framework/balance.js +0 -44
- package/dist/external/nojo/framework/bcs.d.ts +0 -3
- package/dist/external/nojo/framework/bcs.d.ts.map +0 -1
- package/dist/external/nojo/framework/bcs.js +0 -5
- package/dist/external/nojo/framework/coin.d.ts +0 -42
- package/dist/external/nojo/framework/coin.d.ts.map +0 -1
- package/dist/external/nojo/framework/coin.js +0 -144
- package/dist/external/nojo/framework/dynamic-field.d.ts +0 -25
- package/dist/external/nojo/framework/dynamic-field.d.ts.map +0 -1
- package/dist/external/nojo/framework/dynamic-field.js +0 -89
- package/dist/external/nojo/framework/init.d.ts +0 -3
- package/dist/external/nojo/framework/init.d.ts.map +0 -1
- package/dist/external/nojo/framework/init.js +0 -41
- package/dist/external/nojo/framework/loader.d.ts +0 -12
- package/dist/external/nojo/framework/loader.d.ts.map +0 -1
- package/dist/external/nojo/framework/loader.js +0 -103
- package/dist/external/nojo/framework/object.d.ts +0 -33
- package/dist/external/nojo/framework/object.d.ts.map +0 -1
- package/dist/external/nojo/framework/object.js +0 -89
- package/dist/external/nojo/framework/table.d.ts +0 -23
- package/dist/external/nojo/framework/table.d.ts.map +0 -1
- package/dist/external/nojo/framework/table.js +0 -83
- package/dist/external/nojo/framework/type-name.d.ts +0 -15
- package/dist/external/nojo/framework/type-name.d.ts.map +0 -1
- package/dist/external/nojo/framework/type-name.js +0 -34
- package/dist/external/nojo/framework/type.d.ts +0 -24
- package/dist/external/nojo/framework/type.d.ts.map +0 -1
- package/dist/external/nojo/framework/type.js +0 -120
- package/dist/external/nojo/framework/util.d.ts +0 -31
- package/dist/external/nojo/framework/util.d.ts.map +0 -1
- package/dist/external/nojo/framework/util.js +0 -49
- package/dist/external/nojo/index.d.ts +0 -6
- package/dist/external/nojo/index.d.ts.map +0 -1
- package/dist/external/nojo/init.d.ts +0 -2
- package/dist/external/nojo/init.d.ts.map +0 -1
- package/dist/external/nojo/init.js +0 -39
- package/dist/packages/capys/api/capysApi.d.ts +0 -37
- package/dist/packages/capys/api/capysApi.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApi.js +0 -200
- package/dist/packages/capys/api/capysApiCasting.d.ts +0 -13
- package/dist/packages/capys/api/capysApiCasting.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiCasting.js +0 -108
- package/dist/packages/capys/api/capysApiCastingTypes.d.ts +0 -51
- package/dist/packages/capys/api/capysApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiHelpers.d.ts +0 -48
- package/dist/packages/capys/api/capysApiHelpers.d.ts.map +0 -1
- package/dist/packages/capys/api/capysApiHelpers.js +0 -386
- package/dist/packages/capys/capys.d.ts +0 -32
- package/dist/packages/capys/capys.d.ts.map +0 -1
- package/dist/packages/capys/capys.js +0 -151
- package/dist/packages/capys/capysTypes.d.ts +0 -89
- package/dist/packages/capys/capysTypes.d.ts.map +0 -1
- package/dist/packages/capys/index.d.ts +0 -4
- package/dist/packages/capys/index.d.ts.map +0 -1
- package/dist/packages/capys/stakedCapyReceipt.d.ts +0 -14
- package/dist/packages/capys/stakedCapyReceipt.d.ts.map +0 -1
- package/dist/packages/coin/api/coinApiHelpers.d.ts +0 -23
- package/dist/packages/coin/api/coinApiHelpers.d.ts.map +0 -1
- package/dist/packages/coin/api/coinApiHelpers.js +0 -203
- package/dist/packages/external/cetus/cetusApiHelpers.d.ts +0 -247
- package/dist/packages/external/cetus/cetusApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/cetus/cetusApiHelpers.js +0 -303
- package/dist/packages/external/deepBook/deepBookApiHelper.d.ts.map +0 -1
- package/dist/packages/external/deepBook/deepBookApiHelper.js +0 -193
- package/dist/packages/external/nojo/nojoAmmApi.d.ts +0 -24
- package/dist/packages/external/nojo/nojoAmmApi.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmApi.js +0 -86
- package/dist/packages/external/nojo/nojoAmmApiHelpers.d.ts +0 -14
- package/dist/packages/external/nojo/nojoAmmApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmApiHelpers.js +0 -69
- package/dist/packages/external/nojo/nojoAmmTypes.d.ts +0 -9
- package/dist/packages/external/nojo/nojoAmmTypes.d.ts.map +0 -1
- package/dist/packages/external/nojo/nojoAmmTypes.js +0 -7
- package/dist/packages/external/turbos/turbosApiHelpers.d.ts +0 -205
- package/dist/packages/external/turbos/turbosApiHelpers.d.ts.map +0 -1
- package/dist/packages/external/turbos/turbosApiHelpers.js +0 -325
- package/dist/packages/faucet/api/faucetApiHelpers.d.ts.map +0 -1
- package/dist/packages/faucet/api/faucetApiHelpers.js +0 -90
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.d.ts +0 -193
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.d.ts.map +0 -1
- package/dist/packages/nftAmm/api/nftAmmApiHelpers.js +0 -238
- package/dist/packages/pools/api/poolsApiHelpers.d.ts +0 -204
- package/dist/packages/pools/api/poolsApiHelpers.d.ts.map +0 -1
- package/dist/packages/pools/api/poolsApiHelpers.js +0 -523
- package/dist/packages/referralVault/api/referralVaultApiHelpers.d.ts.map +0 -1
- package/dist/packages/referralVault/api/referralVaultApiHelpers.js +0 -86
- package/dist/packages/router/utils/synchronous/routerPools/nojoRouterPool.d.ts.map +0 -1
- package/dist/packages/router/utils/synchronous/routerPools/nojoRouterPool.js +0 -99
- package/dist/packages/staking/api/stakingApiHelpers.d.ts +0 -212
- package/dist/packages/staking/api/stakingApiHelpers.d.ts.map +0 -1
- package/dist/packages/staking/api/stakingApiHelpers.js +0 -400
- package/dist/packages/sui/api/suiApiCasting.d.ts +0 -3
- package/dist/packages/sui/api/suiApiCasting.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiCasting.js +0 -6
- package/dist/packages/sui/api/suiApiCastingTypes.d.ts +0 -2
- package/dist/packages/sui/api/suiApiCastingTypes.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiHelpers.d.ts +0 -6
- package/dist/packages/sui/api/suiApiHelpers.d.ts.map +0 -1
- package/dist/packages/sui/api/suiApiHelpers.js +0 -13
- /package/dist/packages/{capys/api/capysApiCastingTypes.js → farms/farmsTypes.js} +0 -0
- /package/dist/packages/{capys/capysTypes.js → perpetuals/perpetualsTypes.js} +0 -0
- /package/dist/packages/{sui/api/suiApiCastingTypes.js → router/api/routerApiCastingTypes.js} +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { AftermathApi } from "../../../general/providers";
|
|
2
|
+
import { CoinType } from "../../coin/coinTypes";
|
|
3
|
+
import { RouterApiInterface } from "../../router/utils/synchronous/interfaces/routerApiInterface";
|
|
4
|
+
import { ObjectId, TransactionArgument, TransactionBlock } from "@mysten/sui.js";
|
|
5
|
+
import { AnyObjectType, Balance, SuiswapAddresses, PoolsAddresses, ReferralVaultAddresses } from "../../../types";
|
|
6
|
+
import { SuiswapPoolObject } from "./suiswapTypes";
|
|
7
|
+
export declare class SuiswapApi implements RouterApiInterface<SuiswapPoolObject> {
|
|
8
|
+
private readonly Provider;
|
|
9
|
+
private static readonly constants;
|
|
10
|
+
readonly addresses: {
|
|
11
|
+
suiswap: SuiswapAddresses;
|
|
12
|
+
pools: PoolsAddresses;
|
|
13
|
+
referralVault: ReferralVaultAddresses;
|
|
14
|
+
};
|
|
15
|
+
readonly eventTypes: {
|
|
16
|
+
poolCreated: AnyObjectType;
|
|
17
|
+
};
|
|
18
|
+
constructor(Provider: AftermathApi);
|
|
19
|
+
fetchAllPools: () => Promise<SuiswapPoolObject[]>;
|
|
20
|
+
fetchSupportedCoins: () => Promise<CoinType[]>;
|
|
21
|
+
doSwapXToYDirectTx: (inputs: {
|
|
22
|
+
tx: TransactionBlock;
|
|
23
|
+
poolObjectId: ObjectId;
|
|
24
|
+
coinInId: ObjectId | TransactionArgument;
|
|
25
|
+
coinInType: CoinType;
|
|
26
|
+
coinOutType: CoinType;
|
|
27
|
+
tradePotato: TransactionArgument;
|
|
28
|
+
isFirstSwapForPath: boolean;
|
|
29
|
+
isLastSwapForPath: boolean;
|
|
30
|
+
minAmountOut: Balance;
|
|
31
|
+
}) => ({
|
|
32
|
+
kind: "Input";
|
|
33
|
+
index: number;
|
|
34
|
+
type?: "object" | "pure" | undefined;
|
|
35
|
+
value?: any;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "GasCoin";
|
|
38
|
+
} | {
|
|
39
|
+
kind: "Result";
|
|
40
|
+
index: number;
|
|
41
|
+
} | {
|
|
42
|
+
kind: "NestedResult";
|
|
43
|
+
index: number;
|
|
44
|
+
resultIndex: number;
|
|
45
|
+
}) & ({
|
|
46
|
+
kind: "Input";
|
|
47
|
+
index: number;
|
|
48
|
+
type?: "object" | "pure" | undefined;
|
|
49
|
+
value?: any;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "GasCoin";
|
|
52
|
+
} | {
|
|
53
|
+
kind: "Result";
|
|
54
|
+
index: number;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "NestedResult";
|
|
57
|
+
index: number;
|
|
58
|
+
resultIndex: number;
|
|
59
|
+
})[];
|
|
60
|
+
doSwapYToXDirectTx: (inputs: {
|
|
61
|
+
tx: TransactionBlock;
|
|
62
|
+
poolObjectId: ObjectId;
|
|
63
|
+
coinInId: ObjectId | TransactionArgument;
|
|
64
|
+
coinInType: CoinType;
|
|
65
|
+
coinOutType: CoinType;
|
|
66
|
+
tradePotato: TransactionArgument;
|
|
67
|
+
isFirstSwapForPath: boolean;
|
|
68
|
+
isLastSwapForPath: boolean;
|
|
69
|
+
minAmountOut: Balance;
|
|
70
|
+
}) => ({
|
|
71
|
+
kind: "Input";
|
|
72
|
+
index: number;
|
|
73
|
+
type?: "object" | "pure" | undefined;
|
|
74
|
+
value?: any;
|
|
75
|
+
} | {
|
|
76
|
+
kind: "GasCoin";
|
|
77
|
+
} | {
|
|
78
|
+
kind: "Result";
|
|
79
|
+
index: number;
|
|
80
|
+
} | {
|
|
81
|
+
kind: "NestedResult";
|
|
82
|
+
index: number;
|
|
83
|
+
resultIndex: number;
|
|
84
|
+
}) & ({
|
|
85
|
+
kind: "Input";
|
|
86
|
+
index: number;
|
|
87
|
+
type?: "object" | "pure" | undefined;
|
|
88
|
+
value?: any;
|
|
89
|
+
} | {
|
|
90
|
+
kind: "GasCoin";
|
|
91
|
+
} | {
|
|
92
|
+
kind: "Result";
|
|
93
|
+
index: number;
|
|
94
|
+
} | {
|
|
95
|
+
kind: "NestedResult";
|
|
96
|
+
index: number;
|
|
97
|
+
resultIndex: number;
|
|
98
|
+
})[];
|
|
99
|
+
tradeTx: (inputs: {
|
|
100
|
+
tx: TransactionBlock;
|
|
101
|
+
pool: SuiswapPoolObject;
|
|
102
|
+
coinInId: ObjectId | TransactionArgument;
|
|
103
|
+
coinInType: CoinType;
|
|
104
|
+
coinOutType: CoinType;
|
|
105
|
+
tradePotato: TransactionArgument;
|
|
106
|
+
isFirstSwapForPath: boolean;
|
|
107
|
+
isLastSwapForPath: boolean;
|
|
108
|
+
minAmountOut: Balance;
|
|
109
|
+
}) => ({
|
|
110
|
+
kind: "Input";
|
|
111
|
+
index: number;
|
|
112
|
+
type?: "object" | "pure" | undefined;
|
|
113
|
+
value?: any;
|
|
114
|
+
} | {
|
|
115
|
+
kind: "GasCoin";
|
|
116
|
+
} | {
|
|
117
|
+
kind: "Result";
|
|
118
|
+
index: number;
|
|
119
|
+
} | {
|
|
120
|
+
kind: "NestedResult";
|
|
121
|
+
index: number;
|
|
122
|
+
resultIndex: number;
|
|
123
|
+
}) & ({
|
|
124
|
+
kind: "Input";
|
|
125
|
+
index: number;
|
|
126
|
+
type?: "object" | "pure" | undefined;
|
|
127
|
+
value?: any;
|
|
128
|
+
} | {
|
|
129
|
+
kind: "GasCoin";
|
|
130
|
+
} | {
|
|
131
|
+
kind: "Result";
|
|
132
|
+
index: number;
|
|
133
|
+
} | {
|
|
134
|
+
kind: "NestedResult";
|
|
135
|
+
index: number;
|
|
136
|
+
resultIndex: number;
|
|
137
|
+
})[];
|
|
138
|
+
static isCoinX: (inputs: {
|
|
139
|
+
pool: SuiswapPoolObject;
|
|
140
|
+
coinType: CoinType;
|
|
141
|
+
}) => boolean;
|
|
142
|
+
private static suiswapPoolObjectFromSuiObjectResponse;
|
|
143
|
+
private static suiswapPoolCreatedEventFromOnChain;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=suiswapApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suiswapApi.d.ts","sourceRoot":"","sources":["../../../../src/packages/external/suiswap/suiswapApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAClG,OAAO,EACN,QAAQ,EAER,mBAAmB,EACnB,gBAAgB,EAIhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIN,iBAAiB,EACjB,MAAM,gBAAgB,CAAC;AAKxB,qBAAa,UAAW,YAAW,kBAAkB,CAAC,iBAAiB,CAAC;IA8B3D,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAzBrC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAK/B;IAMF,SAAgB,SAAS,EAAE;QAC1B,OAAO,EAAE,gBAAgB,CAAC;QAC1B,KAAK,EAAE,cAAc,CAAC;QACtB,aAAa,EAAE,sBAAsB,CAAC;KACtC,CAAC;IAEF,SAAgB,UAAU,EAAE;QAC3B,WAAW,EAAE,aAAa,CAAC;KAC3B,CAAC;gBAM2B,QAAQ,EAAE,YAAY;IA6B5C,aAAa,QAAa,QAAQ,iBAAiB,EAAE,CAAC,CA6B3D;IAMK,mBAAmB,QAAa,QAAQ,QAAQ,EAAE,CAAC,CAOxD;IAMK,kBAAkB,WAAY;QACpC,EAAE,EAAE,gBAAgB,CAAC;QACrB,YAAY,EAAE,QAAQ,CAAC;QACvB,QAAQ,EAAE,QAAQ,GAAG,mBAAmB,CAAC;QACzC,UAAU,EAAE,QAAQ,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC;QACtB,WAAW,EAAE,mBAAmB,CAAC;QACjC,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAkCC;IAEK,kBAAkB,WAAY;QACpC,EAAE,EAAE,gBAAgB,CAAC;QACrB,YAAY,EAAE,QAAQ,CAAC;QACvB,QAAQ,EAAE,QAAQ,GAAG,mBAAmB,CAAC;QACzC,UAAU,EAAE,QAAQ,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC;QACtB,WAAW,EAAE,mBAAmB,CAAC;QACjC,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAkCC;IAMK,OAAO,WAAY;QACzB,EAAE,EAAE,gBAAgB,CAAC;QACrB,IAAI,EAAE,iBAAiB,CAAC;QACxB,QAAQ,EAAE,QAAQ,GAAG,mBAAmB,CAAC;QACzC,UAAU,EAAE,QAAQ,CAAC;QACrB,WAAW,EAAE,QAAQ,CAAC;QACtB,WAAW,EAAE,mBAAmB,CAAC;QACjC,kBAAkB,EAAE,OAAO,CAAC;QAC5B,iBAAiB,EAAE,OAAO,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC;KACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAWC;IAMF,OAAc,OAAO,WAAY;QAChC,IAAI,EAAE,iBAAiB,CAAC;QACxB,QAAQ,EAAE,QAAQ,CAAC;KACnB,aAGC;IAUF,OAAO,CAAC,MAAM,CAAC,sCAAsC,CA2CnD;IAEF,OAAO,CAAC,MAAM,CAAC,kCAAkC,CAU/C;CACF"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SuiswapApi = void 0;
|
|
13
|
+
const sui_js_1 = require("@mysten/sui.js");
|
|
14
|
+
const coin_1 = require("../../coin");
|
|
15
|
+
const utils_1 = require("../../../general/utils");
|
|
16
|
+
const sui_1 = require("../../sui");
|
|
17
|
+
class SuiswapApi {
|
|
18
|
+
// =========================================================================
|
|
19
|
+
// Constructor
|
|
20
|
+
// =========================================================================
|
|
21
|
+
constructor(Provider) {
|
|
22
|
+
var _a;
|
|
23
|
+
this.Provider = Provider;
|
|
24
|
+
// =========================================================================
|
|
25
|
+
// Public Methods
|
|
26
|
+
// =========================================================================
|
|
27
|
+
// =========================================================================
|
|
28
|
+
// Objects
|
|
29
|
+
// =========================================================================
|
|
30
|
+
this.fetchAllPools = () => __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const poolObjectIds = yield this.Provider.Events().fetchAllEvents({
|
|
32
|
+
fetchEventsFunc: (eventsInputs) => this.Provider.Events().fetchCastEventsWithCursor(Object.assign(Object.assign({}, eventsInputs), { query: {
|
|
33
|
+
MoveEventType: this.eventTypes.poolCreated,
|
|
34
|
+
}, eventFromEventOnChain: (eventOnChain) => SuiswapApi.suiswapPoolCreatedEventFromOnChain(eventOnChain).poolId })),
|
|
35
|
+
});
|
|
36
|
+
const pools = yield this.Provider.Objects().fetchCastObjectBatch({
|
|
37
|
+
objectIds: poolObjectIds,
|
|
38
|
+
objectFromSuiObjectResponse: SuiswapApi.suiswapPoolObjectFromSuiObjectResponse,
|
|
39
|
+
});
|
|
40
|
+
const unlockedPools = pools.filter((pool) =>
|
|
41
|
+
// !pool.freeze &&
|
|
42
|
+
// pool.xValue > BigInt(0) &&
|
|
43
|
+
// pool.yValue > BigInt(0)
|
|
44
|
+
true);
|
|
45
|
+
return unlockedPools;
|
|
46
|
+
});
|
|
47
|
+
// =========================================================================
|
|
48
|
+
// Inspections
|
|
49
|
+
// =========================================================================
|
|
50
|
+
this.fetchSupportedCoins = () => __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const pools = yield this.fetchAllPools();
|
|
52
|
+
const allCoins = pools.reduce((acc, pool) => [...acc, pool.coinTypeX, pool.coinTypeY], []);
|
|
53
|
+
return utils_1.Helpers.uniqueArray(allCoins);
|
|
54
|
+
});
|
|
55
|
+
// =========================================================================
|
|
56
|
+
// Transaction Commands
|
|
57
|
+
// =========================================================================
|
|
58
|
+
this.doSwapXToYDirectTx = (inputs) => {
|
|
59
|
+
const { tx, coinInId, tradePotato, isFirstSwapForPath, isLastSwapForPath, } = inputs;
|
|
60
|
+
return tx.moveCall({
|
|
61
|
+
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.suiswap.packages.wrapper, SuiswapApi.constants.moduleNames.wrapper, "do_swap_x_to_y_direct"),
|
|
62
|
+
typeArguments: [inputs.coinInType, inputs.coinOutType],
|
|
63
|
+
arguments: [
|
|
64
|
+
tx.object(inputs.poolObjectId),
|
|
65
|
+
typeof coinInId === "string" ? tx.object(coinInId) : coinInId,
|
|
66
|
+
tx.pure(inputs.minAmountOut, "U64"),
|
|
67
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
68
|
+
// AF fees
|
|
69
|
+
tx.object(this.addresses.pools.objects.protocolFeeVault),
|
|
70
|
+
tx.object(this.addresses.pools.objects.treasury),
|
|
71
|
+
tx.object(this.addresses.pools.objects.insuranceFund),
|
|
72
|
+
tx.object(this.addresses.referralVault.objects.referralVault),
|
|
73
|
+
// potato
|
|
74
|
+
tradePotato,
|
|
75
|
+
tx.pure(isFirstSwapForPath, "bool"),
|
|
76
|
+
tx.pure(isLastSwapForPath, "bool"),
|
|
77
|
+
],
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.doSwapYToXDirectTx = (inputs) => {
|
|
81
|
+
const { tx, coinInId, tradePotato, isFirstSwapForPath, isLastSwapForPath, } = inputs;
|
|
82
|
+
return tx.moveCall({
|
|
83
|
+
target: utils_1.Helpers.transactions.createTxTarget(this.addresses.suiswap.packages.wrapper, SuiswapApi.constants.moduleNames.wrapper, "do_swap_y_to_x_direct"),
|
|
84
|
+
typeArguments: [inputs.coinOutType, inputs.coinInType],
|
|
85
|
+
arguments: [
|
|
86
|
+
tx.object(inputs.poolObjectId),
|
|
87
|
+
typeof coinInId === "string" ? tx.object(coinInId) : coinInId,
|
|
88
|
+
tx.pure(inputs.minAmountOut, "U64"),
|
|
89
|
+
tx.object(sui_1.Sui.constants.addresses.suiClockId),
|
|
90
|
+
// AF fees
|
|
91
|
+
tx.object(this.addresses.pools.objects.protocolFeeVault),
|
|
92
|
+
tx.object(this.addresses.pools.objects.treasury),
|
|
93
|
+
tx.object(this.addresses.pools.objects.insuranceFund),
|
|
94
|
+
tx.object(this.addresses.referralVault.objects.referralVault),
|
|
95
|
+
// potato
|
|
96
|
+
tradePotato,
|
|
97
|
+
tx.pure(isFirstSwapForPath, "bool"),
|
|
98
|
+
tx.pure(isLastSwapForPath, "bool"),
|
|
99
|
+
],
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
// =========================================================================
|
|
103
|
+
// Transaction Command Wrappers
|
|
104
|
+
// =========================================================================
|
|
105
|
+
this.tradeTx = (inputs) => {
|
|
106
|
+
const commandInputs = Object.assign(Object.assign({}, inputs), { poolObjectId: inputs.pool.objectId });
|
|
107
|
+
if (SuiswapApi.isCoinX(Object.assign(Object.assign({}, inputs), { coinType: inputs.coinInType }))) {
|
|
108
|
+
return this.doSwapXToYDirectTx(commandInputs);
|
|
109
|
+
}
|
|
110
|
+
return this.doSwapYToXDirectTx(commandInputs);
|
|
111
|
+
};
|
|
112
|
+
const suiswap = (_a = this.Provider.addresses.router) === null || _a === void 0 ? void 0 : _a.suiswap;
|
|
113
|
+
const pools = this.Provider.addresses.pools;
|
|
114
|
+
const referralVault = this.Provider.addresses.referralVault;
|
|
115
|
+
if (!suiswap || !pools || !referralVault)
|
|
116
|
+
throw new Error("not all required addresses have been set in provider");
|
|
117
|
+
this.addresses = {
|
|
118
|
+
suiswap,
|
|
119
|
+
pools,
|
|
120
|
+
referralVault,
|
|
121
|
+
};
|
|
122
|
+
this.eventTypes = {
|
|
123
|
+
poolCreated: `${suiswap.packages.dex}::${SuiswapApi.constants.moduleNames.pool}::PoolCreateEvent`,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.SuiswapApi = SuiswapApi;
|
|
128
|
+
// =========================================================================
|
|
129
|
+
// Constants
|
|
130
|
+
// =========================================================================
|
|
131
|
+
SuiswapApi.constants = {
|
|
132
|
+
moduleNames: {
|
|
133
|
+
pool: "pool",
|
|
134
|
+
wrapper: "suiswap",
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
// =========================================================================
|
|
138
|
+
// Public Static Methods
|
|
139
|
+
// =========================================================================
|
|
140
|
+
SuiswapApi.isCoinX = (inputs) => {
|
|
141
|
+
const { coinType, pool } = inputs;
|
|
142
|
+
return utils_1.Helpers.addLeadingZeroesToType(coinType) === pool.coinTypeX;
|
|
143
|
+
};
|
|
144
|
+
// =========================================================================
|
|
145
|
+
// Private Static Methods
|
|
146
|
+
// =========================================================================
|
|
147
|
+
// =========================================================================
|
|
148
|
+
// Casting
|
|
149
|
+
// =========================================================================
|
|
150
|
+
SuiswapApi.suiswapPoolObjectFromSuiObjectResponse = (data) => {
|
|
151
|
+
const objectType = (0, sui_js_1.getObjectType)(data);
|
|
152
|
+
if (!objectType)
|
|
153
|
+
throw new Error("no object type found");
|
|
154
|
+
const coinTypes = coin_1.Coin.getInnerCoinType(objectType)
|
|
155
|
+
.replaceAll(" ", "")
|
|
156
|
+
.split(",")
|
|
157
|
+
.map((coin) => utils_1.Helpers.addLeadingZeroesToType(coin));
|
|
158
|
+
const fields = (0, sui_js_1.getObjectFields)(data);
|
|
159
|
+
return {
|
|
160
|
+
// objectType,
|
|
161
|
+
objectId: (0, sui_js_1.getObjectId)(data),
|
|
162
|
+
version: BigInt(fields.version),
|
|
163
|
+
owner: fields.owner,
|
|
164
|
+
index: BigInt(fields.index),
|
|
165
|
+
poolType: Number(fields.pool_type) === 100 ? "v2" : "stable",
|
|
166
|
+
lspSupply: BigInt(fields.lsp_supply),
|
|
167
|
+
isFrozen: BigInt(fields.freeze) === BigInt(0),
|
|
168
|
+
tradeEpoch: BigInt(fields.trade_epoch),
|
|
169
|
+
feeDirection: Number(fields.fee.fields.direction) === 200 ? "X" : "Y",
|
|
170
|
+
feeAdmin: BigInt(fields.fee.fields.admin),
|
|
171
|
+
feeLp: BigInt(fields.fee.fields.lp),
|
|
172
|
+
feeTh: BigInt(fields.fee.fields.th),
|
|
173
|
+
feeWithdraw: BigInt(fields.fee.fields.withdraw),
|
|
174
|
+
stableAmp: BigInt(fields.stable.fields.amp),
|
|
175
|
+
stableXScale: BigInt(fields.stable.fields.x_scale),
|
|
176
|
+
stableYScale: BigInt(fields.stable.fields.y_scale),
|
|
177
|
+
xValue: BigInt(fields.balance.fields.x),
|
|
178
|
+
yValue: BigInt(fields.balance.fields.y),
|
|
179
|
+
xAdminValue: BigInt(fields.balance.fields.x_admin),
|
|
180
|
+
yAdminValue: BigInt(fields.balance.fields.y_admin),
|
|
181
|
+
xThValue: BigInt(fields.balance.fields.x_th),
|
|
182
|
+
yThValue: BigInt(fields.balance.fields.y_th),
|
|
183
|
+
bx: BigInt(fields.balance.fields.bx),
|
|
184
|
+
by: BigInt(fields.balance.fields.by),
|
|
185
|
+
coinTypeX: coinTypes[0],
|
|
186
|
+
coinTypeY: coinTypes[1],
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
SuiswapApi.suiswapPoolCreatedEventFromOnChain = (eventOnChain) => {
|
|
190
|
+
const fields = eventOnChain.parsedJson;
|
|
191
|
+
return {
|
|
192
|
+
poolId: fields.pool_id,
|
|
193
|
+
timestamp: eventOnChain.timestampMs,
|
|
194
|
+
txnDigest: eventOnChain.id.txDigest,
|
|
195
|
+
type: eventOnChain.type,
|
|
196
|
+
};
|
|
197
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ObjectId, SuiAddress } from "@mysten/sui.js";
|
|
2
|
+
import { BigIntAsString, CoinType, Event, Object, RouterSerializablePool } from "../../../types";
|
|
3
|
+
import { EventOnChain } from "../../../general/types/castingTypes";
|
|
4
|
+
export interface SuiswapPoolObject extends Object {
|
|
5
|
+
version: bigint;
|
|
6
|
+
owner: SuiAddress;
|
|
7
|
+
index: bigint;
|
|
8
|
+
poolType: "v2" | "stable";
|
|
9
|
+
lspSupply: bigint;
|
|
10
|
+
isFrozen: boolean;
|
|
11
|
+
tradeEpoch: bigint;
|
|
12
|
+
feeDirection: "X" | "Y";
|
|
13
|
+
feeAdmin: bigint;
|
|
14
|
+
feeLp: bigint;
|
|
15
|
+
feeTh: bigint;
|
|
16
|
+
feeWithdraw: bigint;
|
|
17
|
+
stableAmp: bigint;
|
|
18
|
+
stableXScale: bigint;
|
|
19
|
+
stableYScale: bigint;
|
|
20
|
+
xValue: bigint;
|
|
21
|
+
yValue: bigint;
|
|
22
|
+
xAdminValue: bigint;
|
|
23
|
+
yAdminValue: bigint;
|
|
24
|
+
xThValue: bigint;
|
|
25
|
+
yThValue: bigint;
|
|
26
|
+
bx: bigint;
|
|
27
|
+
by: bigint;
|
|
28
|
+
coinTypeX: CoinType;
|
|
29
|
+
coinTypeY: CoinType;
|
|
30
|
+
}
|
|
31
|
+
export declare const isSuiswapPoolObject: (pool: RouterSerializablePool) => pool is SuiswapPoolObject;
|
|
32
|
+
export interface SuiswapPoolCreateEvent extends Event {
|
|
33
|
+
poolId: ObjectId;
|
|
34
|
+
}
|
|
35
|
+
export interface SuiswapPoolFieldsOnChain {
|
|
36
|
+
version: BigIntAsString;
|
|
37
|
+
owner: SuiAddress;
|
|
38
|
+
index: BigIntAsString;
|
|
39
|
+
pool_type: BigIntAsString;
|
|
40
|
+
lsp_supply: BigIntAsString;
|
|
41
|
+
freeze: BigIntAsString;
|
|
42
|
+
trade_epoch: BigIntAsString;
|
|
43
|
+
fee: {
|
|
44
|
+
fields: {
|
|
45
|
+
direction: BigIntAsString;
|
|
46
|
+
admin: BigIntAsString;
|
|
47
|
+
lp: BigIntAsString;
|
|
48
|
+
th: BigIntAsString;
|
|
49
|
+
withdraw: BigIntAsString;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
stable: {
|
|
53
|
+
fields: {
|
|
54
|
+
amp: BigIntAsString;
|
|
55
|
+
x_scale: BigIntAsString;
|
|
56
|
+
y_scale: BigIntAsString;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
balance: {
|
|
60
|
+
fields: {
|
|
61
|
+
x: BigIntAsString;
|
|
62
|
+
y: BigIntAsString;
|
|
63
|
+
x_admin: BigIntAsString;
|
|
64
|
+
y_admin: BigIntAsString;
|
|
65
|
+
x_th: BigIntAsString;
|
|
66
|
+
y_th: BigIntAsString;
|
|
67
|
+
bx: BigIntAsString;
|
|
68
|
+
by: BigIntAsString;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export type SuiswapPoolCreateEventOnChain = EventOnChain<{
|
|
73
|
+
pool_id: ObjectId;
|
|
74
|
+
}>;
|
|
75
|
+
//# sourceMappingURL=suiswapTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suiswapTypes.d.ts","sourceRoot":"","sources":["../../../../src/packages/external/suiswap/suiswapTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACN,cAAc,EACd,QAAQ,EACR,KAAK,EACL,MAAM,EACN,sBAAsB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAMnE,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,GAAG,GAAG,GAAG,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,QAAQ,CAAC;IACpB,SAAS,EAAE,QAAQ,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,SACzB,sBAAsB,8BAQ5B,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,KAAK;IACpD,MAAM,EAAE,QAAQ,CAAC;CACjB;AAMD,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,cAAc,CAAC;IAC1B,UAAU,EAAE,cAAc,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,WAAW,EAAE,cAAc,CAAC;IAC5B,GAAG,EAAE;QACJ,MAAM,EAAE;YACP,SAAS,EAAE,cAAc,CAAC;YAC1B,KAAK,EAAE,cAAc,CAAC;YACtB,EAAE,EAAE,cAAc,CAAC;YACnB,EAAE,EAAE,cAAc,CAAC;YACnB,QAAQ,EAAE,cAAc,CAAC;SACzB,CAAC;KACF,CAAC;IACF,MAAM,EAAE;QACP,MAAM,EAAE;YACP,GAAG,EAAE,cAAc,CAAC;YACpB,OAAO,EAAE,cAAc,CAAC;YACxB,OAAO,EAAE,cAAc,CAAC;SACxB,CAAC;KACF,CAAC;IACF,OAAO,EAAE;QACR,MAAM,EAAE;YACP,CAAC,EAAE,cAAc,CAAC;YAClB,CAAC,EAAE,cAAc,CAAC;YAClB,OAAO,EAAE,cAAc,CAAC;YACxB,OAAO,EAAE,cAAc,CAAC;YACxB,IAAI,EAAE,cAAc,CAAC;YACrB,IAAI,EAAE,cAAc,CAAC;YACrB,EAAE,EAAE,cAAc,CAAC;YACnB,EAAE,EAAE,cAAc,CAAC;SACnB,CAAC;KACF,CAAC;CACF;AAED,MAAM,MAAM,6BAA6B,GAAG,YAAY,CAAC;IACxD,OAAO,EAAE,QAAQ,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSuiswapPoolObject = void 0;
|
|
4
|
+
const isSuiswapPoolObject = (pool) => {
|
|
5
|
+
return ("poolType" in pool &&
|
|
6
|
+
"lspSupply" in pool &&
|
|
7
|
+
"xValue" in pool &&
|
|
8
|
+
"bx" in pool);
|
|
9
|
+
};
|
|
10
|
+
exports.isSuiswapPoolObject = isSuiswapPoolObject;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { AftermathApi } from "../../../general/providers";
|
|
2
2
|
import { CoinType } from "../../coin/coinTypes";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Balance, SerializedTransaction } from "../../../types";
|
|
3
|
+
import { ObjectId, SuiAddress, TransactionArgument, TransactionBlock } from "@mysten/sui.js";
|
|
4
|
+
import { Balance, PoolsAddresses, ReferralVaultAddresses, RouterExternalFee, TurbosAddresses } from "../../../types";
|
|
6
5
|
import { RouterApiInterface } from "../../router/utils/synchronous/interfaces/routerApiInterface";
|
|
7
|
-
import { TurbosPoolObject } from "./turbosTypes";
|
|
6
|
+
import { TurbosCalcTradeResult, TurbosPoolObject } from "./turbosTypes";
|
|
8
7
|
export declare class TurbosApi implements RouterApiInterface<TurbosPoolObject> {
|
|
9
|
-
|
|
10
|
-
readonly
|
|
8
|
+
readonly Provider: AftermathApi;
|
|
9
|
+
private static readonly constants;
|
|
10
|
+
readonly addresses: {
|
|
11
|
+
turbos: TurbosAddresses;
|
|
12
|
+
pools: PoolsAddresses;
|
|
13
|
+
referralVault: ReferralVaultAddresses;
|
|
14
|
+
};
|
|
15
|
+
private static MIN_TICK_INDEX;
|
|
16
|
+
private static MAX_TICK_INDEX;
|
|
11
17
|
constructor(Provider: AftermathApi);
|
|
12
18
|
fetchAllPools: () => Promise<TurbosPoolObject[]>;
|
|
13
19
|
fetchPoolsForTrade: (inputs: {
|
|
@@ -17,6 +23,182 @@ export declare class TurbosApi implements RouterApiInterface<TurbosPoolObject> {
|
|
|
17
23
|
partialMatchPools: TurbosPoolObject[];
|
|
18
24
|
exactMatchPools: TurbosPoolObject[];
|
|
19
25
|
}>;
|
|
26
|
+
tradeCoinAToCoinBTx: (inputs: {
|
|
27
|
+
tx: TransactionBlock;
|
|
28
|
+
poolObjectId: ObjectId;
|
|
29
|
+
coinInId: ObjectId | TransactionArgument;
|
|
30
|
+
coinInType: CoinType;
|
|
31
|
+
coinOutType: CoinType;
|
|
32
|
+
coinInAmount: Balance;
|
|
33
|
+
feeCoinType: CoinType;
|
|
34
|
+
walletAddress: SuiAddress;
|
|
35
|
+
sqrtPrice: bigint;
|
|
36
|
+
tradePotato: TransactionArgument;
|
|
37
|
+
isFirstSwapForPath: boolean;
|
|
38
|
+
expectedCoinOutAmount: Balance;
|
|
39
|
+
externalFee?: RouterExternalFee;
|
|
40
|
+
}) => ({
|
|
41
|
+
kind: "Input";
|
|
42
|
+
index: number;
|
|
43
|
+
type?: "object" | "pure" | undefined;
|
|
44
|
+
value?: any;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "GasCoin";
|
|
47
|
+
} | {
|
|
48
|
+
kind: "Result";
|
|
49
|
+
index: number;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "NestedResult";
|
|
52
|
+
index: number;
|
|
53
|
+
resultIndex: number;
|
|
54
|
+
}) & ({
|
|
55
|
+
kind: "Input";
|
|
56
|
+
index: number;
|
|
57
|
+
type?: "object" | "pure" | undefined;
|
|
58
|
+
value?: any;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "GasCoin";
|
|
61
|
+
} | {
|
|
62
|
+
kind: "Result";
|
|
63
|
+
index: number;
|
|
64
|
+
} | {
|
|
65
|
+
kind: "NestedResult";
|
|
66
|
+
index: number;
|
|
67
|
+
resultIndex: number;
|
|
68
|
+
})[];
|
|
69
|
+
tradeCoinBToCoinATx: (inputs: {
|
|
70
|
+
tx: TransactionBlock;
|
|
71
|
+
poolObjectId: ObjectId;
|
|
72
|
+
coinInId: ObjectId | TransactionArgument;
|
|
73
|
+
coinInType: CoinType;
|
|
74
|
+
coinOutType: CoinType;
|
|
75
|
+
coinInAmount: Balance;
|
|
76
|
+
feeCoinType: CoinType;
|
|
77
|
+
walletAddress: SuiAddress;
|
|
78
|
+
sqrtPrice: bigint;
|
|
79
|
+
tradePotato: TransactionArgument;
|
|
80
|
+
isFirstSwapForPath: boolean;
|
|
81
|
+
expectedCoinOutAmount: Balance;
|
|
82
|
+
externalFee?: RouterExternalFee;
|
|
83
|
+
}) => ({
|
|
84
|
+
kind: "Input";
|
|
85
|
+
index: number;
|
|
86
|
+
type?: "object" | "pure" | undefined;
|
|
87
|
+
value?: any;
|
|
88
|
+
} | {
|
|
89
|
+
kind: "GasCoin";
|
|
90
|
+
} | {
|
|
91
|
+
kind: "Result";
|
|
92
|
+
index: number;
|
|
93
|
+
} | {
|
|
94
|
+
kind: "NestedResult";
|
|
95
|
+
index: number;
|
|
96
|
+
resultIndex: number;
|
|
97
|
+
}) & ({
|
|
98
|
+
kind: "Input";
|
|
99
|
+
index: number;
|
|
100
|
+
type?: "object" | "pure" | undefined;
|
|
101
|
+
value?: any;
|
|
102
|
+
} | {
|
|
103
|
+
kind: "GasCoin";
|
|
104
|
+
} | {
|
|
105
|
+
kind: "Result";
|
|
106
|
+
index: number;
|
|
107
|
+
} | {
|
|
108
|
+
kind: "NestedResult";
|
|
109
|
+
index: number;
|
|
110
|
+
resultIndex: number;
|
|
111
|
+
})[];
|
|
112
|
+
tradeTx: (inputs: {
|
|
113
|
+
tx: TransactionBlock;
|
|
114
|
+
pool: TurbosPoolObject;
|
|
115
|
+
coinInId: ObjectId | TransactionArgument;
|
|
116
|
+
coinInType: CoinType;
|
|
117
|
+
coinOutType: CoinType;
|
|
118
|
+
coinInAmount: Balance;
|
|
119
|
+
walletAddress: SuiAddress;
|
|
120
|
+
tradePotato: TransactionArgument;
|
|
121
|
+
isFirstSwapForPath: boolean;
|
|
122
|
+
expectedCoinOutAmount: Balance;
|
|
123
|
+
externalFee?: RouterExternalFee;
|
|
124
|
+
}) => ({
|
|
125
|
+
kind: "Input";
|
|
126
|
+
index: number;
|
|
127
|
+
type?: "object" | "pure" | undefined;
|
|
128
|
+
value?: any;
|
|
129
|
+
} | {
|
|
130
|
+
kind: "GasCoin";
|
|
131
|
+
} | {
|
|
132
|
+
kind: "Result";
|
|
133
|
+
index: number;
|
|
134
|
+
} | {
|
|
135
|
+
kind: "NestedResult";
|
|
136
|
+
index: number;
|
|
137
|
+
resultIndex: number;
|
|
138
|
+
}) & ({
|
|
139
|
+
kind: "Input";
|
|
140
|
+
index: number;
|
|
141
|
+
type?: "object" | "pure" | undefined;
|
|
142
|
+
value?: any;
|
|
143
|
+
} | {
|
|
144
|
+
kind: "GasCoin";
|
|
145
|
+
} | {
|
|
146
|
+
kind: "Result";
|
|
147
|
+
index: number;
|
|
148
|
+
} | {
|
|
149
|
+
kind: "NestedResult";
|
|
150
|
+
index: number;
|
|
151
|
+
resultIndex: number;
|
|
152
|
+
})[];
|
|
153
|
+
calcTradeResultTx: (inputs: {
|
|
154
|
+
tx: TransactionBlock;
|
|
155
|
+
poolObjectId: ObjectId;
|
|
156
|
+
coinInType: CoinType;
|
|
157
|
+
coinOutType: CoinType;
|
|
158
|
+
feeCoinType: CoinType;
|
|
159
|
+
coinTypeA: CoinType;
|
|
160
|
+
coinTypeB: CoinType;
|
|
161
|
+
coinInAmount: Balance;
|
|
162
|
+
sqrtPrice: bigint;
|
|
163
|
+
}) => ({
|
|
164
|
+
kind: "Input";
|
|
165
|
+
index: number;
|
|
166
|
+
type?: "object" | "pure" | undefined;
|
|
167
|
+
value?: any;
|
|
168
|
+
} | {
|
|
169
|
+
kind: "GasCoin";
|
|
170
|
+
} | {
|
|
171
|
+
kind: "Result";
|
|
172
|
+
index: number;
|
|
173
|
+
} | {
|
|
174
|
+
kind: "NestedResult";
|
|
175
|
+
index: number;
|
|
176
|
+
resultIndex: number;
|
|
177
|
+
}) & ({
|
|
178
|
+
kind: "Input";
|
|
179
|
+
index: number;
|
|
180
|
+
type?: "object" | "pure" | undefined;
|
|
181
|
+
value?: any;
|
|
182
|
+
} | {
|
|
183
|
+
kind: "GasCoin";
|
|
184
|
+
} | {
|
|
185
|
+
kind: "Result";
|
|
186
|
+
index: number;
|
|
187
|
+
} | {
|
|
188
|
+
kind: "NestedResult";
|
|
189
|
+
index: number;
|
|
190
|
+
resultIndex: number;
|
|
191
|
+
})[];
|
|
192
|
+
fetchBuildTradeTx: (inputs: {
|
|
193
|
+
walletAddress: SuiAddress;
|
|
194
|
+
pool: TurbosPoolObject;
|
|
195
|
+
coinInType: CoinType;
|
|
196
|
+
coinOutType: CoinType;
|
|
197
|
+
coinInAmount: Balance;
|
|
198
|
+
tradePotato: TransactionArgument;
|
|
199
|
+
isFirstSwapForPath: boolean;
|
|
200
|
+
expectedCoinOutAmount: Balance;
|
|
201
|
+
}) => Promise<TransactionBlock>;
|
|
20
202
|
fetchSupportedCoins: () => Promise<string[]>;
|
|
21
203
|
fetchTradeAmountOut: (inputs: {
|
|
22
204
|
walletAddress: SuiAddress;
|
|
@@ -30,12 +212,28 @@ export declare class TurbosApi implements RouterApiInterface<TurbosPoolObject> {
|
|
|
30
212
|
coinType: CoinType;
|
|
31
213
|
pool: TurbosPoolObject;
|
|
32
214
|
}) => string;
|
|
33
|
-
|
|
215
|
+
fetchCalcTradeResult: (inputs: {
|
|
34
216
|
walletAddress: SuiAddress;
|
|
35
217
|
pool: TurbosPoolObject;
|
|
36
218
|
coinInType: CoinType;
|
|
37
219
|
coinOutType: CoinType;
|
|
38
220
|
coinInAmount: Balance;
|
|
39
|
-
}) => Promise<
|
|
221
|
+
}) => Promise<TurbosCalcTradeResult>;
|
|
222
|
+
static otherCoinInPool: (inputs: {
|
|
223
|
+
coinType: CoinType;
|
|
224
|
+
pool: TurbosPoolObject;
|
|
225
|
+
}) => string;
|
|
226
|
+
private fetchPoolForCoinTypes;
|
|
227
|
+
private fetchPoolsForCoinType;
|
|
228
|
+
private static partialPoolFromSuiObjectResponse;
|
|
229
|
+
private static isPoolForCoinTypes;
|
|
230
|
+
private static isPoolForCoinType;
|
|
231
|
+
private static isCoinA;
|
|
232
|
+
private static calcSqrtPriceLimit;
|
|
233
|
+
private static tickIndexToSqrtPriceX64;
|
|
234
|
+
private static tickIndexToSqrtPricePositive;
|
|
235
|
+
private static tickIndexToSqrtPriceNegative;
|
|
236
|
+
private static signedShiftLeft;
|
|
237
|
+
private static signedShiftRight;
|
|
40
238
|
}
|
|
41
239
|
//# sourceMappingURL=turbosApi.d.ts.map
|