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
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flap Tax Vaults — 链上查询(query)
|
|
3
|
+
*/
|
|
4
|
+
import { Contract } from 'ethers';
|
|
5
|
+
import { getErrorMessageFromUnknown } from '../../../core/index.js';
|
|
6
|
+
import { VAULT_FACTORY_V2_ABI, VAULT_BASE_V2_ABI, VAULT_BASE_ABI, VAULT_PORTAL_ABI, } from './constants.js';
|
|
7
|
+
import { mapFieldDescriptor, mapVaultMethodSchema, } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* 从 VaultFactory 合约读取 vaultDataSchema
|
|
10
|
+
*/
|
|
11
|
+
export async function queryVaultDataSchema(provider, factoryAddress) {
|
|
12
|
+
try {
|
|
13
|
+
const factory = new Contract(factoryAddress, VAULT_FACTORY_V2_ABI, provider);
|
|
14
|
+
const raw = (await factory.vaultDataSchema());
|
|
15
|
+
return {
|
|
16
|
+
description: raw.description,
|
|
17
|
+
fields: raw.fields.map(mapFieldDescriptor),
|
|
18
|
+
isArray: raw.isArray,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 从金库合约读取 vaultUISchema
|
|
27
|
+
*/
|
|
28
|
+
export async function queryVaultUISchema(provider, vaultAddress) {
|
|
29
|
+
try {
|
|
30
|
+
const vault = new Contract(vaultAddress, VAULT_BASE_V2_ABI, provider);
|
|
31
|
+
const raw = (await vault.vaultUISchema());
|
|
32
|
+
return {
|
|
33
|
+
vaultType: raw.vaultType,
|
|
34
|
+
description: raw.description,
|
|
35
|
+
methods: raw.methods.map(mapVaultMethodSchema),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* 读取金库合约的动态描述
|
|
44
|
+
*/
|
|
45
|
+
export async function queryVaultDescription(provider, vaultAddress) {
|
|
46
|
+
try {
|
|
47
|
+
const vault = new Contract(vaultAddress, VAULT_BASE_ABI, provider);
|
|
48
|
+
return await vault.description();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 验证合约是否是有效的 VaultFactory
|
|
56
|
+
*/
|
|
57
|
+
export async function validateVaultFactory(provider, factoryAddress) {
|
|
58
|
+
try {
|
|
59
|
+
const code = await provider.getCode(factoryAddress);
|
|
60
|
+
if (code === '0x' || code === '0x0') {
|
|
61
|
+
return { isValid: false, isV2: false, schema: null, error: '地址没有部署合约' };
|
|
62
|
+
}
|
|
63
|
+
const schema = await queryVaultDataSchema(provider, factoryAddress);
|
|
64
|
+
return {
|
|
65
|
+
isValid: true,
|
|
66
|
+
isV2: schema !== null,
|
|
67
|
+
schema,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
return { isValid: false, isV2: false, schema: null, error: getErrorMessageFromUnknown(e) };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 从 VaultPortal 查询代币的金库信息
|
|
76
|
+
*/
|
|
77
|
+
export async function getVaultInfo(provider, vaultPortalAddress, taxTokenAddress) {
|
|
78
|
+
try {
|
|
79
|
+
const portal = new Contract(vaultPortalAddress, VAULT_PORTAL_ABI, provider);
|
|
80
|
+
const info = (await portal.getVault(taxTokenAddress));
|
|
81
|
+
return {
|
|
82
|
+
vault: info.vault,
|
|
83
|
+
vaultFactory: info.vaultFactory,
|
|
84
|
+
description: info.description,
|
|
85
|
+
isOfficial: info.isOfficial,
|
|
86
|
+
riskLevel: Number(info.riskLevel),
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 验证合约是否有效(是否部署了代码)
|
|
95
|
+
*/
|
|
96
|
+
export async function isValidContract(provider, address) {
|
|
97
|
+
try {
|
|
98
|
+
const code = await provider.getCode(address);
|
|
99
|
+
return code !== '0x' && code !== '0x0';
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flap Tax Vaults — 类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* FieldDescriptor — 字段描述符
|
|
6
|
+
* 对应 Solidity 结构体 IVaultSchemasV1.FieldDescriptor
|
|
7
|
+
*/
|
|
8
|
+
export interface FieldDescriptor {
|
|
9
|
+
name: string;
|
|
10
|
+
fieldType: string;
|
|
11
|
+
description: string;
|
|
12
|
+
decimals: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* VaultDataSchema — 工厂数据模式
|
|
16
|
+
* 对应 VaultFactoryBaseV2.vaultDataSchema() 返回值
|
|
17
|
+
*/
|
|
18
|
+
export interface VaultDataSchema {
|
|
19
|
+
description: string;
|
|
20
|
+
fields: FieldDescriptor[];
|
|
21
|
+
isArray: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ApproveAction — ERC-20 授权操作
|
|
25
|
+
*/
|
|
26
|
+
export interface ApproveAction {
|
|
27
|
+
tokenType: string;
|
|
28
|
+
amountFieldName: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* VaultMethodSchema — 金库方法描述
|
|
32
|
+
*/
|
|
33
|
+
export interface VaultMethodSchema {
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
inputs: FieldDescriptor[];
|
|
37
|
+
outputs: FieldDescriptor[];
|
|
38
|
+
approvals: ApproveAction[];
|
|
39
|
+
isInputArray: boolean;
|
|
40
|
+
isOutputArray: boolean;
|
|
41
|
+
isWriteMethod: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* VaultUISchema — 金库 UI 模式
|
|
45
|
+
*/
|
|
46
|
+
export interface VaultUISchema {
|
|
47
|
+
vaultType: string;
|
|
48
|
+
description: string;
|
|
49
|
+
methods: VaultMethodSchema[];
|
|
50
|
+
}
|
|
51
|
+
/** ABI 编码支持的字段值类型 */
|
|
52
|
+
export type AbiEncodeValue = string | number | boolean | bigint;
|
|
53
|
+
/** 链上 vaultDataSchema 原始返回值 */
|
|
54
|
+
export interface RawFieldDescriptor {
|
|
55
|
+
name: string;
|
|
56
|
+
fieldType: string;
|
|
57
|
+
description: string;
|
|
58
|
+
decimals: bigint | number;
|
|
59
|
+
}
|
|
60
|
+
export interface RawVaultDataSchema {
|
|
61
|
+
description: string;
|
|
62
|
+
fields: RawFieldDescriptor[];
|
|
63
|
+
isArray: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface RawApproveAction {
|
|
66
|
+
tokenType: string;
|
|
67
|
+
amountFieldName: string;
|
|
68
|
+
}
|
|
69
|
+
export interface RawVaultMethodSchema {
|
|
70
|
+
name: string;
|
|
71
|
+
description: string;
|
|
72
|
+
inputs: RawFieldDescriptor[];
|
|
73
|
+
outputs: RawFieldDescriptor[];
|
|
74
|
+
approvals: RawApproveAction[];
|
|
75
|
+
isInputArray: boolean;
|
|
76
|
+
isOutputArray: boolean;
|
|
77
|
+
isWriteMethod: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface RawVaultUISchema {
|
|
80
|
+
vaultType: string;
|
|
81
|
+
description: string;
|
|
82
|
+
methods: RawVaultMethodSchema[];
|
|
83
|
+
}
|
|
84
|
+
export interface RawVaultPortalInfo {
|
|
85
|
+
vault: string;
|
|
86
|
+
vaultFactory: string;
|
|
87
|
+
description: string;
|
|
88
|
+
isOfficial: boolean;
|
|
89
|
+
riskLevel: bigint | number;
|
|
90
|
+
}
|
|
91
|
+
export declare function mapFieldDescriptor(f: RawFieldDescriptor): FieldDescriptor;
|
|
92
|
+
export declare function mapApproveAction(a: RawApproveAction): ApproveAction;
|
|
93
|
+
export declare function mapVaultMethodSchema(m: RawVaultMethodSchema): VaultMethodSchema;
|
|
94
|
+
/**
|
|
95
|
+
* 金库类型枚举
|
|
96
|
+
*
|
|
97
|
+
* ⚠️ 基于 flap.sh 实际 JS 源码中 taxVaults.vaultTypes[] 配置
|
|
98
|
+
* 每种类型对应一个 VaultFactory 合约地址
|
|
99
|
+
*/
|
|
100
|
+
export type VaultType = 'none' | 'gift' | 'split' | 'buyback_burn' | 'burnToEarn' | 'buildYourVault';
|
|
101
|
+
/**
|
|
102
|
+
* Tax Vault 创建配置
|
|
103
|
+
*
|
|
104
|
+
* ⚠️ 金库模式下的核心参数:
|
|
105
|
+
* - vaultFactory: VaultFactory 合约地址(直接传递给 VaultPortal)
|
|
106
|
+
* - vaultData: ABI 编码的金库初始化数据(由 vaultDataSchema 决定格式)
|
|
107
|
+
* - extensionID 和 extensionData 始终为零值
|
|
108
|
+
*/
|
|
109
|
+
export interface TaxVaultConfig {
|
|
110
|
+
/** 金库类型 */
|
|
111
|
+
vaultType: VaultType;
|
|
112
|
+
/**
|
|
113
|
+
* VaultFactory 合约地址
|
|
114
|
+
* - 官方金库:从 VAULT_FACTORY_ADDRESSES 自动获取
|
|
115
|
+
* - buildYourVault:用户手动输入
|
|
116
|
+
*/
|
|
117
|
+
factoryAddress?: string;
|
|
118
|
+
/**
|
|
119
|
+
* 金库初始化数据(原始 hex)
|
|
120
|
+
* 直接使用此数据作为 vaultData
|
|
121
|
+
*/
|
|
122
|
+
rawVaultData?: string;
|
|
123
|
+
/**
|
|
124
|
+
* 金库数据字段值
|
|
125
|
+
* key = vaultDataSchema 中 field.name, value = 用户输入
|
|
126
|
+
*/
|
|
127
|
+
vaultDataFields?: Record<string, string | number | boolean>;
|
|
128
|
+
/**
|
|
129
|
+
* 工厂的 vaultDataSchema
|
|
130
|
+
*/
|
|
131
|
+
vaultDataSchema?: VaultDataSchema;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 金库信息(链上查询结果)
|
|
135
|
+
*/
|
|
136
|
+
export interface VaultInfo {
|
|
137
|
+
/** 金库合约地址 */
|
|
138
|
+
address: string;
|
|
139
|
+
/** 金库中的原生代币余额 */
|
|
140
|
+
nativeBalance: bigint;
|
|
141
|
+
/** 金库描述 */
|
|
142
|
+
description: string | null;
|
|
143
|
+
/** 是否为 V2 金库 */
|
|
144
|
+
isV2: boolean;
|
|
145
|
+
/** V2 金库的 UI 模式 */
|
|
146
|
+
uiSchema: VaultUISchema | null;
|
|
147
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flap Tax Vaults — 类型定义
|
|
3
|
+
*/
|
|
4
|
+
export function mapFieldDescriptor(f) {
|
|
5
|
+
return {
|
|
6
|
+
name: f.name,
|
|
7
|
+
fieldType: f.fieldType,
|
|
8
|
+
description: f.description,
|
|
9
|
+
decimals: Number(f.decimals),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function mapApproveAction(a) {
|
|
13
|
+
return {
|
|
14
|
+
tokenType: a.tokenType,
|
|
15
|
+
amountFieldName: a.amountFieldName,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function mapVaultMethodSchema(m) {
|
|
19
|
+
return {
|
|
20
|
+
name: m.name,
|
|
21
|
+
description: m.description,
|
|
22
|
+
inputs: m.inputs.map(mapFieldDescriptor),
|
|
23
|
+
outputs: m.outputs.map(mapFieldDescriptor),
|
|
24
|
+
approvals: m.approvals.map(mapApproveAction),
|
|
25
|
+
isInputArray: m.isInputArray,
|
|
26
|
+
isOutputArray: m.isOutputArray,
|
|
27
|
+
isWriteMethod: m.isWriteMethod,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -1,417 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Flap Tax Vaults(税收金库)
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 1. 金库代币通过 VaultPortal 合约创建(不是普通 Portal)
|
|
7
|
-
* 2. 调用函数:VaultPortal.newTaxTokenWithVault(params)
|
|
8
|
-
* 3. 参数中 extensionID/extensionData 始终为零值
|
|
9
|
-
* 4. 真正的金库配置通过 vaultFactory(工厂地址)和 vaultData(ABI 编码数据)传递
|
|
10
|
-
* 5. 每种金库类型对应一个具体的 VaultFactory 合约地址
|
|
11
|
-
*
|
|
12
|
-
* VaultPortal.newTaxTokenWithVault 参数结构:
|
|
13
|
-
* - 基础参数(与 Portal.newTokenV5 相同):name, symbol, meta, dexThresh, salt, taxRate,
|
|
14
|
-
* migratorType, quoteToken, quoteAmt, permitData, extensionID(全零), extensionData("0x"),
|
|
15
|
-
* dexId, lpFeeProfile, taxDuration, antiFarmerDuration, mktBps, deflationBps, dividendBps,
|
|
16
|
-
* lpBps, minimumShareBalance
|
|
17
|
-
* - 金库专属参数:vaultFactory(address), vaultData(bytes)
|
|
18
|
-
*
|
|
19
|
-
* 金库分类(来自 flap.sh 源码):
|
|
20
|
-
* 官方金库 (official):
|
|
21
|
-
* - gift (FlapXVault):禮物金庫,指定一个地址接收税费
|
|
22
|
-
* - split (SplitVault):分配金庫,按比例将税费分配给多个接收者
|
|
23
|
-
* - buyback & burn (SnowBallVault):自动回购并销毁代币
|
|
24
|
-
* 社区金库 (community):
|
|
25
|
-
* - burnToEarn (BlackHoleVault):燃燒分紅,燃烧代币以赚取分红奖励
|
|
26
|
-
* - buildYourVault:構建您的金庫,用户输入自定义 VaultFactory 地址
|
|
27
|
-
*
|
|
28
|
-
* @module vault
|
|
29
|
-
*/
|
|
30
|
-
import { type JsonRpcProvider } from 'ethers';
|
|
31
|
-
/**
|
|
32
|
-
* FieldDescriptor — 字段描述符
|
|
33
|
-
* 对应 Solidity 结构体 IVaultSchemasV1.FieldDescriptor
|
|
34
|
-
*/
|
|
35
|
-
export interface FieldDescriptor {
|
|
36
|
-
name: string;
|
|
37
|
-
fieldType: string;
|
|
38
|
-
description: string;
|
|
39
|
-
decimals: number;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* VaultDataSchema — 工厂数据模式
|
|
43
|
-
* 对应 VaultFactoryBaseV2.vaultDataSchema() 返回值
|
|
44
|
-
*/
|
|
45
|
-
export interface VaultDataSchema {
|
|
46
|
-
description: string;
|
|
47
|
-
fields: FieldDescriptor[];
|
|
48
|
-
isArray: boolean;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* ApproveAction — ERC-20 授权操作
|
|
52
|
-
*/
|
|
53
|
-
export interface ApproveAction {
|
|
54
|
-
tokenType: string;
|
|
55
|
-
amountFieldName: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* VaultMethodSchema — 金库方法描述
|
|
59
|
-
*/
|
|
60
|
-
export interface VaultMethodSchema {
|
|
61
|
-
name: string;
|
|
62
|
-
description: string;
|
|
63
|
-
inputs: FieldDescriptor[];
|
|
64
|
-
outputs: FieldDescriptor[];
|
|
65
|
-
approvals: ApproveAction[];
|
|
66
|
-
isInputArray: boolean;
|
|
67
|
-
isOutputArray: boolean;
|
|
68
|
-
isWriteMethod: boolean;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* VaultUISchema — 金库 UI 模式
|
|
72
|
-
*/
|
|
73
|
-
export interface VaultUISchema {
|
|
74
|
-
vaultType: string;
|
|
75
|
-
description: string;
|
|
76
|
-
methods: VaultMethodSchema[];
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* 金库类型枚举
|
|
80
|
-
*
|
|
81
|
-
* ⚠️ 基于 flap.sh 实际 JS 源码中 taxVaults.vaultTypes[] 配置
|
|
82
|
-
* 每种类型对应一个 VaultFactory 合约地址
|
|
83
|
-
*/
|
|
84
|
-
export type VaultType = 'none' | 'gift' | 'split' | 'buyback_burn' | 'burnToEarn' | 'buildYourVault';
|
|
85
|
-
/**
|
|
86
|
-
* 金库类型显示标签
|
|
87
|
-
*/
|
|
88
|
-
export declare const VAULT_TYPE_LABELS: Record<VaultType, string>;
|
|
89
|
-
/**
|
|
90
|
-
* 金库类型分类(对齐 flap.sh 的 category 字段)
|
|
91
|
-
*/
|
|
92
|
-
export declare const VAULT_TYPE_CATEGORIES: {
|
|
93
|
-
official: VaultType[];
|
|
94
|
-
community: VaultType[];
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* VaultPortal 合约地址
|
|
98
|
-
*
|
|
99
|
-
* ⚠️ 金库代币通过 VaultPortal 创建,不是普通 Portal
|
|
100
|
-
* 来源:flap.sh/_next/static/chunks/2601-*.js
|
|
101
|
-
*/
|
|
102
|
-
export declare const VAULT_PORTAL_ADDRESSES: Record<string, string>;
|
|
103
|
-
/**
|
|
104
|
-
* VaultFactory 合约地址(每种金库类型 + 每条链)
|
|
105
|
-
*
|
|
106
|
-
* ⚠️ 直接从 flap.sh 前端 JS 源码中提取的真实地址
|
|
107
|
-
* 来源:flap.sh/_next/static/chunks/2601-*.js 中 taxVaults.vaultTypes[]
|
|
108
|
-
*/
|
|
109
|
-
export declare const VAULT_FACTORY_ADDRESSES: Record<string, Record<string, string>>;
|
|
110
|
-
/**
|
|
111
|
-
* 金库额外配置(如 XVault 的 relayer 端点)
|
|
112
|
-
*/
|
|
113
|
-
export declare const VAULT_EXTRA_CONFIG: Record<string, Record<string, Record<string, string>>>;
|
|
114
|
-
/**
|
|
115
|
-
* Flap Guardian 合约地址
|
|
116
|
-
*/
|
|
117
|
-
export declare const FLAP_GUARDIAN_ADDRESSES: {
|
|
118
|
-
readonly BSC: "0x9e27098dcD8844bcc6287a557E0b4D09C86B8a4b";
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* VaultPortal ABI — newTaxTokenWithVault
|
|
122
|
-
*
|
|
123
|
-
* ⚠️ 从 flap.sh 前端 JS 源码提取的真实 ABI
|
|
124
|
-
* 来源:flap.sh/_next/static/chunks/6288-*.js(VaultPortal 合约 ABI)
|
|
125
|
-
*/
|
|
126
|
-
export declare const VAULT_PORTAL_ABI: readonly [{
|
|
127
|
-
readonly type: "function";
|
|
128
|
-
readonly name: "newTaxTokenWithVault";
|
|
129
|
-
readonly inputs: readonly [{
|
|
130
|
-
readonly name: "params";
|
|
131
|
-
readonly type: "tuple";
|
|
132
|
-
readonly internalType: "struct IVaultPortalTypes.NewTaxTokenWithVaultParams";
|
|
133
|
-
readonly components: readonly [{
|
|
134
|
-
readonly name: "name";
|
|
135
|
-
readonly type: "string";
|
|
136
|
-
readonly internalType: "string";
|
|
137
|
-
}, {
|
|
138
|
-
readonly name: "symbol";
|
|
139
|
-
readonly type: "string";
|
|
140
|
-
readonly internalType: "string";
|
|
141
|
-
}, {
|
|
142
|
-
readonly name: "meta";
|
|
143
|
-
readonly type: "string";
|
|
144
|
-
readonly internalType: "string";
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "dexThresh";
|
|
147
|
-
readonly type: "uint8";
|
|
148
|
-
readonly internalType: "enum IPortalCommonTypes.DexThreshType";
|
|
149
|
-
}, {
|
|
150
|
-
readonly name: "salt";
|
|
151
|
-
readonly type: "bytes32";
|
|
152
|
-
readonly internalType: "bytes32";
|
|
153
|
-
}, {
|
|
154
|
-
readonly name: "taxRate";
|
|
155
|
-
readonly type: "uint16";
|
|
156
|
-
readonly internalType: "uint16";
|
|
157
|
-
}, {
|
|
158
|
-
readonly name: "migratorType";
|
|
159
|
-
readonly type: "uint8";
|
|
160
|
-
readonly internalType: "enum IPortalTypes.MigratorType";
|
|
161
|
-
}, {
|
|
162
|
-
readonly name: "quoteToken";
|
|
163
|
-
readonly type: "address";
|
|
164
|
-
readonly internalType: "address";
|
|
165
|
-
}, {
|
|
166
|
-
readonly name: "quoteAmt";
|
|
167
|
-
readonly type: "uint256";
|
|
168
|
-
readonly internalType: "uint256";
|
|
169
|
-
}, {
|
|
170
|
-
readonly name: "permitData";
|
|
171
|
-
readonly type: "bytes";
|
|
172
|
-
readonly internalType: "bytes";
|
|
173
|
-
}, {
|
|
174
|
-
readonly name: "extensionID";
|
|
175
|
-
readonly type: "bytes32";
|
|
176
|
-
readonly internalType: "bytes32";
|
|
177
|
-
}, {
|
|
178
|
-
readonly name: "extensionData";
|
|
179
|
-
readonly type: "bytes";
|
|
180
|
-
readonly internalType: "bytes";
|
|
181
|
-
}, {
|
|
182
|
-
readonly name: "dexId";
|
|
183
|
-
readonly type: "uint8";
|
|
184
|
-
readonly internalType: "enum IPortalTypes.DEXId";
|
|
185
|
-
}, {
|
|
186
|
-
readonly name: "lpFeeProfile";
|
|
187
|
-
readonly type: "uint8";
|
|
188
|
-
readonly internalType: "enum IPortalTypes.V3LPFeeProfile";
|
|
189
|
-
}, {
|
|
190
|
-
readonly name: "taxDuration";
|
|
191
|
-
readonly type: "uint64";
|
|
192
|
-
readonly internalType: "uint64";
|
|
193
|
-
}, {
|
|
194
|
-
readonly name: "antiFarmerDuration";
|
|
195
|
-
readonly type: "uint64";
|
|
196
|
-
readonly internalType: "uint64";
|
|
197
|
-
}, {
|
|
198
|
-
readonly name: "mktBps";
|
|
199
|
-
readonly type: "uint16";
|
|
200
|
-
readonly internalType: "uint16";
|
|
201
|
-
}, {
|
|
202
|
-
readonly name: "deflationBps";
|
|
203
|
-
readonly type: "uint16";
|
|
204
|
-
readonly internalType: "uint16";
|
|
205
|
-
}, {
|
|
206
|
-
readonly name: "dividendBps";
|
|
207
|
-
readonly type: "uint16";
|
|
208
|
-
readonly internalType: "uint16";
|
|
209
|
-
}, {
|
|
210
|
-
readonly name: "lpBps";
|
|
211
|
-
readonly type: "uint16";
|
|
212
|
-
readonly internalType: "uint16";
|
|
213
|
-
}, {
|
|
214
|
-
readonly name: "minimumShareBalance";
|
|
215
|
-
readonly type: "uint256";
|
|
216
|
-
readonly internalType: "uint256";
|
|
217
|
-
}, {
|
|
218
|
-
readonly name: "vaultFactory";
|
|
219
|
-
readonly type: "address";
|
|
220
|
-
readonly internalType: "address";
|
|
221
|
-
}, {
|
|
222
|
-
readonly name: "vaultData";
|
|
223
|
-
readonly type: "bytes";
|
|
224
|
-
readonly internalType: "bytes";
|
|
225
|
-
}];
|
|
226
|
-
}];
|
|
227
|
-
readonly outputs: readonly [{
|
|
228
|
-
readonly name: "token";
|
|
229
|
-
readonly type: "address";
|
|
230
|
-
readonly internalType: "address";
|
|
231
|
-
}];
|
|
232
|
-
readonly stateMutability: "payable";
|
|
233
|
-
}, {
|
|
234
|
-
readonly type: "function";
|
|
235
|
-
readonly name: "getVault";
|
|
236
|
-
readonly inputs: readonly [{
|
|
237
|
-
readonly name: "taxToken";
|
|
238
|
-
readonly type: "address";
|
|
239
|
-
readonly internalType: "address";
|
|
240
|
-
}];
|
|
241
|
-
readonly outputs: readonly [{
|
|
242
|
-
readonly name: "info";
|
|
243
|
-
readonly type: "tuple";
|
|
244
|
-
readonly internalType: "struct IVaultPortalTypes.VaultInfo";
|
|
245
|
-
readonly components: readonly [{
|
|
246
|
-
readonly name: "vault";
|
|
247
|
-
readonly type: "address";
|
|
248
|
-
readonly internalType: "address";
|
|
249
|
-
}, {
|
|
250
|
-
readonly name: "vaultFactory";
|
|
251
|
-
readonly type: "address";
|
|
252
|
-
readonly internalType: "address";
|
|
253
|
-
}, {
|
|
254
|
-
readonly name: "description";
|
|
255
|
-
readonly type: "string";
|
|
256
|
-
readonly internalType: "string";
|
|
257
|
-
}, {
|
|
258
|
-
readonly name: "isOfficial";
|
|
259
|
-
readonly type: "bool";
|
|
260
|
-
readonly internalType: "bool";
|
|
261
|
-
}, {
|
|
262
|
-
readonly name: "riskLevel";
|
|
263
|
-
readonly type: "uint8";
|
|
264
|
-
readonly internalType: "enum IVaultPortalTypes.RiskLevel";
|
|
265
|
-
}];
|
|
266
|
-
}];
|
|
267
|
-
readonly stateMutability: "view";
|
|
268
|
-
}, {
|
|
269
|
-
readonly type: "function";
|
|
270
|
-
readonly name: "predictTaxTokenV1Address";
|
|
271
|
-
readonly inputs: readonly [{
|
|
272
|
-
readonly name: "salt";
|
|
273
|
-
readonly type: "bytes32";
|
|
274
|
-
readonly internalType: "bytes32";
|
|
275
|
-
}];
|
|
276
|
-
readonly outputs: readonly [{
|
|
277
|
-
readonly name: "predictedAddress";
|
|
278
|
-
readonly type: "address";
|
|
279
|
-
readonly internalType: "address";
|
|
280
|
-
}];
|
|
281
|
-
readonly stateMutability: "view";
|
|
282
|
-
}];
|
|
283
|
-
/**
|
|
284
|
-
* IVaultFactory ABI(V1)
|
|
285
|
-
*/
|
|
286
|
-
export declare const VAULT_FACTORY_ABI: string[];
|
|
287
|
-
/**
|
|
288
|
-
* VaultFactoryBaseV2 ABI
|
|
289
|
-
*/
|
|
290
|
-
export declare const VAULT_FACTORY_V2_ABI: string[];
|
|
291
|
-
/**
|
|
292
|
-
* VaultBase ABI(V1)
|
|
293
|
-
*/
|
|
294
|
-
export declare const VAULT_BASE_ABI: string[];
|
|
295
|
-
/**
|
|
296
|
-
* VaultBaseV2 ABI
|
|
297
|
-
*/
|
|
298
|
-
export declare const VAULT_BASE_V2_ABI: string[];
|
|
299
|
-
/** extensionID/extensionData 在金库模式下始终为零值 */
|
|
300
|
-
export declare const NONE_EXTENSION_ID: string;
|
|
301
|
-
/**
|
|
302
|
-
* Tax Vault 创建配置
|
|
303
|
-
*
|
|
304
|
-
* ⚠️ 金库模式下的核心参数:
|
|
305
|
-
* - vaultFactory: VaultFactory 合约地址(直接传递给 VaultPortal)
|
|
306
|
-
* - vaultData: ABI 编码的金库初始化数据(由 vaultDataSchema 决定格式)
|
|
307
|
-
* - extensionID 和 extensionData 始终为零值
|
|
308
|
-
*/
|
|
309
|
-
export interface TaxVaultConfig {
|
|
310
|
-
/** 金库类型 */
|
|
311
|
-
vaultType: VaultType;
|
|
312
|
-
/**
|
|
313
|
-
* VaultFactory 合约地址
|
|
314
|
-
* - 官方金库:从 VAULT_FACTORY_ADDRESSES 自动获取
|
|
315
|
-
* - buildYourVault:用户手动输入
|
|
316
|
-
*/
|
|
317
|
-
factoryAddress?: string;
|
|
318
|
-
/**
|
|
319
|
-
* 金库初始化数据(原始 hex)
|
|
320
|
-
* 直接使用此数据作为 vaultData
|
|
321
|
-
*/
|
|
322
|
-
rawVaultData?: string;
|
|
323
|
-
/**
|
|
324
|
-
* 金库数据字段值
|
|
325
|
-
* key = vaultDataSchema 中 field.name, value = 用户输入
|
|
326
|
-
*/
|
|
327
|
-
vaultDataFields?: Record<string, string | number | boolean>;
|
|
328
|
-
/**
|
|
329
|
-
* 工厂的 vaultDataSchema
|
|
330
|
-
*/
|
|
331
|
-
vaultDataSchema?: VaultDataSchema;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* 根据 VaultDataSchema 和用户输入编码 vaultData
|
|
335
|
-
*/
|
|
336
|
-
export declare function encodeVaultData(schema: VaultDataSchema, fieldValues: Record<string, string | number | boolean>): string;
|
|
337
|
-
/**
|
|
338
|
-
* 获取指定链和金库类型的 VaultFactory 合约地址
|
|
339
|
-
*/
|
|
340
|
-
export declare function getVaultFactoryAddress(chain: string, vaultType: VaultType): string | null;
|
|
341
|
-
/**
|
|
342
|
-
* 获取指定链的 VaultPortal 合约地址
|
|
343
|
-
*/
|
|
344
|
-
export declare function getVaultPortalAddress(chain: string): string | null;
|
|
345
|
-
/**
|
|
346
|
-
* 构建金库参数(用于 VaultPortal.newTaxTokenWithVault)
|
|
347
|
-
*
|
|
348
|
-
* ⚠️ 重要:返回的是 vaultFactory 和 vaultData,不是 extensionID/extensionData
|
|
349
|
-
* extensionID/extensionData 在金库模式下始终为零值
|
|
350
|
-
*
|
|
351
|
-
* @returns { vaultFactory, vaultData } 直接传给 VaultPortal
|
|
352
|
-
*/
|
|
353
|
-
export declare function buildVaultParams(config?: TaxVaultConfig, chain?: string): {
|
|
354
|
-
vaultFactory: string;
|
|
355
|
-
vaultData: string;
|
|
356
|
-
};
|
|
357
|
-
/**
|
|
358
|
-
* 旧版兼容:将 TaxVaultConfig 转换为 extensionID 和 extensionData
|
|
359
|
-
*
|
|
360
|
-
* ⚠️ 注意:真实的 Flap 平台在金库模式下 extensionID/extensionData 始终为零值
|
|
361
|
-
* 金库参数通过 VaultPortal 的 vaultFactory/vaultData 传递
|
|
362
|
-
* 此函数仅用于向后兼容
|
|
363
|
-
*/
|
|
364
|
-
export declare function buildVaultExtensionParams(): {
|
|
365
|
-
extensionID: string;
|
|
366
|
-
extensionData: string;
|
|
367
|
-
};
|
|
368
|
-
/**
|
|
369
|
-
* 从 VaultFactory 合约读取 vaultDataSchema
|
|
370
|
-
*/
|
|
371
|
-
export declare function queryVaultDataSchema(provider: JsonRpcProvider, factoryAddress: string): Promise<VaultDataSchema | null>;
|
|
372
|
-
/**
|
|
373
|
-
* 从金库合约读取 vaultUISchema
|
|
374
|
-
*/
|
|
375
|
-
export declare function queryVaultUISchema(provider: JsonRpcProvider, vaultAddress: string): Promise<VaultUISchema | null>;
|
|
376
|
-
/**
|
|
377
|
-
* 读取金库合约的动态描述
|
|
378
|
-
*/
|
|
379
|
-
export declare function queryVaultDescription(provider: JsonRpcProvider, vaultAddress: string): Promise<string | null>;
|
|
380
|
-
/**
|
|
381
|
-
* 验证合约是否是有效的 VaultFactory
|
|
382
|
-
*/
|
|
383
|
-
export declare function validateVaultFactory(provider: JsonRpcProvider, factoryAddress: string): Promise<{
|
|
384
|
-
isValid: boolean;
|
|
385
|
-
isV2: boolean;
|
|
386
|
-
schema: VaultDataSchema | null;
|
|
387
|
-
error?: string;
|
|
388
|
-
}>;
|
|
389
|
-
/**
|
|
390
|
-
* 从 VaultPortal 查询代币的金库信息
|
|
391
|
-
*/
|
|
392
|
-
export declare function getVaultInfo(provider: JsonRpcProvider, vaultPortalAddress: string, taxTokenAddress: string): Promise<{
|
|
393
|
-
vault: string;
|
|
394
|
-
vaultFactory: string;
|
|
395
|
-
description: string;
|
|
396
|
-
isOfficial: boolean;
|
|
397
|
-
riskLevel: number;
|
|
398
|
-
} | null>;
|
|
399
|
-
/**
|
|
400
|
-
* 验证合约是否有效(是否部署了代码)
|
|
401
|
-
*/
|
|
402
|
-
export declare function isValidContract(provider: JsonRpcProvider, address: string): Promise<boolean>;
|
|
403
|
-
/**
|
|
404
|
-
* 金库信息(链上查询结果)
|
|
4
|
+
* 原超长文件按职责拆分为 vault/ 目录下的多个子文件,
|
|
5
|
+
* 对外 export 符号与路径保持不变(见 vault/index.ts)。
|
|
405
6
|
*/
|
|
406
|
-
export
|
|
407
|
-
/** 金库合约地址 */
|
|
408
|
-
address: string;
|
|
409
|
-
/** 金库中的原生代币余额 */
|
|
410
|
-
nativeBalance: bigint;
|
|
411
|
-
/** 金库描述 */
|
|
412
|
-
description: string | null;
|
|
413
|
-
/** 是否为 V2 金库 */
|
|
414
|
-
isV2: boolean;
|
|
415
|
-
/** V2 金库的 UI 模式 */
|
|
416
|
-
uiSchema: VaultUISchema | null;
|
|
417
|
-
}
|
|
7
|
+
export * from './vault/index.js';
|