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