@7kprotocol/sdk-ts 3.6.0 → 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 +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 +3 -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 +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 +4 -147
- 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
package/README.md
CHANGED
|
@@ -29,8 +29,6 @@ Key features:
|
|
|
29
29
|
- **Limit Orders**: Place and manage limit orders for token swaps
|
|
30
30
|
- **DCA Orders**: Set up dollar-cost averaging strategies for automated
|
|
31
31
|
recurring purchases
|
|
32
|
-
- **BluefinX Integration**: Access RFQ-based trading with sponsored transactions
|
|
33
|
-
and MEV protection
|
|
34
32
|
- **Type Safety**: Full TypeScript support with comprehensive type definitions
|
|
35
33
|
- **Mainnet Support**: Production-ready SDK for Sui mainnet
|
|
36
34
|
- **Flexible Configuration**: Customize API keys, slippage, commissions, and
|
|
@@ -112,7 +110,7 @@ import SevenK from "@7kprotocol/sdk-ts";
|
|
|
112
110
|
or import specific functions as needed:
|
|
113
111
|
|
|
114
112
|
```typescript
|
|
115
|
-
import {
|
|
113
|
+
import { MetaAg, getTokenPrice } from "@7kprotocol/sdk-ts";
|
|
116
114
|
```
|
|
117
115
|
|
|
118
116
|
Note: this package only supports **mainnet**.
|
|
@@ -121,14 +119,6 @@ Note: this package only supports **mainnet**.
|
|
|
121
119
|
|
|
122
120
|
See [Meta Aggregator](docs/META_AG.md).
|
|
123
121
|
|
|
124
|
-
## Swap
|
|
125
|
-
|
|
126
|
-
See [Swap](docs/SWAP.md).
|
|
127
|
-
|
|
128
|
-
## BluefinX
|
|
129
|
-
|
|
130
|
-
See [BluefinX](docs/BLUEFINX.md).
|
|
131
|
-
|
|
132
122
|
## Limit Orders
|
|
133
123
|
|
|
134
124
|
See [Limit Orders](docs/LIMIT.md).
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchClient = fetchClient;
|
|
4
|
-
const index_1 = require("./index");
|
|
5
4
|
async function fetchClient(input, init) {
|
|
6
5
|
const headers = new Headers(init?.headers);
|
|
7
|
-
|
|
8
|
-
const bluefinXApiKey = (index_1.Config.getBluefinXApiKey() || "").trim();
|
|
9
|
-
if (apiKey) {
|
|
10
|
-
headers.set("apiKey", apiKey);
|
|
11
|
-
}
|
|
12
|
-
if (bluefinXApiKey) {
|
|
13
|
-
headers.set("Bluefin-X-API-Key", bluefinXApiKey);
|
|
14
|
-
}
|
|
6
|
+
// intercept the request and add the headers go here...
|
|
15
7
|
const modifiedInit = {
|
|
16
8
|
...init,
|
|
17
9
|
headers,
|
package/lib/cjs/constants/_7k.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// export const _7K_PACKAGE_ID =
|
|
3
|
+
// "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
4
|
+
// //legacy V4: "0xe8f996ea6ff38c557c253d3b93cfe2ebf393816487266786371aa4532a9229f2";
|
|
5
|
+
// //legacy V3: "0x7ea6e27ad7af6f3b8671d59df1aaebd7c03dddab893e52a714227b2f4fe91519";
|
|
6
|
+
// //legacy V2: "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
7
|
+
// //legacy V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
8
|
+
// export const _7K_CONFIG =
|
|
9
|
+
// "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
|
|
10
|
+
// //legacy v3: "0x0f8fc23dbcc9362b72c7a4c5aa53fcefa02ebfbb83a812c8c262ccd2c076d9ee";
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._7K_PARTNER_ADDRESS = exports._7K_META_CONFIG = exports._7K_META_VAULT = exports._7K_META_PACKAGE_ID = exports._7K_META_PUBLISHED_AT =
|
|
4
|
-
|
|
5
|
-
//
|
|
6
|
-
//legacy
|
|
7
|
-
//legacy V2: "0xa13447019cd982d6bef91cf7b46ad384a52583b1dfc2bdecf31ef0c4bd787a0f";
|
|
8
|
-
//legacy V1: "0xd48e7cdc9e92bec69ce3baa75578010458a0c5b2733d661a84971e8cef6806bc";
|
|
9
|
-
exports._7K_CONFIG = "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
|
|
10
|
-
//legacy v3: "0x0f8fc23dbcc9362b72c7a4c5aa53fcefa02ebfbb83a812c8c262ccd2c076d9ee";
|
|
11
|
-
exports._7K_VAULT = "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
|
|
12
|
-
//legacy v3: "0x39a3c55742c0e011b6f65548e73cf589e1ae5e82dbfab449ca57f24c3bcd9514";
|
|
12
|
+
exports._7K_PARTNER_ADDRESS = exports._7K_META_CONFIG = exports._7K_META_VAULT = exports._7K_META_PACKAGE_ID = exports._7K_META_PUBLISHED_AT = void 0;
|
|
13
|
+
// export const _7K_VAULT =
|
|
14
|
+
// "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
|
|
15
|
+
// //legacy v3: "0x39a3c55742c0e011b6f65548e73cf589e1ae5e82dbfab449ca57f24c3bcd9514";
|
|
13
16
|
exports._7K_META_PUBLISHED_AT = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
|
|
14
17
|
exports._7K_META_PACKAGE_ID = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
|
|
15
18
|
exports._7K_META_VAULT = "0x9a8abd32fe5721307ce3b697cf982ee84e9ffbd58d667a4a199f1683c1a3d23c";
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.timeout = exports.metaSettle = exports.simulateAggregator = exports.simulateSwapTx = void 0;
|
|
4
4
|
const transactions_1 = require("@mysten/sui/transactions");
|
|
5
5
|
const _7k_1 = require("../../constants/_7k");
|
|
6
|
-
const
|
|
6
|
+
const swap_1 = require("../../utils/swap");
|
|
7
7
|
const error_1 = require("./error");
|
|
8
8
|
const simulateSwapTx = async (tx, inspector, simulation) => {
|
|
9
9
|
const res = await (0, exports.timeout)(() => inspector.devInspectTransactionBlock({
|
|
@@ -52,7 +52,7 @@ exports.simulateAggregator = simulateAggregator;
|
|
|
52
52
|
*/
|
|
53
53
|
const metaSettle = (quote, coinOut, slippageBps = 100, tipBps = 0, partner, commissionBps = 0) => {
|
|
54
54
|
return (tx) => {
|
|
55
|
-
const { minAmount, expectedAmount } = (0,
|
|
55
|
+
const { minAmount, expectedAmount } = (0, swap_1.getExpectedReturn)(quote.rawAmountOut, slippageBps, commissionBps, tipBps);
|
|
56
56
|
if (tipBps > 0) {
|
|
57
57
|
tx.moveCall({
|
|
58
58
|
target: `${_7k_1._7K_META_PUBLISHED_AT}::vault::collect_tip`,
|
|
@@ -14,10 +14,6 @@ var MetaAgErrorCode;
|
|
|
14
14
|
MetaAgErrorCode[MetaAgErrorCode["SIMULATION_FAILED"] = 1008] = "SIMULATION_FAILED";
|
|
15
15
|
// OKX error
|
|
16
16
|
MetaAgErrorCode[MetaAgErrorCode["OKX_FINALIZE_COMMAND_NOT_FOUND"] = 1100] = "OKX_FINALIZE_COMMAND_NOT_FOUND";
|
|
17
|
-
// BluefinX error
|
|
18
|
-
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_NOT_FOUND"] = 1200] = "BLUEFINX_TRANSACTION_NOT_FOUND";
|
|
19
|
-
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_NOT_APPROVED"] = 1201] = "BLUEFINX_TRANSACTION_NOT_APPROVED";
|
|
20
|
-
MetaAgErrorCode[MetaAgErrorCode["BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND"] = 1202] = "BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND";
|
|
21
17
|
})(MetaAgErrorCode || (exports.MetaAgErrorCode = MetaAgErrorCode = {}));
|
|
22
18
|
class MetaAgError extends Error {
|
|
23
19
|
constructor(message, code, details) {
|
|
@@ -41,10 +41,9 @@ const sui_1 = require("../../constants/sui");
|
|
|
41
41
|
const metaAg_1 = require("../../types/metaAg");
|
|
42
42
|
const sui_2 = require("../../utils/sui");
|
|
43
43
|
const SuiClientUtils_1 = require("../../utils/SuiClientUtils");
|
|
44
|
-
const
|
|
44
|
+
const swap_1 = require("../../utils/swap");
|
|
45
45
|
const common_1 = require("./common");
|
|
46
46
|
const error_1 = require("./error");
|
|
47
|
-
const bluefin7kLegacy_1 = require("./providers/bluefin7kLegacy");
|
|
48
47
|
const okx_1 = require("./providers/okx");
|
|
49
48
|
const HERMES_API = "https://hermes.pyth.network";
|
|
50
49
|
const DEFAULT_PROVIDERS = {
|
|
@@ -76,9 +75,6 @@ class MetaAg {
|
|
|
76
75
|
const providerOptions = this.options.providers[provider];
|
|
77
76
|
error_1.MetaAgError.assert(!!providerOptions, `Provider not found: ${provider}`, error_1.MetaAgErrorCode.PROVIDER_NOT_FOUND, { provider });
|
|
78
77
|
switch (provider) {
|
|
79
|
-
case metaAg_1.EProvider.BLUEFIN7K_LEGACY:
|
|
80
|
-
this.providers[metaAg_1.EProvider.BLUEFIN7K_LEGACY] = new bluefin7kLegacy_1.BluefinLegacyProvider(providerOptions, this.options, this.client);
|
|
81
|
-
break;
|
|
82
78
|
case metaAg_1.EProvider.BLUEFIN7K:
|
|
83
79
|
const { Bluefin7kProvider } = await Promise.resolve().then(() => __importStar(require("./providers/bluefin7k"))).catch(catchImportError(metaAg_1.EProvider.BLUEFIN7K));
|
|
84
80
|
this.providers[metaAg_1.EProvider.BLUEFIN7K] = new Bluefin7kProvider(providerOptions, this.options, this.client);
|
|
@@ -120,7 +116,7 @@ class MetaAg {
|
|
|
120
116
|
const quote = await provider.quote(options);
|
|
121
117
|
if (!quote)
|
|
122
118
|
return null;
|
|
123
|
-
const { expectedAmount } = (0,
|
|
119
|
+
const { expectedAmount } = (0, swap_1.getExpectedReturn)(quote.rawAmountOut, 0, this.options.partnerCommissionBps, this.options.tipBps);
|
|
124
120
|
quote.amountOut = expectedAmount;
|
|
125
121
|
return quote;
|
|
126
122
|
}, options.timeout ?? 2000, `quote for ${provider.kind} provider from ${options.coinTypeIn} to ${options.coinTypeOut}`);
|
|
@@ -189,7 +185,7 @@ class MetaAg {
|
|
|
189
185
|
/**
|
|
190
186
|
* Build transaction from quote
|
|
191
187
|
* @info Use this function to build composable transaction (ie: add more commands after the swap, consume the coin out object)
|
|
192
|
-
* @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie:
|
|
188
|
+
* @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie: Okx, ...) are not supported, please use `fastSwap` instead
|
|
193
189
|
* @param options - build tx options
|
|
194
190
|
* @param slippageBps - slippage bps if not specified, fallback to global slippage bps, if none of them specified, default to 100
|
|
195
191
|
* @returns coin out object, you must consume it by transferObjects, or other sub sequence commands
|
|
@@ -263,7 +259,6 @@ const catchImportError = (provider) => {
|
|
|
263
259
|
const map = {
|
|
264
260
|
[metaAg_1.EProvider.CETUS]: "@cetusprotocol/aggregator-sdk",
|
|
265
261
|
[metaAg_1.EProvider.FLOWX]: "@flowx-finance/sdk",
|
|
266
|
-
[metaAg_1.EProvider.BLUEFIN7K_LEGACY]: "@7kprotocol/sdk-ts",
|
|
267
262
|
[metaAg_1.EProvider.BLUEFIN7K]: "@bluefin-exchange/bluefin7k-aggregator-sdk",
|
|
268
263
|
[metaAg_1.EProvider.OKX]: "",
|
|
269
264
|
};
|
|
@@ -7,16 +7,6 @@ const fetchClient_1 = require("../../config/fetchClient");
|
|
|
7
7
|
const apiEndpoints_1 = require("../../constants/apiEndpoints");
|
|
8
8
|
const tokens_1 = require("../../constants/tokens");
|
|
9
9
|
const token_1 = require("../../utils/token");
|
|
10
|
-
async function getTokenPrice(id, vsCoin = tokens_1.NATIVE_USDC_TOKEN_TYPE) {
|
|
11
|
-
try {
|
|
12
|
-
const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.PRICES}/price?ids=${(0, token_1.normalizeTokenType)(id)}&vsCoin=${vsCoin}`);
|
|
13
|
-
const pricesRes = (await response.json());
|
|
14
|
-
return Number(pricesRes?.[id]?.price || 0);
|
|
15
|
-
}
|
|
16
|
-
catch (_) {
|
|
17
|
-
return 0;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
10
|
const chunkArray = (array, chunkSize) => {
|
|
21
11
|
const chunks = [];
|
|
22
12
|
for (let i = 0; i < array.length; i += chunkSize) {
|
|
@@ -26,30 +16,66 @@ const chunkArray = (array, chunkSize) => {
|
|
|
26
16
|
};
|
|
27
17
|
const MAX_TOTAL_IDS = 500;
|
|
28
18
|
const MAX_IDS_PER_REQUEST = 100;
|
|
29
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Get the current Unix timestamp as a string
|
|
21
|
+
*/
|
|
22
|
+
function getCurrentTimestamp() {
|
|
23
|
+
return Math.floor(Date.now() / 1000).toString();
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get price for a single token
|
|
27
|
+
* @param id - Token ID (coin type)
|
|
28
|
+
* @returns Token price, or 0 if not found or on error
|
|
29
|
+
*/
|
|
30
|
+
async function getTokenPrice(id) {
|
|
31
|
+
try {
|
|
32
|
+
const normalizedId = (0, token_1.normalizeTokenType)(id);
|
|
33
|
+
const prices = await getTokenPrices([normalizedId]);
|
|
34
|
+
return prices[normalizedId] || 0;
|
|
35
|
+
}
|
|
36
|
+
catch (_) {
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get prices for multiple tokens
|
|
42
|
+
* @param ids - Array of token IDs (coin types)
|
|
43
|
+
* @returns Record mapping token IDs to their prices
|
|
44
|
+
*/
|
|
45
|
+
async function getTokenPrices(ids) {
|
|
30
46
|
try {
|
|
47
|
+
if (ids.length === 0) {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
31
50
|
const limitedIds = ids.slice(0, MAX_TOTAL_IDS).map(token_1.normalizeTokenType);
|
|
32
51
|
const idChunks = chunkArray(limitedIds, MAX_IDS_PER_REQUEST);
|
|
52
|
+
const timestamp = getCurrentTimestamp();
|
|
33
53
|
const responses = await Promise.all(idChunks.map(async (chunk) => {
|
|
34
|
-
const
|
|
54
|
+
const requestBody = {
|
|
55
|
+
timestamp,
|
|
56
|
+
token_ids: chunk,
|
|
57
|
+
};
|
|
58
|
+
const response = await (0, fetchClient_1.fetchClient)(`${apiEndpoints_1.API_ENDPOINTS.PRICES}/prices/batch`, {
|
|
35
59
|
method: "POST",
|
|
36
60
|
headers: {
|
|
37
61
|
"Content-Type": "application/json",
|
|
38
62
|
},
|
|
39
|
-
body: JSON.stringify(
|
|
40
|
-
ids: chunk,
|
|
41
|
-
vsCoin,
|
|
42
|
-
}),
|
|
63
|
+
body: JSON.stringify(requestBody),
|
|
43
64
|
});
|
|
65
|
+
if (!response.ok) {
|
|
66
|
+
throw new Error(`Price API returned status ${response.status}`);
|
|
67
|
+
}
|
|
44
68
|
const pricesRes = (await response.json());
|
|
45
69
|
return pricesRes;
|
|
46
70
|
}));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
// Combine all responses into a single record
|
|
72
|
+
const combinedPrices = responses.reduce((acc, priceResponses) => {
|
|
73
|
+
priceResponses.forEach((priceResponse) => {
|
|
74
|
+
acc[priceResponse.token_id] = priceResponse.price;
|
|
50
75
|
});
|
|
51
76
|
return acc;
|
|
52
77
|
}, {});
|
|
78
|
+
// Ensure all requested IDs are in the result (set to 0 if not found)
|
|
53
79
|
const finalPrices = limitedIds.reduce((acc, id) => {
|
|
54
80
|
acc[id] = combinedPrices[id] || 0;
|
|
55
81
|
return acc;
|
|
@@ -57,12 +83,17 @@ async function getTokenPrices(ids, vsCoin = tokens_1.NATIVE_USDC_TOKEN_TYPE) {
|
|
|
57
83
|
return finalPrices;
|
|
58
84
|
}
|
|
59
85
|
catch (_) {
|
|
86
|
+
// On error, return 0 for all requested IDs
|
|
60
87
|
return ids.slice(0, MAX_TOTAL_IDS).reduce((acc, id) => {
|
|
61
|
-
acc[id] = 0;
|
|
88
|
+
acc[(0, token_1.normalizeTokenType)(id)] = 0;
|
|
62
89
|
return acc;
|
|
63
90
|
}, {});
|
|
64
91
|
}
|
|
65
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the current SUI token price
|
|
95
|
+
* @returns SUI price, or 0 if not found or on error
|
|
96
|
+
*/
|
|
66
97
|
async function getSuiPrice() {
|
|
67
98
|
return await getTokenPrice(tokens_1.SUI_FULL_TYPE);
|
|
68
99
|
}
|
package/lib/cjs/index.js
CHANGED
|
@@ -14,28 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
__exportStar(require("./types/aggregator"), exports);
|
|
17
|
+
exports.placeLimitOrder = exports.placeDcaOrder = exports.getTokenPrices = exports.getTokenPrice = exports.getSuiPrice = exports.getOpenLimitOrders = exports.getOpenDcaOrders = exports.getDcaOrderExecutions = exports.getClosedLimitOrders = exports.getClosedDcaOrders = exports.claimExpiredLimitOrder = exports.cancelLimitOrder = exports.cancelDcaOrder = exports.MetaAg = void 0;
|
|
19
18
|
__exportStar(require("./types/metaAg"), exports);
|
|
20
|
-
const config_1 = require("./config");
|
|
21
|
-
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return config_1.Config; } });
|
|
22
19
|
const metaAg_1 = require("./features/metaAg");
|
|
23
20
|
Object.defineProperty(exports, "MetaAg", { enumerable: true, get: function () { return metaAg_1.MetaAg; } });
|
|
24
21
|
const prices_1 = require("./features/prices");
|
|
25
22
|
Object.defineProperty(exports, "getSuiPrice", { enumerable: true, get: function () { return prices_1.getSuiPrice; } });
|
|
26
23
|
Object.defineProperty(exports, "getTokenPrice", { enumerable: true, get: function () { return prices_1.getTokenPrice; } });
|
|
27
24
|
Object.defineProperty(exports, "getTokenPrices", { enumerable: true, get: function () { return prices_1.getTokenPrices; } });
|
|
28
|
-
const client_1 = require("./libs/protocols/bluefinx/client");
|
|
29
|
-
Object.defineProperty(exports, "executeBluefinTx", { enumerable: true, get: function () { return client_1.executeBluefinTx; } });
|
|
30
|
-
const swap_1 = require("./features/swap");
|
|
31
|
-
Object.defineProperty(exports, "buildTx", { enumerable: true, get: function () { return swap_1.buildTx; } });
|
|
32
|
-
Object.defineProperty(exports, "buildTxV2", { enumerable: true, get: function () { return swap_1.buildTxV2; } });
|
|
33
|
-
Object.defineProperty(exports, "DEFAULT_SOURCES", { enumerable: true, get: function () { return swap_1.DEFAULT_SOURCES; } });
|
|
34
|
-
Object.defineProperty(exports, "estimateGasFee", { enumerable: true, get: function () { return swap_1.estimateGasFee; } });
|
|
35
|
-
Object.defineProperty(exports, "executeTx", { enumerable: true, get: function () { return swap_1.executeTx; } });
|
|
36
|
-
Object.defineProperty(exports, "getQuote", { enumerable: true, get: function () { return swap_1.getQuote; } });
|
|
37
|
-
Object.defineProperty(exports, "getSwapHistory", { enumerable: true, get: function () { return swap_1.getSwapHistory; } });
|
|
38
|
-
Object.defineProperty(exports, "multiSwap", { enumerable: true, get: function () { return swap_1.multiSwap; } });
|
|
39
25
|
const limitDca_1 = require("./features/limitDca");
|
|
40
26
|
Object.defineProperty(exports, "cancelDcaOrder", { enumerable: true, get: function () { return limitDca_1.cancelDcaOrder; } });
|
|
41
27
|
Object.defineProperty(exports, "cancelLimitOrder", { enumerable: true, get: function () { return limitDca_1.cancelLimitOrder; } });
|
|
@@ -47,31 +33,11 @@ Object.defineProperty(exports, "getOpenDcaOrders", { enumerable: true, get: func
|
|
|
47
33
|
Object.defineProperty(exports, "getOpenLimitOrders", { enumerable: true, get: function () { return limitDca_1.getOpenLimitOrders; } });
|
|
48
34
|
Object.defineProperty(exports, "placeDcaOrder", { enumerable: true, get: function () { return limitDca_1.placeDcaOrder; } });
|
|
49
35
|
Object.defineProperty(exports, "placeLimitOrder", { enumerable: true, get: function () { return limitDca_1.placeLimitOrder; } });
|
|
50
|
-
// avoid breaking changes
|
|
51
|
-
const getSuiClient = config_1.Config.getSuiClient;
|
|
52
|
-
exports.getSuiClient = getSuiClient;
|
|
53
|
-
const setSuiClient = config_1.Config.setSuiClient;
|
|
54
|
-
exports.setSuiClient = setSuiClient;
|
|
55
36
|
exports.default = {
|
|
56
|
-
// config
|
|
57
|
-
Config: config_1.Config,
|
|
58
|
-
// sui client
|
|
59
|
-
getSuiClient,
|
|
60
|
-
setSuiClient,
|
|
61
37
|
// prices
|
|
62
38
|
getTokenPrice: prices_1.getTokenPrice,
|
|
63
39
|
getTokenPrices: prices_1.getTokenPrices,
|
|
64
40
|
getSuiPrice: prices_1.getSuiPrice,
|
|
65
|
-
// swap
|
|
66
|
-
getQuote: swap_1.getQuote,
|
|
67
|
-
estimateGasFee: swap_1.estimateGasFee,
|
|
68
|
-
buildTx: swap_1.buildTx,
|
|
69
|
-
buildTxV2: swap_1.buildTxV2,
|
|
70
|
-
multiSwap: swap_1.multiSwap,
|
|
71
|
-
getSwapHistory: swap_1.getSwapHistory,
|
|
72
|
-
executeTx: swap_1.executeTx,
|
|
73
|
-
executeBluefinTx: client_1.executeBluefinTx,
|
|
74
|
-
DEFAULT_SOURCES: swap_1.DEFAULT_SOURCES,
|
|
75
41
|
// limit order
|
|
76
42
|
placeLimitOrder: limitDca_1.placeLimitOrder,
|
|
77
43
|
getOpenLimitOrders: limitDca_1.getOpenLimitOrders,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchClient.d.ts","sourceRoot":"","sources":["../../../../src/config/fetchClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchClient.d.ts","sourceRoot":"","sources":["../../../../src/config/fetchClient.ts"],"names":[],"mappings":"AAAA,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CAUnB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export declare const _7K_PACKAGE_ID = "0x62412b7268c35f3808336aee57a52836501f40b8ba5d936f8ad275e672befd04";
|
|
2
|
-
export declare const _7K_CONFIG = "0x47442a93f7727d188ba7cb71031170d1786af70013cb7ad5115f3fe877ff0c54";
|
|
3
|
-
export declare const _7K_VAULT = "0x442ad50389ed5cda6f7a6f5a7ae6361a4c05ef1d9fb2e54fbba5a268d690bfe6";
|
|
4
1
|
export declare const _7K_META_PUBLISHED_AT = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
|
|
5
2
|
export declare const _7K_META_PACKAGE_ID = "0x17c0b1f7a6ad73f51268f16b8c06c049eecc2f28a270cdd29c06e3d2dea23302";
|
|
6
3
|
export declare const _7K_META_VAULT = "0x9a8abd32fe5721307ce3b697cf982ee84e9ffbd58d667a4a199f1683c1a3d23c";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_7k.d.ts","sourceRoot":"","sources":["../../../../src/constants/_7k.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,qBAAqB,uEACoC,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC;AACvE,eAAO,MAAM,cAAc,uEAC2C,CAAC;AACvE,eAAO,MAAM,eAAe,uEAC0C,CAAC;AACvE,eAAO,MAAM,mBAAmB,uEACsC,CAAC"}
|
|
@@ -9,7 +9,7 @@ export declare const simulateAggregator: (provider: AggregatorProvider, quote: M
|
|
|
9
9
|
simulatedAmountOut: string;
|
|
10
10
|
gasUsed: import("@mysten/sui/client").GasCostSummary;
|
|
11
11
|
id: string;
|
|
12
|
-
provider: import("../../types/metaAg").EProvider.
|
|
12
|
+
provider: import("../../types/metaAg").EProvider.BLUEFIN7K | import("../../types/metaAg").EProvider.CETUS | import("../../types/metaAg").EProvider.FLOWX;
|
|
13
13
|
}>;
|
|
14
14
|
/**
|
|
15
15
|
* this settlement does not charge commission fee for partner, since all integrated aggregators already charge commission fee for partner
|
|
@@ -10,10 +10,7 @@ export declare enum MetaAgErrorCode {
|
|
|
10
10
|
INVALID_SIGNER_ADDRESS = 1006,
|
|
11
11
|
PROVIDER_NOT_SUPPORT_SWAP = 1007,
|
|
12
12
|
SIMULATION_FAILED = 1008,
|
|
13
|
-
OKX_FINALIZE_COMMAND_NOT_FOUND = 1100
|
|
14
|
-
BLUEFINX_TRANSACTION_NOT_FOUND = 1200,
|
|
15
|
-
BLUEFINX_TRANSACTION_NOT_APPROVED = 1201,
|
|
16
|
-
BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND = 1202
|
|
13
|
+
OKX_FINALIZE_COMMAND_NOT_FOUND = 1100
|
|
17
14
|
}
|
|
18
15
|
export type MetaAgErrorDetailsMap = {
|
|
19
16
|
[MetaAgErrorCode.UNKNOWN]: any;
|
|
@@ -46,9 +43,6 @@ export type MetaAgErrorDetailsMap = {
|
|
|
46
43
|
[MetaAgErrorCode.OKX_FINALIZE_COMMAND_NOT_FOUND]: {
|
|
47
44
|
packageId: string;
|
|
48
45
|
};
|
|
49
|
-
[MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_FOUND]: Record<string, never>;
|
|
50
|
-
[MetaAgErrorCode.BLUEFINX_TRANSACTION_NOT_APPROVED]: Record<string, never>;
|
|
51
|
-
[MetaAgErrorCode.BLUEFINX_TRANSACTION_DIGEST_NOT_FOUND]: Record<string, never>;
|
|
52
46
|
};
|
|
53
47
|
export type MetaAgErrorDetails<T extends MetaAgErrorCode> = T extends keyof MetaAgErrorDetailsMap ? MetaAgErrorDetailsMap[T] : never;
|
|
54
48
|
export declare class MetaAgError<T extends MetaAgErrorCode> extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5E,oBAAY,eAAe;IACzB,OAAO,OAAO;IACd,OAAO,OAAO;IACd,kBAAkB,OAAO;IACzB,sBAAsB,OAAO;IAC7B,aAAa,OAAO;IACpB,eAAe,OAAO;IACtB,sBAAsB,OAAO;IAC7B,yBAAyB,OAAO;IAChC,iBAAiB,OAAO;IAExB,8BAA8B,OAAO;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../src/features/met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AAA;KAAE,CAAC;IAE3E,CAAC,eAAe,CAAC,8BAA8B,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IACtD,CAAC,SAAS,MAAM,qBAAqB,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AAE3E,qBAAa,WAAW,CAAC,CAAC,SAAS,eAAe,CAAE,SAAQ,KAAK;IAC/D,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;gBACpB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAOtE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,eAAe,EACrC,SAAS,EAAE,GAAG,EACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,EACvB,IAAI,CAAC,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC9B,OAAO,CAAC,SAAS;CAKrB"}
|
|
@@ -21,7 +21,7 @@ export declare class MetaAg {
|
|
|
21
21
|
/**
|
|
22
22
|
* Build transaction from quote
|
|
23
23
|
* @info Use this function to build composable transaction (ie: add more commands after the swap, consume the coin out object)
|
|
24
|
-
* @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie:
|
|
24
|
+
* @warning Providers that build transaction on the fly (typically RFQ, Swap-API providers ie: Okx, ...) are not supported, please use `fastSwap` instead
|
|
25
25
|
* @param options - build tx options
|
|
26
26
|
* @param slippageBps - slippage bps if not specified, fallback to global slippage bps, if none of them specified, default to 100
|
|
27
27
|
* @returns coin out object, you must consume it by transferObjects, or other sub sequence commands
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EACzB,SAAS,EACT,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metaAg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,EACzB,SAAS,EACT,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAOL,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAgB5B,qBAAa,MAAM;IACjB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,SAAS,CAAiD;IAClE,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,OAAO,CAA0B;gBAC7B,OAAO,CAAC,EAAE,aAAa;YAkBrB,YAAY;YA0DZ,SAAS;YAoCT,MAAM;YAqBN,SAAS;IA2BvB;;;;;OAKG;IACG,KAAK,CACT,OAAO,EAAE,gBAAgB,EACzB,UAAU,CAAC,EAAE,qBAAqB,GACjC,OAAO,CAAC,SAAS,EAAE,CAAC;IAsCvB;;;;;;;OAOG;IACG,IAAI,CACR,OAAO,EAAE,eAAe,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,yBAAyB,CAAC;IAmCrC;;;;OAIG;IACG,QAAQ,CACZ,OAAO,EAAE,mBAAmB,EAC5B,yBAAyB,CAAC,EAAE,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GACpE,OAAO,CAAC,2BAA2B,CAAC;IAwBvC;;;OAGG;IACH,mBAAmB,CAAC,OAAO,EAAE,aAAa;CA4B3C"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Get price for a single token
|
|
3
|
+
* @param id - Token ID (coin type)
|
|
4
|
+
* @returns Token price, or 0 if not found or on error
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTokenPrice(id: string): Promise<number>;
|
|
7
|
+
/**
|
|
8
|
+
* Get prices for multiple tokens
|
|
9
|
+
* @param ids - Array of token IDs (coin types)
|
|
10
|
+
* @returns Record mapping token IDs to their prices
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTokenPrices(ids: string[]): Promise<Record<string, number>>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the current SUI token price
|
|
15
|
+
* @returns SUI price, or 0 if not found or on error
|
|
16
|
+
*/
|
|
3
17
|
export declare function getSuiPrice(): Promise<number>;
|
|
4
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/prices/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/prices/index.ts"],"names":[],"mappings":"AAwCA;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ/D;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EAAE,GACZ,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CA2DjC;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAEnD"}
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
export * from "./types/aggregator";
|
|
2
1
|
export * from "./types/metaAg";
|
|
3
|
-
import { Config } from "./config";
|
|
4
2
|
import { MetaAg } from "./features/metaAg";
|
|
5
3
|
import { getSuiPrice, getTokenPrice, getTokenPrices } from "./features/prices";
|
|
6
|
-
import { executeBluefinTx } from "./libs/protocols/bluefinx/client";
|
|
7
|
-
import { buildTx, buildTxV2, DEFAULT_SOURCES, estimateGasFee, executeTx, getQuote, getSwapHistory, multiSwap } from "./features/swap";
|
|
8
4
|
import { cancelDcaOrder, cancelLimitOrder, claimExpiredLimitOrder, getClosedDcaOrders, getClosedLimitOrders, getDcaOrderExecutions, getOpenDcaOrders, getOpenLimitOrders, placeDcaOrder, placeLimitOrder } from "./features/limitDca";
|
|
9
|
-
|
|
10
|
-
declare const setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
11
|
-
export { buildTx, buildTxV2, cancelDcaOrder, cancelLimitOrder, claimExpiredLimitOrder, Config, DEFAULT_SOURCES, estimateGasFee, executeBluefinTx, executeTx, getClosedDcaOrders, getClosedLimitOrders, getDcaOrderExecutions, getOpenDcaOrders, getOpenLimitOrders, getQuote, getSuiClient, getSuiPrice, getSwapHistory, getTokenPrice, getTokenPrices, MetaAg, multiSwap, placeDcaOrder, placeLimitOrder, setSuiClient, };
|
|
5
|
+
export { MetaAg, cancelDcaOrder, cancelLimitOrder, claimExpiredLimitOrder, getClosedDcaOrders, getClosedLimitOrders, getDcaOrderExecutions, getOpenDcaOrders, getOpenLimitOrders, getSuiPrice, getTokenPrice, getTokenPrices, placeDcaOrder, placeLimitOrder, };
|
|
12
6
|
declare const _default: {
|
|
13
|
-
Config: {
|
|
14
|
-
setApi: (url: string) => void;
|
|
15
|
-
getApi: () => string;
|
|
16
|
-
setApiKey: (key: string) => void;
|
|
17
|
-
getApiKey: () => string;
|
|
18
|
-
setBluefinXApiKey: (key: string) => void;
|
|
19
|
-
getBluefinXApiKey: () => string;
|
|
20
|
-
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
21
|
-
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
22
|
-
setPythClient: (client: import("@pythnetwork/pyth-sui-js").SuiPythClient) => void;
|
|
23
|
-
getPythClient: () => import("@pythnetwork/pyth-sui-js").SuiPythClient;
|
|
24
|
-
setPythConnection: (connection: import("@pythnetwork/pyth-sui-js").SuiPriceServiceConnection) => void;
|
|
25
|
-
getPythConnection: () => import("@pythnetwork/pyth-sui-js").SuiPriceServiceConnection;
|
|
26
|
-
};
|
|
27
|
-
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
28
|
-
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
29
7
|
getTokenPrice: typeof getTokenPrice;
|
|
30
8
|
getTokenPrices: typeof getTokenPrices;
|
|
31
9
|
getSuiPrice: typeof getSuiPrice;
|
|
32
|
-
getQuote: typeof getQuote;
|
|
33
|
-
estimateGasFee: typeof estimateGasFee;
|
|
34
|
-
buildTx: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: import("./types/tx").BuildTxParams) => Promise<import("./types/aggregator").BuildTxResult>;
|
|
35
|
-
buildTxV2: (params: import("./types/tx").BuildTxParams) => Promise<import("./types/aggregator").BuildTxResult>;
|
|
36
|
-
multiSwap: ({ sender, slippageBps, swaps, tx, commission, }: import("./types/tx").MultiSwapParams) => Promise<Record<string, import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>>;
|
|
37
|
-
getSwapHistory: typeof getSwapHistory;
|
|
38
|
-
executeTx: (tx: import("./types/aggregator").AggregatorTx, signature: string, signedTxBytes: string, options?: import("@mysten/sui/dist/cjs/client").SuiTransactionBlockResponseOptions) => Promise<import("@mysten/sui/dist/cjs/client").SuiTransactionBlockResponse>;
|
|
39
|
-
executeBluefinTx: (tx: import("./types/aggregator").BluefinXTx, signature: string) => Promise<import("./libs/protocols/bluefinx/types").SwapResponse>;
|
|
40
|
-
DEFAULT_SOURCES: import("./types/aggregator").SourceDex[];
|
|
41
10
|
placeLimitOrder: typeof placeLimitOrder;
|
|
42
11
|
getOpenLimitOrders: typeof getOpenLimitOrders;
|
|
43
12
|
cancelLimitOrder: typeof cancelLimitOrder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAElB,WAAW,EACX,aAAa,EACb,cAAc,EAEd,aAAa,EAEb,eAAe,GAChB,CAAC;;;;;;;;;;;;;;;;;AAEF,wBAsBE"}
|
package/lib/cjs/types/metaAg.js
CHANGED
|
@@ -3,14 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isSwapAPIProvider = exports.isAggregatorProvider = exports.EProvider = void 0;
|
|
4
4
|
var EProvider;
|
|
5
5
|
(function (EProvider) {
|
|
6
|
-
EProvider["BLUEFIN7K_LEGACY"] = "bluefin7k_legacy";
|
|
7
6
|
EProvider["BLUEFIN7K"] = "bluefin7k";
|
|
8
7
|
EProvider["CETUS"] = "cetus";
|
|
9
8
|
EProvider["FLOWX"] = "flowx";
|
|
10
9
|
EProvider["OKX"] = "okx";
|
|
11
10
|
})(EProvider || (exports.EProvider = EProvider = {}));
|
|
12
|
-
const isAggregatorProvider = (provider) => provider.kind === EProvider.
|
|
13
|
-
provider.kind === EProvider.BLUEFIN7K ||
|
|
11
|
+
const isAggregatorProvider = (provider) => provider.kind === EProvider.BLUEFIN7K ||
|
|
14
12
|
provider.kind === EProvider.CETUS ||
|
|
15
13
|
provider.kind === EProvider.FLOWX;
|
|
16
14
|
exports.isAggregatorProvider = isAggregatorProvider;
|
|
@@ -4,10 +4,8 @@ import type { AggregatorQuoter, Protocol } from "@flowx-finance/sdk";
|
|
|
4
4
|
import type { GasCostSummary } from "@mysten/sui/client";
|
|
5
5
|
import { SignatureWithBytes } from "@mysten/sui/cryptography";
|
|
6
6
|
import type { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
7
|
-
import { QuoteResponse as LegacyQuoteResponse, SourceDex as LegacySourceDex } from "./aggregator";
|
|
8
7
|
import { OkxSwapResponseData } from "./okx";
|
|
9
8
|
export declare enum EProvider {
|
|
10
|
-
BLUEFIN7K_LEGACY = "bluefin7k_legacy",
|
|
11
9
|
BLUEFIN7K = "bluefin7k",
|
|
12
10
|
CETUS = "cetus",
|
|
13
11
|
FLOWX = "flowx",
|
|
@@ -18,12 +16,6 @@ type ProviderBaseOptions = {
|
|
|
18
16
|
apiKey?: string;
|
|
19
17
|
disabled?: boolean;
|
|
20
18
|
};
|
|
21
|
-
export type BluefinLegacyProviderOptions = ProviderBaseOptions & {
|
|
22
|
-
sources?: LegacySourceDex[];
|
|
23
|
-
maxPaths?: number;
|
|
24
|
-
excludedPools?: string[];
|
|
25
|
-
targetPools?: string[];
|
|
26
|
-
};
|
|
27
19
|
export type Bluefin7kProviderOptions = ProviderBaseOptions & {
|
|
28
20
|
sources?: SourceDex[];
|
|
29
21
|
excludedPools?: string[];
|
|
@@ -53,7 +45,6 @@ export type OkxProviderOptions = Required<Omit<ProviderBaseOptions, "api">> & {
|
|
|
53
45
|
export interface MetaAgOptions {
|
|
54
46
|
/**If not specified, all providers will be used */
|
|
55
47
|
providers?: {
|
|
56
|
-
[EProvider.BLUEFIN7K_LEGACY]?: BluefinLegacyProviderOptions;
|
|
57
48
|
[EProvider.BLUEFIN7K]?: Bluefin7kProviderOptions;
|
|
58
49
|
[EProvider.FLOWX]?: FlowxProviderOptions;
|
|
59
50
|
[EProvider.CETUS]?: CetusProviderOptions;
|
|
@@ -78,7 +69,7 @@ export interface MetaQuoteOptions {
|
|
|
78
69
|
coinTypeIn: string;
|
|
79
70
|
coinTypeOut: string;
|
|
80
71
|
amountIn: string;
|
|
81
|
-
/** Required for
|
|
72
|
+
/** Required for api-tx providers (ie: Okx) */
|
|
82
73
|
signer?: string;
|
|
83
74
|
/**
|
|
84
75
|
* Timeout for quote operation in milliseconds
|
|
@@ -127,9 +118,6 @@ export interface MetaSwapOptions {
|
|
|
127
118
|
}
|
|
128
119
|
export type FlowxQuoteResponse = Awaited<ReturnType<AggregatorQuoter["getRoutes"]>>;
|
|
129
120
|
export type MetaQuote = ({
|
|
130
|
-
provider: EProvider.BLUEFIN7K_LEGACY;
|
|
131
|
-
quote: LegacyQuoteResponse;
|
|
132
|
-
} | {
|
|
133
121
|
provider: EProvider.BLUEFIN7K;
|
|
134
122
|
quote: QuoteResponse;
|
|
135
123
|
} | {
|
|
@@ -168,7 +156,7 @@ export interface SwapAPIProvider extends QuoteProvider {
|
|
|
168
156
|
fastSwap(options: MetaFastSwapOptions): Promise<string>;
|
|
169
157
|
}
|
|
170
158
|
export interface AggregatorProvider extends QuoteProvider {
|
|
171
|
-
readonly kind: EProvider.
|
|
159
|
+
readonly kind: EProvider.BLUEFIN7K | EProvider.CETUS | EProvider.FLOWX;
|
|
172
160
|
swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
|
|
173
161
|
}
|
|
174
162
|
export declare const isAggregatorProvider: (provider: QuoteProvider) => provider is AggregatorProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaAg.d.ts","sourceRoot":"","sources":["../../../../src/types/metaAg.ts"],"names":[],"mappings":"AAAA,OAAO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