four-flap-meme-sdk 2.2.8 → 2.2.11
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.en.md +6 -41
- package/README.md +0 -31
- package/README.zh-CN.md +6 -41
- package/dist/chains/bsc/four/approve-tokenmanager.d.ts +26 -1
- package/dist/chains/bsc/four/approve-tokenmanager.js +113 -1
- package/dist/chains/bsc/four/config.d.ts +67 -5
- package/dist/chains/bsc/four/config.js +114 -2
- package/dist/chains/bsc/four/core.d.ts +4 -1
- package/dist/chains/bsc/four/core.js +592 -1
- 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 +46 -2
- package/dist/chains/bsc/four/internal.js +239 -2
- package/dist/chains/bsc/four/pancake-proxy.d.ts +28 -1
- package/dist/chains/bsc/four/pancake-proxy.js +687 -1
- package/dist/chains/bsc/four/private.d.ts +27 -1
- package/dist/chains/bsc/four/private.js +477 -1
- package/dist/chains/bsc/four/submit.d.ts +315 -2
- package/dist/chains/bsc/four/submit.js +752 -2
- package/dist/chains/bsc/four/swap-buy-first.d.ts +55 -2
- package/dist/chains/bsc/four/swap-buy-first.js +507 -2
- package/dist/chains/bsc/four/swap-internal.d.ts +3 -1
- package/dist/chains/bsc/four/swap-internal.js +18 -1
- package/dist/chains/bsc/four/swap.d.ts +144 -2
- package/dist/chains/bsc/four/swap.js +766 -2
- package/dist/chains/bsc/four/types.d.ts +476 -1
- package/dist/chains/bsc/four/utils.d.ts +18 -5
- package/dist/chains/bsc/four/utils.js +1552 -5
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +91 -1
- package/dist/chains/bsc/pancake/bundle-buy-first.js +212 -97
- package/dist/chains/bsc/pancake/bundle-swap.d.ts +79 -1
- package/dist/chains/bsc/pancake/bundle-swap.js +726 -114
- package/dist/chains/bsc/pancake/index.d.ts +2 -4
- package/dist/chains/bsc/pancake/index.js +3 -1
- package/dist/chains/bsc/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/bsc/platforms/iro/factory.js +1 -3
- 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 +10 -31
- package/dist/chains/bsc/platforms/iro/token.js +1 -4
- package/dist/chains/eni/batch-router/bundle-approve.js +3 -4
- package/dist/chains/eni/batch-router/transfer.js +25 -55
- package/dist/chains/eni/batch-router/utils.js +6 -32
- package/dist/chains/eni/bundler/sign.js +6 -5
- package/dist/chains/eni/bundler/submit.js +4 -1
- package/dist/chains/eni/constants.js +1 -1
- package/dist/chains/eni/index.d.ts +1 -2
- package/dist/chains/eni/index.js +0 -1
- package/dist/chains/eni/platforms/daoaas/create.js +2 -2
- 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 +6 -9
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +44 -28
- package/dist/chains/eni/platforms/daoaas/portal.js +6 -10
- package/dist/chains/eni/platforms/dswap/liquidity.js +26 -58
- 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 +46 -87
- package/dist/chains/eni/platforms/fair-launch/pool.js +1 -4
- package/dist/chains/eni/platforms/fair-launch/presets.js +2 -2
- package/dist/chains/eni/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/eni/platforms/iro/factory.js +1 -3
- 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 +26 -90
- package/dist/chains/eni/platforms/iro/token.js +31 -107
- package/dist/chains/eni/platforms/iro/whitelist.js +18 -6
- package/dist/chains/index.d.ts +0 -13
- package/dist/chains/index.js +0 -13
- package/dist/chains/xlayer/eip7702/bundle-approve.d.ts +26 -2
- package/dist/chains/xlayer/eip7702/bundle-approve.js +21 -11
- package/dist/chains/xlayer/eip7702/bundle-buy.d.ts +6 -2
- package/dist/chains/xlayer/eip7702/bundle-buy.js +51 -13
- package/dist/chains/xlayer/eip7702/bundle-create.js +59 -93
- package/dist/chains/xlayer/eip7702/bundle-sell.d.ts +6 -2
- package/dist/chains/xlayer/eip7702/bundle-sell.js +111 -29
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +65 -3
- package/dist/chains/xlayer/eip7702/bundle-swap.js +245 -51
- package/dist/chains/xlayer/eip7702/constants.d.ts +16 -1
- package/dist/chains/xlayer/eip7702/constants.js +21 -3
- package/dist/chains/xlayer/eip7702/index.d.ts +46 -28
- package/dist/chains/xlayer/eip7702/index.js +81 -28
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.d.ts +203 -2
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.js +307 -63
- package/dist/chains/xlayer/eip7702/types.d.ts +0 -88
- package/dist/chains/xlayer/eip7702/utils.d.ts +3 -0
- package/dist/chains/xlayer/eip7702/utils.js +28 -23
- package/dist/chains/xlayer/eip7702/volume.d.ts +184 -6
- package/dist/chains/xlayer/eip7702/volume.js +164 -89
- package/dist/chains/xlayer/eoa/constants.js +1 -1
- package/dist/chains/xlayer/eoa/dex-helpers.js +5 -5
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.d.ts +95 -1
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.js +299 -66
- package/dist/chains/xlayer/eoa/eoa-wash-volume.d.ts +1 -1
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +23 -18
- package/dist/chains/xlayer/eoa/index.d.ts +6 -10
- package/dist/chains/xlayer/eoa/index.js +23 -8
- package/dist/chains/xlayer/eoa/portal-ops.js +2 -7
- package/dist/chains/xlayer/eoa/router-manager.js +3 -3
- package/dist/chains/xlayer/eoa/types.d.ts +2 -2
- package/dist/chains/xlayer/eoa/types.js +3 -1
- package/dist/chains/xlayer/index.d.ts +2 -3
- package/dist/chains/xlayer/index.js +7 -4
- package/dist/contracts/helper3.d.ts +5 -20
- package/dist/contracts/helper3.js +20 -56
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.d.ts +26 -1
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.js +113 -1
- package/dist/contracts/tm-bundle-merkle/config.d.ts +67 -5
- package/dist/contracts/tm-bundle-merkle/config.js +114 -2
- package/dist/contracts/tm-bundle-merkle/core.d.ts +4 -1
- package/dist/contracts/tm-bundle-merkle/core.js +591 -1
- package/dist/contracts/tm-bundle-merkle/index.d.ts +5 -5
- package/dist/contracts/tm-bundle-merkle/index.js +5 -5
- package/dist/contracts/tm-bundle-merkle/internal.d.ts +46 -2
- package/dist/contracts/tm-bundle-merkle/internal.js +238 -2
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.d.ts +28 -1
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.js +686 -1
- package/dist/contracts/tm-bundle-merkle/private.d.ts +27 -1
- package/dist/contracts/tm-bundle-merkle/private.js +476 -1
- package/dist/contracts/tm-bundle-merkle/submit.d.ts +314 -3
- package/dist/contracts/tm-bundle-merkle/submit.js +928 -3
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.d.ts +55 -2
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.js +506 -2
- package/dist/contracts/tm-bundle-merkle/swap-internal.d.ts +3 -1
- package/dist/contracts/tm-bundle-merkle/swap-internal.js +18 -1
- package/dist/contracts/tm-bundle-merkle/swap.d.ts +144 -2
- package/dist/contracts/tm-bundle-merkle/swap.js +764 -2
- package/dist/contracts/tm-bundle-merkle/types.d.ts +476 -1
- package/dist/contracts/tm-bundle-merkle/utils.d.ts +18 -6
- package/dist/contracts/tm-bundle-merkle/utils.js +1501 -6
- package/dist/contracts/tm-bundle.d.ts +51 -3
- package/dist/contracts/tm-bundle.js +177 -108
- package/dist/contracts/tm.d.ts +2 -3
- package/dist/contracts/tm.js +32 -37
- package/dist/contracts/tm1.js +4 -9
- package/dist/contracts/tm2.js +4 -9
- package/dist/dex/direct-router.d.ts +125 -3
- package/dist/dex/direct-router.js +666 -237
- package/dist/flows/create.d.ts +1 -2
- package/dist/flows/create.js +6 -6
- package/dist/index.d.ts +87 -20
- package/dist/index.js +217 -20
- package/dist/shared/abis/TaxToken.json +105 -0
- package/dist/shared/abis/TokenManager2.json +60 -0
- package/dist/shared/abis/common.d.ts +83 -2
- package/dist/shared/abis/common.js +254 -2
- package/dist/shared/abis/index.d.ts +6 -5
- package/dist/shared/abis/index.js +7 -5
- package/dist/shared/clients/blockrazor.js +25 -39
- package/dist/shared/clients/club48.d.ts +2 -2
- package/dist/shared/clients/club48.js +29 -34
- package/dist/shared/clients/emitservice.js +0 -2
- package/dist/shared/clients/four.d.ts +6 -21
- package/dist/shared/clients/four.js +24 -29
- package/dist/shared/clients/merkle.js +34 -27
- package/dist/shared/constants/addresses.d.ts +1 -1
- package/dist/shared/constants/addresses.js +2 -11
- package/dist/shared/constants/chains.d.ts +1 -1
- package/dist/shared/constants/chains.js +1 -1
- package/dist/shared/constants/gas.d.ts +1 -1
- package/dist/shared/constants/gas.js +6 -2
- package/dist/shared/constants/index.d.ts +0 -3
- package/dist/shared/constants/index.js +0 -1
- package/dist/shared/flap/abi.js +1 -1
- package/dist/shared/flap/constants.d.ts +2 -1
- package/dist/shared/flap/constants.js +4 -3
- package/dist/shared/flap/curve.js +0 -3
- package/dist/shared/flap/errors.d.ts +4 -1
- package/dist/shared/flap/errors.js +1 -20
- package/dist/shared/flap/index.d.ts +5 -4
- package/dist/shared/flap/index.js +5 -4
- package/dist/shared/flap/launch-v6.d.ts +127 -0
- package/dist/shared/flap/launch-v6.js +123 -0
- package/dist/shared/flap/meta.d.ts +18 -22
- package/dist/shared/flap/meta.js +17 -12
- package/dist/shared/flap/permit.js +2 -5
- package/dist/shared/flap/pinata.d.ts +6 -22
- package/dist/shared/flap/pinata.js +26 -21
- package/dist/shared/flap/portal-bundle-merkle/config.d.ts +72 -3
- package/dist/shared/flap/portal-bundle-merkle/config.js +124 -4
- package/dist/shared/flap/portal-bundle-merkle/core.d.ts +4 -0
- package/dist/shared/flap/portal-bundle-merkle/core.js +151 -142
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.d.ts +4 -17
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.js +86 -86
- package/dist/shared/flap/portal-bundle-merkle/curve-to-dex.js +92 -100
- package/dist/shared/flap/portal-bundle-merkle/index.d.ts +7 -11
- package/dist/shared/flap/portal-bundle-merkle/index.js +7 -4
- package/dist/shared/flap/portal-bundle-merkle/pancake-proxy.js +68 -71
- package/dist/shared/flap/portal-bundle-merkle/private.js +114 -61
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.d.ts +64 -1
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.js +247 -66
- package/dist/shared/flap/portal-bundle-merkle/swap.d.ts +71 -2
- package/dist/shared/flap/portal-bundle-merkle/swap.js +410 -103
- package/dist/shared/flap/portal-bundle-merkle/types.d.ts +12 -88
- package/dist/shared/flap/portal-bundle-merkle/utils.d.ts +80 -1
- package/dist/shared/flap/portal-bundle-merkle/utils.js +265 -145
- package/dist/shared/flap/portal-bundle.js +56 -55
- package/dist/shared/flap/portal-create-token.d.ts +19 -37
- package/dist/shared/flap/portal-create-token.js +124 -121
- package/dist/shared/flap/portal.d.ts +2 -1
- package/dist/shared/flap/portal.js +28 -36
- package/dist/shared/flap/vanity.d.ts +6 -6
- package/dist/shared/flap/vanity.js +21 -15
- package/dist/shared/flap/vault.d.ts +93 -25
- package/dist/shared/flap/vault.js +126 -75
- package/dist/shared/four/tax-token.d.ts +1 -1
- package/dist/shared/four/tax-token.js +7 -27
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/index.js +0 -4
- package/dist/utils/airdrop-sweep.d.ts +76 -4
- package/dist/utils/airdrop-sweep.js +55 -42
- package/dist/utils/bundle-helpers.d.ts +243 -9
- package/dist/utils/bundle-helpers.js +584 -10
- package/dist/utils/constants.d.ts +61 -5
- package/dist/utils/constants.js +80 -5
- package/dist/utils/contract-factory.d.ts +4 -2
- package/dist/utils/contract-factory.js +18 -25
- package/dist/utils/erc20.d.ts +89 -7
- package/dist/utils/erc20.js +125 -94
- package/dist/utils/errors.d.ts +1 -12
- package/dist/utils/errors.js +1 -60
- package/dist/utils/holders-maker.d.ts +138 -2
- package/dist/utils/holders-maker.js +661 -26
- package/dist/utils/lp-inspect.d.ts +112 -2
- package/dist/utils/lp-inspect.js +223 -73
- package/dist/utils/mpcExclusive.d.ts +5 -2
- package/dist/utils/mpcExclusive.js +3 -4
- package/dist/utils/private-sale.d.ts +58 -2
- package/dist/utils/private-sale.js +15 -4
- package/dist/utils/provider-factory.d.ts +0 -4
- package/dist/utils/provider-factory.js +0 -10
- package/dist/utils/quote-helpers.d.ts +45 -4
- package/dist/utils/quote-helpers.js +74 -17
- package/dist/utils/stealth-transfer.d.ts +28 -2
- package/dist/utils/stealth-transfer.js +15 -31
- package/dist/utils/swap-helpers.d.ts +15 -2
- package/dist/utils/swap-helpers.js +11 -6
- package/dist/utils/wallet.d.ts +25 -2
- package/dist/utils/wallet.js +10 -13
- package/package.json +4 -160
- package/dist/__tests__/subpath-exports.test.d.ts +0 -1
- package/dist/__tests__/subpath-exports.test.js +0 -64
- package/dist/abis/common.d.ts +0 -85
- package/dist/abis/common.js +0 -264
- package/dist/abis/contracts/TaxToken.json +0 -969
- package/dist/abis/contracts/TokenManager2.json +0 -136
- package/dist/abis/contracts/index.d.ts +0 -5
- package/dist/abis/contracts/index.js +0 -5
- package/dist/abis/flap/index.d.ts +0 -3
- package/dist/abis/flap/index.js +0 -3
- package/dist/abis/flap/portal-events.d.ts +0 -6
- package/dist/abis/flap/portal-events.js +0 -17
- package/dist/abis/flap/portal.d.ts +0 -6
- package/dist/abis/flap/portal.js +0 -37
- package/dist/abis/flap/vault.d.ts +0 -171
- package/dist/abis/flap/vault.js +0 -91
- package/dist/abis/index.d.ts +0 -8
- package/dist/abis/index.js +0 -11
- package/dist/bundle-core/__tests__/config-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/config-helpers.test.js +0 -28
- package/dist/bundle-core/__tests__/facade-parity.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/facade-parity.test.js +0 -33
- package/dist/bundle-core/__tests__/sign-context-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-context-helpers.test.js +0 -60
- package/dist/bundle-core/__tests__/sign-fixture.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-fixture.test.js +0 -220
- package/dist/bundle-core/__tests__/sign-fixtures.d.ts +0 -10
- package/dist/bundle-core/__tests__/sign-fixtures.js +0 -16
- package/dist/bundle-core/config-helpers.d.ts +0 -36
- package/dist/bundle-core/config-helpers.js +0 -57
- package/dist/bundle-core/errors.d.ts +0 -50
- package/dist/bundle-core/errors.js +0 -35
- package/dist/bundle-core/four-meme/approve-tokenmanager.d.ts +0 -7
- package/dist/bundle-core/four-meme/approve-tokenmanager.js +0 -99
- package/dist/bundle-core/four-meme/core-helpers.d.ts +0 -8
- package/dist/bundle-core/four-meme/core-helpers.js +0 -40
- package/dist/bundle-core/four-meme/core.d.ts +0 -4
- package/dist/bundle-core/four-meme/core.js +0 -515
- package/dist/bundle-core/four-meme/pancake-proxy.d.ts +0 -28
- package/dist/bundle-core/four-meme/pancake-proxy.js +0 -679
- package/dist/bundle-core/four-meme/private.d.ts +0 -27
- package/dist/bundle-core/four-meme/private.js +0 -465
- package/dist/bundle-core/four-meme/sign-context-helpers.d.ts +0 -2
- package/dist/bundle-core/four-meme/sign-context-helpers.js +0 -2
- package/dist/bundle-core/four-meme/swap-buy-first.d.ts +0 -8
- package/dist/bundle-core/four-meme/swap-buy-first.js +0 -493
- package/dist/bundle-core/four-meme/swap-hop-helpers.d.ts +0 -6
- package/dist/bundle-core/four-meme/swap-hop-helpers.js +0 -63
- package/dist/bundle-core/four-meme/swap-internal.d.ts +0 -3
- package/dist/bundle-core/four-meme/swap-internal.js +0 -18
- package/dist/bundle-core/four-meme/swap-sign-helpers.d.ts +0 -27
- package/dist/bundle-core/four-meme/swap-sign-helpers.js +0 -105
- package/dist/bundle-core/four-meme/swap.d.ts +0 -17
- package/dist/bundle-core/four-meme/swap.js +0 -505
- package/dist/bundle-core/four-meme/types/buy-first.d.ts +0 -50
- package/dist/bundle-core/four-meme/types/buy-first.js +0 -1
- package/dist/bundle-core/four-meme/types/core-flow.d.ts +0 -63
- package/dist/bundle-core/four-meme/types/core-flow.js +0 -1
- package/dist/bundle-core/four-meme/types/index.d.ts +0 -600
- package/dist/bundle-core/four-meme/types/index.js +0 -1
- package/dist/bundle-core/four-meme/types/swap-internal.d.ts +0 -19
- package/dist/bundle-core/four-meme/types/swap-internal.js +0 -1
- package/dist/bundle-core/four-meme/types.d.ts +0 -1
- package/dist/bundle-core/four-meme/types.js +0 -1
- package/dist/bundle-core/four-meme/utils-disperse.d.ts +0 -7
- package/dist/bundle-core/four-meme/utils-disperse.js +0 -396
- package/dist/bundle-core/four-meme/utils-pairwise.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-pairwise.js +0 -328
- package/dist/bundle-core/four-meme/utils-sweep.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-sweep.js +0 -744
- package/dist/bundle-core/index.d.ts +0 -8
- package/dist/bundle-core/index.js +0 -8
- package/dist/bundle-core/internal.d.ts +0 -21
- package/dist/bundle-core/internal.js +0 -182
- package/dist/bundle-core/sign-context-helpers.d.ts +0 -25
- package/dist/bundle-core/sign-context-helpers.js +0 -67
- package/dist/bundle-core/submit.d.ts +0 -293
- package/dist/bundle-core/submit.js +0 -727
- package/dist/bundle-core/types/index.d.ts +0 -8
- package/dist/bundle-core/types/index.js +0 -1
- package/dist/bundle-core/types.d.ts +0 -1
- package/dist/bundle-core/types.js +0 -1
- package/dist/chains/bsc/four/utils-disperse.d.ts +0 -1
- package/dist/chains/bsc/four/utils-disperse.js +0 -1
- package/dist/chains/bsc/four/utils-pairwise.d.ts +0 -1
- package/dist/chains/bsc/four/utils-pairwise.js +0 -1
- package/dist/chains/bsc/four/utils-sweep.d.ts +0 -1
- package/dist/chains/bsc/four/utils-sweep.js +0 -1
- package/dist/chains/bsc/iro.d.ts +0 -5
- package/dist/chains/bsc/iro.js +0 -4
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +0 -159
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +0 -117
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +0 -241
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +0 -565
- package/dist/chains/eni/flat-aliases.d.ts +0 -10
- package/dist/chains/eni/flat-aliases.js +0 -8
- package/dist/chains/eni/submit.d.ts +0 -43
- package/dist/chains/eni/submit.js +0 -286
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +0 -13
- package/dist/chains/xlayer/eip7702/flat-aliases.js +0 -10
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.d.ts +0 -79
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.js +0 -1
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +0 -26
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +0 -57
- package/dist/chains/xlayer/eip7702/volume-helpers.d.ts +0 -148
- package/dist/chains/xlayer/eip7702/volume-helpers.js +0 -48
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +0 -126
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +0 -228
- package/dist/contracts/tm-bundle-helpers.d.ts +0 -88
- package/dist/contracts/tm-bundle-helpers.js +0 -72
- package/dist/contracts/tm-bundle-merkle/utils-disperse.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-disperse.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.js +0 -1
- package/dist/dex/direct-router-helpers.d.ts +0 -264
- package/dist/dex/direct-router-helpers.js +0 -539
- package/dist/dex/types.d.ts +0 -81
- package/dist/dex/types.js +0 -1
- package/dist/exports/root-bundle-and-tooling.d.ts +0 -27
- package/dist/exports/root-bundle-and-tooling.js +0 -30
- package/dist/exports/root-eni-and-bsc-iro.d.ts +0 -26
- package/dist/exports/root-eni-and-bsc-iro.js +0 -66
- package/dist/exports/root-foundations.d.ts +0 -35
- package/dist/exports/root-foundations.js +0 -70
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +0 -30
- package/dist/exports/root-swap-dex-and-xlayer.js +0 -78
- package/dist/flap/index.d.ts +0 -10
- package/dist/flap/index.js +0 -8
- package/dist/flows/index.d.ts +0 -1
- package/dist/flows/index.js +0 -1
- package/dist/merkle/index.d.ts +0 -12
- package/dist/merkle/index.js +0 -11
- package/dist/shared/clients/index.d.ts +0 -8
- package/dist/shared/clients/index.js +0 -8
- package/dist/shared/constants/quote.d.ts +0 -30
- package/dist/shared/constants/quote.js +0 -37
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.d.ts +0 -32
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.js +0 -83
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +0 -125
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.js +0 -113
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.d.ts +0 -149
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.js +0 -259
- package/dist/shared/foundation/dex/v3-path.d.ts +0 -6
- package/dist/shared/foundation/dex/v3-path.js +0 -35
- package/dist/shared/foundation/gas/bundle-gas.d.ts +0 -49
- package/dist/shared/foundation/gas/bundle-gas.js +0 -93
- package/dist/shared/foundation/gas/profit-hop.d.ts +0 -20
- package/dist/shared/foundation/gas/profit-hop.js +0 -72
- package/dist/shared/foundation/index.d.ts +0 -13
- package/dist/shared/foundation/index.js +0 -12
- package/dist/shared/foundation/nonce/nonce-manager.d.ts +0 -17
- package/dist/shared/foundation/nonce/nonce-manager.js +0 -183
- package/dist/shared/foundation/normalize-unknown.d.ts +0 -9
- package/dist/shared/foundation/normalize-unknown.js +0 -29
- package/dist/shared/foundation/sdk-logger.d.ts +0 -13
- package/dist/shared/foundation/sdk-logger.js +0 -12
- package/dist/shared/foundation/tx/build-request.d.ts +0 -17
- package/dist/shared/foundation/tx/build-request.js +0 -25
- package/dist/shared/foundation/tx/sign-batch.d.ts +0 -5
- package/dist/shared/foundation/tx/sign-batch.js +0 -26
- package/dist/shared/foundation/tx/wallet-sign-patch.d.ts +0 -1
- package/dist/shared/foundation/tx/wallet-sign-patch.js +0 -18
- package/dist/shared/foundation/types/airdrop-sweep.d.ts +0 -79
- package/dist/shared/foundation/types/airdrop-sweep.js +0 -1
- package/dist/shared/foundation/types/erc20.d.ts +0 -65
- package/dist/shared/foundation/types/erc20.js +0 -1
- package/dist/shared/foundation/types/holders-maker.d.ts +0 -64
- package/dist/shared/foundation/types/holders-maker.js +0 -1
- package/dist/shared/foundation/types/index.d.ts +0 -7
- package/dist/shared/foundation/types/index.js +0 -1
- package/dist/shared/foundation/types/lp-inspect.d.ts +0 -102
- package/dist/shared/foundation/types/lp-inspect.js +0 -1
- package/dist/shared/foundation/types/multicall.d.ts +0 -5
- package/dist/shared/foundation/types/multicall.js +0 -1
- package/dist/shared/foundation/types/private-sale.d.ts +0 -35
- package/dist/shared/foundation/types/private-sale.js +0 -1
- package/dist/shared/foundation/types/quote-helpers.d.ts +0 -17
- package/dist/shared/foundation/types/quote-helpers.js +0 -1
- package/dist/types/errors.d.ts +0 -27
- package/dist/types/errors.js +0 -34
- package/dist/utils/holders-maker/addresses.d.ts +0 -12
- package/dist/utils/holders-maker/addresses.js +0 -15
- package/dist/utils/holders-maker/buy-tx.d.ts +0 -44
- package/dist/utils/holders-maker/buy-tx.js +0 -278
- package/dist/utils/holders-maker/constants.d.ts +0 -6
- package/dist/utils/holders-maker/constants.js +0 -7
- package/dist/utils/holders-maker/disperse.d.ts +0 -18
- package/dist/utils/holders-maker/disperse.js +0 -90
- package/dist/utils/holders-maker/routing.d.ts +0 -4
- package/dist/utils/holders-maker/routing.js +0 -45
- package/dist/utils/holders-maker/transfer-tx.d.ts +0 -4
- package/dist/utils/holders-maker/transfer-tx.js +0 -67
- package/dist/utils/holders-maker-helpers.d.ts +0 -9
- package/dist/utils/holders-maker-helpers.js +0 -9
- package/dist/utils/hop-chains.d.ts +0 -35
- package/dist/utils/hop-chains.js +0 -215
- package/dist/utils/lp-inspect-helpers.d.ts +0 -9
- package/dist/utils/lp-inspect-helpers.js +0 -109
- package/dist/utils/types/airdrop-sweep.d.ts +0 -1
- package/dist/utils/types/airdrop-sweep.js +0 -1
- package/dist/utils/types/contract-factory.d.ts +0 -1
- package/dist/utils/types/contract-factory.js +0 -1
- package/dist/utils/types/erc20.d.ts +0 -1
- package/dist/utils/types/erc20.js +0 -1
- package/dist/utils/types/errors.d.ts +0 -1
- package/dist/utils/types/errors.js +0 -1
- package/dist/utils/types/holders-maker.d.ts +0 -1
- package/dist/utils/types/holders-maker.js +0 -1
- package/dist/utils/types/hop-chains.d.ts +0 -8
- package/dist/utils/types/hop-chains.js +0 -1
- package/dist/utils/types/index.d.ts +0 -13
- package/dist/utils/types/index.js +0 -1
- package/dist/utils/types/lp-inspect.d.ts +0 -1
- package/dist/utils/types/lp-inspect.js +0 -1
- package/dist/utils/types/mpc-exclusive.d.ts +0 -5
- package/dist/utils/types/mpc-exclusive.js +0 -1
- package/dist/utils/types/private-sale.d.ts +0 -1
- package/dist/utils/types/private-sale.js +0 -1
- package/dist/utils/types/quote-helpers.d.ts +0 -1
- package/dist/utils/types/quote-helpers.js +0 -1
- package/dist/utils/types/stealth-transfer.d.ts +0 -44
- package/dist/utils/types/stealth-transfer.js +0 -1
- package/dist/utils/types/wallet.d.ts +0 -25
- package/dist/utils/types/wallet.js +0 -1
- package/dist/vanity/index.d.ts +0 -5
- package/dist/vanity/index.js +0 -5
- package/src/abis/contracts/TaxToken.json +0 -969
- package/src/abis/contracts/TokenManager.json +0 -836
- package/src/abis/contracts/TokenManager2.json +0 -136
- package/src/abis/contracts/TokenManagerHelper3.json +0 -993
- /package/dist/{abis/contracts → shared/abis}/TokenManager.json +0 -0
- /package/dist/{abis/contracts → shared/abis}/TokenManagerHelper3.json +0 -0
|
@@ -1,539 +0,0 @@
|
|
|
1
|
-
import { ethers, Contract } from 'ethers';
|
|
2
|
-
import { createProvider } from '../utils/provider-factory.js';
|
|
3
|
-
import { V2_ROUTER_ABI as _V2_ROUTER_ABI, V3_ROUTER02_ABI as _V3_ROUTER02_ABI, V3_ROUTER_LEGACY_ABI as _V3_ROUTER_LEGACY_ABI, SWAP_ROUTER02_V2_ABI as _SWAP_ROUTER02_V2_ABI, } from '../abis/common.js';
|
|
4
|
-
import { ADDRESSES, GAS_LIMITS, getProfitRecipient, getProfitRateBps, ZERO_ADDRESS, BLOCKRAZOR_BUILDER_EOA, } from '../shared/constants/index.js';
|
|
5
|
-
import { getOptimizedGasPrice, buildProfitHopTransactions, PROFIT_HOP_COUNT, getDeadline as bundleGetDeadline, buildGasFields, } from '../utils/bundle-helpers.js';
|
|
6
|
-
/**
|
|
7
|
-
* 直接 Router 交易(不走代理合约)
|
|
8
|
-
*
|
|
9
|
-
* 支持:
|
|
10
|
-
* - BSC: PancakeSwap V2/V3
|
|
11
|
-
* - Monad: PancakeSwap V2, Uniswap V2/V3
|
|
12
|
-
*
|
|
13
|
-
* 收费方式:交易末尾附加利润提取交易(和内盘一致)
|
|
14
|
-
*/
|
|
15
|
-
// ============================================================================
|
|
16
|
-
// ✅ 方案 C:Provider 缓存(避免重复创建)
|
|
17
|
-
// ============================================================================
|
|
18
|
-
export const providerCache = new Map();
|
|
19
|
-
export const PROVIDER_CACHE_TTL = 60000; // 60秒后过期
|
|
20
|
-
export const providerCacheTimestamps = new Map();
|
|
21
|
-
/**
|
|
22
|
-
* 获取缓存的 Provider 实例
|
|
23
|
-
* - 根据 rpcUrl + chainId 作为缓存 key
|
|
24
|
-
* - 60秒后自动失效,避免长连接问题
|
|
25
|
-
*/
|
|
26
|
-
export function getCachedProvider(rpcUrl, chainId, chainName) {
|
|
27
|
-
const cacheKey = `${rpcUrl}_${chainId}`;
|
|
28
|
-
const now = Date.now();
|
|
29
|
-
// 检查缓存是否存在且未过期
|
|
30
|
-
const cachedProvider = providerCache.get(cacheKey);
|
|
31
|
-
const timestamp = providerCacheTimestamps.get(cacheKey) || 0;
|
|
32
|
-
if (cachedProvider && now - timestamp < PROVIDER_CACHE_TTL) {
|
|
33
|
-
return cachedProvider;
|
|
34
|
-
}
|
|
35
|
-
// ✅ 禁用 ENS: 避免 "network does not support ENS" 错误
|
|
36
|
-
const provider = createProvider(rpcUrl, chainId, chainName);
|
|
37
|
-
providerCache.set(cacheKey, provider);
|
|
38
|
-
providerCacheTimestamps.set(cacheKey, now);
|
|
39
|
-
return provider;
|
|
40
|
-
}
|
|
41
|
-
export const DEFAULT_GAS_LIMIT = 300000;
|
|
42
|
-
export const DEADLINE_MINUTES = 20;
|
|
43
|
-
// ✅ BLOCKRAZOR_BUILDER_EOA 从公共模块导入
|
|
44
|
-
/**
|
|
45
|
-
* 截断小数位数,避免超过代币精度导致 parseUnits 报错
|
|
46
|
-
* 例如:truncateDecimals("21906.025000000000000000", 1) => "21906.0"
|
|
47
|
-
*/
|
|
48
|
-
export function truncateDecimals(value, decimals) {
|
|
49
|
-
if (!value || decimals < 0)
|
|
50
|
-
return value;
|
|
51
|
-
const parts = value.split('.');
|
|
52
|
-
if (parts.length === 1)
|
|
53
|
-
return value; // 没有小数点
|
|
54
|
-
const integerPart = parts[0];
|
|
55
|
-
const decimalPart = parts[1];
|
|
56
|
-
if (decimals === 0)
|
|
57
|
-
return integerPart;
|
|
58
|
-
// 截断到指定小数位数
|
|
59
|
-
const truncatedDecimal = decimalPart.slice(0, decimals);
|
|
60
|
-
// 如果截断后没有小数部分,只返回整数部分
|
|
61
|
-
if (!truncatedDecimal || truncatedDecimal === '')
|
|
62
|
-
return integerPart;
|
|
63
|
-
return `${integerPart}.${truncatedDecimal}`;
|
|
64
|
-
}
|
|
65
|
-
/** Router 地址配置 - ✅ 使用公共模块中的地址 */
|
|
66
|
-
export const DIRECT_ROUTERS = {
|
|
67
|
-
BSC: {
|
|
68
|
-
PANCAKESWAP_V2: ADDRESSES.BSC.PancakeV2Router,
|
|
69
|
-
PANCAKESWAP_V3: ADDRESSES.BSC.PancakeV3Router,
|
|
70
|
-
IROSWAP_V2: ADDRESSES.BSC.IroSwapV2Router,
|
|
71
|
-
WBNB: ADDRESSES.BSC.WBNB,
|
|
72
|
-
},
|
|
73
|
-
MONAD: {
|
|
74
|
-
// PancakeSwap
|
|
75
|
-
PANCAKESWAP_V2: '0xB1Bc24c34e88f7D43D5923034E3a14B24DaACfF9',
|
|
76
|
-
PANCAKESWAP_V3: '0x1b81D678ffb9C0263b24A97847620C99d213eB14',
|
|
77
|
-
// Uniswap
|
|
78
|
-
UNISWAP_V2: '0x4b2ab38dbf28d31d467aa8993f6c2585981d6804',
|
|
79
|
-
UNISWAP_V3: '0xd6145b2d3f379919e8cdeda7b97e37c4b2ca9c40',
|
|
80
|
-
// Wrapped Native
|
|
81
|
-
WMON: ADDRESSES.MONAD.WMON,
|
|
82
|
-
},
|
|
83
|
-
// XLayer (PotatoSwap + DYORSwap)
|
|
84
|
-
XLAYER: {
|
|
85
|
-
POTATOSWAP_V2: '0x881fb2f98c13d521009464e7d1cbf16e1b394e8e',
|
|
86
|
-
POTATOSWAP_V3: '0xB45D0149249488333E3F3f9F359807F4b810C1FC',
|
|
87
|
-
DYORSWAP_ROUTER: '0xfb001fbbace32f09cb6d3c449b935183de53ee96',
|
|
88
|
-
DYORSWAP_FACTORY: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09',
|
|
89
|
-
V3_ROUTER: '0xBB069e9465BcabC4F488d21e793BDEf0F2d41D41',
|
|
90
|
-
V3_FACTORY: '0xa1415fAe79c4B196d087F02b8aD5a622B8A827E5',
|
|
91
|
-
WOKB: '0xe538905cf8410324e03a5a23c1c177a474d59b2b',
|
|
92
|
-
},
|
|
93
|
-
ENI: {
|
|
94
|
-
DSWAP_V2: ADDRESSES.ENI.DswapV2Router,
|
|
95
|
-
DSWAP_V3: ADDRESSES.ENI.DswapV3Router02,
|
|
96
|
-
IROSWAP_V2: ADDRESSES.ENI.IroSwapV2Router,
|
|
97
|
-
WEGAS: ADDRESSES.ENI.WEGAS,
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
/** 链 ID 映射 */
|
|
101
|
-
export const CHAIN_IDS = {
|
|
102
|
-
BSC: 56,
|
|
103
|
-
MONAD: 143,
|
|
104
|
-
XLAYER: 196,
|
|
105
|
-
ENI: 173,
|
|
106
|
-
};
|
|
107
|
-
/** 获取原生包装代币地址 */
|
|
108
|
-
export function getWrappedNative(chain) {
|
|
109
|
-
const chainUpper = chain.toUpperCase();
|
|
110
|
-
if (chainUpper === 'BSC')
|
|
111
|
-
return DIRECT_ROUTERS.BSC.WBNB;
|
|
112
|
-
if (chainUpper === 'MONAD')
|
|
113
|
-
return DIRECT_ROUTERS.MONAD.WMON;
|
|
114
|
-
if (chainUpper === 'XLAYER')
|
|
115
|
-
return DIRECT_ROUTERS.XLAYER.WOKB;
|
|
116
|
-
if (chainUpper === 'ENI')
|
|
117
|
-
return DIRECT_ROUTERS.ENI.WEGAS;
|
|
118
|
-
throw new Error(`Unsupported chain: ${chain}`);
|
|
119
|
-
}
|
|
120
|
-
// ============================================================================
|
|
121
|
-
// ABI - ✅ 使用公共模块
|
|
122
|
-
// ============================================================================
|
|
123
|
-
/** V2 Router ABI */
|
|
124
|
-
export const V2_ROUTER_ABI = _V2_ROUTER_ABI;
|
|
125
|
-
/** SwapRouter02 的 V2 方法 ABI - ✅ 从公共模块导入 */
|
|
126
|
-
export const SWAP_ROUTER02_V2_ABI = _SWAP_ROUTER02_V2_ABI;
|
|
127
|
-
/**
|
|
128
|
-
* DYORSwap SwapRouter02 的 V2 方法
|
|
129
|
-
*
|
|
130
|
-
* ⚠️ 重要:DYORSwap 使用自定义的函数签名,无法通过标准 ABI 编码
|
|
131
|
-
* 必须手动构造 calldata
|
|
132
|
-
*
|
|
133
|
-
* swapExactTokensForTokens selector: 0x3234fe0d
|
|
134
|
-
* unwrapWETH9 selector: 0x7342292e
|
|
135
|
-
* refundETH selector: 0x6d29fcf4
|
|
136
|
-
*/
|
|
137
|
-
export const DYORSWAP_SELECTORS = {
|
|
138
|
-
swapExactTokensForTokens: '0x3234fe0d',
|
|
139
|
-
unwrapWETH9: '0x7342292e',
|
|
140
|
-
refundETH: '0x6d29fcf4',
|
|
141
|
-
multicall: '0x5ae401dc',
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* 手动编码 DYORSwap 的 swapExactTokensForTokens calldata
|
|
145
|
-
*
|
|
146
|
-
* 参数格式 (根据成功交易分析):
|
|
147
|
-
* - amountIn: uint256
|
|
148
|
-
* - amountOutMin: uint256
|
|
149
|
-
* - path: address[] (动态) - offset from start
|
|
150
|
-
* - pools: address[] (动态) - offset from start
|
|
151
|
-
* - to: uint256 (address(2) = 2)
|
|
152
|
-
* - flag: uint256 (1)
|
|
153
|
-
* - factory: address
|
|
154
|
-
*
|
|
155
|
-
* 成功交易的布局:
|
|
156
|
-
* [0] amountIn
|
|
157
|
-
* [1] amountOutMin
|
|
158
|
-
* [2] offset to path = 0xa0 = 160 = 5 * 32 (从参数区域开始)
|
|
159
|
-
* [3] offset to pools = 0xe0 = 224 = 7 * 32
|
|
160
|
-
* [4] to = 2
|
|
161
|
-
* [5] flag = 1
|
|
162
|
-
* [6] factory
|
|
163
|
-
* [7] path.length
|
|
164
|
-
* [8+] path elements
|
|
165
|
-
* [N] pools.length
|
|
166
|
-
* [N+1+] pools elements
|
|
167
|
-
*/
|
|
168
|
-
export function encodeDYORSwapExactTokensForTokens(amountIn, amountOutMin, path, pools, to, // 可以是地址 (string) 或 address(2) 这样的特殊值 (bigint)
|
|
169
|
-
flag, factory) {
|
|
170
|
-
const pathOffset = 5n * 32n; // 160
|
|
171
|
-
// poolsOffset = pathOffset + (1 + path.length) * 32 = 160 + 96 = 256?
|
|
172
|
-
// 不对,成功交易是 224 = 160 + 64 = pathOffset + path.length * 32
|
|
173
|
-
const poolsOffset = pathOffset + BigInt(path.length) * 32n; // 160 + 2*32 = 224
|
|
174
|
-
// 手动构建数据
|
|
175
|
-
const pad32 = (hex) => hex.replace('0x', '').padStart(64, '0');
|
|
176
|
-
const toHex = (n) => n.toString(16).padStart(64, '0');
|
|
177
|
-
// 处理 to 参数:可以是地址 (string) 或特殊值 (bigint)
|
|
178
|
-
const toValue = typeof to === 'string' ? pad32(to) : toHex(to);
|
|
179
|
-
let data = DYORSWAP_SELECTORS.swapExactTokensForTokens;
|
|
180
|
-
data += toHex(amountIn);
|
|
181
|
-
data += toHex(amountOutMin);
|
|
182
|
-
data += toHex(pathOffset);
|
|
183
|
-
data += toHex(poolsOffset);
|
|
184
|
-
data += toValue;
|
|
185
|
-
data += toHex(flag);
|
|
186
|
-
data += pad32(factory);
|
|
187
|
-
// path 数据
|
|
188
|
-
data += toHex(BigInt(path.length));
|
|
189
|
-
for (const addr of path) {
|
|
190
|
-
data += pad32(addr);
|
|
191
|
-
}
|
|
192
|
-
// ⚠️ 不包含 pools 数据!成功交易中 pools 是空的
|
|
193
|
-
// poolsOffset 指向的位置没有数据
|
|
194
|
-
return '0x' + data.replace('0x', '');
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* 手动编码 DYORSwap 的 unwrapWETH9 calldata
|
|
198
|
-
*
|
|
199
|
-
* 参数格式 (根据成功交易分析):
|
|
200
|
-
* - amountMinimum: uint256
|
|
201
|
-
* - recipient: address
|
|
202
|
-
* - pools: bytes (动态) - 包含特殊的 pool 数据
|
|
203
|
-
*
|
|
204
|
-
* 成功交易的布局:
|
|
205
|
-
* [0] amountMinimum
|
|
206
|
-
* [1] recipient
|
|
207
|
-
* [2] offset to pools = 0x60 = 96 = 3 * 32
|
|
208
|
-
* [3] pools 数据 (bytes)
|
|
209
|
-
*/
|
|
210
|
-
export function encodeDYORUnwrapWETH9(amountMinimum, recipient, poolsData = '') {
|
|
211
|
-
const pad32 = (hex) => hex.slice(2).padStart(64, '0');
|
|
212
|
-
const toHex = (n) => n.toString(16).padStart(64, '0');
|
|
213
|
-
const poolsOffset = 3n * 32n; // 96
|
|
214
|
-
const poolsBytes = poolsData.startsWith('0x') ? poolsData.slice(2) : poolsData;
|
|
215
|
-
const poolsLength = poolsBytes.length / 2;
|
|
216
|
-
let data = DYORSWAP_SELECTORS.unwrapWETH9;
|
|
217
|
-
data += toHex(amountMinimum);
|
|
218
|
-
data += pad32(recipient);
|
|
219
|
-
data += toHex(poolsOffset);
|
|
220
|
-
data += toHex(BigInt(poolsLength));
|
|
221
|
-
// pools 数据需要 padding 到 32 字节的倍数
|
|
222
|
-
if (poolsBytes.length > 0) {
|
|
223
|
-
const paddedLength = Math.ceil(poolsBytes.length / 64) * 64;
|
|
224
|
-
data += poolsBytes.padEnd(paddedLength, '0');
|
|
225
|
-
}
|
|
226
|
-
return '0x' + data.replace('0x', '');
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* DYORSwap 的 ETHBack_Dividend 合约地址
|
|
230
|
-
* 这是 refundETH 中使用的固定地址,不是 LP 池地址
|
|
231
|
-
*/
|
|
232
|
-
export const DYORSWAP_ETHBACK_DIVIDEND = '0x2e61b0b4410f6fb941d47205191cbb8963d44bcc';
|
|
233
|
-
/**
|
|
234
|
-
* 手动编码 DYORSwap 的 refundETH calldata
|
|
235
|
-
*
|
|
236
|
-
* 根据成功交易分析,refundETH 的格式是:
|
|
237
|
-
* refundETH(bytes pools)
|
|
238
|
-
*
|
|
239
|
-
* 成功交易的 refundETH (0x6d29fcf4):
|
|
240
|
-
* [0] offset to pools = 0x20 = 32
|
|
241
|
-
* [1] pools 数组长度 = 1
|
|
242
|
-
* [2] fee = 30 (0x1e)
|
|
243
|
-
* [3] ETHBack_Dividend 合约地址
|
|
244
|
-
*/
|
|
245
|
-
export function encodeDYORRefundETH(fee = 30) {
|
|
246
|
-
const toHex = (n) => n.toString(16).padStart(64, '0');
|
|
247
|
-
const pad32 = (hex) => hex.replace('0x', '').padStart(64, '0');
|
|
248
|
-
// 使用固定的 ETHBack_Dividend 合约地址
|
|
249
|
-
let data = DYORSWAP_SELECTORS.refundETH;
|
|
250
|
-
data += toHex(32n); // offset = 0x20
|
|
251
|
-
data += toHex(1n); // 数组长度 = 1
|
|
252
|
-
data += toHex(BigInt(fee)); // fee = 30
|
|
253
|
-
data += pad32(DYORSWAP_ETHBACK_DIVIDEND); // ETHBack_Dividend 地址
|
|
254
|
-
return '0x' + data.replace('0x', '');
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* 手动编码 DYORSwap 的 multicall calldata
|
|
258
|
-
*
|
|
259
|
-
* multicall(uint256 deadline, bytes[] data)
|
|
260
|
-
* 这个函数使用标准 ABI 编码
|
|
261
|
-
*/
|
|
262
|
-
export function encodeDYORMulticall(deadline, data) {
|
|
263
|
-
const abiCoder = ethers.AbiCoder.defaultAbiCoder();
|
|
264
|
-
// multicall(uint256 deadline, bytes[] data)
|
|
265
|
-
// 确保每个 data 元素都是正确的 hex 格式
|
|
266
|
-
const formattedData = data.map((d) => (d.startsWith('0x') ? d : '0x' + d));
|
|
267
|
-
const encoded = abiCoder.encode(['uint256', 'bytes[]'], [deadline, formattedData]).slice(2);
|
|
268
|
-
return '0x' + DYORSWAP_SELECTORS.multicall.slice(2) + encoded;
|
|
269
|
-
}
|
|
270
|
-
/** V3 SwapRouter02 ABI (PancakeSwap V3, 新版 Uniswap) */
|
|
271
|
-
export const V3_ROUTER02_ABI = _V3_ROUTER02_ABI;
|
|
272
|
-
/** V3 SwapRouter(旧版)ABI (Monad Uniswap V3) */
|
|
273
|
-
export const V3_ROUTER_LEGACY_ABI = _V3_ROUTER_LEGACY_ABI;
|
|
274
|
-
/**
|
|
275
|
-
* 判断是否使用旧版 SwapRouter
|
|
276
|
-
*
|
|
277
|
-
* 旧版特征:
|
|
278
|
-
* - exactInputSingle 包含 deadline 字段
|
|
279
|
-
* - multicall 只有 bytes[] 参数
|
|
280
|
-
*
|
|
281
|
-
* Monad 上的 V3 DEX 都使用旧版:
|
|
282
|
-
* - Uniswap V3: 0xd6145b2d3f379919e8cdeda7b97e37c4b2ca9c40
|
|
283
|
-
* - PancakeSwap V3: 0x1b81D678ffb9C0263b24A97847620C99d213eB14
|
|
284
|
-
*
|
|
285
|
-
* XLayer:
|
|
286
|
-
* - V3 Router (0xBB069e9465BcabC4F488d21e793BDEf0F2d41D41) - 旧版(exactInputSingle 包含 deadline)
|
|
287
|
-
* - SwapRouter02 (0xB45D0149249488333E3F3f9F359807F4b810C1FC) - 新版(V2+V3 混合)
|
|
288
|
-
*
|
|
289
|
-
* BSC PancakeSwap V3 使用新版 SwapRouter02
|
|
290
|
-
*/
|
|
291
|
-
export function isLegacySwapRouter(chain, routerAddress) {
|
|
292
|
-
const chainUpper = chain.toUpperCase();
|
|
293
|
-
const routerLower = routerAddress.toLowerCase();
|
|
294
|
-
// ✅ Monad 上的所有 V3 Router 都是旧版
|
|
295
|
-
if (chainUpper === 'MONAD') {
|
|
296
|
-
if (routerLower === DIRECT_ROUTERS.MONAD.UNISWAP_V3.toLowerCase()) {
|
|
297
|
-
return true;
|
|
298
|
-
}
|
|
299
|
-
if (routerLower === DIRECT_ROUTERS.MONAD.PANCAKESWAP_V3.toLowerCase()) {
|
|
300
|
-
return true;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// ✅ XLayer V3 专用 Router 是旧版(exactInputSingle 包含 deadline)
|
|
304
|
-
if (chainUpper === 'XLAYER') {
|
|
305
|
-
if (routerLower === DIRECT_ROUTERS.XLAYER.V3_ROUTER.toLowerCase()) {
|
|
306
|
-
return true; // V3 Router 是旧版
|
|
307
|
-
}
|
|
308
|
-
// SwapRouter02 是新版
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
// ✅ BSC PancakeSwap V3 使用新版 SwapRouter02
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
/** ERC20 ABI - ✅ 从公共模块导入 */
|
|
315
|
-
// ============================================================================
|
|
316
|
-
// 类型定义
|
|
317
|
-
// ============================================================================
|
|
318
|
-
// 工具函数
|
|
319
|
-
// ============================================================================
|
|
320
|
-
// ✅ 使用公共模块的 getDeadline
|
|
321
|
-
export function getDeadline(minutes = DEADLINE_MINUTES) {
|
|
322
|
-
return bundleGetDeadline(minutes);
|
|
323
|
-
}
|
|
324
|
-
export function getGasLimit(config, defaultGas = DEFAULT_GAS_LIMIT) {
|
|
325
|
-
if (config.gasLimit !== undefined) {
|
|
326
|
-
return typeof config.gasLimit === 'bigint' ? config.gasLimit : BigInt(config.gasLimit);
|
|
327
|
-
}
|
|
328
|
-
const multiplier = config.gasLimitMultiplier ?? 1.2;
|
|
329
|
-
return BigInt(Math.ceil(defaultGas * multiplier));
|
|
330
|
-
}
|
|
331
|
-
export async function getGasPrice(provider, config) {
|
|
332
|
-
if (config.gasPrice)
|
|
333
|
-
return config.gasPrice;
|
|
334
|
-
// 转换 Gwei 配置为 Wei
|
|
335
|
-
const gasPriceConfig = {};
|
|
336
|
-
if (config.minGasPriceGwei !== undefined) {
|
|
337
|
-
gasPriceConfig.minGasPrice = ethers.parseUnits(String(config.minGasPriceGwei), 'gwei');
|
|
338
|
-
}
|
|
339
|
-
if (config.maxGasPriceGwei !== undefined) {
|
|
340
|
-
gasPriceConfig.maxGasPrice = ethers.parseUnits(String(config.maxGasPriceGwei), 'gwei');
|
|
341
|
-
}
|
|
342
|
-
return getOptimizedGasPrice(provider, gasPriceConfig);
|
|
343
|
-
}
|
|
344
|
-
export function isNativeToken(quoteToken) {
|
|
345
|
-
return !quoteToken || quoteToken === ZERO_ADDRESS;
|
|
346
|
-
}
|
|
347
|
-
// ============================================================================
|
|
348
|
-
// XLAYER V3 报价(slot0 现货价,纯 V3,不串 V2)
|
|
349
|
-
// - 只用于“利润换算”为原生币,避免 XLAYER 没有 v3Quoter 导致 profit=0
|
|
350
|
-
// - 不改 BSC 的任何配置/逻辑
|
|
351
|
-
// ============================================================================
|
|
352
|
-
export const XLAYER_V3_FACTORY_ABI = [
|
|
353
|
-
'function getPool(address tokenA, address tokenB, uint24 fee) view returns (address pool)',
|
|
354
|
-
];
|
|
355
|
-
export const XLAYER_V3_POOL_ABI = [
|
|
356
|
-
'function slot0() view returns (uint160 sqrtPriceX96,int24 tick,uint16 observationIndex,uint16 observationCardinality,uint16 observationCardinalityNext,uint8 feeProtocol,bool unlocked)',
|
|
357
|
-
'function token0() view returns (address)',
|
|
358
|
-
'function token1() view returns (address)',
|
|
359
|
-
];
|
|
360
|
-
export const V3_FEE_DENOMINATOR = 1000000n; // UniswapV3 fee: X / 1e6
|
|
361
|
-
export async function quoteXLayerV3TokenToNativeBySlot0(params) {
|
|
362
|
-
try {
|
|
363
|
-
const { provider, tokenIn, amountIn, fee } = params;
|
|
364
|
-
if (!tokenIn || amountIn <= 0n)
|
|
365
|
-
return 0n;
|
|
366
|
-
const chainFactory = DIRECT_ROUTERS.XLAYER.V3_FACTORY;
|
|
367
|
-
const wrappedNative = DIRECT_ROUTERS.XLAYER.WOKB;
|
|
368
|
-
if (!chainFactory || !wrappedNative)
|
|
369
|
-
return 0n;
|
|
370
|
-
const tokenInLower = tokenIn.toLowerCase();
|
|
371
|
-
const wrappedLower = wrappedNative.toLowerCase();
|
|
372
|
-
if (tokenInLower === wrappedLower)
|
|
373
|
-
return amountIn;
|
|
374
|
-
const factory = new Contract(chainFactory, XLAYER_V3_FACTORY_ABI, provider);
|
|
375
|
-
const poolAddr = await factory.getPool?.(tokenIn, wrappedNative, fee);
|
|
376
|
-
if (!poolAddr || poolAddr.toLowerCase() === ZERO_ADDRESS.toLowerCase())
|
|
377
|
-
return 0n;
|
|
378
|
-
const pool = new Contract(poolAddr, XLAYER_V3_POOL_ABI, provider);
|
|
379
|
-
const [t0, t1, slot0] = await Promise.all([pool.token0?.(), pool.token1?.(), pool.slot0?.()]);
|
|
380
|
-
if (!t0 || !t1 || !slot0)
|
|
381
|
-
return 0n;
|
|
382
|
-
const sqrtPriceX96 = BigInt(slot0[0]);
|
|
383
|
-
if (sqrtPriceX96 <= 0n)
|
|
384
|
-
return 0n;
|
|
385
|
-
const amountInLessFee = (amountIn * (V3_FEE_DENOMINATOR - BigInt(fee))) / V3_FEE_DENOMINATOR;
|
|
386
|
-
if (amountInLessFee <= 0n)
|
|
387
|
-
return 0n;
|
|
388
|
-
const Q192 = 2n ** 192n;
|
|
389
|
-
const num = sqrtPriceX96 * sqrtPriceX96;
|
|
390
|
-
const t0Lower = String(t0).toLowerCase();
|
|
391
|
-
const t1Lower = String(t1).toLowerCase();
|
|
392
|
-
// sqrtPriceX96 表示 token1/token0 的现货价(raw)
|
|
393
|
-
if (tokenInLower === t0Lower && wrappedLower === t1Lower) {
|
|
394
|
-
return (amountInLessFee * num) / Q192;
|
|
395
|
-
}
|
|
396
|
-
if (tokenInLower === t1Lower && wrappedLower === t0Lower) {
|
|
397
|
-
return (amountInLessFee * Q192) / num;
|
|
398
|
-
}
|
|
399
|
-
return 0n;
|
|
400
|
-
}
|
|
401
|
-
catch {
|
|
402
|
-
return 0n;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
// ✅ getTokenToNativeQuote 函数已移至 ../utils/quote-helpers.ts
|
|
406
|
-
/**
|
|
407
|
-
* ✅ 找到金额最大的钱包索引(和 core.ts 逻辑一致)
|
|
408
|
-
*/
|
|
409
|
-
export function findMaxFlowIndex(amounts) {
|
|
410
|
-
if (amounts.length === 0)
|
|
411
|
-
return 0;
|
|
412
|
-
let maxIndex = 0;
|
|
413
|
-
let maxValue = amounts[0];
|
|
414
|
-
for (let i = 1; i < amounts.length; i++) {
|
|
415
|
-
if (amounts[i] > maxValue) {
|
|
416
|
-
maxValue = amounts[i];
|
|
417
|
-
maxIndex = i;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
return maxIndex;
|
|
421
|
-
}
|
|
422
|
-
/** 计算利润金额 */
|
|
423
|
-
export function calculateProfitAmount(totalFlowWei) {
|
|
424
|
-
return (totalFlowWei * BigInt(getProfitRateBps('normal'))) / 10000n;
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* 构建利润多跳转账交易(强制 2 跳中转)
|
|
428
|
-
*/
|
|
429
|
-
export async function buildProfitTransactionWithHops(provider, wallet, profitAmountWei, nonce, gasPrice, chainId, txType = 0, profitRecipient) {
|
|
430
|
-
if (profitAmountWei <= 0n)
|
|
431
|
-
return { signedTransactions: [], hopWallets: undefined };
|
|
432
|
-
const profitHopResult = await buildProfitHopTransactions({
|
|
433
|
-
provider,
|
|
434
|
-
payerWallet: wallet,
|
|
435
|
-
profitAmount: profitAmountWei,
|
|
436
|
-
profitRecipient: profitRecipient || getProfitRecipient(),
|
|
437
|
-
hopCount: PROFIT_HOP_COUNT,
|
|
438
|
-
gasPrice,
|
|
439
|
-
chainId,
|
|
440
|
-
txType,
|
|
441
|
-
startNonce: nonce,
|
|
442
|
-
});
|
|
443
|
-
return { signedTransactions: profitHopResult.signedTransactions, hopWallets: profitHopResult.hopWallets };
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* 获取贿赂金额(wei)
|
|
447
|
-
* ✅ 仅 BSC 链支持贿赂
|
|
448
|
-
*/
|
|
449
|
-
export function getBribeAmount(config, chain) {
|
|
450
|
-
// 只有 BSC 链支持贿赂
|
|
451
|
-
if (chain.toUpperCase() !== 'BSC')
|
|
452
|
-
return 0n;
|
|
453
|
-
const bribeAmount = config.bribeAmount;
|
|
454
|
-
if (typeof bribeAmount !== 'number' || bribeAmount <= 0)
|
|
455
|
-
return 0n;
|
|
456
|
-
// 转换为 wei
|
|
457
|
-
return ethers.parseEther(String(bribeAmount));
|
|
458
|
-
}
|
|
459
|
-
/** 构建贿赂交易(向 BlockRazor Builder EOA 转账 BNB) */
|
|
460
|
-
export async function buildBribeTransaction(wallet, bribeAmountWei, nonce, gasPrice, chainId, txType = 0) {
|
|
461
|
-
const tx = {
|
|
462
|
-
to: BLOCKRAZOR_BUILDER_EOA,
|
|
463
|
-
value: bribeAmountWei,
|
|
464
|
-
nonce,
|
|
465
|
-
gasLimit: GAS_LIMITS.BRIBE,
|
|
466
|
-
...buildGasFields(txType, gasPrice),
|
|
467
|
-
chainId,
|
|
468
|
-
};
|
|
469
|
-
return wallet.signTransaction(tx);
|
|
470
|
-
}
|
|
471
|
-
// ============================================================================
|
|
472
|
-
// V2 直接交易
|
|
473
|
-
// ============================================================================
|
|
474
|
-
/**
|
|
475
|
-
* 判断是否是 SwapRouter02 (XLayer PotatoSwap V3)
|
|
476
|
-
*
|
|
477
|
-
* SwapRouter02 风格的 Router 使用 multicall 包装 V2 方法:
|
|
478
|
-
* - multicall(uint256 deadline, bytes[] data)
|
|
479
|
-
* - data 内包含 swapExactTokensForTokens 等 V2 方法
|
|
480
|
-
*
|
|
481
|
-
* SwapRouter02 的 V2 方法签名不同:
|
|
482
|
-
* - swapExactTokensForTokens(amountIn, amountOutMin, path[], to) - 没有 deadline
|
|
483
|
-
* - 需要通过 multicall 的 deadline 参数传递 deadline
|
|
484
|
-
*
|
|
485
|
-
* ⚠️ 注意:DYORSwap 虽然也用 multicall,但它的 ABI 完全不同,需要单独处理
|
|
486
|
-
*/
|
|
487
|
-
export function isSwapRouter02(chain, routerAddress) {
|
|
488
|
-
const chainUpper = chain.toUpperCase();
|
|
489
|
-
const addrLower = routerAddress.toLowerCase();
|
|
490
|
-
if (chainUpper === 'XLAYER') {
|
|
491
|
-
// ✅ XLayer PotatoSwap SwapRouter02 (V3 风格)
|
|
492
|
-
if (addrLower === DIRECT_ROUTERS.XLAYER.POTATOSWAP_V3.toLowerCase()) {
|
|
493
|
-
return true;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
// ❌ XLayer POTATOSWAP_V2 (0x881fb...) 是标准 V2 Router,不走 SwapRouter02 逻辑
|
|
497
|
-
// ❌ XLayer DYORSWAP_ROUTER 有自己独特的 ABI,不走 SwapRouter02 逻辑
|
|
498
|
-
// ❌ BSC V2 交易使用传统 PancakeSwap V2 Router,不走 SwapRouter02 逻辑
|
|
499
|
-
// ❌ Monad V2 交易使用传统 V2 Router,不走 SwapRouter02 逻辑
|
|
500
|
-
return false;
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* 判断是否是 DYORSwap Router
|
|
504
|
-
*
|
|
505
|
-
* DYORSwap 使用 multicall,但它的 swapExactTokensForTokens 有特殊的 ABI:
|
|
506
|
-
* - swapExactTokensForTokens(amountIn, amountOutMin, path[], payer, flags, factory, pools)
|
|
507
|
-
* - unwrapWETH9(amountMinimum, recipient, pools)
|
|
508
|
-
*/
|
|
509
|
-
export function isDYORSwap(chain, routerAddress) {
|
|
510
|
-
const chainUpper = chain.toUpperCase();
|
|
511
|
-
const addrLower = routerAddress.toLowerCase();
|
|
512
|
-
if (chainUpper === 'XLAYER') {
|
|
513
|
-
if (addrLower === DIRECT_ROUTERS.XLAYER.DYORSWAP_ROUTER.toLowerCase()) {
|
|
514
|
-
return true;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return false;
|
|
518
|
-
}
|
|
519
|
-
export function filterEniNativeBuyIndices(balances, flowAmounts, gasLimit, gasPrice, profitWei) {
|
|
520
|
-
const maxFlowIdx = findMaxFlowIndex(flowAmounts);
|
|
521
|
-
const profitGasCost = GAS_LIMITS.NATIVE_TRANSFER * gasPrice;
|
|
522
|
-
const validIdx = [];
|
|
523
|
-
for (let i = 0; i < balances.length; i++) {
|
|
524
|
-
let required = flowAmounts[i] + BigInt(gasLimit) * gasPrice;
|
|
525
|
-
if (i === maxFlowIdx && profitWei > 0n) {
|
|
526
|
-
required += profitWei + profitGasCost;
|
|
527
|
-
}
|
|
528
|
-
if (balances[i] < required)
|
|
529
|
-
continue;
|
|
530
|
-
validIdx.push(i);
|
|
531
|
-
}
|
|
532
|
-
if (validIdx.length === 0) {
|
|
533
|
-
throw new Error('[V2 BatchBuy ENI] 所有钱包余额不足(含 swap + gas + 利润费),无法执行');
|
|
534
|
-
}
|
|
535
|
-
return validIdx.length < balances.length ? validIdx : null;
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* V2 批量买入(直接调用 Router)
|
|
539
|
-
*/
|
package/dist/dex/types.d.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type { GeneratedWallet } from '../utils/wallet.js';
|
|
2
|
-
export interface DirectRouterSignConfig {
|
|
3
|
-
rpcUrl: string;
|
|
4
|
-
chainId?: number;
|
|
5
|
-
gasLimit?: number | bigint;
|
|
6
|
-
gasLimitMultiplier?: number;
|
|
7
|
-
gasPrice?: bigint;
|
|
8
|
-
minGasPriceGwei?: number;
|
|
9
|
-
maxGasPriceGwei?: number;
|
|
10
|
-
txType?: 0 | 2;
|
|
11
|
-
/** 是否跳过授权检查 */
|
|
12
|
-
skipApprovalCheck?: boolean;
|
|
13
|
-
/** 滑点(基点),默认 100 = 1% */
|
|
14
|
-
slippageBps?: number;
|
|
15
|
-
/** BlockRazor 贿赂金额(BNB),仅 BSC 链有效,用于提高 bundle 打包优先级 */
|
|
16
|
-
bribeAmount?: number;
|
|
17
|
-
/** ✅ 利润模式:'single'(默认,从最大钱包统一扣)或 'distributed'(每个钱包独立扣) */
|
|
18
|
-
profitMode?: 'single' | 'distributed';
|
|
19
|
-
/** ✅ 是否跳过利润扣除(EOA 普通模式使用) */
|
|
20
|
-
skipProfit?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface DirectV2BuyParams {
|
|
23
|
-
chain: 'BSC' | 'MONAD' | 'XLAYER' | 'ENI';
|
|
24
|
-
privateKeys: string[];
|
|
25
|
-
buyAmounts: string[];
|
|
26
|
-
tokenAddress: string;
|
|
27
|
-
routerAddress: string;
|
|
28
|
-
quoteToken?: string;
|
|
29
|
-
quoteTokenDecimals?: number;
|
|
30
|
-
startNonces?: number[];
|
|
31
|
-
config: DirectRouterSignConfig;
|
|
32
|
-
}
|
|
33
|
-
export interface DirectV2SellParams {
|
|
34
|
-
chain: 'BSC' | 'MONAD' | 'XLAYER' | 'ENI';
|
|
35
|
-
privateKeys: string[];
|
|
36
|
-
sellPercentages?: number[];
|
|
37
|
-
sellAmounts?: string[];
|
|
38
|
-
startNonces?: number[];
|
|
39
|
-
tokenAddress: string;
|
|
40
|
-
tokenDecimals?: number;
|
|
41
|
-
routerAddress: string;
|
|
42
|
-
quoteToken?: string;
|
|
43
|
-
config: DirectRouterSignConfig;
|
|
44
|
-
}
|
|
45
|
-
export interface DirectV3BuyParams {
|
|
46
|
-
chain: 'BSC' | 'MONAD' | 'XLAYER' | 'ENI';
|
|
47
|
-
privateKeys: string[];
|
|
48
|
-
buyAmounts: string[];
|
|
49
|
-
tokenAddress: string;
|
|
50
|
-
routerAddress: string;
|
|
51
|
-
fee: number;
|
|
52
|
-
quoteToken?: string;
|
|
53
|
-
quoteTokenDecimals?: number;
|
|
54
|
-
startNonces?: number[];
|
|
55
|
-
config: DirectRouterSignConfig;
|
|
56
|
-
}
|
|
57
|
-
export interface DirectV3SellParams {
|
|
58
|
-
chain: 'BSC' | 'MONAD' | 'XLAYER' | 'ENI';
|
|
59
|
-
privateKeys: string[];
|
|
60
|
-
sellPercentages?: number[];
|
|
61
|
-
sellAmounts?: string[];
|
|
62
|
-
tokenAddress: string;
|
|
63
|
-
tokenDecimals?: number;
|
|
64
|
-
routerAddress: string;
|
|
65
|
-
fee: number;
|
|
66
|
-
quoteToken?: string;
|
|
67
|
-
startNonces?: number[];
|
|
68
|
-
config: DirectRouterSignConfig;
|
|
69
|
-
}
|
|
70
|
-
export interface DirectRouterResult {
|
|
71
|
-
signedTransactions: string[];
|
|
72
|
-
profitHopWallets?: GeneratedWallet[];
|
|
73
|
-
metadata?: {
|
|
74
|
-
profitMode?: 'single' | 'distributed';
|
|
75
|
-
profitAmount: string;
|
|
76
|
-
profitRecipient: string;
|
|
77
|
-
totalFlow: string;
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
export type DexKey = 'PANCAKESWAP' | 'UNISWAP' | 'POTATOSWAP' | 'DYORSWAP' | 'IROSWAP';
|
|
81
|
-
export type RouterVersion = 'v2' | 'v3';
|
package/dist/dex/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根包 API 分层再导出 · TokenManager Bundle / Portal / 钱包 LP 空投等横向工具再导出
|
|
3
|
-
*
|
|
4
|
-
* 由 src/index.ts 聚合引用,请勿在本目录写实现逻辑。
|
|
5
|
-
*
|
|
6
|
-
* **命名提示**:Four bundle 分散/归集类型用 `FourDisperseSignParams` / `FourSweepSignParams`;
|
|
7
|
-
* 空投工具类型用包根 `AirdropDisperseSignParams` / `AirdropSweepSignParams`。
|
|
8
|
-
* Merkle 提交函数亦见 `root-swap-dex-and-xlayer` / `bundle-core` 子路径。
|
|
9
|
-
* 详见 docs/MIGRATION_EXPORTS.zh-CN.md §8。
|
|
10
|
-
*/
|
|
11
|
-
export { createTokenWithBundleBuy as fourCreateTokenWithBundleBuy, batchBuyWithBundle as fourBatchBuyWithBundle, batchSellWithBundle as fourBatchSellWithBundle, type FourBundleConfig, type FourCreateWithBundleBuyParams, type FourCreateWithBundleBuyResult, type FourBatchBuyParams, type FourBatchBuyResult, type FourBatchSellParams, type FourBatchSellResult, } from '../contracts/tm-bundle.js';
|
|
12
|
-
export { createTokenWithBundleBuy as flapCreateTokenWithBundleBuy, batchBuyWithBundle as flapBatchBuyWithBundle, batchSellWithBundle as flapBatchSellWithBundle, type FlapBundleConfig, type FlapChainForBundle, type FlapCreateWithBundleBuyParams, type FlapCreateWithBundleBuyResult, type FlapBatchBuyParams, type FlapBatchBuyResult, type FlapBatchSellParams, type FlapBatchSellResult, } from '../shared/flap/portal-bundle.js';
|
|
13
|
-
export { fourPrivateBuy, fourPrivateSell, fourBatchPrivateBuy, fourBatchPrivateSell, type FourPrivateBuyParams, type FourPrivateSellParams, type FourBatchPrivateBuyParams, type FourBatchPrivateSellParams, } from '../contracts/tm-bundle.js';
|
|
14
|
-
export { flapPrivateBuy, flapPrivateSell, flapBatchPrivateBuy, flapBatchPrivateSell, type FlapPrivateBuyParams, type FlapPrivateSellParams, type FlapBatchPrivateBuyParams, type FlapBatchPrivateSellParams, type FlapBatchPrivateSellResult, } from '../shared/flap/portal-bundle.js';
|
|
15
|
-
export { createTokenWithBundleBuyMerkle as flapCreateTokenWithBundleBuyMerkle, batchBuyWithBundleMerkle as flapBatchBuyWithBundleMerkle, batchSellWithBundleMerkle as flapBatchSellWithBundleMerkle, flapPrivateBuyMerkle, flapPrivateSellMerkle, flapBatchPrivateBuyMerkle, flapBatchPrivateSellMerkle, pancakeProxyBatchBuyMerkle, pancakeProxyBatchSellMerkle, approvePancakeProxy, approvePancakeProxyBatch, flapDisperseWithBundleMerkle, flapSweepWithBundleMerkle, type FlapBundleMerkleConfig, type FlapSignConfig, type FlapProfitMode, type FlapChainForMerkleBundle, type FlapCreateWithBundleBuySignParams, type FlapCreateWithBundleBuyMerkleParams, type FlapCreateWithBundleBuyMerkleResult, type FlapBatchBuySignParams, type FlapBatchBuyMerkleParams, type FlapBatchBuyMerkleResult, type FlapBatchSellSignParams, type FlapBatchSellMerkleParams, type FlapBatchSellMerkleResult, type MerkleTransactionStatus, type MerkleBundleStatus, type FlapPrivateBuyMerkleParams, type FlapPrivateSellMerkleParams, type FlapBatchPrivateBuyMerkleParams, type FlapBatchPrivateSellMerkleParams, type FlapBatchPrivateMerkleResult, type FlapPrivateTransactionResult, type PancakeProxyBatchBuyParams, type PancakeProxyBatchBuyResult, type PancakeProxyBatchSellParams, type PancakeProxyBatchSellResult, type PancakeProxyApprovalParams, type PancakeProxyApprovalBatchParams, type PancakeProxyApprovalBatchResult, type FlapDisperseSignParams, type FlapDisperseMerkleResult, type FlapSweepSignParams, type FlapSweepMerkleResult, } from '../shared/flap/portal-bundle-merkle/index.js';
|
|
16
|
-
export { createTokenWithBundleBuyMerkle as fourCreateTokenWithBundleBuyMerkle, batchBuyWithBundleMerkle as fourBatchBuyWithBundleMerkle, batchSellWithBundleMerkle as fourBatchSellWithBundleMerkle, fourPrivateBuyMerkle, fourPrivateSellMerkle, fourBatchPrivateBuyMerkle, fourBatchPrivateSellMerkle, disperseWithBundleMerkle, sweepWithBundleMerkle, pairwiseTransferWithBundleMerkle, fourPancakeProxyBatchBuyMerkle, fourPancakeProxyBatchSellMerkle, approveFourPancakeProxy, approveFourPancakeProxyBatch, approveFourTokenManagerBatch, submitBundleToMerkle, submitMultipleBundles, submitMultipleBundlesParallel, submitBundleToBlockRazor, submitMultipleBundlesToBlockRazor, submitMultipleBundlesToBlockRazorParallel, type MerkleSubmitConfig, type SubmitBundleResult, type BlockRazorSubmitConfig, type BlockRazorSubmitResult, type FourBundleMerkleConfig, type FourSignConfig, type FourCreateWithBundleBuySignParams, type FourBatchBuySignParams, type FourBatchSellSignParams, type FourPrivateBuySignParams, type FourPrivateSellSignParams, type FourBatchPrivateBuySignParams, type FourBatchPrivateSellSignParams, type FourPancakeProxyBatchBuySignParams, type FourPancakeProxyBatchSellSignParams, type DisperseSignParams as FourDisperseSignParams, type SweepSignParams as FourSweepSignParams, type FourCreateWithBundleBuyMerkleParams, type FourCreateWithBundleBuyMerkleResult, type FourBatchBuyMerkleParams, type FourBatchBuyMerkleResult, type FourBatchSellMerkleParams, type FourBatchSellMerkleResult, type FourPrivateBuyMerkleParams, type FourPrivateSellMerkleParams, type FourBatchPrivateBuyMerkleParams, type FourBatchPrivateSellMerkleParams, type FourBatchPrivateMerkleResult, type FourPrivateTransactionResult, type DisperseMerkleParams, type DisperseMerkleResult, type SweepMerkleParams, type SweepMerkleResult, type FourPancakeProxyBatchBuyParams, type FourPancakeProxyBatchBuyResult, type FourPancakeProxyBatchSellParams, type FourPancakeProxyBatchSellResult, type FourPancakeProxyApprovalParams, type FourPancakeProxyApprovalBatchParams, type FourPancakeProxyApprovalBatchResult, type ApproveFourTokenManagerBatchParams, type ApproveFourTokenManagerBatchResult, } from '../chains/bsc/four/index.js';
|
|
17
|
-
export { isTaxToken as fourIsTaxToken, isAntiSniperFeeMode as fourIsAntiSniperFeeMode, getCreatorType as fourGetCreatorType, getTaxTokenInfo as fourGetTaxTokenInfo, getClaimableFee as fourGetClaimableFee, getClaimedFee as fourGetClaimedFee, getUserRewardInfo as fourGetUserRewardInfo, buildClaimFeeTx as fourBuildClaimFeeTx, buildBatchClaimFeeTxs as fourBuildBatchClaimFeeTxs, validateFourTokenTaxInfo, TAX_TOKEN_ABI, TransferMode as FourTransferMode, type TaxTokenConfig as FourTaxTokenConfig, type TaxTokenRewardStats as FourTaxTokenRewardStats, type TaxTokenUserInfo as FourTaxTokenUserInfo, type TaxTokenInfo as FourTaxTokenInfo, } from '../shared/four/index.js';
|
|
18
|
-
export { PinataClient, type PinataConfig } from '../shared/flap/pinata.js';
|
|
19
|
-
export { pinFileToIPFSWithJWT, pinImageByPath, pinFileToIPFSWithJWTWeb, pinDataURLWithJWTWeb, dataURLToBlob, type PinataPinResp, } from '../shared/flap/pinata.js';
|
|
20
|
-
export { generateWallets, type GeneratedWallet } from '../utils/wallet.js';
|
|
21
|
-
export { getTokenBalancesWithMulticall, type MulticallResult, type MultiTokenBalancesResult } from '../utils/wallet.js';
|
|
22
|
-
export { validatePrivateKeys, type PrivateKeyValidation } from '../utils/wallet.js';
|
|
23
|
-
export { stealthTransfer, type StealthTransferResult, type StealthTransferSimpleParams, } from '../utils/stealth-transfer.js';
|
|
24
|
-
export { holdersMaker, estimateHoldersMakerCost } from '../utils/holders-maker.js';
|
|
25
|
-
export { privateSaleMerkle, batchPrivateSaleMerkle } from '../utils/private-sale.js';
|
|
26
|
-
export { inspectTokenLP, getFactoryFromRouter, registerDYORSwap, registerDex, getChainConfig, } from '../utils/lp-inspect.js';
|
|
27
|
-
export { disperseWithBundle, sweepWithBundle, type AirdropDisperseParams, type AirdropDisperseSignParams, type AirdropSweepParams, type AirdropSweepSignParams, } from '../utils/airdrop-sweep.js';
|