four-flap-meme-sdk 2.2.19 → 3.0.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/dist/{shared/abis → abis}/common.d.ts +1 -1
- package/dist/{shared/abis → abis}/common.js +75 -91
- package/dist/abis/contracts/TaxToken.json +969 -0
- package/dist/abis/contracts/TokenManager2.json +136 -0
- package/dist/{shared/abis → abis/contracts}/index.d.ts +0 -1
- package/dist/{shared/abis → abis/contracts}/index.js +0 -2
- package/dist/abis/flap/index.d.ts +5 -0
- package/dist/abis/flap/index.js +5 -0
- package/dist/abis/flap/portal-eip7702.d.ts +4 -0
- package/dist/abis/flap/portal-eip7702.js +39 -0
- package/dist/abis/flap/portal-events.d.ts +6 -0
- package/dist/abis/flap/portal-events.js +17 -0
- package/dist/abis/flap/portal-merkle.d.ts +4 -0
- package/dist/abis/flap/portal-merkle.js +25 -0
- package/dist/abis/flap/portal.d.ts +6 -0
- package/dist/abis/flap/portal.js +37 -0
- package/dist/abis/flap/vault.d.ts +171 -0
- package/dist/abis/flap/vault.js +91 -0
- package/dist/abis/index.d.ts +6 -0
- package/dist/abis/index.js +9 -0
- package/dist/bundle/config-helpers.d.ts +37 -0
- package/dist/bundle/config-helpers.js +58 -0
- package/dist/bundle/errors.d.ts +50 -0
- package/dist/bundle/errors.js +38 -0
- package/dist/bundle/four-meme/approve-tokenmanager.d.ts +7 -0
- package/dist/bundle/four-meme/approve-tokenmanager.js +99 -0
- package/dist/bundle/four-meme/core-helpers.d.ts +8 -0
- package/dist/bundle/four-meme/core-helpers.js +41 -0
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/core.d.ts +1 -1
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/core.js +74 -150
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/pancake-proxy.d.ts +1 -1
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/pancake-proxy.js +85 -92
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/private.d.ts +1 -1
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/private.js +48 -59
- package/dist/bundle/four-meme/sign-context-helpers.d.ts +2 -0
- package/dist/bundle/four-meme/sign-context-helpers.js +2 -0
- package/dist/bundle/four-meme/swap-buy-first.d.ts +8 -0
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/swap-buy-first.js +56 -108
- package/dist/bundle/four-meme/swap-hop-helpers.d.ts +6 -0
- package/dist/bundle/four-meme/swap-hop-helpers.js +63 -0
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/swap-internal.js +4 -4
- package/dist/bundle/four-meme/swap-sign-helpers.d.ts +28 -0
- package/dist/bundle/four-meme/swap-sign-helpers.js +105 -0
- package/dist/bundle/four-meme/swap.d.ts +17 -0
- package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/swap.js +84 -345
- package/dist/{contracts/tm-bundle-merkle/swap-buy-first.d.ts → bundle/four-meme/types/buy-first.d.ts} +11 -18
- package/dist/bundle/four-meme/types/core-flow.d.ts +63 -0
- package/dist/bundle/four-meme/types/core-flow.js +1 -0
- package/dist/{contracts/tm-bundle-merkle/types.d.ts → bundle/four-meme/types/index.d.ts} +130 -6
- package/dist/bundle/four-meme/types/index.js +1 -0
- package/dist/bundle/four-meme/types/swap-internal.d.ts +19 -0
- package/dist/bundle/four-meme/types/swap-internal.js +1 -0
- package/dist/bundle/four-meme/types.d.ts +1 -0
- package/dist/bundle/four-meme/utils-disperse.d.ts +7 -0
- package/dist/bundle/four-meme/utils-disperse.js +396 -0
- package/dist/bundle/four-meme/utils-pairwise.d.ts +8 -0
- package/dist/bundle/four-meme/utils-pairwise.js +328 -0
- package/dist/bundle/four-meme/utils-sweep.d.ts +8 -0
- package/dist/bundle/four-meme/utils-sweep.js +744 -0
- package/dist/bundle/index.d.ts +8 -0
- package/dist/bundle/index.js +8 -0
- package/dist/bundle/internal.d.ts +16 -0
- package/dist/bundle/internal.js +160 -0
- package/dist/bundle/sign-context-helpers.d.ts +26 -0
- package/dist/bundle/sign-context-helpers.js +63 -0
- package/dist/{contracts/tm-bundle-merkle → bundle}/submit.d.ts +6 -27
- package/dist/{contracts/tm-bundle-merkle → bundle}/submit.js +116 -313
- package/dist/bundle/types/index.d.ts +8 -0
- package/dist/bundle/types/index.js +1 -0
- package/dist/bundle/types.d.ts +1 -0
- package/dist/bundle/types.js +1 -0
- package/dist/chains/bsc/constants.js +1 -1
- package/dist/chains/bsc/four/approve-tokenmanager.d.ts +1 -26
- package/dist/chains/bsc/four/approve-tokenmanager.js +1 -113
- package/dist/chains/bsc/four/config.d.ts +5 -67
- package/dist/chains/bsc/four/config.js +2 -114
- package/dist/chains/bsc/four/core.d.ts +1 -4
- package/dist/chains/bsc/four/core.js +1 -592
- package/dist/chains/bsc/four/index.d.ts +6 -6
- package/dist/chains/bsc/four/index.js +6 -6
- package/dist/chains/bsc/four/internal.d.ts +2 -46
- package/dist/chains/bsc/four/internal.js +2 -239
- package/dist/chains/bsc/four/pancake-proxy.d.ts +1 -28
- package/dist/chains/bsc/four/pancake-proxy.js +1 -687
- package/dist/chains/bsc/four/private.d.ts +1 -27
- package/dist/chains/bsc/four/private.js +1 -477
- package/dist/chains/bsc/four/submit.d.ts +2 -315
- package/dist/chains/bsc/four/submit.js +2 -752
- package/dist/chains/bsc/four/swap-buy-first.d.ts +2 -55
- package/dist/chains/bsc/four/swap-buy-first.js +2 -507
- package/dist/chains/bsc/four/swap-internal.d.ts +1 -3
- package/dist/chains/bsc/four/swap-internal.js +1 -18
- package/dist/chains/bsc/four/swap.d.ts +2 -144
- package/dist/chains/bsc/four/swap.js +2 -766
- package/dist/chains/bsc/four/types.d.ts +1 -476
- package/dist/chains/bsc/four/utils-disperse.d.ts +1 -0
- package/dist/chains/bsc/four/utils-disperse.js +1 -0
- package/dist/chains/bsc/four/utils-pairwise.d.ts +1 -0
- package/dist/chains/bsc/four/utils-pairwise.js +1 -0
- package/dist/chains/bsc/four/utils-sweep.d.ts +1 -0
- package/dist/chains/bsc/four/utils-sweep.js +1 -0
- package/dist/chains/bsc/four/utils.d.ts +5 -18
- package/dist/chains/bsc/four/utils.js +5 -1552
- package/dist/chains/bsc/iro.d.ts +5 -0
- package/dist/chains/bsc/iro.js +4 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +155 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +80 -0
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +1 -91
- package/dist/chains/bsc/pancake/bundle-buy-first.js +99 -214
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +241 -0
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +565 -0
- package/dist/chains/bsc/pancake/bundle-swap.d.ts +1 -79
- package/dist/chains/bsc/pancake/bundle-swap.js +114 -726
- package/dist/chains/bsc/pancake/index.d.ts +4 -2
- package/dist/chains/bsc/pancake/index.js +1 -3
- package/dist/chains/bsc/platforms/iro/constants.js +1 -1
- package/dist/chains/bsc/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/bsc/platforms/iro/factory.js +3 -1
- package/dist/chains/bsc/platforms/iro/index.d.ts +5 -5
- package/dist/chains/bsc/platforms/iro/index.js +3 -3
- package/dist/chains/bsc/platforms/iro/pool.js +31 -10
- package/dist/chains/bsc/platforms/iro/token.js +5 -2
- package/dist/chains/eni/batch-router/bundle-approve.js +4 -3
- package/dist/chains/eni/batch-router/transfer.js +57 -27
- package/dist/chains/eni/batch-router/utils.js +32 -6
- package/dist/chains/eni/bundler/sign.js +5 -6
- package/dist/chains/eni/bundler/submit.js +1 -4
- package/dist/chains/eni/constants.js +2 -2
- package/dist/chains/eni/flat-aliases.d.ts +10 -0
- package/dist/chains/eni/flat-aliases.js +8 -0
- package/dist/chains/eni/index.d.ts +2 -1
- package/dist/chains/eni/index.js +1 -0
- package/dist/chains/eni/platforms/daoaas/create.js +3 -3
- package/dist/chains/eni/platforms/daoaas/index.d.ts +3 -3
- package/dist/chains/eni/platforms/daoaas/index.js +3 -3
- package/dist/chains/eni/platforms/daoaas/meta.js +9 -6
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +29 -45
- package/dist/chains/eni/platforms/daoaas/portal.js +10 -6
- package/dist/chains/eni/platforms/dswap/liquidity.js +59 -27
- package/dist/chains/eni/platforms/fair-launch/constants.js +1 -1
- package/dist/chains/eni/platforms/fair-launch/index.d.ts +2 -2
- package/dist/chains/eni/platforms/fair-launch/index.js +1 -1
- package/dist/chains/eni/platforms/fair-launch/launcher.js +88 -47
- package/dist/chains/eni/platforms/fair-launch/pool.js +5 -2
- package/dist/chains/eni/platforms/fair-launch/presets.js +2 -2
- package/dist/chains/eni/platforms/iro/constants.d.ts +1 -1
- package/dist/chains/eni/platforms/iro/constants.js +2 -2
- package/dist/chains/eni/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/eni/platforms/iro/factory.js +3 -1
- package/dist/chains/eni/platforms/iro/index.d.ts +6 -6
- package/dist/chains/eni/platforms/iro/index.js +4 -4
- package/dist/chains/eni/platforms/iro/pool.js +90 -26
- package/dist/chains/eni/platforms/iro/token.js +108 -32
- package/dist/chains/eni/platforms/iro/whitelist.js +6 -18
- package/dist/chains/eni/submit.d.ts +43 -0
- package/dist/chains/eni/submit.js +287 -0
- package/dist/chains/index.d.ts +13 -0
- package/dist/chains/index.js +13 -0
- package/dist/chains/monad/constants.js +1 -1
- package/dist/chains/xlayer/constants.d.ts +5 -0
- package/dist/chains/xlayer/constants.js +1 -1
- package/dist/chains/xlayer/eip7702/bundle-approve.d.ts +2 -26
- package/dist/chains/xlayer/eip7702/bundle-approve.js +11 -21
- package/dist/chains/xlayer/eip7702/bundle-buy.d.ts +2 -6
- package/dist/chains/xlayer/eip7702/bundle-buy.js +13 -51
- package/dist/chains/xlayer/eip7702/bundle-create.js +104 -74
- package/dist/chains/xlayer/eip7702/bundle-sell.d.ts +2 -6
- package/dist/chains/xlayer/eip7702/bundle-sell.js +30 -112
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +3 -65
- package/dist/chains/xlayer/eip7702/bundle-swap.js +52 -246
- package/dist/chains/xlayer/eip7702/constants.d.ts +11 -26
- package/dist/chains/xlayer/eip7702/constants.js +15 -68
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +13 -0
- package/dist/chains/xlayer/eip7702/flat-aliases.js +10 -0
- package/dist/chains/xlayer/eip7702/index.d.ts +28 -46
- package/dist/chains/xlayer/eip7702/index.js +28 -81
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.d.ts +79 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.js +1 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.d.ts +2 -203
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.js +64 -308
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +26 -0
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +58 -0
- package/dist/chains/xlayer/eip7702/types.d.ts +88 -0
- package/dist/chains/xlayer/eip7702/utils.d.ts +0 -3
- package/dist/chains/xlayer/eip7702/utils.js +23 -28
- package/dist/chains/xlayer/eip7702/volume-helpers.d.ts +148 -0
- package/dist/chains/xlayer/eip7702/volume-helpers.js +48 -0
- package/dist/chains/xlayer/eip7702/volume.d.ts +6 -184
- package/dist/chains/xlayer/eip7702/volume.js +89 -164
- package/dist/chains/xlayer/eoa/constants.d.ts +1 -1
- package/dist/chains/xlayer/eoa/constants.js +2 -16
- package/dist/chains/xlayer/eoa/dex-helpers.d.ts +1 -1
- package/dist/chains/xlayer/eoa/dex-helpers.js +7 -37
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +126 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +228 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.d.ts +1 -95
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.js +66 -299
- package/dist/chains/xlayer/eoa/eoa-wash-volume.d.ts +1 -1
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +18 -23
- package/dist/chains/xlayer/eoa/index.d.ts +10 -6
- package/dist/chains/xlayer/eoa/index.js +8 -23
- package/dist/chains/xlayer/eoa/portal-ops.js +7 -2
- package/dist/chains/xlayer/eoa/router-manager.js +5 -4
- package/dist/chains/xlayer/eoa/types.d.ts +2 -2
- package/dist/chains/xlayer/eoa/types.js +1 -3
- package/dist/chains/xlayer/index.d.ts +3 -2
- package/dist/chains/xlayer/index.js +4 -7
- package/dist/core/amount/split-by-weight.d.ts +5 -0
- package/dist/core/amount/split-by-weight.js +35 -0
- package/dist/{shared → core}/clients/blockrazor.d.ts +4 -8
- package/dist/{shared → core}/clients/blockrazor.js +43 -35
- package/dist/{shared → core}/clients/club48.d.ts +2 -2
- package/dist/{shared → core}/clients/club48.js +36 -30
- package/dist/{shared → core}/clients/emitservice.js +2 -0
- package/dist/{shared → core}/clients/four.d.ts +21 -6
- package/dist/{shared → core}/clients/four.js +29 -24
- package/dist/core/clients/index.d.ts +8 -0
- package/dist/core/clients/index.js +8 -0
- package/dist/{shared → core}/clients/merkle.d.ts +4 -3
- package/dist/{shared → core}/clients/merkle.js +30 -47
- package/dist/{shared → core}/constants/addresses.d.ts +27 -1
- package/dist/{shared → core}/constants/addresses.js +39 -2
- package/dist/{shared → core}/constants/chains.d.ts +1 -1
- package/dist/{shared → core}/constants/chains.js +1 -1
- package/dist/{shared → core}/constants/gas.d.ts +1 -1
- package/dist/{shared → core}/constants/gas.js +2 -6
- package/dist/{shared → core}/constants/index.d.ts +5 -2
- package/dist/{shared → core}/constants/index.js +3 -2
- package/dist/core/constants/quote.d.ts +30 -0
- package/dist/core/constants/quote.js +37 -0
- package/dist/core/dex/v3-path.d.ts +6 -0
- package/dist/core/dex/v3-path.js +35 -0
- package/dist/core/erc20/decimals.d.ts +7 -0
- package/dist/core/erc20/decimals.js +24 -0
- package/dist/{utils → core}/erc20.d.ts +7 -89
- package/dist/{utils → core}/erc20.js +99 -130
- package/dist/core/foundation.d.ts +15 -0
- package/dist/core/foundation.js +14 -0
- package/dist/core/gas/bundle-gas.d.ts +49 -0
- package/dist/core/gas/bundle-gas.js +93 -0
- package/dist/core/gas/profit-hop.d.ts +20 -0
- package/dist/core/gas/profit-hop.js +72 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +5 -0
- package/dist/core/legacy-types/errors.d.ts +27 -0
- package/dist/core/legacy-types/errors.js +34 -0
- package/dist/core/nonce/nonce-manager.d.ts +19 -0
- package/dist/core/nonce/nonce-manager.js +217 -0
- package/dist/core/normalize-unknown.d.ts +9 -0
- package/dist/core/normalize-unknown.js +29 -0
- package/dist/core/sdk-logger.d.ts +13 -0
- package/dist/core/sdk-logger.js +12 -0
- package/dist/core/shared-abis/common.d.ts +4 -0
- package/dist/core/shared-abis/common.js +4 -0
- package/dist/core/shared-abis/index.d.ts +5 -0
- package/dist/core/shared-abis/index.js +5 -0
- package/dist/core/tx/build-request.d.ts +17 -0
- package/dist/core/tx/build-request.js +25 -0
- package/dist/core/tx/sign-batch.d.ts +5 -0
- package/dist/core/tx/sign-batch.js +26 -0
- package/dist/core/tx/wallet-sign-patch.d.ts +1 -0
- package/dist/core/tx/wallet-sign-patch.js +18 -0
- package/dist/core/types/airdrop-sweep.d.ts +79 -0
- package/dist/core/types/airdrop-sweep.js +1 -0
- package/dist/core/types/erc20.d.ts +65 -0
- package/dist/core/types/erc20.js +1 -0
- package/dist/core/types/holders-maker.d.ts +64 -0
- package/dist/core/types/holders-maker.js +1 -0
- package/dist/core/types/index.d.ts +7 -0
- package/dist/core/types/index.js +1 -0
- package/dist/{utils → core/types}/lp-inspect.d.ts +4 -52
- package/dist/core/types/lp-inspect.js +1 -0
- package/dist/core/types/multicall.d.ts +5 -0
- package/dist/core/types/multicall.js +1 -0
- package/dist/core/types/private-sale.d.ts +35 -0
- package/dist/core/types/private-sale.js +1 -0
- package/dist/core/types/quote-helpers.d.ts +17 -0
- package/dist/core/types/quote-helpers.js +1 -0
- package/dist/core/types-erc20.d.ts +1 -0
- package/dist/core/types-erc20.js +1 -0
- package/dist/core/wallet/generate.d.ts +5 -0
- package/dist/core/wallet/generate.js +8 -0
- package/dist/domains/dex/direct-router-helpers.d.ts +269 -0
- package/dist/domains/dex/direct-router-helpers.js +536 -0
- package/dist/domains/dex/direct-router.d.ts +28 -0
- package/dist/{dex → domains/dex}/direct-router.js +246 -674
- package/dist/domains/dex/types.d.ts +81 -0
- package/dist/domains/dex/types.js +1 -0
- package/dist/{shared → domains}/flap/abi.js +1 -1
- package/dist/{shared → domains}/flap/constants.d.ts +1 -2
- package/dist/{shared → domains}/flap/constants.js +3 -4
- package/dist/{shared → domains}/flap/curve.js +3 -0
- package/dist/{shared → domains}/flap/errors.d.ts +1 -4
- package/dist/{shared → domains}/flap/errors.js +20 -1
- package/dist/domains/flap/index.d.ts +7 -0
- package/dist/domains/flap/index.js +5 -0
- package/dist/{shared → domains}/flap/meta.d.ts +22 -18
- package/dist/{shared → domains}/flap/meta.js +32 -24
- package/dist/{shared/flap/index.d.ts → domains/flap/module.d.ts} +4 -5
- package/dist/{shared/flap/index.js → domains/flap/module.js} +4 -5
- package/dist/{shared → domains}/flap/permit.js +10 -3
- package/dist/{shared → domains}/flap/pinata.d.ts +22 -6
- package/dist/{shared → domains}/flap/pinata.js +21 -26
- package/dist/domains/flap/portal-bundle-merkle/config.d.ts +10 -0
- package/dist/domains/flap/portal-bundle-merkle/config.js +13 -0
- package/dist/domains/flap/portal-bundle-merkle/core-helpers.d.ts +32 -0
- package/dist/domains/flap/portal-bundle-merkle/core-helpers.js +83 -0
- package/dist/{shared → domains}/flap/portal-bundle-merkle/core.d.ts +0 -4
- package/dist/{shared → domains}/flap/portal-bundle-merkle/core.js +168 -175
- package/dist/{shared → domains}/flap/portal-bundle-merkle/create-to-dex.d.ts +17 -4
- package/dist/{shared → domains}/flap/portal-bundle-merkle/create-to-dex.js +97 -118
- package/dist/{shared → domains}/flap/portal-bundle-merkle/curve-to-dex.js +105 -123
- package/dist/domains/flap/portal-bundle-merkle/index.d.ts +18 -0
- package/dist/{shared → domains}/flap/portal-bundle-merkle/index.js +4 -7
- package/dist/{shared → domains}/flap/portal-bundle-merkle/pancake-proxy.js +73 -70
- package/dist/{shared → domains}/flap/portal-bundle-merkle/private.js +63 -116
- package/dist/domains/flap/portal-bundle-merkle/swap-batch.d.ts +8 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-batch.js +227 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +125 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-helpers.js +113 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first.d.ts +2 -0
- package/dist/{shared → domains}/flap/portal-bundle-merkle/swap-buy-first.js +69 -288
- package/dist/domains/flap/portal-bundle-merkle/swap-cross.d.ts +9 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-cross.js +139 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.d.ts +149 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.js +259 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-planning.d.ts +70 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-planning.js +182 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-quick-batch.d.ts +16 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-quick-batch.js +327 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-single.d.ts +2 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-single.js +184 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-types.d.ts +101 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-types.js +1 -0
- package/dist/domains/flap/portal-bundle-merkle/swap.d.ts +8 -0
- package/dist/domains/flap/portal-bundle-merkle/swap.js +7 -0
- package/dist/{shared → domains}/flap/portal-bundle-merkle/types.d.ts +88 -12
- package/dist/domains/flap/portal-bundle-merkle/types.js +1 -0
- package/dist/domains/flap/portal-bundle-merkle/utils.d.ts +10 -0
- package/dist/{shared → domains}/flap/portal-bundle-merkle/utils.js +145 -265
- package/dist/{shared → domains}/flap/portal-bundle.d.ts +2 -2
- package/dist/{shared → domains}/flap/portal-bundle.js +84 -79
- package/dist/domains/flap/portal-create-token.d.ts +81 -0
- package/dist/domains/flap/portal-create-token.js +255 -0
- package/dist/{shared → domains}/flap/portal.d.ts +1 -2
- package/dist/{shared → domains}/flap/portal.js +36 -28
- package/dist/{shared → domains}/flap/vanity.d.ts +6 -6
- package/dist/{shared → domains}/flap/vanity.js +15 -21
- package/dist/{shared → domains}/flap/vault.d.ts +25 -93
- package/dist/{shared → domains}/flap/vault.js +77 -127
- package/dist/{flows → domains/flows}/create.d.ts +2 -1
- package/dist/{flows → domains/flows}/create.js +8 -8
- package/dist/domains/flows/index.d.ts +9 -0
- package/dist/domains/flows/index.js +9 -0
- package/dist/{contracts → domains/four/contracts}/helper3.d.ts +20 -5
- package/dist/{contracts → domains/four/contracts}/helper3.js +56 -20
- package/dist/domains/four/contracts/tm-bundle-helpers.d.ts +88 -0
- package/dist/domains/four/contracts/tm-bundle-helpers.js +73 -0
- package/dist/{contracts → domains/four/contracts}/tm-bundle.d.ts +4 -52
- package/dist/{contracts → domains/four/contracts}/tm-bundle.js +122 -189
- package/dist/{contracts → domains/four/contracts}/tm.d.ts +10 -8
- package/dist/{contracts → domains/four/contracts}/tm.js +39 -35
- package/dist/{contracts → domains/four/contracts}/tm1.js +9 -4
- package/dist/{contracts → domains/four/contracts}/tm2.js +10 -5
- package/dist/domains/four/index.d.ts +7 -0
- package/dist/domains/four/index.js +7 -0
- package/dist/{shared → domains}/four/tax-token.d.ts +1 -1
- package/dist/{shared → domains}/four/tax-token.js +31 -10
- package/dist/domains/holders/holders-maker-helpers.d.ts +9 -0
- package/dist/domains/holders/holders-maker-helpers.js +9 -0
- package/dist/domains/holders/holders-maker.d.ts +18 -0
- package/dist/domains/holders/holders-maker.js +324 -0
- package/dist/domains/holders/index.d.ts +1 -0
- package/dist/domains/holders/index.js +1 -0
- package/dist/domains/holders/internal/addresses.d.ts +12 -0
- package/dist/domains/holders/internal/addresses.js +15 -0
- package/dist/domains/holders/internal/buy-tx.d.ts +44 -0
- package/dist/domains/holders/internal/buy-tx.js +278 -0
- package/dist/domains/holders/internal/constants.d.ts +6 -0
- package/dist/domains/holders/internal/constants.js +7 -0
- package/dist/domains/holders/internal/disperse.d.ts +18 -0
- package/dist/domains/holders/internal/disperse.js +90 -0
- package/dist/domains/holders/internal/routing.d.ts +4 -0
- package/dist/domains/holders/internal/routing.js +45 -0
- package/dist/domains/holders/internal/transfer-tx.d.ts +4 -0
- package/dist/domains/holders/internal/transfer-tx.js +67 -0
- package/dist/domains/holders/types.d.ts +1 -0
- package/dist/domains/holders/types.js +1 -0
- package/dist/domains/lp-inspect/index.d.ts +1 -0
- package/dist/domains/lp-inspect/index.js +1 -0
- package/dist/domains/lp-inspect/lp-inspect-helpers.d.ts +9 -0
- package/dist/domains/lp-inspect/lp-inspect-helpers.js +109 -0
- package/dist/domains/lp-inspect/lp-inspect.d.ts +40 -0
- package/dist/{utils → domains/lp-inspect}/lp-inspect.js +78 -293
- package/dist/domains/lp-inspect/types.d.ts +1 -0
- package/dist/domains/lp-inspect/types.js +1 -0
- package/dist/domains/merkle/index.d.ts +12 -0
- package/dist/domains/merkle/index.js +11 -0
- package/dist/domains/private-sale/index.d.ts +1 -0
- package/dist/domains/private-sale/index.js +1 -0
- package/dist/domains/private-sale/private-sale.d.ts +34 -0
- package/dist/{utils → domains/private-sale}/private-sale.js +5 -16
- package/dist/domains/private-sale/types.d.ts +1 -0
- package/dist/domains/private-sale/types.js +1 -0
- package/dist/domains/quote/index.d.ts +1 -0
- package/dist/domains/quote/index.js +1 -0
- package/dist/{utils → domains/quote}/quote-helpers.d.ts +4 -45
- package/dist/{utils → domains/quote}/quote-helpers.js +17 -74
- package/dist/domains/quote/types.d.ts +1 -0
- package/dist/domains/quote/types.js +1 -0
- package/dist/domains/vanity/index.d.ts +5 -0
- package/dist/domains/vanity/index.js +5 -0
- package/dist/exports/root-bundle-and-tooling.d.ts +27 -0
- package/dist/exports/root-bundle-and-tooling.js +30 -0
- package/dist/exports/root-eni-and-bsc-iro.d.ts +26 -0
- package/dist/exports/root-eni-and-bsc-iro.js +66 -0
- package/dist/exports/root-foundations.d.ts +35 -0
- package/dist/exports/root-foundations.js +70 -0
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +30 -0
- package/dist/exports/root-swap-dex-and-xlayer.js +78 -0
- package/dist/index.d.ts +17 -88
- package/dist/index.js +17 -218
- package/dist/utils/airdrop-sweep.d.ts +4 -76
- package/dist/utils/airdrop-sweep.js +42 -55
- package/dist/utils/bundle-helpers.d.ts +9 -243
- package/dist/utils/bundle-helpers.js +10 -584
- package/dist/utils/constants.d.ts +5 -61
- package/dist/utils/constants.js +5 -80
- package/dist/utils/contract-factory.d.ts +2 -4
- package/dist/utils/contract-factory.js +25 -18
- package/dist/utils/errors.d.ts +12 -1
- package/dist/utils/errors.js +60 -1
- package/dist/utils/hop-chains.d.ts +35 -0
- package/dist/utils/hop-chains.js +215 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/mpcExclusive.d.ts +2 -5
- package/dist/utils/mpcExclusive.js +4 -3
- package/dist/utils/provider-factory.d.ts +4 -0
- package/dist/utils/provider-factory.js +10 -0
- package/dist/utils/stealth-transfer.d.ts +2 -28
- package/dist/utils/stealth-transfer.js +41 -21
- package/dist/utils/swap-helpers.d.ts +2 -15
- package/dist/utils/swap-helpers.js +7 -12
- package/dist/utils/types/airdrop-sweep.d.ts +1 -0
- package/dist/utils/types/airdrop-sweep.js +1 -0
- package/dist/utils/types/contract-factory.d.ts +1 -0
- package/dist/utils/types/contract-factory.js +1 -0
- package/dist/utils/types/errors.d.ts +1 -0
- package/dist/utils/types/errors.js +1 -0
- package/dist/utils/types/hop-chains.d.ts +8 -0
- package/dist/utils/types/hop-chains.js +1 -0
- package/dist/utils/types/index.d.ts +13 -0
- package/dist/utils/types/index.js +1 -0
- package/dist/utils/types/mpc-exclusive.d.ts +5 -0
- package/dist/utils/types/mpc-exclusive.js +1 -0
- package/dist/utils/types/stealth-transfer.d.ts +44 -0
- package/dist/utils/types/stealth-transfer.js +1 -0
- package/dist/utils/types/wallet.d.ts +25 -0
- package/dist/utils/types/wallet.js +1 -0
- package/dist/utils/wallet.d.ts +4 -25
- package/dist/utils/wallet.js +27 -22
- package/package.json +96 -2
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.d.ts +0 -26
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.js +0 -113
- package/dist/contracts/tm-bundle-merkle/config.d.ts +0 -70
- package/dist/contracts/tm-bundle-merkle/config.js +0 -114
- package/dist/contracts/tm-bundle-merkle/index.d.ts +0 -15
- package/dist/contracts/tm-bundle-merkle/index.js +0 -29
- package/dist/contracts/tm-bundle-merkle/internal.d.ts +0 -48
- package/dist/contracts/tm-bundle-merkle/internal.js +0 -240
- package/dist/contracts/tm-bundle-merkle/swap.d.ts +0 -146
- package/dist/contracts/tm-bundle-merkle/utils.d.ts +0 -20
- package/dist/contracts/tm-bundle-merkle/utils.js +0 -1503
- package/dist/dex/direct-router.d.ts +0 -150
- package/dist/shared/abis/TaxToken.json +0 -105
- package/dist/shared/abis/TokenManager2.json +0 -60
- package/dist/shared/flap/graduated-dex.d.ts +0 -1
- package/dist/shared/flap/graduated-dex.js +0 -1
- package/dist/shared/flap/launch-v6.d.ts +0 -132
- package/dist/shared/flap/launch-v6.js +0 -137
- package/dist/shared/flap/portal-bundle-merkle/config.d.ts +0 -79
- package/dist/shared/flap/portal-bundle-merkle/config.js +0 -133
- package/dist/shared/flap/portal-bundle-merkle/index.d.ts +0 -14
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.d.ts +0 -65
- package/dist/shared/flap/portal-bundle-merkle/swap.d.ts +0 -201
- package/dist/shared/flap/portal-bundle-merkle/swap.js +0 -1359
- package/dist/shared/flap/portal-bundle-merkle/utils.d.ts +0 -89
- package/dist/shared/flap/portal-create-token.d.ts +0 -63
- package/dist/shared/flap/portal-create-token.js +0 -258
- package/dist/shared/four/index.d.ts +0 -7
- package/dist/shared/four/index.js +0 -22
- package/dist/shared/index.d.ts +0 -10
- package/dist/shared/index.js +0 -10
- package/dist/utils/holders-maker.d.ts +0 -154
- package/dist/utils/holders-maker.js +0 -945
- package/dist/utils/pcs-infinity-cl.d.ts +0 -65
- package/dist/utils/pcs-infinity-cl.js +0 -426
- package/dist/utils/private-sale.d.ts +0 -90
- /package/dist/{shared/abis → abis/contracts}/TokenManager.json +0 -0
- /package/dist/{shared/abis → abis/contracts}/TokenManagerHelper3.json +0 -0
- /package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/swap-internal.d.ts +0 -0
- /package/dist/{shared/flap/portal-bundle-merkle/types.js → bundle/four-meme/types/buy-first.js} +0 -0
- /package/dist/{contracts/tm-bundle-merkle → bundle/four-meme}/types.js +0 -0
- /package/dist/{shared → core}/clients/emitservice.d.ts +0 -0
- /package/dist/{shared → core}/constants/profit.d.ts +0 -0
- /package/dist/{shared → core}/constants/profit.js +0 -0
- /package/dist/{dex → domains/dex}/index.d.ts +0 -0
- /package/dist/{dex → domains/dex}/index.js +0 -0
- /package/dist/{shared → domains}/flap/abi.d.ts +0 -0
- /package/dist/{shared → domains}/flap/curve.d.ts +0 -0
- /package/dist/{shared → domains}/flap/ipfs.d.ts +0 -0
- /package/dist/{shared → domains}/flap/ipfs.js +0 -0
- /package/dist/{shared → domains}/flap/permit.d.ts +0 -0
- /package/dist/{shared → domains}/flap/portal-bundle-merkle/curve-to-dex.d.ts +0 -0
- /package/dist/{shared → domains}/flap/portal-bundle-merkle/pancake-proxy.d.ts +0 -0
- /package/dist/{shared → domains}/flap/portal-bundle-merkle/private.d.ts +0 -0
- /package/dist/{contracts → domains/four/contracts}/tm1.d.ts +0 -0
- /package/dist/{contracts → domains/four/contracts}/tm2.d.ts +0 -0
|
@@ -11,8 +11,9 @@
|
|
|
11
11
|
* 支持池子类型:V2, V3
|
|
12
12
|
*/
|
|
13
13
|
import { ethers, Wallet, Contract } from 'ethers';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { createXLayerProvider } from '../../../utils/provider-factory.js';
|
|
15
|
+
import { directV2BatchBuy, directV2BatchSell, directV3BatchBuy, directV3BatchSell, } from '../../../domains/dex/direct-router.js';
|
|
16
|
+
import { getProfitRecipient } from '../../../core/constants/index.js';
|
|
16
17
|
// ============================================================================
|
|
17
18
|
// 辅助函数
|
|
18
19
|
// ============================================================================
|
|
@@ -54,8 +55,8 @@ export async function signEoaWashBuyTransactions(params) {
|
|
|
54
55
|
throw new Error('[signEoaWashBuyTransactions] 私钥数量与买入金额数量不一致');
|
|
55
56
|
}
|
|
56
57
|
// 创建钱包
|
|
57
|
-
const provider =
|
|
58
|
-
const wallets = privateKeys.map(pk => new Wallet(pk, provider));
|
|
58
|
+
const provider = createXLayerProvider(config.rpcUrl);
|
|
59
|
+
const wallets = privateKeys.map((pk) => new Wallet(pk, provider));
|
|
59
60
|
let result;
|
|
60
61
|
if (poolType === 'V2') {
|
|
61
62
|
result = await directV2BatchBuy({
|
|
@@ -69,7 +70,7 @@ export async function signEoaWashBuyTransactions(params) {
|
|
|
69
70
|
config: {
|
|
70
71
|
...config,
|
|
71
72
|
skipProfit: true, // 买入时不刮取利润(卖出时刮取)
|
|
72
|
-
}
|
|
73
|
+
},
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
76
|
else {
|
|
@@ -86,10 +87,9 @@ export async function signEoaWashBuyTransactions(params) {
|
|
|
86
87
|
config: {
|
|
87
88
|
...config,
|
|
88
89
|
skipProfit: true, // 买入时不刮取利润(卖出时刮取)
|
|
89
|
-
}
|
|
90
|
+
},
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
|
-
console.log(`[signEoaWashBuyTransactions] 签名 ${result.signedTransactions.length} 笔买入交易`);
|
|
93
93
|
return {
|
|
94
94
|
signedTransactions: result.signedTransactions,
|
|
95
95
|
wallets,
|
|
@@ -107,35 +107,32 @@ export async function signEoaWashBuyTransactions(params) {
|
|
|
107
107
|
*/
|
|
108
108
|
export async function signEoaWashSellTransactions(params, wallets, tokenDecimals) {
|
|
109
109
|
const { tokenAddress, poolType, routerAddress, quoteToken, config } = params;
|
|
110
|
-
const provider =
|
|
110
|
+
const provider = createXLayerProvider(config.rpcUrl);
|
|
111
111
|
// 获取代币精度
|
|
112
|
-
const decimals = tokenDecimals ?? await getTokenDecimals(provider, tokenAddress);
|
|
113
|
-
console.log(`[signEoaWashSellTransactions] 代币精度: ${decimals}`);
|
|
112
|
+
const decimals = tokenDecimals ?? (await getTokenDecimals(provider, tokenAddress));
|
|
114
113
|
// 查询所有钱包的代币余额
|
|
115
|
-
const balancesWei = await Promise.all(wallets.map(w => getTokenBalance(provider, tokenAddress, w.address)));
|
|
114
|
+
const balancesWei = await Promise.all(wallets.map((w) => getTokenBalance(provider, tokenAddress, w.address)));
|
|
116
115
|
// 转换为格式化金额
|
|
117
|
-
const sellAmounts = balancesWei.map(balance => {
|
|
116
|
+
const sellAmounts = balancesWei.map((balance) => {
|
|
118
117
|
if (balance <= 0n)
|
|
119
118
|
return '0';
|
|
120
119
|
return ethers.formatUnits(balance, decimals);
|
|
121
120
|
});
|
|
122
|
-
console.log(`[signEoaWashSellTransactions] 钱包余额:`, sellAmounts);
|
|
123
121
|
// 过滤出有余额的钱包
|
|
124
122
|
const validIndices = sellAmounts
|
|
125
123
|
.map((amt, i) => ({ amt, i }))
|
|
126
124
|
.filter(({ amt }) => parseFloat(amt) > 0)
|
|
127
125
|
.map(({ i }) => i);
|
|
128
126
|
if (validIndices.length === 0) {
|
|
129
|
-
console.warn('[signEoaWashSellTransactions] 所有钱包余额为 0,无法卖出');
|
|
130
127
|
return {
|
|
131
128
|
signedTransactions: [],
|
|
132
129
|
profitHopWallets: [],
|
|
133
130
|
profitAmount: '0',
|
|
134
|
-
profitRecipient:
|
|
131
|
+
profitRecipient: getProfitRecipient(),
|
|
135
132
|
};
|
|
136
133
|
}
|
|
137
|
-
const validPrivateKeys = validIndices.map(i => wallets[i].privateKey);
|
|
138
|
-
const validSellAmounts = validIndices.map(i => sellAmounts[i]);
|
|
134
|
+
const validPrivateKeys = validIndices.map((i) => wallets[i].privateKey);
|
|
135
|
+
const validSellAmounts = validIndices.map((i) => sellAmounts[i]);
|
|
139
136
|
let result;
|
|
140
137
|
if (poolType === 'V2') {
|
|
141
138
|
result = await directV2BatchSell({
|
|
@@ -148,7 +145,7 @@ export async function signEoaWashSellTransactions(params, wallets, tokenDecimals
|
|
|
148
145
|
config: {
|
|
149
146
|
...config,
|
|
150
147
|
// ✅ 卖出时正常刮取利润(XLayer 不使用多跳,直接转账)
|
|
151
|
-
}
|
|
148
|
+
},
|
|
152
149
|
});
|
|
153
150
|
}
|
|
154
151
|
else {
|
|
@@ -164,15 +161,14 @@ export async function signEoaWashSellTransactions(params, wallets, tokenDecimals
|
|
|
164
161
|
config: {
|
|
165
162
|
...config,
|
|
166
163
|
// ✅ 卖出时正常刮取利润(XLayer 不使用多跳,直接转账)
|
|
167
|
-
}
|
|
164
|
+
},
|
|
168
165
|
});
|
|
169
166
|
}
|
|
170
|
-
console.log(`[signEoaWashSellTransactions] 签名 ${result.signedTransactions.length} 笔卖出交易(含利润)`);
|
|
171
167
|
return {
|
|
172
168
|
signedTransactions: result.signedTransactions,
|
|
173
169
|
profitHopWallets: result.profitHopWallets ?? [],
|
|
174
170
|
profitAmount: result.metadata?.profitAmount ?? '0',
|
|
175
|
-
profitRecipient: result.metadata?.profitRecipient ??
|
|
171
|
+
profitRecipient: result.metadata?.profitRecipient ?? getProfitRecipient(),
|
|
176
172
|
};
|
|
177
173
|
}
|
|
178
174
|
/**
|
|
@@ -190,13 +186,12 @@ export async function signEoaWashVolumeTransactions(params) {
|
|
|
190
186
|
// 第一步:签名买入交易
|
|
191
187
|
const buyResult = await signEoaWashBuyTransactions(params);
|
|
192
188
|
// 注意:这里的卖出签名是基于预估的,实际使用时应该在买入确认后重新签名
|
|
193
|
-
console.log(`[signEoaWashVolumeTransactions] ⚠️ 注意:卖出签名应在买入确认后根据实际余额重新生成`);
|
|
194
189
|
// 暂时返回空的卖出签名(实际使用时应该在买入确认后调用 signEoaWashSellTransactions)
|
|
195
190
|
return {
|
|
196
191
|
buySignedTransactions: buyResult.signedTransactions,
|
|
197
192
|
sellSignedTransactions: [], // 需要在买入确认后重新签名
|
|
198
193
|
profitHopWallets: [],
|
|
199
194
|
profitAmount: '0',
|
|
200
|
-
profitRecipient:
|
|
195
|
+
profitRecipient: getProfitRecipient(),
|
|
201
196
|
};
|
|
202
197
|
}
|
|
@@ -11,14 +11,18 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export * from './constants.js';
|
|
13
13
|
export * from './types.js';
|
|
14
|
+
import { createPortalQuery } from './portal-ops.js';
|
|
15
|
+
import { xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle } from './eoa-bundle-swap.js';
|
|
16
|
+
import { signEoaWashVolumeTransactions } from './eoa-wash-volume.js';
|
|
14
17
|
export { encodeBuyCall, encodeBuyCallV3, encodeSellCall, encodeApproveCall, encodeTransferCall, PortalQuery, createPortalQuery, applySlippage, formatOkb, parseOkb, formatTokenAmount, parseTokenAmount, type PortalQueryConfig, } from './portal-ops.js';
|
|
15
18
|
export { signEoaWashBuyTransactions, signEoaWashSellTransactions, signEoaWashVolumeTransactions, type EoaWashPoolType, type EoaWashVolumeParams, type EoaWashVolumeResult, } from './eoa-wash-volume.js';
|
|
16
|
-
export { xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle, type
|
|
19
|
+
export { xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle, type XLayerPureCrossSwapParams, type XLayerPureCrossSwapResult, } from './eoa-bundle-swap.js';
|
|
20
|
+
export type { XLayerEoaSwapConfig, XLayerQuickBatchSwapParams, XLayerQuickBatchSwapResult, XLayerCrossSwapParams, XLayerCrossSwapResult, UserType as XLayerUserType, RouteParams as XLayerRouteParams, V2RouteParams as XLayerV2RouteParams, V3SingleRouteParams as XLayerV3SingleRouteParams, V3MultiRouteParams as XLayerV3MultiRouteParams, } from './eoa-bundle-swap-helpers.js';
|
|
17
21
|
export declare const xlayer: {
|
|
18
|
-
createPortalQuery:
|
|
19
|
-
xlayerQuickBatchSwapMerkle:
|
|
20
|
-
xlayerCrossSwapMerkle:
|
|
21
|
-
xlayerPureCrossSwapMerkle:
|
|
22
|
-
signEoaWashVolumeTransactions:
|
|
22
|
+
createPortalQuery: typeof createPortalQuery;
|
|
23
|
+
xlayerQuickBatchSwapMerkle: typeof xlayerQuickBatchSwapMerkle;
|
|
24
|
+
xlayerCrossSwapMerkle: typeof xlayerCrossSwapMerkle;
|
|
25
|
+
xlayerPureCrossSwapMerkle: typeof xlayerPureCrossSwapMerkle;
|
|
26
|
+
signEoaWashVolumeTransactions: typeof signEoaWashVolumeTransactions;
|
|
23
27
|
};
|
|
24
28
|
export default xlayer;
|
|
@@ -17,6 +17,9 @@ export * from './constants.js';
|
|
|
17
17
|
// 类型
|
|
18
18
|
// ============================================================================
|
|
19
19
|
export * from './types.js';
|
|
20
|
+
import { createPortalQuery } from './portal-ops.js';
|
|
21
|
+
import { xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle } from './eoa-bundle-swap.js';
|
|
22
|
+
import { signEoaWashVolumeTransactions } from './eoa-wash-volume.js';
|
|
20
23
|
// ============================================================================
|
|
21
24
|
// Portal 操作
|
|
22
25
|
// ============================================================================
|
|
@@ -33,28 +36,10 @@ export { xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapM
|
|
|
33
36
|
// 便捷重导出
|
|
34
37
|
// ============================================================================
|
|
35
38
|
export const xlayer = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// EOA 换手
|
|
42
|
-
xlayerQuickBatchSwapMerkle: async (...args) => {
|
|
43
|
-
const { xlayerQuickBatchSwapMerkle } = await import('./eoa-bundle-swap.js');
|
|
44
|
-
return xlayerQuickBatchSwapMerkle(...args);
|
|
45
|
-
},
|
|
46
|
-
xlayerCrossSwapMerkle: async (...args) => {
|
|
47
|
-
const { xlayerCrossSwapMerkle } = await import('./eoa-bundle-swap.js');
|
|
48
|
-
return xlayerCrossSwapMerkle(...args);
|
|
49
|
-
},
|
|
50
|
-
xlayerPureCrossSwapMerkle: async (...args) => {
|
|
51
|
-
const { xlayerPureCrossSwapMerkle } = await import('./eoa-bundle-swap.js');
|
|
52
|
-
return xlayerPureCrossSwapMerkle(...args);
|
|
53
|
-
},
|
|
54
|
-
// EOA 刷量
|
|
55
|
-
signEoaWashVolumeTransactions: async (...args) => {
|
|
56
|
-
const { signEoaWashVolumeTransactions } = await import('./eoa-wash-volume.js');
|
|
57
|
-
return signEoaWashVolumeTransactions(...args);
|
|
58
|
-
},
|
|
39
|
+
createPortalQuery,
|
|
40
|
+
xlayerQuickBatchSwapMerkle,
|
|
41
|
+
xlayerCrossSwapMerkle,
|
|
42
|
+
xlayerPureCrossSwapMerkle,
|
|
43
|
+
signEoaWashVolumeTransactions,
|
|
59
44
|
};
|
|
60
45
|
export default xlayer;
|
|
@@ -165,6 +165,9 @@ export function encodeCreateCallV5(params) {
|
|
|
165
165
|
* - 代币状态
|
|
166
166
|
*/
|
|
167
167
|
export class PortalQuery {
|
|
168
|
+
provider;
|
|
169
|
+
portal;
|
|
170
|
+
portalAddress;
|
|
168
171
|
constructor(config = {}) {
|
|
169
172
|
const rpcUrl = config.rpcUrl ?? DEFAULT_RPC_URL;
|
|
170
173
|
const chainId = config.chainId ?? XLAYER_CHAIN_ID;
|
|
@@ -446,8 +449,10 @@ export function applySlippage(expectedOutput, slippageBps) {
|
|
|
446
449
|
*/
|
|
447
450
|
export function lpFeeProfileToV3Fee(profile) {
|
|
448
451
|
switch (profile) {
|
|
449
|
-
case 1:
|
|
450
|
-
|
|
452
|
+
case 1:
|
|
453
|
+
return 100; // 0.01%
|
|
454
|
+
case 2:
|
|
455
|
+
return 10000; // 1%
|
|
451
456
|
case 0:
|
|
452
457
|
default:
|
|
453
458
|
return 2500; // 0.25%
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* XLayer Router 管理器
|
|
3
3
|
* 统一管理 V2/V3 Router 地址和授权目标选择逻辑
|
|
4
4
|
*/
|
|
5
|
-
import { POTATOSWAP_V2_ROUTER, POTATOSWAP_V3_ROUTER, FLAP_PORTAL
|
|
5
|
+
import { POTATOSWAP_V2_ROUTER, POTATOSWAP_V3_ROUTER, FLAP_PORTAL } from './constants.js';
|
|
6
|
+
import { ADDRESSES } from '../../../core/constants/index.js';
|
|
6
7
|
/**
|
|
7
8
|
* ✅ 获取 Router 地址
|
|
8
9
|
* @param params.routerVersion - Router 版本(V2 或 V3)
|
|
@@ -16,7 +17,7 @@ export function getRouterAddress(params) {
|
|
|
16
17
|
return params.routerAddress;
|
|
17
18
|
// 2. 根据 dexKey 选择
|
|
18
19
|
if (params.dexKey === 'DYORSWAP') {
|
|
19
|
-
return
|
|
20
|
+
return ADDRESSES.XLAYER.DyorSwapRouter;
|
|
20
21
|
}
|
|
21
22
|
// 3. 根据 routerVersion 选择
|
|
22
23
|
const version = params.routerVersion ?? 'V2';
|
|
@@ -49,9 +50,9 @@ export function getApprovalTargetAddress(target) {
|
|
|
49
50
|
* @returns 目标信息数组
|
|
50
51
|
*/
|
|
51
52
|
export function getAllApprovalTargets(targets) {
|
|
52
|
-
return targets.map(target => ({
|
|
53
|
+
return targets.map((target) => ({
|
|
53
54
|
target,
|
|
54
|
-
address: getApprovalTargetAddress(target)
|
|
55
|
+
address: getApprovalTargetAddress(target),
|
|
55
56
|
}));
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
@@ -100,12 +100,12 @@ export interface XLayerConfig {
|
|
|
100
100
|
extractProfit?: boolean;
|
|
101
101
|
/**
|
|
102
102
|
* 利润比例(基点 bps,1 bps = 0.01%)
|
|
103
|
-
* -
|
|
103
|
+
* - 默认使用 `getProfitRateBps('normal')`
|
|
104
104
|
*/
|
|
105
105
|
profitBps?: number;
|
|
106
106
|
/**
|
|
107
107
|
* 利润接收地址
|
|
108
|
-
* -
|
|
108
|
+
* - 默认使用 `getProfitRecipient()`
|
|
109
109
|
*/
|
|
110
110
|
profitRecipient?: string;
|
|
111
111
|
/**
|
|
@@ -15,9 +15,7 @@
|
|
|
15
15
|
* - 对“可能不生成 op”的分支(例如 withdraw 返回 null),使用 peek + commit,避免提前消耗 nonce。
|
|
16
16
|
*/
|
|
17
17
|
export class AANonceMap {
|
|
18
|
-
|
|
19
|
-
this.nextBySenderLower = new Map();
|
|
20
|
-
}
|
|
18
|
+
nextBySenderLower = new Map();
|
|
21
19
|
init(sender, startNonce) {
|
|
22
20
|
const k = sender.toLowerCase();
|
|
23
21
|
const cur = this.nextBySenderLower.get(k);
|
|
@@ -10,5 +10,6 @@ export * as eoa from './eoa/index.js';
|
|
|
10
10
|
export * as eip7702 from './eip7702/index.js';
|
|
11
11
|
export { PortalQuery, createPortalQuery, xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle, signEoaWashBuyTransactions, signEoaWashSellTransactions, signEoaWashVolumeTransactions, } from './eoa/index.js';
|
|
12
12
|
export type { BundleSwapParams, BundleSwapSignParams, BundleSwapResult, BundleSwapSignResult, BundleBatchSwapParams, BundleBatchSwapSignParams, BundleBatchSwapResult, BundleBatchSwapSignResult, BuyFirstParams, BuyFirstResult, BuyParams, SellParams, } from './eoa/types.js';
|
|
13
|
-
export
|
|
14
|
-
export { default as xlayer } from './eoa/index.js';
|
|
13
|
+
export * from './eip7702/flat-aliases.js';
|
|
14
|
+
export { default as xlayer, default as XLayer } from './eoa/index.js';
|
|
15
|
+
export { lpFeeProfileToV3Fee } from './eoa/portal-ops.js';
|
|
@@ -22,12 +22,9 @@ xlayerQuickBatchSwapMerkle, xlayerCrossSwapMerkle, xlayerPureCrossSwapMerkle,
|
|
|
22
22
|
// EOA 刷量
|
|
23
23
|
signEoaWashBuyTransactions, signEoaWashSellTransactions, signEoaWashVolumeTransactions, } from './eoa/index.js';
|
|
24
24
|
// ============================================================================
|
|
25
|
-
// 快捷导出 - EIP-7702
|
|
25
|
+
// 快捷导出 - EIP-7702 模式(与包根 `xlayerEip7702*` 别名一致,见 flat-aliases)
|
|
26
26
|
// ============================================================================
|
|
27
|
-
export
|
|
28
|
-
// Bundle 操作
|
|
29
|
-
bundleBuy as xlayerEip7702BundleBuy, bundleSell as xlayerEip7702BundleSell, bundleSwap as xlayerEip7702BundleSwap, bundleApprove as xlayerEip7702BundleApprove, bundleCreateBuy as xlayerEip7702BundleCreate,
|
|
30
|
-
// 刷量
|
|
31
|
-
washVolume as xlayerEip7702WashVolume, bundleVolume as xlayerEip7702BundleVolume, } from './eip7702/index.js';
|
|
27
|
+
export * from './eip7702/flat-aliases.js';
|
|
32
28
|
// 导出旧模块的默认对象(向后兼容)
|
|
33
|
-
export { default as xlayer } from './eoa/index.js';
|
|
29
|
+
export { default as xlayer, default as XLayer } from './eoa/index.js';
|
|
30
|
+
export { lpFeeProfileToV3Fee } from './eoa/portal-ops.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function shuffle(arr) {
|
|
2
|
+
const a = arr.slice();
|
|
3
|
+
for (let i = a.length - 1; i > 0; i--) {
|
|
4
|
+
const j = Math.floor(Math.random() * (i + 1));
|
|
5
|
+
[a[i], a[j]] = [a[j], a[i]];
|
|
6
|
+
}
|
|
7
|
+
return a;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 将 bigint 金额按随机权重拆分为多份,末份取 remainder,保证总和精确。
|
|
11
|
+
* 权重范围 500_000–1_500_000(与 dex-helpers 一致),全程 bigint 运算。
|
|
12
|
+
*/
|
|
13
|
+
export function splitAmountByWeight(totalAmount, count) {
|
|
14
|
+
if (count <= 0)
|
|
15
|
+
throw new Error('拆分份数必须大于 0');
|
|
16
|
+
if (count === 1)
|
|
17
|
+
return [totalAmount];
|
|
18
|
+
if (totalAmount <= 0n)
|
|
19
|
+
return new Array(count).fill(0n);
|
|
20
|
+
const weights = [];
|
|
21
|
+
for (let i = 0; i < count; i++) {
|
|
22
|
+
const w = BigInt(500_000 + Math.floor(Math.random() * 1_000_000));
|
|
23
|
+
weights.push(w);
|
|
24
|
+
}
|
|
25
|
+
const totalWeight = weights.reduce((a, b) => a + b, 0n);
|
|
26
|
+
const amounts = [];
|
|
27
|
+
let allocated = 0n;
|
|
28
|
+
for (let i = 0; i < count - 1; i++) {
|
|
29
|
+
const amt = (totalAmount * weights[i]) / totalWeight;
|
|
30
|
+
amounts.push(amt);
|
|
31
|
+
allocated += amt;
|
|
32
|
+
}
|
|
33
|
+
amounts.push(totalAmount - allocated);
|
|
34
|
+
return shuffle(amounts);
|
|
35
|
+
}
|
|
@@ -26,20 +26,16 @@
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
import { JsonRpcProvider, Wallet, TransactionLike, ethers } from 'ethers';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* 向此地址转账 BNB 可提高 Bundle 优先级
|
|
32
|
-
* 来源: https://blockrazor.gitbook.io/blockrazor/bsc/block-builder/send-bundle
|
|
33
|
-
*/
|
|
34
|
-
export declare const BLOCKRAZOR_BUILDER_EOA = "0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20";
|
|
29
|
+
import { CHAINS } from '../constants/index.js';
|
|
30
|
+
export { BLOCKRAZOR_BUILDER_EOA } from '../constants/index.js';
|
|
35
31
|
/**
|
|
36
32
|
* BlockRazor 客户端配置
|
|
37
33
|
*/
|
|
38
34
|
export interface BlockRazorConfig {
|
|
39
35
|
/** API Key(可选,根据 Tier 等级需要) */
|
|
40
36
|
apiKey?: string;
|
|
41
|
-
/** 链 ID:
|
|
42
|
-
chainId:
|
|
37
|
+
/** 链 ID: BSC */
|
|
38
|
+
chainId: typeof CHAINS.BSC.chainId;
|
|
43
39
|
/** 自定义 RPC URL(可选) */
|
|
44
40
|
customRpcUrl?: string;
|
|
45
41
|
/** 自定义 Builder RPC URL(可选,用于发送 Bundle) */
|
|
@@ -26,16 +26,12 @@
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
import { JsonRpcProvider, Transaction, ethers } from 'ethers';
|
|
29
|
-
import { GAS_LIMITS } from '../constants/index.js';
|
|
29
|
+
import { GAS_LIMITS, CHAINS, BLOCKRAZOR_BUILDER_EOA } from '../constants/index.js';
|
|
30
|
+
import { getErrorMessageFromUnknown } from '../index.js';
|
|
31
|
+
export { BLOCKRAZOR_BUILDER_EOA } from '../constants/index.js';
|
|
30
32
|
// ============================================================================
|
|
31
33
|
// 常量
|
|
32
34
|
// ============================================================================
|
|
33
|
-
/**
|
|
34
|
-
* BlockRazor Builder EOA 地址
|
|
35
|
-
* 向此地址转账 BNB 可提高 Bundle 优先级
|
|
36
|
-
* 来源: https://blockrazor.gitbook.io/blockrazor/bsc/block-builder/send-bundle
|
|
37
|
-
*/
|
|
38
|
-
export const BLOCKRAZOR_BUILDER_EOA = '0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20';
|
|
39
35
|
/**
|
|
40
36
|
* BlockRazor BSC RPC 端点
|
|
41
37
|
* 来源: 测试文件 008_blockrazor_smoke_test.ts
|
|
@@ -55,9 +51,14 @@ const MIN_GAS_PRICE_GWEI = 0.05;
|
|
|
55
51
|
* BlockRazor 客户端
|
|
56
52
|
*/
|
|
57
53
|
export class BlockRazorClient {
|
|
54
|
+
provider;
|
|
55
|
+
chainId;
|
|
56
|
+
apiKey;
|
|
57
|
+
builderUrl;
|
|
58
|
+
// 区块号缓存
|
|
59
|
+
blockNumberCache = null;
|
|
60
|
+
static BLOCK_CACHE_TTL_MS = 1000; // 1秒缓存
|
|
58
61
|
constructor(config) {
|
|
59
|
-
// 区块号缓存
|
|
60
|
-
this.blockNumberCache = null;
|
|
61
62
|
this.chainId = config.chainId;
|
|
62
63
|
this.apiKey = config.apiKey;
|
|
63
64
|
// 普通 RPC(用于查询)
|
|
@@ -114,7 +115,7 @@ export class BlockRazorClient {
|
|
|
114
115
|
async buildIncentiveTransaction(params) {
|
|
115
116
|
const { wallet, amount, nonce, gasPrice } = params;
|
|
116
117
|
// 获取 nonce(使用 pending 确保包含待处理交易)
|
|
117
|
-
const txNonce = nonce ?? await this.provider.getTransactionCount(wallet.address, 'pending');
|
|
118
|
+
const txNonce = nonce ?? (await this.provider.getTransactionCount(wallet.address, 'pending'));
|
|
118
119
|
// 获取 gas price
|
|
119
120
|
let txGasPrice = gasPrice;
|
|
120
121
|
if (!txGasPrice) {
|
|
@@ -152,6 +153,7 @@ export class BlockRazorClient {
|
|
|
152
153
|
const gasPrice = tx.gasPrice || 0n;
|
|
153
154
|
const minGasPrice = ethers.parseUnits(String(MIN_GAS_PRICE_GWEI), 'gwei');
|
|
154
155
|
if (gasPrice < minGasPrice) {
|
|
156
|
+
throw new Error(`Transaction gas price (${ethers.formatUnits(gasPrice, 'gwei')} gwei) is below minimum (${MIN_GAS_PRICE_GWEI} gwei)`);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
catch {
|
|
@@ -183,7 +185,7 @@ export class BlockRazorClient {
|
|
|
183
185
|
jsonrpc: '2.0',
|
|
184
186
|
id: '1',
|
|
185
187
|
method: 'eth_sendBundle',
|
|
186
|
-
params: [bundleParams]
|
|
188
|
+
params: [bundleParams],
|
|
187
189
|
};
|
|
188
190
|
const headers = {
|
|
189
191
|
'Content-Type': 'application/json',
|
|
@@ -202,12 +204,23 @@ export class BlockRazorClient {
|
|
|
202
204
|
throw new Error(`HTTP ${response.status}: ${text}`);
|
|
203
205
|
}
|
|
204
206
|
const result = await response.json();
|
|
207
|
+
if (typeof result !== 'object' || result === null) {
|
|
208
|
+
throw new Error('Invalid JSON-RPC response');
|
|
209
|
+
}
|
|
210
|
+
const rpc = result;
|
|
205
211
|
// 检查 JSON-RPC 错误
|
|
206
|
-
if (
|
|
207
|
-
|
|
212
|
+
if (rpc.error != null) {
|
|
213
|
+
const er = rpc.error;
|
|
214
|
+
const rpcMsg = typeof er === 'object' &&
|
|
215
|
+
er !== null &&
|
|
216
|
+
'message' in er &&
|
|
217
|
+
typeof er.message === 'string'
|
|
218
|
+
? er.message
|
|
219
|
+
: JSON.stringify(er);
|
|
220
|
+
throw new Error(`RPC Error: ${rpcMsg}`);
|
|
208
221
|
}
|
|
209
222
|
// 提取 bundle hash
|
|
210
|
-
const bundleHash =
|
|
223
|
+
const bundleHash = rpc.result;
|
|
211
224
|
if (typeof bundleHash === 'string') {
|
|
212
225
|
return bundleHash;
|
|
213
226
|
}
|
|
@@ -216,10 +229,10 @@ export class BlockRazorClient {
|
|
|
216
229
|
return String(bundleHash.bundleHash);
|
|
217
230
|
}
|
|
218
231
|
}
|
|
219
|
-
return JSON.stringify(
|
|
232
|
+
return JSON.stringify(rpc.result ?? rpc);
|
|
220
233
|
}
|
|
221
234
|
catch (error) {
|
|
222
|
-
const errorMsg =
|
|
235
|
+
const errorMsg = getErrorMessageFromUnknown(error);
|
|
223
236
|
console.error(`❌ [BlockRazor] Bundle 发送失败: ${errorMsg}`);
|
|
224
237
|
throw new Error(`BlockRazor send bundle failed: ${errorMsg}`);
|
|
225
238
|
}
|
|
@@ -257,7 +270,7 @@ export class BlockRazorClient {
|
|
|
257
270
|
noMerge: options.noMerge,
|
|
258
271
|
});
|
|
259
272
|
// 提取交易哈希
|
|
260
|
-
const txHashes = options.transactions.map(rawTx => {
|
|
273
|
+
const txHashes = options.transactions.map((rawTx) => {
|
|
261
274
|
try {
|
|
262
275
|
return Transaction.from(rawTx).hash || '';
|
|
263
276
|
}
|
|
@@ -276,13 +289,16 @@ export class BlockRazorClient {
|
|
|
276
289
|
lastError = error;
|
|
277
290
|
if (autoRetry && attempt < maxRetries) {
|
|
278
291
|
attempt++;
|
|
279
|
-
await new Promise(resolve => setTimeout(resolve, 3000)); // 等待一个区块
|
|
292
|
+
await new Promise((resolve) => setTimeout(resolve, 3000)); // 等待一个区块
|
|
280
293
|
continue;
|
|
281
294
|
}
|
|
282
295
|
throw error;
|
|
283
296
|
}
|
|
284
297
|
}
|
|
285
|
-
|
|
298
|
+
if (lastError !== null && lastError !== undefined) {
|
|
299
|
+
throw lastError;
|
|
300
|
+
}
|
|
301
|
+
throw new Error('Bundle submission failed after all retries');
|
|
286
302
|
}
|
|
287
303
|
/**
|
|
288
304
|
* 发送带激励的 Bundle(自动添加激励交易)
|
|
@@ -330,8 +346,7 @@ export class BlockRazorClient {
|
|
|
330
346
|
let gasCost;
|
|
331
347
|
if (receipt.gasUsed && receipt.gasPrice) {
|
|
332
348
|
const costWei = receipt.gasUsed * receipt.gasPrice;
|
|
333
|
-
|
|
334
|
-
gasCost = costBnb.toFixed(8);
|
|
349
|
+
gasCost = ethers.formatEther(costWei);
|
|
335
350
|
}
|
|
336
351
|
return {
|
|
337
352
|
index,
|
|
@@ -348,7 +363,7 @@ export class BlockRazorClient {
|
|
|
348
363
|
index,
|
|
349
364
|
hash,
|
|
350
365
|
success: false,
|
|
351
|
-
error: error
|
|
366
|
+
error: getErrorMessageFromUnknown(error),
|
|
352
367
|
};
|
|
353
368
|
}
|
|
354
369
|
});
|
|
@@ -439,7 +454,7 @@ export class BlockRazorClient {
|
|
|
439
454
|
return { index: globalIndex, hash: txResponse.hash, error: null };
|
|
440
455
|
}
|
|
441
456
|
catch (err) {
|
|
442
|
-
const errorMsg =
|
|
457
|
+
const errorMsg = getErrorMessageFromUnknown(err);
|
|
443
458
|
console.warn(`[broadcastParallel] 交易 ${globalIndex} 广播失败:`, errorMsg);
|
|
444
459
|
return { index: globalIndex, hash: '', error: errorMsg };
|
|
445
460
|
}
|
|
@@ -488,33 +503,29 @@ export class BlockRazorClient {
|
|
|
488
503
|
// 广播交易
|
|
489
504
|
const txResponse = await provider.broadcastTransaction(rawTx);
|
|
490
505
|
txHashes.push(txResponse.hash);
|
|
491
|
-
console.log(`[broadcastSequential] 交易 ${i}/${signedTransactions.length} 广播成功: ${txResponse.hash.slice(0, 10)}...`);
|
|
492
506
|
// 如果需要等待确认
|
|
493
507
|
if (waitConfirmation) {
|
|
494
508
|
try {
|
|
495
509
|
const receipt = await provider.waitForTransaction(txResponse.hash, 1, confirmationTimeout);
|
|
496
|
-
if (receipt && receipt.status ===
|
|
497
|
-
console.log(`[broadcastSequential] 交易 ${i} 确认成功,区块: ${receipt.blockNumber}`);
|
|
498
|
-
}
|
|
499
|
-
else if (receipt && receipt.status === 0) {
|
|
510
|
+
if (receipt && receipt.status === 0) {
|
|
500
511
|
console.warn(`[broadcastSequential] 交易 ${i} 执行失败(revert)`);
|
|
501
512
|
errors.push({ index: i, error: 'Transaction reverted' });
|
|
502
513
|
}
|
|
503
514
|
}
|
|
504
515
|
catch (waitErr) {
|
|
505
|
-
console.warn(`[broadcastSequential] 交易 ${i} 等待确认超时:`, waitErr
|
|
516
|
+
console.warn(`[broadcastSequential] 交易 ${i} 等待确认超时:`, getErrorMessageFromUnknown(waitErr));
|
|
506
517
|
// 超时不算失败,交易可能还在 pending
|
|
507
518
|
}
|
|
508
519
|
}
|
|
509
520
|
else {
|
|
510
521
|
// 不等待确认,只加一个小延迟确保 RPC 处理完成
|
|
511
522
|
if (broadcastDelay > 0 && i < signedTransactions.length - 1) {
|
|
512
|
-
await new Promise(resolve => setTimeout(resolve, broadcastDelay));
|
|
523
|
+
await new Promise((resolve) => setTimeout(resolve, broadcastDelay));
|
|
513
524
|
}
|
|
514
525
|
}
|
|
515
526
|
}
|
|
516
527
|
catch (err) {
|
|
517
|
-
const errorMsg =
|
|
528
|
+
const errorMsg = getErrorMessageFromUnknown(err);
|
|
518
529
|
console.warn(`[broadcastSequential] 交易 ${i} 广播失败:`, errorMsg);
|
|
519
530
|
errors.push({ index: i, error: errorMsg });
|
|
520
531
|
// 如果是 nonce 问题,后续交易也会失败,提前终止
|
|
@@ -566,12 +577,10 @@ export class BlockRazorClient {
|
|
|
566
577
|
return false;
|
|
567
578
|
})();
|
|
568
579
|
if (hasMultipleFromSameWallet) {
|
|
569
|
-
console.log(`[broadcastSmart] 检测到同一钱包多笔交易,使用顺序广播`);
|
|
570
580
|
const result = await this.broadcastTransactionsSequential(signedTransactions, options);
|
|
571
581
|
return { ...result, mode: 'sequential' };
|
|
572
582
|
}
|
|
573
583
|
else {
|
|
574
|
-
console.log(`[broadcastSmart] 所有交易来自不同钱包,使用并行广播`);
|
|
575
584
|
const result = await this.broadcastTransactionsParallel(signedTransactions, { provider: options?.provider });
|
|
576
585
|
return { ...result, mode: 'parallel' };
|
|
577
586
|
}
|
|
@@ -587,10 +596,9 @@ export class BlockRazorClient {
|
|
|
587
596
|
};
|
|
588
597
|
}
|
|
589
598
|
}
|
|
590
|
-
BlockRazorClient.BLOCK_CACHE_TTL_MS = 1000; // 1秒缓存
|
|
591
599
|
/**
|
|
592
600
|
* 创建 BlockRazor 客户端的便捷函数
|
|
593
601
|
*/
|
|
594
602
|
export function createBlockRazorClient(apiKey) {
|
|
595
|
-
return new BlockRazorClient({ apiKey, chainId:
|
|
603
|
+
return new BlockRazorClient({ apiKey, chainId: CHAINS.BSC.chainId });
|
|
596
604
|
}
|
|
@@ -127,8 +127,8 @@ export declare const BUILDER_CONTROL_EOA = "0x4848489f0b2BEdd788c696e2D79b6b69D7
|
|
|
127
127
|
*/
|
|
128
128
|
export type AuctionFeedCallbacks = {
|
|
129
129
|
onOpen?: () => void;
|
|
130
|
-
onMessage?: (data:
|
|
131
|
-
onError?: (err:
|
|
130
|
+
onMessage?: (data: unknown) => void;
|
|
131
|
+
onError?: (err: unknown) => void;
|
|
132
132
|
onClose?: () => void;
|
|
133
133
|
};
|
|
134
134
|
export declare function createAuctionFeedClient(wsUrl: string, callbacks: AuctionFeedCallbacks): {
|