four-flap-meme-sdk 2.2.2 → 2.2.4
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 +41 -6
- package/README.md +31 -0
- package/README.zh-CN.md +41 -6
- package/dist/__tests__/subpath-exports.test.d.ts +1 -0
- package/dist/__tests__/subpath-exports.test.js +64 -0
- package/dist/abis/common.d.ts +85 -0
- package/dist/abis/common.js +264 -0
- package/dist/abis/contracts/TaxToken.json +969 -0
- package/dist/abis/contracts/TokenManager2.json +136 -0
- package/dist/abis/contracts/index.d.ts +5 -0
- package/dist/abis/contracts/index.js +5 -0
- package/dist/abis/flap/index.d.ts +3 -0
- package/dist/abis/flap/index.js +3 -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.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 +8 -0
- package/dist/abis/index.js +11 -0
- package/dist/bundle-core/__tests__/config-helpers.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/config-helpers.test.js +28 -0
- package/dist/bundle-core/__tests__/facade-parity.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/facade-parity.test.js +33 -0
- package/dist/bundle-core/__tests__/sign-context-helpers.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/sign-context-helpers.test.js +60 -0
- package/dist/bundle-core/__tests__/sign-fixture.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/sign-fixture.test.js +220 -0
- package/dist/bundle-core/__tests__/sign-fixtures.d.ts +10 -0
- package/dist/bundle-core/__tests__/sign-fixtures.js +16 -0
- package/dist/bundle-core/config-helpers.d.ts +36 -0
- package/dist/bundle-core/config-helpers.js +57 -0
- package/dist/bundle-core/errors.d.ts +50 -0
- package/dist/bundle-core/errors.js +35 -0
- package/dist/bundle-core/four-meme/approve-tokenmanager.d.ts +7 -0
- package/dist/bundle-core/four-meme/approve-tokenmanager.js +99 -0
- package/dist/bundle-core/four-meme/core-helpers.d.ts +8 -0
- package/dist/bundle-core/four-meme/core-helpers.js +40 -0
- package/dist/bundle-core/four-meme/core.d.ts +4 -0
- package/dist/bundle-core/four-meme/core.js +515 -0
- package/dist/bundle-core/four-meme/pancake-proxy.d.ts +28 -0
- package/dist/bundle-core/four-meme/pancake-proxy.js +679 -0
- package/dist/bundle-core/four-meme/private.d.ts +27 -0
- package/dist/bundle-core/four-meme/private.js +465 -0
- package/dist/bundle-core/four-meme/sign-context-helpers.d.ts +2 -0
- package/dist/bundle-core/four-meme/sign-context-helpers.js +2 -0
- package/dist/bundle-core/four-meme/swap-buy-first.d.ts +8 -0
- package/dist/bundle-core/four-meme/swap-buy-first.js +493 -0
- package/dist/bundle-core/four-meme/swap-hop-helpers.d.ts +6 -0
- package/dist/bundle-core/four-meme/swap-hop-helpers.js +63 -0
- package/dist/bundle-core/four-meme/swap-internal.d.ts +3 -0
- package/dist/bundle-core/four-meme/swap-internal.js +18 -0
- package/dist/bundle-core/four-meme/swap-sign-helpers.d.ts +27 -0
- package/dist/bundle-core/four-meme/swap-sign-helpers.js +105 -0
- package/dist/bundle-core/four-meme/swap.d.ts +17 -0
- package/dist/bundle-core/four-meme/swap.js +505 -0
- package/dist/bundle-core/four-meme/types/buy-first.d.ts +50 -0
- package/dist/bundle-core/four-meme/types/buy-first.js +1 -0
- package/dist/bundle-core/four-meme/types/core-flow.d.ts +63 -0
- package/dist/bundle-core/four-meme/types/core-flow.js +1 -0
- package/dist/bundle-core/four-meme/types/index.d.ts +600 -0
- package/dist/bundle-core/four-meme/types/index.js +1 -0
- package/dist/bundle-core/four-meme/types/swap-internal.d.ts +19 -0
- package/dist/bundle-core/four-meme/types/swap-internal.js +1 -0
- package/dist/bundle-core/four-meme/types.d.ts +1 -0
- package/dist/bundle-core/four-meme/types.js +1 -0
- package/dist/bundle-core/four-meme/utils-disperse.d.ts +7 -0
- package/dist/bundle-core/four-meme/utils-disperse.js +396 -0
- package/dist/bundle-core/four-meme/utils-pairwise.d.ts +8 -0
- package/dist/bundle-core/four-meme/utils-pairwise.js +328 -0
- package/dist/bundle-core/four-meme/utils-sweep.d.ts +8 -0
- package/dist/bundle-core/four-meme/utils-sweep.js +744 -0
- package/dist/bundle-core/index.d.ts +8 -0
- package/dist/bundle-core/index.js +8 -0
- package/dist/bundle-core/internal.d.ts +21 -0
- package/dist/bundle-core/internal.js +182 -0
- package/dist/bundle-core/sign-context-helpers.d.ts +25 -0
- package/dist/bundle-core/sign-context-helpers.js +67 -0
- package/dist/bundle-core/submit.d.ts +293 -0
- package/dist/bundle-core/submit.js +727 -0
- package/dist/bundle-core/types/index.d.ts +8 -0
- package/dist/bundle-core/types/index.js +1 -0
- package/dist/bundle-core/types.d.ts +1 -0
- package/dist/bundle-core/types.js +1 -0
- 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 +159 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +117 -0
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +1 -91
- package/dist/chains/bsc/pancake/bundle-buy-first.js +97 -212
- 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/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 +4 -1
- package/dist/chains/eni/batch-router/bundle-approve.js +4 -3
- package/dist/chains/eni/batch-router/transfer.js +55 -25
- 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 +1 -1
- 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 +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 +9 -6
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +28 -44
- package/dist/chains/eni/platforms/daoaas/portal.js +10 -6
- package/dist/chains/eni/platforms/dswap/liquidity.js +58 -26
- 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 +87 -46
- package/dist/chains/eni/platforms/fair-launch/pool.js +4 -1
- 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 +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 +107 -31
- 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 +286 -0
- package/dist/chains/index.d.ts +13 -0
- package/dist/chains/index.js +13 -0
- 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 +93 -59
- package/dist/chains/xlayer/eip7702/bundle-sell.d.ts +2 -6
- package/dist/chains/xlayer/eip7702/bundle-sell.js +29 -111
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +3 -65
- package/dist/chains/xlayer/eip7702/bundle-swap.js +51 -245
- package/dist/chains/xlayer/eip7702/constants.d.ts +1 -16
- package/dist/chains/xlayer/eip7702/constants.js +3 -21
- 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 +63 -307
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +26 -0
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +57 -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.js +1 -1
- package/dist/chains/xlayer/eoa/dex-helpers.js +5 -5
- 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 +3 -3
- 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/contracts/helper3.d.ts +20 -5
- package/dist/contracts/helper3.js +56 -20
- package/dist/contracts/tm-bundle-helpers.d.ts +88 -0
- package/dist/contracts/tm-bundle-helpers.js +72 -0
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.d.ts +1 -26
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.js +1 -113
- package/dist/contracts/tm-bundle-merkle/config.d.ts +5 -67
- package/dist/contracts/tm-bundle-merkle/config.js +2 -114
- package/dist/contracts/tm-bundle-merkle/core.d.ts +1 -4
- package/dist/contracts/tm-bundle-merkle/core.js +1 -591
- 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 +2 -46
- package/dist/contracts/tm-bundle-merkle/internal.js +2 -238
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.d.ts +1 -28
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.js +1 -686
- package/dist/contracts/tm-bundle-merkle/private.d.ts +1 -27
- package/dist/contracts/tm-bundle-merkle/private.js +1 -476
- package/dist/contracts/tm-bundle-merkle/submit.d.ts +3 -314
- package/dist/contracts/tm-bundle-merkle/submit.js +3 -928
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.d.ts +2 -55
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.js +2 -506
- package/dist/contracts/tm-bundle-merkle/swap-internal.d.ts +1 -3
- package/dist/contracts/tm-bundle-merkle/swap-internal.js +1 -18
- package/dist/contracts/tm-bundle-merkle/swap.d.ts +2 -144
- package/dist/contracts/tm-bundle-merkle/swap.js +2 -764
- package/dist/contracts/tm-bundle-merkle/types.d.ts +1 -476
- package/dist/contracts/tm-bundle-merkle/utils-disperse.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-disperse.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-sweep.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-sweep.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils.d.ts +6 -18
- package/dist/contracts/tm-bundle-merkle/utils.js +6 -1501
- package/dist/contracts/tm-bundle.d.ts +3 -51
- package/dist/contracts/tm-bundle.js +108 -177
- package/dist/contracts/tm.d.ts +3 -2
- package/dist/contracts/tm.js +37 -32
- package/dist/contracts/tm1.js +9 -4
- package/dist/contracts/tm2.js +9 -4
- package/dist/dex/direct-router-helpers.d.ts +264 -0
- package/dist/dex/direct-router-helpers.js +539 -0
- package/dist/dex/direct-router.d.ts +3 -125
- package/dist/dex/direct-router.js +237 -666
- package/dist/dex/types.d.ts +81 -0
- package/dist/dex/types.js +1 -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/flap/index.d.ts +10 -0
- package/dist/flap/index.js +8 -0
- package/dist/flows/create.d.ts +2 -1
- package/dist/flows/create.js +6 -6
- package/dist/flows/index.d.ts +1 -0
- package/dist/flows/index.js +1 -0
- package/dist/index.d.ts +20 -85
- package/dist/index.js +20 -215
- package/dist/merkle/index.d.ts +12 -0
- package/dist/merkle/index.js +11 -0
- package/dist/shared/abis/common.d.ts +2 -83
- package/dist/shared/abis/common.js +2 -252
- package/dist/shared/abis/index.d.ts +5 -6
- package/dist/shared/abis/index.js +5 -7
- package/dist/shared/clients/blockrazor.js +39 -25
- package/dist/shared/clients/club48.d.ts +2 -2
- package/dist/shared/clients/club48.js +34 -29
- package/dist/shared/clients/emitservice.js +2 -0
- package/dist/shared/clients/four.d.ts +21 -6
- package/dist/shared/clients/four.js +29 -24
- package/dist/shared/clients/index.d.ts +8 -0
- package/dist/shared/clients/index.js +8 -0
- package/dist/shared/clients/merkle.js +27 -34
- package/dist/shared/constants/addresses.d.ts +1 -1
- package/dist/shared/constants/addresses.js +11 -2
- 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 +2 -6
- package/dist/shared/constants/index.d.ts +3 -0
- package/dist/shared/constants/index.js +1 -0
- package/dist/shared/constants/quote.d.ts +30 -0
- package/dist/shared/constants/quote.js +37 -0
- package/dist/shared/flap/abi.js +1 -1
- package/dist/shared/flap/constants.d.ts +1 -2
- package/dist/shared/flap/constants.js +2 -3
- package/dist/shared/flap/curve.js +3 -0
- package/dist/shared/flap/errors.d.ts +1 -4
- package/dist/shared/flap/errors.js +20 -1
- package/dist/shared/flap/index.d.ts +5 -4
- package/dist/shared/flap/index.js +5 -4
- package/dist/shared/flap/meta.d.ts +22 -18
- package/dist/shared/flap/meta.js +12 -17
- package/dist/shared/flap/permit.js +5 -2
- package/dist/shared/flap/pinata.d.ts +22 -6
- package/dist/shared/flap/pinata.js +21 -26
- package/dist/shared/flap/portal-bundle-merkle/config.d.ts +3 -72
- package/dist/shared/flap/portal-bundle-merkle/config.js +4 -124
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.d.ts +32 -0
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.js +83 -0
- package/dist/shared/flap/portal-bundle-merkle/core.d.ts +0 -4
- package/dist/shared/flap/portal-bundle-merkle/core.js +96 -277
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.d.ts +7 -2
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.js +107 -206
- package/dist/shared/flap/portal-bundle-merkle/curve-to-dex.js +100 -92
- package/dist/shared/flap/portal-bundle-merkle/index.d.ts +11 -7
- package/dist/shared/flap/portal-bundle-merkle/index.js +4 -7
- package/dist/shared/flap/portal-bundle-merkle/pancake-proxy.js +71 -68
- package/dist/shared/flap/portal-bundle-merkle/private.js +61 -114
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +125 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.js +113 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.d.ts +1 -64
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.js +66 -247
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.d.ts +149 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.js +259 -0
- package/dist/shared/flap/portal-bundle-merkle/swap.d.ts +2 -71
- package/dist/shared/flap/portal-bundle-merkle/swap.js +103 -410
- package/dist/shared/flap/portal-bundle-merkle/types.d.ts +88 -9
- package/dist/shared/flap/portal-bundle-merkle/utils.d.ts +1 -80
- package/dist/shared/flap/portal-bundle-merkle/utils.js +145 -265
- package/dist/shared/flap/portal-bundle.js +55 -56
- package/dist/shared/flap/portal-create-token.d.ts +80 -0
- package/dist/shared/flap/portal-create-token.js +257 -0
- package/dist/shared/flap/portal.d.ts +14 -3
- package/dist/shared/flap/portal.js +50 -25
- package/dist/shared/flap/vanity.d.ts +1 -5
- package/dist/shared/flap/vanity.js +6 -17
- package/dist/shared/flap/vault.d.ts +17 -124
- package/dist/shared/flap/vault.js +67 -148
- package/dist/shared/foundation/dex/v3-path.d.ts +6 -0
- package/dist/shared/foundation/dex/v3-path.js +35 -0
- package/dist/shared/foundation/gas/bundle-gas.d.ts +49 -0
- package/dist/shared/foundation/gas/bundle-gas.js +93 -0
- package/dist/shared/foundation/gas/profit-hop.d.ts +20 -0
- package/dist/shared/foundation/gas/profit-hop.js +72 -0
- package/dist/shared/foundation/index.d.ts +13 -0
- package/dist/shared/foundation/index.js +12 -0
- package/dist/shared/foundation/nonce/nonce-manager.d.ts +17 -0
- package/dist/shared/foundation/nonce/nonce-manager.js +183 -0
- package/dist/shared/foundation/normalize-unknown.d.ts +9 -0
- package/dist/shared/foundation/normalize-unknown.js +29 -0
- package/dist/shared/foundation/sdk-logger.d.ts +13 -0
- package/dist/shared/foundation/sdk-logger.js +12 -0
- package/dist/shared/foundation/tx/build-request.d.ts +17 -0
- package/dist/shared/foundation/tx/build-request.js +25 -0
- package/dist/shared/foundation/tx/sign-batch.d.ts +5 -0
- package/dist/shared/foundation/tx/sign-batch.js +26 -0
- package/dist/shared/foundation/tx/wallet-sign-patch.d.ts +1 -0
- package/dist/shared/foundation/tx/wallet-sign-patch.js +18 -0
- package/dist/shared/foundation/types/airdrop-sweep.d.ts +79 -0
- package/dist/shared/foundation/types/airdrop-sweep.js +1 -0
- package/dist/shared/foundation/types/erc20.d.ts +65 -0
- package/dist/shared/foundation/types/erc20.js +1 -0
- package/dist/shared/foundation/types/holders-maker.d.ts +64 -0
- package/dist/shared/foundation/types/holders-maker.js +1 -0
- package/dist/shared/foundation/types/index.d.ts +7 -0
- package/dist/shared/foundation/types/index.js +1 -0
- package/dist/shared/foundation/types/lp-inspect.d.ts +102 -0
- package/dist/shared/foundation/types/lp-inspect.js +1 -0
- package/dist/shared/foundation/types/multicall.d.ts +5 -0
- package/dist/shared/foundation/types/multicall.js +1 -0
- package/dist/shared/foundation/types/private-sale.d.ts +35 -0
- package/dist/shared/foundation/types/private-sale.js +1 -0
- package/dist/shared/foundation/types/quote-helpers.d.ts +17 -0
- package/dist/shared/foundation/types/quote-helpers.js +1 -0
- package/dist/shared/four/tax-token.d.ts +1 -1
- package/dist/shared/four/tax-token.js +27 -7
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.js +4 -0
- package/dist/types/errors.d.ts +27 -0
- package/dist/types/errors.js +34 -0
- 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/erc20.d.ts +7 -89
- package/dist/utils/erc20.js +94 -125
- package/dist/utils/errors.d.ts +12 -1
- package/dist/utils/errors.js +60 -1
- package/dist/utils/holders-maker/addresses.d.ts +12 -0
- package/dist/utils/holders-maker/addresses.js +15 -0
- package/dist/utils/holders-maker/buy-tx.d.ts +44 -0
- package/dist/utils/holders-maker/buy-tx.js +278 -0
- package/dist/utils/holders-maker/constants.d.ts +6 -0
- package/dist/utils/holders-maker/constants.js +7 -0
- package/dist/utils/holders-maker/disperse.d.ts +18 -0
- package/dist/utils/holders-maker/disperse.js +90 -0
- package/dist/utils/holders-maker/routing.d.ts +4 -0
- package/dist/utils/holders-maker/routing.js +45 -0
- package/dist/utils/holders-maker/transfer-tx.d.ts +4 -0
- package/dist/utils/holders-maker/transfer-tx.js +67 -0
- package/dist/utils/holders-maker-helpers.d.ts +9 -0
- package/dist/utils/holders-maker-helpers.js +9 -0
- package/dist/utils/holders-maker.d.ts +2 -138
- package/dist/utils/holders-maker.js +26 -661
- package/dist/utils/hop-chains.d.ts +35 -0
- package/dist/utils/hop-chains.js +215 -0
- package/dist/utils/lp-inspect-helpers.d.ts +9 -0
- package/dist/utils/lp-inspect-helpers.js +109 -0
- package/dist/utils/lp-inspect.d.ts +2 -112
- package/dist/utils/lp-inspect.js +73 -223
- package/dist/utils/mpcExclusive.d.ts +2 -5
- package/dist/utils/mpcExclusive.js +4 -3
- package/dist/utils/private-sale.d.ts +2 -58
- package/dist/utils/private-sale.js +4 -15
- package/dist/utils/provider-factory.d.ts +4 -0
- package/dist/utils/provider-factory.js +10 -0
- package/dist/utils/quote-helpers.d.ts +4 -45
- package/dist/utils/quote-helpers.js +17 -74
- package/dist/utils/stealth-transfer.d.ts +2 -28
- package/dist/utils/stealth-transfer.js +31 -15
- package/dist/utils/swap-helpers.d.ts +2 -15
- package/dist/utils/swap-helpers.js +6 -11
- 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/erc20.d.ts +1 -0
- package/dist/utils/types/erc20.js +1 -0
- package/dist/utils/types/errors.d.ts +1 -0
- package/dist/utils/types/errors.js +1 -0
- package/dist/utils/types/holders-maker.d.ts +1 -0
- package/dist/utils/types/holders-maker.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/lp-inspect.d.ts +1 -0
- package/dist/utils/types/lp-inspect.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/private-sale.d.ts +1 -0
- package/dist/utils/types/private-sale.js +1 -0
- package/dist/utils/types/quote-helpers.d.ts +1 -0
- package/dist/utils/types/quote-helpers.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 +2 -25
- package/dist/utils/wallet.js +13 -10
- package/dist/vanity/index.d.ts +5 -0
- package/dist/vanity/index.js +5 -0
- package/package.json +160 -4
- package/src/abis/contracts/TaxToken.json +969 -0
- package/src/abis/contracts/TokenManager.json +836 -0
- package/src/abis/contracts/TokenManager2.json +136 -0
- package/src/abis/contracts/TokenManagerHelper3.json +993 -0
- package/dist/shared/abis/TaxToken.json +0 -105
- package/dist/shared/abis/TokenManager2.json +0 -60
- /package/dist/{shared/abis → abis/contracts}/TokenManager.json +0 -0
- /package/dist/{shared/abis → abis/contracts}/TokenManagerHelper3.json +0 -0
package/dist/utils/lp-inspect.js
CHANGED
|
@@ -1,133 +1,20 @@
|
|
|
1
|
-
import { Contract, JsonRpcProvider, Interface, formatUnits, formatEther } from 'ethers';
|
|
2
|
-
import { ADDRESSES, ZERO_ADDRESS } from './constants.js';
|
|
3
|
-
import { MULTICALL3_ABI, V2_FACTORY_ABI, V2_PAIR_ABI, V3_FACTORY_ABI, ERC20_ABI } from '../shared/abis/common.js';
|
|
4
|
-
import { Helper3 } from '../contracts/helper3.js';
|
|
5
|
-
import { FlapPortal } from '../shared/flap/portal.js';
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// 链配置
|
|
8
|
-
// ============================================================================
|
|
9
|
-
/** 默认 V3 费率档位(合并 PancakeSwap 和 Uniswap 的所有档位) */
|
|
10
|
-
const DEFAULT_V3_FEE_TIERS = [100, 500, 2500, 3000, 10000];
|
|
11
|
-
/** 链 DEX 配置 */
|
|
12
|
-
const CHAIN_DEX_CONFIGS = {
|
|
13
|
-
BSC: {
|
|
14
|
-
wrappedNative: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
15
|
-
wrappedNativeSymbol: 'WBNB',
|
|
16
|
-
stableCoins: [
|
|
17
|
-
{ address: '0x55d398326f99059fF775485246999027B3197955', symbol: 'USDT', decimals: 18 },
|
|
18
|
-
{ address: '0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d', symbol: 'USDC', decimals: 18 },
|
|
19
|
-
],
|
|
20
|
-
dexes: {
|
|
21
|
-
PANCAKESWAP: {
|
|
22
|
-
name: 'PancakeSwap',
|
|
23
|
-
v2Factory: '0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73',
|
|
24
|
-
v3Factory: '0x0BFbCF9fa4f9C56B0F40a671Ad40E0805A091865',
|
|
25
|
-
enabled: true,
|
|
26
|
-
},
|
|
27
|
-
IROSWAP: {
|
|
28
|
-
name: 'IROSwap',
|
|
29
|
-
v2Factory: ADDRESSES.BSC.IroSwapV2Factory,
|
|
30
|
-
v2Router: ADDRESSES.BSC.IroSwapV2Router,
|
|
31
|
-
enabled: true,
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
MONAD: {
|
|
36
|
-
wrappedNative: '0x3bd359c1119da7da1d913d1c4d2b7c461115433a',
|
|
37
|
-
wrappedNativeSymbol: 'WMON',
|
|
38
|
-
stableCoins: [
|
|
39
|
-
{ address: '0x754704bc059f8c67012fed69bc8a327a5aafb603', symbol: 'USDC', decimals: 6 },
|
|
40
|
-
],
|
|
41
|
-
dexes: {
|
|
42
|
-
PANCAKESWAP: {
|
|
43
|
-
name: 'PancakeSwap',
|
|
44
|
-
v2Factory: '0x44c90b66eb4c4f814cea6aaf2ac71ca88fa77308',
|
|
45
|
-
v3Factory: '0x40ce898c43df68c8c4229cd5ce21d3ce1f3ddcf1',
|
|
46
|
-
enabled: true,
|
|
47
|
-
},
|
|
48
|
-
UNISWAP: {
|
|
49
|
-
name: 'Uniswap',
|
|
50
|
-
v2Factory: '0x182a927119d56008d921126764bf884221b10f59',
|
|
51
|
-
v3Factory: '0x204faca1764b154221e35c0d20abb3c525710498',
|
|
52
|
-
v2Router: '0x4b2ab38dbf28d31d467aa8993f6c2585981d6804',
|
|
53
|
-
v3Router: '0xd6145b2d3f379919e8cdeda7b97e37c4b2ca9c40',
|
|
54
|
-
quoterV2: '0x661e93cca42afacb172121ef892830ca3b70f08d',
|
|
55
|
-
enabled: true,
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
// ✅ 新增 XLayer 配置
|
|
60
|
-
XLAYER: {
|
|
61
|
-
wrappedNative: '0xe538905cf8410324e03a5a23c1c177a474d59b2b',
|
|
62
|
-
wrappedNativeSymbol: 'WOKB',
|
|
63
|
-
stableCoins: [
|
|
64
|
-
{ address: '0x1e4a5963abfd975d8c9021ce480b42188849d41d', symbol: 'USDT', decimals: 6 },
|
|
65
|
-
{ address: '0x74b7f16337b8972027f6196a17a631ac6de26d22', symbol: 'USDC', decimals: 6 },
|
|
66
|
-
// ✅ XLayer: USD₮0 / USDT0(常见外盘配对)
|
|
67
|
-
{ address: '0x779ded0c9e1022225f8e0630b35a9b54be713736', symbol: 'USDT0', decimals: 6 },
|
|
68
|
-
],
|
|
69
|
-
dexes: {
|
|
70
|
-
POTATOSWAP: {
|
|
71
|
-
name: 'PotatoSwap',
|
|
72
|
-
v2Factory: '0x630DB8E822805c82Ca40a54daE02dd5aC31f7fcF', // V2 Factory
|
|
73
|
-
v2Router: '0x881fb2f98c13d521009464e7d1cbf16e1b394e8e', // ✅ V2 Router (标准 Uniswap V2 风格)
|
|
74
|
-
v3Router: '0xB45D0149249488333E3F3f9F359807F4b810C1FC', // SwapRouter02 (V3 风格)
|
|
75
|
-
v3Factory: '0xa1415fAe79c4B196d087F02b8aD5a622B8A827E5', // V3 Factory
|
|
76
|
-
quoterV2: '0x5A6f3723346aF54a4D0693bfC1718D64d4915C3e', // QuoterV2
|
|
77
|
-
enabled: true,
|
|
78
|
-
},
|
|
79
|
-
DYORSWAP: {
|
|
80
|
-
name: 'DYORSwap',
|
|
81
|
-
v2Factory: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09', // ✅ V2 Factory
|
|
82
|
-
v2Router: '0xfb001fbbace32f09cb6d3c449b935183de53ee96', // DYORSwap Router (SwapRouter02 风格)
|
|
83
|
-
enabled: true, // ✅ 已启用
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
ENI: {
|
|
88
|
-
wrappedNative: '0x6d1e851446f4d004ae2a72f9afed85e8829a205e',
|
|
89
|
-
wrappedNativeSymbol: 'WEGAS',
|
|
90
|
-
stableCoins: [
|
|
91
|
-
{ address: '0xDC1a8A35b0BaA3229b13f348ED708a2fd50b5e3a', symbol: 'USDT', decimals: 18 },
|
|
92
|
-
{ address: '0xaFF944b96c1BAEA587159ec446280E468B32ee15', symbol: 'USDC', decimals: 18 },
|
|
93
|
-
],
|
|
94
|
-
dexes: {
|
|
95
|
-
DSWAP: {
|
|
96
|
-
name: 'DSWAP',
|
|
97
|
-
v2Factory: '0x548c0e26ce90b333c07abb6d55546304d46d269d',
|
|
98
|
-
v2Router: '0x97ed8be49d9a8b86247090aa41e908e76b8fcf22',
|
|
99
|
-
v3Factory: '0xa97c5a70Be5B81f573a688F656E7bE569B492A56',
|
|
100
|
-
v3Router: '0xcdE487F5B460a516f31FaC520D4e18BA1C8cda49',
|
|
101
|
-
enabled: true,
|
|
102
|
-
},
|
|
103
|
-
IROSWAP: {
|
|
104
|
-
name: 'IROSwap',
|
|
105
|
-
v2Factory: ADDRESSES.ENI.IroSwapV2Factory,
|
|
106
|
-
v2Router: ADDRESSES.ENI.IroSwapV2Router,
|
|
107
|
-
enabled: true,
|
|
108
|
-
},
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
// ============================================================================
|
|
113
|
-
// 动态配置 API
|
|
114
|
-
// ============================================================================
|
|
115
|
-
/** 运行时配置存储(内存) */
|
|
116
|
-
const runtimeConfigs = {};
|
|
117
1
|
/**
|
|
118
|
-
*
|
|
119
|
-
* 支持 Uniswap V2 Router 和 V3 SwapRouter02
|
|
2
|
+
* lp-inspect - 主函数
|
|
120
3
|
*/
|
|
4
|
+
import { Contract, Interface, formatUnits, formatEther } from 'ethers';
|
|
5
|
+
import { createProvider } from './provider-factory.js';
|
|
6
|
+
import { ADDRESSES, ZERO_ADDRESS } from '../shared/constants/index.js';
|
|
7
|
+
import { MULTICALL3_ABI, V2_FACTORY_ABI, V2_PAIR_ABI, V3_FACTORY_ABI, ERC20_ABI } from '../abis/common.js';
|
|
8
|
+
import { Helper3 } from '../contracts/helper3.js';
|
|
9
|
+
import { FlapPortal } from '../shared/flap/portal.js';
|
|
10
|
+
import { CHAIN_DEX_CONFIGS, DEFAULT_V3_FEE_TIERS, runtimeConfigs } from './lp-inspect-helpers.js';
|
|
121
11
|
export async function getFactoryFromRouter(routerAddress, rpcUrl, routerType = 'v2') {
|
|
122
|
-
const provider =
|
|
12
|
+
const provider = createProvider(rpcUrl);
|
|
123
13
|
const result = {};
|
|
124
14
|
// V2 Router ABI: factory()
|
|
125
15
|
const V2_ROUTER_ABI = ['function factory() view returns (address)'];
|
|
126
16
|
// V3 SwapRouter02 ABI: factory() 和 factoryV2()
|
|
127
|
-
const V3_ROUTER_ABI = [
|
|
128
|
-
'function factory() view returns (address)',
|
|
129
|
-
'function factoryV2() view returns (address)',
|
|
130
|
-
];
|
|
17
|
+
const V3_ROUTER_ABI = ['function factory() view returns (address)', 'function factoryV2() view returns (address)'];
|
|
131
18
|
try {
|
|
132
19
|
if (routerType === 'v2') {
|
|
133
20
|
const router = new Contract(routerAddress, V2_ROUTER_ABI, provider);
|
|
@@ -139,7 +26,7 @@ export async function getFactoryFromRouter(routerAddress, rpcUrl, routerType = '
|
|
|
139
26
|
// ✅ 并行获取 V3 和 V2 Factory
|
|
140
27
|
const [v3Factory, v2Factory] = await Promise.all([
|
|
141
28
|
router.factory().catch(() => undefined),
|
|
142
|
-
router.factoryV2().catch(() => undefined)
|
|
29
|
+
router.factoryV2().catch(() => undefined),
|
|
143
30
|
]);
|
|
144
31
|
if (v3Factory)
|
|
145
32
|
result.v3Factory = v3Factory;
|
|
@@ -192,7 +79,7 @@ export function registerStableCoin(chain, coin) {
|
|
|
192
79
|
const chainConfig = getChainConfig(chain);
|
|
193
80
|
if (chainConfig) {
|
|
194
81
|
// 检查是否已存在
|
|
195
|
-
const exists = chainConfig.stableCoins.some(c => c.address.toLowerCase() === coin.address.toLowerCase());
|
|
82
|
+
const exists = chainConfig.stableCoins.some((c) => c.address.toLowerCase() === coin.address.toLowerCase());
|
|
196
83
|
if (!exists) {
|
|
197
84
|
chainConfig.stableCoins.push(coin);
|
|
198
85
|
}
|
|
@@ -235,7 +122,7 @@ export function getQuoteTokens(chain) {
|
|
|
235
122
|
return [];
|
|
236
123
|
return [
|
|
237
124
|
{ address: config.wrappedNative, symbol: config.wrappedNativeSymbol, decimals: 18, isNative: true },
|
|
238
|
-
...config.stableCoins.map(c => ({ ...c, isNative: false })),
|
|
125
|
+
...config.stableCoins.map((c) => ({ ...c, isNative: false })),
|
|
239
126
|
];
|
|
240
127
|
}
|
|
241
128
|
// ============================================================================
|
|
@@ -253,7 +140,7 @@ const MULTICALL3_ADDRESS = ADDRESSES.BSC.Multicall3;
|
|
|
253
140
|
const providerCache = new Map();
|
|
254
141
|
function getProvider(rpcUrl) {
|
|
255
142
|
if (!providerCache.has(rpcUrl)) {
|
|
256
|
-
providerCache.set(rpcUrl,
|
|
143
|
+
providerCache.set(rpcUrl, createProvider(rpcUrl));
|
|
257
144
|
}
|
|
258
145
|
return providerCache.get(rpcUrl);
|
|
259
146
|
}
|
|
@@ -307,7 +194,6 @@ export async function inspectTokenLP(token, opts) {
|
|
|
307
194
|
// 获取链配置
|
|
308
195
|
let chainConfig = getChainConfig(opts.chain);
|
|
309
196
|
if (!chainConfig) {
|
|
310
|
-
console.warn(`[LP Inspect] Unknown chain: ${opts.chain}`);
|
|
311
197
|
return result;
|
|
312
198
|
}
|
|
313
199
|
// 应用自定义配置
|
|
@@ -318,13 +204,10 @@ export async function inspectTokenLP(token, opts) {
|
|
|
318
204
|
let tokenDecimals;
|
|
319
205
|
let totalSupplyRaw;
|
|
320
206
|
try {
|
|
321
|
-
const tokenContract = new Contract(token, [
|
|
322
|
-
'function decimals() view returns (uint8)',
|
|
323
|
-
'function totalSupply() view returns (uint256)'
|
|
324
|
-
], provider);
|
|
207
|
+
const tokenContract = new Contract(token, ['function decimals() view returns (uint8)', 'function totalSupply() view returns (uint256)'], provider);
|
|
325
208
|
const [decimals, supply] = await Promise.all([
|
|
326
209
|
tokenContract.decimals().catch(() => 18),
|
|
327
|
-
tokenContract.totalSupply().catch(() => undefined)
|
|
210
|
+
tokenContract.totalSupply().catch(() => undefined),
|
|
328
211
|
]);
|
|
329
212
|
tokenDecimals = Number(decimals);
|
|
330
213
|
totalSupplyRaw = supply ? BigInt(supply) : undefined;
|
|
@@ -349,29 +232,23 @@ export async function inspectTokenLP(token, opts) {
|
|
|
349
232
|
try {
|
|
350
233
|
const stV7 = await flap.getTokenV7(token);
|
|
351
234
|
st = stV7;
|
|
352
|
-
|
|
353
|
-
taxRate = typeof stV7.taxRate === 'bigint' ? Number(stV7.taxRate) : Number(stV7.taxRate ?? 0);
|
|
354
|
-
if (opts.debug)
|
|
355
|
-
console.log('[LP Inspect] Flap V7 taxRate:', taxRate);
|
|
235
|
+
taxRate = Number(stV7.taxRate ?? 0n);
|
|
356
236
|
}
|
|
357
237
|
catch {
|
|
358
|
-
// V7 不支持,fallback 到 V5
|
|
359
238
|
st = await flap.getTokenV5(token);
|
|
360
|
-
if (opts.debug)
|
|
361
|
-
console.log('[LP Inspect] Flap V7 failed, using V5');
|
|
362
239
|
}
|
|
363
240
|
if (st && st.status !== undefined && Number(st.status) !== 4) {
|
|
364
241
|
result.platform = 'FLAP';
|
|
365
242
|
let quoteDecimals = 18;
|
|
366
243
|
let quoteSymbol = chainConfig.wrappedNativeSymbol;
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const stableCoin = chainConfig.stableCoins.find(c => c.address.toLowerCase() ===
|
|
244
|
+
const quoteTokenAddress = st.quoteTokenAddress;
|
|
245
|
+
if (quoteTokenAddress && quoteTokenAddress.toLowerCase() !== ZERO_ADDRESS) {
|
|
246
|
+
quoteDecimals = await getTokenDecimals(quoteTokenAddress, provider);
|
|
247
|
+
const stableCoin = chainConfig.stableCoins.find((c) => c.address.toLowerCase() === quoteTokenAddress.toLowerCase());
|
|
371
248
|
quoteSymbol = stableCoin?.symbol || 'TOKEN';
|
|
372
249
|
}
|
|
373
250
|
result.flap = {
|
|
374
|
-
quoteToken:
|
|
251
|
+
quoteToken: quoteTokenAddress,
|
|
375
252
|
quoteSymbol,
|
|
376
253
|
quoteDecimals,
|
|
377
254
|
reserveNative: formatBalance(st.reserve, shouldFormat, quoteDecimals),
|
|
@@ -386,9 +263,8 @@ export async function inspectTokenLP(token, opts) {
|
|
|
386
263
|
return result;
|
|
387
264
|
}
|
|
388
265
|
}
|
|
389
|
-
catch
|
|
390
|
-
|
|
391
|
-
console.log('[LP Inspect] Flap check failed:', err);
|
|
266
|
+
catch {
|
|
267
|
+
// Flap 检测失败,继续其他平台检测
|
|
392
268
|
}
|
|
393
269
|
}
|
|
394
270
|
// ========================================
|
|
@@ -407,11 +283,8 @@ export async function inspectTokenLP(token, opts) {
|
|
|
407
283
|
// status: 0=不存在, 1=交易中(内盘), 2=已毕业(外盘)
|
|
408
284
|
if (status === 1) {
|
|
409
285
|
result.platform = 'DAOAAS';
|
|
410
|
-
const price = await portal.getPrice(token);
|
|
411
|
-
const tokenContract = new Contract(token, [
|
|
412
|
-
'function totalSupply() view returns (uint256)',
|
|
413
|
-
'function balanceOf(address) view returns (uint256)',
|
|
414
|
-
], provider);
|
|
286
|
+
const price = (await portal.getPrice(token));
|
|
287
|
+
const tokenContract = new Contract(token, ['function totalSupply() view returns (uint256)', 'function balanceOf(address) view returns (uint256)'], provider);
|
|
415
288
|
const [totalSupply, portalTokenBalance] = await Promise.all([
|
|
416
289
|
tokenContract.totalSupply(),
|
|
417
290
|
tokenContract.balanceOf(portalAddress),
|
|
@@ -420,7 +293,7 @@ export async function inspectTokenLP(token, opts) {
|
|
|
420
293
|
let reserveNative = '0';
|
|
421
294
|
try {
|
|
422
295
|
if (circulatingSupply > 0n) {
|
|
423
|
-
const saleValue = await portal.getOKAmountBySale(token, circulatingSupply);
|
|
296
|
+
const saleValue = (await portal.getOKAmountBySale(token, circulatingSupply));
|
|
424
297
|
reserveNative = formatBalance(saleValue, shouldFormat, 18);
|
|
425
298
|
}
|
|
426
299
|
}
|
|
@@ -429,7 +302,9 @@ export async function inspectTokenLP(token, opts) {
|
|
|
429
302
|
const egasBalance = await provider.getBalance(portalAddress);
|
|
430
303
|
reserveNative = formatBalance(egasBalance, shouldFormat, 18);
|
|
431
304
|
}
|
|
432
|
-
catch {
|
|
305
|
+
catch {
|
|
306
|
+
/* ignore */
|
|
307
|
+
}
|
|
433
308
|
}
|
|
434
309
|
result.daoaas = {
|
|
435
310
|
quoteToken: ZERO_ADDRESS,
|
|
@@ -444,9 +319,8 @@ export async function inspectTokenLP(token, opts) {
|
|
|
444
319
|
}
|
|
445
320
|
// status === 2 (Graduated): 已毕业到 DSWAP V2,继续走外盘检测
|
|
446
321
|
}
|
|
447
|
-
catch
|
|
448
|
-
|
|
449
|
-
console.log('[LP Inspect] DAOaaS Portal check failed:', err);
|
|
322
|
+
catch {
|
|
323
|
+
// DAOaaS Portal 检测失败,继续其他平台检测
|
|
450
324
|
}
|
|
451
325
|
}
|
|
452
326
|
// ========================================
|
|
@@ -456,24 +330,21 @@ export async function inspectTokenLP(token, opts) {
|
|
|
456
330
|
try {
|
|
457
331
|
const helper = Helper3.connectByChain('BSC', opts.rpcUrl);
|
|
458
332
|
const info = await helper.getTokenInfo(token);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
return result;
|
|
471
|
-
}
|
|
333
|
+
const tokenManager = info.tokenManager;
|
|
334
|
+
const versionNum = Number(info.version);
|
|
335
|
+
const liquidityAdded = info.liquidityAdded;
|
|
336
|
+
const isValid = tokenManager && tokenManager !== ZERO_ADDRESS && (versionNum === 1 || versionNum === 2);
|
|
337
|
+
if (isValid && !liquidityAdded) {
|
|
338
|
+
result.platform = 'FOUR';
|
|
339
|
+
const reserveNative = formatBalance(info.funds, shouldFormat);
|
|
340
|
+
const offerTokens = formatBalance(info.offers, shouldFormat);
|
|
341
|
+
const lastPrice = formatBalance(info.lastPrice, shouldFormat);
|
|
342
|
+
result.four = { helper: ADDRESSES.BSC.TokenManagerHelper3, reserveNative, offerTokens, lastPrice };
|
|
343
|
+
return result;
|
|
472
344
|
}
|
|
473
345
|
}
|
|
474
|
-
catch
|
|
475
|
-
|
|
476
|
-
console.log('[LP Inspect] Four.meme check failed:', err);
|
|
346
|
+
catch {
|
|
347
|
+
// Four.meme 检测失败,继续外盘检测
|
|
477
348
|
}
|
|
478
349
|
}
|
|
479
350
|
// ========================================
|
|
@@ -498,7 +369,7 @@ export async function inspectTokenLP(token, opts) {
|
|
|
498
369
|
// V2 查询
|
|
499
370
|
if (dexConfig.v2Factory) {
|
|
500
371
|
try {
|
|
501
|
-
const v2Pairs = await queryV2Pairs(token, dexConfig.v2Factory, quoteTokens, provider, multicall3, tokenDecimals ?? 18, shouldFormat
|
|
372
|
+
const v2Pairs = await queryV2Pairs(token, dexConfig.v2Factory, quoteTokens, provider, multicall3, tokenDecimals ?? 18, shouldFormat);
|
|
502
373
|
dexPoolInfo.v2Pairs = v2Pairs;
|
|
503
374
|
// 添加到最佳池子候选
|
|
504
375
|
for (const pair of v2Pairs) {
|
|
@@ -519,15 +390,14 @@ export async function inspectTokenLP(token, opts) {
|
|
|
519
390
|
}
|
|
520
391
|
}
|
|
521
392
|
}
|
|
522
|
-
catch
|
|
523
|
-
|
|
524
|
-
console.log(`[LP Inspect] ${dexConfig.name} V2 query failed:`, err);
|
|
393
|
+
catch {
|
|
394
|
+
// 单个 DEX V2 查询失败,继续其他 DEX
|
|
525
395
|
}
|
|
526
396
|
}
|
|
527
397
|
// V3 查询
|
|
528
398
|
if (dexConfig.v3Factory) {
|
|
529
399
|
try {
|
|
530
|
-
const v3Pools = await queryV3Pools(token, dexConfig.v3Factory, quoteTokens, v3FeeTiers, provider, multicall3, tokenDecimals ?? 18, shouldFormat
|
|
400
|
+
const v3Pools = await queryV3Pools(token, dexConfig.v3Factory, quoteTokens, v3FeeTiers, provider, multicall3, tokenDecimals ?? 18, shouldFormat);
|
|
531
401
|
dexPoolInfo.v3Pools = v3Pools;
|
|
532
402
|
// 添加到最佳池子候选
|
|
533
403
|
for (const pool of v3Pools) {
|
|
@@ -549,9 +419,8 @@ export async function inspectTokenLP(token, opts) {
|
|
|
549
419
|
}
|
|
550
420
|
}
|
|
551
421
|
}
|
|
552
|
-
catch
|
|
553
|
-
|
|
554
|
-
console.log(`[LP Inspect] ${dexConfig.name} V3 query failed:`, err);
|
|
422
|
+
catch {
|
|
423
|
+
// 单个 DEX V3 查询失败,继续其他 DEX
|
|
555
424
|
}
|
|
556
425
|
}
|
|
557
426
|
return dexPoolInfo;
|
|
@@ -559,7 +428,7 @@ export async function inspectTokenLP(token, opts) {
|
|
|
559
428
|
// 等待所有 DEX 查询完成
|
|
560
429
|
const dexResults = await Promise.all(dexPromises);
|
|
561
430
|
// 过滤出有流动性的 DEX
|
|
562
|
-
result.allPools = dexResults.filter(dex => dex.v2Pairs.length > 0 || dex.v3Pools.length > 0);
|
|
431
|
+
result.allPools = dexResults.filter((dex) => dex.v2Pairs.length > 0 || dex.v3Pools.length > 0);
|
|
563
432
|
// 按流动性排序最佳池子,并计算 poolRatio
|
|
564
433
|
result.bestPools = allBestPoolCandidates
|
|
565
434
|
.sort((a, b) => {
|
|
@@ -571,7 +440,7 @@ export async function inspectTokenLP(token, opts) {
|
|
|
571
440
|
return 0;
|
|
572
441
|
})
|
|
573
442
|
.slice(0, 10) // 最多返回 10 个
|
|
574
|
-
.map(pool => {
|
|
443
|
+
.map((pool) => {
|
|
575
444
|
// ✅ 计算池子代币占比
|
|
576
445
|
if (pool.reserveTokenRaw && totalSupplyRaw && totalSupplyRaw > 0n) {
|
|
577
446
|
// 计算百分比:(reserveTokenRaw / totalSupplyRaw) * 100
|
|
@@ -612,17 +481,13 @@ export async function inspectTokenLP(token, opts) {
|
|
|
612
481
|
const flap = new FlapPortal({ chain: opts.flapChain, rpcUrl: opts.rpcUrl });
|
|
613
482
|
const stV7 = await flap.getTokenV7(token);
|
|
614
483
|
// taxRate 是 bigint,需要转换为 number
|
|
615
|
-
const taxRate =
|
|
484
|
+
const taxRate = Number(stV7.taxRate ?? 0n);
|
|
616
485
|
if (taxRate > 0) {
|
|
617
486
|
result.taxRate = taxRate;
|
|
618
|
-
if (opts.debug)
|
|
619
|
-
console.log('[LP Inspect] 外盘税率:', taxRate, 'bps');
|
|
620
487
|
}
|
|
621
488
|
}
|
|
622
|
-
catch
|
|
489
|
+
catch {
|
|
623
490
|
// V7 不支持或代币不是 Flap 创建的,忽略
|
|
624
|
-
if (opts.debug)
|
|
625
|
-
console.log('[LP Inspect] 外盘税率查询失败(可忽略):', err);
|
|
626
491
|
}
|
|
627
492
|
}
|
|
628
493
|
return result;
|
|
@@ -630,20 +495,20 @@ export async function inspectTokenLP(token, opts) {
|
|
|
630
495
|
// ============================================================================
|
|
631
496
|
// V2 批量查询
|
|
632
497
|
// ============================================================================
|
|
633
|
-
async function queryV2Pairs(token, factoryAddress, quoteTokens, provider, multicall3, tokenDecimals, shouldFormat
|
|
498
|
+
async function queryV2Pairs(token, factoryAddress, quoteTokens, provider, multicall3, tokenDecimals, shouldFormat) {
|
|
634
499
|
const results = [];
|
|
635
500
|
const factoryIface = new Interface(I_UNIV2_FACTORY_ABI);
|
|
636
501
|
const pairIface = new Interface(I_UNIV2_PAIR_ABI);
|
|
637
502
|
const mcIface = new Interface(MULTICALL3_ABI);
|
|
638
503
|
// 第一步:批量查询所有 getPair
|
|
639
|
-
const pairCalls = quoteTokens.map(qt => ({
|
|
504
|
+
const pairCalls = quoteTokens.map((qt) => ({
|
|
640
505
|
target: factoryAddress,
|
|
641
506
|
callData: factoryIface.encodeFunctionData('getPair', [token, qt.address]),
|
|
642
507
|
quoteToken: qt,
|
|
643
508
|
}));
|
|
644
509
|
try {
|
|
645
510
|
const aggData = mcIface.encodeFunctionData('aggregate', [
|
|
646
|
-
pairCalls.map(c => ({ target: c.target, callData: c.callData }))
|
|
511
|
+
pairCalls.map((c) => ({ target: c.target, callData: c.callData })),
|
|
647
512
|
]);
|
|
648
513
|
const res = await provider.call({ to: multicall3, data: aggData });
|
|
649
514
|
const [, returnData] = mcIface.decodeFunctionResult('aggregate', res);
|
|
@@ -664,7 +529,7 @@ async function queryV2Pairs(token, factoryAddress, quoteTokens, provider, multic
|
|
|
664
529
|
if (validPairs.length === 0)
|
|
665
530
|
return results;
|
|
666
531
|
// 第二步:批量查询 getReserves
|
|
667
|
-
const reserveCalls = validPairs.flatMap(p => [
|
|
532
|
+
const reserveCalls = validPairs.flatMap((p) => [
|
|
668
533
|
{ target: p.pairAddress, callData: pairIface.encodeFunctionData('token0', []) },
|
|
669
534
|
{ target: p.pairAddress, callData: pairIface.encodeFunctionData('token1', []) },
|
|
670
535
|
{ target: p.pairAddress, callData: pairIface.encodeFunctionData('getReserves', []) },
|
|
@@ -677,7 +542,7 @@ async function queryV2Pairs(token, factoryAddress, quoteTokens, provider, multic
|
|
|
677
542
|
try {
|
|
678
543
|
const idx = i * 3;
|
|
679
544
|
const token0 = pairIface.decodeFunctionResult('token0', returnData2[idx])[0];
|
|
680
|
-
|
|
545
|
+
pairIface.decodeFunctionResult('token1', returnData2[idx + 1]);
|
|
681
546
|
const [r0, r1] = pairIface.decodeFunctionResult('getReserves', returnData2[idx + 2]);
|
|
682
547
|
const p = validPairs[i];
|
|
683
548
|
const isToken0 = token0.toLowerCase() === token.toLowerCase();
|
|
@@ -694,15 +559,12 @@ async function queryV2Pairs(token, factoryAddress, quoteTokens, provider, multic
|
|
|
694
559
|
reserveTokenRaw: reserveToken, // ✅ 新增
|
|
695
560
|
});
|
|
696
561
|
}
|
|
697
|
-
catch
|
|
698
|
-
|
|
699
|
-
console.log('[V2] Reserve decode error:', err);
|
|
562
|
+
catch {
|
|
563
|
+
// 单条 reserve 解码失败,跳过
|
|
700
564
|
}
|
|
701
565
|
}
|
|
702
566
|
}
|
|
703
|
-
catch
|
|
704
|
-
if (debug)
|
|
705
|
-
console.log('[V2] Multicall failed:', err);
|
|
567
|
+
catch {
|
|
706
568
|
// Fallback: 逐个查询
|
|
707
569
|
return queryV2PairsFallback(token, factoryAddress, quoteTokens, provider, tokenDecimals, shouldFormat);
|
|
708
570
|
}
|
|
@@ -718,12 +580,7 @@ async function queryV2PairsFallback(token, factoryAddress, quoteTokens, provider
|
|
|
718
580
|
return null;
|
|
719
581
|
}
|
|
720
582
|
const pair = new Contract(pairAddress, I_UNIV2_PAIR_ABI, provider);
|
|
721
|
-
|
|
722
|
-
const [token0, token1, reserves] = await Promise.all([
|
|
723
|
-
pair.token0(),
|
|
724
|
-
pair.token1(),
|
|
725
|
-
pair.getReserves()
|
|
726
|
-
]);
|
|
583
|
+
const [token0, , reserves] = await Promise.all([pair.token0(), pair.token1(), pair.getReserves()]);
|
|
727
584
|
const [r0, r1] = reserves;
|
|
728
585
|
const isToken0 = token0.toLowerCase() === token.toLowerCase();
|
|
729
586
|
const reserveToken = isToken0 ? r0 : r1;
|
|
@@ -749,7 +606,7 @@ async function queryV2PairsFallback(token, factoryAddress, quoteTokens, provider
|
|
|
749
606
|
// ============================================================================
|
|
750
607
|
// V3 批量查询
|
|
751
608
|
// ============================================================================
|
|
752
|
-
async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provider, multicall3, tokenDecimals, shouldFormat
|
|
609
|
+
async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provider, multicall3, tokenDecimals, shouldFormat) {
|
|
753
610
|
const results = [];
|
|
754
611
|
const factoryIface = new Interface(I_UNIV3_FACTORY_ABI);
|
|
755
612
|
const erc20Iface = new Interface(I_ERC20_ABI);
|
|
@@ -761,9 +618,7 @@ async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provid
|
|
|
761
618
|
// V3 要求 token0 < token1
|
|
762
619
|
const tokenLower = token.toLowerCase();
|
|
763
620
|
const quoteLower = qt.address.toLowerCase();
|
|
764
|
-
const [token0, token1] = tokenLower < quoteLower
|
|
765
|
-
? [tokenLower, quoteLower]
|
|
766
|
-
: [quoteLower, tokenLower];
|
|
621
|
+
const [token0, token1] = tokenLower < quoteLower ? [tokenLower, quoteLower] : [quoteLower, tokenLower];
|
|
767
622
|
poolCalls.push({
|
|
768
623
|
target: factoryAddress,
|
|
769
624
|
callData: factoryIface.encodeFunctionData('getPool', [token0, token1, fee]),
|
|
@@ -775,7 +630,7 @@ async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provid
|
|
|
775
630
|
try {
|
|
776
631
|
// 第一步:批量查询所有 getPool
|
|
777
632
|
const aggData = mcIface.encodeFunctionData('aggregate', [
|
|
778
|
-
poolCalls.map(c => ({ target: c.target, callData: c.callData }))
|
|
633
|
+
poolCalls.map((c) => ({ target: c.target, callData: c.callData })),
|
|
779
634
|
]);
|
|
780
635
|
const res = await provider.call({ to: multicall3, data: aggData });
|
|
781
636
|
const [, returnData] = mcIface.decodeFunctionResult('aggregate', res);
|
|
@@ -800,7 +655,7 @@ async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provid
|
|
|
800
655
|
if (validPools.length === 0)
|
|
801
656
|
return results;
|
|
802
657
|
// 第二步:批量查询余额
|
|
803
|
-
const balanceCalls = validPools.flatMap(p => [
|
|
658
|
+
const balanceCalls = validPools.flatMap((p) => [
|
|
804
659
|
{ target: token, callData: erc20Iface.encodeFunctionData('balanceOf', [p.poolAddress]) },
|
|
805
660
|
{ target: p.quoteToken.address, callData: erc20Iface.encodeFunctionData('balanceOf', [p.poolAddress]) },
|
|
806
661
|
]);
|
|
@@ -826,15 +681,12 @@ async function queryV3Pools(token, factoryAddress, quoteTokens, feeTiers, provid
|
|
|
826
681
|
fee: p.fee,
|
|
827
682
|
});
|
|
828
683
|
}
|
|
829
|
-
catch
|
|
830
|
-
|
|
831
|
-
console.log('[V3] Balance decode error:', err);
|
|
684
|
+
catch {
|
|
685
|
+
// 单条 balance 解码失败,跳过
|
|
832
686
|
}
|
|
833
687
|
}
|
|
834
688
|
}
|
|
835
|
-
catch
|
|
836
|
-
if (debug)
|
|
837
|
-
console.log('[V3] Multicall failed:', err);
|
|
689
|
+
catch {
|
|
838
690
|
// Fallback: 逐个查询
|
|
839
691
|
return queryV3PoolsFallback(token, factoryAddress, quoteTokens, feeTiers, provider, tokenDecimals, shouldFormat);
|
|
840
692
|
}
|
|
@@ -848,9 +700,7 @@ async function queryV3PoolsFallback(token, factoryAddress, quoteTokens, feeTiers
|
|
|
848
700
|
for (const qt of quoteTokens) {
|
|
849
701
|
const tokenLower = token.toLowerCase();
|
|
850
702
|
const quoteLower = qt.address.toLowerCase();
|
|
851
|
-
const [token0, token1] = tokenLower < quoteLower
|
|
852
|
-
? [tokenLower, quoteLower]
|
|
853
|
-
: [quoteLower, tokenLower];
|
|
703
|
+
const [token0, token1] = tokenLower < quoteLower ? [tokenLower, quoteLower] : [quoteLower, tokenLower];
|
|
854
704
|
for (const fee of feeTiers) {
|
|
855
705
|
queries.push({ qt, fee, token0, token1 });
|
|
856
706
|
}
|
|
@@ -894,7 +744,7 @@ function determinePlatform(allPools) {
|
|
|
894
744
|
if (allPools.length === 0)
|
|
895
745
|
return 'UNKNOWN';
|
|
896
746
|
// 统计有流动性的 DEX
|
|
897
|
-
const dexesWithLiquidity = allPools.filter(dex => dex.v2Pairs.length > 0 || dex.v3Pools.length > 0);
|
|
747
|
+
const dexesWithLiquidity = allPools.filter((dex) => dex.v2Pairs.length > 0 || dex.v3Pools.length > 0);
|
|
898
748
|
if (dexesWithLiquidity.length > 1) {
|
|
899
749
|
return 'MULTI_DEX';
|
|
900
750
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
tokenAddress: string;
|
|
4
|
-
rpcUrl: string;
|
|
5
|
-
};
|
|
1
|
+
import type { ExclusiveCheckOnChainParams } from './types/mpc-exclusive.js';
|
|
2
|
+
export type { ExclusiveCheckOnChainParams } from './types/mpc-exclusive.js';
|
|
6
3
|
export declare function isExclusiveOnChain(params: ExclusiveCheckOnChainParams): Promise<boolean>;
|
|
7
4
|
export declare function isExclusiveOffChain(getTokenInfo: (token: string) => Promise<{
|
|
8
5
|
version?: string;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Contract, JsonRpcProvider } from 'ethers';
|
|
2
|
-
import TokenManager2Abi from '../
|
|
3
|
-
import { ADDRESSES } from '
|
|
2
|
+
import TokenManager2Abi from '../abis/contracts/TokenManager2.json' with { type: 'json' };
|
|
3
|
+
import { ADDRESSES } from '../shared/constants/index.js';
|
|
4
|
+
const TOKEN_MANAGER2_ABI = TokenManager2Abi;
|
|
4
5
|
// 链上识别:template & 0x10000 > 0
|
|
5
6
|
export async function isExclusiveOnChain(params) {
|
|
6
7
|
const { chain, tokenAddress, rpcUrl } = params;
|
|
7
8
|
const tokenManager2Address = ADDRESSES[chain].TokenManagerV2;
|
|
8
9
|
const provider = new JsonRpcProvider(rpcUrl);
|
|
9
|
-
const tm2 = new Contract(tokenManager2Address,
|
|
10
|
+
const tm2 = new Contract(tokenManager2Address, TOKEN_MANAGER2_ABI, provider);
|
|
10
11
|
const info = await tm2._tokenInfos(tokenAddress);
|
|
11
12
|
const template = info.template;
|
|
12
13
|
return (template & 0x10000n) > 0n;
|
|
@@ -5,64 +5,7 @@
|
|
|
5
5
|
* - 贿赂交易:向 BlockRazor Builder EOA 转账 BNB 提高优先级
|
|
6
6
|
* - 利润提取:千分之三(30 bps)
|
|
7
7
|
*/
|
|
8
|
-
import type {
|
|
9
|
-
/** 私募签名配置 */
|
|
10
|
-
export interface PrivateSaleSignConfig {
|
|
11
|
-
/** RPC URL */
|
|
12
|
-
rpcUrl: string;
|
|
13
|
-
/** 链 ID */
|
|
14
|
-
chainId?: number;
|
|
15
|
-
/** Gas Limit(默认 21000) */
|
|
16
|
-
gasLimit?: number;
|
|
17
|
-
/** Gas Price(Gwei,默认 0.1) */
|
|
18
|
-
gasPriceGwei?: number;
|
|
19
|
-
/** 贿赂金额(BNB,默认 0.000001) */
|
|
20
|
-
bribeAmount?: number;
|
|
21
|
-
/** 是否提取利润(默认 true) */
|
|
22
|
-
extractProfit?: boolean;
|
|
23
|
-
/** 利润比例基点(默认 30 = 千分之三) */
|
|
24
|
-
profitBps?: number;
|
|
25
|
-
}
|
|
26
|
-
/** 单个转账参数 */
|
|
27
|
-
export interface PrivateSaleTransferParams {
|
|
28
|
-
/** 发送者私钥 */
|
|
29
|
-
senderPrivateKey: string;
|
|
30
|
-
/** 接收者地址(合约地址) */
|
|
31
|
-
recipient: string;
|
|
32
|
-
/** 转账金额(单位:原生代币,如 BNB) */
|
|
33
|
-
amount: number;
|
|
34
|
-
}
|
|
35
|
-
/** 批量转账参数 */
|
|
36
|
-
export interface BatchPrivateSaleParams {
|
|
37
|
-
/** 转账列表 */
|
|
38
|
-
transfers: PrivateSaleTransferParams[];
|
|
39
|
-
/** 签名配置 */
|
|
40
|
-
config: PrivateSaleSignConfig;
|
|
41
|
-
}
|
|
42
|
-
/** 私募结果 */
|
|
43
|
-
export interface PrivateSaleResult {
|
|
44
|
-
/** 签名交易数组(包含贿赂 + 转账 + 利润) */
|
|
45
|
-
signedTransactions: string[];
|
|
46
|
-
/** ✅ 利润多跳钱包 */
|
|
47
|
-
profitHopWallets?: GeneratedWallet[];
|
|
48
|
-
/** 元数据 */
|
|
49
|
-
metadata: {
|
|
50
|
-
/** 总交易数 */
|
|
51
|
-
totalCount: number;
|
|
52
|
-
/** 贿赂交易数 */
|
|
53
|
-
bribeCount: number;
|
|
54
|
-
/** 转账交易数 */
|
|
55
|
-
transferCount: number;
|
|
56
|
-
/** 利润交易数 */
|
|
57
|
-
profitCount: number;
|
|
58
|
-
/** 总转账金额(Wei) */
|
|
59
|
-
totalAmountWei: string;
|
|
60
|
-
/** 总利润金额(Wei) */
|
|
61
|
-
totalProfitWei: string;
|
|
62
|
-
/** 贿赂金额(Wei) */
|
|
63
|
-
bribeAmountWei: string;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
8
|
+
import type { BatchPrivateSaleParams, PrivateSaleResult, PrivateSaleSignConfig, PrivateSaleTransferParams } from './types/private-sale.js';
|
|
66
9
|
/**
|
|
67
10
|
* 生成私募转账签名交易(带贿赂和利润提取)
|
|
68
11
|
*
|
|
@@ -88,3 +31,4 @@ export declare function batchPrivateSaleMerkle(params: BatchPrivateSaleParams):
|
|
|
88
31
|
* @returns 签名交易结果
|
|
89
32
|
*/
|
|
90
33
|
export declare function privateSaleMerkle(transfer: PrivateSaleTransferParams, config: PrivateSaleSignConfig): Promise<PrivateSaleResult>;
|
|
34
|
+
export type { PrivateSaleSignConfig, PrivateSaleTransferParams, BatchPrivateSaleParams, PrivateSaleResult, } from './types/private-sale.js';
|