four-flap-meme-sdk 2.2.1 → 2.2.2
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 +85 -20
- package/dist/index.js +215 -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 +252 -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 +3 -2
- 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 +3 -3
- package/dist/shared/flap/index.js +3 -3
- 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 +172 -92
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.d.ts +1 -2
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.js +99 -106
- 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 +7 -73
- 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.d.ts +3 -1
- package/dist/shared/flap/portal.js +25 -32
- package/dist/shared/flap/vanity.d.ts +5 -1
- package/dist/shared/flap/vanity.js +17 -6
- package/dist/shared/flap/vault.d.ts +124 -17
- package/dist/shared/flap/vault.js +148 -67
- 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 -260
- package/dist/abis/contracts/TaxToken.json +0 -969
- package/dist/abis/contracts/TokenManager2.json +0 -136
- package/dist/abis/contracts/index.d.ts +0 -5
- package/dist/abis/contracts/index.js +0 -5
- package/dist/abis/flap/index.d.ts +0 -3
- package/dist/abis/flap/index.js +0 -3
- package/dist/abis/flap/portal-events.d.ts +0 -6
- package/dist/abis/flap/portal-events.js +0 -17
- package/dist/abis/flap/portal.d.ts +0 -6
- package/dist/abis/flap/portal.js +0 -37
- package/dist/abis/flap/vault.d.ts +0 -171
- package/dist/abis/flap/vault.js +0 -91
- package/dist/abis/index.d.ts +0 -8
- package/dist/abis/index.js +0 -11
- package/dist/bundle-core/__tests__/config-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/config-helpers.test.js +0 -28
- package/dist/bundle-core/__tests__/facade-parity.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/facade-parity.test.js +0 -33
- package/dist/bundle-core/__tests__/sign-context-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-context-helpers.test.js +0 -60
- package/dist/bundle-core/__tests__/sign-fixture.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-fixture.test.js +0 -220
- package/dist/bundle-core/__tests__/sign-fixtures.d.ts +0 -10
- package/dist/bundle-core/__tests__/sign-fixtures.js +0 -16
- package/dist/bundle-core/config-helpers.d.ts +0 -36
- package/dist/bundle-core/config-helpers.js +0 -57
- package/dist/bundle-core/errors.d.ts +0 -50
- package/dist/bundle-core/errors.js +0 -35
- package/dist/bundle-core/four-meme/approve-tokenmanager.d.ts +0 -7
- package/dist/bundle-core/four-meme/approve-tokenmanager.js +0 -99
- package/dist/bundle-core/four-meme/core-helpers.d.ts +0 -8
- package/dist/bundle-core/four-meme/core-helpers.js +0 -40
- package/dist/bundle-core/four-meme/core.d.ts +0 -4
- package/dist/bundle-core/four-meme/core.js +0 -515
- package/dist/bundle-core/four-meme/pancake-proxy.d.ts +0 -28
- package/dist/bundle-core/four-meme/pancake-proxy.js +0 -679
- package/dist/bundle-core/four-meme/private.d.ts +0 -27
- package/dist/bundle-core/four-meme/private.js +0 -465
- package/dist/bundle-core/four-meme/sign-context-helpers.d.ts +0 -2
- package/dist/bundle-core/four-meme/sign-context-helpers.js +0 -2
- package/dist/bundle-core/four-meme/swap-buy-first.d.ts +0 -8
- package/dist/bundle-core/four-meme/swap-buy-first.js +0 -493
- package/dist/bundle-core/four-meme/swap-hop-helpers.d.ts +0 -6
- package/dist/bundle-core/four-meme/swap-hop-helpers.js +0 -63
- package/dist/bundle-core/four-meme/swap-internal.d.ts +0 -3
- package/dist/bundle-core/four-meme/swap-internal.js +0 -18
- package/dist/bundle-core/four-meme/swap-sign-helpers.d.ts +0 -27
- package/dist/bundle-core/four-meme/swap-sign-helpers.js +0 -105
- package/dist/bundle-core/four-meme/swap.d.ts +0 -17
- package/dist/bundle-core/four-meme/swap.js +0 -505
- package/dist/bundle-core/four-meme/types/buy-first.d.ts +0 -50
- package/dist/bundle-core/four-meme/types/buy-first.js +0 -1
- package/dist/bundle-core/four-meme/types/core-flow.d.ts +0 -63
- package/dist/bundle-core/four-meme/types/core-flow.js +0 -1
- package/dist/bundle-core/four-meme/types/index.d.ts +0 -600
- package/dist/bundle-core/four-meme/types/index.js +0 -1
- package/dist/bundle-core/four-meme/types/swap-internal.d.ts +0 -19
- package/dist/bundle-core/four-meme/types/swap-internal.js +0 -1
- package/dist/bundle-core/four-meme/types.d.ts +0 -1
- package/dist/bundle-core/four-meme/types.js +0 -1
- package/dist/bundle-core/four-meme/utils-disperse.d.ts +0 -7
- package/dist/bundle-core/four-meme/utils-disperse.js +0 -396
- package/dist/bundle-core/four-meme/utils-pairwise.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-pairwise.js +0 -328
- package/dist/bundle-core/four-meme/utils-sweep.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-sweep.js +0 -744
- package/dist/bundle-core/index.d.ts +0 -8
- package/dist/bundle-core/index.js +0 -8
- package/dist/bundle-core/internal.d.ts +0 -21
- package/dist/bundle-core/internal.js +0 -182
- package/dist/bundle-core/sign-context-helpers.d.ts +0 -25
- package/dist/bundle-core/sign-context-helpers.js +0 -67
- package/dist/bundle-core/submit.d.ts +0 -293
- package/dist/bundle-core/submit.js +0 -727
- package/dist/bundle-core/types/index.d.ts +0 -8
- package/dist/bundle-core/types/index.js +0 -1
- package/dist/bundle-core/types.d.ts +0 -1
- package/dist/bundle-core/types.js +0 -1
- package/dist/chains/bsc/four/utils-disperse.d.ts +0 -1
- package/dist/chains/bsc/four/utils-disperse.js +0 -1
- package/dist/chains/bsc/four/utils-pairwise.d.ts +0 -1
- package/dist/chains/bsc/four/utils-pairwise.js +0 -1
- package/dist/chains/bsc/four/utils-sweep.d.ts +0 -1
- package/dist/chains/bsc/four/utils-sweep.js +0 -1
- package/dist/chains/bsc/iro.d.ts +0 -5
- package/dist/chains/bsc/iro.js +0 -4
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +0 -159
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +0 -117
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +0 -241
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +0 -565
- package/dist/chains/eni/flat-aliases.d.ts +0 -10
- package/dist/chains/eni/flat-aliases.js +0 -8
- package/dist/chains/eni/submit.d.ts +0 -43
- package/dist/chains/eni/submit.js +0 -286
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +0 -13
- package/dist/chains/xlayer/eip7702/flat-aliases.js +0 -10
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.d.ts +0 -79
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.js +0 -1
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +0 -26
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +0 -57
- package/dist/chains/xlayer/eip7702/volume-helpers.d.ts +0 -148
- package/dist/chains/xlayer/eip7702/volume-helpers.js +0 -48
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +0 -126
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +0 -228
- package/dist/contracts/tm-bundle-helpers.d.ts +0 -88
- package/dist/contracts/tm-bundle-helpers.js +0 -72
- package/dist/contracts/tm-bundle-merkle/utils-disperse.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-disperse.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.js +0 -1
- package/dist/dex/direct-router-helpers.d.ts +0 -264
- package/dist/dex/direct-router-helpers.js +0 -539
- package/dist/dex/types.d.ts +0 -81
- package/dist/dex/types.js +0 -1
- package/dist/exports/root-bundle-and-tooling.d.ts +0 -27
- package/dist/exports/root-bundle-and-tooling.js +0 -30
- package/dist/exports/root-eni-and-bsc-iro.d.ts +0 -26
- package/dist/exports/root-eni-and-bsc-iro.js +0 -66
- package/dist/exports/root-foundations.d.ts +0 -35
- package/dist/exports/root-foundations.js +0 -70
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +0 -30
- package/dist/exports/root-swap-dex-and-xlayer.js +0 -78
- package/dist/flap/index.d.ts +0 -10
- package/dist/flap/index.js +0 -8
- package/dist/flows/index.d.ts +0 -1
- package/dist/flows/index.js +0 -1
- package/dist/merkle/index.d.ts +0 -12
- package/dist/merkle/index.js +0 -11
- package/dist/shared/clients/index.d.ts +0 -8
- package/dist/shared/clients/index.js +0 -8
- package/dist/shared/constants/quote.d.ts +0 -30
- package/dist/shared/constants/quote.js +0 -37
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.d.ts +0 -32
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.js +0 -83
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +0 -125
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.js +0 -113
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.d.ts +0 -149
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.js +0 -259
- package/dist/shared/foundation/dex/v3-path.d.ts +0 -6
- package/dist/shared/foundation/dex/v3-path.js +0 -35
- package/dist/shared/foundation/gas/bundle-gas.d.ts +0 -49
- package/dist/shared/foundation/gas/bundle-gas.js +0 -93
- package/dist/shared/foundation/gas/profit-hop.d.ts +0 -20
- package/dist/shared/foundation/gas/profit-hop.js +0 -72
- package/dist/shared/foundation/index.d.ts +0 -13
- package/dist/shared/foundation/index.js +0 -12
- package/dist/shared/foundation/nonce/nonce-manager.d.ts +0 -17
- package/dist/shared/foundation/nonce/nonce-manager.js +0 -183
- package/dist/shared/foundation/normalize-unknown.d.ts +0 -9
- package/dist/shared/foundation/normalize-unknown.js +0 -29
- package/dist/shared/foundation/sdk-logger.d.ts +0 -13
- package/dist/shared/foundation/sdk-logger.js +0 -12
- package/dist/shared/foundation/tx/build-request.d.ts +0 -17
- package/dist/shared/foundation/tx/build-request.js +0 -25
- package/dist/shared/foundation/tx/sign-batch.d.ts +0 -5
- package/dist/shared/foundation/tx/sign-batch.js +0 -26
- package/dist/shared/foundation/tx/wallet-sign-patch.d.ts +0 -1
- package/dist/shared/foundation/tx/wallet-sign-patch.js +0 -18
- package/dist/shared/foundation/types/airdrop-sweep.d.ts +0 -79
- package/dist/shared/foundation/types/airdrop-sweep.js +0 -1
- package/dist/shared/foundation/types/erc20.d.ts +0 -65
- package/dist/shared/foundation/types/erc20.js +0 -1
- package/dist/shared/foundation/types/holders-maker.d.ts +0 -64
- package/dist/shared/foundation/types/holders-maker.js +0 -1
- package/dist/shared/foundation/types/index.d.ts +0 -7
- package/dist/shared/foundation/types/index.js +0 -1
- package/dist/shared/foundation/types/lp-inspect.d.ts +0 -102
- package/dist/shared/foundation/types/lp-inspect.js +0 -1
- package/dist/shared/foundation/types/multicall.d.ts +0 -5
- package/dist/shared/foundation/types/multicall.js +0 -1
- package/dist/shared/foundation/types/private-sale.d.ts +0 -35
- package/dist/shared/foundation/types/private-sale.js +0 -1
- package/dist/shared/foundation/types/quote-helpers.d.ts +0 -17
- package/dist/shared/foundation/types/quote-helpers.js +0 -1
- package/dist/types/errors.d.ts +0 -27
- package/dist/types/errors.js +0 -34
- package/dist/utils/holders-maker/addresses.d.ts +0 -12
- package/dist/utils/holders-maker/addresses.js +0 -15
- package/dist/utils/holders-maker/buy-tx.d.ts +0 -44
- package/dist/utils/holders-maker/buy-tx.js +0 -278
- package/dist/utils/holders-maker/constants.d.ts +0 -6
- package/dist/utils/holders-maker/constants.js +0 -7
- package/dist/utils/holders-maker/disperse.d.ts +0 -18
- package/dist/utils/holders-maker/disperse.js +0 -90
- package/dist/utils/holders-maker/routing.d.ts +0 -4
- package/dist/utils/holders-maker/routing.js +0 -45
- package/dist/utils/holders-maker/transfer-tx.d.ts +0 -4
- package/dist/utils/holders-maker/transfer-tx.js +0 -67
- package/dist/utils/holders-maker-helpers.d.ts +0 -9
- package/dist/utils/holders-maker-helpers.js +0 -9
- package/dist/utils/hop-chains.d.ts +0 -35
- package/dist/utils/hop-chains.js +0 -215
- package/dist/utils/lp-inspect-helpers.d.ts +0 -9
- package/dist/utils/lp-inspect-helpers.js +0 -109
- package/dist/utils/types/airdrop-sweep.d.ts +0 -1
- package/dist/utils/types/airdrop-sweep.js +0 -1
- package/dist/utils/types/contract-factory.d.ts +0 -1
- package/dist/utils/types/contract-factory.js +0 -1
- package/dist/utils/types/erc20.d.ts +0 -1
- package/dist/utils/types/erc20.js +0 -1
- package/dist/utils/types/errors.d.ts +0 -1
- package/dist/utils/types/errors.js +0 -1
- package/dist/utils/types/holders-maker.d.ts +0 -1
- package/dist/utils/types/holders-maker.js +0 -1
- package/dist/utils/types/hop-chains.d.ts +0 -8
- package/dist/utils/types/hop-chains.js +0 -1
- package/dist/utils/types/index.d.ts +0 -13
- package/dist/utils/types/index.js +0 -1
- package/dist/utils/types/lp-inspect.d.ts +0 -1
- package/dist/utils/types/lp-inspect.js +0 -1
- package/dist/utils/types/mpc-exclusive.d.ts +0 -5
- package/dist/utils/types/mpc-exclusive.js +0 -1
- package/dist/utils/types/private-sale.d.ts +0 -1
- package/dist/utils/types/private-sale.js +0 -1
- package/dist/utils/types/quote-helpers.d.ts +0 -1
- package/dist/utils/types/quote-helpers.js +0 -1
- package/dist/utils/types/stealth-transfer.d.ts +0 -44
- package/dist/utils/types/stealth-transfer.js +0 -1
- package/dist/utils/types/wallet.d.ts +0 -25
- package/dist/utils/types/wallet.js +0 -1
- package/dist/vanity/index.d.ts +0 -5
- package/dist/vanity/index.js +0 -5
- package/src/abis/contracts/TaxToken.json +0 -969
- package/src/abis/contracts/TokenManager.json +0 -836
- package/src/abis/contracts/TokenManager2.json +0 -136
- package/src/abis/contracts/TokenManagerHelper3.json +0 -993
- /package/dist/{abis/contracts → shared/abis}/TokenManager.json +0 -0
- /package/dist/{abis/contracts → shared/abis}/TokenManagerHelper3.json +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BSC - PancakeSwap 平台模块
|
|
3
3
|
*/
|
|
4
|
-
export { pancakeBundleSwapMerkle, pancakeBatchSwapMerkle, pancakeQuickBatchSwapMerkle, pancakeCrossSwapMerkle, type PancakeBatchSwapSignParams, type PancakeBatchSwapResult, type PancakeQuickBatchSwapParams, type PancakeQuickBatchSwapResult, type PancakeCrossSwapParams, type PancakeCrossSwapResult, } from './bundle-swap.js';
|
|
5
|
-
export
|
|
6
|
-
export { pancakeBundleBuyFirstMerkle } from './bundle-buy-first.js';
|
|
7
|
-
export type { PancakeBuyFirstSignConfig, PancakeBuyFirstConfig, PancakeBundleBuyFirstSignParams, PancakeBundleBuyFirstParams, PancakeBuyFirstResult, } from './bundle-buy-first-helpers.js';
|
|
4
|
+
export { pancakeBundleSwapMerkle, pancakeBatchSwapMerkle, pancakeQuickBatchSwapMerkle, pancakeCrossSwapMerkle, type PancakeSwapSignConfig, type PancakeSwapConfig, type PancakeBundleSwapSignParams, type PancakeBundleSwapParams, type PancakeSwapResult, type PancakeBatchSwapSignParams, type PancakeBatchSwapResult, type PancakeQuickBatchSwapParams, type PancakeQuickBatchSwapResult, type PancakeCrossSwapParams, type PancakeCrossSwapResult, type SwapRouteType, type RouteParams, type V2RouteParams, type V3SingleRouteParams, type V3MultiRouteParams, type UserType, } from './bundle-swap.js';
|
|
5
|
+
export { pancakeBundleBuyFirstMerkle, type PancakeBuyFirstSignConfig, type PancakeBuyFirstConfig, type PancakeBundleBuyFirstSignParams, type PancakeBundleBuyFirstParams, type PancakeBuyFirstResult, } from './bundle-buy-first.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BSC - PancakeSwap 平台模块
|
|
3
3
|
*/
|
|
4
|
+
// Bundle Swap
|
|
4
5
|
export { pancakeBundleSwapMerkle, pancakeBatchSwapMerkle, pancakeQuickBatchSwapMerkle, pancakeCrossSwapMerkle, } from './bundle-swap.js';
|
|
5
|
-
|
|
6
|
+
// Bundle Buy First
|
|
7
|
+
export { pancakeBundleBuyFirstMerkle, } from './bundle-buy-first.js';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 查询: 通过 projectId / token 地址获取信息
|
|
7
7
|
*/
|
|
8
8
|
import { JsonRpcProvider } from 'ethers';
|
|
9
|
-
import type { IroCreateParams, IroCreateProjectResult, IroQueryConfig, IroFactoryTokenInfo
|
|
9
|
+
import type { IroCreateParams, IroCreateProjectResult, IroQueryConfig, IroFactoryTokenInfo } from './types.js';
|
|
10
10
|
export declare class IroFactoryQuery {
|
|
11
11
|
private provider;
|
|
12
12
|
private factory;
|
|
@@ -31,7 +31,7 @@ export declare class IroFactoryQuery {
|
|
|
31
31
|
/**
|
|
32
32
|
* 编码 createProject calldata
|
|
33
33
|
*/
|
|
34
|
-
export declare function encodeCreateProjectCall(params: IroCreateProjectParams): string;
|
|
34
|
+
export declare function encodeCreateProjectCall(params: import('./types.js').IroCreateProjectParams): string;
|
|
35
35
|
/**
|
|
36
36
|
* 创建 IRO 项目 — 签名交易
|
|
37
37
|
*
|
|
@@ -7,14 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Contract, Interface, Wallet, JsonRpcProvider } from 'ethers';
|
|
9
9
|
import { BSC_CHAIN_ID, BSC_RPC_URL } from '../../constants.js';
|
|
10
|
-
import { IRO_FACTORY_ADDRESS, IRO_FACTORY_ABI, CREATE_PROJECT_GAS_LIMIT } from './constants.js';
|
|
10
|
+
import { IRO_FACTORY_ADDRESS, IRO_FACTORY_ABI, CREATE_PROJECT_GAS_LIMIT, } from './constants.js';
|
|
11
11
|
const factoryIface = new Interface(IRO_FACTORY_ABI);
|
|
12
12
|
// ============================================================================
|
|
13
13
|
// 只读查询
|
|
14
14
|
// ============================================================================
|
|
15
15
|
export class IroFactoryQuery {
|
|
16
|
-
provider;
|
|
17
|
-
factory;
|
|
18
16
|
constructor(config = {}) {
|
|
19
17
|
const rpcUrl = config.rpcUrl ?? BSC_RPC_URL;
|
|
20
18
|
const chainId = config.chainId ?? BSC_CHAIN_ID;
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export type { WhiteListQuota, IroCreateProjectParams, IroFactoryTokenInfo, IroSubscribeParams, IroPledgeParams, IroTokenPrice, IroPoolRemovePledgeParams, IroPoolExtractParams, IroPoolTransferAwardsParams, IroTokenInfo, IroTxResult, IroCreateProjectResult, IroQueryConfig, IroCreateParams, } from './types.js';
|
|
10
10
|
export { IRO_FACTORY_ADDRESS, IROSWAP_V2_ROUTER, IROSWAP_V2_FACTORY, USDT_BSC, IRO_FACTORY_ABI, IRO_TOKEN_ABI, IRO_POOL_ABI, CREATE_PROJECT_GAS_LIMIT, SUBSCRIBE_GAS_LIMIT, POOL_OPERATION_GAS_LIMIT, } from './constants.js';
|
|
11
|
-
export { IroFactoryQuery, encodeCreateProjectCall, createProject, parseCreateProjectEvent } from './factory.js';
|
|
12
|
-
export { IroTokenQuery, subscribe, pledge, batchSubscribe, batchSubscribeForSubmit } from './token.js';
|
|
13
|
-
export type { IroBatchSubscribeForSubmitParams, IroBatchSubscribeForSubmitResult } from './token.js';
|
|
14
|
-
export { IroPoolQuery, poolRemovePledge, poolExtract, poolTransferAwards, batchExtract } from './pool.js';
|
|
11
|
+
export { IroFactoryQuery, encodeCreateProjectCall, createProject, parseCreateProjectEvent, } from './factory.js';
|
|
12
|
+
export { IroTokenQuery, subscribe, pledge, batchSubscribe, batchSubscribeForSubmit, } from './token.js';
|
|
13
|
+
export type { IroBatchSubscribeForSubmitParams, IroBatchSubscribeForSubmitResult, } from './token.js';
|
|
14
|
+
export { IroPoolQuery, poolRemovePledge, poolExtract, poolTransferAwards, batchExtract, } from './pool.js';
|
|
15
15
|
export { IRO_PLATFORM_URL, IRO_TESTNET_PLATFORM_URL, setIroApiBase, setIroTestApiBase, iroApiCreateProject, iroApiUploadImage, } from './api.js';
|
|
16
|
-
export type { IroApiCreateProjectRequest, IroApiCreateProjectResponse, IroApiUploadImageResponse } from './api.js';
|
|
16
|
+
export type { IroApiCreateProjectRequest, IroApiCreateProjectResponse, IroApiUploadImageResponse, } from './api.js';
|
|
@@ -13,15 +13,15 @@ export { IRO_FACTORY_ADDRESS, IROSWAP_V2_ROUTER, IROSWAP_V2_FACTORY, USDT_BSC, I
|
|
|
13
13
|
// ============================================================================
|
|
14
14
|
// Factory (工厂合约)
|
|
15
15
|
// ============================================================================
|
|
16
|
-
export { IroFactoryQuery, encodeCreateProjectCall, createProject, parseCreateProjectEvent } from './factory.js';
|
|
16
|
+
export { IroFactoryQuery, encodeCreateProjectCall, createProject, parseCreateProjectEvent, } from './factory.js';
|
|
17
17
|
// ============================================================================
|
|
18
18
|
// Token (代币合约 — 认购)
|
|
19
19
|
// ============================================================================
|
|
20
|
-
export { IroTokenQuery, subscribe, pledge, batchSubscribe, batchSubscribeForSubmit } from './token.js';
|
|
20
|
+
export { IroTokenQuery, subscribe, pledge, batchSubscribe, batchSubscribeForSubmit, } from './token.js';
|
|
21
21
|
// ============================================================================
|
|
22
22
|
// Pool (资金池 — 质押/挖矿)
|
|
23
23
|
// ============================================================================
|
|
24
|
-
export { IroPoolQuery, poolRemovePledge, poolExtract, poolTransferAwards, batchExtract } from './pool.js';
|
|
24
|
+
export { IroPoolQuery, poolRemovePledge, poolExtract, poolTransferAwards, batchExtract, } from './pool.js';
|
|
25
25
|
// ============================================================================
|
|
26
26
|
// API (IRO 平台后端)
|
|
27
27
|
// ============================================================================
|
|
@@ -16,9 +16,6 @@ const poolIface = new Interface(IRO_POOL_ABI);
|
|
|
16
16
|
// 查询
|
|
17
17
|
// ============================================================================
|
|
18
18
|
export class IroPoolQuery {
|
|
19
|
-
provider;
|
|
20
|
-
pool;
|
|
21
|
-
poolAddress;
|
|
22
19
|
constructor(poolAddress, rpcUrl, chainId) {
|
|
23
20
|
this.poolAddress = poolAddress;
|
|
24
21
|
this.provider = new JsonRpcProvider(rpcUrl ?? BSC_RPC_URL, chainId ?? BSC_CHAIN_ID, { staticNetwork: true });
|
|
@@ -65,37 +62,19 @@ export class IroPoolQuery {
|
|
|
65
62
|
const raw = await this.pool.increaseRateMap(index);
|
|
66
63
|
return { status: raw[0], rate: BigInt(raw[1]) };
|
|
67
64
|
}
|
|
68
|
-
async totalSupply() {
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
async balanceOf(account) {
|
|
72
|
-
return this.pool.balanceOf(account);
|
|
73
|
-
}
|
|
74
|
-
async lastPrice() {
|
|
75
|
-
return this.pool.lastPrice();
|
|
76
|
-
}
|
|
65
|
+
async totalSupply() { return this.pool.totalSupply(); }
|
|
66
|
+
async balanceOf(account) { return this.pool.balanceOf(account); }
|
|
67
|
+
async lastPrice() { return this.pool.lastPrice(); }
|
|
77
68
|
async userAward(account) {
|
|
78
69
|
const raw = await this.pool.userAward(account);
|
|
79
70
|
return {
|
|
80
|
-
deposit: BigInt(raw[0]),
|
|
81
|
-
|
|
82
|
-
share: BigInt(raw[2]),
|
|
83
|
-
lastTimestamp: BigInt(raw[3]),
|
|
84
|
-
totalDeposit: BigInt(raw[4]),
|
|
85
|
-
totalInviteReward: BigInt(raw[5]),
|
|
86
|
-
lastInviteReward: BigInt(raw[6]),
|
|
87
|
-
pledgeNum: BigInt(raw[7]),
|
|
71
|
+
deposit: BigInt(raw[0]), debt: BigInt(raw[1]), share: BigInt(raw[2]), lastTimestamp: BigInt(raw[3]),
|
|
72
|
+
totalDeposit: BigInt(raw[4]), totalInviteReward: BigInt(raw[5]), lastInviteReward: BigInt(raw[6]), pledgeNum: BigInt(raw[7]),
|
|
88
73
|
};
|
|
89
74
|
}
|
|
90
|
-
async getUserStake(account) {
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
async ownerAddr() {
|
|
94
|
-
return this.pool.ownerAddr();
|
|
95
|
-
}
|
|
96
|
-
async isInitialized() {
|
|
97
|
-
return this.pool.isInitialized();
|
|
98
|
-
}
|
|
75
|
+
async getUserStake(account) { return this.pool.getUserStake(account); }
|
|
76
|
+
async ownerAddr() { return this.pool.ownerAddr(); }
|
|
77
|
+
async isInitialized() { return this.pool.isInitialized(); }
|
|
99
78
|
get providerInstance() {
|
|
100
79
|
return this.provider;
|
|
101
80
|
}
|
|
@@ -108,7 +87,7 @@ export class IroPoolQuery {
|
|
|
108
87
|
* removePledge() — 用户直接调用
|
|
109
88
|
*/
|
|
110
89
|
export async function poolRemovePledge(params) {
|
|
111
|
-
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, privateKey, poolAddress, gasPrice } = params;
|
|
90
|
+
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, privateKey, poolAddress, gasPrice, } = params;
|
|
112
91
|
const provider = new JsonRpcProvider(rpcUrl, chainId, { staticNetwork: true });
|
|
113
92
|
const wallet = new Wallet(privateKey, provider);
|
|
114
93
|
const calldata = poolIface.encodeFunctionData('removePledge', []);
|
|
@@ -130,7 +109,7 @@ export async function poolRemovePledge(params) {
|
|
|
130
109
|
* extract(uint256 amount) — 用户直接调用
|
|
131
110
|
*/
|
|
132
111
|
export async function poolExtract(params) {
|
|
133
|
-
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, privateKey, poolAddress, amount, gasPrice } = params;
|
|
112
|
+
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, privateKey, poolAddress, amount, gasPrice, } = params;
|
|
134
113
|
const provider = new JsonRpcProvider(rpcUrl, chainId, { staticNetwork: true });
|
|
135
114
|
const wallet = new Wallet(privateKey, provider);
|
|
136
115
|
const calldata = poolIface.encodeFunctionData('extract', [amount]);
|
|
@@ -16,9 +16,6 @@ const tokenIface = new Interface(IRO_TOKEN_ABI);
|
|
|
16
16
|
// 查询
|
|
17
17
|
// ============================================================================
|
|
18
18
|
export class IroTokenQuery {
|
|
19
|
-
provider;
|
|
20
|
-
token;
|
|
21
|
-
tokenAddress;
|
|
22
19
|
constructor(tokenAddress, rpcUrl, chainId) {
|
|
23
20
|
this.tokenAddress = tokenAddress;
|
|
24
21
|
this.provider = new JsonRpcProvider(rpcUrl ?? BSC_RPC_URL, chainId ?? BSC_CHAIN_ID, { staticNetwork: true });
|
|
@@ -220,7 +217,7 @@ export async function batchSubscribe(params) {
|
|
|
220
217
|
* 后端 submit_blockrazor 会验证最后 3 笔是利润交易,然后去掉后广播业务交易
|
|
221
218
|
*/
|
|
222
219
|
export async function batchSubscribeForSubmit(params) {
|
|
223
|
-
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, tokenAddress, subscribers, approvalTxs = [], gasPrice, subscribeGasLimit
|
|
220
|
+
const { rpcUrl = BSC_RPC_URL, chainId = BSC_CHAIN_ID, tokenAddress, subscribers, approvalTxs = [], gasPrice, subscribeGasLimit } = params;
|
|
224
221
|
if (subscribers.length === 0) {
|
|
225
222
|
return { signedTransactions: [...approvalTxs], subscribeResults: [], profitAmount: 0n };
|
|
226
223
|
}
|
|
@@ -5,10 +5,9 @@
|
|
|
5
5
|
* ENI 不支持 EIP-7702,所以无法在一笔 tx 中完成多钱包 approve
|
|
6
6
|
* 采用并行广播策略
|
|
7
7
|
*/
|
|
8
|
-
import { Wallet, Interface } from 'ethers';
|
|
8
|
+
import { Wallet, JsonRpcProvider, Interface } from 'ethers';
|
|
9
9
|
import { ENI_CHAIN_ID, ENI_RPC_URL } from '../constants.js';
|
|
10
|
-
import {
|
|
11
|
-
import { ERC20_ABI } from '../../../abis/common.js';
|
|
10
|
+
import { ERC20_ABI } from '../../../shared/abis/common.js';
|
|
12
11
|
const MAX_UINT256 = BigInt('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff');
|
|
13
12
|
const erc20Iface = new Interface(ERC20_ABI);
|
|
14
13
|
/**
|
|
@@ -17,7 +16,7 @@ const erc20Iface = new Interface(ERC20_ABI);
|
|
|
17
16
|
*/
|
|
18
17
|
export async function batchApprove(params) {
|
|
19
18
|
const { rpcUrl = ENI_RPC_URL, token, privateKeys, spender, gasPrice } = params;
|
|
20
|
-
const provider =
|
|
19
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
21
20
|
const feeData = await provider.getFeeData();
|
|
22
21
|
const maxFeePerGas = gasPrice ?? feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
23
22
|
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 0n;
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
* - eniDisperseForSubmit: 前端统一入口 (EGAS / ERC20 分发)
|
|
9
9
|
* - eniSweepForSubmit: 前端统一入口 (EGAS / ERC20 归集)
|
|
10
10
|
*/
|
|
11
|
-
import { Wallet, Interface, Contract, ethers } from 'ethers';
|
|
11
|
+
import { Wallet, JsonRpcProvider, Interface, Contract, ethers } from 'ethers';
|
|
12
12
|
import { ENI_CHAIN_ID, ENI_RPC_URL } from '../constants.js';
|
|
13
|
-
import { createEniProvider } from '../../../utils/provider-factory.js';
|
|
14
13
|
import { BATCH_ROUTER_ADDRESS, estimateGas } from './constants.js';
|
|
15
14
|
import { validateBatchParams, encodeBatchTransfer, encodeBatchTransferToken, buildBatchRouterTx } from './utils.js';
|
|
16
|
-
import { ERC20_ABI } from '../../../abis/common.js';
|
|
15
|
+
import { ERC20_ABI } from '../../../shared/abis/common.js';
|
|
17
16
|
import { getProfitRecipient, calculateTransferFee } from '../../../shared/constants/profit.js';
|
|
18
17
|
import { GAS_LIMITS } from '../../../shared/constants/gas.js';
|
|
19
18
|
const erc20Iface = new Interface(ERC20_ABI);
|
|
@@ -61,7 +60,7 @@ export async function batchSweepToken(params) {
|
|
|
61
60
|
if (privateKeys.length !== amounts.length) {
|
|
62
61
|
throw new Error(`privateKeys.length (${privateKeys.length}) !== amounts.length (${amounts.length})`);
|
|
63
62
|
}
|
|
64
|
-
const provider =
|
|
63
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
65
64
|
const feeData = await provider.getFeeData();
|
|
66
65
|
const maxFeePerGas = gasPrice ?? feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
67
66
|
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 0n;
|
|
@@ -88,7 +87,7 @@ export async function batchSweepEgas(params) {
|
|
|
88
87
|
if (privateKeys.length !== amounts.length) {
|
|
89
88
|
throw new Error(`privateKeys.length (${privateKeys.length}) !== amounts.length (${amounts.length})`);
|
|
90
89
|
}
|
|
91
|
-
const provider =
|
|
90
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
92
91
|
const feeData = await provider.getFeeData();
|
|
93
92
|
const maxFeePerGas = gasPrice ?? feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
94
93
|
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 0n;
|
|
@@ -113,8 +112,8 @@ export async function eniDisperseForSubmit(params) {
|
|
|
113
112
|
const { rpcUrl = ENI_RPC_URL, fromPrivateKey, recipients, tokenAddress, hopCount = 0 } = params;
|
|
114
113
|
const decimals = params.tokenDecimals ?? 18;
|
|
115
114
|
const isNative = !tokenAddress || tokenAddress === ethers.ZeroAddress;
|
|
116
|
-
const amountsWei = params.amounts.map(
|
|
117
|
-
const provider =
|
|
115
|
+
const amountsWei = params.amounts.map(a => ethers.parseUnits(a, decimals));
|
|
116
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
118
117
|
const mainWallet = new Wallet(fromPrivateKey, provider);
|
|
119
118
|
const feeData = await provider.getFeeData();
|
|
120
119
|
const maxFeePerGas = feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
@@ -124,17 +123,8 @@ export async function eniDisperseForSubmit(params) {
|
|
|
124
123
|
const erc20GasLimit = params.gasLimit ? BigInt(params.gasLimit) : DEFAULT_GAS_PER_SWEEP;
|
|
125
124
|
if (hopCount > 0) {
|
|
126
125
|
return eniDisperseWithHops({
|
|
127
|
-
provider,
|
|
128
|
-
|
|
129
|
-
recipients,
|
|
130
|
-
amountsWei,
|
|
131
|
-
isNative,
|
|
132
|
-
tokenAddress,
|
|
133
|
-
hopCount,
|
|
134
|
-
profitAmount,
|
|
135
|
-
maxFeePerGas,
|
|
136
|
-
maxPriorityFeePerGas,
|
|
137
|
-
erc20GasLimit,
|
|
126
|
+
provider, mainWallet, recipients, amountsWei, isNative, tokenAddress,
|
|
127
|
+
hopCount, profitAmount, maxFeePerGas, maxPriorityFeePerGas, erc20GasLimit,
|
|
138
128
|
});
|
|
139
129
|
}
|
|
140
130
|
// ===== 无多跳:使用 BatchRouter 合约批量分发 =====
|
|
@@ -226,8 +216,8 @@ async function eniDisperseWithHops(params) {
|
|
|
226
216
|
const finalRecipient = recipients[i];
|
|
227
217
|
const amountWei = amountsWei[i];
|
|
228
218
|
const hops = hopWallets[i];
|
|
229
|
-
const fullChain = [mainWallet, ...hops.map(
|
|
230
|
-
const addresses = [...fullChain.map(
|
|
219
|
+
const fullChain = [mainWallet, ...hops.map(h => new Wallet(h.privateKey, provider))];
|
|
220
|
+
const addresses = [...fullChain.map(w => w.address), finalRecipient];
|
|
231
221
|
if (isNative) {
|
|
232
222
|
for (let j = 0; j < addresses.length - 1; j++) {
|
|
233
223
|
const fromWallet = fullChain[j];
|
|
@@ -363,7 +353,7 @@ export async function eniSweepForSubmit(params) {
|
|
|
363
353
|
const isNative = !tokenAddress || tokenAddress === ethers.ZeroAddress;
|
|
364
354
|
const ratioPct = params.ratioPct ?? 100;
|
|
365
355
|
const erc20GasLimit = params.gasLimit ? BigInt(params.gasLimit) : DEFAULT_GAS_PER_SWEEP;
|
|
366
|
-
const provider =
|
|
356
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
367
357
|
const feeData = await provider.getFeeData();
|
|
368
358
|
const maxFeePerGas = feeData.maxFeePerGas ?? feeData.gasPrice ?? 1000000000n;
|
|
369
359
|
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas ?? 0n;
|
|
@@ -391,19 +381,12 @@ export async function eniSweepForSubmit(params) {
|
|
|
391
381
|
return { signedTransactions: [] };
|
|
392
382
|
if (hopCount > 0) {
|
|
393
383
|
return eniSweepWithHops({
|
|
394
|
-
provider,
|
|
395
|
-
|
|
396
|
-
validAmounts,
|
|
397
|
-
target,
|
|
398
|
-
targetPrivateKey,
|
|
399
|
-
isNative: true,
|
|
400
|
-
hopCount,
|
|
401
|
-
maxFeePerGas,
|
|
402
|
-
maxPriorityFeePerGas,
|
|
384
|
+
provider, validKeys, validAmounts, target, targetPrivateKey,
|
|
385
|
+
isNative: true, hopCount, maxFeePerGas, maxPriorityFeePerGas,
|
|
403
386
|
});
|
|
404
387
|
}
|
|
405
388
|
const result = await batchSweepEgas({ rpcUrl, privateKeys: validKeys, amounts: validAmounts, target });
|
|
406
|
-
const signedTxs = result.transactions.map(
|
|
389
|
+
const signedTxs = result.transactions.map(tx => tx.signedTx);
|
|
407
390
|
if (targetPrivateKey) {
|
|
408
391
|
const profitTxGasCost = GAS_LIMITS.NATIVE_TRANSFER * maxFeePerGas;
|
|
409
392
|
const profitAmount = calculateTransferFee(ENI_CHAIN_ID, validKeys.length) + profitTxGasCost;
|
|
@@ -426,7 +409,9 @@ export async function eniSweepForSubmit(params) {
|
|
|
426
409
|
// ===== ERC20 归集 =====
|
|
427
410
|
const erc20 = new Contract(tokenAddress, ERC20_ABI, provider);
|
|
428
411
|
const erc20TransferGasCost = erc20GasLimit * maxFeePerGas;
|
|
429
|
-
const hopGasCostPerWallet = hopCount > 0
|
|
412
|
+
const hopGasCostPerWallet = hopCount > 0
|
|
413
|
+
? gasForTransfer * BigInt(hopCount) + erc20GasLimit * maxFeePerGas * BigInt(hopCount)
|
|
414
|
+
: 0n;
|
|
430
415
|
const minNativeRequired = erc20TransferGasCost + hopGasCostPerWallet;
|
|
431
416
|
const walletsData = await Promise.all(sourcePrivateKeys.map(async (key) => {
|
|
432
417
|
const wallet = new Wallet(key, provider);
|
|
@@ -443,6 +428,7 @@ export async function eniSweepForSubmit(params) {
|
|
|
443
428
|
if (tokenBal <= 0n)
|
|
444
429
|
continue;
|
|
445
430
|
if (nativeBal < minNativeRequired) {
|
|
431
|
+
console.log(`[eniSweep] 跳过钱包 ${i}: EGAS 余额 ${ethers.formatEther(nativeBal)} 不足以支付 gas (需要 ${ethers.formatEther(minNativeRequired)})`);
|
|
446
432
|
continue;
|
|
447
433
|
}
|
|
448
434
|
const amount = ratioPct >= 100 ? tokenBal : (tokenBal * BigInt(ratioPct)) / 100n;
|
|
@@ -455,28 +441,12 @@ export async function eniSweepForSubmit(params) {
|
|
|
455
441
|
return { signedTransactions: [] };
|
|
456
442
|
if (hopCount > 0) {
|
|
457
443
|
return eniSweepWithHops({
|
|
458
|
-
provider,
|
|
459
|
-
|
|
460
|
-
validAmounts,
|
|
461
|
-
target,
|
|
462
|
-
targetPrivateKey,
|
|
463
|
-
isNative: false,
|
|
464
|
-
tokenAddress,
|
|
465
|
-
hopCount,
|
|
466
|
-
maxFeePerGas,
|
|
467
|
-
maxPriorityFeePerGas,
|
|
468
|
-
erc20GasLimit,
|
|
444
|
+
provider, validKeys, validAmounts, target, targetPrivateKey,
|
|
445
|
+
isNative: false, tokenAddress, hopCount, maxFeePerGas, maxPriorityFeePerGas, erc20GasLimit,
|
|
469
446
|
});
|
|
470
447
|
}
|
|
471
|
-
const result = await batchSweepToken({
|
|
472
|
-
|
|
473
|
-
token: tokenAddress,
|
|
474
|
-
privateKeys: validKeys,
|
|
475
|
-
amounts: validAmounts,
|
|
476
|
-
target,
|
|
477
|
-
gasLimit: erc20GasLimit,
|
|
478
|
-
});
|
|
479
|
-
const signedTxs = result.transactions.map((tx) => tx.signedTx);
|
|
448
|
+
const result = await batchSweepToken({ rpcUrl, token: tokenAddress, privateKeys: validKeys, amounts: validAmounts, target, gasLimit: erc20GasLimit });
|
|
449
|
+
const signedTxs = result.transactions.map(tx => tx.signedTx);
|
|
480
450
|
if (targetPrivateKey) {
|
|
481
451
|
const profitTxGasCost = GAS_LIMITS.NATIVE_TRANSFER * maxFeePerGas;
|
|
482
452
|
const profitAmount = calculateTransferFee(ENI_CHAIN_ID, validKeys.length) + profitTxGasCost;
|
|
@@ -515,8 +485,8 @@ async function eniSweepWithHops(params) {
|
|
|
515
485
|
const sourceWallet = new Wallet(validKeys[i], provider);
|
|
516
486
|
const amountWei = validAmounts[i];
|
|
517
487
|
const hops = hopWallets[i];
|
|
518
|
-
const fullChain = [sourceWallet, ...hops.map(
|
|
519
|
-
const addresses = [...fullChain.map(
|
|
488
|
+
const fullChain = [sourceWallet, ...hops.map(h => new Wallet(h.privateKey, provider))];
|
|
489
|
+
const addresses = [...fullChain.map(w => w.address), target];
|
|
520
490
|
const sourceNonce = await sourceWallet.getNonce();
|
|
521
491
|
if (isNative) {
|
|
522
492
|
for (let j = 0; j < addresses.length - 1; j++) {
|
|
@@ -573,7 +543,7 @@ async function eniSweepWithHops(params) {
|
|
|
573
543
|
to: tokenAddress,
|
|
574
544
|
data: srcToFirstHopData,
|
|
575
545
|
value: 0n,
|
|
576
|
-
nonce: srcNonce
|
|
546
|
+
nonce: srcNonce++,
|
|
577
547
|
chainId: BigInt(ENI_CHAIN_ID),
|
|
578
548
|
type: 2,
|
|
579
549
|
maxFeePerGas,
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 对标 BSC 全部 Bundle 操作的 calldata 编码
|
|
5
5
|
*/
|
|
6
|
-
import { Interface, Wallet } from 'ethers';
|
|
6
|
+
import { Interface, Wallet, JsonRpcProvider } from 'ethers';
|
|
7
7
|
import { ENI_CHAIN_ID, ENI_RPC_URL } from '../constants.js';
|
|
8
|
-
import { createEniProvider } from '../../../utils/provider-factory.js';
|
|
9
8
|
import { BATCH_ROUTER_ABI, MAX_BATCH_SIZE } from './constants.js';
|
|
10
9
|
const routerIface = new Interface(BATCH_ROUTER_ABI);
|
|
11
10
|
// ============================================================================
|
|
@@ -66,14 +65,7 @@ export function encodeBuyFirstSwapV2(router, token, buyers, buyAmounts, sellers,
|
|
|
66
65
|
// ============================================================================
|
|
67
66
|
export function encodeCreateAndBatchBuy(portal, name, symbol, salt, createValue, token, buyers, buyAmounts) {
|
|
68
67
|
return routerIface.encodeFunctionData('createAndBatchBuy', [
|
|
69
|
-
portal,
|
|
70
|
-
name,
|
|
71
|
-
symbol,
|
|
72
|
-
salt,
|
|
73
|
-
createValue,
|
|
74
|
-
token,
|
|
75
|
-
buyers,
|
|
76
|
-
buyAmounts,
|
|
68
|
+
portal, name, symbol, salt, createValue, token, buyers, buyAmounts,
|
|
77
69
|
]);
|
|
78
70
|
}
|
|
79
71
|
export function encodeFairLaunchAndBatchBuyV2(launcher, launchParams, launchValue, router, token, buyers, buyAmounts) {
|
|
@@ -111,13 +103,7 @@ export function encodeFairLaunchAndBatchBuyV2(launcher, launchParams, launchValu
|
|
|
111
103
|
launchParams.inviteCodes,
|
|
112
104
|
];
|
|
113
105
|
return routerIface.encodeFunctionData('fairLaunchAndBatchBuyV2', [
|
|
114
|
-
launcher,
|
|
115
|
-
paramsTuple,
|
|
116
|
-
launchValue,
|
|
117
|
-
router,
|
|
118
|
-
token,
|
|
119
|
-
buyers,
|
|
120
|
-
buyAmounts,
|
|
106
|
+
launcher, paramsTuple, launchValue, router, token, buyers, buyAmounts,
|
|
121
107
|
]);
|
|
122
108
|
}
|
|
123
109
|
// ============================================================================
|
|
@@ -125,24 +111,12 @@ export function encodeFairLaunchAndBatchBuyV2(launcher, launchParams, launchValu
|
|
|
125
111
|
// ============================================================================
|
|
126
112
|
export function encodeCrossSwapPortalToV2(portal, router, token, sellers, sellAmounts, buyers, buyAmounts) {
|
|
127
113
|
return routerIface.encodeFunctionData('crossSwapPortalToV2', [
|
|
128
|
-
portal,
|
|
129
|
-
router,
|
|
130
|
-
token,
|
|
131
|
-
sellers,
|
|
132
|
-
sellAmounts,
|
|
133
|
-
buyers,
|
|
134
|
-
buyAmounts,
|
|
114
|
+
portal, router, token, sellers, sellAmounts, buyers, buyAmounts,
|
|
135
115
|
]);
|
|
136
116
|
}
|
|
137
117
|
export function encodeCrossSwapV2ToPortal(portal, router, token, sellers, sellAmounts, buyers, buyAmounts) {
|
|
138
118
|
return routerIface.encodeFunctionData('crossSwapV2ToPortal', [
|
|
139
|
-
portal,
|
|
140
|
-
router,
|
|
141
|
-
token,
|
|
142
|
-
sellers,
|
|
143
|
-
sellAmounts,
|
|
144
|
-
buyers,
|
|
145
|
-
buyAmounts,
|
|
119
|
+
portal, router, token, sellers, sellAmounts, buyers, buyAmounts,
|
|
146
120
|
]);
|
|
147
121
|
}
|
|
148
122
|
// ============================================================================
|
|
@@ -162,7 +136,7 @@ export function encodeBatchSweepToken(token, sources, target) {
|
|
|
162
136
|
// ============================================================================
|
|
163
137
|
export async function buildBatchRouterTx(params) {
|
|
164
138
|
const { rpcUrl = ENI_RPC_URL, mainPrivateKey, batchRouterAddress, calldata, value = 0n, gasLimit, gasPrice } = params;
|
|
165
|
-
const provider =
|
|
139
|
+
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
166
140
|
const wallet = new Wallet(mainPrivateKey, provider);
|
|
167
141
|
const nonce = await wallet.getNonce();
|
|
168
142
|
const feeData = await provider.getFeeData();
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 各钱包离线签署操作意图,主钱包收集后统一提交。
|
|
5
5
|
*/
|
|
6
|
-
import { Wallet, JsonRpcProvider
|
|
6
|
+
import { Wallet, JsonRpcProvider } from 'ethers';
|
|
7
7
|
import { ENI_CHAIN_ID, ENI_RPC_URL } from '../constants.js';
|
|
8
8
|
import { ENI_BUNDLER_ABI, EIP712_DOMAIN, SIGNED_OP_TYPE, TOKEN_PULL_TYPE } from './constants.js';
|
|
9
9
|
const DEFAULT_DEADLINE_SEC = 300;
|
|
@@ -19,6 +19,7 @@ function buildDomain(bundlerAddress, chainId = Number(ENI_CHAIN_ID)) {
|
|
|
19
19
|
*/
|
|
20
20
|
export async function getBundlerNonce(params) {
|
|
21
21
|
const provider = new JsonRpcProvider(params.rpcUrl ?? ENI_RPC_URL, ENI_CHAIN_ID, { staticNetwork: true });
|
|
22
|
+
const { Interface } = await import('ethers');
|
|
22
23
|
const iface = new Interface(ENI_BUNDLER_ABI);
|
|
23
24
|
const data = iface.encodeFunctionData('nonces', [params.signer]);
|
|
24
25
|
const result = await provider.call({ to: params.bundlerAddress, data });
|
|
@@ -31,7 +32,7 @@ export async function signOperation(params) {
|
|
|
31
32
|
const { privateKey, bundlerAddress, op, rpcUrl } = params;
|
|
32
33
|
const wallet = new Wallet(privateKey);
|
|
33
34
|
const signer = wallet.address;
|
|
34
|
-
const nonce = params.nonce ??
|
|
35
|
+
const nonce = params.nonce ?? await getBundlerNonce({ rpcUrl, bundlerAddress, signer });
|
|
35
36
|
const deadline = BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_SEC);
|
|
36
37
|
const domain = buildDomain(bundlerAddress);
|
|
37
38
|
const value = {
|
|
@@ -60,7 +61,7 @@ export async function signTokenPull(params) {
|
|
|
60
61
|
const { privateKey, bundlerAddress, token, spender, amount, rpcUrl } = params;
|
|
61
62
|
const wallet = new Wallet(privateKey);
|
|
62
63
|
const signer = wallet.address;
|
|
63
|
-
const nonce = params.nonce ??
|
|
64
|
+
const nonce = params.nonce ?? await getBundlerNonce({ rpcUrl, bundlerAddress, signer });
|
|
64
65
|
const deadline = BigInt(Math.floor(Date.now() / 1000) + DEFAULT_DEADLINE_SEC);
|
|
65
66
|
const domain = buildDomain(bundlerAddress);
|
|
66
67
|
const value = {
|
|
@@ -90,8 +91,8 @@ export async function signOperationsBatch(params) {
|
|
|
90
91
|
if (privateKeys.length !== ops.length) {
|
|
91
92
|
throw new Error(`privateKeys.length (${privateKeys.length}) !== ops.length (${ops.length})`);
|
|
92
93
|
}
|
|
93
|
-
const signers = privateKeys.map(
|
|
94
|
-
const nonces = await Promise.all(signers.map(
|
|
94
|
+
const signers = privateKeys.map(k => new Wallet(k).address);
|
|
95
|
+
const nonces = await Promise.all(signers.map(signer => getBundlerNonce({ rpcUrl, bundlerAddress, signer })));
|
|
95
96
|
return Promise.all(privateKeys.map((pk, i) => signOperation({
|
|
96
97
|
privateKey: pk,
|
|
97
98
|
bundlerAddress,
|
|
@@ -46,7 +46,10 @@ export async function buildExecuteBatch(params) {
|
|
|
46
46
|
export async function buildPullAndExecute(params) {
|
|
47
47
|
const { rpcUrl = ENI_RPC_URL, mainPrivateKey, bundlerAddress, pulls, ops, gasPrice } = params;
|
|
48
48
|
const totalValue = ops.reduce((sum, op) => sum + op.value, 0n);
|
|
49
|
-
const calldata = bundlerIface.encodeFunctionData('pullAndExecute', [
|
|
49
|
+
const calldata = bundlerIface.encodeFunctionData('pullAndExecute', [
|
|
50
|
+
pulls.map(toPullTuple),
|
|
51
|
+
ops.map(toOpTuple),
|
|
52
|
+
]);
|
|
50
53
|
const provider = new JsonRpcProvider(rpcUrl, ENI_CHAIN_ID, { staticNetwork: true });
|
|
51
54
|
const wallet = new Wallet(mainPrivateKey, provider);
|
|
52
55
|
const nonce = await wallet.getNonce();
|
|
@@ -45,7 +45,7 @@ export const DAOAAS_BUY_FEE_RATE = 0.015;
|
|
|
45
45
|
/** DAOaaS Portal 卖出手续费率 (1.5%) */
|
|
46
46
|
export const DAOAAS_SELL_FEE_RATE = 0.015;
|
|
47
47
|
/** LPFairLauncher RATE_BASE */
|
|
48
|
-
export const RATE_BASE =
|
|
48
|
+
export const RATE_BASE = 1000000;
|
|
49
49
|
/** 最大 BatchRouter 钱包数(受 10M gas 限制, ~35-45 钱包) */
|
|
50
50
|
export const MAX_BATCH_WALLETS = 35;
|
|
51
51
|
// ============================================================================
|
|
@@ -15,9 +15,8 @@ export type { DaoaasTokenState, DaoaasBuyParams, DaoaasSellParams, DaoaasCreateP
|
|
|
15
15
|
export { TokenLaunchType, FairLauncherQuery, launchToken, launchTokenForSubmit, setTokenTradeStartTime, setTokenTradeStartTimeForSubmit, encodeLaunchTokenCall, standardPreset, liquidityProvidingPreset, dividendPreset, dividendBuybackPreset, deflationaryPreset, validateLaunchParams, detectLaunchType, RATE_BASE, QUOTE_TOKENS, LP_FAIR_LAUNCHER_ADDRESS, } from './platforms/fair-launch/index.js';
|
|
16
16
|
export type { LaunchParams, FairLaunchTokenInfo, FairLaunchQueryConfig, FairLaunchCreateParams, FairLaunchCreateResult, } from './platforms/fair-launch/index.js';
|
|
17
17
|
export { FairPoolQuery, claimFromPool, claimFromPoolForSubmit, batchClaimForSubmit, } from './platforms/fair-launch/index.js';
|
|
18
|
-
export type { PoolOverview, PoolClaimParams, PoolClaimResult } from './platforms/fair-launch/index.js';
|
|
18
|
+
export type { PoolOverview, PoolClaimParams, PoolClaimResult, } from './platforms/fair-launch/index.js';
|
|
19
19
|
export { getLPPairInfo, batchGetLPPairInfo, getPairAddress, addLiquidityETHForSubmit, removeLiquidityETHForSubmit, addLiquidityForSubmit, removeLiquidityForSubmit, } from './platforms/dswap/index.js';
|
|
20
20
|
export type { LPPairInfo, GetLPInfoParams, BatchGetLPInfoParams, AddLiquidityETHParams, RemoveLiquidityETHParams, AddLiquidityParams, RemoveLiquidityParams, LiquidityTxResult, LiquidityForSubmitResult, } from './platforms/dswap/index.js';
|
|
21
21
|
export { IroFactoryQuery as EniIroFactoryQuery, encodeCreateProjectCall as eniIroEncodeCreateProjectCall, createProject as eniIroCreateProject, parseCreateProjectEvent as eniIroParseCreateProjectEvent, IroTokenQuery as EniIroTokenQuery, subscribe as eniIroSubscribe, pledge as eniIroPledge, batchSubscribe as eniIroBatchSubscribe, batchSubscribeForSubmit as eniIroBatchSubscribeForSubmit, IroPoolQuery as EniIroPoolQuery, poolRemovePledge as eniIroPoolRemovePledge, poolExtract as eniIroPoolExtract, poolTransferAwards as eniIroPoolTransferAwards, batchExtract as eniIroBatchExtract, ENI_IRO_FACTORY_ADDRESS, ENI_IRO_OWNER_ADDRESS, ENI_IRO_SELL_FEE_CONTRACT, ENI_IROSWAP_V2_ROUTER, ENI_IROSWAP_V2_FACTORY, IRO_FACTORY_ABI as ENI_IRO_FACTORY_ABI, IRO_TOKEN_ABI as ENI_IRO_TOKEN_ABI, IRO_POOL_ABI as ENI_IRO_POOL_ABI, CREATE_PROJECT_GAS_LIMIT as ENI_CREATE_PROJECT_GAS_LIMIT, ENI_IRO_PLATFORM_URL, setIroApiBase as setEniIroApiBase, iroApiCreateProject as eniIroApiCreateProject, iroApiUploadImage as eniIroApiUploadImage, getTokenWhiteList as eniIroGetTokenWhiteList, addTokenWhiteListForSubmit as eniIroAddTokenWhiteListForSubmit, batchAddTokenWhiteListForSubmit as eniIroBatchAddTokenWhiteListForSubmit, removeTokenWhiteListForSubmit as eniIroRemoveTokenWhiteListForSubmit, IRO_OWNER_WHITELIST_ABI as ENI_IRO_OWNER_WHITELIST_ABI, } from './platforms/iro/index.js';
|
|
22
22
|
export type { WhiteListQuota as EniWhiteListQuota, IroCreateProjectParams as EniIroCreateProjectParams, IroSubscribeParams as EniIroSubscribeParams, IroPledgeParams as EniIroPledgeParams, IroTokenInfo as EniIroTokenInfo, IroTxResult as EniIroTxResult, IroCreateProjectResult as EniIroCreateProjectResult, IroQueryConfig as EniIroQueryConfig, IroCreateParams as EniIroCreateParams, IroBatchSubscribeForSubmitParams as EniIroBatchSubscribeForSubmitParams, IroBatchSubscribeForSubmitResult as EniIroBatchSubscribeForSubmitResult, WhitelistManageConfig as EniWhitelistManageConfig, AddWhitelistParams as EniAddWhitelistParams, BatchAddWhitelistParams as EniBatchAddWhitelistParams, RemoveWhitelistParams as EniRemoveWhitelistParams, GetWhitelistParams as EniGetWhitelistParams, } from './platforms/iro/index.js';
|
|
23
|
-
export * from './flat-aliases.js';
|
package/dist/chains/eni/index.js
CHANGED
|
@@ -31,4 +31,3 @@ export { getLPPairInfo, batchGetLPPairInfo, getPairAddress, addLiquidityETHForSu
|
|
|
31
31
|
// 快捷导出 - IRO (Initial Rights Offering)
|
|
32
32
|
// ============================================================================
|
|
33
33
|
export { IroFactoryQuery as EniIroFactoryQuery, encodeCreateProjectCall as eniIroEncodeCreateProjectCall, createProject as eniIroCreateProject, parseCreateProjectEvent as eniIroParseCreateProjectEvent, IroTokenQuery as EniIroTokenQuery, subscribe as eniIroSubscribe, pledge as eniIroPledge, batchSubscribe as eniIroBatchSubscribe, batchSubscribeForSubmit as eniIroBatchSubscribeForSubmit, IroPoolQuery as EniIroPoolQuery, poolRemovePledge as eniIroPoolRemovePledge, poolExtract as eniIroPoolExtract, poolTransferAwards as eniIroPoolTransferAwards, batchExtract as eniIroBatchExtract, ENI_IRO_FACTORY_ADDRESS, ENI_IRO_OWNER_ADDRESS, ENI_IRO_SELL_FEE_CONTRACT, ENI_IROSWAP_V2_ROUTER, ENI_IROSWAP_V2_FACTORY, IRO_FACTORY_ABI as ENI_IRO_FACTORY_ABI, IRO_TOKEN_ABI as ENI_IRO_TOKEN_ABI, IRO_POOL_ABI as ENI_IRO_POOL_ABI, CREATE_PROJECT_GAS_LIMIT as ENI_CREATE_PROJECT_GAS_LIMIT, ENI_IRO_PLATFORM_URL, setIroApiBase as setEniIroApiBase, iroApiCreateProject as eniIroApiCreateProject, iroApiUploadImage as eniIroApiUploadImage, getTokenWhiteList as eniIroGetTokenWhiteList, addTokenWhiteListForSubmit as eniIroAddTokenWhiteListForSubmit, batchAddTokenWhiteListForSubmit as eniIroBatchAddTokenWhiteListForSubmit, removeTokenWhiteListForSubmit as eniIroRemoveTokenWhiteListForSubmit, IRO_OWNER_WHITELIST_ABI as ENI_IRO_OWNER_WHITELIST_ABI, } from './platforms/iro/index.js';
|
|
34
|
-
export * from './flat-aliases.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 支持 createAndInitPurchase — 创建代币并可选首次买入
|
|
5
5
|
*/
|
|
6
6
|
import { Wallet, JsonRpcProvider } from 'ethers';
|
|
7
|
-
import { ENI_CHAIN_ID, ENI_RPC_URL, DAOAAS_PORTAL, NATIVE_TRANSFER_GAS_LIMIT } from '../../constants.js';
|
|
7
|
+
import { ENI_CHAIN_ID, ENI_RPC_URL, DAOAAS_PORTAL, NATIVE_TRANSFER_GAS_LIMIT, } from '../../constants.js';
|
|
8
8
|
import { encodeCreateCall } from './portal.js';
|
|
9
9
|
import { buildProfitTransfer } from './portal-direct.js';
|
|
10
10
|
import { calculateProfitAmount, getProfitRateBps, getProfitRecipient } from '../../../../shared/constants/profit.js';
|
|
@@ -15,7 +15,7 @@ const NORMAL_PROFIT_BPS = getProfitRateBps('normal');
|
|
|
15
15
|
*/
|
|
16
16
|
export function generateSalt(_deployer, _name, _symbol) {
|
|
17
17
|
const timestamp = BigInt(Date.now());
|
|
18
|
-
const random = BigInt(Math.floor(Math.random() *
|
|
18
|
+
const random = BigInt(Math.floor(Math.random() * 1000000));
|
|
19
19
|
return timestamp * 1000000n + random;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -8,6 +8,6 @@ export type { DaoaasTokenState, DaoaasBuyParams, DaoaasSellParams, DaoaasCreateP
|
|
|
8
8
|
export { DaoaasTokenStatus } from './types.js';
|
|
9
9
|
export { DaoaasPortalQuery, createPortalQuery, encodeBuyCall, encodeSellCall, encodeCreateCall, encodeApproveCall, encodeTransferCall, applySlippage, formatEgas, parseEgas, type PortalQueryConfig, } from './portal.js';
|
|
10
10
|
export { directBuy, directSell, directBatchBuy, directBatchSell, directQuickSwap, directBuyForSubmit, directSellForSubmit, directBatchBuyForSubmit, directBatchSellForSubmit, directQuickSwapForSubmit, buildProfitTransfer, } from './portal-direct.js';
|
|
11
|
-
export { createToken, createTokenForSubmit, generateSalt } from './create.js';
|
|
12
|
-
export { getGraduationInfo, batchGetGraduationInfo, type GraduationInfo } from './graduation.js';
|
|
13
|
-
export { getTokenMeta, getFairLaunchTokenMeta, getTokenMetasBatch, type DaoaasTokenMeta } from './meta.js';
|
|
11
|
+
export { createToken, createTokenForSubmit, generateSalt, } from './create.js';
|
|
12
|
+
export { getGraduationInfo, batchGetGraduationInfo, type GraduationInfo, } from './graduation.js';
|
|
13
|
+
export { getTokenMeta, getFairLaunchTokenMeta, getTokenMetasBatch, type DaoaasTokenMeta, } from './meta.js';
|
|
@@ -16,12 +16,12 @@ export { directBuy, directSell, directBatchBuy, directBatchSell, directQuickSwap
|
|
|
16
16
|
// ============================================================================
|
|
17
17
|
// 代币创建
|
|
18
18
|
// ============================================================================
|
|
19
|
-
export { createToken, createTokenForSubmit, generateSalt } from './create.js';
|
|
19
|
+
export { createToken, createTokenForSubmit, generateSalt, } from './create.js';
|
|
20
20
|
// ============================================================================
|
|
21
21
|
// 毕业状态
|
|
22
22
|
// ============================================================================
|
|
23
|
-
export { getGraduationInfo, batchGetGraduationInfo } from './graduation.js';
|
|
23
|
+
export { getGraduationInfo, batchGetGraduationInfo, } from './graduation.js';
|
|
24
24
|
// ============================================================================
|
|
25
25
|
// 代币元数据
|
|
26
26
|
// ============================================================================
|
|
27
|
-
export { getTokenMeta, getFairLaunchTokenMeta, getTokenMetasBatch } from './meta.js';
|
|
27
|
+
export { getTokenMeta, getFairLaunchTokenMeta, getTokenMetasBatch, } from './meta.js';
|