@7kprotocol/sdk-ts 3.6.0 → 3.6.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -11
- package/lib/cjs/config/fetchClient.js +1 -9
- package/lib/cjs/constants/_7k.js +13 -10
- package/lib/cjs/constants/apiEndpoints.js +1 -1
- package/lib/cjs/features/metaAg/common.js +2 -2
- package/lib/cjs/features/metaAg/error.js +0 -4
- package/lib/cjs/features/metaAg/index.js +3 -8
- package/lib/cjs/features/prices/index.js +51 -20
- package/lib/cjs/index.js +1 -35
- package/lib/cjs/types/config/fetchClient.d.ts.map +1 -1
- package/lib/cjs/types/constants/_7k.d.ts +0 -3
- package/lib/cjs/types/constants/_7k.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/common.d.ts +1 -1
- package/lib/cjs/types/features/metaAg/error.d.ts +1 -7
- package/lib/cjs/types/features/metaAg/error.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/index.d.ts +1 -1
- package/lib/cjs/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/cjs/types/features/prices/index.d.ts +16 -2
- package/lib/cjs/types/features/prices/index.d.ts.map +1 -1
- package/lib/cjs/types/index.d.ts +1 -32
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/metaAg.js +1 -3
- package/lib/cjs/types/types/metaAg.d.ts +2 -14
- package/lib/cjs/types/types/metaAg.d.ts.map +1 -1
- package/lib/cjs/types/utils/sui.d.ts +0 -31
- package/lib/cjs/types/utils/sui.d.ts.map +1 -1
- package/lib/cjs/types/utils/swap.d.ts +15 -0
- package/lib/cjs/types/utils/swap.d.ts.map +1 -0
- package/lib/cjs/utils/sui.js +15 -154
- package/lib/cjs/utils/swap.js +37 -0
- package/lib/esm/config/fetchClient.js +1 -9
- package/lib/esm/constants/_7k.js +12 -9
- package/lib/esm/constants/apiEndpoints.js +1 -1
- package/lib/esm/features/metaAg/common.js +1 -1
- package/lib/esm/features/metaAg/error.js +0 -4
- package/lib/esm/features/metaAg/index.js +2 -7
- package/lib/esm/features/prices/index.js +52 -21
- package/lib/esm/index.mjs +3 -31
- package/lib/esm/types/config/fetchClient.d.ts.map +1 -1
- package/lib/esm/types/constants/_7k.d.ts +0 -3
- package/lib/esm/types/constants/_7k.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/common.d.ts +1 -1
- package/lib/esm/types/features/metaAg/error.d.ts +1 -7
- package/lib/esm/types/features/metaAg/error.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/index.d.ts +1 -1
- package/lib/esm/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/esm/types/features/prices/index.d.ts +16 -2
- package/lib/esm/types/features/prices/index.d.ts.map +1 -1
- package/lib/esm/types/index.d.ts +1 -32
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/metaAg.js +1 -3
- package/lib/esm/types/types/metaAg.d.ts +2 -14
- package/lib/esm/types/types/metaAg.d.ts.map +1 -1
- package/lib/esm/types/utils/sui.d.ts +0 -31
- package/lib/esm/types/utils/sui.d.ts.map +1 -1
- package/lib/esm/types/utils/swap.d.ts +15 -0
- package/lib/esm/types/utils/swap.d.ts.map +1 -0
- package/lib/esm/utils/sui.js +17 -156
- package/lib/esm/utils/swap.js +33 -0
- package/package.json +1 -1
- package/lib/cjs/config/index.js +0 -67
- package/lib/cjs/features/metaAg/providers/bluefin7kLegacy.js +0 -68
- package/lib/cjs/features/swap/buildTx.js +0 -198
- package/lib/cjs/features/swap/buildTxV2.js +0 -229
- package/lib/cjs/features/swap/config.js +0 -154
- package/lib/cjs/features/swap/estimateGasFee.js +0 -44
- package/lib/cjs/features/swap/executeTx.js +0 -52
- package/lib/cjs/features/swap/getQuote.js +0 -95
- package/lib/cjs/features/swap/getSwapHistory.js +0 -21
- package/lib/cjs/features/swap/index.js +0 -22
- package/lib/cjs/libs/groupSwapRoutes.js +0 -60
- package/lib/cjs/libs/protocols/aftermath/index.js +0 -35
- package/lib/cjs/libs/protocols/base.js +0 -41
- package/lib/cjs/libs/protocols/bluefin/index.js +0 -38
- package/lib/cjs/libs/protocols/bluefinx/client.js +0 -41
- package/lib/cjs/libs/protocols/bluefinx/index.js +0 -48
- package/lib/cjs/libs/protocols/bluefinx/types.js +0 -10
- package/lib/cjs/libs/protocols/bluemove/index.js +0 -24
- package/lib/cjs/libs/protocols/cetus/index.js +0 -44
- package/lib/cjs/libs/protocols/cetus_dlmm.js +0 -48
- package/lib/cjs/libs/protocols/constants.js +0 -5
- package/lib/cjs/libs/protocols/deepbookV3/sponsored.js +0 -30
- package/lib/cjs/libs/protocols/ferra_clmm.js +0 -44
- package/lib/cjs/libs/protocols/ferra_dlmm.js +0 -30
- package/lib/cjs/libs/protocols/flowx/index.js +0 -18
- package/lib/cjs/libs/protocols/flowxV3/index.js +0 -36
- package/lib/cjs/libs/protocols/fullsail/index.js +0 -39
- package/lib/cjs/libs/protocols/haedal_pmm/index.js +0 -31
- package/lib/cjs/libs/protocols/index.js +0 -55
- package/lib/cjs/libs/protocols/kriya/index.js +0 -30
- package/lib/cjs/libs/protocols/kriyaV3/index.js +0 -65
- package/lib/cjs/libs/protocols/magma/index.js +0 -40
- package/lib/cjs/libs/protocols/momentum/index.js +0 -49
- package/lib/cjs/libs/protocols/obric/index.js +0 -28
- package/lib/cjs/libs/protocols/sevenk/index.js +0 -55
- package/lib/cjs/libs/protocols/springsui/index.js +0 -24
- package/lib/cjs/libs/protocols/steamm/index.js +0 -160
- package/lib/cjs/libs/protocols/stsui/index.js +0 -24
- package/lib/cjs/libs/protocols/suiswap/index.js +0 -34
- package/lib/cjs/libs/protocols/turbos/index.js +0 -36
- package/lib/cjs/libs/protocols/utils.js +0 -7
- package/lib/cjs/libs/swapWithRoute.js +0 -22
- package/lib/cjs/types/aggregator.js +0 -19
- package/lib/cjs/types/config/index.d.ts +0 -30
- package/lib/cjs/types/config/index.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7kLegacy.d.ts +0 -11
- package/lib/cjs/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/buildTx.d.ts +0 -17
- package/lib/cjs/types/features/swap/buildTx.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/buildTxV2.d.ts +0 -20
- package/lib/cjs/types/features/swap/buildTxV2.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/config.d.ts +0 -4
- package/lib/cjs/types/features/swap/config.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/estimateGasFee.d.ts +0 -3
- package/lib/cjs/types/features/swap/estimateGasFee.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/executeTx.d.ts +0 -24
- package/lib/cjs/types/features/swap/executeTx.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/getQuote.d.ts +0 -27
- package/lib/cjs/types/features/swap/getQuote.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/getSwapHistory.d.ts +0 -22
- package/lib/cjs/types/features/swap/getSwapHistory.d.ts.map +0 -1
- package/lib/cjs/types/features/swap/index.d.ts +0 -7
- package/lib/cjs/types/features/swap/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/groupSwapRoutes.d.ts +0 -3
- package/lib/cjs/types/libs/groupSwapRoutes.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/aftermath/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/aftermath/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/base.d.ts +0 -24
- package/lib/cjs/types/libs/protocols/base.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/bluefin/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/bluefin/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/bluefinx/client.d.ts +0 -13
- package/lib/cjs/types/libs/protocols/bluefinx/client.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/bluefinx/index.d.ts +0 -17
- package/lib/cjs/types/libs/protocols/bluefinx/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/bluefinx/types.d.ts +0 -34
- package/lib/cjs/types/libs/protocols/bluefinx/types.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/bluemove/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/bluemove/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/cetus/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/cetus/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/cetus_dlmm.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/cetus_dlmm.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/constants.d.ts +0 -3
- package/lib/cjs/types/libs/protocols/constants.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/deepbookV3/sponsored.d.ts +0 -7
- package/lib/cjs/types/libs/protocols/deepbookV3/sponsored.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/ferra_clmm.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/ferra_clmm.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/ferra_dlmm.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/ferra_dlmm.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/flowx/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/flowx/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/flowxV3/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/fullsail/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/fullsail/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts +0 -14
- package/lib/cjs/types/libs/protocols/haedal_pmm/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/index.d.ts +0 -53
- package/lib/cjs/types/libs/protocols/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/kriya/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/kriya/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/kriyaV3/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/magma/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/magma/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/momentum/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/momentum/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/obric/index.d.ts +0 -14
- package/lib/cjs/types/libs/protocols/obric/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/sevenk/index.d.ts +0 -18
- package/lib/cjs/types/libs/protocols/sevenk/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/springsui/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/springsui/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/steamm/index.d.ts +0 -28
- package/lib/cjs/types/libs/protocols/steamm/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/stsui/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/stsui/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/suiswap/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/suiswap/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/turbos/index.d.ts +0 -9
- package/lib/cjs/types/libs/protocols/turbos/index.d.ts.map +0 -1
- package/lib/cjs/types/libs/protocols/utils.d.ts +0 -2
- package/lib/cjs/types/libs/protocols/utils.d.ts.map +0 -1
- package/lib/cjs/types/libs/swapWithRoute.d.ts +0 -12
- package/lib/cjs/types/libs/swapWithRoute.d.ts.map +0 -1
- package/lib/cjs/types/sui.js +0 -2
- package/lib/cjs/types/tx.js +0 -2
- package/lib/cjs/types/types/aggregator.d.ts +0 -173
- package/lib/cjs/types/types/aggregator.d.ts.map +0 -1
- package/lib/cjs/types/types/sui.d.ts +0 -4
- package/lib/cjs/types/types/sui.d.ts.map +0 -1
- package/lib/cjs/types/types/tx.d.ts +0 -67
- package/lib/cjs/types/types/tx.d.ts.map +0 -1
- package/lib/cjs/types/types/utilities.d.ts +0 -5
- package/lib/cjs/types/types/utilities.d.ts.map +0 -1
- package/lib/cjs/types/utilities.js +0 -2
- package/lib/cjs/types/utils/number.d.ts +0 -2
- package/lib/cjs/types/utils/number.d.ts.map +0 -1
- package/lib/cjs/utils/number.js +0 -9
- package/lib/esm/config/index.js +0 -64
- package/lib/esm/features/metaAg/providers/bluefin7kLegacy.js +0 -66
- package/lib/esm/features/swap/buildTx.js +0 -188
- package/lib/esm/features/swap/buildTxV2.js +0 -223
- package/lib/esm/features/swap/config.js +0 -150
- package/lib/esm/features/swap/estimateGasFee.js +0 -41
- package/lib/esm/features/swap/executeTx.js +0 -48
- package/lib/esm/features/swap/getQuote.js +0 -91
- package/lib/esm/features/swap/getSwapHistory.js +0 -18
- package/lib/esm/features/swap/index.js +0 -6
- package/lib/esm/libs/groupSwapRoutes.js +0 -57
- package/lib/esm/libs/protocols/aftermath/index.js +0 -31
- package/lib/esm/libs/protocols/base.js +0 -42
- package/lib/esm/libs/protocols/bluefin/index.js +0 -34
- package/lib/esm/libs/protocols/bluefinx/client.js +0 -36
- package/lib/esm/libs/protocols/bluefinx/index.js +0 -44
- package/lib/esm/libs/protocols/bluefinx/types.js +0 -8
- package/lib/esm/libs/protocols/bluemove/index.js +0 -20
- package/lib/esm/libs/protocols/cetus/index.js +0 -40
- package/lib/esm/libs/protocols/cetus_dlmm.js +0 -44
- package/lib/esm/libs/protocols/constants.js +0 -2
- package/lib/esm/libs/protocols/deepbookV3/sponsored.js +0 -26
- package/lib/esm/libs/protocols/ferra_clmm.js +0 -40
- package/lib/esm/libs/protocols/ferra_dlmm.js +0 -26
- package/lib/esm/libs/protocols/flowx/index.js +0 -14
- package/lib/esm/libs/protocols/flowxV3/index.js +0 -32
- package/lib/esm/libs/protocols/fullsail/index.js +0 -35
- package/lib/esm/libs/protocols/haedal_pmm/index.js +0 -27
- package/lib/esm/libs/protocols/index.js +0 -52
- package/lib/esm/libs/protocols/kriya/index.js +0 -26
- package/lib/esm/libs/protocols/kriyaV3/index.js +0 -61
- package/lib/esm/libs/protocols/magma/index.js +0 -36
- package/lib/esm/libs/protocols/momentum/index.js +0 -45
- package/lib/esm/libs/protocols/obric/index.js +0 -24
- package/lib/esm/libs/protocols/sevenk/index.js +0 -51
- package/lib/esm/libs/protocols/springsui/index.js +0 -20
- package/lib/esm/libs/protocols/steamm/index.js +0 -156
- package/lib/esm/libs/protocols/stsui/index.js +0 -20
- package/lib/esm/libs/protocols/suiswap/index.js +0 -30
- package/lib/esm/libs/protocols/turbos/index.js +0 -32
- package/lib/esm/libs/protocols/utils.js +0 -4
- package/lib/esm/libs/swapWithRoute.js +0 -19
- package/lib/esm/types/aggregator.js +0 -14
- package/lib/esm/types/config/index.d.ts +0 -30
- package/lib/esm/types/config/index.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7kLegacy.d.ts +0 -11
- package/lib/esm/types/features/metaAg/providers/bluefin7kLegacy.d.ts.map +0 -1
- package/lib/esm/types/features/swap/buildTx.d.ts +0 -17
- package/lib/esm/types/features/swap/buildTx.d.ts.map +0 -1
- package/lib/esm/types/features/swap/buildTxV2.d.ts +0 -20
- package/lib/esm/types/features/swap/buildTxV2.d.ts.map +0 -1
- package/lib/esm/types/features/swap/config.d.ts +0 -4
- package/lib/esm/types/features/swap/config.d.ts.map +0 -1
- package/lib/esm/types/features/swap/estimateGasFee.d.ts +0 -3
- package/lib/esm/types/features/swap/estimateGasFee.d.ts.map +0 -1
- package/lib/esm/types/features/swap/executeTx.d.ts +0 -24
- package/lib/esm/types/features/swap/executeTx.d.ts.map +0 -1
- package/lib/esm/types/features/swap/getQuote.d.ts +0 -27
- package/lib/esm/types/features/swap/getQuote.d.ts.map +0 -1
- package/lib/esm/types/features/swap/getSwapHistory.d.ts +0 -22
- package/lib/esm/types/features/swap/getSwapHistory.d.ts.map +0 -1
- package/lib/esm/types/features/swap/index.d.ts +0 -7
- package/lib/esm/types/features/swap/index.d.ts.map +0 -1
- package/lib/esm/types/libs/groupSwapRoutes.d.ts +0 -3
- package/lib/esm/types/libs/groupSwapRoutes.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/aftermath/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/aftermath/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/base.d.ts +0 -24
- package/lib/esm/types/libs/protocols/base.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/bluefin/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/bluefin/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/bluefinx/client.d.ts +0 -13
- package/lib/esm/types/libs/protocols/bluefinx/client.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/bluefinx/index.d.ts +0 -17
- package/lib/esm/types/libs/protocols/bluefinx/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/bluefinx/types.d.ts +0 -34
- package/lib/esm/types/libs/protocols/bluefinx/types.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/bluemove/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/bluemove/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/cetus/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/cetus/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/cetus_dlmm.d.ts +0 -9
- package/lib/esm/types/libs/protocols/cetus_dlmm.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/constants.d.ts +0 -3
- package/lib/esm/types/libs/protocols/constants.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/deepbookV3/sponsored.d.ts +0 -7
- package/lib/esm/types/libs/protocols/deepbookV3/sponsored.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/ferra_clmm.d.ts +0 -9
- package/lib/esm/types/libs/protocols/ferra_clmm.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/ferra_dlmm.d.ts +0 -9
- package/lib/esm/types/libs/protocols/ferra_dlmm.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/flowx/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/flowx/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/flowxV3/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/flowxV3/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/fullsail/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/fullsail/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts +0 -14
- package/lib/esm/types/libs/protocols/haedal_pmm/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/index.d.ts +0 -53
- package/lib/esm/types/libs/protocols/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/kriya/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/kriya/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/kriyaV3/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/magma/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/magma/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/momentum/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/momentum/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/obric/index.d.ts +0 -14
- package/lib/esm/types/libs/protocols/obric/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/sevenk/index.d.ts +0 -18
- package/lib/esm/types/libs/protocols/sevenk/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/springsui/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/springsui/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/steamm/index.d.ts +0 -28
- package/lib/esm/types/libs/protocols/steamm/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/stsui/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/stsui/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/suiswap/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/suiswap/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/turbos/index.d.ts +0 -9
- package/lib/esm/types/libs/protocols/turbos/index.d.ts.map +0 -1
- package/lib/esm/types/libs/protocols/utils.d.ts +0 -2
- package/lib/esm/types/libs/protocols/utils.d.ts.map +0 -1
- package/lib/esm/types/libs/swapWithRoute.d.ts +0 -12
- package/lib/esm/types/libs/swapWithRoute.d.ts.map +0 -1
- package/lib/esm/types/sui.js +0 -1
- package/lib/esm/types/tx.js +0 -1
- package/lib/esm/types/types/aggregator.d.ts +0 -173
- package/lib/esm/types/types/aggregator.d.ts.map +0 -1
- package/lib/esm/types/types/sui.d.ts +0 -4
- package/lib/esm/types/types/sui.d.ts.map +0 -1
- package/lib/esm/types/types/tx.d.ts +0 -67
- package/lib/esm/types/types/tx.d.ts.map +0 -1
- package/lib/esm/types/types/utilities.d.ts +0 -5
- package/lib/esm/types/types/utilities.d.ts.map +0 -1
- package/lib/esm/types/utilities.js +0 -1
- package/lib/esm/types/utils/number.d.ts +0 -2
- package/lib/esm/types/utils/number.d.ts.map +0 -1
- package/lib/esm/utils/number.js +0 -6
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BaseContract } from "../base";
|
|
2
|
-
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
3
|
-
import { getDefaultSqrtPriceLimit } from "../utils";
|
|
4
|
-
import { SuiUtils } from "../../../utils/sui";
|
|
5
|
-
export class MagmaContract extends BaseContract {
|
|
6
|
-
async swap(tx) {
|
|
7
|
-
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
8
|
-
const swapXtoY = this.swapInfo.swapXtoY;
|
|
9
|
-
const sqrtPriceLimit = getDefaultSqrtPriceLimit(swapXtoY);
|
|
10
|
-
const typeArguments = [coinX.address, coinY.address];
|
|
11
|
-
const [zeroOut] = tx.moveCall({
|
|
12
|
-
target: "0x2::coin::zero",
|
|
13
|
-
typeArguments: [swapXtoY ? coinY.address : coinX.address],
|
|
14
|
-
});
|
|
15
|
-
const amountIn = SuiUtils.getCoinValue(swapXtoY ? coinX.address : coinY.address, this.inputCoinObject, tx);
|
|
16
|
-
const config = this.config.magma;
|
|
17
|
-
const [receiveA, receiveB] = tx.moveCall({
|
|
18
|
-
target: `${config.package}::router::swap`,
|
|
19
|
-
typeArguments,
|
|
20
|
-
arguments: [
|
|
21
|
-
tx.object(config.globalConfig),
|
|
22
|
-
tx.object(this.swapInfo.poolId),
|
|
23
|
-
swapXtoY ? this.inputCoinObject : zeroOut, // coin A
|
|
24
|
-
swapXtoY ? zeroOut : this.inputCoinObject, // coin B
|
|
25
|
-
tx.pure.bool(swapXtoY), // a to b or b to a
|
|
26
|
-
tx.pure.bool(true), // exact in or out
|
|
27
|
-
amountIn, // swap amount
|
|
28
|
-
tx.pure.u128(sqrtPriceLimit.toString()), // sqrt price limit
|
|
29
|
-
tx.pure.bool(false),
|
|
30
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, swapXtoY ? receiveA : receiveB);
|
|
34
|
-
return swapXtoY ? receiveB : receiveA;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BaseContract } from "../base";
|
|
2
|
-
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
3
|
-
import { getDefaultSqrtPriceLimit } from "../utils";
|
|
4
|
-
import { SuiUtils } from "../../../utils/sui";
|
|
5
|
-
export class MomentumContract extends BaseContract {
|
|
6
|
-
async swap(tx) {
|
|
7
|
-
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
8
|
-
const swapXtoY = this.swapInfo.swapXtoY;
|
|
9
|
-
const sqrtPriceLimit = getDefaultSqrtPriceLimit(swapXtoY);
|
|
10
|
-
const typeArguments = [coinX.address, coinY.address];
|
|
11
|
-
const { package: packageId, version } = this.config.momentum;
|
|
12
|
-
const [receiveA, receiveB, debt] = tx.moveCall({
|
|
13
|
-
target: `${packageId}::trade::flash_swap`,
|
|
14
|
-
typeArguments,
|
|
15
|
-
arguments: [
|
|
16
|
-
tx.object(this.swapInfo.poolId),
|
|
17
|
-
tx.pure.bool(swapXtoY), // a2b
|
|
18
|
-
tx.pure.bool(true), // exact in
|
|
19
|
-
this.getInputCoinValue(tx),
|
|
20
|
-
tx.pure.u128(sqrtPriceLimit.toString()), // sqrt price limit
|
|
21
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
22
|
-
tx.object(version),
|
|
23
|
-
],
|
|
24
|
-
});
|
|
25
|
-
tx.moveCall({
|
|
26
|
-
target: `${packageId}::trade::repay_flash_swap`,
|
|
27
|
-
typeArguments,
|
|
28
|
-
arguments: [
|
|
29
|
-
tx.object(this.swapInfo.poolId),
|
|
30
|
-
debt,
|
|
31
|
-
swapXtoY
|
|
32
|
-
? SuiUtils.coinIntoBalance(tx, coinX.address, this.inputCoinObject)
|
|
33
|
-
: SuiUtils.zeroBalance(tx, coinX.address),
|
|
34
|
-
swapXtoY
|
|
35
|
-
? SuiUtils.zeroBalance(tx, coinY.address)
|
|
36
|
-
: SuiUtils.coinIntoBalance(tx, coinY.address, this.inputCoinObject),
|
|
37
|
-
tx.object(version),
|
|
38
|
-
],
|
|
39
|
-
});
|
|
40
|
-
const receiveACoin = SuiUtils.coinFromBalance(tx, coinX.address, receiveA);
|
|
41
|
-
const receiveBCoin = SuiUtils.coinFromBalance(tx, coinY.address, receiveB);
|
|
42
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, swapXtoY ? receiveACoin : receiveBCoin);
|
|
43
|
-
return swapXtoY ? receiveBCoin : receiveACoin;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export class ObricContract extends BaseContract {
|
|
4
|
-
async swap(tx) {
|
|
5
|
-
const [coinX, coinY] = this.swapInfo.pool.allTokens;
|
|
6
|
-
const xToY = this.swapInfo.swapXtoY;
|
|
7
|
-
const oracleX = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
8
|
-
const oracleY = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
9
|
-
const { package: PACKAGE_ID, pythState: PYTH_STATE } = this.config.obric;
|
|
10
|
-
const [coinOut] = tx.moveCall({
|
|
11
|
-
target: `${PACKAGE_ID}::v2::${xToY ? "swap_x_to_y" : "swap_y_to_x"}`,
|
|
12
|
-
typeArguments: [coinX.address, coinY.address],
|
|
13
|
-
arguments: [
|
|
14
|
-
tx.object(this.swapInfo.poolId),
|
|
15
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
16
|
-
tx.object(PYTH_STATE),
|
|
17
|
-
tx.object(oracleX), // pyth pricefeed for x
|
|
18
|
-
tx.object(oracleY), // pyth pricefeed for y
|
|
19
|
-
this.inputCoinObject,
|
|
20
|
-
],
|
|
21
|
-
});
|
|
22
|
-
return coinOut;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { normalizeStructTag, parseStructTag, SUI_CLOCK_OBJECT_ID, toHex, } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export class SevenKV1 extends BaseContract {
|
|
4
|
-
async swap(tx) {
|
|
5
|
-
const x2y = this.swapInfo.swapXtoY;
|
|
6
|
-
const config = this.config.sevenk_v1;
|
|
7
|
-
const [coinOut] = tx.moveCall({
|
|
8
|
-
target: `${config.package}::pool_v1::${x2y ? "swap_x_to_y" : "swap_y_to_x"}`,
|
|
9
|
-
typeArguments: parseStructTag(this.extra.poolStructTag).typeParams.map(normalizeStructTag),
|
|
10
|
-
arguments: [
|
|
11
|
-
tx.object(this.swapInfo.poolId),
|
|
12
|
-
this.getOraclePriceUpdate(tx),
|
|
13
|
-
this.inputCoinObject,
|
|
14
|
-
tx.pure.u64(0),
|
|
15
|
-
],
|
|
16
|
-
});
|
|
17
|
-
return coinOut;
|
|
18
|
-
}
|
|
19
|
-
getOraclePriceUpdate(tx) {
|
|
20
|
-
const oracleX = this.extra.oracles?.[0]?.Pyth?.bytes;
|
|
21
|
-
const oracleY = this.extra.oracles?.[1]?.Pyth?.bytes;
|
|
22
|
-
if (!oracleX ||
|
|
23
|
-
!oracleY ||
|
|
24
|
-
!this.extra.oracleConfigX ||
|
|
25
|
-
!this.extra.oracleConfigY) {
|
|
26
|
-
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
27
|
-
}
|
|
28
|
-
const [holder] = tx.moveCall({
|
|
29
|
-
target: `${this.config.sevenk_v1.oracle}::oracle::new_holder`,
|
|
30
|
-
});
|
|
31
|
-
tx.moveCall({
|
|
32
|
-
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
33
|
-
arguments: [
|
|
34
|
-
tx.object(this.extra.oracleConfigX),
|
|
35
|
-
holder,
|
|
36
|
-
tx.object(this.pythMap["0x" + toHex(Uint8Array.from(oracleX))]),
|
|
37
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
38
|
-
],
|
|
39
|
-
});
|
|
40
|
-
tx.moveCall({
|
|
41
|
-
target: `${this.config.sevenk_v1.oracle}::pyth::get_price`,
|
|
42
|
-
arguments: [
|
|
43
|
-
tx.object(this.extra.oracleConfigY),
|
|
44
|
-
holder,
|
|
45
|
-
tx.object(this.pythMap["0x" + toHex(Uint8Array.from(oracleY))]),
|
|
46
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
47
|
-
],
|
|
48
|
-
});
|
|
49
|
-
return holder;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SUI_SYSTEM_STATE_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export class SpringSuiContract extends BaseContract {
|
|
4
|
-
async swap(tx) {
|
|
5
|
-
// coinX is always SUI
|
|
6
|
-
const coinY = this.swapInfo.pool.allTokens[1];
|
|
7
|
-
const isStake = this.swapInfo.swapXtoY;
|
|
8
|
-
const { package: PACKAGE_ID } = this.config.springsui;
|
|
9
|
-
const [coinOut] = tx.moveCall({
|
|
10
|
-
target: `${PACKAGE_ID}::liquid_staking::${isStake ? "mint" : "redeem"}`,
|
|
11
|
-
typeArguments: [coinY.address],
|
|
12
|
-
arguments: [
|
|
13
|
-
tx.object(this.swapInfo.poolId),
|
|
14
|
-
isStake ? tx.object(SUI_SYSTEM_STATE_OBJECT_ID) : this.inputCoinObject,
|
|
15
|
-
isStake ? this.inputCoinObject : tx.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
16
|
-
],
|
|
17
|
-
});
|
|
18
|
-
return coinOut;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { normalizeStructTag, parseStructTag, SUI_CLOCK_OBJECT_ID, } from "@mysten/sui/utils";
|
|
2
|
-
import { SuiUtils } from "../../../utils/sui";
|
|
3
|
-
import { BaseContract } from "../base";
|
|
4
|
-
export class SteammContract extends BaseContract {
|
|
5
|
-
async swap(tx) {
|
|
6
|
-
if (this.extra.poolStructTag.includes("omm::OracleQuoter")) {
|
|
7
|
-
return this.ommSwap(tx, "v1");
|
|
8
|
-
}
|
|
9
|
-
else if (this.extra.poolStructTag.includes("omm_v2::OracleQuoterV2")) {
|
|
10
|
-
return this.ommSwap(tx, "v2");
|
|
11
|
-
}
|
|
12
|
-
else if (this.extra.poolStructTag.includes("cpmm::CpQuoter")) {
|
|
13
|
-
return this.cpmmSwap(tx);
|
|
14
|
-
}
|
|
15
|
-
throw new Error(`Unsupported pool type: ${this.extra.poolStructTag}`);
|
|
16
|
-
}
|
|
17
|
-
cpmmSwap(tx) {
|
|
18
|
-
const extra = this.extra;
|
|
19
|
-
if (!extra ||
|
|
20
|
-
!extra.bankAStructTag ||
|
|
21
|
-
!extra.bankBStructTag ||
|
|
22
|
-
!extra.poolStructTag ||
|
|
23
|
-
!extra.bankA ||
|
|
24
|
-
!extra.bankB ||
|
|
25
|
-
!extra.lendingMarketA ||
|
|
26
|
-
!extra.lendingMarketB) {
|
|
27
|
-
throw new Error(`Invalid extra info for cpmmSwap`);
|
|
28
|
-
}
|
|
29
|
-
// the pool script v1 only support same lending market
|
|
30
|
-
if (extra.lendingMarketA !== extra.lendingMarketB) {
|
|
31
|
-
throw new Error(`Invalid lending market for cpmmSwap`);
|
|
32
|
-
}
|
|
33
|
-
const [btokenA, bTokenB, _quoter, lp] = parseStructTag(extra.poolStructTag).typeParams;
|
|
34
|
-
const [lendingMarket, coinTypeA, _bTokenA] = parseStructTag(extra.bankAStructTag).typeParams;
|
|
35
|
-
const [_lendingMarket, coinTypeB, _bTokenB] = parseStructTag(extra.bankBStructTag).typeParams;
|
|
36
|
-
const xToY = this.swapInfo.swapXtoY;
|
|
37
|
-
const coinA = xToY
|
|
38
|
-
? this.inputCoinObject
|
|
39
|
-
: SuiUtils.zeroCoin(tx, normalizeStructTag(coinTypeA));
|
|
40
|
-
const coinB = !xToY
|
|
41
|
-
? this.inputCoinObject
|
|
42
|
-
: SuiUtils.zeroCoin(tx, normalizeStructTag(coinTypeB));
|
|
43
|
-
tx.moveCall({
|
|
44
|
-
target: `${this.config.steamm.script}::pool_script::cpmm_swap`,
|
|
45
|
-
typeArguments: [
|
|
46
|
-
lendingMarket,
|
|
47
|
-
coinTypeA,
|
|
48
|
-
coinTypeB,
|
|
49
|
-
btokenA,
|
|
50
|
-
bTokenB,
|
|
51
|
-
lp,
|
|
52
|
-
].map(normalizeStructTag),
|
|
53
|
-
arguments: [
|
|
54
|
-
tx.object(this.swapInfo.poolId),
|
|
55
|
-
tx.object(extra.bankA),
|
|
56
|
-
tx.object(extra.bankB),
|
|
57
|
-
tx.object(extra.lendingMarketA),
|
|
58
|
-
coinA,
|
|
59
|
-
coinB,
|
|
60
|
-
tx.pure.bool(xToY),
|
|
61
|
-
this.getInputCoinValue(tx),
|
|
62
|
-
tx.pure.u64(0),
|
|
63
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
64
|
-
],
|
|
65
|
-
});
|
|
66
|
-
const coinIn = xToY ? coinA : coinB;
|
|
67
|
-
const coinOut = xToY ? coinB : coinA;
|
|
68
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, coinIn);
|
|
69
|
-
return coinOut;
|
|
70
|
-
}
|
|
71
|
-
ommSwap(tx, version) {
|
|
72
|
-
const extra = this.swapInfo.extra;
|
|
73
|
-
if (!extra ||
|
|
74
|
-
!extra.bankAStructTag ||
|
|
75
|
-
!extra.bankBStructTag ||
|
|
76
|
-
!extra.poolStructTag ||
|
|
77
|
-
!extra.bankA ||
|
|
78
|
-
!extra.bankB ||
|
|
79
|
-
!extra.lendingMarketA ||
|
|
80
|
-
!extra.lendingMarketB) {
|
|
81
|
-
throw new Error(`Invalid extra info for cpmmSwap`);
|
|
82
|
-
}
|
|
83
|
-
// the pool script v1 only support same lending market
|
|
84
|
-
if (extra.lendingMarketA !== extra.lendingMarketB) {
|
|
85
|
-
throw new Error(`Invalid lending market for ommSwap`);
|
|
86
|
-
}
|
|
87
|
-
const [btokenA, bTokenB, _quoter, lp] = parseStructTag(extra.poolStructTag).typeParams;
|
|
88
|
-
const [lendingMarket, coinTypeA, _bTokenA] = parseStructTag(extra.bankAStructTag).typeParams;
|
|
89
|
-
const [_lendingMarket, coinTypeB, _bTokenB] = parseStructTag(extra.bankBStructTag).typeParams;
|
|
90
|
-
const xToY = this.swapInfo.swapXtoY;
|
|
91
|
-
const coinA = xToY
|
|
92
|
-
? this.inputCoinObject
|
|
93
|
-
: SuiUtils.zeroCoin(tx, normalizeStructTag(coinTypeA));
|
|
94
|
-
const coinB = !xToY
|
|
95
|
-
? this.inputCoinObject
|
|
96
|
-
: SuiUtils.zeroCoin(tx, normalizeStructTag(coinTypeB));
|
|
97
|
-
const [priceA, priceB] = this.getOraclePriceUpdate(tx);
|
|
98
|
-
tx.moveCall({
|
|
99
|
-
target: `${this.config.steamm.script}::pool_script_v2::${version === "v1" ? "omm_swap" : "omm_v2_swap"}`,
|
|
100
|
-
typeArguments: [
|
|
101
|
-
lendingMarket,
|
|
102
|
-
coinTypeA,
|
|
103
|
-
coinTypeB,
|
|
104
|
-
btokenA,
|
|
105
|
-
bTokenB,
|
|
106
|
-
lp,
|
|
107
|
-
].map(normalizeStructTag),
|
|
108
|
-
arguments: [
|
|
109
|
-
tx.object(this.swapInfo.poolId),
|
|
110
|
-
tx.object(extra.bankA),
|
|
111
|
-
tx.object(extra.bankB),
|
|
112
|
-
tx.object(extra.lendingMarketA),
|
|
113
|
-
priceA,
|
|
114
|
-
priceB,
|
|
115
|
-
coinA,
|
|
116
|
-
coinB,
|
|
117
|
-
tx.pure.bool(xToY),
|
|
118
|
-
this.getInputCoinValue(tx),
|
|
119
|
-
tx.pure.u64(0),
|
|
120
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
121
|
-
],
|
|
122
|
-
});
|
|
123
|
-
const coinIn = xToY ? coinA : coinB;
|
|
124
|
-
const coinOut = xToY ? coinB : coinA;
|
|
125
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, coinIn);
|
|
126
|
-
return coinOut;
|
|
127
|
-
}
|
|
128
|
-
getOraclePriceUpdate(tx) {
|
|
129
|
-
const oracleA = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
130
|
-
const oracleB = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
131
|
-
const registry = this.extra.oracleRegistry;
|
|
132
|
-
const indexes = this.extra.oracleIndexes;
|
|
133
|
-
if (!registry || indexes?.length !== 2) {
|
|
134
|
-
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
135
|
-
}
|
|
136
|
-
const [a] = tx.moveCall({
|
|
137
|
-
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
138
|
-
arguments: [
|
|
139
|
-
tx.object(registry),
|
|
140
|
-
tx.object(oracleA),
|
|
141
|
-
tx.pure.u64(indexes[0]),
|
|
142
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
143
|
-
],
|
|
144
|
-
});
|
|
145
|
-
const [b] = tx.moveCall({
|
|
146
|
-
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
147
|
-
arguments: [
|
|
148
|
-
tx.object(registry),
|
|
149
|
-
tx.object(oracleB),
|
|
150
|
-
tx.pure.u64(indexes[1]),
|
|
151
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
152
|
-
],
|
|
153
|
-
});
|
|
154
|
-
return [a, b];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { SUI_SYSTEM_STATE_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export class StSuiContract extends BaseContract {
|
|
4
|
-
async swap(tx) {
|
|
5
|
-
// coinX is always SUI
|
|
6
|
-
const coinY = this.swapInfo.pool.allTokens[1];
|
|
7
|
-
const isStake = this.swapInfo.swapXtoY;
|
|
8
|
-
const { package: PACKAGE_ID } = this.config.stsui;
|
|
9
|
-
const [coinOut] = tx.moveCall({
|
|
10
|
-
target: `${PACKAGE_ID}::liquid_staking::${isStake ? "mint" : "redeem"}`,
|
|
11
|
-
typeArguments: [coinY.address],
|
|
12
|
-
arguments: [
|
|
13
|
-
tx.object(this.swapInfo.poolId),
|
|
14
|
-
isStake ? tx.object(SUI_SYSTEM_STATE_OBJECT_ID) : this.inputCoinObject,
|
|
15
|
-
isStake ? this.inputCoinObject : tx.object(SUI_SYSTEM_STATE_OBJECT_ID),
|
|
16
|
-
],
|
|
17
|
-
});
|
|
18
|
-
return coinOut;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
import { SuiUtils } from "../../../utils/sui";
|
|
4
|
-
export class SuiswapContract extends BaseContract {
|
|
5
|
-
async swap(tx) {
|
|
6
|
-
const poolId = this.swapInfo.poolId;
|
|
7
|
-
const swapXtoY = this.swapInfo.swapXtoY;
|
|
8
|
-
const inputCoin = this.inputCoinObject;
|
|
9
|
-
const typeArguments = [this.swapInfo.coinX.type, this.swapInfo.coinY.type];
|
|
10
|
-
const callFunc = swapXtoY
|
|
11
|
-
? "do_swap_x_to_y_direct"
|
|
12
|
-
: "do_swap_y_to_x_direct";
|
|
13
|
-
const { package: PACKAGE_ID } = this.config.suiswap;
|
|
14
|
-
const inputAmount = this.getInputCoinValue(tx);
|
|
15
|
-
const [tokenIn, tokenOut] = tx.moveCall({
|
|
16
|
-
target: `${PACKAGE_ID}::pool::${callFunc}`,
|
|
17
|
-
typeArguments,
|
|
18
|
-
arguments: [
|
|
19
|
-
tx.object(poolId),
|
|
20
|
-
tx.makeMoveVec({
|
|
21
|
-
elements: [inputCoin],
|
|
22
|
-
}),
|
|
23
|
-
inputAmount,
|
|
24
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
25
|
-
],
|
|
26
|
-
});
|
|
27
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, tokenIn);
|
|
28
|
-
return tokenOut;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SUI_CLOCK_OBJECT_ID } from "@mysten/sui/utils";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
import { getDefaultSqrtPriceLimit } from "../utils";
|
|
4
|
-
import { SuiUtils } from "../../../utils/sui";
|
|
5
|
-
const ONE_MINUTE = 60 * 1000;
|
|
6
|
-
export class TurbosContract extends BaseContract {
|
|
7
|
-
async swap(tx) {
|
|
8
|
-
const a2b = this.swapInfo.swapXtoY;
|
|
9
|
-
const { package: PACKAGE_ID, version: VERSION } = this.config.turbos;
|
|
10
|
-
const inputAmount = this.getInputCoinValue(tx);
|
|
11
|
-
const [tokenOut, tokenIn] = tx.moveCall({
|
|
12
|
-
target: `${PACKAGE_ID}::swap_router::swap_${a2b ? "a_b" : "b_a"}_with_return_`,
|
|
13
|
-
typeArguments: this.getTypeParams(),
|
|
14
|
-
arguments: [
|
|
15
|
-
tx.object(this.swapInfo.poolId),
|
|
16
|
-
tx.makeMoveVec({
|
|
17
|
-
elements: [this.inputCoinObject],
|
|
18
|
-
}),
|
|
19
|
-
inputAmount,
|
|
20
|
-
tx.pure.u64(0),
|
|
21
|
-
tx.pure.u128(getDefaultSqrtPriceLimit(this.swapInfo.swapXtoY).toString()),
|
|
22
|
-
tx.pure.bool(true),
|
|
23
|
-
tx.pure.address(this.currentAccount),
|
|
24
|
-
tx.pure.u64(Date.now() + ONE_MINUTE * 3),
|
|
25
|
-
tx.object(SUI_CLOCK_OBJECT_ID),
|
|
26
|
-
tx.object(VERSION),
|
|
27
|
-
],
|
|
28
|
-
});
|
|
29
|
-
SuiUtils.collectDust(tx, this.swapInfo.assetIn, tokenIn);
|
|
30
|
-
return tokenOut;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ProtocolContract } from "./protocols";
|
|
2
|
-
export async function swapWithRoute({ route, inputCoinObject, currentAccount, config, pythMap, tx, }) {
|
|
3
|
-
let inputTokenObject = inputCoinObject;
|
|
4
|
-
let txbResultToReturn;
|
|
5
|
-
for (const swap of route) {
|
|
6
|
-
const ContractClass = ProtocolContract[swap.pool.type];
|
|
7
|
-
const contractInstance = new ContractClass({
|
|
8
|
-
swapInfo: swap,
|
|
9
|
-
inputCoinObject: inputTokenObject,
|
|
10
|
-
currentAccount,
|
|
11
|
-
config,
|
|
12
|
-
pythMap,
|
|
13
|
-
});
|
|
14
|
-
const tokenOut = await contractInstance.swap(tx);
|
|
15
|
-
inputTokenObject = tokenOut;
|
|
16
|
-
txbResultToReturn = tokenOut;
|
|
17
|
-
}
|
|
18
|
-
return txbResultToReturn;
|
|
19
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Transaction, } from "@mysten/sui/transactions";
|
|
2
|
-
import { BluefinXTx } from "../libs/protocols/bluefinx/types";
|
|
3
|
-
export { BluefinXTx };
|
|
4
|
-
export const isSuiTransaction = (tx) => tx instanceof Transaction;
|
|
5
|
-
/**
|
|
6
|
-
* Check if the sor response is a bluefinx routing
|
|
7
|
-
* @param sor
|
|
8
|
-
* @returns boolean
|
|
9
|
-
*/
|
|
10
|
-
export const isBluefinXRouting = (sor) => {
|
|
11
|
-
return (sor.routes?.length === 1 &&
|
|
12
|
-
sor.routes[0].hops.length === 1 &&
|
|
13
|
-
sor.routes[0].hops[0].pool.type === "bluefinx");
|
|
14
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
-
import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
|
|
3
|
-
declare function setApi(url: string): void;
|
|
4
|
-
declare function getApi(): string;
|
|
5
|
-
declare function setApiKey(key: string): void;
|
|
6
|
-
declare function getApiKey(): string;
|
|
7
|
-
declare function setBluefinXApiKey(key: string): void;
|
|
8
|
-
declare function getBluefinXApiKey(): string;
|
|
9
|
-
declare function getSuiClient(): SuiClient;
|
|
10
|
-
declare function setSuiClient(client: SuiClient): void;
|
|
11
|
-
declare function setPythClient(client: SuiPythClient): void;
|
|
12
|
-
declare function getPythClient(): SuiPythClient;
|
|
13
|
-
declare function setPythConnection(connection: SuiPriceServiceConnection): void;
|
|
14
|
-
declare function getPythConnection(): SuiPriceServiceConnection;
|
|
15
|
-
declare const Config: {
|
|
16
|
-
setApi: typeof setApi;
|
|
17
|
-
getApi: typeof getApi;
|
|
18
|
-
setApiKey: typeof setApiKey;
|
|
19
|
-
getApiKey: typeof getApiKey;
|
|
20
|
-
setBluefinXApiKey: typeof setBluefinXApiKey;
|
|
21
|
-
getBluefinXApiKey: typeof getBluefinXApiKey;
|
|
22
|
-
setSuiClient: typeof setSuiClient;
|
|
23
|
-
getSuiClient: typeof getSuiClient;
|
|
24
|
-
setPythClient: typeof setPythClient;
|
|
25
|
-
getPythClient: typeof getPythClient;
|
|
26
|
-
setPythConnection: typeof setPythConnection;
|
|
27
|
-
getPythConnection: typeof getPythConnection;
|
|
28
|
-
};
|
|
29
|
-
export { Config };
|
|
30
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkB,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,aAAa,EACd,MAAM,0BAA0B,CAAC;AAuBlC,iBAAS,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjC;AAED,iBAAS,MAAM,IAAI,MAAM,CAExB;AAED,iBAAS,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEpC;AAED,iBAAS,SAAS,IAAI,MAAM,CAE3B;AAED,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5C;AAED,iBAAS,iBAAiB,IAAI,MAAM,CAEnC;AAED,iBAAS,YAAY,IAAI,SAAS,CAEjC;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAE7C;AAED,iBAAS,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAElD;AAED,iBAAS,aAAa,IAAI,aAAa,CAEtC;AAED,iBAAS,iBAAiB,CAAC,UAAU,EAAE,yBAAyB,GAAG,IAAI,CAEtE;AAED,iBAAS,iBAAiB,IAAI,yBAAyB,CAEtD;AAED,QAAA,MAAM,MAAM;;;;;;;;;;;;;CAaX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
-
import { AggregatorProvider, BluefinLegacyProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions, QuoteProvider } from "../../../types/metaAg";
|
|
3
|
-
export declare class BluefinLegacyProvider implements QuoteProvider, AggregatorProvider {
|
|
4
|
-
private readonly options;
|
|
5
|
-
private readonly metaOptions;
|
|
6
|
-
readonly kind = EProvider.BLUEFIN7K_LEGACY;
|
|
7
|
-
constructor(options: BluefinLegacyProviderOptions, metaOptions: Required<MetaAgOptions>, client: SuiClient);
|
|
8
|
-
quote(options: MetaQuoteOptions): Promise<MetaQuote>;
|
|
9
|
-
swap({ quote, signer, tx, coinIn }: MetaSwapOptions): Promise<import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=bluefin7kLegacy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bluefin7kLegacy.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin7kLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAS/C,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,uBAAuB,CAAC;AAQ/B,qBAAa,qBACX,YAAW,aAAa,EAAE,kBAAkB;IAI1C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,QAAQ,CAAC,IAAI,8BAA8B;gBAExB,OAAO,EAAE,4BAA4B,EACrC,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAgBb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqBpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAsB1D"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
|
-
import { BluefinXTx } from "../../libs/protocols/bluefinx/types";
|
|
3
|
-
import { BuildTxResult, Commission, QuoteResponse, TxSorSwap } from "../../types/aggregator";
|
|
4
|
-
import { BuildTxParams } from "../../types/tx";
|
|
5
|
-
export declare const buildTx: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: BuildTxParams) => Promise<BuildTxResult>;
|
|
6
|
-
export declare const getPythPriceFeeds: (responses: QuoteResponse[]) => string[];
|
|
7
|
-
export declare const updatePythPriceFeedsIfAny: (tx: Transaction, quoteResponse: QuoteResponse[]) => Promise<Record<string, string>>;
|
|
8
|
-
export declare const validateRoutes: (routes: TxSorSwap[][], isSponsored?: boolean) => void;
|
|
9
|
-
export declare const getExpectedReturn: (returnAmount: string, slippageBps: number, commissionBps: number, tipBps?: number) => {
|
|
10
|
-
tipAmount: bigint;
|
|
11
|
-
minAmount: bigint;
|
|
12
|
-
commissionAmount: bigint;
|
|
13
|
-
expectedAmount: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const settle: (coinObjects: TransactionObjectArgument[], quoteResponse: QuoteResponse, slippageBps: number, _commission: Commission) => (tx: Transaction) => TransactionObjectArgument;
|
|
16
|
-
export declare const buildBluefinXTx: (tx: Transaction, accountAddress: string, quoteResponse: QuoteResponse) => Promise<BluefinXTx>;
|
|
17
|
-
//# sourceMappingURL=buildTx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTx.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,EACL,aAAa,EACb,UAAU,EAEV,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,OAAO,GAAU,2GAQ3B,aAAa,KAAG,OAAO,CAAC,aAAa,CA+FvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,WAAW,aAAa,EAAE,aAa3D,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,IAAI,WAAW,EACf,eAAe,aAAa,EAAE,oCAkB/B,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,QAAQ,SAAS,EAAE,EAAE,EACrB,cAAc,OAAO,SAWtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,eAAe,MAAM,EACrB,SAAQ,MAAU;;;;;CA8BnB,CAAC;AAEF,eAAO,MAAM,MAAM,GACjB,aAAa,yBAAyB,EAAE,EACxC,eAAe,aAAa,EAC5B,aAAa,MAAM,EACnB,aAAa,UAAU,MAEf,IAAI,WAAW,8BAiCxB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,IAAI,WAAW,EACf,gBAAgB,MAAM,EACtB,eAAe,aAAa,wBAyB7B,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
|
-
import { BuildTxResult } from "../../types/aggregator";
|
|
3
|
-
import { BuildTxParams, MultiSwapParams } from "../../types/tx";
|
|
4
|
-
/**
|
|
5
|
-
* Wave-based transaction builder that optimizes swap execution by:
|
|
6
|
-
* 1. Grouping swaps into execution waves based on readiness
|
|
7
|
-
* 2. Merging redundant swaps to the same pool within each wave
|
|
8
|
-
* 3. Processing waves sequentially, passing intermediate tokens between waves
|
|
9
|
-
*/
|
|
10
|
-
export declare const buildTxV2: (params: BuildTxParams) => Promise<BuildTxResult>;
|
|
11
|
-
export declare const buildTxV2Int: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: BuildTxParams, beforeBuildBluefinXTx?: (tx: Transaction, coinOut: TransactionObjectArgument | undefined) => void) => Promise<BuildTxResult>;
|
|
12
|
-
/**
|
|
13
|
-
* execute multiple swap in single transaction
|
|
14
|
-
*
|
|
15
|
-
* User must handle the coins from return
|
|
16
|
-
* @param param - MultiSwapParams
|
|
17
|
-
* @returns a map of coinType to coinObject
|
|
18
|
-
*/
|
|
19
|
-
export declare const multiSwap: ({ sender, slippageBps, swaps, tx, commission, }: MultiSwapParams) => Promise<Record<string, TransactionObjectArgument>>;
|
|
20
|
-
//# sourceMappingURL=buildTxV2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildTxV2.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/buildTxV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,aAAa,EAId,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAUhE;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,QAAQ,aAAa,KACpB,OAAO,CAAC,aAAa,CAEvB,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,2GAQG,aAAa,EAChB,wBAAwB,CACtB,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,yBAAyB,GAAG,SAAS,KAC3C,IAAI,KACR,OAAO,CAAC,aAAa,CAwFvB,CAAC;AAiKF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAU,iDAM7B,eAAe,uDAiDjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,MAqL5B,CAAC;AAIF,wBAAsB,SAAS,oBAiB9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"estimateGasFee.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/estimateGasFee.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAMtD,wBAAsB,cAAc,CAAC,EACnC,aAAa,EACb,cAAc,EACd,QAAQ,EACR,QAAQ,EAAE,SAAS,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAwCxC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SuiTransactionBlockResponse, SuiTransactionBlockResponseOptions } from "@mysten/sui/client";
|
|
2
|
-
import { AggregatorTx } from "../../types/aggregator";
|
|
3
|
-
/**
|
|
4
|
-
* Execute a transaction after it is signed
|
|
5
|
-
*
|
|
6
|
-
* Automatically handle BluefinX transaction execution if needed
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const { mutateAsync: signTransaction } = useSignTransaction();
|
|
10
|
-
* const quoteResponse = await getQuote(...quoteParams);
|
|
11
|
-
* const { tx } = await buildTx(...buildTxParams);
|
|
12
|
-
* const {signature, bytes} = await signTransaction({
|
|
13
|
-
* transaction: tx instanceof BluefinXTx ? tx.txBytes : tx,
|
|
14
|
-
* });
|
|
15
|
-
* const res = await executeTx(tx, signature, bytes);
|
|
16
|
-
* ```
|
|
17
|
-
* @param tx - AggregatorTx - received from `buildTx`
|
|
18
|
-
* @param signature - User signature after signing the transaction
|
|
19
|
-
* @param signedTxBytes - Signed transaction bytes after signing the transaction
|
|
20
|
-
* @param options - Options for the transaction
|
|
21
|
-
* @returns `SuiTransactionBlockResponse`
|
|
22
|
-
*/
|
|
23
|
-
export declare const executeTx: (tx: AggregatorTx, signature: string, signedTxBytes: string, options?: SuiTransactionBlockResponseOptions) => Promise<SuiTransactionBlockResponse>;
|
|
24
|
-
//# sourceMappingURL=executeTx.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"executeTx.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/executeTx.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,kCAAkC,EACnC,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,GACpB,IAAI,YAAY,EAChB,WAAW,MAAM,EACjB,eAAe,MAAM,EACrB,UAAU,kCAAkC,yCA0B7C,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { QuoteResponse, SourceDex } from "../../types/aggregator";
|
|
2
|
-
interface Params {
|
|
3
|
-
tokenIn: string;
|
|
4
|
-
tokenOut: string;
|
|
5
|
-
amountIn: string;
|
|
6
|
-
/**
|
|
7
|
-
* @default DEFAULT_SOURCES
|
|
8
|
-
* @warning BluefinX must be explicitly specified if needed
|
|
9
|
-
* @example ```sources: [...DEFAULT_SOURCES, "bluefinx"]``` */
|
|
10
|
-
sources?: SourceDex[];
|
|
11
|
-
commissionBps?: number;
|
|
12
|
-
/** Limit the route to a specific set of pools */
|
|
13
|
-
targetPools?: string[];
|
|
14
|
-
/** Exclude a specific set of pools from the route */
|
|
15
|
-
excludedPools?: string[];
|
|
16
|
-
/** The taker address, required for bluefinx */
|
|
17
|
-
taker?: string;
|
|
18
|
-
/** If true, excludes all liquidity sources that depend on pyth price feeds - pyth client use tx.gas to pay the fee*/
|
|
19
|
-
isSponsored?: boolean;
|
|
20
|
-
/** Maximum number of paths to consider for the quote */
|
|
21
|
-
maxPaths?: number;
|
|
22
|
-
}
|
|
23
|
-
export declare const DEFAULT_SOURCES: SourceDex[];
|
|
24
|
-
export declare const ORACLE_BASED_SOURCES: Set<SourceDex>;
|
|
25
|
-
export declare function getQuote({ tokenIn, tokenOut, amountIn, sources: _sources, commissionBps, targetPools, excludedPools, taker, isSponsored, maxPaths, }: Params): Promise<QuoteResponse>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=getQuote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC,UAAU,MAAM;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB;;;kEAG8D;IAC9D,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qHAAqH;IACrH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,EA0BtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,gBAM/B,CAAC;AAEH,wBAAsB,QAAQ,CAAC,EAC7B,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EAAE,QAA0B,EACnC,aAAa,EACb,WAAW,EACX,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,GACT,EAAE,MAAM,0BA8CR"}
|