four-flap-meme-sdk 3.0.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/four-meme/approve-tokenmanager.d.ts +2 -2
- package/dist/bundle/four-meme/approve-tokenmanager.js +3 -3
- package/dist/bundle/four-meme/core/buy-flow.d.ts +5 -0
- package/dist/bundle/four-meme/core/buy-flow.js +147 -0
- package/dist/bundle/four-meme/core/constants.d.ts +6 -0
- package/dist/bundle/four-meme/core/constants.js +15 -0
- package/dist/bundle/four-meme/core/create-token.d.ts +5 -0
- package/dist/bundle/four-meme/core/create-token.js +137 -0
- package/dist/bundle/four-meme/core/index.d.ts +14 -0
- package/dist/bundle/four-meme/core/index.js +14 -0
- package/dist/bundle/four-meme/core/sell-flow.d.ts +5 -0
- package/dist/bundle/four-meme/core/sell-flow.js +240 -0
- package/dist/bundle/four-meme/core-helpers.js +1 -1
- package/dist/bundle/four-meme/core.d.ts +7 -4
- package/dist/bundle/four-meme/core.js +5 -513
- package/dist/bundle/four-meme/pancake-proxy/approve.d.ts +15 -0
- package/dist/bundle/four-meme/pancake-proxy/approve.js +113 -0
- package/dist/bundle/four-meme/pancake-proxy/buy.d.ts +8 -0
- package/dist/bundle/four-meme/pancake-proxy/buy.js +143 -0
- package/dist/bundle/four-meme/pancake-proxy/constants.d.ts +25 -0
- package/dist/bundle/four-meme/pancake-proxy/constants.js +14 -0
- package/dist/bundle/four-meme/pancake-proxy/helpers.d.ts +45 -0
- package/dist/bundle/four-meme/pancake-proxy/helpers.js +232 -0
- package/dist/bundle/four-meme/pancake-proxy/index.d.ts +15 -0
- package/dist/bundle/four-meme/pancake-proxy/index.js +15 -0
- package/dist/bundle/four-meme/pancake-proxy/sell.d.ts +8 -0
- package/dist/bundle/four-meme/pancake-proxy/sell.js +194 -0
- package/dist/bundle/four-meme/pancake-proxy.d.ts +4 -20
- package/dist/bundle/four-meme/pancake-proxy.js +3 -670
- package/dist/bundle/four-meme/private/buy.d.ts +16 -0
- package/dist/bundle/four-meme/private/buy.js +225 -0
- package/dist/bundle/four-meme/private/index.d.ts +11 -0
- package/dist/bundle/four-meme/private/index.js +11 -0
- package/dist/bundle/four-meme/private/sell.d.ts +18 -0
- package/dist/bundle/four-meme/private/sell.js +245 -0
- package/dist/bundle/four-meme/private.d.ts +5 -25
- package/dist/bundle/four-meme/private.js +5 -463
- package/dist/bundle/four-meme/swap/batch.d.ts +8 -0
- package/dist/bundle/four-meme/swap/batch.js +170 -0
- package/dist/bundle/four-meme/swap/bundle.d.ts +8 -0
- package/dist/bundle/four-meme/swap/bundle.js +147 -0
- package/dist/bundle/four-meme/swap/index.d.ts +14 -0
- package/dist/bundle/four-meme/swap/index.js +13 -0
- package/dist/bundle/four-meme/swap/quick-batch.d.ts +8 -0
- package/dist/bundle/four-meme/swap/quick-batch.js +206 -0
- package/dist/bundle/four-meme/swap-buy-first/helpers.d.ts +20 -0
- package/dist/bundle/four-meme/swap-buy-first/helpers.js +39 -0
- package/dist/bundle/four-meme/swap-buy-first/index.d.ts +12 -0
- package/dist/bundle/four-meme/swap-buy-first/index.js +11 -0
- package/dist/bundle/four-meme/swap-buy-first/multi-wallet.d.ts +20 -0
- package/dist/bundle/four-meme/swap-buy-first/multi-wallet.js +198 -0
- package/dist/bundle/four-meme/swap-buy-first/single.d.ts +7 -0
- package/dist/bundle/four-meme/swap-buy-first/single.js +232 -0
- package/dist/bundle/four-meme/swap-buy-first.d.ts +4 -3
- package/dist/bundle/four-meme/swap-buy-first.js +4 -451
- package/dist/bundle/four-meme/swap-hop-helpers.d.ts +2 -2
- package/dist/bundle/four-meme/swap-sign-helpers.d.ts +2 -2
- package/dist/bundle/four-meme/swap-sign-helpers.js +1 -1
- package/dist/bundle/four-meme/swap.d.ts +4 -14
- package/dist/bundle/four-meme/swap.js +4 -502
- package/dist/bundle/four-meme/types/index.d.ts +1 -1
- package/dist/bundle/four-meme/utils-disperse.d.ts +1 -1
- package/dist/bundle/four-meme/utils-disperse.js +1 -1
- package/dist/bundle/four-meme/utils-pairwise.d.ts +1 -1
- package/dist/bundle/four-meme/utils-pairwise.js +1 -1
- package/dist/bundle/four-meme/utils-sweep/context.d.ts +39 -0
- package/dist/bundle/four-meme/utils-sweep/context.js +7 -0
- package/dist/bundle/four-meme/utils-sweep/erc20-no-hop.d.ts +5 -0
- package/dist/bundle/four-meme/utils-sweep/erc20-no-hop.js +162 -0
- package/dist/bundle/four-meme/utils-sweep/index.d.ts +13 -0
- package/dist/bundle/four-meme/utils-sweep/index.js +13 -0
- package/dist/bundle/four-meme/utils-sweep/main.d.ts +8 -0
- package/dist/bundle/four-meme/utils-sweep/main.js +114 -0
- package/dist/bundle/four-meme/utils-sweep/native-no-hop.d.ts +5 -0
- package/dist/bundle/four-meme/utils-sweep/native-no-hop.js +156 -0
- package/dist/bundle/four-meme/utils-sweep/with-hops.d.ts +6 -0
- package/dist/bundle/four-meme/utils-sweep/with-hops.js +382 -0
- package/dist/bundle/four-meme/utils-sweep.d.ts +3 -4
- package/dist/bundle/four-meme/utils-sweep.js +3 -740
- package/dist/bundle/internal.d.ts +2 -2
- package/dist/bundle/sign-context-helpers.d.ts +1 -26
- package/dist/bundle/sign-context-helpers.js +1 -63
- package/dist/bundle/submit/blockrazor.d.ts +94 -0
- package/dist/bundle/submit/blockrazor.js +122 -0
- package/dist/bundle/submit/direct.d.ts +118 -0
- package/dist/bundle/submit/direct.js +484 -0
- package/dist/bundle/submit/helpers.d.ts +7 -0
- package/dist/bundle/submit/helpers.js +15 -0
- package/dist/bundle/submit/index.d.ts +14 -0
- package/dist/bundle/submit/index.js +14 -0
- package/dist/bundle/submit/merkle.d.ts +84 -0
- package/dist/bundle/submit/merkle.js +121 -0
- package/dist/bundle/submit.d.ts +3 -286
- package/dist/bundle/submit.js +3 -724
- package/dist/chains/bsc/four/types.d.ts +1 -1
- package/dist/chains/bsc/index.d.ts +1 -1
- package/dist/chains/bsc/index.js +2 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-build.d.ts +25 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-build.js +177 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-constants.d.ts +30 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-constants.js +24 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +11 -149
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +12 -74
- package/dist/chains/bsc/pancake/bundle-buy-first-multi-wallet.d.ts +9 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-multi-wallet.js +225 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-plan.d.ts +14 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-plan.js +64 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-profit.d.ts +12 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-profit.js +22 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-quote.d.ts +15 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-quote.js +122 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-types.d.ts +179 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-types.js +1 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-validate.d.ts +2 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-validate.js +41 -0
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +1 -1
- package/dist/chains/bsc/pancake/bundle-buy-first.js +8 -578
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +11 -239
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +12 -564
- package/dist/chains/bsc/pancake/bundle-swap-types.d.ts +183 -0
- package/dist/chains/bsc/pancake/bundle-swap-types.js +17 -0
- package/dist/chains/bsc/pancake/bundle-swap.d.ts +10 -132
- package/dist/chains/bsc/pancake/bundle-swap.js +12 -1003
- package/dist/chains/bsc/pancake/hop-chain.d.ts +18 -0
- package/dist/chains/bsc/pancake/hop-chain.js +227 -0
- package/dist/chains/bsc/pancake/quote.d.ts +14 -0
- package/dist/chains/bsc/pancake/quote.js +84 -0
- package/dist/chains/bsc/pancake/swap-batch.d.ts +42 -0
- package/dist/chains/bsc/pancake/swap-batch.js +283 -0
- package/dist/chains/bsc/pancake/swap-build.d.ts +19 -0
- package/dist/chains/bsc/pancake/swap-build.js +226 -0
- package/dist/chains/bsc/pancake/swap-cross.d.ts +42 -0
- package/dist/chains/bsc/pancake/swap-cross.js +140 -0
- package/dist/chains/bsc/pancake/swap-quick.d.ts +54 -0
- package/dist/chains/bsc/pancake/swap-quick.js +424 -0
- package/dist/chains/bsc/pancake/swap-single.d.ts +2 -0
- package/dist/chains/bsc/pancake/swap-single.js +182 -0
- package/dist/chains/bsc/platforms/four/index.d.ts +21 -3
- package/dist/chains/bsc/platforms/four/index.js +28 -3
- package/dist/chains/eni/batch-router/transfer-disperse.d.ts +37 -0
- package/dist/chains/eni/batch-router/transfer-disperse.js +302 -0
- package/dist/chains/eni/batch-router/transfer-shared.d.ts +9 -0
- package/dist/chains/eni/batch-router/transfer-shared.js +10 -0
- package/dist/chains/eni/batch-router/transfer-sweep.d.ts +51 -0
- package/dist/chains/eni/batch-router/transfer-sweep.js +364 -0
- package/dist/chains/eni/batch-router/transfer.d.ts +4 -74
- package/dist/chains/eni/batch-router/transfer.js +2 -647
- package/dist/chains/eni/index.d.ts +2 -0
- package/dist/chains/eni/index.js +4 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-profit.d.ts +17 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-profit.js +30 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-submit.d.ts +12 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-submit.js +396 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-tx.d.ts +20 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct-tx.js +165 -0
- package/dist/chains/eni/platforms/daoaas/portal-direct.d.ts +3 -32
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +3 -571
- package/dist/chains/eni/submit.js +1 -1
- package/dist/chains/xlayer/constants.d.ts +0 -2
- package/dist/chains/xlayer/constants.js +0 -2
- package/dist/chains/xlayer/eip7702/auth.d.ts +16 -0
- package/dist/chains/xlayer/eip7702/auth.js +81 -0
- package/dist/chains/xlayer/eip7702/bundle-create-buy.d.ts +22 -0
- package/dist/chains/xlayer/eip7702/bundle-create-buy.js +201 -0
- package/dist/chains/xlayer/eip7702/bundle-create-helpers.d.ts +114 -0
- package/dist/chains/xlayer/eip7702/bundle-create-helpers.js +139 -0
- package/dist/chains/xlayer/eip7702/bundle-create-to-dex.d.ts +24 -0
- package/dist/chains/xlayer/eip7702/bundle-create-to-dex.js +233 -0
- package/dist/chains/xlayer/eip7702/bundle-create.d.ts +3 -35
- package/dist/chains/xlayer/eip7702/bundle-create.js +3 -746
- package/dist/chains/xlayer/eip7702/bundle-graduate-buy.d.ts +22 -0
- package/dist/chains/xlayer/eip7702/bundle-graduate-buy.js +214 -0
- package/dist/chains/xlayer/eip7702/bundle-sell.js +1 -1
- package/dist/chains/xlayer/eip7702/bundle-swap-batch.d.ts +31 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-batch.js +216 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-helpers.d.ts +21 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-helpers.js +206 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-multi.d.ts +33 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-multi.js +146 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-single.d.ts +31 -0
- package/dist/chains/xlayer/eip7702/bundle-swap-single.js +177 -0
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +6 -61
- package/dist/chains/xlayer/eip7702/bundle-swap.js +3 -712
- package/dist/chains/xlayer/eip7702/bytes.d.ts +4 -0
- package/dist/chains/xlayer/eip7702/bytes.js +31 -0
- package/dist/chains/xlayer/eip7702/gas.d.ts +19 -0
- package/dist/chains/xlayer/eip7702/gas.js +152 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-disperse.d.ts +5 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-disperse.js +196 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-pairwise.d.ts +5 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-pairwise.js +188 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-sweep.d.ts +5 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-sweep.js +220 -0
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.d.ts +8 -4
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.js +5 -591
- package/dist/chains/xlayer/eip7702/profit.d.ts +32 -0
- package/dist/chains/xlayer/eip7702/profit.js +59 -0
- package/dist/chains/xlayer/eip7702/provider.d.ts +3 -0
- package/dist/chains/xlayer/eip7702/provider.js +17 -0
- package/dist/chains/xlayer/eip7702/time.d.ts +2 -0
- package/dist/chains/xlayer/eip7702/time.js +10 -0
- package/dist/chains/xlayer/eip7702/tx-build.d.ts +10 -0
- package/dist/chains/xlayer/eip7702/tx-build.js +128 -0
- package/dist/chains/xlayer/eip7702/utils.d.ts +19 -85
- package/dist/chains/xlayer/eip7702/utils.js +19 -484
- package/dist/chains/xlayer/eip7702/volume-bundle.d.ts +13 -0
- package/dist/chains/xlayer/eip7702/volume-bundle.js +250 -0
- package/dist/chains/xlayer/eip7702/volume-internal.d.ts +13 -0
- package/dist/chains/xlayer/eip7702/volume-internal.js +169 -0
- package/dist/chains/xlayer/eip7702/volume-make.d.ts +8 -0
- package/dist/chains/xlayer/eip7702/volume-make.js +38 -0
- package/dist/chains/xlayer/eip7702/volume-single-round.d.ts +17 -0
- package/dist/chains/xlayer/eip7702/volume-single-round.js +44 -0
- package/dist/chains/xlayer/eip7702/volume-swap.d.ts +18 -0
- package/dist/chains/xlayer/eip7702/volume-swap.js +30 -0
- package/dist/chains/xlayer/eip7702/volume-wash.d.ts +8 -0
- package/dist/chains/xlayer/eip7702/volume-wash.js +191 -0
- package/dist/chains/xlayer/eip7702/volume.d.ts +7 -35
- package/dist/chains/xlayer/eip7702/volume.js +5 -697
- package/dist/chains/xlayer/eip7702/wallet.d.ts +6 -0
- package/dist/chains/xlayer/eip7702/wallet.js +17 -0
- package/dist/chains/xlayer/eoa/aa-types.d.ts +176 -0
- package/dist/chains/xlayer/eoa/aa-types.js +6 -0
- package/dist/chains/xlayer/eoa/constants.d.ts +0 -2
- package/dist/chains/xlayer/eoa/constants.js +0 -2
- package/dist/chains/xlayer/eoa/context.d.ts +8 -0
- package/dist/chains/xlayer/eoa/context.js +23 -0
- package/dist/chains/xlayer/eoa/encoders.d.ts +147 -0
- package/dist/chains/xlayer/eoa/encoders.js +147 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-cross.d.ts +5 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-cross.js +113 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +10 -123
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +10 -225
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-pure.d.ts +50 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-pure.js +170 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-quick.d.ts +5 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-quick.js +257 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-types.d.ts +99 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-types.js +11 -0
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.d.ts +5 -47
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.js +3 -522
- package/dist/chains/xlayer/eoa/eoa-types.d.ts +776 -0
- package/dist/chains/xlayer/eoa/eoa-types.js +6 -0
- package/dist/chains/xlayer/eoa/eoa-wash-volume.d.ts +8 -0
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +8 -0
- package/dist/chains/xlayer/eoa/format.d.ts +34 -0
- package/dist/chains/xlayer/eoa/format.js +56 -0
- package/dist/chains/xlayer/eoa/hop-chain.d.ts +4 -0
- package/dist/chains/xlayer/eoa/hop-chain.js +87 -0
- package/dist/chains/xlayer/eoa/nonce-map.d.ts +20 -0
- package/dist/chains/xlayer/eoa/nonce-map.js +51 -0
- package/dist/chains/xlayer/eoa/portal-ops.d.ts +9 -292
- package/dist/chains/xlayer/eoa/portal-ops.js +9 -486
- package/dist/chains/xlayer/eoa/query.d.ts +117 -0
- package/dist/chains/xlayer/eoa/query.js +285 -0
- package/dist/chains/xlayer/eoa/quote.d.ts +6 -0
- package/dist/chains/xlayer/eoa/quote.js +90 -0
- package/dist/chains/xlayer/eoa/types.d.ts +9 -959
- package/dist/chains/xlayer/eoa/types.js +9 -49
- package/dist/core/clients/blockrazor.js +1 -1
- package/dist/core/clients/merkle.js +1 -1
- package/dist/core/erc20/allowances.d.ts +104 -0
- package/dist/core/erc20/allowances.js +205 -0
- package/dist/core/erc20/approve.d.ts +141 -0
- package/dist/core/erc20/approve.js +325 -0
- package/dist/core/erc20/helpers.d.ts +20 -0
- package/dist/core/erc20/helpers.js +109 -0
- package/dist/core/erc20/index.d.ts +13 -0
- package/dist/core/erc20/index.js +12 -0
- package/dist/core/gas/bundle-gas.d.ts +6 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/quote/index.d.ts +1 -0
- package/dist/core/quote/index.js +1 -0
- package/dist/core/quote/quote-helpers.d.ts +78 -0
- package/dist/core/quote/quote-helpers.js +289 -0
- package/dist/core/quote/types.d.ts +1 -0
- package/dist/core/quote/types.js +1 -0
- package/dist/core/sign-context-helpers.d.ts +29 -0
- package/dist/core/sign-context-helpers.js +63 -0
- package/dist/domains/dex/direct-router-helpers.d.ts +16 -268
- package/dist/domains/dex/direct-router-helpers.js +16 -535
- package/dist/domains/dex/direct-router-types.d.ts +104 -0
- package/dist/domains/dex/direct-router-types.js +81 -0
- package/dist/domains/dex/direct-router-v2-buy.d.ts +2 -0
- package/dist/domains/dex/direct-router-v2-buy.js +249 -0
- package/dist/domains/dex/direct-router-v2-sell.d.ts +5 -0
- package/dist/domains/dex/direct-router-v2-sell.js +270 -0
- package/dist/domains/dex/direct-router-v2.d.ts +9 -0
- package/dist/domains/dex/direct-router-v2.js +9 -0
- package/dist/domains/dex/direct-router-v3.d.ts +17 -0
- package/dist/domains/dex/direct-router-v3.js +432 -0
- package/dist/domains/dex/direct-router.d.ts +11 -26
- package/dist/domains/dex/direct-router.js +10 -977
- package/dist/domains/dex/dyo-encode.d.ts +62 -0
- package/dist/domains/dex/dyo-encode.js +124 -0
- package/dist/domains/dex/profit.d.ts +24 -0
- package/dist/domains/dex/profit.js +86 -0
- package/dist/domains/dex/provider.d.ts +10 -0
- package/dist/domains/dex/provider.js +27 -0
- package/dist/domains/dex/quote.d.ts +7 -0
- package/dist/domains/dex/quote.js +52 -0
- package/dist/domains/dex/router.d.ts +56 -0
- package/dist/domains/dex/router.js +193 -0
- package/dist/domains/flap/portal-bundle/batch.d.ts +9 -0
- package/dist/domains/flap/portal-bundle/batch.js +193 -0
- package/dist/domains/flap/portal-bundle/create.d.ts +5 -0
- package/dist/domains/flap/portal-bundle/create.js +153 -0
- package/dist/domains/flap/portal-bundle/helpers.d.ts +32 -0
- package/dist/domains/flap/portal-bundle/helpers.js +50 -0
- package/dist/domains/flap/portal-bundle/index.d.ts +16 -0
- package/dist/domains/flap/portal-bundle/index.js +15 -0
- package/dist/domains/flap/portal-bundle/private.d.ts +5 -0
- package/dist/domains/flap/portal-bundle/private.js +198 -0
- package/dist/domains/flap/portal-bundle/types.d.ts +102 -0
- package/dist/domains/flap/portal-bundle/types.js +1 -0
- package/dist/domains/flap/portal-bundle-merkle/core-batch.d.ts +13 -0
- package/dist/domains/flap/portal-bundle-merkle/core-batch.js +376 -0
- package/dist/domains/flap/portal-bundle-merkle/core-helpers.d.ts +75 -7
- package/dist/domains/flap/portal-bundle-merkle/core-helpers.js +259 -20
- package/dist/domains/flap/portal-bundle-merkle/core.d.ts +2 -13
- package/dist/domains/flap/portal-bundle-merkle/core.js +12 -629
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/constants.d.ts +70 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/constants.js +90 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/index.d.ts +12 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/index.js +11 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/main.d.ts +15 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/main.js +432 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/types.d.ts +113 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex/types.js +4 -0
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex.d.ts +4 -127
- package/dist/domains/flap/portal-bundle-merkle/create-to-dex.js +4 -527
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/constants.d.ts +42 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/constants.js +81 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/index.d.ts +12 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/index.js +11 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/main.d.ts +15 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/main.js +339 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/types.d.ts +72 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex/types.js +4 -0
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex.d.ts +4 -85
- package/dist/domains/flap/portal-bundle-merkle/curve-to-dex.js +4 -425
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/approve.d.ts +12 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/approve.js +102 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/buy.d.ts +5 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/buy.js +135 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.d.ts +52 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.js +267 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/index.d.ts +14 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/index.js +14 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/sell.d.ts +5 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/sell.js +195 -0
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy.d.ts +3 -24
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy.js +3 -700
- package/dist/domains/flap/portal-bundle-merkle/private/buy.d.ts +9 -0
- package/dist/domains/flap/portal-bundle-merkle/private/buy.js +188 -0
- package/dist/domains/flap/portal-bundle-merkle/private/helpers.d.ts +36 -0
- package/dist/domains/flap/portal-bundle-merkle/private/helpers.js +127 -0
- package/dist/domains/flap/portal-bundle-merkle/private/index.d.ts +12 -0
- package/dist/domains/flap/portal-bundle-merkle/private/index.js +12 -0
- package/dist/domains/flap/portal-bundle-merkle/private/sell.d.ts +9 -0
- package/dist/domains/flap/portal-bundle-merkle/private/sell.js +191 -0
- package/dist/domains/flap/portal-bundle-merkle/private.d.ts +5 -15
- package/dist/domains/flap/portal-bundle-merkle/private.js +5 -494
- package/dist/domains/flap/portal-bundle-merkle/swap-batch.js +3 -2
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-chain.d.ts +4 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-chain.js +43 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-constants.d.ts +13 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-constants.js +21 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +11 -121
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-helpers.js +11 -109
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-multi-wallet.d.ts +20 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-multi-wallet.js +223 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-plan.d.ts +32 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-plan.js +66 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-profit.d.ts +22 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-profit.js +22 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-quote.d.ts +51 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-quote.js +149 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-types.d.ts +87 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first-types.js +1 -0
- package/dist/domains/flap/portal-bundle-merkle/swap-buy-first.js +5 -404
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.d.ts +0 -1
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.js +0 -7
- package/dist/domains/flap/portal-bundle-merkle/swap-planning.js +1 -1
- package/dist/domains/flap/portal-bundle-merkle/swap-quick-batch.js +3 -2
- package/dist/domains/flap/portal-bundle-merkle/swap-single.js +3 -2
- package/dist/domains/flap/portal-bundle-merkle/utils/disperse.d.ts +2 -0
- package/dist/domains/flap/portal-bundle-merkle/utils/disperse.js +275 -0
- package/dist/domains/flap/portal-bundle-merkle/utils/index.d.ts +11 -0
- package/dist/domains/flap/portal-bundle-merkle/utils/index.js +11 -0
- package/dist/domains/flap/portal-bundle-merkle/utils/sweep.d.ts +9 -0
- package/dist/domains/flap/portal-bundle-merkle/utils/sweep.js +570 -0
- package/dist/domains/flap/portal-bundle-merkle/utils.d.ts +5 -8
- package/dist/domains/flap/portal-bundle-merkle/utils.js +5 -841
- package/dist/domains/flap/portal-bundle.d.ts +5 -117
- package/dist/domains/flap/portal-bundle.js +5 -587
- package/dist/domains/flap/portal.d.ts +13 -404
- package/dist/domains/flap/portal.js +12 -619
- package/dist/domains/flap/reader.d.ts +51 -0
- package/dist/domains/flap/reader.js +275 -0
- package/dist/domains/flap/types.d.ts +246 -0
- package/dist/domains/flap/types.js +104 -0
- package/dist/domains/flap/vault/constants.d.ts +220 -0
- package/dist/domains/flap/vault/constants.js +173 -0
- package/dist/domains/flap/vault/encode.d.ts +39 -0
- package/dist/domains/flap/vault/encode.js +135 -0
- package/dist/domains/flap/vault/index.d.ts +15 -0
- package/dist/domains/flap/vault/index.js +14 -0
- package/dist/domains/flap/vault/query.d.ts +40 -0
- package/dist/domains/flap/vault/query.js +104 -0
- package/dist/domains/flap/vault/types.d.ts +147 -0
- package/dist/domains/flap/vault/types.js +29 -0
- package/dist/domains/flap/vault.d.ts +3 -413
- package/dist/domains/flap/vault.js +3 -467
- package/dist/domains/flap/writer.d.ts +124 -0
- package/dist/domains/flap/writer.js +255 -0
- package/dist/domains/four/contracts/tm-bundle-batch.d.ts +35 -0
- package/dist/domains/four/contracts/tm-bundle-batch.js +286 -0
- package/dist/domains/four/contracts/tm-bundle-create.d.ts +2 -0
- package/dist/domains/four/contracts/tm-bundle-create.js +304 -0
- package/dist/domains/four/contracts/tm-bundle-helpers.d.ts +2 -1
- package/dist/domains/four/contracts/tm-bundle-helpers.js +3 -0
- package/dist/domains/four/contracts/tm-bundle-private.d.ts +36 -0
- package/dist/domains/four/contracts/tm-bundle-private.js +164 -0
- package/dist/domains/four/contracts/tm-bundle.d.ts +10 -71
- package/dist/domains/four/contracts/tm-bundle.js +9 -738
- package/dist/domains/lp-inspect/inspect-helpers.d.ts +25 -0
- package/dist/domains/lp-inspect/inspect-helpers.js +343 -0
- package/dist/domains/lp-inspect/inspect.d.ts +8 -0
- package/dist/domains/lp-inspect/inspect.js +332 -0
- package/dist/domains/lp-inspect/lp-inspect.d.ts +9 -37
- package/dist/domains/lp-inspect/lp-inspect.js +9 -775
- package/dist/domains/lp-inspect/registry.d.ts +43 -0
- package/dist/domains/lp-inspect/registry.js +127 -0
- package/dist/domains/merkle/index.d.ts +1 -1
- package/dist/exports/root-bundle-and-tooling.d.ts +9 -1
- package/dist/exports/root-bundle-and-tooling.js +8 -1
- package/dist/exports/root-foundations.d.ts +1 -1
- package/dist/exports/root-foundations.js +1 -1
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +4 -4
- package/dist/exports/root-swap-dex-and-xlayer.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/swap-helpers.js +1 -1
- package/package.json +1 -81
|
@@ -1,597 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* multi-hop-transfer - 主函数
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export async function disperse(params) {
|
|
10
|
-
const { mainPrivateKey, payerPrivateKey, recipients, amounts, tokenAddress, tokenDecimals = 18, hopCount = 0, userType, config, } = params;
|
|
11
|
-
if (recipients.length !== amounts.length) {
|
|
12
|
-
throw new Error('recipients 和 amounts 长度必须相同');
|
|
13
|
-
}
|
|
14
|
-
const { provider, delegateAddress, delegateInterface, profitRecipient } = createEip7702DelegateContext(config);
|
|
15
|
-
const { mainWallet, payerWallet, txSender } = resolveDispersePayerWallets(mainPrivateKey, payerPrivateKey, provider);
|
|
16
|
-
const isNative = isNativeTransferToken(tokenAddress);
|
|
17
|
-
const { allHopWalletInfos, allHopWallets } = generateHopWalletMatrix(recipients.length, hopCount, provider);
|
|
18
|
-
const amountsWei = parseTransferAmountsWei(amounts, isNative, tokenDecimals);
|
|
19
|
-
const totalAmount = amountsWei.reduce((sum, amt) => sum + amt, 0n);
|
|
20
|
-
// ✅ 按地址数量收取固定费用(原生 OKB)
|
|
21
|
-
const profitAmountOkb = calculateTransferFee(XLAYER_CHAIN_ID, recipients.length);
|
|
22
|
-
// ========================================
|
|
23
|
-
// 并行获取数据
|
|
24
|
-
// ========================================
|
|
25
|
-
const addressesToGetNonces = payerWallet ? [payerWallet.address, mainWallet.address] : [mainWallet.address];
|
|
26
|
-
const [allNoncesResult, feeData] = await Promise.all([
|
|
27
|
-
batchGetNonces(addressesToGetNonces, provider),
|
|
28
|
-
provider.getFeeData(),
|
|
29
|
-
]);
|
|
30
|
-
const payerNonce = payerWallet ? allNoncesResult[0] : allNoncesResult[0];
|
|
31
|
-
const mainNonce = payerWallet ? allNoncesResult[1] : allNoncesResult[0];
|
|
32
|
-
// ========================================
|
|
33
|
-
// 同步签署授权(已有 nonce)
|
|
34
|
-
// ========================================
|
|
35
|
-
// ✅ 如果有 Payer,需要为 Payer 和 mainWallet 都生成授权
|
|
36
|
-
const allWallets = payerWallet ? [payerWallet, mainWallet] : [mainWallet];
|
|
37
|
-
const allNonces = payerWallet ? [payerNonce, mainNonce] : [mainNonce];
|
|
38
|
-
for (const hopWallets of allHopWallets) {
|
|
39
|
-
for (const hopWallet of hopWallets) {
|
|
40
|
-
allWallets.push(hopWallet);
|
|
41
|
-
allNonces.push(0);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const authorizations = signAuthorizationsWithNonces(allWallets, allNonces, delegateAddress, 0);
|
|
45
|
-
// ========================================
|
|
46
|
-
// 同步构建调用
|
|
47
|
-
// ========================================
|
|
48
|
-
const calls = [];
|
|
49
|
-
for (let i = 0; i < recipients.length; i++) {
|
|
50
|
-
const recipient = recipients[i];
|
|
51
|
-
const amtWei = amountsWei[i];
|
|
52
|
-
const hopWallets = allHopWallets[i];
|
|
53
|
-
if (hopCount === 0 || hopWallets.length === 0) {
|
|
54
|
-
// ========================================
|
|
55
|
-
// 直接分发:主钱包 → 接收者
|
|
56
|
-
// ========================================
|
|
57
|
-
if (isNative) {
|
|
58
|
-
// ✅ Payer 模式:使用 transferAmount(从 mainWallet 余额转出)
|
|
59
|
-
// ✅ 非 Payer 模式:使用 transferTo(从 msg.value 转出)
|
|
60
|
-
if (payerWallet) {
|
|
61
|
-
calls.push({
|
|
62
|
-
target: mainWallet.address,
|
|
63
|
-
allowFailure: false,
|
|
64
|
-
value: 0n,
|
|
65
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [recipient, amtWei]),
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
calls.push({
|
|
70
|
-
target: mainWallet.address,
|
|
71
|
-
allowFailure: false,
|
|
72
|
-
value: amtWei,
|
|
73
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [recipient]),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
calls.push({
|
|
79
|
-
target: mainWallet.address,
|
|
80
|
-
allowFailure: false,
|
|
81
|
-
value: 0n,
|
|
82
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, recipient, amtWei]),
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
// ========================================
|
|
88
|
-
// 多跳分发:主钱包 → hop1 → hop2 → ... → 接收者
|
|
89
|
-
// ========================================
|
|
90
|
-
const firstHop = hopWallets[0];
|
|
91
|
-
const lastHop = hopWallets[hopWallets.length - 1];
|
|
92
|
-
if (isNative) {
|
|
93
|
-
// 主钱包 → 第一个中间钱包
|
|
94
|
-
// ✅ Payer 模式:使用 transferAmount(从 mainWallet 余额转出)
|
|
95
|
-
if (payerWallet) {
|
|
96
|
-
calls.push({
|
|
97
|
-
target: mainWallet.address,
|
|
98
|
-
allowFailure: false,
|
|
99
|
-
value: 0n,
|
|
100
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [firstHop.address, amtWei]),
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
calls.push({
|
|
105
|
-
target: mainWallet.address,
|
|
106
|
-
allowFailure: false,
|
|
107
|
-
value: amtWei,
|
|
108
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [firstHop.address]),
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
// 中间钱包之间转账(使用全部余额)
|
|
112
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
113
|
-
calls.push({
|
|
114
|
-
target: hopWallets[j].address,
|
|
115
|
-
allowFailure: false,
|
|
116
|
-
value: 0n,
|
|
117
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [hopWallets[j + 1].address]),
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
// 最后一个中间钱包 → 接收者(使用全部余额)
|
|
121
|
-
calls.push({
|
|
122
|
-
target: lastHop.address,
|
|
123
|
-
allowFailure: false,
|
|
124
|
-
value: 0n,
|
|
125
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [recipient]),
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// ERC20 多跳
|
|
130
|
-
// 主钱包 → 第一个中间钱包
|
|
131
|
-
calls.push({
|
|
132
|
-
target: mainWallet.address,
|
|
133
|
-
allowFailure: false,
|
|
134
|
-
value: 0n,
|
|
135
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, firstHop.address, amtWei]),
|
|
136
|
-
});
|
|
137
|
-
// 中间钱包之间转账
|
|
138
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
139
|
-
calls.push({
|
|
140
|
-
target: hopWallets[j].address,
|
|
141
|
-
allowFailure: false,
|
|
142
|
-
value: 0n,
|
|
143
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [
|
|
144
|
-
tokenAddress,
|
|
145
|
-
hopWallets[j + 1].address,
|
|
146
|
-
]),
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
// 最后一个中间钱包 → 接收者
|
|
150
|
-
calls.push({
|
|
151
|
-
target: lastHop.address,
|
|
152
|
-
allowFailure: false,
|
|
153
|
-
value: 0n,
|
|
154
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [tokenAddress, recipient]),
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// ========================================
|
|
160
|
-
// 添加利润转账调用(固定费用,OKB)
|
|
161
|
-
// ========================================
|
|
162
|
-
if (profitAmountOkb > 0n) {
|
|
163
|
-
calls.push({
|
|
164
|
-
target: mainWallet.address,
|
|
165
|
-
allowFailure: false,
|
|
166
|
-
value: 0n,
|
|
167
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [profitRecipient, profitAmountOkb]),
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
// ========================================
|
|
171
|
-
// 构建交易
|
|
172
|
-
// ========================================
|
|
173
|
-
// ✅ Payer 模式下 value 为 0(资金从 mainWallet 转出,不是 Payer)
|
|
174
|
-
// 无 Payer 时,原生币分发需要传递 value(资金从 txSender 转出)
|
|
175
|
-
const totalValue = isNative && !payerWallet ? totalAmount : 0n;
|
|
176
|
-
const signedTransaction = buildEIP7702TransactionSync(txSender, // ✅ 使用 txSender(Payer 或 mainWallet)发起交易
|
|
177
|
-
authorizations, calls, totalValue, payerNonce, // ✅ 使用 txSender 的 nonce
|
|
178
|
-
feeData, config);
|
|
179
|
-
// ✅ 返回所有中间钱包(扁平化)
|
|
180
|
-
const flatHopWallets = allHopWalletInfos.flat();
|
|
181
|
-
return {
|
|
182
|
-
signedTransaction,
|
|
183
|
-
hopWallets: flatHopWallets.length > 0 ? flatHopWallets : undefined,
|
|
184
|
-
metadata: {
|
|
185
|
-
senderAddress: mainWallet.address, // 资金来源
|
|
186
|
-
payerAddress: txSender.address, // Gas 支付者
|
|
187
|
-
recipientCount: recipients.length,
|
|
188
|
-
totalAmount: isNative ? ethers.formatEther(totalAmount) : ethers.formatUnits(totalAmount, tokenDecimals),
|
|
189
|
-
profitAmount: ethers.formatEther(profitAmountOkb), // ✅ 以 OKB 计
|
|
190
|
-
isNative,
|
|
191
|
-
tokenAddress: tokenAddress ?? null,
|
|
192
|
-
hopCount,
|
|
193
|
-
userType,
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
// ========================================
|
|
198
|
-
// 归集 (Sweep) - 多对一
|
|
199
|
-
// ========================================
|
|
200
|
-
export async function sweep(params) {
|
|
201
|
-
const { targetAddress, sourcePrivateKeys, payerPrivateKey, tokenAddress, tokenDecimals = 18, hopCount = 0, reserveGas = true, percent = 100, userType, config, } = params;
|
|
202
|
-
const { provider, delegateAddress, delegateInterface, profitRecipient } = createEip7702DelegateContext(config);
|
|
203
|
-
const sourceWallets = sourcePrivateKeys.map((pk) => createWallet(pk, provider));
|
|
204
|
-
const isNative = isNativeTransferToken(tokenAddress);
|
|
205
|
-
const { allHopWalletInfos, allHopWallets } = generateHopWalletMatrix(sourceWallets.length, hopCount, provider);
|
|
206
|
-
const { payerWallet } = resolveListPayerWallet(sourcePrivateKeys, payerPrivateKey, provider);
|
|
207
|
-
const mainWallet = payerWallet ?? sourceWallets[0];
|
|
208
|
-
// ========================================
|
|
209
|
-
// 并行获取数据
|
|
210
|
-
// ========================================
|
|
211
|
-
const sourceAddresses = sourceWallets.map((w) => w.address);
|
|
212
|
-
const addressesToGetNonces = payerWallet ? [payerWallet.address, ...sourceAddresses] : sourceAddresses;
|
|
213
|
-
const [allNoncesResult, feeData, balancesRaw] = await Promise.all([
|
|
214
|
-
batchGetNonces(addressesToGetNonces, provider),
|
|
215
|
-
provider.getFeeData(),
|
|
216
|
-
isNative
|
|
217
|
-
? Promise.all(sourceWallets.map((w) => provider.getBalance(w.address)))
|
|
218
|
-
: Promise.all(sourceWallets.map((w) => {
|
|
219
|
-
if (!tokenAddress)
|
|
220
|
-
throw new Error('tokenAddress is required for ERC20 sweep');
|
|
221
|
-
const tokenContract = new Contract(tokenAddress, ERC20_ABI, provider);
|
|
222
|
-
return tokenContract.balanceOf(w.address);
|
|
223
|
-
})),
|
|
224
|
-
]);
|
|
225
|
-
const payerNonce = payerWallet ? allNoncesResult[0] : allNoncesResult[0];
|
|
226
|
-
const nonces = payerWallet ? allNoncesResult.slice(1) : allNoncesResult;
|
|
227
|
-
const balances = balancesRaw;
|
|
228
|
-
// 计算转账金额
|
|
229
|
-
// ✅ 修复:当 percent=100 时,不预留 gas,归集全部余额
|
|
230
|
-
const isFullSweep = percent >= 100;
|
|
231
|
-
const gasReserve = reserveGas && isNative && !isFullSweep ? ethers.parseEther('0.001') : 0n;
|
|
232
|
-
const percentBigInt = BigInt(Math.min(100, Math.max(1, percent)));
|
|
233
|
-
const transferAmounts = balances.map((b) => {
|
|
234
|
-
if (isFullSweep) {
|
|
235
|
-
// 100% 归集:使用全部余额
|
|
236
|
-
return b;
|
|
237
|
-
}
|
|
238
|
-
const afterReserve = b > gasReserve ? b - gasReserve : 0n;
|
|
239
|
-
return (afterReserve * percentBigInt) / 100n;
|
|
240
|
-
});
|
|
241
|
-
const totalAmount = transferAmounts.reduce((sum, amt) => sum + amt, 0n);
|
|
242
|
-
// ✅ 按地址数量收取固定费用(原生 OKB)
|
|
243
|
-
const profitAmountOkb = calculateTransferFee(XLAYER_CHAIN_ID, sourceWallets.length);
|
|
244
|
-
// ✅ 找出归集金额最大的钱包(用于支付 OKB 利润)
|
|
245
|
-
let maxSweepIndex = -1;
|
|
246
|
-
let maxSweepAmount = 0n;
|
|
247
|
-
for (let i = 0; i < transferAmounts.length; i++) {
|
|
248
|
-
if (transferAmounts[i] > maxSweepAmount) {
|
|
249
|
-
maxSweepAmount = transferAmounts[i];
|
|
250
|
-
maxSweepIndex = i;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
// ========================================
|
|
254
|
-
// 构建调用
|
|
255
|
-
// ========================================
|
|
256
|
-
const calls = [];
|
|
257
|
-
for (let i = 0; i < sourceWallets.length; i++) {
|
|
258
|
-
const sourceWallet = sourceWallets[i];
|
|
259
|
-
const amount = transferAmounts[i];
|
|
260
|
-
const hopWallets = allHopWallets[i];
|
|
261
|
-
if (amount <= 0n)
|
|
262
|
-
continue;
|
|
263
|
-
// ✅ 使用 Payer 时所有源钱包都用自己的余额(value: 0n)
|
|
264
|
-
const callValue = payerWallet || i > 0 ? 0n : amount;
|
|
265
|
-
if (hopCount === 0 || hopWallets.length === 0) {
|
|
266
|
-
// ========================================
|
|
267
|
-
// 直接归集:源钱包 → 目标地址
|
|
268
|
-
// ========================================
|
|
269
|
-
// ✅ 最大归集钱包负责转 OKB 固定费用
|
|
270
|
-
if (profitAmountOkb > 0n && i === maxSweepIndex) {
|
|
271
|
-
calls.push({
|
|
272
|
-
target: sourceWallet.address,
|
|
273
|
-
allowFailure: false,
|
|
274
|
-
value: 0n,
|
|
275
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [profitRecipient, profitAmountOkb]),
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
if (isNative) {
|
|
279
|
-
// ✅ 原生 OKB 归集
|
|
280
|
-
calls.push({
|
|
281
|
-
target: sourceWallet.address,
|
|
282
|
-
allowFailure: false,
|
|
283
|
-
value: callValue,
|
|
284
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [targetAddress, amount]),
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
// ✅ ERC20 归集
|
|
289
|
-
calls.push({
|
|
290
|
-
target: sourceWallet.address,
|
|
291
|
-
allowFailure: false,
|
|
292
|
-
value: 0n,
|
|
293
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, targetAddress, amount]),
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
// ========================================
|
|
299
|
-
// 多跳归集:源钱包 → hop1 → hop2 → ... → 目标地址
|
|
300
|
-
// ========================================
|
|
301
|
-
const firstHop = hopWallets[0];
|
|
302
|
-
const lastHop = hopWallets[hopWallets.length - 1];
|
|
303
|
-
// ✅ 最大归集钱包负责转 OKB 固定费用(在归集前)
|
|
304
|
-
if (profitAmountOkb > 0n && i === maxSweepIndex) {
|
|
305
|
-
calls.push({
|
|
306
|
-
target: sourceWallet.address,
|
|
307
|
-
allowFailure: false,
|
|
308
|
-
value: 0n,
|
|
309
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [profitRecipient, profitAmountOkb]),
|
|
310
|
-
});
|
|
311
|
-
}
|
|
312
|
-
if (isNative) {
|
|
313
|
-
// 源钱包 → 第一个中间钱包
|
|
314
|
-
// ✅ 修复:使用 transferAmount 替代 transferTo,支持百分比归集
|
|
315
|
-
calls.push({
|
|
316
|
-
target: sourceWallet.address,
|
|
317
|
-
allowFailure: false,
|
|
318
|
-
value: callValue,
|
|
319
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [firstHop.address, amount]),
|
|
320
|
-
});
|
|
321
|
-
// 中间钱包之间转账
|
|
322
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
323
|
-
calls.push({
|
|
324
|
-
target: hopWallets[j].address,
|
|
325
|
-
allowFailure: false,
|
|
326
|
-
value: 0n,
|
|
327
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [hopWallets[j + 1].address]),
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
// 最后一个中间钱包 → 目标地址
|
|
331
|
-
calls.push({
|
|
332
|
-
target: lastHop.address,
|
|
333
|
-
allowFailure: false,
|
|
334
|
-
value: 0n,
|
|
335
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [targetAddress]),
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
// ERC20 多跳
|
|
340
|
-
// 源钱包 → 第一个中间钱包(ERC20 代币)
|
|
341
|
-
calls.push({
|
|
342
|
-
target: sourceWallet.address,
|
|
343
|
-
allowFailure: false,
|
|
344
|
-
value: 0n,
|
|
345
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, firstHop.address, amount]),
|
|
346
|
-
});
|
|
347
|
-
// 中间钱包之间转账
|
|
348
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
349
|
-
calls.push({
|
|
350
|
-
target: hopWallets[j].address,
|
|
351
|
-
allowFailure: false,
|
|
352
|
-
value: 0n,
|
|
353
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [
|
|
354
|
-
tokenAddress,
|
|
355
|
-
hopWallets[j + 1].address,
|
|
356
|
-
]),
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
// 最后一个中间钱包 → 目标地址
|
|
360
|
-
calls.push({
|
|
361
|
-
target: lastHop.address,
|
|
362
|
-
allowFailure: false,
|
|
363
|
-
value: 0n,
|
|
364
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [tokenAddress, targetAddress]),
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
// ========================================
|
|
370
|
-
// 同步签署授权(已有 nonce)
|
|
371
|
-
// ========================================
|
|
372
|
-
// ✅ 收集所有需要授权的钱包
|
|
373
|
-
const allWallets = payerWallet ? [payerWallet] : [];
|
|
374
|
-
const allNonces = payerWallet ? [payerNonce] : [];
|
|
375
|
-
// 添加源钱包
|
|
376
|
-
for (let i = 0; i < sourceWallets.length; i++) {
|
|
377
|
-
allWallets.push(sourceWallets[i]);
|
|
378
|
-
allNonces.push(nonces[i]);
|
|
379
|
-
}
|
|
380
|
-
// 添加所有中间钱包
|
|
381
|
-
for (const hopWallets of allHopWallets) {
|
|
382
|
-
for (const hopWallet of hopWallets) {
|
|
383
|
-
allWallets.push(hopWallet);
|
|
384
|
-
allNonces.push(0);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
const authorizations = signAuthorizationsWithNonces(allWallets, allNonces, delegateAddress, 0);
|
|
388
|
-
// ========================================
|
|
389
|
-
// 同步构建交易
|
|
390
|
-
// ========================================
|
|
391
|
-
// ✅ Payer 模式下 value 为 0(资金来自源钱包)
|
|
392
|
-
const totalValue = isNative && !payerWallet ? transferAmounts[0] : 0n;
|
|
393
|
-
const signedTransaction = buildEIP7702TransactionSync(mainWallet, authorizations, calls, totalValue, payerWallet ? payerNonce : nonces[0], feeData, config);
|
|
394
|
-
// ✅ 返回所有中间钱包(扁平化)
|
|
395
|
-
const flatHopWallets = allHopWalletInfos.flat();
|
|
396
|
-
return {
|
|
397
|
-
signedTransaction,
|
|
398
|
-
hopWallets: flatHopWallets.length > 0 ? flatHopWallets : undefined,
|
|
399
|
-
metadata: {
|
|
400
|
-
targetAddress,
|
|
401
|
-
sourceCount: sourceWallets.length,
|
|
402
|
-
totalAmount: isNative ? ethers.formatEther(totalAmount) : ethers.formatUnits(totalAmount, tokenDecimals),
|
|
403
|
-
profitAmount: ethers.formatEther(profitAmountOkb), // ✅ 以 OKB 计
|
|
404
|
-
isNative,
|
|
405
|
-
tokenAddress: tokenAddress ?? null,
|
|
406
|
-
hopCount,
|
|
407
|
-
percent,
|
|
408
|
-
userType,
|
|
409
|
-
},
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
// ========================================
|
|
413
|
-
// 多对多 (Pairwise) - sender[i] → receiver[i]
|
|
414
|
-
// ========================================
|
|
415
|
-
export async function pairwiseTransfer(params) {
|
|
416
|
-
const { senderPrivateKeys, receiverAddresses, payerPrivateKey, amount, amounts, tokenAddress, tokenDecimals = 18, hopCount = 0, userType, config, } = params;
|
|
417
|
-
// 验证参数
|
|
418
|
-
if (senderPrivateKeys.length !== receiverAddresses.length) {
|
|
419
|
-
throw new Error(`senderPrivateKeys 长度 (${senderPrivateKeys.length}) 必须与 receiverAddresses 长度 (${receiverAddresses.length}) 相同`);
|
|
420
|
-
}
|
|
421
|
-
const pairCount = senderPrivateKeys.length;
|
|
422
|
-
if (pairCount === 0) {
|
|
423
|
-
throw new Error('至少需要一对发送者/接收者');
|
|
424
|
-
}
|
|
425
|
-
const normalizedAmounts = normalizePairwiseAmounts(pairCount, amount, amounts);
|
|
426
|
-
const { provider, delegateAddress, delegateInterface, profitRecipient } = createEip7702DelegateContext(config);
|
|
427
|
-
const isNative = isNativeTransferToken(tokenAddress);
|
|
428
|
-
const senderWallets = senderPrivateKeys.map((pk) => createWallet(pk, provider));
|
|
429
|
-
const { payerWallet } = resolveListPayerWallet(senderPrivateKeys, payerPrivateKey, provider);
|
|
430
|
-
const mainWallet = payerWallet ?? senderWallets[0];
|
|
431
|
-
const { allHopWalletInfos, allHopWallets } = generateHopWalletMatrix(pairCount, hopCount, provider);
|
|
432
|
-
const amountsWei = parseTransferAmountsWei(normalizedAmounts, isNative, tokenDecimals);
|
|
433
|
-
const totalAmount = amountsWei.reduce((sum, amt) => sum + amt, 0n);
|
|
434
|
-
// ✅ 按地址数量收取固定费用(原生 OKB)
|
|
435
|
-
const profitAmountOkb = calculateTransferFee(XLAYER_CHAIN_ID, pairCount);
|
|
436
|
-
// ✅ 使用第一个发送者支付 OKB 利润
|
|
437
|
-
const maxTransferIndex = 0;
|
|
438
|
-
// ========================================
|
|
439
|
-
// 并行获取数据
|
|
440
|
-
// ========================================
|
|
441
|
-
const senderAddresses = senderWallets.map((w) => w.address);
|
|
442
|
-
const addressesToGetNonces = payerWallet ? [payerWallet.address, ...senderAddresses] : senderAddresses;
|
|
443
|
-
const [allNoncesResult, feeData] = await Promise.all([
|
|
444
|
-
batchGetNonces(addressesToGetNonces, provider),
|
|
445
|
-
provider.getFeeData(),
|
|
446
|
-
]);
|
|
447
|
-
// 如果有单独的 Payer,第一个是 Payer 的 nonce,其余是发送者的
|
|
448
|
-
const payerNonce = payerWallet ? allNoncesResult[0] : allNoncesResult[0];
|
|
449
|
-
const nonces = payerWallet ? allNoncesResult.slice(1) : allNoncesResult;
|
|
450
|
-
// ========================================
|
|
451
|
-
// 构建调用
|
|
452
|
-
// ========================================
|
|
453
|
-
const calls = [];
|
|
454
|
-
for (let i = 0; i < pairCount; i++) {
|
|
455
|
-
const senderWallet = senderWallets[i];
|
|
456
|
-
const receiver = receiverAddresses[i];
|
|
457
|
-
const amtWei = amountsWei[i];
|
|
458
|
-
const hopWallets = allHopWallets[i];
|
|
459
|
-
// ✅ 如果有单独的 Payer,发送者使用自己的余额(value: 0n, 由 transferTo 使用 address(this).balance)
|
|
460
|
-
// ✅ 如果没有 Payer 且是第一个发送者(发起交易),需要传递 value
|
|
461
|
-
const shouldPassValue = !payerWallet && i === 0;
|
|
462
|
-
if (hopCount === 0 || hopWallets.length === 0) {
|
|
463
|
-
// ========================================
|
|
464
|
-
// 直接转账:sender → receiver
|
|
465
|
-
// ========================================
|
|
466
|
-
// ✅ 第一个发送者负责转 OKB 固定费用
|
|
467
|
-
if (profitAmountOkb > 0n && i === maxTransferIndex) {
|
|
468
|
-
calls.push({
|
|
469
|
-
target: senderWallet.address,
|
|
470
|
-
allowFailure: false,
|
|
471
|
-
value: 0n,
|
|
472
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [profitRecipient, profitAmountOkb]),
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
if (isNative) {
|
|
476
|
-
calls.push({
|
|
477
|
-
target: senderWallet.address,
|
|
478
|
-
allowFailure: false,
|
|
479
|
-
value: shouldPassValue ? amtWei : 0n,
|
|
480
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [receiver, amtWei]),
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
// ERC20 代币转账
|
|
485
|
-
calls.push({
|
|
486
|
-
target: senderWallet.address,
|
|
487
|
-
allowFailure: false,
|
|
488
|
-
value: 0n,
|
|
489
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, receiver, amtWei]),
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
// ========================================
|
|
495
|
-
// 多跳转账:sender → hop1 → hop2 → ... → receiver
|
|
496
|
-
// ========================================
|
|
497
|
-
const firstHop = hopWallets[0];
|
|
498
|
-
const lastHop = hopWallets[hopWallets.length - 1];
|
|
499
|
-
// ✅ 第一个发送者负责转 OKB 固定费用(在转账前)
|
|
500
|
-
if (profitAmountOkb > 0n && i === maxTransferIndex) {
|
|
501
|
-
calls.push({
|
|
502
|
-
target: senderWallet.address,
|
|
503
|
-
allowFailure: false,
|
|
504
|
-
value: 0n,
|
|
505
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [profitRecipient, profitAmountOkb]),
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
if (isNative) {
|
|
509
|
-
// 原生 OKB 多跳
|
|
510
|
-
calls.push({
|
|
511
|
-
target: senderWallet.address,
|
|
512
|
-
allowFailure: false,
|
|
513
|
-
value: shouldPassValue ? amtWei : 0n,
|
|
514
|
-
callData: delegateInterface.encodeFunctionData('transferAmount', [firstHop.address, amtWei]),
|
|
515
|
-
});
|
|
516
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
517
|
-
calls.push({
|
|
518
|
-
target: hopWallets[j].address,
|
|
519
|
-
allowFailure: false,
|
|
520
|
-
value: 0n,
|
|
521
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [hopWallets[j + 1].address]),
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
calls.push({
|
|
525
|
-
target: lastHop.address,
|
|
526
|
-
allowFailure: false,
|
|
527
|
-
value: 0n,
|
|
528
|
-
callData: delegateInterface.encodeFunctionData('transferTo', [receiver]),
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
else {
|
|
532
|
-
// ERC20 多跳
|
|
533
|
-
// sender → 第一个中间钱包(ERC20 代币)
|
|
534
|
-
calls.push({
|
|
535
|
-
target: senderWallet.address,
|
|
536
|
-
allowFailure: false,
|
|
537
|
-
value: 0n,
|
|
538
|
-
callData: delegateInterface.encodeFunctionData('executeTransfer', [tokenAddress, firstHop.address, amtWei]),
|
|
539
|
-
});
|
|
540
|
-
// 中间钱包之间转账
|
|
541
|
-
for (let j = 0; j < hopWallets.length - 1; j++) {
|
|
542
|
-
calls.push({
|
|
543
|
-
target: hopWallets[j].address,
|
|
544
|
-
allowFailure: false,
|
|
545
|
-
value: 0n,
|
|
546
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [
|
|
547
|
-
tokenAddress,
|
|
548
|
-
hopWallets[j + 1].address,
|
|
549
|
-
]),
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
// 最后一个中间钱包 → receiver
|
|
553
|
-
calls.push({
|
|
554
|
-
target: lastHop.address,
|
|
555
|
-
allowFailure: false,
|
|
556
|
-
value: 0n,
|
|
557
|
-
callData: delegateInterface.encodeFunctionData('executeTransferAll', [tokenAddress, receiver]),
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
// ========================================
|
|
563
|
-
// 同步签署授权(已有 nonce)
|
|
564
|
-
// ========================================
|
|
565
|
-
// ✅ 如果有单独的 Payer,需要为 Payer 也生成授权
|
|
566
|
-
const allWallets = payerWallet ? [payerWallet, ...senderWallets] : [...senderWallets];
|
|
567
|
-
const allNonces = payerWallet ? [payerNonce, ...nonces] : [...nonces];
|
|
568
|
-
for (const hopWallets of allHopWallets) {
|
|
569
|
-
for (const hopWallet of hopWallets) {
|
|
570
|
-
allWallets.push(hopWallet);
|
|
571
|
-
allNonces.push(0);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
const authorizations = signAuthorizationsWithNonces(allWallets, allNonces, delegateAddress, 0);
|
|
575
|
-
// ========================================
|
|
576
|
-
// 同步构建交易
|
|
577
|
-
// ========================================
|
|
578
|
-
// ✅ Payer 模式下 value 为 0(资金来自发送者钱包)
|
|
579
|
-
const totalValue = isNative && !payerWallet ? totalAmount : 0n;
|
|
580
|
-
const signedTransaction = buildEIP7702TransactionSync(mainWallet, authorizations, calls, totalValue, payerWallet ? payerNonce : nonces[0], feeData, config);
|
|
581
|
-
return {
|
|
582
|
-
signedTransaction,
|
|
583
|
-
hopWallets: hopCount > 0 ? allHopWalletInfos : undefined,
|
|
584
|
-
metadata: {
|
|
585
|
-
pairCount,
|
|
586
|
-
totalAmount: isNative ? ethers.formatEther(totalAmount) : ethers.formatUnits(totalAmount, tokenDecimals),
|
|
587
|
-
profitAmount: ethers.formatEther(profitAmountOkb), // ✅ 以 OKB 计
|
|
588
|
-
isNative,
|
|
589
|
-
tokenAddress: tokenAddress ?? null,
|
|
590
|
-
hopCount,
|
|
591
|
-
userType,
|
|
592
|
-
},
|
|
593
|
-
};
|
|
594
|
-
}
|
|
4
|
+
import { disperse } from './multi-hop-transfer-disperse.js';
|
|
5
|
+
import { sweep } from './multi-hop-transfer-sweep.js';
|
|
6
|
+
export { disperse } from './multi-hop-transfer-disperse.js';
|
|
7
|
+
export { sweep } from './multi-hop-transfer-sweep.js';
|
|
8
|
+
export { pairwiseTransfer } from './multi-hop-transfer-pairwise.js';
|
|
595
9
|
// ========================================
|
|
596
10
|
// 保留旧函数名的别名(向后兼容)
|
|
597
11
|
// ========================================
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { EIP7702Config } from './types.js';
|
|
2
|
+
export type UserType = 'v0' | 'v1' | 'default';
|
|
3
|
+
/**
|
|
4
|
+
* 根据用户类型获取利润率(单边模式)
|
|
5
|
+
* - v0: 8 bps = 0.08%
|
|
6
|
+
* - v1: 10 bps = 0.10%
|
|
7
|
+
* - default: 8 bps = 0.08%
|
|
8
|
+
*/
|
|
9
|
+
export declare function getProfitRateBps(userType?: UserType): number;
|
|
10
|
+
/**
|
|
11
|
+
* 根据用户类型获取利润率(双边/换手模式)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getProfitRateBpsDouble(userType?: UserType): number;
|
|
14
|
+
/**
|
|
15
|
+
* 计算利润金额(旧版兼容)
|
|
16
|
+
*/
|
|
17
|
+
export declare function calculateProfitAmount(totalFlowWei: bigint, isSwapMode?: boolean): bigint;
|
|
18
|
+
/**
|
|
19
|
+
* 计算利润金额(基于用户类型)
|
|
20
|
+
* @param totalFlowWei 总资金流水
|
|
21
|
+
* @param userType 用户类型
|
|
22
|
+
* @param isDoubleMode 是否双边模式(换手模式)
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateProfitAmountByUserType(totalFlowWei: bigint, userType?: UserType, isDoubleMode?: boolean): bigint;
|
|
25
|
+
/**
|
|
26
|
+
* 根据交易数量计算利润金额
|
|
27
|
+
* @param totalFlowWei 总资金流水
|
|
28
|
+
* @param txCount 交易数量
|
|
29
|
+
* @param userType 用户类型
|
|
30
|
+
*/
|
|
31
|
+
export declare function calculateProfitAmountByTxCount(totalFlowWei: bigint, txCount: number, userType?: UserType): bigint;
|
|
32
|
+
export declare function getProfitRecipient(config?: EIP7702Config): string;
|