0xtrails 0.15.1 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -434
- package/dist/actions/actionBuilder.d.ts +10 -0
- package/dist/actions/actionBuilder.d.ts.map +1 -1
- package/dist/actions/actionBuilder.js +92 -80
- package/dist/actions/constants.d.ts +9 -53
- package/dist/actions/constants.d.ts.map +1 -1
- package/dist/actions/constants.js +10 -11
- package/dist/actions/custom-integrations/sushiswapV3/sushiswapV3.js +11 -11
- package/dist/actions/custom-integrations/uniswapV3/uniswapV3.js +11 -11
- package/dist/actions/destinationCalls.d.ts.map +1 -1
- package/dist/actions/destinationCalls.js +34 -27
- package/dist/actions/hooks/useEarnBalances.js +7 -7
- package/dist/actions/hooks/useEarnMarkets.js +4 -4
- package/dist/actions/hooks/useEarnProviders.js +4 -4
- package/dist/actions/hooks/useResolveActions.d.ts +2 -11
- package/dist/actions/hooks/useResolveActions.d.ts.map +1 -1
- package/dist/actions/hooks/useResolveActions.js +40 -222
- package/dist/actions/index.d.ts +6 -0
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +35 -28
- package/dist/actions/resolveActions.d.ts +13 -0
- package/dist/actions/resolveActions.d.ts.map +1 -0
- package/dist/actions/resolveActions.js +267 -0
- package/dist/actions/resolvers.d.ts +2 -3
- package/dist/actions/resolvers.d.ts.map +1 -1
- package/dist/actions/resolvers.js +1 -1
- package/dist/actions/types.d.ts +16 -0
- package/dist/actions/types.d.ts.map +1 -1
- package/dist/actions/utils.d.ts +5 -5
- package/dist/actions/utils.d.ts.map +1 -1
- package/dist/actions/utils.js +124 -114
- package/dist/adapters/evmAdapter.d.ts +10 -0
- package/dist/adapters/evmAdapter.d.ts.map +1 -0
- package/dist/adapters/evmAdapter.js +28 -0
- package/dist/analytics.js +8 -8
- package/dist/chainRegistry.d.ts +6 -0
- package/dist/chainRegistry.d.ts.map +1 -0
- package/dist/chainRegistry.js +47 -0
- package/dist/chainResolution.d.ts +6 -0
- package/dist/chainResolution.d.ts.map +1 -0
- package/dist/chainResolution.js +53 -0
- package/dist/chainRpcClient.d.ts +8 -0
- package/dist/chainRpcClient.d.ts.map +1 -0
- package/dist/chainRpcClient.js +67 -0
- package/dist/chains.d.ts +5 -11
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +108 -208
- package/dist/config.d.ts +1 -30
- package/dist/config.d.ts.map +1 -1
- package/dist/configDefaults.d.ts +7 -0
- package/dist/configDefaults.d.ts.map +1 -0
- package/dist/configDefaults.js +9 -0
- package/dist/configStore.d.ts +31 -0
- package/dist/configStore.d.ts.map +1 -0
- package/dist/{config.js → configStore.js} +1 -1
- package/dist/constants.d.ts +2 -14
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +21 -31
- package/dist/contractConstants.d.ts +8 -0
- package/dist/contractConstants.d.ts.map +1 -0
- package/dist/contractConstants.js +9 -0
- package/dist/contractUtils.js +5 -5
- package/dist/ens.d.ts.map +1 -1
- package/dist/ens.js +78 -55
- package/dist/estimate.js +11 -11
- package/dist/fees.d.ts.map +1 -1
- package/dist/fees.js +40 -35
- package/dist/gasless.d.ts +5 -0
- package/dist/gasless.d.ts.map +1 -1
- package/dist/gasless.js +12 -12
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +63 -62
- package/dist/hooks/prepareTrailsSendTransactionDestination.js +1 -1
- package/dist/hooks/useAmountUsd.js +5 -5
- package/dist/hooks/useBluvoTokenList.d.ts +13 -0
- package/dist/hooks/useBluvoTokenList.d.ts.map +1 -0
- package/dist/hooks/useBluvoTokenList.js +57 -0
- package/dist/hooks/useCheckout.js +6 -6
- package/dist/hooks/useCombinedHistory.d.ts.map +1 -1
- package/dist/hooks/useCombinedHistory.js +89 -81
- package/dist/hooks/useCustomTokenSearch.d.ts +4 -1
- package/dist/hooks/useCustomTokenSearch.d.ts.map +1 -1
- package/dist/hooks/useCustomTokenSearch.js +106 -108
- package/dist/hooks/useDefaultDestinationToken.js +5 -5
- package/dist/hooks/useDefaultOriginToken.d.ts.map +1 -1
- package/dist/hooks/useDefaultOriginToken.js +73 -80
- package/dist/hooks/useDepositMonitor.js +15 -15
- package/dist/hooks/useDestinationSelectedToken.d.ts +8 -2
- package/dist/hooks/useDestinationSelectedToken.d.ts.map +1 -1
- package/dist/hooks/useDestinationSelectedToken.js +150 -116
- package/dist/hooks/useExchangeFundingSelection.d.ts +17 -0
- package/dist/hooks/useExchangeFundingSelection.d.ts.map +1 -0
- package/dist/hooks/useExchangeFundingSelection.js +25 -0
- package/dist/hooks/useExternalFundingReceiptSync.js +5 -5
- package/dist/hooks/useFiatSelectedCurrency.js +1 -1
- package/dist/hooks/useGetIntent.js +3 -3
- package/dist/hooks/useIntentReceiptBalances.js +6 -6
- package/dist/hooks/useIntentTransactionHistory.d.ts.map +1 -1
- package/dist/hooks/useIntentTransactionHistory.js +207 -182
- package/dist/hooks/useMeldTransactionHistory.js +5 -5
- package/dist/hooks/useMeldTransactionStatus.js +8 -8
- package/dist/hooks/useOnRampCountryDefaults.js +4 -4
- package/dist/hooks/useOnRampQuote.js +1 -1
- package/dist/hooks/useOriginSelectedToken.d.ts +5 -0
- package/dist/hooks/useOriginSelectedToken.d.ts.map +1 -1
- package/dist/hooks/useOriginSelectedToken.js +112 -46
- package/dist/hooks/usePayMessage.js +2 -2
- package/dist/hooks/useQuote.d.ts +37 -45
- package/dist/hooks/useQuote.d.ts.map +1 -1
- package/dist/hooks/useQuote.js +249 -254
- package/dist/hooks/useRecentChains.d.ts +7 -0
- package/dist/hooks/useRecentChains.d.ts.map +1 -0
- package/dist/hooks/useRecentChains.js +52 -0
- package/dist/hooks/useSelectedFundMethod.d.ts +31 -0
- package/dist/hooks/useSelectedFundMethod.d.ts.map +1 -1
- package/dist/hooks/useSelectedFundMethod.js +35 -26
- package/dist/hooks/useSelectedRecipient.d.ts.map +1 -1
- package/dist/hooks/useSelectedRecipient.js +21 -21
- package/dist/hooks/useSendForm.d.ts +8 -1
- package/dist/hooks/useSendForm.d.ts.map +1 -1
- package/dist/hooks/useSendForm.js +266 -256
- package/dist/hooks/useSwapState.d.ts +1 -1
- package/dist/hooks/useSwapState.d.ts.map +1 -1
- package/dist/hooks/useTokenList.d.ts +4 -1
- package/dist/hooks/useTokenList.d.ts.map +1 -1
- package/dist/hooks/useTokenList.js +350 -355
- package/dist/hooks/useTrailsSendTransaction.d.ts +9 -43
- package/dist/hooks/useTrailsSendTransaction.d.ts.map +1 -1
- package/dist/hooks/useTrailsSendTransaction.js +289 -306
- package/dist/hooks/useViewManager.d.ts +1 -1
- package/dist/hooks/useViewManager.d.ts.map +1 -1
- package/dist/hooks/useWalletConnectionContext.d.ts +6 -5
- package/dist/hooks/useWalletConnectionContext.d.ts.map +1 -1
- package/dist/hooks/useWalletConnectionContext.js +3 -3
- package/dist/hydrate/multicall.d.ts.map +1 -1
- package/dist/hydrate/multicall.js +127 -91
- package/dist/index.d.ts +77 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +307 -257
- package/dist/indexerClient.d.ts.map +1 -1
- package/dist/indexerClient.js +23 -25
- package/dist/intentProtocolResolver.js +2 -2
- package/dist/intents.d.ts +3 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/intents.js +58 -63
- package/dist/logger/index.js +1 -1
- package/dist/meld/components/MeldCountriesList.js +1 -1
- package/dist/meld/components/MeldFundMethods.js +7 -7
- package/dist/meld/components/MeldProvidersList.js +1 -1
- package/dist/meld/components/MeldTokensList.js +9 -9
- package/dist/meld/components/SimpleHeader.js +4 -4
- package/dist/meld/utils/meld.js +2 -2
- package/dist/offlineRecovery.d.ts.map +1 -1
- package/dist/offlineRecovery.js +107 -112
- package/dist/onramp/MeshConnectIframe.js +1 -1
- package/dist/onramp/SendFromExchangeButton.js +1 -1
- package/dist/onramp/TrailsOnRampProvider.d.ts +7 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts.map +1 -1
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts +12 -0
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.d.ts.map +1 -0
- package/dist/onramp/bluvo/hooks/useBluvoFundingSelection.js +18 -0
- package/dist/onramp/mesh/components/MeshExchangeSelection.js +5 -5
- package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.js +4 -4
- package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.js +1 -1
- package/dist/onramp/trailsOnramp.d.ts.map +1 -1
- package/dist/onramp/trailsOnramp.js +22 -18
- package/dist/onrampClient.d.ts.map +1 -1
- package/dist/onrampClient.js +21 -17
- package/dist/package.js +30 -28
- package/dist/prepareSend.d.ts +4 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/prepareSend.js +32 -31
- package/dist/query/QueryProvider.d.ts +9 -0
- package/dist/query/QueryProvider.d.ts.map +1 -0
- package/dist/query/QueryProvider.js +13 -0
- package/dist/query/balance.fetchers.d.ts.map +1 -1
- package/dist/query/balance.fetchers.js +16 -16
- package/dist/query/balance.hooks.js +9 -9
- package/dist/query/balance.queries.js +1 -1
- package/dist/query/chains.hooks.d.ts +3 -2
- package/dist/query/chains.hooks.d.ts.map +1 -1
- package/dist/query/chains.hooks.js +25 -24
- package/dist/query/fiat.hooks.js +5 -5
- package/dist/query/geo.hooks.js +1 -1
- package/dist/query/geo.queries.js +1 -1
- package/dist/query/intentProtocol.queries.js +1 -1
- package/dist/query/persister.d.ts +0 -1
- package/dist/query/persister.d.ts.map +1 -1
- package/dist/query/persister.js +5 -5
- package/dist/query/price.hooks.js +4 -4
- package/dist/query/price.queries.js +1 -1
- package/dist/query/serialization.d.ts +3 -0
- package/dist/query/serialization.d.ts.map +1 -0
- package/dist/query/serialization.js +17 -0
- package/dist/query/token.fetchers.d.ts +13 -0
- package/dist/query/token.fetchers.d.ts.map +1 -0
- package/dist/query/token.fetchers.js +6 -0
- package/dist/{hooks/useTokens.d.ts → query/token.hooks.d.ts} +14 -25
- package/dist/query/token.hooks.d.ts.map +1 -0
- package/dist/query/token.hooks.js +68 -0
- package/dist/query/token.queries.d.ts +67 -0
- package/dist/query/token.queries.d.ts.map +1 -0
- package/dist/query/token.queries.js +144 -0
- package/dist/quoteError.d.ts +22 -0
- package/dist/quoteError.d.ts.map +1 -0
- package/dist/quoteError.js +9 -0
- package/dist/recover.d.ts +10 -3
- package/dist/recover.d.ts.map +1 -1
- package/dist/recover.js +401 -339
- package/dist/smartContractWallet.d.ts +8 -0
- package/dist/smartContractWallet.d.ts.map +1 -0
- package/dist/smartContractWallet.js +11 -0
- package/dist/tokenRegistry.d.ts +50 -0
- package/dist/tokenRegistry.d.ts.map +1 -0
- package/dist/tokenRegistry.js +589 -0
- package/dist/tokenTypes.d.ts +29 -0
- package/dist/tokenTypes.d.ts.map +1 -0
- package/dist/tokens.d.ts +10 -44
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +269 -798
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -2
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +3 -2
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.js +52 -49
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +3 -2
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.js +2 -2
- package/dist/transactionIntent/handlers/intentHandler.d.ts +3 -2
- package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/intentHandler.js +193 -193
- package/dist/transactionIntent/quote/feeExtractors.d.ts +2 -1
- package/dist/transactionIntent/quote/feeExtractors.d.ts.map +1 -1
- package/dist/transactionIntent/quote/feeExtractors.js +31 -20
- package/dist/transactionIntent/quote/normalizeQuote.js +43 -43
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +3 -3
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.js +35 -32
- package/dist/transactionIntent/types.d.ts +9 -6
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactionIntent/types.js +24 -7
- package/dist/transactions.d.ts +5 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +8 -8
- package/dist/umd/trails.min.js +767 -1112
- package/dist/utils/tokenResolution.d.ts +19 -0
- package/dist/utils/tokenResolution.d.ts.map +1 -0
- package/dist/utils/tokenResolution.js +53 -0
- package/dist/widget/assets/components/Aave.d.ts +8 -0
- package/dist/widget/assets/components/Aave.d.ts.map +1 -0
- package/dist/widget/assets/components/Aave.js +29 -0
- package/dist/widget/assets/components/ExchangeIconBlack.d.ts +8 -0
- package/dist/widget/assets/components/ExchangeIconBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodCardBrands.d.ts +8 -0
- package/dist/widget/assets/components/FundMethodCardBrands.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodCardBrands.js +49 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts +8 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.d.ts.map +1 -0
- package/dist/widget/assets/components/FundMethodExchangeBrands.js +37 -0
- package/dist/widget/assets/components/MetaMaskIconFox.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskIconFox.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskIconFoxWithMargins.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskLogoBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts +8 -0
- package/dist/widget/assets/components/MetaMaskLogoWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/Morpho.d.ts +8 -0
- package/dist/widget/assets/components/Morpho.d.ts.map +1 -0
- package/dist/widget/assets/components/Morpho.js +51 -0
- package/dist/widget/assets/components/TrailsBlack.d.ts +8 -0
- package/dist/widget/assets/components/TrailsBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/TrailsBlack.js +25 -0
- package/dist/widget/assets/components/TrailsWhite.d.ts +8 -0
- package/dist/widget/assets/components/TrailsWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/TrailsWhite.js +25 -0
- package/dist/widget/assets/components/WalletChangeBlack.d.ts +8 -0
- package/dist/widget/assets/components/WalletChangeBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogo.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogo.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoBlack.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoBlue.d.ts.map +1 -0
- package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts +8 -0
- package/dist/widget/assets/components/WalletConnectLogoWhite.d.ts.map +1 -0
- package/dist/widget/assets/components/index.d.ts +17 -0
- package/dist/widget/assets/components/index.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts +54 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoCache.js +68 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts +386 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoFlowClient.js +872 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts +192 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/BluvoWebClient.js +294 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts +51 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WebSocketClient.js +72 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts +19 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WebsocketListener.js +62 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts +44 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/WorkflowTypes.js +6 -0
- package/dist/widget/bluvo/bluvo-lib/api.types.d.ts +49 -0
- package/dist/widget/bluvo/bluvo-lib/api.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts +84 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/balanceTransform.js +26 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts +3 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/createMachine.js +38 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts +156 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/error-codes.js +115 -0
- package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts +356 -0
- package/dist/widget/bluvo/bluvo-lib/flow.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts +4 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.js +45 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts +20 -0
- package/dist/widget/bluvo/bluvo-lib/flowMachine.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts +39 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/flowStateHandlers.js +395 -0
- package/dist/widget/bluvo/bluvo-lib/index.d.ts +5 -0
- package/dist/widget/bluvo/bluvo-lib/index.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts +15 -0
- package/dist/widget/bluvo/bluvo-lib/machine.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts +23 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/stateHelpers.js +24 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts +325 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/useBluvoFlow.js +152 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts +11 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/useFlowMachine.js +25 -0
- package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts +17 -0
- package/dist/widget/bluvo/bluvo-lib/useWithdrawMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts +46 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawal.types.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts +29 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalErrorHandler.js +95 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts +3 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.d.ts.map +1 -0
- package/dist/widget/bluvo/bluvo-lib/withdrawalMachine.js +137 -0
- package/dist/widget/bluvo/index.d.ts +2 -0
- package/dist/widget/bluvo/index.d.ts.map +1 -0
- package/dist/widget/components/AccountActionsDropdown.js +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.js +143 -190
- package/dist/widget/components/AccountIntentTransactionHistoryButton.js +1 -1
- package/dist/widget/components/AccountSettings.d.ts.map +1 -1
- package/dist/widget/components/AccountSettings.js +19 -18
- package/dist/widget/components/AddressWalletIcon.d.ts +1 -1
- package/dist/widget/components/AddressWalletIcon.d.ts.map +1 -1
- package/dist/widget/components/AddressWalletIcon.js +13 -13
- package/dist/widget/components/AllChainsIcon.d.ts.map +1 -1
- package/dist/widget/components/AllChainsIcon.js +80 -13
- package/dist/widget/components/BluvoExchangeSelection.d.ts +12 -0
- package/dist/widget/components/BluvoExchangeSelection.d.ts.map +1 -0
- package/dist/widget/components/BluvoExchangeSelection.js +131 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts +2 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.d.ts.map +1 -0
- package/dist/widget/components/BluvoExchangeSelection.lazy.js +4 -0
- package/dist/widget/components/BluvoOnrampFlow.d.ts +20 -0
- package/dist/widget/components/BluvoOnrampFlow.d.ts.map +1 -0
- package/dist/widget/components/BluvoOnrampFlow.js +1472 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts +2 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.d.ts.map +1 -0
- package/dist/widget/components/BluvoOnrampFlow.lazy.js +4 -0
- package/dist/widget/components/ChainFilterDropdown.d.ts.map +1 -1
- package/dist/widget/components/ChainFilterDropdown.js +37 -37
- package/dist/widget/components/ChainList.d.ts.map +1 -1
- package/dist/widget/components/ChainList.js +157 -119
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.js +309 -300
- package/dist/widget/components/ConfigDisplay.js +3 -3
- package/dist/widget/components/ConnectWallet.d.ts +1 -6
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.js +110 -165
- package/dist/widget/components/ConnectedWallets.d.ts +3 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.js +75 -100
- package/dist/widget/components/CopyButton.js +1 -1
- package/dist/widget/components/CountryFilterDropdown.js +1 -1
- package/dist/widget/components/DebugMenu.js +1 -1
- package/dist/widget/components/DepositTracker.js +1 -1
- package/dist/widget/components/DirectTransfer.d.ts +1 -1
- package/dist/widget/components/DirectTransfer.js +3 -3
- package/dist/widget/components/Earn.js +1 -1
- package/dist/widget/components/EarnMarkets.d.ts.map +1 -1
- package/dist/widget/components/EarnMarkets.js +162 -148
- package/dist/widget/components/EarnPools.d.ts.map +1 -1
- package/dist/widget/components/EarnPools.js +123 -103
- package/dist/widget/components/EarnPoolsFilters.d.ts.map +1 -1
- package/dist/widget/components/EarnPoolsFilters.js +19 -16
- package/dist/widget/components/EarnWithdraw.d.ts.map +1 -1
- package/dist/widget/components/EarnWithdraw.js +130 -129
- package/dist/widget/components/FeeOptions.js +1 -1
- package/dist/widget/components/FiatSelector.js +5 -5
- package/dist/widget/components/FiatSelectorButton.js +6 -6
- package/dist/widget/components/Footer.d.ts.map +1 -1
- package/dist/widget/components/Footer.js +47 -40
- package/dist/widget/components/Fund.d.ts +15 -11
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/Fund.js +13 -1088
- package/dist/widget/components/Fund.types.d.ts +22 -0
- package/dist/widget/components/Fund.types.d.ts.map +1 -0
- package/dist/widget/components/FundExactInput.d.ts +5 -0
- package/dist/widget/components/FundExactInput.d.ts.map +1 -0
- package/dist/widget/components/FundExactInput.js +1116 -0
- package/dist/widget/components/FundExactOutput.d.ts +5 -0
- package/dist/widget/components/FundExactOutput.d.ts.map +1 -0
- package/dist/widget/components/FundExactOutput.js +498 -0
- package/dist/widget/components/FundMethods.d.ts +2 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.js +144 -143
- package/dist/widget/components/FundWalletSelection.d.ts +1 -0
- package/dist/widget/components/FundWalletSelection.d.ts.map +1 -1
- package/dist/widget/components/FundWalletSelection.js +18 -19
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.js +32 -30
- package/dist/widget/components/HookModalContent.js +11 -11
- package/dist/widget/components/MeldForm.js +15 -15
- package/dist/widget/components/MeldHistory.js +5 -5
- package/dist/widget/components/MeldStepsFlow.js +8 -8
- package/dist/widget/components/MeldTransactionStatus.js +7 -7
- package/dist/widget/components/Modal.js +3 -3
- package/dist/widget/components/OnRampProviderSelector.js +1 -1
- package/dist/widget/components/OnrampErrorScreen.js +1 -1
- package/dist/widget/components/OnrampHistoryRow.js +1 -1
- package/dist/widget/components/OnrampPaymentMethods.js +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.js +7 -7
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/Pay.js +223 -216
- package/dist/widget/components/PaymentMethods.d.ts.map +1 -1
- package/dist/widget/components/PaymentMethods.js +51 -52
- package/dist/widget/components/PoolDeposit.js +35 -35
- package/dist/widget/components/QRCodeOptions.js +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts +1 -1
- package/dist/widget/components/QRCodeWalletSelect.js +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.js +195 -187
- package/dist/widget/components/QuoteInputErrorBlock.d.ts +7 -0
- package/dist/widget/components/QuoteInputErrorBlock.d.ts.map +1 -0
- package/dist/widget/components/QuoteInputErrorBlock.js +22 -0
- package/dist/widget/components/Receipt.js +15 -15
- package/dist/widget/components/RecentChains.d.ts +9 -0
- package/dist/widget/components/RecentChains.d.ts.map +1 -0
- package/dist/widget/components/RecentChains.js +28 -0
- package/dist/widget/components/RecipientSelectorButton.js +5 -5
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/Recipients.js +84 -102
- package/dist/widget/components/ScreenHeader.d.ts.map +1 -1
- package/dist/widget/components/ScreenHeader.js +20 -20
- package/dist/widget/components/SearchInputField.js +4 -4
- package/dist/widget/components/SessionTimeoutScreen.js +1 -1
- package/dist/widget/components/ShadowPortal.js +1 -1
- package/dist/widget/components/SlippageToleranceSettings.js +4 -4
- package/dist/widget/components/ThemeProvider.js +1 -1
- package/dist/widget/components/Toast.js +19 -19
- package/dist/widget/components/TokenImage.js +4 -4
- package/dist/widget/components/TokenSelector.d.ts +3 -0
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.js +201 -190
- package/dist/widget/components/TokenSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/TokenSelectorButton.js +22 -22
- package/dist/widget/components/TrailsHookModal.d.ts +2 -2
- package/dist/widget/components/TrailsHookModal.d.ts.map +1 -1
- package/dist/widget/components/TrailsHookModal.js +47 -49
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.js +33 -23
- package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
- package/dist/widget/components/TransactionHistoryItem.js +278 -188
- package/dist/widget/components/TransferPendingVertical.js +2 -2
- package/dist/widget/components/UserPreferences.js +11 -11
- package/dist/widget/components/WaasFeeOptions.d.ts.map +1 -1
- package/dist/widget/components/WaasFeeOptions.js +208 -159
- package/dist/widget/components/WalletAccountHeader.js +1 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConfirmation.js +46 -47
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.js +83 -135
- package/dist/widget/components/WalletConnectionPending.d.ts.map +1 -1
- package/dist/widget/components/WalletConnectionPending.js +25 -25
- package/dist/widget/components/WalletList.d.ts +8 -2
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/components/WalletList.js +61 -33
- package/dist/widget/components/WidgetProviders.d.ts +3 -1
- package/dist/widget/components/WidgetProviders.d.ts.map +1 -1
- package/dist/widget/components/WidgetProviders.js +32 -28
- package/dist/widget/components/Withdraw.d.ts.map +1 -1
- package/dist/widget/components/Withdraw.js +192 -185
- package/dist/widget/index.d.ts +3 -1
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +30 -26
- package/dist/widget/modes/EarnWidget.d.ts +4 -4
- package/dist/widget/modes/EarnWidget.d.ts.map +1 -1
- package/dist/widget/modes/EarnWidget.js +17 -15
- package/dist/widget/modes/FundWidget.d.ts +13 -0
- package/dist/widget/modes/FundWidget.d.ts.map +1 -1
- package/dist/widget/modes/FundWidget.js +30 -28
- package/dist/widget/modes/PayWidget.d.ts.map +1 -1
- package/dist/widget/modes/PayWidget.js +23 -21
- package/dist/widget/modes/SwapWidget.d.ts.map +1 -1
- package/dist/widget/modes/SwapWidget.js +19 -18
- package/dist/widget/modes/WithdrawWidget.d.ts +3 -3
- package/dist/widget/modes/WithdrawWidget.d.ts.map +1 -1
- package/dist/widget/modes/WithdrawWidget.js +15 -13
- package/dist/widget/props.d.ts +255 -0
- package/dist/widget/props.d.ts.map +1 -0
- package/dist/widget/props.js +14 -0
- package/dist/widget/providers/TrailsModalProvider.js +4 -4
- package/dist/widget/providers/TrailsProvider.d.ts +78 -16
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/providers/TrailsProvider.js +64 -46
- package/dist/widget/providers/WalletContext.d.ts +10 -0
- package/dist/widget/providers/WalletContext.d.ts.map +1 -0
- package/dist/widget/providers/WalletContext.js +23 -0
- package/dist/widget/providers/WidgetProviderTree.d.ts +9 -7
- package/dist/widget/providers/WidgetProviderTree.d.ts.map +1 -1
- package/dist/widget/providers/WidgetProviderTree.js +31 -47
- package/dist/widget/providers/adapterConfig.d.ts +13 -0
- package/dist/widget/providers/adapterConfig.d.ts.map +1 -0
- package/dist/widget/providers/adapterConfig.js +97 -0
- package/dist/widget/providers/sequenceSupport.d.ts +42 -0
- package/dist/widget/providers/sequenceSupport.d.ts.map +1 -0
- package/dist/widget/providers/walletRuntimeResolution.d.ts +10 -0
- package/dist/widget/providers/walletRuntimeResolution.d.ts.map +1 -0
- package/dist/widget/providers/walletRuntimeResolution.js +14 -0
- package/dist/widget/shared/destinationDefaultToken.d.ts.map +1 -1
- package/dist/widget/shared/destinationDefaultToken.js +12 -13
- package/dist/widget/shared/destinationSupport.d.ts +40 -0
- package/dist/widget/shared/destinationSupport.d.ts.map +1 -0
- package/dist/widget/shared/destinationSupport.js +215 -0
- package/dist/widget/shared/resolution.d.ts +2 -17
- package/dist/widget/shared/resolution.d.ts.map +1 -1
- package/dist/widget/shared/resolution.js +32 -52
- package/dist/widget/shared/resolvePaymentSource.d.ts +2 -1
- package/dist/widget/shared/resolvePaymentSource.d.ts.map +1 -1
- package/dist/widget/shared/resolvePaymentSource.js +9 -9
- package/dist/widget/shared/types.d.ts +23 -31
- package/dist/widget/shared/types.d.ts.map +1 -1
- package/dist/widget/styles.gen.d.ts.map +1 -1
- package/dist/widget/styles.gen.js +4 -4
- package/dist/widget/utils/fundMethodSwitchState.d.ts +2 -0
- package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -1
- package/dist/widget/utils/fundMethodSwitchState.js +3 -3
- package/dist/widget/utils/tokens.d.ts.map +1 -1
- package/dist/widget/utils/tokens.js +11 -25
- package/dist/widget/utils/trailsOnrampConfig.d.ts +5 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts.map +1 -1
- package/dist/widget/utils/viewManagerGuards.d.ts.map +1 -1
- package/dist/widget/utils/viewManagerGuards.js +5 -4
- package/dist/widget/utils/walletConnectRedirect.d.ts +19 -0
- package/dist/widget/utils/walletConnectRedirect.d.ts.map +1 -0
- package/dist/widget/utils/walletConnectRedirect.js +21 -0
- package/dist/widget/widget.d.ts +2 -224
- package/dist/widget/widget.d.ts.map +1 -1
- package/dist/widget/widget.js +995 -993
- package/dist/widgetFlowHooks.d.ts +12 -0
- package/dist/widgetFlowHooks.d.ts.map +1 -0
- package/dist/widgetFlowHooks.js +18 -0
- package/package.json +24 -22
- package/dist/hooks/useAddressWalletIcon.d.ts +0 -10
- package/dist/hooks/useAddressWalletIcon.d.ts.map +0 -1
- package/dist/hooks/useAddressWalletIcon.js +0 -33
- package/dist/hooks/useConnector.d.ts +0 -9
- package/dist/hooks/useConnector.d.ts.map +0 -1
- package/dist/hooks/useConnector.js +0 -11
- package/dist/hooks/useIsSequenceWallet.d.ts +0 -6
- package/dist/hooks/useIsSequenceWallet.d.ts.map +0 -1
- package/dist/hooks/useIsSequenceWallet.js +0 -10
- package/dist/hooks/useTokens.d.ts.map +0 -1
- package/dist/hooks/useTokens.js +0 -166
- package/dist/hooks/useWalletConnectUri.d.ts +0 -19
- package/dist/hooks/useWalletConnectUri.d.ts.map +0 -1
- package/dist/hooks/useWalletConnectUri.js +0 -122
- package/dist/query/tokenList.queries.d.ts +0 -54
- package/dist/query/tokenList.queries.d.ts.map +0 -1
- package/dist/query/tokenList.queries.js +0 -77
- package/dist/tokensApi.d.ts +0 -8
- package/dist/tokensApi.d.ts.map +0 -1
- package/dist/tokensApi.js +0 -56
- package/dist/walletUtils.d.ts +0 -42
- package/dist/walletUtils.d.ts.map +0 -1
- package/dist/walletUtils.js +0 -110
- package/dist/wallets.d.ts +0 -23
- package/dist/wallets.d.ts.map +0 -1
- package/dist/wallets.js +0 -236
- package/dist/widget/assets/FundMethod-card-brands.js +0 -4
- package/dist/widget/assets/FundMethod-exchange-brands.js +0 -4
- package/dist/widget/assets/Trails-logo-black.js +0 -4
- package/dist/widget/assets/Trails-logo-white.js +0 -4
- package/dist/widget/assets/aave.js +0 -4
- package/dist/widget/assets/morpho.js +0 -4
- package/dist/widget/components/FundMethodIcons.d.ts +0 -4
- package/dist/widget/components/FundMethodIcons.d.ts.map +0 -1
- package/dist/widget/components/FundMethodIcons.js +0 -60
- package/dist/widget/shared/tokenAllowlist.d.ts +0 -36
- package/dist/widget/shared/tokenAllowlist.d.ts.map +0 -1
- package/dist/widget/shared/tokenAllowlist.js +0 -60
- package/dist/widget/utils/createWagmiConfig.d.ts +0 -10
- package/dist/widget/utils/createWagmiConfig.d.ts.map +0 -1
- package/dist/widget/utils/createWagmiConfig.js +0 -18
|
@@ -1,58 +1,59 @@
|
|
|
1
|
-
import { isZeroAccount as
|
|
2
|
-
import { TRAILS_HYDRATE_PLACEHOLDER_AMOUNT as
|
|
3
|
-
import { HydrateSource as
|
|
4
|
-
import { DYNAMIC_AMOUNT_MARKER as
|
|
5
|
-
import { isDynamicAmount as
|
|
6
|
-
import { SwapType as
|
|
1
|
+
import { isZeroAccount as u } from "../utils/address.js";
|
|
2
|
+
import { TRAILS_HYDRATE_PLACEHOLDER_AMOUNT as E, getAmountOffsets as I } from "../placeholder.js";
|
|
3
|
+
import { HydrateSource as g } from "../hydrate/source.js";
|
|
4
|
+
import { DYNAMIC_AMOUNT_MARKER as T } from "./types.js";
|
|
5
|
+
import { isDynamicAmount as l, isDynamicAmountOrMarker as h } from "./dynamic.js";
|
|
6
|
+
import { SwapType as k } from "./resolvers.js";
|
|
7
|
+
import { isAddress as A } from "viem";
|
|
7
8
|
var O = "0x095ea7b3";
|
|
8
|
-
function
|
|
9
|
-
return
|
|
9
|
+
function r(e) {
|
|
10
|
+
return l(e) ? T : e;
|
|
10
11
|
}
|
|
11
|
-
function a(e,
|
|
12
|
-
if (
|
|
12
|
+
function a(e, n) {
|
|
13
|
+
if (h(e)) throw new Error(`assertCondition: dynamic() is not allowed on ${n} — assertions must use a concrete threshold`);
|
|
13
14
|
}
|
|
14
|
-
function f(e,
|
|
15
|
-
if (e !== void 0 &&
|
|
16
|
-
throw new Error(`swap: dynamic() is not allowed on ${
|
|
15
|
+
function f(e, n) {
|
|
16
|
+
if (e !== void 0 && h(e))
|
|
17
|
+
throw new Error(`swap: dynamic() is not allowed on ${n} — only amountIn (EXACT_INPUT) or maxAmountIn (EXACT_OUTPUT) may be dynamic; the SDK hydrates them from the tokenIn balance automatically`);
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function v(e, n) {
|
|
19
20
|
if (typeof e == "bigint") return e;
|
|
20
|
-
const
|
|
21
|
-
if (!/^\d+$/.test(
|
|
22
|
-
return BigInt(
|
|
21
|
+
const t = e.trim();
|
|
22
|
+
if (!/^\d+$/.test(t)) throw new Error(`${n} must be a non-negative integer string or bigint (e.g. 1000000n or "1000000"). Got: ${JSON.stringify(e)}`);
|
|
23
|
+
return BigInt(t);
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
if (e !== void 0 &&
|
|
26
|
-
if (
|
|
27
|
-
if (e === void 0 || e === "") throw new Error(`${
|
|
25
|
+
function i(e, n, t) {
|
|
26
|
+
if (e !== void 0 && n !== void 0) throw new Error(`${t}: cannot specify both amount and amountRaw. Use amount for human-readable decimals (e.g. "1.5") or amountRaw for raw wei (e.g. 1000000n).`);
|
|
27
|
+
if (n !== void 0) return v(n, t);
|
|
28
|
+
if (e === void 0 || e === "") throw new Error(`${t}: amount or amountRaw is required`);
|
|
28
29
|
return e;
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
if (e !== void 0 &&
|
|
32
|
-
return
|
|
31
|
+
function y(e, n, t) {
|
|
32
|
+
if (e !== void 0 && n !== void 0) throw new Error(`${t}: cannot specify both amount and amountRaw. Use amount for human-readable decimals (e.g. "1.5") or amountRaw for raw wei (e.g. 1000000n).`);
|
|
33
|
+
return n !== void 0 ? v(n, t) : e;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
+
function x(e) {
|
|
35
36
|
if (!e.marketId) throw new Error("lend: marketId is required");
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
37
|
+
const n = i(e.amount, e.amountRaw, "lend");
|
|
38
|
+
if (u(e.receiverAddress)) throw new Error("lend: receiverAddress must not be the zero address (position tokens would be irrecoverably lost)");
|
|
38
39
|
return {
|
|
39
40
|
type: "lend",
|
|
40
41
|
marketId: e.marketId,
|
|
41
|
-
amount:
|
|
42
|
+
amount: r(n),
|
|
42
43
|
direction: "enter",
|
|
43
44
|
...e.inputToken !== void 0 && { inputToken: e.inputToken },
|
|
44
45
|
...e.inputTokenNetwork !== void 0 && { inputTokenNetwork: e.inputTokenNetwork },
|
|
45
46
|
...e.receiverAddress !== void 0 && { receiverAddress: e.receiverAddress }
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function B(e) {
|
|
49
50
|
if (!e.marketId) throw new Error("deposit: marketId is required");
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
51
|
+
const n = i(e.amount, e.amountRaw, "deposit");
|
|
52
|
+
if (u(e.receiverAddress)) throw new Error("deposit: receiverAddress must not be the zero address (vault shares would be irrecoverably lost)");
|
|
52
53
|
return {
|
|
53
54
|
type: "deposit",
|
|
54
55
|
marketId: e.marketId,
|
|
55
|
-
amount:
|
|
56
|
+
amount: r(n),
|
|
56
57
|
direction: "enter",
|
|
57
58
|
...e.inputToken !== void 0 && { inputToken: e.inputToken },
|
|
58
59
|
...e.inputTokenNetwork !== void 0 && { inputTokenNetwork: e.inputTokenNetwork },
|
|
@@ -60,60 +61,60 @@ function _(e) {
|
|
|
60
61
|
...e.useMaxAllowance !== void 0 && { useMaxAllowance: e.useMaxAllowance }
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function P(e) {
|
|
64
65
|
if (!e.tokenIn) throw new Error("swap: tokenIn is required");
|
|
65
66
|
if (!e.tokenOut) throw new Error("swap: tokenOut is required");
|
|
66
67
|
if (typeof e.tokenIn == "string" && typeof e.tokenOut == "string" && e.tokenIn.toLowerCase() === e.tokenOut.toLowerCase()) throw new Error("swap: tokenIn and tokenOut must be different tokens");
|
|
67
|
-
if (
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
if (!
|
|
71
|
-
const s = e.fee ?? "0.3",
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
return f(
|
|
68
|
+
if (u(e.recipient)) throw new Error("swap: recipient must not be the zero address (swap output would be irrecoverably lost)");
|
|
69
|
+
const n = e.amountIn !== void 0 || e.amountInRaw !== void 0, t = e.amountOut !== void 0 || e.amountOutRaw !== void 0;
|
|
70
|
+
if (n && t) throw new Error("swap: pass either amountIn (EXACT_INPUT) or amountOut (EXACT_OUTPUT), not both");
|
|
71
|
+
if (!n && !t) throw new Error("swap: one of amountIn (EXACT_INPUT) or amountOut (EXACT_OUTPUT) is required");
|
|
72
|
+
const s = e.fee ?? "0.3", w = e.provider ?? "UNISWAP_V3";
|
|
73
|
+
if (n) {
|
|
74
|
+
const m = i(e.amountIn, e.amountInRaw, "swap amountIn"), o = y(e.minAmountOut, e.minAmountOutRaw, "swap minAmountOut");
|
|
75
|
+
return f(o, "minAmountOut"), {
|
|
75
76
|
type: "swap",
|
|
76
|
-
swapType:
|
|
77
|
+
swapType: k.EXACT_INPUT,
|
|
77
78
|
tokenIn: e.tokenIn,
|
|
78
79
|
tokenOut: e.tokenOut,
|
|
79
80
|
fee: s,
|
|
80
|
-
provider:
|
|
81
|
-
amountIn:
|
|
82
|
-
...
|
|
81
|
+
provider: w,
|
|
82
|
+
amountIn: r(m),
|
|
83
|
+
...o !== void 0 && { minAmountOut: r(o) },
|
|
83
84
|
...e.recipient !== void 0 && { recipient: e.recipient }
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
|
-
const
|
|
87
|
-
f(
|
|
88
|
-
const
|
|
87
|
+
const d = i(e.amountOut, e.amountOutRaw, "swap amountOut");
|
|
88
|
+
f(d, "amountOut");
|
|
89
|
+
const c = y(e.maxAmountIn, e.maxAmountInRaw, "swap maxAmountIn");
|
|
89
90
|
return {
|
|
90
91
|
type: "swap",
|
|
91
|
-
swapType:
|
|
92
|
+
swapType: k.EXACT_OUTPUT,
|
|
92
93
|
tokenIn: e.tokenIn,
|
|
93
94
|
tokenOut: e.tokenOut,
|
|
94
95
|
fee: s,
|
|
95
|
-
provider:
|
|
96
|
-
amountOut:
|
|
97
|
-
maxAmountIn:
|
|
96
|
+
provider: w,
|
|
97
|
+
amountOut: r(d),
|
|
98
|
+
maxAmountIn: c === void 0 ? T : r(c),
|
|
98
99
|
...e.recipient !== void 0 && { recipient: e.recipient }
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function D(e) {
|
|
102
103
|
if ("erc20Balance" in e) {
|
|
103
|
-
const
|
|
104
|
-
return a(
|
|
104
|
+
const n = e.erc20Balance, t = i(n.gte, n.gteRaw, "assertCondition erc20Balance.gte");
|
|
105
|
+
return a(t, "erc20Balance.gte"), {
|
|
105
106
|
type: "assert",
|
|
106
107
|
assertType: "erc20Balance",
|
|
107
|
-
token:
|
|
108
|
-
gte:
|
|
108
|
+
token: n.token,
|
|
109
|
+
gte: r(t)
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
112
|
if ("nativeBalance" in e) {
|
|
112
|
-
const
|
|
113
|
-
return a(
|
|
113
|
+
const n = e.nativeBalance, t = i(n.gte, n.gteRaw, "assertCondition nativeBalance.gte");
|
|
114
|
+
return a(t, "nativeBalance.gte"), {
|
|
114
115
|
type: "assert",
|
|
115
116
|
assertType: "nativeBalance",
|
|
116
|
-
gte:
|
|
117
|
+
gte: r(t)
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
if ("notExpired" in e) return {
|
|
@@ -122,40 +123,51 @@ function B(e) {
|
|
|
122
123
|
deadline: e.notExpired.deadline
|
|
123
124
|
};
|
|
124
125
|
if ("erc20Allowance" in e) {
|
|
125
|
-
const
|
|
126
|
-
return a(
|
|
126
|
+
const n = e.erc20Allowance, t = i(n.gte, n.gteRaw, "assertCondition erc20Allowance.gte");
|
|
127
|
+
return a(t, "erc20Allowance.gte"), {
|
|
127
128
|
type: "assert",
|
|
128
129
|
assertType: "erc20Allowance",
|
|
129
|
-
token:
|
|
130
|
-
spender:
|
|
131
|
-
gte:
|
|
130
|
+
token: n.token,
|
|
131
|
+
spender: n.spender,
|
|
132
|
+
gte: r(t)
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
throw new Error("assertCondition: unknown assertion type");
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function $(e) {
|
|
137
138
|
if (!e.to) throw new Error("custom: to address is required");
|
|
138
|
-
if (
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
if (u(e.to)) throw new Error("custom: to must not be the zero address");
|
|
140
|
+
if (u(e.dynamicAmountToken)) throw new Error("custom: dynamicAmountToken must not be the zero address");
|
|
141
|
+
for (const o of e.dynamicAmountTokens ?? []) {
|
|
142
|
+
if (!A(o)) throw new Error(`custom: invalid dynamicAmountTokens entry: ${o}`);
|
|
143
|
+
if (u(o)) throw new Error("custom: dynamicAmountTokens must not contain the zero address");
|
|
144
|
+
}
|
|
145
|
+
for (const o of e.sweepTokens ?? []) if (!A(o)) throw new Error(`custom: invalid sweepTokens entry: ${o}`);
|
|
146
|
+
const n = e.data ?? "0x";
|
|
147
|
+
if (e.dynamicAmountToken !== void 0 && e.dynamicAmountTokens !== void 0) throw new Error("custom: use either dynamicAmountToken or dynamicAmountTokens, not both.");
|
|
148
|
+
if (e.dynamicAmountTokens?.length === 0) throw new Error("custom: dynamicAmountTokens cannot be empty.");
|
|
149
|
+
const t = I(n, E).length, s = t > 0, w = n.slice(0, 10).toLowerCase() === O;
|
|
150
|
+
if (e.dynamicAmountTokens !== void 0 && e.dynamicAmountTokens.length !== t) throw new Error("custom: dynamicAmountTokens length must match the number of dynamic() amount slots.");
|
|
151
|
+
if (s && !e.dynamicAmountToken && !e.dynamicAmountTokens && !w) throw new Error("custom: calldata contains a dynamic() amount sentinel, but no `dynamicAmountToken` was provided. Set `dynamicAmountToken` or `dynamicAmountTokens` to the ERC-20 address whose runtime balance should replace the sentinel. (Inference from `to` is only available for bare `approve(spender, dynamic())` calls.)");
|
|
152
|
+
const d = l(e.value), c = d ? 0n : e.value, m = d ? [{
|
|
143
153
|
type: "value",
|
|
144
|
-
address:
|
|
154
|
+
address: g.self()
|
|
145
155
|
}] : [];
|
|
146
156
|
return {
|
|
147
157
|
type: "custom",
|
|
148
158
|
to: e.to,
|
|
149
|
-
data:
|
|
150
|
-
...
|
|
159
|
+
data: n,
|
|
160
|
+
...c !== void 0 && { value: c },
|
|
151
161
|
...e.dynamicAmountToken !== void 0 && { dynamicAmountToken: e.dynamicAmountToken },
|
|
152
|
-
...
|
|
162
|
+
...e.dynamicAmountTokens !== void 0 && { dynamicAmountTokens: e.dynamicAmountTokens },
|
|
163
|
+
...e.sweepTokens !== void 0 && { sweepTokens: e.sweepTokens },
|
|
164
|
+
...m.length > 0 && { hydrateEntries: m }
|
|
153
165
|
};
|
|
154
166
|
}
|
|
155
167
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
D as assertCondition,
|
|
169
|
+
$ as custom,
|
|
170
|
+
B as deposit,
|
|
171
|
+
x as lend,
|
|
172
|
+
P as swap
|
|
161
173
|
};
|
|
@@ -556,7 +556,6 @@ export declare const supportedChainsByName: {
|
|
|
556
556
|
blobGasUsed?: bigint | undefined;
|
|
557
557
|
blockHash: import('viem').Hash;
|
|
558
558
|
blockNumber: bigint;
|
|
559
|
-
blockTimestamp?: bigint | undefined;
|
|
560
559
|
contractAddress: import('viem').Address | null | undefined;
|
|
561
560
|
cumulativeGasUsed: bigint;
|
|
562
561
|
effectiveGasPrice: bigint;
|
|
@@ -870,12 +869,15 @@ export declare const supportedChainsByName: {
|
|
|
870
869
|
};
|
|
871
870
|
};
|
|
872
871
|
blockTime?: number | undefined | undefined;
|
|
873
|
-
contracts
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
872
|
+
contracts?: {
|
|
873
|
+
[x: string]: import('viem').ChainContract | {
|
|
874
|
+
[sourceId: number]: import('viem').ChainContract | undefined;
|
|
875
|
+
} | undefined;
|
|
876
|
+
ensRegistry?: import('viem').ChainContract | undefined;
|
|
877
|
+
ensUniversalResolver?: import('viem').ChainContract | undefined;
|
|
878
|
+
multicall3?: import('viem').ChainContract | undefined;
|
|
879
|
+
erc6492Verifier?: import('viem').ChainContract | undefined;
|
|
880
|
+
} | undefined;
|
|
879
881
|
ensTlds?: readonly string[] | undefined;
|
|
880
882
|
id: 747474;
|
|
881
883
|
name: "Katana";
|
|
@@ -1337,7 +1339,6 @@ export declare const supportedChainsByName: {
|
|
|
1337
1339
|
blobGasUsed?: bigint | undefined;
|
|
1338
1340
|
blockHash: import('viem').Hash;
|
|
1339
1341
|
blockNumber: bigint;
|
|
1340
|
-
blockTimestamp?: bigint | undefined;
|
|
1341
1342
|
contractAddress: import('viem').Address | null | undefined;
|
|
1342
1343
|
cumulativeGasUsed: bigint;
|
|
1343
1344
|
effectiveGasPrice: bigint;
|
|
@@ -1700,7 +1701,6 @@ export declare const supportedChainsByName: {
|
|
|
1700
1701
|
blobGasUsed?: bigint | undefined;
|
|
1701
1702
|
blockHash: import('viem').Hash;
|
|
1702
1703
|
blockNumber: bigint;
|
|
1703
|
-
blockTimestamp?: bigint | undefined;
|
|
1704
1704
|
contractAddress: import('viem').Address | null | undefined;
|
|
1705
1705
|
cumulativeGasUsed: bigint;
|
|
1706
1706
|
effectiveGasPrice: bigint;
|
|
@@ -1801,50 +1801,6 @@ export declare const supportedChainsByName: {
|
|
|
1801
1801
|
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
1802
1802
|
verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
|
|
1803
1803
|
};
|
|
1804
|
-
readonly xai: {
|
|
1805
|
-
blockExplorers: {
|
|
1806
|
-
readonly default: {
|
|
1807
|
-
readonly name: "Blockscout";
|
|
1808
|
-
readonly url: "https://explorer.xai-chain.net";
|
|
1809
|
-
};
|
|
1810
|
-
};
|
|
1811
|
-
blockTime?: number | undefined | undefined;
|
|
1812
|
-
contracts: {
|
|
1813
|
-
readonly multicall3: {
|
|
1814
|
-
readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
|
|
1815
|
-
readonly blockCreated: 222549;
|
|
1816
|
-
};
|
|
1817
|
-
};
|
|
1818
|
-
ensTlds?: readonly string[] | undefined;
|
|
1819
|
-
id: 660279;
|
|
1820
|
-
name: "Xai Mainnet";
|
|
1821
|
-
nativeCurrency: {
|
|
1822
|
-
readonly name: "Xai";
|
|
1823
|
-
readonly symbol: "XAI";
|
|
1824
|
-
readonly decimals: 18;
|
|
1825
|
-
};
|
|
1826
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
1827
|
-
rpcUrls: {
|
|
1828
|
-
readonly default: {
|
|
1829
|
-
readonly http: readonly ["https://xai-chain.net/rpc"];
|
|
1830
|
-
};
|
|
1831
|
-
};
|
|
1832
|
-
sourceId?: number | undefined | undefined;
|
|
1833
|
-
testnet: false;
|
|
1834
|
-
custom?: Record<string, unknown> | undefined;
|
|
1835
|
-
extendSchema?: Record<string, unknown> | undefined;
|
|
1836
|
-
fees?: import('viem').ChainFees<undefined> | undefined;
|
|
1837
|
-
formatters?: undefined;
|
|
1838
|
-
prepareTransactionRequest?: ((args: import('viem').PrepareTransactionRequestParameters, options: {
|
|
1839
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1840
|
-
}) => Promise<import('viem').PrepareTransactionRequestParameters>) | [fn: ((args: import('viem').PrepareTransactionRequestParameters, options: {
|
|
1841
|
-
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
1842
|
-
}) => Promise<import('viem').PrepareTransactionRequestParameters>) | undefined, options: {
|
|
1843
|
-
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
1844
|
-
}] | undefined;
|
|
1845
|
-
serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
|
|
1846
|
-
verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
|
|
1847
|
-
};
|
|
1848
1804
|
};
|
|
1849
1805
|
export declare const TRAILS_ROUTER_ADDRESS: `0x${string}`;
|
|
1850
1806
|
export type SupportedChainName = keyof typeof supportedChainsByName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/actions/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/actions/constants.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG5C;mEACmE;AACnE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAsCk9C,CAAC;;;;;;;;;;;;;;yCAAqnB,CAAC;;;;;;;;;;;;+BAAgrB,CAAC;mCAAgG,CAAC;;;;;;kFAA0O,CAAC;;;;;;;;;;;;;;;;4BAA0sB,CAAC;oCAAyD,CAAC;;;8BAAuI,CAAC;wBAA+B,CAAC;;;;;;;;;;;;;;;;;;8BAA8xB,CAAC;qCAA0D,CAAC;uCAA4D,CAAC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AG,MAAM,OAAO,qBAAqB,CAAA;AAEnE,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,qBAAqB,CAAC,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,CAAA;AAE1D,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAK9D,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { apeChain as n, arbitrum as o, arbitrumNova as t, avalanche as r, b3 as s, base as p, bsc as a, etherlink as E, gnosis as b, hyperEvm as h, katana as v, mainnet as e, monad as R, optimism as T, polygon as c, soneium as u, sonic as _
|
|
4
|
-
var
|
|
1
|
+
import { somnia as i } from "../customChains.js";
|
|
2
|
+
import { TRAILS_CONTRACTS as m } from "../contractConstants.js";
|
|
3
|
+
import { apeChain as n, arbitrum as o, arbitrumNova as t, avalanche as r, b3 as s, base as p, bsc as a, etherlink as E, gnosis as b, hyperEvm as h, katana as v, mainnet as e, monad as R, optimism as T, polygon as c, soneium as u, sonic as _ } from "viem/chains";
|
|
4
|
+
var S = {
|
|
5
5
|
apechain: n,
|
|
6
6
|
arbitrum: o,
|
|
7
7
|
"arbitrum-nova": t,
|
|
@@ -22,17 +22,16 @@ var d = {
|
|
|
22
22
|
optimism: T,
|
|
23
23
|
polygon: c,
|
|
24
24
|
soneium: u,
|
|
25
|
-
somnia:
|
|
26
|
-
sonic: _
|
|
27
|
-
|
|
28
|
-
}, y = i.trailsRouterAddress, N = {
|
|
25
|
+
somnia: i,
|
|
26
|
+
sonic: _
|
|
27
|
+
}, d = m.trailsRouterAddress, y = {
|
|
29
28
|
"0.01": 100,
|
|
30
29
|
"0.05": 500,
|
|
31
30
|
"0.3": 3e3,
|
|
32
31
|
1: 1e4
|
|
33
32
|
};
|
|
34
33
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
y as FEE_PERCENT_TO_FEE_TIER,
|
|
35
|
+
d as TRAILS_ROUTER_ADDRESS,
|
|
36
|
+
S as supportedChainsByName
|
|
38
37
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfiguredChainRpcClient as O } from "../../../chainRpcClient.js";
|
|
2
2
|
import { assertNonNativeTokenAddress as p, buildErc20Approve as A, feePercentToFeeTier as k, normalizeChainToChainId as P, resolveTokenAddress as d } from "../../utils.js";
|
|
3
|
-
import { factoryAddressOn as
|
|
3
|
+
import { factoryAddressOn as g, isSupportedOn as z, quoterAddressOn as N, swapRouterAddressOn as y } from "./helpers.js";
|
|
4
4
|
import { swapExactInputSingle as X, swapExactOutputSingle as R } from "./calls.js";
|
|
5
5
|
import { zeroAddress as U } from "viem";
|
|
6
6
|
var F = [{
|
|
@@ -122,8 +122,8 @@ var F = [{
|
|
|
122
122
|
type: "address"
|
|
123
123
|
}]
|
|
124
124
|
}], H = {
|
|
125
|
-
onChain: (
|
|
126
|
-
const t = P(
|
|
125
|
+
onChain: (w) => {
|
|
126
|
+
const t = P(w);
|
|
127
127
|
return {
|
|
128
128
|
swapExactInputSingle: ({ tokenIn: s, tokenOut: c, fee: m, recipient: r, deadline: a, amountIn: i, amountOutMinimum: u, sqrtPriceLimitX96: e = 0n }) => {
|
|
129
129
|
const n = d(s, t), o = d(c, t);
|
|
@@ -168,7 +168,7 @@ var F = [{
|
|
|
168
168
|
getPool: async ({ token0: s, token1: c, fee: m }) => {
|
|
169
169
|
const r = d(s, t), a = d(c, t);
|
|
170
170
|
p(r, "SushiSwap V3 token0"), p(a, "SushiSwap V3 token1");
|
|
171
|
-
const i = k(m), u =
|
|
171
|
+
const i = k(m), u = g(t), e = await O(t).readContract({
|
|
172
172
|
address: u,
|
|
173
173
|
abi: B,
|
|
174
174
|
functionName: "getPool",
|
|
@@ -185,7 +185,7 @@ var F = [{
|
|
|
185
185
|
p(e, "SushiSwap V3 tokenIn"), p(n, "SushiSwap V3 tokenOut");
|
|
186
186
|
const o = k(r), l = O(t), S = N(t);
|
|
187
187
|
if (s === "exactInputSingle") {
|
|
188
|
-
const { result:
|
|
188
|
+
const { result: b } = await l.simulateContract({
|
|
189
189
|
abi: F,
|
|
190
190
|
address: S,
|
|
191
191
|
functionName: "quoteExactInputSingle",
|
|
@@ -196,14 +196,14 @@ var F = [{
|
|
|
196
196
|
fee: o,
|
|
197
197
|
sqrtPriceLimitX96: u
|
|
198
198
|
}]
|
|
199
|
-
}), [
|
|
199
|
+
}), [x, T, V, v] = b;
|
|
200
200
|
return {
|
|
201
201
|
type: s,
|
|
202
202
|
tokenIn: e,
|
|
203
203
|
tokenOut: n,
|
|
204
204
|
feeTier: o,
|
|
205
205
|
amountIn: a,
|
|
206
|
-
amountOut:
|
|
206
|
+
amountOut: x,
|
|
207
207
|
sqrtPriceX96After: T,
|
|
208
208
|
initializedTicksCrossed: Number(V),
|
|
209
209
|
gasEstimate: v
|
|
@@ -222,7 +222,7 @@ var F = [{
|
|
|
222
222
|
fee: o,
|
|
223
223
|
sqrtPriceLimitX96: u
|
|
224
224
|
}]
|
|
225
|
-
}), [h, q, E,
|
|
225
|
+
}), [h, q, E, C] = I;
|
|
226
226
|
return {
|
|
227
227
|
type: s,
|
|
228
228
|
tokenIn: e,
|
|
@@ -232,12 +232,12 @@ var F = [{
|
|
|
232
232
|
amountOut: f,
|
|
233
233
|
sqrtPriceX96After: q,
|
|
234
234
|
initializedTicksCrossed: Number(E),
|
|
235
|
-
gasEstimate:
|
|
235
|
+
gasEstimate: C
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
},
|
|
240
|
-
factoryAddressOn:
|
|
240
|
+
factoryAddressOn: g,
|
|
241
241
|
isSupportedOn: z,
|
|
242
242
|
swapRouterAddressOn: y
|
|
243
243
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfiguredChainRpcClient as O } from "../../../chainRpcClient.js";
|
|
2
2
|
import { assertNonNativeTokenAddress as u, buildErc20Approve as A, feePercentToFeeTier as l, normalizeChainToChainId as P, resolveTokenAddress as p } from "../../utils.js";
|
|
3
|
-
import { factoryAddressOn as
|
|
3
|
+
import { factoryAddressOn as g, isSupportedOn as h, quoterV2AddressOn as v, swapRouterAddressOn as k } from "./helpers.js";
|
|
4
4
|
import { swapExactInputSingle as z, swapExactOutputSingle as X } from "./calls.js";
|
|
5
5
|
import { zeroAddress as N } from "viem";
|
|
6
6
|
var L = [{
|
|
@@ -122,8 +122,8 @@ var L = [{
|
|
|
122
122
|
type: "address"
|
|
123
123
|
}]
|
|
124
124
|
}], G = {
|
|
125
|
-
onChain: (
|
|
126
|
-
const e = P(
|
|
125
|
+
onChain: (w) => {
|
|
126
|
+
const e = P(w);
|
|
127
127
|
return {
|
|
128
128
|
swapExactInputSingle: ({ tokenIn: n, tokenOut: d, fee: c, recipient: r, amountIn: i, amountOutMinimum: a, sqrtPriceLimitX96: s = 0n }) => {
|
|
129
129
|
const t = p(n, e), o = p(d, e);
|
|
@@ -166,7 +166,7 @@ var L = [{
|
|
|
166
166
|
getPool: async ({ token0: n, token1: d, fee: c }) => {
|
|
167
167
|
const r = p(n, e), i = p(d, e);
|
|
168
168
|
u(r, "Uniswap V3 token0"), u(i, "Uniswap V3 token1");
|
|
169
|
-
const a = l(c), s =
|
|
169
|
+
const a = l(c), s = g(e), t = await O(e).readContract({
|
|
170
170
|
address: s,
|
|
171
171
|
abi: F,
|
|
172
172
|
functionName: "getPool",
|
|
@@ -183,7 +183,7 @@ var L = [{
|
|
|
183
183
|
u(s, "Uniswap V3 tokenIn"), u(t, "Uniswap V3 tokenOut");
|
|
184
184
|
const o = l(r), m = O(e), y = v(e);
|
|
185
185
|
if (n === "exactInputSingle") {
|
|
186
|
-
const { result:
|
|
186
|
+
const { result: b } = await m.simulateContract({
|
|
187
187
|
abi: L,
|
|
188
188
|
address: y,
|
|
189
189
|
functionName: "quoteExactInputSingle",
|
|
@@ -194,14 +194,14 @@ var L = [{
|
|
|
194
194
|
fee: o,
|
|
195
195
|
sqrtPriceLimitX96: 0n
|
|
196
196
|
}]
|
|
197
|
-
}), [
|
|
197
|
+
}), [x, T, U, V] = b;
|
|
198
198
|
return {
|
|
199
199
|
type: n,
|
|
200
200
|
tokenIn: s,
|
|
201
201
|
tokenOut: t,
|
|
202
202
|
feeTier: o,
|
|
203
203
|
amountIn: i,
|
|
204
|
-
amountOut:
|
|
204
|
+
amountOut: x,
|
|
205
205
|
sqrtPriceX96After: T,
|
|
206
206
|
initializedTicksCrossed: Number(U),
|
|
207
207
|
gasEstimate: V
|
|
@@ -220,7 +220,7 @@ var L = [{
|
|
|
220
220
|
fee: o,
|
|
221
221
|
sqrtPriceLimitX96: 0n
|
|
222
222
|
}]
|
|
223
|
-
}), [I, S, E,
|
|
223
|
+
}), [I, S, E, C] = q;
|
|
224
224
|
return {
|
|
225
225
|
type: n,
|
|
226
226
|
tokenIn: s,
|
|
@@ -230,12 +230,12 @@ var L = [{
|
|
|
230
230
|
amountOut: f,
|
|
231
231
|
sqrtPriceX96After: S,
|
|
232
232
|
initializedTicksCrossed: Number(E),
|
|
233
|
-
gasEstimate:
|
|
233
|
+
gasEstimate: C
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
},
|
|
238
|
-
factoryAddressOn:
|
|
238
|
+
factoryAddressOn: g,
|
|
239
239
|
isSupportedOn: h,
|
|
240
240
|
swapRouterAddressOn: k
|
|
241
241
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinationCalls.d.ts","sourceRoot":"","sources":["../../src/actions/destinationCalls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAKtC,MAAM,MAAM,qBAAqB,GAC7B,CAAC,IAAI,GAAG,IAAI,EAAE,CAAC,EAAE,GACjB,IAAI,EAAE,GACN,IAA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