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
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { FlapBundleMerkleConfig, FlapSignConfig, FlapChainForMerkleBundle } from './types.js';
|
|
2
|
-
export type { FlapBundleMerkleConfig, FlapSignConfig, FlapChainForMerkleBundle };
|
|
3
|
-
export declare const BLOCKRAZOR_BUILDER_EOA: "0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20";
|
|
4
|
-
export type FlapAnyConfig = FlapBundleMerkleConfig | FlapSignConfig;
|
|
5
|
-
export declare const CHAIN_ID_MAP: Record<FlapChainForMerkleBundle, number>;
|
|
6
|
-
export declare const MERKLE_SUPPORTED_CHAIN_IDS: readonly [56, 1];
|
|
7
|
-
export type MerkleSupportedChainId = typeof MERKLE_SUPPORTED_CHAIN_IDS[number];
|
|
8
|
-
export declare const PORTAL_ABI: string[];
|
|
9
|
-
export declare const ERRORS: {
|
|
10
|
-
NO_PRIVATE_KEY: {
|
|
11
|
-
en: string;
|
|
12
|
-
zh: string;
|
|
13
|
-
};
|
|
14
|
-
AMOUNT_MISMATCH: {
|
|
15
|
-
en: (buyCount: number, buyerCount: number) => string;
|
|
16
|
-
zh: (buyCount: number, buyerCount: number) => string;
|
|
17
|
-
};
|
|
18
|
-
KEY_AMOUNT_MISMATCH: {
|
|
19
|
-
en: string;
|
|
20
|
-
zh: string;
|
|
21
|
-
};
|
|
22
|
-
SELL_KEY_AMOUNT_MISMATCH: {
|
|
23
|
-
en: string;
|
|
24
|
-
zh: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export declare function getErrorMessage(key: keyof typeof ERRORS, ...args: any[]): string;
|
|
28
|
-
export declare function getTxType(config: FlapAnyConfig): 0 | 2;
|
|
29
|
-
export declare function getGasPriceMultiplier(config: FlapAnyConfig): number;
|
|
30
|
-
export declare function getBundleOptions(config: FlapBundleMerkleConfig, blockOffset?: number): {
|
|
31
|
-
blockOffset: number;
|
|
32
|
-
minBlockOffset: number;
|
|
33
|
-
autoRetry: boolean;
|
|
34
|
-
maxRetries: number;
|
|
35
|
-
};
|
|
36
|
-
export declare function getGasPriceConfig(config: FlapAnyConfig): any;
|
|
37
|
-
/**
|
|
38
|
-
* 检查是否需要提取利润
|
|
39
|
-
* ✅ 强制开启,始终返回 true
|
|
40
|
-
*/
|
|
41
|
-
export declare function shouldExtractProfit(config?: FlapAnyConfig): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* 获取利润率(单位:基点 bps,1 bps = 0.01%)
|
|
44
|
-
* ✅ 硬编码:30 bps = 0.3% = 千分之3
|
|
45
|
-
*/
|
|
46
|
-
export declare function getProfitRateBps(config?: FlapAnyConfig): number;
|
|
47
|
-
/**
|
|
48
|
-
* 获取利润接收地址
|
|
49
|
-
*/
|
|
50
|
-
export declare function getProfitRecipient(config?: FlapAnyConfig): string;
|
|
51
|
-
/**
|
|
52
|
-
* 计算利润和剩余金额
|
|
53
|
-
* ✅ 强制提取利润:使用硬编码的利润率
|
|
54
|
-
* @param amount 原始金额
|
|
55
|
-
* @param config 配置(保留参数但不使用,保持兼容性)
|
|
56
|
-
* @returns { profit: 利润金额, remaining: 剩余金额 }
|
|
57
|
-
*/
|
|
58
|
-
export declare function calculateProfit(amount: bigint, config?: FlapAnyConfig): {
|
|
59
|
-
profit: bigint;
|
|
60
|
-
remaining: bigint;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* 批量计算利润
|
|
64
|
-
* ✅ 强制提取利润:使用硬编码的利润率
|
|
65
|
-
* @param amounts 原始金额数组
|
|
66
|
-
* @param config 配置(保留参数但不使用,保持兼容性)
|
|
67
|
-
* @returns { totalProfit: 总利润, remainingAmounts: 剩余金额数组 }
|
|
68
|
-
*/
|
|
69
|
-
export declare function calculateBatchProfit(amounts: bigint[], config?: FlapAnyConfig): {
|
|
70
|
-
totalProfit: bigint;
|
|
71
|
-
remainingAmounts: bigint[];
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* 获取 BlockRazor 贿赂金额(wei)
|
|
75
|
-
* ✅ 用于提高 bundle 打包优先级
|
|
76
|
-
* @param config 配置
|
|
77
|
-
* @returns 贿赂金额(wei),如果未配置则返回 0n
|
|
78
|
-
*/
|
|
79
|
-
export declare function getBribeAmount(config?: FlapAnyConfig): bigint;
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
import { PROFIT_CONFIG, BLOCKRAZOR_BUILDER_EOA as _BLOCKRAZOR_BUILDER_EOA } from '../../../utils/constants.js';
|
|
3
|
-
import { FLAP_PORTAL_ABI } from '../../abis/common.js';
|
|
4
|
-
// ✅ 从公共模块重新导出
|
|
5
|
-
export const BLOCKRAZOR_BUILDER_EOA = _BLOCKRAZOR_BUILDER_EOA;
|
|
6
|
-
// ✅ Chain ID 映射
|
|
7
|
-
// 注意:Merkle 捆绑服务目前只支持 BSC (56) 和 ETH (1)
|
|
8
|
-
// 其他链仅用于非捆绑的签名交易(顺序广播)
|
|
9
|
-
export const CHAIN_ID_MAP = {
|
|
10
|
-
BSC: 56,
|
|
11
|
-
MONAD: 143,
|
|
12
|
-
XLAYER: 196,
|
|
13
|
-
BASE: 8453, // ✅ 新增 Base(非捆绑,顺序广播)
|
|
14
|
-
};
|
|
15
|
-
// Merkle 服务支持的 chainId(用于类型断言)
|
|
16
|
-
export const MERKLE_SUPPORTED_CHAIN_IDS = [56, 1];
|
|
17
|
-
// ✅ Portal ABI 从公共模块导入
|
|
18
|
-
export const PORTAL_ABI = FLAP_PORTAL_ABI;
|
|
19
|
-
// 错误信息国际化
|
|
20
|
-
export const ERRORS = {
|
|
21
|
-
NO_PRIVATE_KEY: {
|
|
22
|
-
en: 'At least 1 private key (creator) is required',
|
|
23
|
-
zh: '至少需要 1 个私钥(创建者)'
|
|
24
|
-
},
|
|
25
|
-
AMOUNT_MISMATCH: {
|
|
26
|
-
en: (buyCount, buyerCount) => `Buy amount count (${buyCount}) must equal buyer count (${buyerCount})`,
|
|
27
|
-
zh: (buyCount, buyerCount) => `购买金额数量(${buyCount})必须等于买家数量(${buyerCount})`
|
|
28
|
-
},
|
|
29
|
-
KEY_AMOUNT_MISMATCH: {
|
|
30
|
-
en: 'Private key count and amount count must match',
|
|
31
|
-
zh: '私钥和购买金额数量必须一致'
|
|
32
|
-
},
|
|
33
|
-
SELL_KEY_AMOUNT_MISMATCH: {
|
|
34
|
-
en: 'Private key count and sell amount count must match',
|
|
35
|
-
zh: '私钥和卖出数量必须一致'
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export function getErrorMessage(key, ...args) {
|
|
39
|
-
const lang = (process.env.LANG || process.env.LANGUAGE || 'en').toLowerCase().includes('zh') ? 'zh' : 'en';
|
|
40
|
-
const message = ERRORS[key][lang];
|
|
41
|
-
return typeof message === 'function' ? message(...args) : message;
|
|
42
|
-
}
|
|
43
|
-
export function getTxType(config) {
|
|
44
|
-
return config.txType ?? 0;
|
|
45
|
-
}
|
|
46
|
-
export function getGasPriceMultiplier(config) {
|
|
47
|
-
return config.gasPriceMultiplierPercent ?? 50;
|
|
48
|
-
}
|
|
49
|
-
export function getBundleOptions(config, blockOffset) {
|
|
50
|
-
return {
|
|
51
|
-
blockOffset: blockOffset ?? config.bundleBlockOffset ?? 3,
|
|
52
|
-
minBlockOffset: config.minBlockOffset ?? 3,
|
|
53
|
-
autoRetry: config.autoRetryBundle ?? false,
|
|
54
|
-
maxRetries: config.maxBundleRetries ?? 2
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export function getGasPriceConfig(config) {
|
|
58
|
-
const gasPriceConfig = {};
|
|
59
|
-
// ✅ 如果用户明确设置了 minGasPriceGwei,就直接使用它作为 baseGasPrice(不增幅)
|
|
60
|
-
if (config.minGasPriceGwei !== undefined) {
|
|
61
|
-
gasPriceConfig.baseGasPrice = ethers.parseUnits(String(config.minGasPriceGwei), 'gwei');
|
|
62
|
-
gasPriceConfig.multiplierPercent = 0; // 不增幅
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
// 否则使用默认增幅策略
|
|
66
|
-
gasPriceConfig.multiplierPercent = getGasPriceMultiplier(config);
|
|
67
|
-
}
|
|
68
|
-
return gasPriceConfig;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* 检查是否需要提取利润
|
|
72
|
-
* ✅ 强制开启,始终返回 true
|
|
73
|
-
*/
|
|
74
|
-
export function shouldExtractProfit(config) {
|
|
75
|
-
return true; // 强制提取利润
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* 获取利润率(单位:基点 bps,1 bps = 0.01%)
|
|
79
|
-
* ✅ 硬编码:30 bps = 0.3% = 千分之3
|
|
80
|
-
*/
|
|
81
|
-
export function getProfitRateBps(config) {
|
|
82
|
-
return PROFIT_CONFIG.RATE_BPS;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* 获取利润接收地址
|
|
86
|
-
*/
|
|
87
|
-
export function getProfitRecipient(config) {
|
|
88
|
-
return PROFIT_CONFIG.RECIPIENT;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* 计算利润和剩余金额
|
|
92
|
-
* ✅ 强制提取利润:使用硬编码的利润率
|
|
93
|
-
* @param amount 原始金额
|
|
94
|
-
* @param config 配置(保留参数但不使用,保持兼容性)
|
|
95
|
-
* @returns { profit: 利润金额, remaining: 剩余金额 }
|
|
96
|
-
*/
|
|
97
|
-
export function calculateProfit(amount, config) {
|
|
98
|
-
// ✅ 强制提取利润
|
|
99
|
-
const profit = (amount * BigInt(PROFIT_CONFIG.RATE_BPS)) / 10000n;
|
|
100
|
-
const remaining = amount - profit;
|
|
101
|
-
return { profit, remaining };
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* 批量计算利润
|
|
105
|
-
* ✅ 强制提取利润:使用硬编码的利润率
|
|
106
|
-
* @param amounts 原始金额数组
|
|
107
|
-
* @param config 配置(保留参数但不使用,保持兼容性)
|
|
108
|
-
* @returns { totalProfit: 总利润, remainingAmounts: 剩余金额数组 }
|
|
109
|
-
*/
|
|
110
|
-
export function calculateBatchProfit(amounts, config) {
|
|
111
|
-
let totalProfit = 0n;
|
|
112
|
-
const remainingAmounts = [];
|
|
113
|
-
for (const amount of amounts) {
|
|
114
|
-
const { profit, remaining } = calculateProfit(amount, config);
|
|
115
|
-
totalProfit += profit;
|
|
116
|
-
remainingAmounts.push(remaining);
|
|
117
|
-
}
|
|
118
|
-
return { totalProfit, remainingAmounts };
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* 获取 BlockRazor 贿赂金额(wei)
|
|
122
|
-
* ✅ 用于提高 bundle 打包优先级
|
|
123
|
-
* @param config 配置
|
|
124
|
-
* @returns 贿赂金额(wei),如果未配置则返回 0n
|
|
125
|
-
*/
|
|
126
|
-
export function getBribeAmount(config) {
|
|
127
|
-
if (!config)
|
|
128
|
-
return 0n;
|
|
129
|
-
const bribeAmount = config.bribeAmount;
|
|
130
|
-
if (!bribeAmount || bribeAmount <= 0)
|
|
131
|
-
return 0n;
|
|
132
|
-
return ethers.parseEther(String(bribeAmount));
|
|
133
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flap Protocol Bundle 交易方法(Merkle 版本)
|
|
3
|
-
* 使用 Merkle.io Bundle 服务实现原子化交易
|
|
4
|
-
*/
|
|
5
|
-
export * from './config.js';
|
|
6
|
-
export * from './types.js';
|
|
7
|
-
export { createTokenWithBundleBuyMerkle, batchBuyWithBundleMerkle, batchSellWithBundleMerkle } from './core.js';
|
|
8
|
-
export { flapBundleBuyFirstMerkle, type FlapChain, type FlapBuyFirstSignConfig, type FlapBuyFirstConfig, type FlapBundleBuyFirstSignParams, type FlapBundleBuyFirstParams, type FlapBuyFirstResult } from './swap-buy-first.js';
|
|
9
|
-
export { flapPrivateBuyMerkle, flapPrivateSellMerkle, flapBatchPrivateBuyMerkle, flapBatchPrivateSellMerkle } from './private.js';
|
|
10
|
-
export { pancakeProxyBatchBuyMerkle, pancakeProxyBatchSellMerkle, approvePancakeProxy, approvePancakeProxyBatch } from './pancake-proxy.js';
|
|
11
|
-
export { flapDisperseWithBundleMerkle, flapSweepWithBundleMerkle, type FlapDisperseSignParams, type FlapDisperseMerkleResult, type FlapSweepSignParams, type FlapSweepMerkleResult } from './utils.js';
|
|
12
|
-
export { flapBundleCurveToDex, type CurveToDexChain, type DexPoolType, type CurveToDexSignConfig, type CurveBuyerConfig, type DexBuyerConfig, type FlapCurveToDexParams, type FlapCurveToDexResult } from './curve-to-dex.js';
|
|
13
|
-
export { flapBundleCreateToDex, type CreateToDexChain, type CreateToDexSignConfig, type CreateTokenInfo, type FlapCreateToDexParams, type FlapCreateToDexResult, type CurveBuyerConfig as CreateCurveBuyerConfig, type DexBuyerConfig as CreateDexBuyerConfig, type DexPoolType as CreateDexPoolType } from './create-to-dex.js';
|
|
14
|
-
export { flapBundleSwapMerkle, flapBatchSwapMerkle, flapQuickBatchSwapMerkle, flapCrossSwapMerkle, type FlapSwapSignConfig, type FlapSwapConfig, type FlapBundleSwapSignParams, type FlapBundleSwapParams, type FlapSwapResult, type FlapBatchSwapSignParams, type FlapBatchSwapResult, type FlapQuickBatchSwapSignParams, type FlapQuickBatchSwapResult, type FlapCrossSwapParams, type FlapCrossSwapResult, type UserType } from './swap.js';
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flap Protocol 内盘捆绑换手(Merkle Bundle)- 先买后卖
|
|
3
|
-
*
|
|
4
|
-
* 功能:钱包B先买入代币 → 钱包A卖出相同数量 → 原子执行
|
|
5
|
-
*/
|
|
6
|
-
import { CommonBundleConfig } from '../../../utils/bundle-helpers.js';
|
|
7
|
-
import { FlapSignConfig } from './config.js';
|
|
8
|
-
import type { GeneratedWallet } from '../../../utils/wallet.js';
|
|
9
|
-
export type FlapChain = 'bsc' | 'xlayer' | 'base';
|
|
10
|
-
export type UserType = 'v0' | 'v1';
|
|
11
|
-
export interface FlapBuyFirstSignConfig extends FlapSignConfig {
|
|
12
|
-
reserveGasETH?: number;
|
|
13
|
-
skipQuoteOnError?: boolean;
|
|
14
|
-
userType?: UserType;
|
|
15
|
-
}
|
|
16
|
-
export interface FlapBuyFirstConfig extends CommonBundleConfig {
|
|
17
|
-
apiKey: string;
|
|
18
|
-
customRpcUrl?: string;
|
|
19
|
-
bundleBlockOffset?: number;
|
|
20
|
-
reserveGasETH?: number;
|
|
21
|
-
skipQuoteOnError?: boolean;
|
|
22
|
-
waitForConfirmation?: boolean;
|
|
23
|
-
waitTimeoutMs?: number;
|
|
24
|
-
}
|
|
25
|
-
export interface FlapBundleBuyFirstSignParams {
|
|
26
|
-
chain: FlapChain;
|
|
27
|
-
buyerPrivateKey?: string;
|
|
28
|
-
buyerPrivateKeys?: string[];
|
|
29
|
-
sellerPrivateKey?: string;
|
|
30
|
-
sellerPrivateKeys?: string[];
|
|
31
|
-
tokenAddress: string;
|
|
32
|
-
buyerFunds?: string;
|
|
33
|
-
buyerFundsPercentage?: number;
|
|
34
|
-
config: FlapBuyFirstSignConfig;
|
|
35
|
-
quoteToken?: string;
|
|
36
|
-
quoteTokenDecimals?: number;
|
|
37
|
-
buyCount?: number;
|
|
38
|
-
sellCount?: number;
|
|
39
|
-
}
|
|
40
|
-
export interface FlapBundleBuyFirstParams {
|
|
41
|
-
chain: FlapChain;
|
|
42
|
-
buyerPrivateKey: string;
|
|
43
|
-
sellerPrivateKey: string;
|
|
44
|
-
tokenAddress: string;
|
|
45
|
-
buyerFunds?: string;
|
|
46
|
-
buyerFundsPercentage?: number;
|
|
47
|
-
config: FlapBuyFirstConfig;
|
|
48
|
-
}
|
|
49
|
-
/** ✅ Flap BuyFirst 结果(简化版) */
|
|
50
|
-
export type FlapBuyFirstResult = {
|
|
51
|
-
signedTransactions: string[];
|
|
52
|
-
profitHopWallets?: GeneratedWallet[];
|
|
53
|
-
metadata?: {
|
|
54
|
-
buyerAddress: string;
|
|
55
|
-
sellerAddress: string;
|
|
56
|
-
buyAmount: string;
|
|
57
|
-
sellAmount: string;
|
|
58
|
-
profitAmount?: string;
|
|
59
|
-
buyCount?: number;
|
|
60
|
-
sellCount?: number;
|
|
61
|
-
buyAmounts?: string[];
|
|
62
|
-
sellAmounts?: string[];
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export declare function flapBundleBuyFirstMerkle(params: FlapBundleBuyFirstSignParams): Promise<FlapBuyFirstResult>;
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flap Protocol 内盘捆绑换手(Merkle Bundle)
|
|
3
|
-
*
|
|
4
|
-
* 功能:钱包A卖出代币 → 钱包B买入相同数量 → 原子执行
|
|
5
|
-
*/
|
|
6
|
-
import { CommonBundleConfig } from '../../../utils/bundle-helpers.js';
|
|
7
|
-
import { type GeneratedWallet } from '../../../utils/wallet.js';
|
|
8
|
-
export type UserType = 'v0' | 'v1';
|
|
9
|
-
export interface FlapSwapSignConfig {
|
|
10
|
-
rpcUrl: string;
|
|
11
|
-
gasLimit?: number | bigint;
|
|
12
|
-
gasLimitMultiplier?: number;
|
|
13
|
-
minGasPriceGwei?: number;
|
|
14
|
-
maxGasPriceGwei?: number;
|
|
15
|
-
txType?: 0 | 2;
|
|
16
|
-
chainId?: number;
|
|
17
|
-
reserveGasETH?: number;
|
|
18
|
-
skipQuoteOnError?: boolean;
|
|
19
|
-
skipApprovalCheck?: boolean;
|
|
20
|
-
bribeAmount?: number;
|
|
21
|
-
userType?: UserType;
|
|
22
|
-
}
|
|
23
|
-
export type FlapChain = 'bsc' | 'xlayer' | 'base';
|
|
24
|
-
export interface FlapSwapConfig extends CommonBundleConfig {
|
|
25
|
-
apiKey: string;
|
|
26
|
-
customRpcUrl?: string;
|
|
27
|
-
bundleBlockOffset?: number;
|
|
28
|
-
reserveGasETH?: number;
|
|
29
|
-
skipQuoteOnError?: boolean;
|
|
30
|
-
waitForConfirmation?: boolean;
|
|
31
|
-
waitTimeoutMs?: number;
|
|
32
|
-
skipApprovalCheck?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface FlapBundleSwapSignParams {
|
|
35
|
-
chain: FlapChain;
|
|
36
|
-
sellerPrivateKey: string;
|
|
37
|
-
sellAmount?: string;
|
|
38
|
-
sellPercentage?: number;
|
|
39
|
-
buyerPrivateKey: string;
|
|
40
|
-
tokenAddress: string;
|
|
41
|
-
config: FlapSwapSignConfig;
|
|
42
|
-
quoteToken?: string;
|
|
43
|
-
quoteTokenDecimals?: number;
|
|
44
|
-
startNonces?: number[];
|
|
45
|
-
}
|
|
46
|
-
export interface FlapBundleSwapParams {
|
|
47
|
-
chain: FlapChain;
|
|
48
|
-
sellerPrivateKey: string;
|
|
49
|
-
sellAmount?: string;
|
|
50
|
-
sellPercentage?: number;
|
|
51
|
-
buyerPrivateKey: string;
|
|
52
|
-
tokenAddress: string;
|
|
53
|
-
config: FlapSwapConfig;
|
|
54
|
-
}
|
|
55
|
-
/** ✅ Flap Swap 结果(简化版) */
|
|
56
|
-
export type FlapSwapResult = {
|
|
57
|
-
signedTransactions: string[];
|
|
58
|
-
profitHopWallets?: GeneratedWallet[];
|
|
59
|
-
metadata?: {
|
|
60
|
-
sellerAddress: string;
|
|
61
|
-
buyerAddress: string;
|
|
62
|
-
sellAmount: string;
|
|
63
|
-
buyAmount: string;
|
|
64
|
-
hasApproval?: boolean;
|
|
65
|
-
profitAmount?: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Flap内盘捆绑换手
|
|
70
|
-
* ✅ 支持 quoteToken:传入 USDT 等地址时,卖出得到该代币,买入使用该代币
|
|
71
|
-
*/
|
|
72
|
-
export declare function flapBundleSwapMerkle(params: FlapBundleSwapSignParams): Promise<FlapSwapResult>;
|
|
73
|
-
/**
|
|
74
|
-
* Flap 批量换手参数(一卖多买)
|
|
75
|
-
*/
|
|
76
|
-
export interface FlapBatchSwapSignParams {
|
|
77
|
-
chain: FlapChain;
|
|
78
|
-
sellerPrivateKey: string;
|
|
79
|
-
sellAmount?: string;
|
|
80
|
-
sellPercentage?: number;
|
|
81
|
-
buyerPrivateKeys: string[];
|
|
82
|
-
buyerRatios?: number[];
|
|
83
|
-
tokenAddress: string;
|
|
84
|
-
config: FlapSwapSignConfig;
|
|
85
|
-
quoteToken?: string;
|
|
86
|
-
quoteTokenDecimals?: number;
|
|
87
|
-
startNonces?: number[];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Flap 批量换手结果
|
|
91
|
-
*/
|
|
92
|
-
export interface FlapBatchSwapResult {
|
|
93
|
-
signedTransactions: string[];
|
|
94
|
-
profitHopWallets?: GeneratedWallet[];
|
|
95
|
-
metadata?: {
|
|
96
|
-
sellerAddress: string;
|
|
97
|
-
buyerAddresses: string[];
|
|
98
|
-
sellAmount: string;
|
|
99
|
-
buyAmounts: string[];
|
|
100
|
-
hasApproval?: boolean;
|
|
101
|
-
profitAmount?: string;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Flap 内盘批量换手(一卖多买)
|
|
106
|
-
*
|
|
107
|
-
* 功能:主钱包一次卖出 → 多个子钱包同时买入 → 在同一个区块中完成
|
|
108
|
-
* 限制:最多 24 个买方(服务器限制 25 笔交易,包含 1 笔利润交易)
|
|
109
|
-
*/
|
|
110
|
-
export declare function flapBatchSwapMerkle(params: FlapBatchSwapSignParams): Promise<FlapBatchSwapResult>;
|
|
111
|
-
/**
|
|
112
|
-
* Flap 快捷批量换手参数
|
|
113
|
-
*/
|
|
114
|
-
export interface FlapQuickBatchSwapSignParams {
|
|
115
|
-
chain: FlapChain;
|
|
116
|
-
sellerPrivateKey: string;
|
|
117
|
-
sellAmount?: string;
|
|
118
|
-
sellPercentage?: number;
|
|
119
|
-
buyerPrivateKeys: string[];
|
|
120
|
-
buyerRatios?: number[];
|
|
121
|
-
buyerAmounts?: string[];
|
|
122
|
-
tokenAddress: string;
|
|
123
|
-
config: FlapSwapSignConfig;
|
|
124
|
-
quoteToken?: string;
|
|
125
|
-
quoteTokenDecimals?: number;
|
|
126
|
-
disperseHopCount?: number;
|
|
127
|
-
startNonces?: number[];
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Flap 快捷批量换手结果
|
|
131
|
-
*/
|
|
132
|
-
export interface FlapQuickBatchSwapResult {
|
|
133
|
-
signedTransactions: string[];
|
|
134
|
-
disperseHopWallets?: GeneratedWallet[];
|
|
135
|
-
profitHopWallets?: GeneratedWallet[];
|
|
136
|
-
metadata?: {
|
|
137
|
-
sellerAddress: string;
|
|
138
|
-
buyerAddresses: string[];
|
|
139
|
-
sellAmount: string;
|
|
140
|
-
estimatedOutput: string;
|
|
141
|
-
transferAmounts: string[];
|
|
142
|
-
profitAmount?: string;
|
|
143
|
-
useNativeToken: boolean;
|
|
144
|
-
disperseHopCount?: number;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
/** 交叉换手参数 */
|
|
148
|
-
export interface FlapCrossSwapParams {
|
|
149
|
-
chain: FlapChain;
|
|
150
|
-
/** 卖方私钥列表(按顺序轮流卖出) */
|
|
151
|
-
sellerPrivateKeys: string[];
|
|
152
|
-
/** 每个卖方的卖出数量(与 sellerPrivateKeys 长度一致) */
|
|
153
|
-
sellAmounts: string[];
|
|
154
|
-
/** 买方私钥列表(按顺序轮流分配,每笔平分) */
|
|
155
|
-
buyerPrivateKeys: string[];
|
|
156
|
-
tokenAddress: string;
|
|
157
|
-
config: FlapSwapSignConfig;
|
|
158
|
-
quoteToken?: string;
|
|
159
|
-
quoteTokenDecimals?: number;
|
|
160
|
-
/** 每次卖出分配给多少个买方(默认使用全部买方平分) */
|
|
161
|
-
buyersPerSell?: number;
|
|
162
|
-
/** 转账多跳数(可选) */
|
|
163
|
-
disperseHopCount?: number;
|
|
164
|
-
}
|
|
165
|
-
/** 交叉换手结果 */
|
|
166
|
-
export interface FlapCrossSwapResult {
|
|
167
|
-
signedTransactions: string[];
|
|
168
|
-
/** 每轮的元数据列表 */
|
|
169
|
-
rounds: Array<{
|
|
170
|
-
sellerAddress: string;
|
|
171
|
-
buyerAddresses: string[];
|
|
172
|
-
sellAmount: string;
|
|
173
|
-
bundleHash?: string;
|
|
174
|
-
}>;
|
|
175
|
-
/** 汇总的中间钱包信息(转账/利润) */
|
|
176
|
-
disperseHopWallets?: GeneratedWallet[];
|
|
177
|
-
profitHopWallets?: GeneratedWallet[];
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Flap 内盘快捷批量换手(资金利用率模式)
|
|
181
|
-
*
|
|
182
|
-
* 流程:[贿赂] → [卖出] → [转账多跳...] → [买入1, 买入2, ...] → [利润]
|
|
183
|
-
*
|
|
184
|
-
* 特点:
|
|
185
|
-
* - 子钱包不需要预先有余额
|
|
186
|
-
* - 资金来自主钱包卖出代币所得
|
|
187
|
-
* - 提升资金利用率
|
|
188
|
-
* - 支持原生代币(BNB/OKB/ETH)和 ERC20(如 USDT)两种模式
|
|
189
|
-
* - ✅ 支持转账多跳,隐藏资金流向
|
|
190
|
-
*
|
|
191
|
-
* 限制:根据多跳数动态计算最大买方数量
|
|
192
|
-
*/
|
|
193
|
-
export declare function flapQuickBatchSwapMerkle(params: FlapQuickBatchSwapSignParams): Promise<FlapQuickBatchSwapResult>;
|
|
194
|
-
/**
|
|
195
|
-
* Flap 交叉换手(多卖多买,循环执行)
|
|
196
|
-
* - 每个卖方单独卖出,买入金额由卖出所得等分分配给当轮买方
|
|
197
|
-
* - 利润刮取、转账多跳逻辑继承 flapQuickBatchSwapMerkle
|
|
198
|
-
* - 结果按顺序拼接 signedTransactions(可交由前端/后端顺序广播)
|
|
199
|
-
* - ✅ 正确处理 nonce:同一钱包在多轮中使用时 nonce 自动递增
|
|
200
|
-
*/
|
|
201
|
-
export declare function flapCrossSwapMerkle(params: FlapCrossSwapParams): Promise<FlapCrossSwapResult>;
|