@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"okx.d.ts","sourceRoot":"","sources":["../../../../../../src/features/metaAg/providers/okx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAc/C,OAAO,EACL,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,gBAAgB,EAChB,qBAAqB,EAErB,kBAAkB,EAClB,aAAa,EACb,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAQ/D,qBAAa,WAAY,YAAW,aAAa,EAAE,eAAe;IAG9D,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,QAAQ,CAAC,IAAI,iBAAiB;gBAEX,OAAO,EAAE,kBAAkB,EAC3B,WAAW,EAAE,QAAQ,CAAC,aAAa,CAAC,EACpC,MAAM,EAAE,SAAS;IAG9B,KAAK,CAAC,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,MAAM,GACP,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAoCzC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CA4B9D;AAmHD,eAAO,MAAM,eAAe,GAC1B,CAAC,SAAS,SAAS,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAC,GAAG,CAAA;CAAE,EAEjD,OAAO,CAAC,EACR,WAAW,cAAc,EACzB,YAAY,qBAAqB,EACjC,aAAa,QAAQ,CAAC,aAAa,CAAC;;;;;EAoBrC,CAAC"}
|
|
@@ -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,41 +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
|
-
setApiKey: (key: string) => void;
|
|
15
|
-
getApiKey: () => string;
|
|
16
|
-
setBluefinXApiKey: (key: string) => void;
|
|
17
|
-
getBluefinXApiKey: () => string;
|
|
18
|
-
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
19
|
-
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
20
|
-
setPythClient: (client: import("@pythnetwork/pyth-sui-js").SuiPythClient) => void;
|
|
21
|
-
getPythClient: () => import("@pythnetwork/pyth-sui-js").SuiPythClient;
|
|
22
|
-
setPythConnection: (connection: import("@pythnetwork/pyth-sui-js").SuiPriceServiceConnection) => void;
|
|
23
|
-
getPythConnection: () => import("@pythnetwork/pyth-sui-js").SuiPriceServiceConnection;
|
|
24
|
-
};
|
|
25
|
-
getSuiClient: () => import("@mysten/sui/dist/cjs/client").SuiClient;
|
|
26
|
-
setSuiClient: (client: import("@mysten/sui/dist/cjs/client").SuiClient) => void;
|
|
27
7
|
getTokenPrice: typeof getTokenPrice;
|
|
28
8
|
getTokenPrices: typeof getTokenPrices;
|
|
29
9
|
getSuiPrice: typeof getSuiPrice;
|
|
30
|
-
getQuote: typeof getQuote;
|
|
31
|
-
estimateGasFee: typeof estimateGasFee;
|
|
32
|
-
buildTx: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: import("./types/tx").BuildTxParams) => Promise<import("./types/aggregator").BuildTxResult>;
|
|
33
|
-
buildTxV2: ({ quoteResponse, accountAddress, slippage, commission: __commission, devInspect, extendTx, isSponsored, }: import("./types/tx").BuildTxParams) => Promise<import("./types/aggregator").BuildTxResult>;
|
|
34
|
-
multiSwap: ({ sender, slippageBps, swaps, tx, commission, }: import("./types/tx").MultiSwapParams) => Promise<Record<string, import("@mysten/sui/dist/cjs/transactions").TransactionObjectArgument>>;
|
|
35
|
-
getSwapHistory: typeof getSwapHistory;
|
|
36
|
-
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>;
|
|
37
|
-
executeBluefinTx: (tx: import("./types/aggregator").BluefinXTx, signature: string) => Promise<import("./libs/protocols/bluefinx/types").SwapResponse>;
|
|
38
|
-
DEFAULT_SOURCES: import("./types/aggregator").SourceDex[];
|
|
39
10
|
placeLimitOrder: typeof placeLimitOrder;
|
|
40
11
|
getOpenLimitOrders: typeof getOpenLimitOrders;
|
|
41
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
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isSwapAPIProvider = exports.isAggregatorProvider = exports.EProvider = void 0;
|
|
4
4
|
var EProvider;
|
|
5
5
|
(function (EProvider) {
|
|
6
6
|
EProvider["BLUEFIN7K"] = "bluefin7k";
|
|
7
7
|
EProvider["CETUS"] = "cetus";
|
|
8
8
|
EProvider["FLOWX"] = "flowx";
|
|
9
|
+
EProvider["OKX"] = "okx";
|
|
9
10
|
})(EProvider || (exports.EProvider = EProvider = {}));
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
const isAggregatorProvider = (provider) => provider.kind === EProvider.BLUEFIN7K ||
|
|
12
|
+
provider.kind === EProvider.CETUS ||
|
|
13
|
+
provider.kind === EProvider.FLOWX;
|
|
14
|
+
exports.isAggregatorProvider = isAggregatorProvider;
|
|
15
|
+
const isSwapAPIProvider = (provider) => provider.kind === EProvider.OKX;
|
|
16
|
+
exports.isSwapAPIProvider = isSwapAPIProvider;
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import type { QuoteResponse, SourceDex } from "@bluefin-exchange/bluefin7k-aggregator-sdk";
|
|
1
2
|
import type { PreSwapLpChangeParams, RouterDataV3 } from "@cetusprotocol/aggregator-sdk";
|
|
2
3
|
import type { AggregatorQuoter, Protocol } from "@flowx-finance/sdk";
|
|
3
4
|
import type { GasCostSummary } from "@mysten/sui/client";
|
|
5
|
+
import { SignatureWithBytes } from "@mysten/sui/cryptography";
|
|
4
6
|
import type { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
5
|
-
import {
|
|
7
|
+
import { OkxSwapResponseData } from "./okx";
|
|
6
8
|
export declare enum EProvider {
|
|
7
9
|
BLUEFIN7K = "bluefin7k",
|
|
8
10
|
CETUS = "cetus",
|
|
9
|
-
FLOWX = "flowx"
|
|
11
|
+
FLOWX = "flowx",
|
|
12
|
+
OKX = "okx"
|
|
10
13
|
}
|
|
11
14
|
type ProviderBaseOptions = {
|
|
12
15
|
api?: string;
|
|
13
16
|
apiKey?: string;
|
|
14
17
|
disabled?: boolean;
|
|
15
18
|
};
|
|
16
|
-
export type
|
|
19
|
+
export type Bluefin7kProviderOptions = ProviderBaseOptions & {
|
|
17
20
|
sources?: SourceDex[];
|
|
18
|
-
maxPaths?: number;
|
|
19
21
|
excludedPools?: string[];
|
|
20
22
|
targetPools?: string[];
|
|
21
23
|
};
|
|
@@ -34,12 +36,19 @@ export type CetusProviderOptions = ProviderBaseOptions & {
|
|
|
34
36
|
depth?: number;
|
|
35
37
|
liquidityChanges?: PreSwapLpChangeParams[];
|
|
36
38
|
};
|
|
39
|
+
export type OkxProviderOptions = Required<Omit<ProviderBaseOptions, "api">> & {
|
|
40
|
+
api?: string;
|
|
41
|
+
secretKey: string;
|
|
42
|
+
apiPassphrase: string;
|
|
43
|
+
projectId: string;
|
|
44
|
+
};
|
|
37
45
|
export interface MetaAgOptions {
|
|
38
46
|
/**If not specified, all providers will be used */
|
|
39
47
|
providers?: {
|
|
40
|
-
[EProvider.BLUEFIN7K]?:
|
|
48
|
+
[EProvider.BLUEFIN7K]?: Bluefin7kProviderOptions;
|
|
41
49
|
[EProvider.FLOWX]?: FlowxProviderOptions;
|
|
42
50
|
[EProvider.CETUS]?: CetusProviderOptions;
|
|
51
|
+
[EProvider.OKX]?: OkxProviderOptions;
|
|
43
52
|
};
|
|
44
53
|
/**Mainnet Json Rpc url, if not specified, the default mainnet url will be used */
|
|
45
54
|
fullnodeUrl?: string;
|
|
@@ -57,9 +66,11 @@ export interface MetaAgOptions {
|
|
|
57
66
|
tipBps?: number;
|
|
58
67
|
}
|
|
59
68
|
export interface MetaQuoteOptions {
|
|
60
|
-
|
|
61
|
-
|
|
69
|
+
coinTypeIn: string;
|
|
70
|
+
coinTypeOut: string;
|
|
62
71
|
amountIn: string;
|
|
72
|
+
/** Required for api-tx providers (ie: Okx) */
|
|
73
|
+
signer?: string;
|
|
63
74
|
/**
|
|
64
75
|
* Timeout for quote operation in milliseconds
|
|
65
76
|
* @default 2000ms
|
|
@@ -76,7 +87,22 @@ export interface MetaSimulationOptions {
|
|
|
76
87
|
/** If specify, defer the simulation that could reduce the time to display quote result, you must update the quote via the id on callback
|
|
77
88
|
* else await all quote and simulation before return
|
|
78
89
|
*/
|
|
79
|
-
onSimulated?: (payload:
|
|
90
|
+
onSimulated?: (payload: MetaQuote) => void;
|
|
91
|
+
}
|
|
92
|
+
export interface MetaFastSwapOptions {
|
|
93
|
+
/** Quote object from the quote operation */
|
|
94
|
+
quote: MetaQuote;
|
|
95
|
+
/** Signer address (owner of `coinIn`) */
|
|
96
|
+
signer: string;
|
|
97
|
+
/** If true, use the gas coin for the swap
|
|
98
|
+
* @default true */
|
|
99
|
+
useGasCoin?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Sign the transaction bytes
|
|
102
|
+
* @param txBytes - base64 transaction bytes
|
|
103
|
+
* @returns - signature with bytes
|
|
104
|
+
*/
|
|
105
|
+
signTransaction: (txBytes: string) => Promise<SignatureWithBytes>;
|
|
80
106
|
}
|
|
81
107
|
export interface MetaSwapOptions {
|
|
82
108
|
/** Quote object from the quote operation */
|
|
@@ -100,6 +126,9 @@ export type MetaQuote = ({
|
|
|
100
126
|
} | {
|
|
101
127
|
provider: EProvider.FLOWX;
|
|
102
128
|
quote: FlowxQuoteResponse;
|
|
129
|
+
} | {
|
|
130
|
+
provider: EProvider.OKX;
|
|
131
|
+
quote: OkxSwapResponseData;
|
|
103
132
|
}) & {
|
|
104
133
|
/** uuid to keep track the quote result, used to apply simulation result on quote on callback `onSimulated`*/
|
|
105
134
|
id: string;
|
|
@@ -118,10 +147,19 @@ export type MetaQuote = ({
|
|
|
118
147
|
/** Estimate gas consumption if the transaction is executed */
|
|
119
148
|
gasUsed?: GasCostSummary;
|
|
120
149
|
};
|
|
121
|
-
export
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
150
|
+
export interface QuoteProvider {
|
|
151
|
+
readonly kind: EProvider;
|
|
152
|
+
quote(_quoteOptions: MetaQuoteOptions): Promise<MetaQuote | null>;
|
|
153
|
+
}
|
|
154
|
+
export interface SwapAPIProvider extends QuoteProvider {
|
|
155
|
+
readonly kind: EProvider.OKX;
|
|
156
|
+
fastSwap(options: MetaFastSwapOptions): Promise<string>;
|
|
157
|
+
}
|
|
158
|
+
export interface AggregatorProvider extends QuoteProvider {
|
|
159
|
+
readonly kind: EProvider.BLUEFIN7K | EProvider.CETUS | EProvider.FLOWX;
|
|
160
|
+
swap(options: MetaSwapOptions): Promise<TransactionObjectArgument>;
|
|
125
161
|
}
|
|
162
|
+
export declare const isAggregatorProvider: (provider: QuoteProvider) => provider is AggregatorProvider;
|
|
163
|
+
export declare const isSwapAPIProvider: (provider: QuoteProvider) => provider is SwapAPIProvider;
|
|
126
164
|
export {};
|
|
127
165
|
//# sourceMappingURL=metaAg.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metaAg.d.ts","sourceRoot":"","sources":["../../../../src/types/metaAg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAA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UAAU,aAAa,KACtB,QAAQ,IAAI,kBAGoB,CAAC;AAEpC,eAAO,MAAM,iBAAiB,GAC5B,UAAU,aAAa,KACtB,QAAQ,IAAI,eAAkD,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OKX DEX Swap API Types
|
|
3
|
+
* Documentation: https://web3.okx.com/vi/build/dev-docs/wallet-api/dex-swap
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Gas level options for swap transactions
|
|
7
|
+
*/
|
|
8
|
+
export type GasLevel = "average" | "fast" | "slow";
|
|
9
|
+
/**
|
|
10
|
+
* Swap mode options
|
|
11
|
+
*/
|
|
12
|
+
export type SwapMode = "exactIn" | "exactOut";
|
|
13
|
+
/**
|
|
14
|
+
* Swap API Request Parameters (v6)
|
|
15
|
+
*/
|
|
16
|
+
export interface OkxSwapRequest {
|
|
17
|
+
/** Unique identifier for the chain */
|
|
18
|
+
chainIndex?: string;
|
|
19
|
+
/** The input amount of a token to be sold (set in minimal divisible units, e.g., 1.00 USDT set as 1000000) */
|
|
20
|
+
amount: string;
|
|
21
|
+
/** Swap mode: "exactIn" or "exactOut" (default: "exactIn"). exactOut only supports Ethereum, Base, BSC, Arbitrum chains and Uni v3 protocols */
|
|
22
|
+
swapMode?: SwapMode;
|
|
23
|
+
/** The contract address of a token you want to send (e.g., 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee for native token) */
|
|
24
|
+
fromTokenAddress: string;
|
|
25
|
+
/** The contract address of a token you want to receive */
|
|
26
|
+
toTokenAddress: string;
|
|
27
|
+
/** Slippage limit. For EVM: 0-100. For Solana: 0-less than 100 (e.g., 0.5 means 0.5%) */
|
|
28
|
+
slippagePercent: string;
|
|
29
|
+
/** User's wallet address */
|
|
30
|
+
userWalletAddress: string;
|
|
31
|
+
/** Recipient address of a purchased token (if not set, userWalletAddress will receive the token) */
|
|
32
|
+
swapReceiverAddress?: string;
|
|
33
|
+
/** The percentage of fromTokenAmount sent to referrer. Min > 0, max 10 for Solana, 3 for all other chains. Maximum of nine decimal places */
|
|
34
|
+
feePercent?: string;
|
|
35
|
+
/** Wallet address to receive commission fee for fromToken. Must set feePercent together. Can only choose either fromToken or toToken commission per transaction */
|
|
36
|
+
fromTokenReferrerWalletAddress?: string;
|
|
37
|
+
/** Wallet address to receive commission fee for toToken. Must set feePercent together. Can only choose either fromToken or toToken commission per transaction */
|
|
38
|
+
toTokenReferrerWalletAddress?: string;
|
|
39
|
+
/** Positive slippage percentage (0-10, max 1 decimal point). Solana only, whitelist/enterprise clients only */
|
|
40
|
+
positiveSlippagePercent?: string;
|
|
41
|
+
/** Wallet address that receives positive slippage. Must set positiveSlippagePercent together. Solana only, whitelist/enterprise clients only */
|
|
42
|
+
positiveSlippageFeeAddress?: string;
|
|
43
|
+
/** The gas (in wei) for the swap transaction. EVM only. If too low, an error will be returned */
|
|
44
|
+
gasLimit?: string;
|
|
45
|
+
/** Target gas price level (defaults to "average"). EVM only */
|
|
46
|
+
gasLevel?: GasLevel;
|
|
47
|
+
/** Used for Solana transactions, similar to gasPrice on Ethereum. Determines transaction priority */
|
|
48
|
+
computeUnitPrice?: string;
|
|
49
|
+
/** Used for Solana transactions, similar to gasLimit on Ethereum. If tips is not 0, computeUnitPrice should be set to 0 */
|
|
50
|
+
computeUnitLimit?: string;
|
|
51
|
+
/** Jito tips in SOL. Maximum is "2", minimum is "0.0000000001". Used for MEV protection. Solana only */
|
|
52
|
+
tips?: string;
|
|
53
|
+
/** DexId of liquidity pool for limited quotes, multiple separated by comma (e.g., "1,50,180") */
|
|
54
|
+
dexIds?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Token information
|
|
58
|
+
*/
|
|
59
|
+
export interface OkxTokenInfo {
|
|
60
|
+
/** Token contract address */
|
|
61
|
+
tokenContractAddress: string;
|
|
62
|
+
/** Token symbol (e.g., "USDC") */
|
|
63
|
+
tokenSymbol: string;
|
|
64
|
+
/** Token unit price in USD (may be null for special cases) */
|
|
65
|
+
tokenUnitPrice: string | null;
|
|
66
|
+
/** Decimal number defining smallest unit */
|
|
67
|
+
decimal: string;
|
|
68
|
+
/** Whether the token is a honeypot token */
|
|
69
|
+
isHoneyPot: boolean;
|
|
70
|
+
/** Token tax rate (0-1, where 0.01 = 1%) */
|
|
71
|
+
taxRate: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* DEX Protocol information
|
|
75
|
+
*/
|
|
76
|
+
export interface OkxDexProtocol {
|
|
77
|
+
/** Name of the liquidity protocol (e.g., "Uniswap V3") */
|
|
78
|
+
dexName: string;
|
|
79
|
+
/** Percentage of assets handled by the protocol */
|
|
80
|
+
percent: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Sub-router information
|
|
84
|
+
*/
|
|
85
|
+
export interface OkxSubRouter {
|
|
86
|
+
/** Liquidity protocol used on the path */
|
|
87
|
+
dexProtocol: OkxDexProtocol;
|
|
88
|
+
/** Index of the from token */
|
|
89
|
+
fromTokenIndex: string;
|
|
90
|
+
/** Index of the to token */
|
|
91
|
+
toTokenIndex: string;
|
|
92
|
+
/** Information of token to be sold */
|
|
93
|
+
fromToken: OkxTokenInfo;
|
|
94
|
+
/** Information of token to be bought */
|
|
95
|
+
toToken: OkxTokenInfo;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Main router information (deprecated in v6, kept for backward compatibility)
|
|
99
|
+
* In v6, dexRouterList is an array of OkxSubRouter directly
|
|
100
|
+
*/
|
|
101
|
+
export interface OkxRouter {
|
|
102
|
+
/** One of the main paths for the token swap */
|
|
103
|
+
router: string;
|
|
104
|
+
/** Percentage of assets handled by the main path */
|
|
105
|
+
routerPercent: string;
|
|
106
|
+
/** Quote path sub data set */
|
|
107
|
+
subRouterList: OkxSubRouter[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Quote comparison information
|
|
111
|
+
*/
|
|
112
|
+
export interface OkxQuoteCompare {
|
|
113
|
+
/** DEX name of the quote route */
|
|
114
|
+
dexName: string;
|
|
115
|
+
/** DEX logo of the quote route */
|
|
116
|
+
dexLogo: string;
|
|
117
|
+
/** Estimated network fee (USD) of the quote route */
|
|
118
|
+
tradeFee: string;
|
|
119
|
+
/** Received amount of the quote route */
|
|
120
|
+
amountOut: string;
|
|
121
|
+
/** Price impact percentage */
|
|
122
|
+
priceImpactPercentage: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Transaction data model
|
|
126
|
+
*/
|
|
127
|
+
export interface OkxTransactionData {
|
|
128
|
+
/** Additional signing data (if required). When tips is specified, represents calldata of jito tips transfer */
|
|
129
|
+
signatureData?: string[];
|
|
130
|
+
/** User's wallet address */
|
|
131
|
+
from: string;
|
|
132
|
+
/** Estimated amount of the gas limit (increase by 50% for accurate data) */
|
|
133
|
+
gas: string;
|
|
134
|
+
/** Gas price in wei */
|
|
135
|
+
gasPrice?: string;
|
|
136
|
+
/** EIP-1559: Recommended priority cost of gas per unit */
|
|
137
|
+
maxPriorityFeePerGas?: string;
|
|
138
|
+
/** The contract address of OKX DEX router */
|
|
139
|
+
to: string;
|
|
140
|
+
/** The amount of native tokens (in wei) to be sent to the contract */
|
|
141
|
+
value: string;
|
|
142
|
+
/** The maximum amount of a token to spend when price reaches upper limit of slippage (applies to exactOut mode) */
|
|
143
|
+
maxSpendAmount?: string;
|
|
144
|
+
/** The minimum amount of a token to buy when price reaches upper limit of slippage */
|
|
145
|
+
minReceiveAmount: string;
|
|
146
|
+
/** Call data */
|
|
147
|
+
data: string;
|
|
148
|
+
/** Current transaction slippage value */
|
|
149
|
+
slippagePercent: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Router result data
|
|
153
|
+
*/
|
|
154
|
+
export interface OkxRouterResult {
|
|
155
|
+
/** Unique identifier for the chain */
|
|
156
|
+
chainIndex: string;
|
|
157
|
+
/** Context slot (for Solana) */
|
|
158
|
+
contextSlot?: number;
|
|
159
|
+
/** Quote path data set - array of sub-routers */
|
|
160
|
+
dexRouterList: OkxSubRouter[];
|
|
161
|
+
/** Estimated gas consumption in smallest units (e.g., wei) */
|
|
162
|
+
estimateGasFee: string;
|
|
163
|
+
/** Information of token to be sold */
|
|
164
|
+
fromToken: OkxTokenInfo;
|
|
165
|
+
/** The input amount of a token to be sold */
|
|
166
|
+
fromTokenAmount: string;
|
|
167
|
+
/** Price impact percentage = (Received value – Paid value) / Paid value. Can be positive if received value exceeds paid value */
|
|
168
|
+
priceImpactPercent: string;
|
|
169
|
+
/** Router identifier */
|
|
170
|
+
router: string;
|
|
171
|
+
/** Swap mode: "exactIn" or "exactOut" */
|
|
172
|
+
swapMode: SwapMode;
|
|
173
|
+
/** Information of token to be bought */
|
|
174
|
+
toToken: OkxTokenInfo;
|
|
175
|
+
/** The resulting amount of a token to be bought */
|
|
176
|
+
toTokenAmount: string;
|
|
177
|
+
/** Estimated network fee (USD) of the quote route */
|
|
178
|
+
tradeFee: string;
|
|
179
|
+
/** Comparison of quote routes */
|
|
180
|
+
quoteCompareList?: OkxQuoteCompare[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Swap API Response Data
|
|
184
|
+
*/
|
|
185
|
+
export interface OkxSwapResponseData {
|
|
186
|
+
/** Quote path data */
|
|
187
|
+
routerResult: OkxRouterResult;
|
|
188
|
+
/** Contract data model */
|
|
189
|
+
tx: OkxTransactionData;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* OKX API Standard Response Wrapper
|
|
193
|
+
*/
|
|
194
|
+
export interface OkxApiResponse<T> {
|
|
195
|
+
/** Response code ("0" indicates success) */
|
|
196
|
+
code: string;
|
|
197
|
+
/** Response data array */
|
|
198
|
+
data: T[];
|
|
199
|
+
/** Response message */
|
|
200
|
+
msg: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Complete Swap API Response
|
|
204
|
+
*/
|
|
205
|
+
export type OkxSwapResponse = OkxApi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IACjB,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,YAAY,EAAE,eAAe,CAAC;IAC9B,0BAA0B;IAC1B,EAAE,EAAE,kBAAkB,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,37 +1,7 @@
|
|
|
1
|
-
import { CoinStruct, SuiObjectResponseQuery } from "@mysten/sui/client";
|
|
2
1
|
import { Transaction, TransactionArgument } from "@mysten/sui/transactions";
|
|
3
|
-
type DataPage<T> = {
|
|
4
|
-
data: T[];
|
|
5
|
-
nextCursor?: any;
|
|
6
|
-
hasNextPage: boolean;
|
|
7
|
-
};
|
|
8
|
-
type PageQuery = {
|
|
9
|
-
cursor?: any;
|
|
10
|
-
limit?: number | null;
|
|
11
|
-
};
|
|
12
|
-
type PaginationArgs = "all" | PageQuery;
|
|
13
2
|
export declare const SuiUtils: {
|
|
14
3
|
getSuiCoin(amount: bigint | TransactionArgument, txb: Transaction): TransactionArgument;
|
|
15
|
-
mergeCoins(coinObjects: Array<string | TransactionArgument>, txb: Transaction): TransactionArgument | undefined;
|
|
16
4
|
getCoinValue(coinType: string, coinObject: string | TransactionArgument, txb: Transaction): TransactionArgument;
|
|
17
|
-
getExactCoinByAmount(coinType: string, coins: {
|
|
18
|
-
objectId: string;
|
|
19
|
-
balance: bigint;
|
|
20
|
-
}[], amount: bigint, txb: Transaction): {
|
|
21
|
-
$kind: "NestedResult";
|
|
22
|
-
NestedResult: [number, number];
|
|
23
|
-
};
|
|
24
|
-
mergeAllUserCoins(coinType: string, signerAddress: string): Promise<Transaction | undefined>;
|
|
25
|
-
mergeAllCoinsWithoutFetch(coins: CoinStruct[], coinType: string, txb: Transaction): void;
|
|
26
|
-
getAllUserCoins({ address, type }: {
|
|
27
|
-
type: string;
|
|
28
|
-
address: string;
|
|
29
|
-
}): Promise<CoinStruct[]>;
|
|
30
|
-
getCoinsGreaterThanAmount(amount: bigint, coins: {
|
|
31
|
-
objectId: string;
|
|
32
|
-
balance: bigint;
|
|
33
|
-
}[]): string[];
|
|
34
|
-
getOwnedObjectsByPage(owner: string, query: SuiObjectResponseQuery, paginationArgs?: PaginationArgs): Promise<DataPage<any>>;
|
|
35
5
|
isValidStructTag(value: string): boolean;
|
|
36
6
|
zeroBalance(tx: Transaction, coinType: string): {
|
|
37
7
|
$kind: "NestedResult";
|
|
@@ -53,5 +23,5 @@ export declare const SuiUtils: {
|
|
|
53
23
|
collectDust(tx: Transaction, coinType: string, coin: TransactionArgument): void;
|
|
54
24
|
transferOrDestroyZeroCoin(tx: Transaction, coinType: string, coin: TransactionArgument, address: string): void;
|
|
55
25
|
};
|
|
56
|
-
export
|
|
26
|
+
export declare const isSystemAddress: (address: string) => boolean;
|
|
57
27
|
//# sourceMappingURL=sui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/utils/sui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../../../src/utils/sui.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AA6B5E,eAAO,MAAM,QAAQ;uBAET,MAAM,GAAG,mBAAmB,OAC/B,WAAW,GACf,mBAAmB;2BAMV,MAAM,cACJ,MAAM,GAAG,mBAAmB,OACnC,WAAW,GACf,mBAAmB;4BAWE,MAAM;oBAQd,WAAW,YAAY,MAAM;;;;iBAQhC,WAAW,YAAY,MAAM;;;;wBASpC,WAAW,YACL,MAAM,cACJ,mBAAmB;;;;wBAU3B,WAAW,YACL,MAAM,WACP,mBAAmB;;;;2BAUxB,WAAW,YACL,MAAM,WACP,mBAAmB;oBASd,WAAW,YAAY,MAAM,QAAQ,mBAAmB;kCASlE,WAAW,YACL,MAAM,QACV,mBAAmB,WAChB,MAAM;CAQlB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,YAY9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculate expected return amount after applying slippage, commission, and tip
|
|
3
|
+
* @param returnAmount - The raw return amount (with decimals)
|
|
4
|
+
* @param slippageBps - Slippage in basis points (1 bps = 0.01%)
|
|
5
|
+
* @param commissionBps - Commission in basis points
|
|
6
|
+
* @param tipBps - Tip in basis points (default: 0)
|
|
7
|
+
* @returns Object containing tipAmount, minAmount, commissionAmount, and expectedAmount
|
|
8
|
+
*/
|
|
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
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../../../src/utils/swap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,MAAM,EACpB,aAAa,MAAM,EACnB,eAAe,MAAM,EACrB,SAAQ,MAAU;;;;;CA8BnB,CAAC"}
|