@7kprotocol/sdk-ts 3.5.4 → 3.6.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +103 -0
- package/lib/cjs/features/metaAg/error.js +31 -0
- package/lib/cjs/features/metaAg/index.js +96 -117
- package/lib/cjs/features/metaAg/providers/bluefin7k.js +57 -0
- package/lib/cjs/features/metaAg/providers/cetus.js +7 -7
- package/lib/cjs/features/metaAg/providers/flowx.js +6 -6
- package/lib/cjs/features/metaAg/providers/okx.js +182 -0
- 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 +24 -0
- package/lib/cjs/types/features/metaAg/common.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/error.d.ts +54 -0
- package/lib/cjs/types/features/metaAg/error.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/index.d.ts +11 -2
- package/lib/cjs/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
- package/lib/cjs/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts +4 -5
- package/lib/cjs/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts +3 -3
- package/lib/cjs/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts +21 -0
- package/lib/cjs/types/features/metaAg/providers/okx.d.ts.map +1 -0
- 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 -30
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/metaAg.js +8 -4
- package/lib/cjs/types/okx.js +6 -0
- package/lib/cjs/types/types/metaAg.d.ts +50 -12
- package/lib/cjs/types/types/metaAg.d.ts.map +1 -1
- package/lib/cjs/types/types/okx.d.ts +206 -0
- package/lib/cjs/types/types/okx.d.ts.map +1 -0
- package/lib/cjs/types/utils/sui.d.ts +1 -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 +19 -146
- 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 +96 -0
- package/lib/esm/features/metaAg/error.js +29 -0
- package/lib/esm/features/metaAg/index.js +96 -117
- package/lib/esm/features/metaAg/providers/{bluefin.js → bluefin7k.js} +12 -23
- package/lib/esm/features/metaAg/providers/cetus.js +7 -7
- package/lib/esm/features/metaAg/providers/flowx.js +6 -6
- package/lib/esm/features/metaAg/providers/okx.js +147 -0
- 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 +24 -0
- package/lib/esm/types/features/metaAg/common.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/error.d.ts +54 -0
- package/lib/esm/types/features/metaAg/error.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/index.d.ts +11 -2
- package/lib/esm/types/features/metaAg/index.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts +11 -0
- package/lib/esm/types/features/metaAg/providers/bluefin7k.d.ts.map +1 -0
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts +4 -5
- package/lib/esm/types/features/metaAg/providers/cetus.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts +3 -3
- package/lib/esm/types/features/metaAg/providers/flowx.d.ts.map +1 -1
- package/lib/esm/types/features/metaAg/providers/okx.d.ts +21 -0
- package/lib/esm/types/features/metaAg/providers/okx.d.ts.map +1 -0
- 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 -30
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/metaAg.js +5 -2
- package/lib/esm/types/okx.js +5 -0
- package/lib/esm/types/types/metaAg.d.ts +50 -12
- package/lib/esm/types/types/metaAg.d.ts.map +1 -1
- package/lib/esm/types/types/okx.d.ts +206 -0
- package/lib/esm/types/types/okx.d.ts.map +1 -0
- package/lib/esm/types/utils/sui.d.ts +1 -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 +19 -147
- package/lib/esm/utils/swap.js +33 -0
- package/package.json +3 -1
- package/lib/cjs/config/index.js +0 -58
- package/lib/cjs/features/metaAg/providers/bluefin.js +0 -68
- package/lib/cjs/features/swap/buildTx.js +0 -195
- package/lib/cjs/features/swap/buildTxV2.js +0 -225
- package/lib/cjs/features/swap/config.js +0 -153
- 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 -94
- 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 -26
- package/lib/cjs/types/config/index.d.ts.map +0 -1
- package/lib/cjs/types/features/metaAg/providers/bluefin.d.ts +0 -11
- package/lib/cjs/types/features/metaAg/providers/bluefin.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 -29
- 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/condition.d.ts +0 -2
- package/lib/cjs/types/utils/condition.d.ts.map +0 -1
- 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/condition.js +0 -8
- package/lib/cjs/utils/number.js +0 -9
- package/lib/esm/config/index.js +0 -55
- package/lib/esm/features/swap/buildTx.js +0 -185
- package/lib/esm/features/swap/buildTxV2.js +0 -219
- package/lib/esm/features/swap/config.js +0 -149
- 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 -90
- 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 -26
- package/lib/esm/types/config/index.d.ts.map +0 -1
- package/lib/esm/types/features/metaAg/providers/bluefin.d.ts +0 -11
- package/lib/esm/types/features/metaAg/providers/bluefin.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 -29
- 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/condition.d.ts +0 -2
- package/lib/esm/types/utils/condition.d.ts.map +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/condition.js +0 -5
- package/lib/esm/utils/number.js +0 -6
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SteammContract = void 0;
|
|
4
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
-
const sui_1 = require("../../../utils/sui");
|
|
6
|
-
const base_1 = require("../base");
|
|
7
|
-
class SteammContract extends base_1.BaseContract {
|
|
8
|
-
async swap(tx) {
|
|
9
|
-
if (this.extra.poolStructTag.includes("omm::OracleQuoter")) {
|
|
10
|
-
return this.ommSwap(tx, "v1");
|
|
11
|
-
}
|
|
12
|
-
else if (this.extra.poolStructTag.includes("omm_v2::OracleQuoterV2")) {
|
|
13
|
-
return this.ommSwap(tx, "v2");
|
|
14
|
-
}
|
|
15
|
-
else if (this.extra.poolStructTag.includes("cpmm::CpQuoter")) {
|
|
16
|
-
return this.cpmmSwap(tx);
|
|
17
|
-
}
|
|
18
|
-
throw new Error(`Unsupported pool type: ${this.extra.poolStructTag}`);
|
|
19
|
-
}
|
|
20
|
-
cpmmSwap(tx) {
|
|
21
|
-
const extra = this.extra;
|
|
22
|
-
if (!extra ||
|
|
23
|
-
!extra.bankAStructTag ||
|
|
24
|
-
!extra.bankBStructTag ||
|
|
25
|
-
!extra.poolStructTag ||
|
|
26
|
-
!extra.bankA ||
|
|
27
|
-
!extra.bankB ||
|
|
28
|
-
!extra.lendingMarketA ||
|
|
29
|
-
!extra.lendingMarketB) {
|
|
30
|
-
throw new Error(`Invalid extra info for cpmmSwap`);
|
|
31
|
-
}
|
|
32
|
-
// the pool script v1 only support same lending market
|
|
33
|
-
if (extra.lendingMarketA !== extra.lendingMarketB) {
|
|
34
|
-
throw new Error(`Invalid lending market for cpmmSwap`);
|
|
35
|
-
}
|
|
36
|
-
const [btokenA, bTokenB, _quoter, lp] = (0, utils_1.parseStructTag)(extra.poolStructTag).typeParams;
|
|
37
|
-
const [lendingMarket, coinTypeA, _bTokenA] = (0, utils_1.parseStructTag)(extra.bankAStructTag).typeParams;
|
|
38
|
-
const [_lendingMarket, coinTypeB, _bTokenB] = (0, utils_1.parseStructTag)(extra.bankBStructTag).typeParams;
|
|
39
|
-
const xToY = this.swapInfo.swapXtoY;
|
|
40
|
-
const coinA = xToY
|
|
41
|
-
? this.inputCoinObject
|
|
42
|
-
: sui_1.SuiUtils.zeroCoin(tx, (0, utils_1.normalizeStructTag)(coinTypeA));
|
|
43
|
-
const coinB = !xToY
|
|
44
|
-
? this.inputCoinObject
|
|
45
|
-
: sui_1.SuiUtils.zeroCoin(tx, (0, utils_1.normalizeStructTag)(coinTypeB));
|
|
46
|
-
tx.moveCall({
|
|
47
|
-
target: `${this.config.steamm.script}::pool_script::cpmm_swap`,
|
|
48
|
-
typeArguments: [
|
|
49
|
-
lendingMarket,
|
|
50
|
-
coinTypeA,
|
|
51
|
-
coinTypeB,
|
|
52
|
-
btokenA,
|
|
53
|
-
bTokenB,
|
|
54
|
-
lp,
|
|
55
|
-
].map(utils_1.normalizeStructTag),
|
|
56
|
-
arguments: [
|
|
57
|
-
tx.object(this.swapInfo.poolId),
|
|
58
|
-
tx.object(extra.bankA),
|
|
59
|
-
tx.object(extra.bankB),
|
|
60
|
-
tx.object(extra.lendingMarketA),
|
|
61
|
-
coinA,
|
|
62
|
-
coinB,
|
|
63
|
-
tx.pure.bool(xToY),
|
|
64
|
-
this.getInputCoinValue(tx),
|
|
65
|
-
tx.pure.u64(0),
|
|
66
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
67
|
-
],
|
|
68
|
-
});
|
|
69
|
-
const coinIn = xToY ? coinA : coinB;
|
|
70
|
-
const coinOut = xToY ? coinB : coinA;
|
|
71
|
-
sui_1.SuiUtils.collectDust(tx, this.swapInfo.assetIn, coinIn);
|
|
72
|
-
return coinOut;
|
|
73
|
-
}
|
|
74
|
-
ommSwap(tx, version) {
|
|
75
|
-
const extra = this.swapInfo.extra;
|
|
76
|
-
if (!extra ||
|
|
77
|
-
!extra.bankAStructTag ||
|
|
78
|
-
!extra.bankBStructTag ||
|
|
79
|
-
!extra.poolStructTag ||
|
|
80
|
-
!extra.bankA ||
|
|
81
|
-
!extra.bankB ||
|
|
82
|
-
!extra.lendingMarketA ||
|
|
83
|
-
!extra.lendingMarketB) {
|
|
84
|
-
throw new Error(`Invalid extra info for cpmmSwap`);
|
|
85
|
-
}
|
|
86
|
-
// the pool script v1 only support same lending market
|
|
87
|
-
if (extra.lendingMarketA !== extra.lendingMarketB) {
|
|
88
|
-
throw new Error(`Invalid lending market for ommSwap`);
|
|
89
|
-
}
|
|
90
|
-
const [btokenA, bTokenB, _quoter, lp] = (0, utils_1.parseStructTag)(extra.poolStructTag).typeParams;
|
|
91
|
-
const [lendingMarket, coinTypeA, _bTokenA] = (0, utils_1.parseStructTag)(extra.bankAStructTag).typeParams;
|
|
92
|
-
const [_lendingMarket, coinTypeB, _bTokenB] = (0, utils_1.parseStructTag)(extra.bankBStructTag).typeParams;
|
|
93
|
-
const xToY = this.swapInfo.swapXtoY;
|
|
94
|
-
const coinA = xToY
|
|
95
|
-
? this.inputCoinObject
|
|
96
|
-
: sui_1.SuiUtils.zeroCoin(tx, (0, utils_1.normalizeStructTag)(coinTypeA));
|
|
97
|
-
const coinB = !xToY
|
|
98
|
-
? this.inputCoinObject
|
|
99
|
-
: sui_1.SuiUtils.zeroCoin(tx, (0, utils_1.normalizeStructTag)(coinTypeB));
|
|
100
|
-
const [priceA, priceB] = this.getOraclePriceUpdate(tx);
|
|
101
|
-
tx.moveCall({
|
|
102
|
-
target: `${this.config.steamm.script}::pool_script_v2::${version === "v1" ? "omm_swap" : "omm_v2_swap"}`,
|
|
103
|
-
typeArguments: [
|
|
104
|
-
lendingMarket,
|
|
105
|
-
coinTypeA,
|
|
106
|
-
coinTypeB,
|
|
107
|
-
btokenA,
|
|
108
|
-
bTokenB,
|
|
109
|
-
lp,
|
|
110
|
-
].map(utils_1.normalizeStructTag),
|
|
111
|
-
arguments: [
|
|
112
|
-
tx.object(this.swapInfo.poolId),
|
|
113
|
-
tx.object(extra.bankA),
|
|
114
|
-
tx.object(extra.bankB),
|
|
115
|
-
tx.object(extra.lendingMarketA),
|
|
116
|
-
priceA,
|
|
117
|
-
priceB,
|
|
118
|
-
coinA,
|
|
119
|
-
coinB,
|
|
120
|
-
tx.pure.bool(xToY),
|
|
121
|
-
this.getInputCoinValue(tx),
|
|
122
|
-
tx.pure.u64(0),
|
|
123
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
124
|
-
],
|
|
125
|
-
});
|
|
126
|
-
const coinIn = xToY ? coinA : coinB;
|
|
127
|
-
const coinOut = xToY ? coinB : coinA;
|
|
128
|
-
sui_1.SuiUtils.collectDust(tx, this.swapInfo.assetIn, coinIn);
|
|
129
|
-
return coinOut;
|
|
130
|
-
}
|
|
131
|
-
getOraclePriceUpdate(tx) {
|
|
132
|
-
const oracleA = this.getPythPriceInfoId(this.extra.oracles?.[0]);
|
|
133
|
-
const oracleB = this.getPythPriceInfoId(this.extra.oracles?.[1]);
|
|
134
|
-
const registry = this.extra.oracleRegistry;
|
|
135
|
-
const indexes = this.extra.oracleIndexes;
|
|
136
|
-
if (!registry || indexes?.length !== 2) {
|
|
137
|
-
throw new Error(`Invalid oracle info for getOraclePriceUpdate`);
|
|
138
|
-
}
|
|
139
|
-
const [a] = tx.moveCall({
|
|
140
|
-
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
141
|
-
arguments: [
|
|
142
|
-
tx.object(registry),
|
|
143
|
-
tx.object(oracleA),
|
|
144
|
-
tx.pure.u64(indexes[0]),
|
|
145
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
146
|
-
],
|
|
147
|
-
});
|
|
148
|
-
const [b] = tx.moveCall({
|
|
149
|
-
target: `${this.config.steamm.oracle}::oracles::get_pyth_price`,
|
|
150
|
-
arguments: [
|
|
151
|
-
tx.object(registry),
|
|
152
|
-
tx.object(oracleB),
|
|
153
|
-
tx.pure.u64(indexes[1]),
|
|
154
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
155
|
-
],
|
|
156
|
-
});
|
|
157
|
-
return [a, b];
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
exports.SteammContract = SteammContract;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StSuiContract = void 0;
|
|
4
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
-
const base_1 = require("../base");
|
|
6
|
-
class StSuiContract extends base_1.BaseContract {
|
|
7
|
-
async swap(tx) {
|
|
8
|
-
// coinX is always SUI
|
|
9
|
-
const coinY = this.swapInfo.pool.allTokens[1];
|
|
10
|
-
const isStake = this.swapInfo.swapXtoY;
|
|
11
|
-
const { package: PACKAGE_ID } = this.config.stsui;
|
|
12
|
-
const [coinOut] = tx.moveCall({
|
|
13
|
-
target: `${PACKAGE_ID}::liquid_staking::${isStake ? "mint" : "redeem"}`,
|
|
14
|
-
typeArguments: [coinY.address],
|
|
15
|
-
arguments: [
|
|
16
|
-
tx.object(this.swapInfo.poolId),
|
|
17
|
-
isStake ? tx.object(utils_1.SUI_SYSTEM_STATE_OBJECT_ID) : this.inputCoinObject,
|
|
18
|
-
isStake ? this.inputCoinObject : tx.object(utils_1.SUI_SYSTEM_STATE_OBJECT_ID),
|
|
19
|
-
],
|
|
20
|
-
});
|
|
21
|
-
return coinOut;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.StSuiContract = StSuiContract;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SuiswapContract = void 0;
|
|
4
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
-
const base_1 = require("../base");
|
|
6
|
-
const sui_1 = require("../../../utils/sui");
|
|
7
|
-
class SuiswapContract extends base_1.BaseContract {
|
|
8
|
-
async swap(tx) {
|
|
9
|
-
const poolId = this.swapInfo.poolId;
|
|
10
|
-
const swapXtoY = this.swapInfo.swapXtoY;
|
|
11
|
-
const inputCoin = this.inputCoinObject;
|
|
12
|
-
const typeArguments = [this.swapInfo.coinX.type, this.swapInfo.coinY.type];
|
|
13
|
-
const callFunc = swapXtoY
|
|
14
|
-
? "do_swap_x_to_y_direct"
|
|
15
|
-
: "do_swap_y_to_x_direct";
|
|
16
|
-
const { package: PACKAGE_ID } = this.config.suiswap;
|
|
17
|
-
const inputAmount = this.getInputCoinValue(tx);
|
|
18
|
-
const [tokenIn, tokenOut] = tx.moveCall({
|
|
19
|
-
target: `${PACKAGE_ID}::pool::${callFunc}`,
|
|
20
|
-
typeArguments,
|
|
21
|
-
arguments: [
|
|
22
|
-
tx.object(poolId),
|
|
23
|
-
tx.makeMoveVec({
|
|
24
|
-
elements: [inputCoin],
|
|
25
|
-
}),
|
|
26
|
-
inputAmount,
|
|
27
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
28
|
-
],
|
|
29
|
-
});
|
|
30
|
-
sui_1.SuiUtils.collectDust(tx, this.swapInfo.assetIn, tokenIn);
|
|
31
|
-
return tokenOut;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.SuiswapContract = SuiswapContract;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TurbosContract = void 0;
|
|
4
|
-
const utils_1 = require("@mysten/sui/utils");
|
|
5
|
-
const base_1 = require("../base");
|
|
6
|
-
const utils_2 = require("../utils");
|
|
7
|
-
const sui_1 = require("../../../utils/sui");
|
|
8
|
-
const ONE_MINUTE = 60 * 1000;
|
|
9
|
-
class TurbosContract extends base_1.BaseContract {
|
|
10
|
-
async swap(tx) {
|
|
11
|
-
const a2b = this.swapInfo.swapXtoY;
|
|
12
|
-
const { package: PACKAGE_ID, version: VERSION } = this.config.turbos;
|
|
13
|
-
const inputAmount = this.getInputCoinValue(tx);
|
|
14
|
-
const [tokenOut, tokenIn] = tx.moveCall({
|
|
15
|
-
target: `${PACKAGE_ID}::swap_router::swap_${a2b ? "a_b" : "b_a"}_with_return_`,
|
|
16
|
-
typeArguments: this.getTypeParams(),
|
|
17
|
-
arguments: [
|
|
18
|
-
tx.object(this.swapInfo.poolId),
|
|
19
|
-
tx.makeMoveVec({
|
|
20
|
-
elements: [this.inputCoinObject],
|
|
21
|
-
}),
|
|
22
|
-
inputAmount,
|
|
23
|
-
tx.pure.u64(0),
|
|
24
|
-
tx.pure.u128((0, utils_2.getDefaultSqrtPriceLimit)(this.swapInfo.swapXtoY).toString()),
|
|
25
|
-
tx.pure.bool(true),
|
|
26
|
-
tx.pure.address(this.currentAccount),
|
|
27
|
-
tx.pure.u64(Date.now() + ONE_MINUTE * 3),
|
|
28
|
-
tx.object(utils_1.SUI_CLOCK_OBJECT_ID),
|
|
29
|
-
tx.object(VERSION),
|
|
30
|
-
],
|
|
31
|
-
});
|
|
32
|
-
sui_1.SuiUtils.collectDust(tx, this.swapInfo.assetIn, tokenIn);
|
|
33
|
-
return tokenOut;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.TurbosContract = TurbosContract;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDefaultSqrtPriceLimit = getDefaultSqrtPriceLimit;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
function getDefaultSqrtPriceLimit(a2b) {
|
|
6
|
-
return BigInt(a2b ? constants_1.MIN_SQRT_PRICE : constants_1.MAX_SQRT_PRICE);
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.swapWithRoute = swapWithRoute;
|
|
4
|
-
const protocols_1 = require("./protocols");
|
|
5
|
-
async function swapWithRoute({ route, inputCoinObject, currentAccount, config, pythMap, tx, }) {
|
|
6
|
-
let inputTokenObject = inputCoinObject;
|
|
7
|
-
let txbResultToReturn;
|
|
8
|
-
for (const swap of route) {
|
|
9
|
-
const ContractClass = protocols_1.ProtocolContract[swap.pool.type];
|
|
10
|
-
const contractInstance = new ContractClass({
|
|
11
|
-
swapInfo: swap,
|
|
12
|
-
inputCoinObject: inputTokenObject,
|
|
13
|
-
currentAccount,
|
|
14
|
-
config,
|
|
15
|
-
pythMap,
|
|
16
|
-
});
|
|
17
|
-
const tokenOut = await contractInstance.swap(tx);
|
|
18
|
-
inputTokenObject = tokenOut;
|
|
19
|
-
txbResultToReturn = tokenOut;
|
|
20
|
-
}
|
|
21
|
-
return txbResultToReturn;
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBluefinXRouting = exports.isSuiTransaction = exports.BluefinXTx = void 0;
|
|
4
|
-
const transactions_1 = require("@mysten/sui/transactions");
|
|
5
|
-
const types_1 = require("../libs/protocols/bluefinx/types");
|
|
6
|
-
Object.defineProperty(exports, "BluefinXTx", { enumerable: true, get: function () { return types_1.BluefinXTx; } });
|
|
7
|
-
const isSuiTransaction = (tx) => tx instanceof transactions_1.Transaction;
|
|
8
|
-
exports.isSuiTransaction = isSuiTransaction;
|
|
9
|
-
/**
|
|
10
|
-
* Check if the sor response is a bluefinx routing
|
|
11
|
-
* @param sor
|
|
12
|
-
* @returns boolean
|
|
13
|
-
*/
|
|
14
|
-
const isBluefinXRouting = (sor) => {
|
|
15
|
-
return (sor.routes?.length === 1 &&
|
|
16
|
-
sor.routes[0].hops.length === 1 &&
|
|
17
|
-
sor.routes[0].hops[0].pool.type === "bluefinx");
|
|
18
|
-
};
|
|
19
|
-
exports.isBluefinXRouting = isBluefinXRouting;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
-
import { SuiPriceServiceConnection, SuiPythClient } from "@pythnetwork/pyth-sui-js";
|
|
3
|
-
declare function setApiKey(key: string): void;
|
|
4
|
-
declare function getApiKey(): string;
|
|
5
|
-
declare function setBluefinXApiKey(key: string): void;
|
|
6
|
-
declare function getBluefinXApiKey(): string;
|
|
7
|
-
declare function getSuiClient(): SuiClient;
|
|
8
|
-
declare function setSuiClient(client: SuiClient): void;
|
|
9
|
-
declare function setPythClient(client: SuiPythClient): void;
|
|
10
|
-
declare function getPythClient(): SuiPythClient;
|
|
11
|
-
declare function setPythConnection(connection: SuiPriceServiceConnection): void;
|
|
12
|
-
declare function getPythConnection(): SuiPriceServiceConnection;
|
|
13
|
-
declare const Config: {
|
|
14
|
-
setApiKey: typeof setApiKey;
|
|
15
|
-
getApiKey: typeof getApiKey;
|
|
16
|
-
setBluefinXApiKey: typeof setBluefinXApiKey;
|
|
17
|
-
getBluefinXApiKey: typeof getBluefinXApiKey;
|
|
18
|
-
setSuiClient: typeof setSuiClient;
|
|
19
|
-
getSuiClient: typeof getSuiClient;
|
|
20
|
-
setPythClient: typeof setPythClient;
|
|
21
|
-
getPythClient: typeof getPythClient;
|
|
22
|
-
setPythConnection: typeof setPythConnection;
|
|
23
|
-
getPythConnection: typeof getPythConnection;
|
|
24
|
-
};
|
|
25
|
-
export { Config };
|
|
26
|
-
//# 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;AAsBlC,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;;;;;;;;;;;CAWX,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { SuiClient } from "@mysten/sui/client";
|
|
2
|
-
import { AgProvider, BluefinProviderOptions, EProvider, MetaAgOptions, MetaQuote, MetaQuoteOptions, MetaSwapOptions } from "../../../types/metaAg";
|
|
3
|
-
export declare class BluefinProvider implements AgProvider {
|
|
4
|
-
private readonly options;
|
|
5
|
-
private readonly metaOptions;
|
|
6
|
-
kind: EProvider;
|
|
7
|
-
constructor(options: BluefinProviderOptions, 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=bluefin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bluefin.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/bluefin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAU/C,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,SAAS,EACT,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAQ/B,qBAAa,eAAgB,YAAW,UAAU;IAG9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,IAAI,YAAuB;gBAER,OAAO,EAAE,sBAAsB,EAC/B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACrD,MAAM,EAAE,SAAS;IAeb,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC;IAsBpD,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAAe;CAiB1D"}
|
|
@@ -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,wBAsB7B,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
|
-
import { BuildTxResult, Config, TxSorSwap } 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: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: BuildTxParams) => Promise<BuildTxResult>;
|
|
11
|
-
export declare const optimize: (pythMap: Record<string, string>, config: Config, routes: TxSorSwap[][], coinData: TransactionObjectArgument[], tx: Transaction, accountAddress: string) => Promise<TransactionObjectArgument[]>;
|
|
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,EACb,MAAM,EAEN,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAUhE;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAU,2GAQ7B,aAAa,KAAG,OAAO,CAAC,aAAa,CAuFvC,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,MAAM,EACd,QAAQ,SAAS,EAAE,EAAE,EACrB,UAAU,yBAAyB,EAAE,EACrC,IAAI,WAAW,EACf,gBAAgB,MAAM,yCAuJvB,CAAC;AAEF;;;;;;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":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,eAAO,MAAM,cAAc,EAAE,MAqL5B,CAAC;AAIF,wBAAsB,SAAS,oBAe9B"}
|
|
@@ -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,29 +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
|
-
/** Custom API endpoint */
|
|
21
|
-
api?: string;
|
|
22
|
-
/** Maximum number of paths to consider for the quote */
|
|
23
|
-
maxPaths?: number;
|
|
24
|
-
}
|
|
25
|
-
export declare const DEFAULT_SOURCES: SourceDex[];
|
|
26
|
-
export declare const ORACLE_BASED_SOURCES: Set<SourceDex>;
|
|
27
|
-
export declare function getQuote({ tokenIn, tokenOut, amountIn, sources: _sources, commissionBps, targetPools, excludedPools, taker, isSponsored, api, maxPaths, }: Params): Promise<QuoteResponse>;
|
|
28
|
-
export {};
|
|
29
|
-
//# sourceMappingURL=getQuote.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getQuote.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getQuote.ts"],"names":[],"mappings":"AAGA,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,0BAA0B;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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,GAAG,EACH,QAAQ,GACT,EAAE,MAAM,0BA8CR"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface Params {
|
|
2
|
-
owner: string;
|
|
3
|
-
offset: number;
|
|
4
|
-
limit: number;
|
|
5
|
-
tokenPair?: string;
|
|
6
|
-
}
|
|
7
|
-
interface TradingHistoryItem {
|
|
8
|
-
digest: string;
|
|
9
|
-
timestamp: string;
|
|
10
|
-
coin_in: string;
|
|
11
|
-
coin_out: string;
|
|
12
|
-
amount_in: string;
|
|
13
|
-
amount_out: string;
|
|
14
|
-
volume: string | null;
|
|
15
|
-
}
|
|
16
|
-
interface TradingHistoryResponse {
|
|
17
|
-
count: number;
|
|
18
|
-
history: TradingHistoryItem[];
|
|
19
|
-
}
|
|
20
|
-
export declare function getSwapHistory({ owner, offset, limit, tokenPair, }: Params): Promise<TradingHistoryResponse>;
|
|
21
|
-
export {};
|
|
22
|
-
//# sourceMappingURL=getSwapHistory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSwapHistory.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/getSwapHistory.ts"],"names":[],"mappings":"AAIA,UAAU,MAAM;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,wBAAsB,cAAc,CAAC,EACnC,KAAK,EACL,MAAU,EACV,KAAU,EACV,SAAS,GACV,EAAE,MAAM,mCAmBR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/swap/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"groupSwapRoutes.d.ts","sourceRoot":"","sources":["../../../../src/libs/groupSwapRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,EACb,SAAS,EACV,MAAM,qBAAqB,CAAC;AAG7B,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,GAAG,SAAS,EAAE,EAAE,CA2B3E"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export declare class AfterMathContract extends BaseContract {
|
|
4
|
-
swap(tx: Transaction): Promise<{
|
|
5
|
-
$kind: "NestedResult";
|
|
6
|
-
NestedResult: [number, number];
|
|
7
|
-
}>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/aftermath/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,qBAAa,iBAAkB,SAAQ,YAAY;IAC3C,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CA4B3B"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
2
|
-
import { Config, ExtraOracle, TxSorSwap } from "../../types/aggregator";
|
|
3
|
-
export interface BaseContractParams {
|
|
4
|
-
swapInfo: TxSorSwap;
|
|
5
|
-
inputCoinObject: TransactionObjectArgument;
|
|
6
|
-
currentAccount: string;
|
|
7
|
-
config: Config;
|
|
8
|
-
/** map price feed id to onchain priceInfoObject id */
|
|
9
|
-
pythMap: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
export declare abstract class BaseContract<T = any> {
|
|
12
|
-
protected swapInfo: TxSorSwap;
|
|
13
|
-
protected inputCoinObject: TransactionObjectArgument;
|
|
14
|
-
protected currentAccount: string;
|
|
15
|
-
protected config: Config;
|
|
16
|
-
protected pythMap: Record<string, string>;
|
|
17
|
-
constructor({ swapInfo, inputCoinObject, currentAccount, config, pythMap, }: BaseContractParams);
|
|
18
|
-
abstract swap(tx: Transaction): Promise<TransactionObjectArgument>;
|
|
19
|
-
protected getInputCoinValue(tx: Transaction): import("@mysten/sui/transactions").TransactionArgument;
|
|
20
|
-
protected getTypeParams(): string[];
|
|
21
|
-
protected get extra(): NonNullable<T>;
|
|
22
|
-
protected getPythPriceInfoId(oracle?: ExtraOracle): string;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/libs/protocols/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,yBAAyB,CAAC;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,8BAAsB,YAAY,CAAC,CAAC,GAAG,GAAG;IACxC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,SAAS,CAAC,eAAe,EAAE,yBAAyB,CAAC;IACrD,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC;IACjC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE9B,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,MAAM,EACN,OAAO,GACR,EAAE,kBAAkB;IAQrB,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAElE,SAAS,CAAC,iBAAiB,CAAC,EAAE,EAAE,WAAW;IAQ3C,SAAS,CAAC,aAAa;IAMvB,SAAS,KAAK,KAAK,mBAMlB;IAED,SAAS,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,WAAW;CAclD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export declare class BluefinContract extends BaseContract {
|
|
4
|
-
swap(tx: Transaction): Promise<{
|
|
5
|
-
$kind: "NestedResult";
|
|
6
|
-
NestedResult: [number, number];
|
|
7
|
-
}>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluefin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,qBAAa,eAAgB,SAAQ,YAAY;IACzC,IAAI,CAAC,EAAE,EAAE,WAAW;;;;CAyC3B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BluefinXTx, SponsorRequest, SponsorResponse, SwapResponse } from "./types";
|
|
2
|
-
export declare const sponsorBluefinX: (body: SponsorRequest) => Promise<SponsorResponse>;
|
|
3
|
-
/**
|
|
4
|
-
* Request BluefinX for signing sponsored tx and execute it
|
|
5
|
-
*
|
|
6
|
-
* @Warning
|
|
7
|
-
* User must use this function to execute BluefinX tx, otherwise the tx will be rejected by BluefinX contract
|
|
8
|
-
* @param tx - BluefinX tx which is generated by `buildTx`
|
|
9
|
-
* @param signature - user signature after signing the transaction
|
|
10
|
-
* @returns `SwapResponse`
|
|
11
|
-
*/
|
|
12
|
-
export declare const executeBluefinTx: (tx: BluefinXTx, signature: string) => Promise<SwapResponse>;
|
|
13
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/libs/protocols/bluefinx/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,cAAc,EACd,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAiBjB,eAAO,MAAM,eAAe,GAAU,MAAM,cAAc,6BAEzD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAU,IAAI,UAAU,EAAE,WAAW,MAAM,0BAMvE,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@mysten/sui/transactions";
|
|
2
|
-
import { BaseContract } from "../base";
|
|
3
|
-
export type BluefinXExtra = {
|
|
4
|
-
quoteId: string;
|
|
5
|
-
signature: string;
|
|
6
|
-
taker: string;
|
|
7
|
-
vault: string;
|
|
8
|
-
quoteExpiresAtUtcMillis: number;
|
|
9
|
-
createdAtUtcMillis: number;
|
|
10
|
-
};
|
|
11
|
-
export declare class BluefinXContract extends BaseContract {
|
|
12
|
-
swap(tx: Transaction): Promise<{
|
|
13
|
-
$kind: "NestedResult";
|
|
14
|
-
NestedResult: [number, number];
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|