four-flap-meme-sdk 2.2.18 → 2.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/subpath-exports.test.d.ts +1 -0
- package/dist/__tests__/subpath-exports.test.js +64 -0
- package/dist/abis/common.d.ts +85 -0
- package/dist/abis/common.js +240 -0
- package/dist/abis/contracts/TaxToken.json +969 -0
- package/dist/abis/contracts/TokenManager.json +836 -0
- package/dist/abis/contracts/TokenManager2.json +136 -0
- package/dist/abis/contracts/TokenManagerHelper3.json +993 -0
- package/dist/abis/contracts/index.d.ts +5 -0
- package/dist/abis/contracts/index.js +5 -0
- package/dist/abis/flap/index.d.ts +5 -0
- package/dist/abis/flap/index.js +5 -0
- package/dist/abis/flap/portal-eip7702.d.ts +4 -0
- package/dist/abis/flap/portal-eip7702.js +39 -0
- package/dist/abis/flap/portal-events.d.ts +6 -0
- package/dist/abis/flap/portal-events.js +17 -0
- package/dist/abis/flap/portal-merkle.d.ts +4 -0
- package/dist/abis/flap/portal-merkle.js +25 -0
- package/dist/abis/flap/portal.d.ts +6 -0
- package/dist/abis/flap/portal.js +37 -0
- package/dist/abis/flap/vault.d.ts +171 -0
- package/dist/abis/flap/vault.js +91 -0
- package/dist/abis/index.d.ts +8 -0
- package/dist/abis/index.js +11 -0
- package/dist/bundle-core/__tests__/config-helpers.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/config-helpers.test.js +28 -0
- package/dist/bundle-core/__tests__/facade-parity.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/facade-parity.test.js +33 -0
- package/dist/bundle-core/__tests__/sign-context-helpers.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/sign-context-helpers.test.js +60 -0
- package/dist/bundle-core/__tests__/sign-fixture.test.d.ts +1 -0
- package/dist/bundle-core/__tests__/sign-fixture.test.js +220 -0
- package/dist/bundle-core/__tests__/sign-fixtures.d.ts +10 -0
- package/dist/bundle-core/__tests__/sign-fixtures.js +16 -0
- package/dist/bundle-core/config-helpers.d.ts +37 -0
- package/dist/bundle-core/config-helpers.js +58 -0
- package/dist/bundle-core/errors.d.ts +50 -0
- package/dist/bundle-core/errors.js +38 -0
- package/dist/bundle-core/four-meme/approve-tokenmanager.d.ts +7 -0
- package/dist/bundle-core/four-meme/approve-tokenmanager.js +99 -0
- package/dist/bundle-core/four-meme/core-helpers.d.ts +8 -0
- package/dist/bundle-core/four-meme/core-helpers.js +41 -0
- package/dist/bundle-core/four-meme/core.d.ts +4 -0
- package/dist/bundle-core/four-meme/core.js +515 -0
- package/dist/bundle-core/four-meme/pancake-proxy.d.ts +28 -0
- package/dist/bundle-core/four-meme/pancake-proxy.js +679 -0
- package/dist/bundle-core/four-meme/private.d.ts +27 -0
- package/dist/bundle-core/four-meme/private.js +465 -0
- package/dist/bundle-core/four-meme/sign-context-helpers.d.ts +2 -0
- package/dist/bundle-core/four-meme/sign-context-helpers.js +2 -0
- package/dist/bundle-core/four-meme/swap-buy-first.d.ts +8 -0
- package/dist/bundle-core/four-meme/swap-buy-first.js +456 -0
- package/dist/bundle-core/four-meme/swap-hop-helpers.d.ts +6 -0
- package/dist/bundle-core/four-meme/swap-hop-helpers.js +63 -0
- package/dist/bundle-core/four-meme/swap-internal.d.ts +3 -0
- package/dist/bundle-core/four-meme/swap-internal.js +18 -0
- package/dist/bundle-core/four-meme/swap-sign-helpers.d.ts +28 -0
- package/dist/bundle-core/four-meme/swap-sign-helpers.js +105 -0
- package/dist/bundle-core/four-meme/swap.d.ts +17 -0
- package/dist/bundle-core/four-meme/swap.js +505 -0
- package/dist/bundle-core/four-meme/types/buy-first.d.ts +50 -0
- package/dist/bundle-core/four-meme/types/buy-first.js +1 -0
- package/dist/bundle-core/four-meme/types/core-flow.d.ts +63 -0
- package/dist/bundle-core/four-meme/types/core-flow.js +1 -0
- package/dist/bundle-core/four-meme/types/index.d.ts +600 -0
- package/dist/bundle-core/four-meme/types/index.js +1 -0
- package/dist/bundle-core/four-meme/types/swap-internal.d.ts +19 -0
- package/dist/bundle-core/four-meme/types/swap-internal.js +1 -0
- package/dist/bundle-core/four-meme/types.d.ts +1 -0
- package/dist/bundle-core/four-meme/types.js +1 -0
- package/dist/bundle-core/four-meme/utils-disperse.d.ts +7 -0
- package/dist/bundle-core/four-meme/utils-disperse.js +396 -0
- package/dist/bundle-core/four-meme/utils-pairwise.d.ts +8 -0
- package/dist/bundle-core/four-meme/utils-pairwise.js +328 -0
- package/dist/bundle-core/four-meme/utils-sweep.d.ts +8 -0
- package/dist/bundle-core/four-meme/utils-sweep.js +744 -0
- package/dist/bundle-core/index.d.ts +8 -0
- package/dist/bundle-core/index.js +8 -0
- package/dist/bundle-core/internal.d.ts +16 -0
- package/dist/bundle-core/internal.js +160 -0
- package/dist/bundle-core/sign-context-helpers.d.ts +26 -0
- package/dist/bundle-core/sign-context-helpers.js +63 -0
- package/dist/bundle-core/submit.d.ts +293 -0
- package/dist/bundle-core/submit.js +731 -0
- package/dist/bundle-core/types/index.d.ts +8 -0
- package/dist/bundle-core/types/index.js +1 -0
- package/dist/bundle-core/types.d.ts +1 -0
- package/dist/bundle-core/types.js +1 -0
- package/dist/chains/bsc/four/approve-tokenmanager.d.ts +1 -26
- package/dist/chains/bsc/four/approve-tokenmanager.js +1 -113
- package/dist/chains/bsc/four/config.d.ts +5 -67
- package/dist/chains/bsc/four/config.js +2 -114
- package/dist/chains/bsc/four/core.d.ts +1 -4
- package/dist/chains/bsc/four/core.js +1 -592
- package/dist/chains/bsc/four/index.d.ts +6 -6
- package/dist/chains/bsc/four/index.js +6 -6
- package/dist/chains/bsc/four/internal.d.ts +2 -46
- package/dist/chains/bsc/four/internal.js +2 -239
- package/dist/chains/bsc/four/pancake-proxy.d.ts +1 -28
- package/dist/chains/bsc/four/pancake-proxy.js +1 -687
- package/dist/chains/bsc/four/private.d.ts +1 -27
- package/dist/chains/bsc/four/private.js +1 -477
- package/dist/chains/bsc/four/submit.d.ts +2 -315
- package/dist/chains/bsc/four/submit.js +2 -752
- package/dist/chains/bsc/four/swap-buy-first.d.ts +2 -55
- package/dist/chains/bsc/four/swap-buy-first.js +2 -507
- package/dist/chains/bsc/four/swap-internal.d.ts +1 -3
- package/dist/chains/bsc/four/swap-internal.js +1 -18
- package/dist/chains/bsc/four/swap.d.ts +2 -144
- package/dist/chains/bsc/four/swap.js +2 -766
- package/dist/chains/bsc/four/types.d.ts +1 -476
- package/dist/chains/bsc/four/utils-disperse.d.ts +1 -0
- package/dist/chains/bsc/four/utils-disperse.js +1 -0
- package/dist/chains/bsc/four/utils-pairwise.d.ts +1 -0
- package/dist/chains/bsc/four/utils-pairwise.js +1 -0
- package/dist/chains/bsc/four/utils-sweep.d.ts +1 -0
- package/dist/chains/bsc/four/utils-sweep.js +1 -0
- package/dist/chains/bsc/four/utils.d.ts +5 -18
- package/dist/chains/bsc/four/utils.js +5 -1552
- package/dist/chains/bsc/iro.d.ts +5 -0
- package/dist/chains/bsc/iro.js +4 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +155 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +80 -0
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +1 -91
- package/dist/chains/bsc/pancake/bundle-buy-first.js +98 -213
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +241 -0
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +565 -0
- package/dist/chains/bsc/pancake/bundle-swap.d.ts +1 -79
- package/dist/chains/bsc/pancake/bundle-swap.js +114 -726
- package/dist/chains/bsc/pancake/index.d.ts +4 -2
- package/dist/chains/bsc/pancake/index.js +1 -3
- package/dist/chains/bsc/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/bsc/platforms/iro/factory.js +3 -1
- package/dist/chains/bsc/platforms/iro/index.d.ts +5 -5
- package/dist/chains/bsc/platforms/iro/index.js +3 -3
- package/dist/chains/bsc/platforms/iro/pool.js +31 -10
- package/dist/chains/bsc/platforms/iro/token.js +4 -1
- package/dist/chains/eni/batch-router/bundle-approve.js +4 -3
- package/dist/chains/eni/batch-router/transfer.js +55 -25
- package/dist/chains/eni/batch-router/utils.js +32 -6
- package/dist/chains/eni/bundler/sign.js +5 -6
- package/dist/chains/eni/bundler/submit.js +1 -4
- package/dist/chains/eni/constants.js +1 -1
- package/dist/chains/eni/flat-aliases.d.ts +10 -0
- package/dist/chains/eni/flat-aliases.js +8 -0
- package/dist/chains/eni/index.d.ts +2 -1
- package/dist/chains/eni/index.js +1 -0
- package/dist/chains/eni/platforms/daoaas/create.js +2 -2
- package/dist/chains/eni/platforms/daoaas/index.d.ts +3 -3
- package/dist/chains/eni/platforms/daoaas/index.js +3 -3
- package/dist/chains/eni/platforms/daoaas/meta.js +9 -6
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +28 -44
- package/dist/chains/eni/platforms/daoaas/portal.js +10 -6
- package/dist/chains/eni/platforms/dswap/liquidity.js +58 -26
- package/dist/chains/eni/platforms/fair-launch/index.d.ts +2 -2
- package/dist/chains/eni/platforms/fair-launch/index.js +1 -1
- package/dist/chains/eni/platforms/fair-launch/launcher.js +87 -46
- package/dist/chains/eni/platforms/fair-launch/pool.js +4 -1
- package/dist/chains/eni/platforms/fair-launch/presets.js +2 -2
- package/dist/chains/eni/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/eni/platforms/iro/factory.js +3 -1
- package/dist/chains/eni/platforms/iro/index.d.ts +6 -6
- package/dist/chains/eni/platforms/iro/index.js +4 -4
- package/dist/chains/eni/platforms/iro/pool.js +90 -26
- package/dist/chains/eni/platforms/iro/token.js +107 -31
- package/dist/chains/eni/platforms/iro/whitelist.js +6 -18
- package/dist/chains/eni/submit.d.ts +43 -0
- package/dist/chains/eni/submit.js +287 -0
- package/dist/chains/index.d.ts +13 -0
- package/dist/chains/index.js +13 -0
- package/dist/chains/xlayer/constants.d.ts +5 -0
- package/dist/chains/xlayer/eip7702/bundle-approve.d.ts +2 -26
- package/dist/chains/xlayer/eip7702/bundle-approve.js +11 -21
- package/dist/chains/xlayer/eip7702/bundle-buy.d.ts +2 -6
- package/dist/chains/xlayer/eip7702/bundle-buy.js +13 -51
- package/dist/chains/xlayer/eip7702/bundle-create.js +104 -74
- package/dist/chains/xlayer/eip7702/bundle-sell.d.ts +2 -6
- package/dist/chains/xlayer/eip7702/bundle-sell.js +29 -111
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +3 -65
- package/dist/chains/xlayer/eip7702/bundle-swap.js +51 -245
- package/dist/chains/xlayer/eip7702/constants.d.ts +11 -26
- package/dist/chains/xlayer/eip7702/constants.js +15 -68
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +13 -0
- package/dist/chains/xlayer/eip7702/flat-aliases.js +10 -0
- package/dist/chains/xlayer/eip7702/index.d.ts +28 -46
- package/dist/chains/xlayer/eip7702/index.js +28 -81
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.d.ts +79 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.js +1 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.d.ts +2 -203
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.js +63 -307
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +26 -0
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +58 -0
- package/dist/chains/xlayer/eip7702/types.d.ts +88 -0
- package/dist/chains/xlayer/eip7702/utils.d.ts +0 -3
- package/dist/chains/xlayer/eip7702/utils.js +23 -28
- package/dist/chains/xlayer/eip7702/volume-helpers.d.ts +148 -0
- package/dist/chains/xlayer/eip7702/volume-helpers.js +48 -0
- package/dist/chains/xlayer/eip7702/volume.d.ts +6 -184
- package/dist/chains/xlayer/eip7702/volume.js +89 -164
- package/dist/chains/xlayer/eoa/constants.d.ts +1 -1
- package/dist/chains/xlayer/eoa/constants.js +2 -16
- package/dist/chains/xlayer/eoa/dex-helpers.d.ts +1 -1
- package/dist/chains/xlayer/eoa/dex-helpers.js +7 -37
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +126 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +228 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.d.ts +1 -95
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.js +66 -299
- package/dist/chains/xlayer/eoa/eoa-wash-volume.d.ts +1 -1
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +18 -23
- package/dist/chains/xlayer/eoa/index.d.ts +10 -6
- package/dist/chains/xlayer/eoa/index.js +8 -23
- package/dist/chains/xlayer/eoa/portal-ops.js +7 -2
- package/dist/chains/xlayer/eoa/router-manager.js +5 -4
- package/dist/chains/xlayer/eoa/types.d.ts +2 -2
- package/dist/chains/xlayer/eoa/types.js +1 -3
- package/dist/chains/xlayer/index.d.ts +3 -2
- package/dist/chains/xlayer/index.js +4 -7
- package/dist/contracts/helper3.d.ts +20 -5
- package/dist/contracts/helper3.js +56 -20
- package/dist/contracts/tm-bundle-helpers.d.ts +88 -0
- package/dist/contracts/tm-bundle-helpers.js +73 -0
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.d.ts +1 -26
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.js +1 -113
- package/dist/contracts/tm-bundle-merkle/config.d.ts +5 -67
- package/dist/contracts/tm-bundle-merkle/config.js +2 -114
- package/dist/contracts/tm-bundle-merkle/core.d.ts +1 -4
- package/dist/contracts/tm-bundle-merkle/core.js +1 -591
- package/dist/contracts/tm-bundle-merkle/index.d.ts +5 -5
- package/dist/contracts/tm-bundle-merkle/index.js +5 -5
- package/dist/contracts/tm-bundle-merkle/internal.d.ts +2 -46
- package/dist/contracts/tm-bundle-merkle/internal.js +2 -238
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.d.ts +1 -28
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.js +1 -686
- package/dist/contracts/tm-bundle-merkle/private.d.ts +1 -27
- package/dist/contracts/tm-bundle-merkle/private.js +1 -476
- package/dist/contracts/tm-bundle-merkle/submit.d.ts +3 -314
- package/dist/contracts/tm-bundle-merkle/submit.js +3 -928
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.d.ts +2 -55
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.js +2 -506
- package/dist/contracts/tm-bundle-merkle/swap-internal.d.ts +1 -3
- package/dist/contracts/tm-bundle-merkle/swap-internal.js +1 -18
- package/dist/contracts/tm-bundle-merkle/swap.d.ts +2 -144
- package/dist/contracts/tm-bundle-merkle/swap.js +2 -764
- package/dist/contracts/tm-bundle-merkle/types.d.ts +1 -476
- package/dist/contracts/tm-bundle-merkle/utils-disperse.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-disperse.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-sweep.d.ts +1 -0
- package/dist/contracts/tm-bundle-merkle/utils-sweep.js +1 -0
- package/dist/contracts/tm-bundle-merkle/utils.d.ts +6 -18
- package/dist/contracts/tm-bundle-merkle/utils.js +6 -1501
- package/dist/contracts/tm-bundle.d.ts +3 -51
- package/dist/contracts/tm-bundle.js +120 -187
- package/dist/contracts/tm.d.ts +10 -8
- package/dist/contracts/tm.js +39 -35
- package/dist/contracts/tm1.js +9 -4
- package/dist/contracts/tm2.js +10 -5
- package/dist/dex/direct-router-helpers.d.ts +269 -0
- package/dist/dex/direct-router-helpers.js +536 -0
- package/dist/dex/direct-router.d.ts +3 -125
- package/dist/dex/direct-router.js +244 -672
- package/dist/dex/types.d.ts +81 -0
- package/dist/dex/types.js +1 -0
- package/dist/exports/root-bundle-and-tooling.d.ts +27 -0
- package/dist/exports/root-bundle-and-tooling.js +30 -0
- package/dist/exports/root-eni-and-bsc-iro.d.ts +26 -0
- package/dist/exports/root-eni-and-bsc-iro.js +66 -0
- package/dist/exports/root-foundations.d.ts +35 -0
- package/dist/exports/root-foundations.js +70 -0
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +30 -0
- package/dist/exports/root-swap-dex-and-xlayer.js +78 -0
- package/dist/flap/index.d.ts +11 -0
- package/dist/flap/index.js +9 -0
- package/dist/flows/create.d.ts +2 -1
- package/dist/flows/create.js +6 -6
- package/dist/flows/index.d.ts +9 -0
- package/dist/flows/index.js +9 -0
- package/dist/index.d.ts +20 -88
- package/dist/index.js +20 -218
- package/dist/merkle/index.d.ts +12 -0
- package/dist/merkle/index.js +11 -0
- package/dist/shared/abis/common.d.ts +2 -83
- package/dist/shared/abis/common.js +2 -254
- package/dist/shared/abis/index.d.ts +5 -6
- package/dist/shared/abis/index.js +5 -7
- package/dist/shared/clients/blockrazor.d.ts +4 -8
- package/dist/shared/clients/blockrazor.js +43 -35
- package/dist/shared/clients/club48.d.ts +2 -2
- package/dist/shared/clients/club48.js +36 -30
- package/dist/shared/clients/emitservice.js +2 -0
- package/dist/shared/clients/four.d.ts +21 -6
- package/dist/shared/clients/four.js +29 -24
- package/dist/shared/clients/index.d.ts +8 -0
- package/dist/shared/clients/index.js +8 -0
- package/dist/shared/clients/merkle.d.ts +4 -3
- package/dist/shared/clients/merkle.js +30 -47
- package/dist/shared/constants/addresses.d.ts +27 -1
- package/dist/shared/constants/addresses.js +39 -2
- package/dist/shared/constants/chains.d.ts +1 -1
- package/dist/shared/constants/chains.js +1 -1
- package/dist/shared/constants/gas.d.ts +1 -1
- package/dist/shared/constants/gas.js +2 -6
- package/dist/shared/constants/index.d.ts +4 -1
- package/dist/shared/constants/index.js +2 -1
- package/dist/shared/constants/quote.d.ts +30 -0
- package/dist/shared/constants/quote.js +37 -0
- package/dist/shared/flap/abi.js +1 -1
- package/dist/shared/flap/constants.d.ts +1 -2
- package/dist/shared/flap/constants.js +3 -4
- package/dist/shared/flap/curve.js +3 -0
- package/dist/shared/flap/errors.d.ts +1 -4
- package/dist/shared/flap/errors.js +20 -1
- package/dist/shared/flap/index.d.ts +4 -5
- package/dist/shared/flap/index.js +4 -5
- package/dist/shared/flap/launch-v6.d.ts +0 -5
- package/dist/shared/flap/launch-v6.js +2 -16
- package/dist/shared/flap/meta.d.ts +22 -18
- package/dist/shared/flap/meta.js +32 -24
- package/dist/shared/flap/permit.js +10 -3
- package/dist/shared/flap/pinata.d.ts +22 -6
- package/dist/shared/flap/pinata.js +21 -26
- package/dist/shared/flap/portal-bundle-merkle/config.d.ts +3 -72
- package/dist/shared/flap/portal-bundle-merkle/config.js +4 -124
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.d.ts +32 -0
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.js +83 -0
- package/dist/shared/flap/portal-bundle-merkle/core.d.ts +0 -4
- package/dist/shared/flap/portal-bundle-merkle/core.js +168 -175
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.d.ts +17 -4
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.js +96 -117
- package/dist/shared/flap/portal-bundle-merkle/curve-to-dex.js +104 -122
- package/dist/shared/flap/portal-bundle-merkle/index.d.ts +11 -7
- package/dist/shared/flap/portal-bundle-merkle/index.js +4 -7
- package/dist/shared/flap/portal-bundle-merkle/pancake-proxy.js +71 -68
- package/dist/shared/flap/portal-bundle-merkle/private.js +61 -114
- package/dist/shared/flap/portal-bundle-merkle/swap-batch.d.ts +8 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-batch.js +227 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +125 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.js +113 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.d.ts +1 -64
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.js +69 -288
- package/dist/shared/flap/portal-bundle-merkle/swap-cross.d.ts +9 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-cross.js +139 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.d.ts +149 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.js +259 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-planning.d.ts +70 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-planning.js +182 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-quick-batch.d.ts +16 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-quick-batch.js +327 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-single.d.ts +2 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-single.js +184 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-types.d.ts +101 -0
- package/dist/shared/flap/portal-bundle-merkle/swap-types.js +1 -0
- package/dist/shared/flap/portal-bundle-merkle/swap.d.ts +6 -199
- package/dist/shared/flap/portal-bundle-merkle/swap.js +5 -1357
- package/dist/shared/flap/portal-bundle-merkle/types.d.ts +88 -12
- package/dist/shared/flap/portal-bundle-merkle/utils.d.ts +1 -80
- package/dist/shared/flap/portal-bundle-merkle/utils.js +145 -265
- package/dist/shared/flap/portal-bundle.js +83 -78
- package/dist/shared/flap/portal-create-token.d.ts +39 -21
- package/dist/shared/flap/portal-create-token.js +121 -124
- package/dist/shared/flap/portal.d.ts +1 -2
- package/dist/shared/flap/portal.js +36 -28
- package/dist/shared/flap/vanity.d.ts +6 -6
- package/dist/shared/flap/vanity.js +15 -21
- package/dist/shared/flap/vault.d.ts +25 -93
- package/dist/shared/flap/vault.js +77 -127
- package/dist/shared/foundation/amount/split-by-weight.d.ts +5 -0
- package/dist/shared/foundation/amount/split-by-weight.js +35 -0
- package/dist/shared/foundation/dex/v3-path.d.ts +6 -0
- package/dist/shared/foundation/dex/v3-path.js +35 -0
- package/dist/shared/foundation/erc20/decimals.d.ts +7 -0
- package/dist/shared/foundation/erc20/decimals.js +24 -0
- package/dist/shared/foundation/gas/bundle-gas.d.ts +49 -0
- package/dist/shared/foundation/gas/bundle-gas.js +93 -0
- package/dist/shared/foundation/gas/profit-hop.d.ts +20 -0
- package/dist/shared/foundation/gas/profit-hop.js +72 -0
- package/dist/shared/foundation/index.d.ts +15 -0
- package/dist/shared/foundation/index.js +14 -0
- package/dist/shared/foundation/nonce/nonce-manager.d.ts +19 -0
- package/dist/shared/foundation/nonce/nonce-manager.js +217 -0
- package/dist/shared/foundation/normalize-unknown.d.ts +9 -0
- package/dist/shared/foundation/normalize-unknown.js +29 -0
- package/dist/shared/foundation/sdk-logger.d.ts +13 -0
- package/dist/shared/foundation/sdk-logger.js +12 -0
- package/dist/shared/foundation/tx/build-request.d.ts +17 -0
- package/dist/shared/foundation/tx/build-request.js +25 -0
- package/dist/shared/foundation/tx/sign-batch.d.ts +5 -0
- package/dist/shared/foundation/tx/sign-batch.js +26 -0
- package/dist/shared/foundation/tx/wallet-sign-patch.d.ts +1 -0
- package/dist/shared/foundation/tx/wallet-sign-patch.js +18 -0
- package/dist/shared/foundation/types/airdrop-sweep.d.ts +79 -0
- package/dist/shared/foundation/types/airdrop-sweep.js +1 -0
- package/dist/shared/foundation/types/erc20.d.ts +65 -0
- package/dist/shared/foundation/types/erc20.js +1 -0
- package/dist/shared/foundation/types/holders-maker.d.ts +64 -0
- package/dist/shared/foundation/types/holders-maker.js +1 -0
- package/dist/shared/foundation/types/index.d.ts +7 -0
- package/dist/shared/foundation/types/index.js +1 -0
- package/dist/shared/foundation/types/lp-inspect.d.ts +102 -0
- package/dist/shared/foundation/types/lp-inspect.js +1 -0
- package/dist/shared/foundation/types/multicall.d.ts +5 -0
- package/dist/shared/foundation/types/multicall.js +1 -0
- package/dist/shared/foundation/types/private-sale.d.ts +35 -0
- package/dist/shared/foundation/types/private-sale.js +1 -0
- package/dist/shared/foundation/types/quote-helpers.d.ts +17 -0
- package/dist/shared/foundation/types/quote-helpers.js +1 -0
- package/dist/shared/foundation/wallet/generate.d.ts +5 -0
- package/dist/shared/foundation/wallet/generate.js +8 -0
- package/dist/shared/four/tax-token.d.ts +1 -1
- package/dist/shared/four/tax-token.js +31 -10
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/index.js +4 -0
- package/dist/types/errors.d.ts +27 -0
- package/dist/types/errors.js +34 -0
- package/dist/utils/airdrop-sweep.d.ts +4 -76
- package/dist/utils/airdrop-sweep.js +42 -55
- package/dist/utils/bundle-helpers.d.ts +9 -243
- package/dist/utils/bundle-helpers.js +10 -584
- package/dist/utils/constants.d.ts +5 -61
- package/dist/utils/constants.js +5 -80
- package/dist/utils/contract-factory.d.ts +2 -4
- package/dist/utils/contract-factory.js +25 -18
- package/dist/utils/erc20.d.ts +7 -89
- package/dist/utils/erc20.js +98 -129
- package/dist/utils/errors.d.ts +12 -1
- package/dist/utils/errors.js +60 -1
- package/dist/utils/holders-maker/addresses.d.ts +12 -0
- package/dist/utils/holders-maker/addresses.js +15 -0
- package/dist/utils/holders-maker/buy-tx.d.ts +44 -0
- package/dist/utils/holders-maker/buy-tx.js +278 -0
- package/dist/utils/holders-maker/constants.d.ts +6 -0
- package/dist/utils/holders-maker/constants.js +7 -0
- package/dist/utils/holders-maker/disperse.d.ts +18 -0
- package/dist/utils/holders-maker/disperse.js +90 -0
- package/dist/utils/holders-maker/routing.d.ts +4 -0
- package/dist/utils/holders-maker/routing.js +45 -0
- package/dist/utils/holders-maker/transfer-tx.d.ts +4 -0
- package/dist/utils/holders-maker/transfer-tx.js +67 -0
- package/dist/utils/holders-maker-helpers.d.ts +9 -0
- package/dist/utils/holders-maker-helpers.js +9 -0
- package/dist/utils/holders-maker.d.ts +2 -138
- package/dist/utils/holders-maker.js +50 -671
- package/dist/utils/hop-chains.d.ts +35 -0
- package/dist/utils/hop-chains.js +215 -0
- package/dist/utils/lp-inspect-helpers.d.ts +9 -0
- package/dist/utils/lp-inspect-helpers.js +109 -0
- package/dist/utils/lp-inspect.d.ts +2 -112
- package/dist/utils/lp-inspect.js +78 -293
- package/dist/utils/mpcExclusive.d.ts +2 -5
- package/dist/utils/mpcExclusive.js +4 -3
- package/dist/utils/private-sale.d.ts +2 -58
- package/dist/utils/private-sale.js +4 -15
- package/dist/utils/provider-factory.d.ts +4 -0
- package/dist/utils/provider-factory.js +10 -0
- package/dist/utils/quote-helpers.d.ts +4 -45
- package/dist/utils/quote-helpers.js +17 -74
- package/dist/utils/stealth-transfer.d.ts +2 -28
- package/dist/utils/stealth-transfer.js +39 -19
- package/dist/utils/swap-helpers.d.ts +2 -15
- package/dist/utils/swap-helpers.js +6 -11
- package/dist/utils/types/airdrop-sweep.d.ts +1 -0
- package/dist/utils/types/airdrop-sweep.js +1 -0
- package/dist/utils/types/contract-factory.d.ts +1 -0
- package/dist/utils/types/contract-factory.js +1 -0
- package/dist/utils/types/erc20.d.ts +1 -0
- package/dist/utils/types/erc20.js +1 -0
- package/dist/utils/types/errors.d.ts +1 -0
- package/dist/utils/types/errors.js +1 -0
- package/dist/utils/types/holders-maker.d.ts +1 -0
- package/dist/utils/types/holders-maker.js +1 -0
- package/dist/utils/types/hop-chains.d.ts +8 -0
- package/dist/utils/types/hop-chains.js +1 -0
- package/dist/utils/types/index.d.ts +13 -0
- package/dist/utils/types/index.js +1 -0
- package/dist/utils/types/lp-inspect.d.ts +1 -0
- package/dist/utils/types/lp-inspect.js +1 -0
- package/dist/utils/types/mpc-exclusive.d.ts +5 -0
- package/dist/utils/types/mpc-exclusive.js +1 -0
- package/dist/utils/types/private-sale.d.ts +1 -0
- package/dist/utils/types/private-sale.js +1 -0
- package/dist/utils/types/quote-helpers.d.ts +1 -0
- package/dist/utils/types/quote-helpers.js +1 -0
- package/dist/utils/types/stealth-transfer.d.ts +44 -0
- package/dist/utils/types/stealth-transfer.js +1 -0
- package/dist/utils/types/wallet.d.ts +25 -0
- package/dist/utils/types/wallet.js +1 -0
- package/dist/utils/wallet.d.ts +4 -25
- package/dist/utils/wallet.js +27 -22
- package/dist/vanity/index.d.ts +5 -0
- package/dist/vanity/index.js +5 -0
- package/package.json +100 -2
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/** 零地址 */
|
|
6
6
|
export declare const ZERO_ADDRESS: "0x0000000000000000000000000000000000000000";
|
|
7
|
+
/** 32 字节零哈希(bytes32 零值) */
|
|
8
|
+
export declare const ZERO_BYTES32: "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
7
9
|
/** BlockRazor Builder EOA 地址(用于 BSC 链贿赂) */
|
|
8
10
|
export declare const BLOCKRAZOR_BUILDER_EOA: "0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20";
|
|
9
11
|
export declare const ADDRESSES: {
|
|
@@ -46,12 +48,22 @@ export declare const ADDRESSES: {
|
|
|
46
48
|
readonly FlapTokenImpl: "0x12Dc83157Bf1cfCB8Db5952b3ba5bb56Cc38f8C9";
|
|
47
49
|
/** V2 Router (标准 Uniswap V2 风格) */
|
|
48
50
|
readonly PotatoSwapV2Router: "0x881fb2f98c13d521009464e7d1cbf16e1b394e8e";
|
|
51
|
+
/** V2 Factory */
|
|
52
|
+
readonly PotatoSwapV2Factory: "0x630DB8E822805c82Ca40a54daE02dd5aC31f7fcF";
|
|
49
53
|
/** SwapRouter02 (V3 风格) */
|
|
50
54
|
readonly PotatoSwapSwapRouter02: "0xB45D0149249488333E3F3f9F359807F4b810C1FC";
|
|
51
55
|
/** V3 Router */
|
|
52
56
|
readonly PotatoSwapV3Router: "0xBB069e9465BcabC4F488d21e793BDEf0F2d41D41";
|
|
53
57
|
/** V3 Factory */
|
|
54
58
|
readonly PotatoSwapV3Factory: "0xa1415fAe79c4B196d087F02b8aD5a622B8A827E5";
|
|
59
|
+
/** QuoterV2 */
|
|
60
|
+
readonly PotatoSwapQuoterV2: "0x5A6f3723346aF54a4D0693bfC1718D64d4915C3e";
|
|
61
|
+
/** DYORSwap V2 Factory */
|
|
62
|
+
readonly DyorSwapV2Factory: "0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09";
|
|
63
|
+
/** DYORSwap Router */
|
|
64
|
+
readonly DyorSwapRouter: "0xfb001fbbace32f09cb6d3c449b935183de53ee96";
|
|
65
|
+
/** DYORSwap ETHBack Dividend 合约(refundETH 固定地址) */
|
|
66
|
+
readonly DyorSwapEthBackDividend: "0x2e61b0b4410f6fb941d47205191cbb8963d44bcc";
|
|
55
67
|
/** EntryPoint v0.6 合约地址 */
|
|
56
68
|
readonly EntryPointV06: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
|
|
57
69
|
/** SimpleAccountFactory 合约地址 */
|
|
@@ -66,6 +78,16 @@ export declare const ADDRESSES: {
|
|
|
66
78
|
readonly TaxTokenImplementation: "0x1C8847736521f5cD725dFB8f33c7c610826e7C42";
|
|
67
79
|
readonly TaxTokenSplitterImplementation: "0x57Fed6832F12150a77D5952b49190d9447aCB5ee";
|
|
68
80
|
readonly PancakeProxy: "0x20B89e7e088db3e06e0893Ce23162E475b9d8c7c";
|
|
81
|
+
readonly USDC: "0x754704bc059f8c67012fed69bc8a327a5aafb603";
|
|
82
|
+
readonly PancakeV2Factory: "0x44c90b66eb4c4f814cea6aaf2ac71ca88fa77308";
|
|
83
|
+
readonly PancakeV3Factory: "0x40ce898c43df68c8c4229cd5ce21d3ce1f3ddcf1";
|
|
84
|
+
readonly UniswapV2Factory: "0x182a927119d56008d921126764bf884221b10f59";
|
|
85
|
+
readonly UniswapV3Factory: "0x204faca1764b154221e35c0d20abb3c525710498";
|
|
86
|
+
readonly UniswapV2Router: "0x4b2ab38dbf28d31d467aa8993f6c2585981d6804";
|
|
87
|
+
readonly UniswapV3Router: "0xd6145b2d3f379919e8cdeda7b97e37c4b2ca9c40";
|
|
88
|
+
readonly UniswapV3Quoter: "0x661e93cca42afacb172121ef892830ca3b70f08d";
|
|
89
|
+
readonly PancakeV2Router: "0xb1bc24c34e88f7d43d5923034e3a14b24daacff9";
|
|
90
|
+
readonly PancakeV3Router: "0x1b81d678ffb9c0263b24a97847620c99d213eb14";
|
|
69
91
|
readonly Multicall3: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
70
92
|
};
|
|
71
93
|
readonly BASE: {
|
|
@@ -78,6 +100,10 @@ export declare const ADDRESSES: {
|
|
|
78
100
|
readonly UniswapV3Factory: "0x33128a8fC17869897dcE68Ed026d694621f6FDfD";
|
|
79
101
|
/** Uniswap V3 QuoterV2 */
|
|
80
102
|
readonly UniswapV3Quoter: "0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a";
|
|
103
|
+
/** PancakeSwap V2 Router */
|
|
104
|
+
readonly PancakeV2Router: "0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb";
|
|
105
|
+
/** PancakeSwap V3 Router */
|
|
106
|
+
readonly PancakeV3Router: "0x678Aa4bF4E210cf2166753e054d5b7c31cc7fa86";
|
|
81
107
|
readonly Multicall3: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
82
108
|
};
|
|
83
109
|
readonly ARBITRUM_ONE: {
|
|
@@ -127,7 +153,7 @@ export declare const ENI_SPENDERS: {
|
|
|
127
153
|
*/
|
|
128
154
|
export declare function getEniSpenders(mode?: boolean | 'all'): string[];
|
|
129
155
|
export type ChainAddresses = keyof typeof ADDRESSES;
|
|
130
|
-
export type AddressKey<C extends ChainAddresses> = keyof typeof ADDRESSES[C];
|
|
156
|
+
export type AddressKey<C extends ChainAddresses> = keyof (typeof ADDRESSES)[C];
|
|
131
157
|
/**
|
|
132
158
|
* 获取指定链的合约地址
|
|
133
159
|
*/
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
// ============================================================================
|
|
8
8
|
/** 零地址 */
|
|
9
9
|
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
|
10
|
+
/** 32 字节零哈希(bytes32 零值) */
|
|
11
|
+
export const ZERO_BYTES32 = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
|
10
12
|
/** BlockRazor Builder EOA 地址(用于 BSC 链贿赂) */
|
|
11
13
|
export const BLOCKRAZOR_BUILDER_EOA = '0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20';
|
|
12
14
|
// ============================================================================
|
|
@@ -71,12 +73,22 @@ export const ADDRESSES = {
|
|
|
71
73
|
// ---------- PotatoSwap DEX 合约 ----------
|
|
72
74
|
/** V2 Router (标准 Uniswap V2 风格) */
|
|
73
75
|
PotatoSwapV2Router: '0x881fb2f98c13d521009464e7d1cbf16e1b394e8e',
|
|
76
|
+
/** V2 Factory */
|
|
77
|
+
PotatoSwapV2Factory: '0x630DB8E822805c82Ca40a54daE02dd5aC31f7fcF',
|
|
74
78
|
/** SwapRouter02 (V3 风格) */
|
|
75
79
|
PotatoSwapSwapRouter02: '0xB45D0149249488333E3F3f9F359807F4b810C1FC',
|
|
76
80
|
/** V3 Router */
|
|
77
81
|
PotatoSwapV3Router: '0xBB069e9465BcabC4F488d21e793BDEf0F2d41D41',
|
|
78
82
|
/** V3 Factory */
|
|
79
83
|
PotatoSwapV3Factory: '0xa1415fAe79c4B196d087F02b8aD5a622B8A827E5',
|
|
84
|
+
/** QuoterV2 */
|
|
85
|
+
PotatoSwapQuoterV2: '0x5A6f3723346aF54a4D0693bfC1718D64d4915C3e',
|
|
86
|
+
/** DYORSwap V2 Factory */
|
|
87
|
+
DyorSwapV2Factory: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09',
|
|
88
|
+
/** DYORSwap Router */
|
|
89
|
+
DyorSwapRouter: '0xfb001fbbace32f09cb6d3c449b935183de53ee96',
|
|
90
|
+
/** DYORSwap ETHBack Dividend 合约(refundETH 固定地址) */
|
|
91
|
+
DyorSwapEthBackDividend: '0x2e61b0b4410f6fb941d47205191cbb8963d44bcc',
|
|
80
92
|
// ---------- ERC-4337 合约 ----------
|
|
81
93
|
/** EntryPoint v0.6 合约地址 */
|
|
82
94
|
EntryPointV06: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789',
|
|
@@ -99,6 +111,18 @@ export const ADDRESSES = {
|
|
|
99
111
|
TaxTokenSplitterImplementation: '0x57Fed6832F12150a77D5952b49190d9447aCB5ee',
|
|
100
112
|
// ---------- PancakeSwap Proxy ----------
|
|
101
113
|
PancakeProxy: '0x20B89e7e088db3e06e0893Ce23162E475b9d8c7c',
|
|
114
|
+
// ---------- 稳定币 ----------
|
|
115
|
+
USDC: '0x754704bc059f8c67012fed69bc8a327a5aafb603',
|
|
116
|
+
// ---------- DEX ----------
|
|
117
|
+
PancakeV2Factory: '0x44c90b66eb4c4f814cea6aaf2ac71ca88fa77308',
|
|
118
|
+
PancakeV3Factory: '0x40ce898c43df68c8c4229cd5ce21d3ce1f3ddcf1',
|
|
119
|
+
UniswapV2Factory: '0x182a927119d56008d921126764bf884221b10f59',
|
|
120
|
+
UniswapV3Factory: '0x204faca1764b154221e35c0d20abb3c525710498',
|
|
121
|
+
UniswapV2Router: '0x4b2ab38dbf28d31d467aa8993f6c2585981d6804',
|
|
122
|
+
UniswapV3Router: '0xd6145b2d3f379919e8cdeda7b97e37c4b2ca9c40',
|
|
123
|
+
UniswapV3Quoter: '0x661e93cca42afacb172121ef892830ca3b70f08d',
|
|
124
|
+
PancakeV2Router: '0xb1bc24c34e88f7d43d5923034e3a14b24daacff9',
|
|
125
|
+
PancakeV3Router: '0x1b81d678ffb9c0263b24a97847620c99d213eb14',
|
|
102
126
|
// ---------- 通用合约 ----------
|
|
103
127
|
Multicall3: '0xca11bde05977b3631167028862be2a173976ca11',
|
|
104
128
|
},
|
|
@@ -118,6 +142,10 @@ export const ADDRESSES = {
|
|
|
118
142
|
UniswapV3Factory: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD',
|
|
119
143
|
/** Uniswap V3 QuoterV2 */
|
|
120
144
|
UniswapV3Quoter: '0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a',
|
|
145
|
+
/** PancakeSwap V2 Router */
|
|
146
|
+
PancakeV2Router: '0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb',
|
|
147
|
+
/** PancakeSwap V3 Router */
|
|
148
|
+
PancakeV3Router: '0x678Aa4bF4E210cf2166753e054d5b7c31cc7fa86',
|
|
121
149
|
// ---------- 通用合约 ----------
|
|
122
150
|
Multicall3: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
123
151
|
},
|
|
@@ -192,12 +220,21 @@ export const ENI_SPENDERS = {
|
|
|
192
220
|
*/
|
|
193
221
|
export function getEniSpenders(mode = false) {
|
|
194
222
|
if (mode === 'all' && ENI_SPENDERS.BATCH_ROUTER) {
|
|
195
|
-
return [
|
|
223
|
+
return [
|
|
224
|
+
ENI_SPENDERS.DIRECT.DAOAAS_PORTAL,
|
|
225
|
+
ENI_SPENDERS.DIRECT.DSWAP_V2_ROUTER,
|
|
226
|
+
ENI_SPENDERS.DIRECT.IROSWAP_V2_ROUTER,
|
|
227
|
+
ENI_SPENDERS.BATCH_ROUTER,
|
|
228
|
+
];
|
|
196
229
|
}
|
|
197
230
|
if (mode === true && ENI_SPENDERS.BATCH_ROUTER) {
|
|
198
231
|
return [ENI_SPENDERS.BATCH_ROUTER];
|
|
199
232
|
}
|
|
200
|
-
return [
|
|
233
|
+
return [
|
|
234
|
+
ENI_SPENDERS.DIRECT.DAOAAS_PORTAL,
|
|
235
|
+
ENI_SPENDERS.DIRECT.DSWAP_V2_ROUTER,
|
|
236
|
+
ENI_SPENDERS.DIRECT.IROSWAP_V2_ROUTER,
|
|
237
|
+
];
|
|
201
238
|
}
|
|
202
239
|
// ============================================================================
|
|
203
240
|
// 工具函数
|
|
@@ -107,7 +107,7 @@ export declare const CHAINS: {
|
|
|
107
107
|
};
|
|
108
108
|
export declare const CHAIN_ID_MAP: Record<string, number>;
|
|
109
109
|
export type ChainKey = keyof typeof CHAINS;
|
|
110
|
-
export type ChainConfig = typeof CHAINS[ChainKey];
|
|
110
|
+
export type ChainConfig = (typeof CHAINS)[ChainKey];
|
|
111
111
|
/**
|
|
112
112
|
* 根据 chainId 获取链配置
|
|
113
113
|
*/
|
|
@@ -132,7 +132,7 @@ export const CHAIN_ID_MAP = {
|
|
|
132
132
|
* 根据 chainId 获取链配置
|
|
133
133
|
*/
|
|
134
134
|
export function getChainById(chainId) {
|
|
135
|
-
return Object.values(CHAINS).find(c => c.chainId === chainId);
|
|
135
|
+
return Object.values(CHAINS).find((c) => c.chainId === chainId);
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* 根据 chainId 获取链名称
|
|
@@ -63,7 +63,7 @@ export declare const V3_FEE_TIERS: {
|
|
|
63
63
|
readonly HIGH: 10000;
|
|
64
64
|
};
|
|
65
65
|
export type GasLimitKey = keyof typeof GAS_LIMITS;
|
|
66
|
-
export type V3FeeTier = typeof V3_FEE_TIERS[keyof typeof V3_FEE_TIERS];
|
|
66
|
+
export type V3FeeTier = (typeof V3_FEE_TIERS)[keyof typeof V3_FEE_TIERS];
|
|
67
67
|
/**
|
|
68
68
|
* 根据链和交易类型计算 gas limit
|
|
69
69
|
*/
|
|
@@ -90,9 +90,7 @@ export function calculateGasLimit(chainId, isNative, hasHops = false, hopCount =
|
|
|
90
90
|
}
|
|
91
91
|
// 有多跳时,基础 gas + 每跳额外 gas
|
|
92
92
|
if (hasHops && hopCount > 0) {
|
|
93
|
-
const hopGas = isNative
|
|
94
|
-
? GAS_LIMITS.NATIVE_TRANSFER
|
|
95
|
-
: GAS_LIMITS.ERC20_TRANSFER;
|
|
93
|
+
const hopGas = isNative ? GAS_LIMITS.NATIVE_TRANSFER : GAS_LIMITS.ERC20_TRANSFER;
|
|
96
94
|
return GAS_LIMITS.TRADE + hopGas * BigInt(hopCount);
|
|
97
95
|
}
|
|
98
96
|
// 普通转账
|
|
@@ -108,9 +106,7 @@ export function calculateGasLimit(chainId, isNative, hasHops = false, hopCount =
|
|
|
108
106
|
*/
|
|
109
107
|
export function getTransferGasLimit(chainId, isNative) {
|
|
110
108
|
if (isNative) {
|
|
111
|
-
return chainId === CHAINS.XLAYER.chainId
|
|
112
|
-
? GAS_LIMITS.XLAYER_NATIVE_TRANSFER
|
|
113
|
-
: GAS_LIMITS.NATIVE_TRANSFER;
|
|
109
|
+
return chainId === CHAINS.XLAYER.chainId ? GAS_LIMITS.XLAYER_NATIVE_TRANSFER : GAS_LIMITS.NATIVE_TRANSFER;
|
|
114
110
|
}
|
|
115
111
|
return GAS_LIMITS.ERC20_TRANSFER;
|
|
116
112
|
}
|
|
@@ -10,5 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export { CHAINS, CHAIN_ID_MAP, getChainById, getChainName, getDefaultRpcUrl, isKnownChain, isBscChain, isXLayerChain, isMonadChain, isEniChain, getConfirmationTimeout, type ChainKey, type ChainConfig, } from './chains.js';
|
|
12
12
|
export { GAS_LIMITS, GAS_CONFIG, V3_FEE_TIERS, calculateGasLimit, getTransferGasLimit, type GasLimitKey, type V3FeeTier, } from './gas.js';
|
|
13
|
-
export {
|
|
13
|
+
export { QUOTE_CONFIG, QUOTE_V3_FEE_TIERS, type QuoteConfigChain } from './quote.js';
|
|
14
|
+
/** Flap 链标识(与 `FlapPortal` 一致,供子路径 `./constants` 使用) */
|
|
15
|
+
export type { FlapChain } from '../flap/portal.js';
|
|
16
|
+
export { ZERO_ADDRESS, ZERO_BYTES32, BLOCKRAZOR_BUILDER_EOA, ADDRESSES, getAddress, getWrappedNativeAddress, getMulticall3Address, getFlapPortalAddress, isZeroAddress, isNativeToken, ENI_SPENDERS, getEniSpenders, type ChainAddresses, type AddressKey, } from './addresses.js';
|
|
14
17
|
export { PROFIT_CONFIG, getProfitRecipient, getAllProfitRecipients, getProfitRateBps, calculateProfitAmount, calculateProfitHopGasCost, type ProfitRateKey, TRANSFER_FEE_PER_ADDRESS, getTransferFeePerAddress, calculateTransferFee, } from './profit.js';
|
|
@@ -16,10 +16,11 @@ export { CHAINS, CHAIN_ID_MAP, getChainById, getChainName, getDefaultRpcUrl, isK
|
|
|
16
16
|
// Gas 常量
|
|
17
17
|
// ============================================================================
|
|
18
18
|
export { GAS_LIMITS, GAS_CONFIG, V3_FEE_TIERS, calculateGasLimit, getTransferGasLimit, } from './gas.js';
|
|
19
|
+
export { QUOTE_CONFIG, QUOTE_V3_FEE_TIERS } from './quote.js';
|
|
19
20
|
// ============================================================================
|
|
20
21
|
// 合约地址
|
|
21
22
|
// ============================================================================
|
|
22
|
-
export { ZERO_ADDRESS, BLOCKRAZOR_BUILDER_EOA, ADDRESSES, getAddress, getWrappedNativeAddress, getMulticall3Address, getFlapPortalAddress, isZeroAddress, isNativeToken, ENI_SPENDERS, getEniSpenders, } from './addresses.js';
|
|
23
|
+
export { ZERO_ADDRESS, ZERO_BYTES32, BLOCKRAZOR_BUILDER_EOA, ADDRESSES, getAddress, getWrappedNativeAddress, getMulticall3Address, getFlapPortalAddress, isZeroAddress, isNativeToken, ENI_SPENDERS, getEniSpenders, } from './addresses.js';
|
|
23
24
|
// ============================================================================
|
|
24
25
|
// 利润配置
|
|
25
26
|
// ============================================================================
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** DEX 报价链配置(V2 Router / V3 Quoter / 包装原生币 / 稳定币) */
|
|
2
|
+
export declare const QUOTE_CONFIG: {
|
|
3
|
+
readonly BSC: {
|
|
4
|
+
readonly v2Router: "0x10ED43C718714eb63d5aA57B78B54704E256024E";
|
|
5
|
+
readonly v3Quoter: "0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997";
|
|
6
|
+
readonly wrappedNative: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c";
|
|
7
|
+
readonly stableCoins: readonly ["0x55d398326f99059fF775485246999027B3197955", "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d", "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56"];
|
|
8
|
+
};
|
|
9
|
+
readonly MONAD: {
|
|
10
|
+
readonly v2Router: "0xb1bc24c34e88f7d43d5923034e3a14b24daacff9";
|
|
11
|
+
readonly v3Quoter: "";
|
|
12
|
+
readonly wrappedNative: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a";
|
|
13
|
+
readonly stableCoins: readonly [];
|
|
14
|
+
};
|
|
15
|
+
readonly XLAYER: {
|
|
16
|
+
readonly v2Router: "0x881fb2f98c13d521009464e7d1cbf16e1b394e8e";
|
|
17
|
+
readonly v3Quoter: "0x5A6f3723346aF54a4D0693bfC1718D64d4915C3e";
|
|
18
|
+
readonly wrappedNative: "0xe538905cf8410324e03a5a23c1c177a474d59b2b";
|
|
19
|
+
readonly stableCoins: readonly ["0x1E4a5963aBFD975d8c9021ce480b42188849D41d", "0x74b7f16337b8972027f6196a17a631ac6de26d22", "0x779ded0c9e1022225f8e0630b35a9b54be713736"];
|
|
20
|
+
};
|
|
21
|
+
readonly ENI: {
|
|
22
|
+
readonly v2Router: "0x97ed8be49d9a8b86247090aa41e908e76b8fcf22";
|
|
23
|
+
readonly v3Quoter: "";
|
|
24
|
+
readonly wrappedNative: "0x6d1e851446f4d004ae2a72f9afed85e8829a205e";
|
|
25
|
+
readonly stableCoins: readonly ["0xDC1a8A35b0BaA3229b13f348ED708a2fd50b5e3a", "0xaFF944b96c1BAEA587159ec446280E468B32ee15"];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** V3 报价尝试费率列表(与 `gas.V3_FEE_TIERS` 命名对象区分) */
|
|
29
|
+
export declare const QUOTE_V3_FEE_TIERS: readonly [100, 500, 2500, 10000];
|
|
30
|
+
export type QuoteConfigChain = keyof typeof QUOTE_CONFIG;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** DEX 报价链配置(V2 Router / V3 Quoter / 包装原生币 / 稳定币) */
|
|
2
|
+
export const QUOTE_CONFIG = {
|
|
3
|
+
BSC: {
|
|
4
|
+
v2Router: '0x10ED43C718714eb63d5aA57B78B54704E256024E',
|
|
5
|
+
v3Quoter: '0xB048Bbc1Ee6b733FFfCFb9e9CeF7375518e25997',
|
|
6
|
+
wrappedNative: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',
|
|
7
|
+
stableCoins: [
|
|
8
|
+
'0x55d398326f99059fF775485246999027B3197955',
|
|
9
|
+
'0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d',
|
|
10
|
+
'0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56',
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
MONAD: {
|
|
14
|
+
v2Router: '0xb1bc24c34e88f7d43d5923034e3a14b24daacff9',
|
|
15
|
+
v3Quoter: '',
|
|
16
|
+
wrappedNative: '0x3bd359c1119da7da1d913d1c4d2b7c461115433a',
|
|
17
|
+
stableCoins: [],
|
|
18
|
+
},
|
|
19
|
+
XLAYER: {
|
|
20
|
+
v2Router: '0x881fb2f98c13d521009464e7d1cbf16e1b394e8e',
|
|
21
|
+
v3Quoter: '0x5A6f3723346aF54a4D0693bfC1718D64d4915C3e',
|
|
22
|
+
wrappedNative: '0xe538905cf8410324e03a5a23c1c177a474d59b2b',
|
|
23
|
+
stableCoins: [
|
|
24
|
+
'0x1E4a5963aBFD975d8c9021ce480b42188849D41d',
|
|
25
|
+
'0x74b7f16337b8972027f6196a17a631ac6de26d22',
|
|
26
|
+
'0x779ded0c9e1022225f8e0630b35a9b54be713736',
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
ENI: {
|
|
30
|
+
v2Router: '0x97ed8be49d9a8b86247090aa41e908e76b8fcf22',
|
|
31
|
+
v3Quoter: '',
|
|
32
|
+
wrappedNative: '0x6d1e851446f4d004ae2a72f9afed85e8829a205e',
|
|
33
|
+
stableCoins: ['0xDC1a8A35b0BaA3229b13f348ED708a2fd50b5e3a', '0xaFF944b96c1BAEA587159ec446280E468B32ee15'],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
/** V3 报价尝试费率列表(与 `gas.V3_FEE_TIERS` 命名对象区分) */
|
|
37
|
+
export const QUOTE_V3_FEE_TIERS = [100, 500, 2500, 10000];
|
package/dist/shared/flap/abi.js
CHANGED
|
@@ -9,5 +9,5 @@ export const PORTAL_EVENTS_ABI = [
|
|
|
9
9
|
'event FlapTokenTaxSet(address token, uint256 tax)',
|
|
10
10
|
'event FlapTokenCirculatingSupplyChanged(address token, uint256 newSupply)',
|
|
11
11
|
'event LaunchedToDEX(address token, address pool, uint256 amount, uint256 eth)',
|
|
12
|
-
'event TokenExtensionEnabled(address token, bytes32 extensionID, address extensionAddress, uint8 version)'
|
|
12
|
+
'event TokenExtensionEnabled(address token, bytes32 extensionID, address extensionAddress, uint8 version)',
|
|
13
13
|
];
|
|
@@ -31,7 +31,6 @@ export declare const FLAP_TOKEN_IMPL_ADDRESSES: {
|
|
|
31
31
|
readonly BSC_V3_PERMIT: "0x88881b6f03090462a969eC7f48385744Eeb63333";
|
|
32
32
|
readonly BSC_TAXED: "0x29e6383F0ce68507b5A72a53c2B118a118332aA8";
|
|
33
33
|
readonly BSC_TAXED_V5: "0xae562c6A05b798499507c6276C6Ed796027807BA";
|
|
34
|
-
readonly BSC_TAXED_V3: "0x024f18294970B5c76c0691b87f138A0317156422";
|
|
35
34
|
readonly BASE: "0xF3c514E04f83166E80718f29f0d34F206be40A0A";
|
|
36
35
|
readonly XLAYER: "0x12Dc83157Bf1cfCB8Db5952b3ba5bb56Cc38f8C9";
|
|
37
36
|
readonly MORPH: "0x8b4329947e34b6d56d71a3385cac122bade7d78d";
|
|
@@ -128,4 +127,4 @@ export declare const FLAP_TOTAL_SUPPLY: bigint;
|
|
|
128
127
|
* 零地址(用于表示原生代币)
|
|
129
128
|
* ✅ 从公共模块重新导出
|
|
130
129
|
*/
|
|
131
|
-
export { ZERO_ADDRESS } from '
|
|
130
|
+
export { ZERO_ADDRESS } from '../constants/index.js';
|
|
@@ -32,8 +32,7 @@ export const FLAP_TOKEN_IMPL_ADDRESSES = {
|
|
|
32
32
|
/** TOKEN_V3_PERMIT / newTokenV7(Flap Portal v5.8.6+,vanity 后缀仍为 8888) */
|
|
33
33
|
BSC_V3_PERMIT: '0x88881b6f03090462a969eC7f48385744Eeb63333',
|
|
34
34
|
BSC_TAXED: '0x29e6383F0ce68507b5A72a53c2B118a118332aA8', // V2: 只有运营钱包的税代币
|
|
35
|
-
BSC_TAXED_V5: '0xae562c6A05b798499507c6276C6Ed796027807BA', //
|
|
36
|
-
BSC_TAXED_V3: '0x024f18294970B5c76c0691b87f138A0317156422', // V3: VaultPortal.newTokenV6WithVault / Portal.newTokenV6 税币
|
|
35
|
+
BSC_TAXED_V5: '0xae562c6A05b798499507c6276C6Ed796027807BA', // V5: 高级税代币 (mkt/deflation/dividend/lp)
|
|
37
36
|
BASE: '0xF3c514E04f83166E80718f29f0d34F206be40A0A',
|
|
38
37
|
XLAYER: '0x12Dc83157Bf1cfCB8Db5952b3ba5bb56Cc38f8C9',
|
|
39
38
|
MORPH: '0x8b4329947e34b6d56d71a3385cac122bade7d78d', // 暂时使用 BSC NORMAL 地址
|
|
@@ -138,9 +137,9 @@ export const FLAP_DEX_THRESHOLDS = {
|
|
|
138
137
|
/**
|
|
139
138
|
* 代币总供应量(固定为 10 亿)
|
|
140
139
|
*/
|
|
141
|
-
export const FLAP_TOTAL_SUPPLY = BigInt(
|
|
140
|
+
export const FLAP_TOTAL_SUPPLY = BigInt(1_000_000_000) * BigInt(10 ** 18);
|
|
142
141
|
/**
|
|
143
142
|
* 零地址(用于表示原生代币)
|
|
144
143
|
* ✅ 从公共模块重新导出
|
|
145
144
|
*/
|
|
146
|
-
export { ZERO_ADDRESS } from '
|
|
145
|
+
export { ZERO_ADDRESS } from '../constants/index.js';
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flap Protocol 错误代码
|
|
3
|
-
*/
|
|
4
1
|
export type FlapErrorCode = 'TOKEN_ALREADY_EXISTS' | 'TOKEN_NOT_FOUND' | 'TOKEN_NOT_TRADABLE' | 'ALREADY_ON_DEX' | 'INSUFFICIENT_BALANCE' | 'SLIPPAGE_EXCEEDED' | 'INVALID_TOKEN' | 'INVALID_QUOTE_TOKEN' | 'INVALID_AMOUNT' | 'TAX_RATE_TOO_HIGH' | 'PERMIT_EXPIRED' | 'PERMIT_INVALID' | 'UNKNOWN_ERROR';
|
|
5
2
|
/**
|
|
6
3
|
* 解析 Flap Protocol 错误信息
|
|
@@ -20,7 +17,7 @@ export type FlapErrorCode = 'TOKEN_ALREADY_EXISTS' | 'TOKEN_NOT_FOUND' | 'TOKEN_
|
|
|
20
17
|
* }
|
|
21
18
|
* ```
|
|
22
19
|
*/
|
|
23
|
-
export declare function parseFlapError(error:
|
|
20
|
+
export declare function parseFlapError(error: unknown): FlapErrorCode | null;
|
|
24
21
|
/**
|
|
25
22
|
* 获取错误的友好提示信息(中文)
|
|
26
23
|
*
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flap Protocol 错误代码
|
|
3
|
+
*/
|
|
4
|
+
import { getErrorMessageFromUnknown } from '../foundation/normalize-unknown.js';
|
|
1
5
|
/**
|
|
2
6
|
* 解析 Flap Protocol 错误信息
|
|
3
7
|
*
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
* ```
|
|
18
22
|
*/
|
|
19
23
|
export function parseFlapError(error) {
|
|
20
|
-
const msg =
|
|
24
|
+
const msg = getFlapErrorText(error);
|
|
21
25
|
const msgLower = msg.toLowerCase();
|
|
22
26
|
// Token 状态相关错误
|
|
23
27
|
if (msgLower.includes('token already exists') || msgLower.includes('already created')) {
|
|
@@ -60,6 +64,21 @@ export function parseFlapError(error) {
|
|
|
60
64
|
// 无法识别的错误
|
|
61
65
|
return null;
|
|
62
66
|
}
|
|
67
|
+
function getFlapErrorText(error) {
|
|
68
|
+
if (error !== null && typeof error === 'object') {
|
|
69
|
+
const record = error;
|
|
70
|
+
const topLevel = record.message;
|
|
71
|
+
if (typeof topLevel === 'string' && topLevel)
|
|
72
|
+
return topLevel;
|
|
73
|
+
const data = record.data;
|
|
74
|
+
if (data !== null && typeof data === 'object') {
|
|
75
|
+
const nestedMessage = data.message;
|
|
76
|
+
if (typeof nestedMessage === 'string' && nestedMessage)
|
|
77
|
+
return nestedMessage;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return getErrorMessageFromUnknown(error);
|
|
81
|
+
}
|
|
63
82
|
/**
|
|
64
83
|
* 获取错误的友好提示信息(中文)
|
|
65
84
|
*
|
|
@@ -11,14 +11,13 @@ type PortalConfig, type TokenStateV2, type TokenStateV3, type TokenStateV4, type
|
|
|
11
11
|
export { CDPV2 } from './curve.js';
|
|
12
12
|
export { buildPermitPiggybackAuto } from './permit.js';
|
|
13
13
|
export { uploadTokenMeta, type TokenMetaInput } from './ipfs.js';
|
|
14
|
-
export { PinataClient, type PinataConfig, pinFileToIPFSWithJWT, pinImageByPath, pinFileToIPFSWithJWTWeb, pinDataURLWithJWTWeb, dataURLToBlob, type PinataPinResp } from './pinata.js';
|
|
14
|
+
export { PinataClient, type PinataConfig, pinFileToIPFSWithJWT, pinImageByPath, pinFileToIPFSWithJWTWeb, pinDataURLWithJWTWeb, dataURLToBlob, type PinataPinResp, } from './pinata.js';
|
|
15
15
|
export { predictVanityTokenAddressByChain, findSaltEndingByChain } from './vanity.js';
|
|
16
|
-
export {
|
|
17
|
-
export { populateCreateTokenTransaction, normalizeTaxLaunchConfig, resolveCreateTokenLaunchFlags, MAGIC_DIVIDEND_SELF, type PopulateCreateTokenParams, type NormalizedTaxLaunchConfig, } from './portal-create-token.js';
|
|
16
|
+
export { MAGIC_DIVIDEND_SELF, normalizeTaxLaunchConfig, populateCreateTokenTransaction, type NormalizedTaxLaunchConfig, } from './portal-create-token.js';
|
|
18
17
|
export { getFlapMetaByAddress, getFlapMetasByAddresses } from './meta.js';
|
|
19
18
|
export { parseFlapError, getFlapErrorMessage, getFlapErrorMessageEn, type FlapErrorCode } from './errors.js';
|
|
20
|
-
export { FLAP_DEFAULT_FEE_RATES, FLAP_IPFS_API_URL, FLAP_VANITY_SUFFIX, FLAP_DEX_THRESHOLDS, FLAP_TOTAL_SUPPLY, ZERO_ADDRESS, CHAIN_TAX_SUPPORT, getVanitySuffix, isChainSupportTax, FLAP_PORTAL_ADDRESSES } from './constants.js';
|
|
19
|
+
export { FLAP_DEFAULT_FEE_RATES, FLAP_IPFS_API_URL, FLAP_VANITY_SUFFIX, FLAP_DEX_THRESHOLDS, FLAP_TOTAL_SUPPLY, ZERO_ADDRESS, CHAIN_TAX_SUPPORT, getVanitySuffix, isChainSupportTax, FLAP_PORTAL_ADDRESSES, } from './constants.js';
|
|
21
20
|
export * from './abi.js';
|
|
22
21
|
export { createTokenWithBundleBuy, batchBuyWithBundle, batchSellWithBundle, type FlapBundleConfig, type FlapChainForBundle, type FlapCreateWithBundleBuyParams, type FlapCreateWithBundleBuyResult, type FlapBatchBuyParams, type FlapBatchBuyResult, type FlapBatchSellParams, type FlapBatchSellResult, flapPrivateBuy, flapPrivateSell, flapBatchPrivateBuy, flapBatchPrivateSell, type FlapPrivateBuyParams, type FlapPrivateSellParams, type FlapBatchPrivateBuyParams, type FlapBatchPrivateSellParams, type FlapBatchPrivateSellResult, } from './portal-bundle.js';
|
|
23
22
|
export * from './portal-bundle-merkle/index.js';
|
|
24
|
-
export { NONE_EXTENSION_ID, VAULT_TYPE_LABELS, VAULT_TYPE_CATEGORIES, VAULT_FACTORY_ADDRESSES, VAULT_PORTAL_ADDRESSES, VAULT_PORTAL_ABI, VAULT_EXTRA_CONFIG, FLAP_GUARDIAN_ADDRESSES, VAULT_FACTORY_ABI, VAULT_FACTORY_V2_ABI, VAULT_BASE_ABI, VAULT_BASE_V2_ABI, type VaultType, type TaxVaultConfig, type VaultInfo, type FieldDescriptor, type VaultDataSchema, type ApproveAction, type VaultMethodSchema, type VaultUISchema, encodeVaultData, buildVaultParams, buildVaultExtensionParams,
|
|
23
|
+
export { NONE_EXTENSION_ID, VAULT_TYPE_LABELS, VAULT_TYPE_CATEGORIES, VAULT_FACTORY_ADDRESSES, VAULT_PORTAL_ADDRESSES, VAULT_PORTAL_ABI, VAULT_EXTRA_CONFIG, FLAP_GUARDIAN_ADDRESSES, VAULT_FACTORY_ABI, VAULT_FACTORY_V2_ABI, VAULT_BASE_ABI, VAULT_BASE_V2_ABI, type VaultType, type TaxVaultConfig, type VaultInfo, type FieldDescriptor, type VaultDataSchema, type ApproveAction, type VaultMethodSchema, type VaultUISchema, encodeVaultData, buildVaultParams, buildVaultExtensionParams, getVaultFactoryAddress, getVaultPortalAddress, queryVaultDataSchema, queryVaultUISchema, queryVaultDescription, validateVaultFactory, getVaultInfo, isValidContract, } from './vault.js';
|
|
@@ -11,13 +11,12 @@ export { FlapPortal, FlapPortalWriter, validateTaxDistribution, TokenStatus, Tok
|
|
|
11
11
|
export { CDPV2 } from './curve.js';
|
|
12
12
|
export { buildPermitPiggybackAuto } from './permit.js';
|
|
13
13
|
export { uploadTokenMeta } from './ipfs.js';
|
|
14
|
-
export { PinataClient, pinFileToIPFSWithJWT, pinImageByPath, pinFileToIPFSWithJWTWeb, pinDataURLWithJWTWeb, dataURLToBlob } from './pinata.js';
|
|
14
|
+
export { PinataClient, pinFileToIPFSWithJWT, pinImageByPath, pinFileToIPFSWithJWTWeb, pinDataURLWithJWTWeb, dataURLToBlob, } from './pinata.js';
|
|
15
15
|
export { predictVanityTokenAddressByChain, findSaltEndingByChain } from './vanity.js';
|
|
16
|
-
export {
|
|
17
|
-
export { populateCreateTokenTransaction, normalizeTaxLaunchConfig, resolveCreateTokenLaunchFlags, MAGIC_DIVIDEND_SELF, } from './portal-create-token.js';
|
|
16
|
+
export { MAGIC_DIVIDEND_SELF, normalizeTaxLaunchConfig, populateCreateTokenTransaction, } from './portal-create-token.js';
|
|
18
17
|
export { getFlapMetaByAddress, getFlapMetasByAddresses } from './meta.js';
|
|
19
18
|
export { parseFlapError, getFlapErrorMessage, getFlapErrorMessageEn } from './errors.js';
|
|
20
|
-
export { FLAP_DEFAULT_FEE_RATES, FLAP_IPFS_API_URL, FLAP_VANITY_SUFFIX, FLAP_DEX_THRESHOLDS, FLAP_TOTAL_SUPPLY, ZERO_ADDRESS, CHAIN_TAX_SUPPORT, getVanitySuffix, isChainSupportTax, FLAP_PORTAL_ADDRESSES } from './constants.js';
|
|
19
|
+
export { FLAP_DEFAULT_FEE_RATES, FLAP_IPFS_API_URL, FLAP_VANITY_SUFFIX, FLAP_DEX_THRESHOLDS, FLAP_TOTAL_SUPPLY, ZERO_ADDRESS, CHAIN_TAX_SUPPORT, getVanitySuffix, isChainSupportTax, FLAP_PORTAL_ADDRESSES, } from './constants.js';
|
|
21
20
|
export * from './abi.js';
|
|
22
21
|
// Bundle 功能
|
|
23
22
|
export { createTokenWithBundleBuy, batchBuyWithBundle, batchSellWithBundle, flapPrivateBuy, flapPrivateSell, flapBatchPrivateBuy, flapBatchPrivateSell, } from './portal-bundle.js';
|
|
@@ -30,6 +29,6 @@ NONE_EXTENSION_ID, VAULT_TYPE_LABELS, VAULT_TYPE_CATEGORIES, VAULT_FACTORY_ADDRE
|
|
|
30
29
|
// ABI
|
|
31
30
|
VAULT_FACTORY_ABI, VAULT_FACTORY_V2_ABI, VAULT_BASE_ABI, VAULT_BASE_V2_ABI,
|
|
32
31
|
// 工具函数
|
|
33
|
-
encodeVaultData, buildVaultParams, buildVaultExtensionParams,
|
|
32
|
+
encodeVaultData, buildVaultParams, buildVaultExtensionParams, getVaultFactoryAddress, getVaultPortalAddress,
|
|
34
33
|
// 链上查询
|
|
35
34
|
queryVaultDataSchema, queryVaultUISchema, queryVaultDescription, validateVaultFactory, getVaultInfo, isValidContract, } from './vault.js';
|
|
@@ -58,11 +58,6 @@ export type BuildNewTokenV6FromTaxV2Input = {
|
|
|
58
58
|
};
|
|
59
59
|
/** Portal.newTokenV6 ABI(ethers 简写格式,供 Contract 使用) */
|
|
60
60
|
export declare const NEW_TOKEN_V6_ABI = "function newTokenV6((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile,uint16 buyTaxRate,uint16 sellTaxRate,uint64 taxDuration,uint64 antiFarmerDuration,uint16 mktBps,uint16 deflationBps,uint16 dividendBps,uint16 lpBps,uint256 minimumShareBalance,address dividendToken,address commissionReceiver,uint8 tokenVersion)) external payable returns (address)";
|
|
61
|
-
/**
|
|
62
|
-
* Portal 要求:quoteToken 为 ERC20 时 dividendToken 不能为 0。
|
|
63
|
-
* 未显式传入时默认与 quoteToken 相同(分红币种 = 报价币)。
|
|
64
|
-
*/
|
|
65
|
-
export declare function resolveDividendTokenForQuote(quoteToken?: string, dividendToken?: string): string;
|
|
66
61
|
export declare function normalizeTaxV2Fields(taxV2: TaxV2Config): (TaxV2Config & {
|
|
67
62
|
mktBps: number;
|
|
68
63
|
deflationBps: number;
|
|
@@ -7,20 +7,6 @@ import { TokenVersion } from './portal.js';
|
|
|
7
7
|
const NONE_EXTENSION_ID = '0x' + '00'.repeat(32);
|
|
8
8
|
/** Portal.newTokenV6 ABI(ethers 简写格式,供 Contract 使用) */
|
|
9
9
|
export const NEW_TOKEN_V6_ABI = 'function newTokenV6((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile,uint16 buyTaxRate,uint16 sellTaxRate,uint64 taxDuration,uint64 antiFarmerDuration,uint16 mktBps,uint16 deflationBps,uint16 dividendBps,uint16 lpBps,uint256 minimumShareBalance,address dividendToken,address commissionReceiver,uint8 tokenVersion)) external payable returns (address)';
|
|
10
|
-
/**
|
|
11
|
-
* Portal 要求:quoteToken 为 ERC20 时 dividendToken 不能为 0。
|
|
12
|
-
* 未显式传入时默认与 quoteToken 相同(分红币种 = 报价币)。
|
|
13
|
-
*/
|
|
14
|
-
export function resolveDividendTokenForQuote(quoteToken, dividendToken) {
|
|
15
|
-
if (dividendToken && dividendToken !== ZeroAddress) {
|
|
16
|
-
return dividendToken;
|
|
17
|
-
}
|
|
18
|
-
const qt = quoteToken || ZeroAddress;
|
|
19
|
-
if (qt === ZeroAddress) {
|
|
20
|
-
return ZeroAddress;
|
|
21
|
-
}
|
|
22
|
-
return qt;
|
|
23
|
-
}
|
|
24
10
|
export function normalizeTaxV2Fields(taxV2) {
|
|
25
11
|
if ('distribution' in taxV2) {
|
|
26
12
|
return {
|
|
@@ -77,7 +63,7 @@ export function buildNewTokenV6Params(input) {
|
|
|
77
63
|
dividendBps: tv2.dividendBps & 0xffff,
|
|
78
64
|
lpBps: tv2.lpBps & 0xffff,
|
|
79
65
|
minimumShareBalance: BigInt(tv2.minimumShareBalance ?? 10000) * (10n ** 18n),
|
|
80
|
-
dividendToken:
|
|
66
|
+
dividendToken: input.dividendToken ?? ZeroAddress,
|
|
81
67
|
commissionReceiver: input.commissionReceiver ?? ZeroAddress,
|
|
82
68
|
tokenVersion: TokenVersion.TOKEN_TAXED_V3,
|
|
83
69
|
};
|
|
@@ -108,7 +94,7 @@ export function buildNewTokenV6Params(input) {
|
|
|
108
94
|
dividendBps: (p.dividendBps ?? 0) & 0xffff,
|
|
109
95
|
lpBps: (p.lpBps ?? 0) & 0xffff,
|
|
110
96
|
minimumShareBalance: p.minimumShareBalance ?? 0n,
|
|
111
|
-
dividendToken:
|
|
97
|
+
dividendToken: p.dividendToken ?? ZeroAddress,
|
|
112
98
|
commissionReceiver: isStandard ? ZeroAddress : (p.commissionReceiver ?? ZeroAddress),
|
|
113
99
|
tokenVersion: p.tokenVersion ?? TokenVersion.TOKEN_V2_PERMIT,
|
|
114
100
|
};
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { JsonRpcProvider } from 'ethers';
|
|
2
2
|
export type FlapChain = 'BSC' | 'BASE' | 'XLAYER' | 'MORPH';
|
|
3
|
+
/** JSON 可序列化值(递归) */
|
|
4
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
};
|
|
7
|
+
/** IPFS 元数据 JSON(字段因项目而异) */
|
|
8
|
+
export type FlapTokenMetaJson = {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
};
|
|
11
|
+
export type FlapMetaByAddressResult = {
|
|
12
|
+
cid: string;
|
|
13
|
+
data?: FlapTokenMetaJson;
|
|
14
|
+
};
|
|
15
|
+
export type FlapMetaByTokenResult = {
|
|
16
|
+
token: string;
|
|
17
|
+
cid?: string;
|
|
18
|
+
data?: FlapTokenMetaJson;
|
|
19
|
+
imageUrl?: string;
|
|
20
|
+
error?: string;
|
|
21
|
+
};
|
|
3
22
|
export type FetchMetaOptions = {
|
|
4
23
|
ipfsGateway?: string;
|
|
5
24
|
multicall3?: string;
|
|
@@ -7,24 +26,9 @@ export type FetchMetaOptions = {
|
|
|
7
26
|
/**
|
|
8
27
|
* 根据代币地址直接读取合约 metaURI()/meta()(IPFS CID),并拉取元数据 JSON。
|
|
9
28
|
*/
|
|
10
|
-
export declare function getFlapMetaByAddress(chain: FlapChain, rpcUrl: string, tokenAddress: string, opts?: FetchMetaOptions): Promise<
|
|
11
|
-
|
|
12
|
-
data?: any;
|
|
13
|
-
} | undefined>;
|
|
14
|
-
export declare function getFlapMetasByAddresses(chain: FlapChain, rpcUrl: string, tokenAddresses: string[], opts?: FetchMetaOptions): Promise<Array<{
|
|
15
|
-
token: string;
|
|
16
|
-
cid?: string;
|
|
17
|
-
data?: any;
|
|
18
|
-
imageUrl?: string;
|
|
19
|
-
error?: string;
|
|
20
|
-
}>>;
|
|
29
|
+
export declare function getFlapMetaByAddress(chain: FlapChain, rpcUrl: string, tokenAddress: string, opts?: FetchMetaOptions): Promise<FlapMetaByAddressResult | undefined>;
|
|
30
|
+
export declare function getFlapMetasByAddresses(chain: FlapChain, rpcUrl: string, tokenAddresses: string[], opts?: FetchMetaOptions): Promise<FlapMetaByTokenResult[]>;
|
|
21
31
|
/**
|
|
22
32
|
* 使用 Multicall3 批量读取 metaURI()/meta(),metaURI 优先、meta 兜底。
|
|
23
33
|
*/
|
|
24
|
-
export declare function getFlapMetaUrisWithMulticall(provider: JsonRpcProvider, chain: FlapChain, tokenAddresses: string[], multicall3?: string, ipfsGateway?: string): Promise<
|
|
25
|
-
token: string;
|
|
26
|
-
cid?: string;
|
|
27
|
-
data?: any;
|
|
28
|
-
imageUrl?: string;
|
|
29
|
-
error?: string;
|
|
30
|
-
}>>;
|
|
34
|
+
export declare function getFlapMetaUrisWithMulticall(provider: JsonRpcProvider, chain: FlapChain, tokenAddresses: string[], multicall3?: string, ipfsGateway?: string): Promise<FlapMetaByTokenResult[]>;
|