0xtrails 0.13.1 → 0.14.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/abis/trailsHydrate.d.ts +5 -42
- package/dist/abis/trailsHydrate.d.ts.map +1 -1
- package/dist/abis/trailsRouter.d.ts +1 -1
- package/dist/abis/trailsRouter.d.ts.map +1 -1
- package/dist/{widget/analytics → analytics/hooks}/useWidgetAnalytics.d.ts +2 -4
- package/dist/analytics/hooks/useWidgetAnalytics.d.ts.map +1 -0
- package/dist/analytics.d.ts.map +1 -1
- package/dist/chainSwitch.d.ts.map +1 -1
- package/dist/chains-C1NhDLF_.js +4 -0
- package/dist/chains-CcoarGia.js +658 -0
- package/dist/chains.d.ts +0 -1
- package/dist/chains.d.ts.map +1 -1
- package/dist/committedIntentStore.d.ts +5 -0
- package/dist/committedIntentStore.d.ts.map +1 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/customTokens.d.ts.map +1 -1
- package/dist/error.d.ts +73 -4
- package/dist/error.d.ts.map +1 -1
- package/dist/hooks/useAddressWalletIcon.d.ts.map +1 -0
- package/dist/hooks/useAmountUsd.d.ts.map +1 -0
- package/dist/hooks/useBalanceVisible.d.ts.map +1 -0
- package/dist/hooks/useChainFilter.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useCheckout.d.ts +15 -15
- package/dist/hooks/useCheckout.d.ts.map +1 -0
- package/dist/hooks/useClickTracking.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useCombinedHistory.d.ts +3 -2
- package/dist/hooks/useCombinedHistory.d.ts.map +1 -0
- package/dist/hooks/useConnector.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useCustomTokenSearch.d.ts +7 -2
- package/dist/hooks/useCustomTokenSearch.d.ts.map +1 -0
- package/dist/hooks/useDebounce.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useDebugScreens.d.ts +2 -2
- package/dist/hooks/useDebugScreens.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useDefaultDestinationToken.d.ts +1 -1
- package/dist/hooks/useDefaultDestinationToken.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useDefaultOriginToken.d.ts +1 -1
- package/dist/hooks/useDefaultOriginToken.d.ts.map +1 -0
- package/dist/hooks/useDepositMonitor.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useDestinationSelectedToken.d.ts +2 -2
- package/dist/hooks/useDestinationSelectedToken.d.ts.map +1 -0
- package/dist/hooks/useDisplayCurrencyPreference.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useEarnPool.d.ts +1 -1
- package/dist/hooks/useEarnPool.d.ts.map +1 -0
- package/dist/hooks/useEffectiveFundBalance.d.ts +28 -0
- package/dist/hooks/useEffectiveFundBalance.d.ts.map +1 -0
- package/dist/hooks/useExecutingIntentsCount.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useExternalFundingReceiptSync.d.ts +1 -1
- package/dist/hooks/useExternalFundingReceiptSync.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useFiatOnRampCurrencies.d.ts +2 -2
- package/dist/hooks/useFiatOnRampCurrencies.d.ts.map +1 -0
- package/dist/hooks/useFiatSelectedCurrency.d.ts.map +1 -0
- package/dist/hooks/useGetIntent.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useIntentReceiptBalances.d.ts +1 -1
- package/dist/hooks/useIntentReceiptBalances.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useIntentTransactionHistory.d.ts +2 -1
- package/dist/hooks/useIntentTransactionHistory.d.ts.map +1 -0
- package/dist/hooks/useIsMobile.d.ts.map +1 -0
- package/dist/hooks/useIsSequenceWallet.d.ts.map +1 -0
- package/dist/hooks/useLocalePreference.d.ts.map +1 -0
- package/dist/hooks/useMeldTransactionHistory.d.ts.map +1 -0
- package/dist/hooks/useMeldTransactionStatus.d.ts.map +1 -0
- package/dist/hooks/useOnRampCountryDefaults.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useOnRampPaymentMethods.d.ts +2 -2
- package/dist/hooks/useOnRampPaymentMethods.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useOnRampProviderWidget.d.ts +1 -1
- package/dist/hooks/useOnRampProviderWidget.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useOnRampQuote.d.ts +3 -3
- package/dist/hooks/useOnRampQuote.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useOnRampTransactionStatus.d.ts +1 -1
- package/dist/hooks/useOnRampTransactionStatus.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useOriginSelectedToken.d.ts +1 -1
- package/dist/hooks/useOriginSelectedToken.d.ts.map +1 -0
- package/dist/hooks/usePayMessage.d.ts.map +1 -0
- package/dist/hooks/usePriceImpactWarning.d.ts.map +1 -0
- package/dist/hooks/useQuote.d.ts +439 -0
- package/dist/hooks/useQuote.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useRecentTokens.d.ts +1 -1
- package/dist/hooks/useRecentTokens.d.ts.map +1 -0
- package/dist/hooks/useRecipients.d.ts.map +1 -0
- package/dist/hooks/useSelectedFeeOption.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useSelectedFundMethod.d.ts +18 -1
- package/dist/hooks/useSelectedFundMethod.d.ts.map +1 -0
- package/dist/hooks/useSelectedRecipient.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useSendForm.d.ts +6 -11
- package/dist/hooks/useSendForm.d.ts.map +1 -0
- package/dist/hooks/useSwapAmount.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useSwapState.d.ts +1 -1
- package/dist/hooks/useSwapState.d.ts.map +1 -0
- package/dist/hooks/useTargetAmount.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useTokenList.d.ts +9 -3
- package/dist/hooks/useTokenList.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useTrailsSendTransaction.d.ts +1 -1
- package/dist/hooks/useTrailsSendTransaction.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useViewManager.d.ts +1 -1
- package/dist/hooks/useViewManager.d.ts.map +1 -0
- package/dist/hooks/useWalletConnectUri.d.ts +19 -0
- package/dist/hooks/useWalletConnectUri.d.ts.map +1 -0
- package/dist/hooks/useWalletConnectionContext.d.ts.map +1 -0
- package/dist/{widget/hooks → hooks}/useWidgetProps.d.ts +1 -1
- package/dist/hooks/useWidgetProps.d.ts.map +1 -0
- package/dist/hydrate/builder.d.ts +131 -0
- package/dist/hydrate/builder.d.ts.map +1 -0
- package/dist/hydrate/constants.d.ts +13 -0
- package/dist/hydrate/constants.d.ts.map +1 -0
- package/dist/hydrate/encodeExecute.d.ts +73 -0
- package/dist/hydrate/encodeExecute.d.ts.map +1 -0
- package/dist/hydrate/index.d.ts +6 -0
- package/dist/hydrate/index.d.ts.map +1 -0
- package/dist/hydrate/index.js +11 -0
- package/dist/hydrate/payload.d.ts +38 -0
- package/dist/hydrate/payload.d.ts.map +1 -0
- package/dist/hydrate/selectors.d.ts +28 -0
- package/dist/hydrate/selectors.d.ts.map +1 -0
- package/dist/hydrate/types.d.ts +19 -0
- package/dist/hydrate/types.d.ts.map +1 -0
- package/dist/hydrate/utils.d.ts +8 -0
- package/dist/hydrate/utils.d.ts.map +1 -0
- package/dist/hydrate-Cr9eaeDK.js +654 -0
- package/dist/index.d.ts +20 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +156 -610
- package/dist/intentConfigStore.d.ts +8 -0
- package/dist/intentConfigStore.d.ts.map +1 -0
- package/dist/intentProtocolApi.d.ts +11 -0
- package/dist/intentProtocolApi.d.ts.map +1 -0
- package/dist/intentProtocolEncoding.d.ts +25 -0
- package/dist/intentProtocolEncoding.d.ts.map +1 -0
- package/dist/intentProtocolResolver.d.ts +28 -0
- package/dist/intentProtocolResolver.d.ts.map +1 -0
- package/dist/intentReceiptPoller.d.ts.map +1 -1
- package/dist/intentValidation.d.ts +5 -0
- package/dist/intentValidation.d.ts.map +1 -0
- package/dist/intents.d.ts +8 -2
- package/dist/intents.d.ts.map +1 -1
- package/dist/keyMachineClient.d.ts +9 -0
- package/dist/keyMachineClient.d.ts.map +1 -0
- package/dist/keymachine/index.d.ts +34 -0
- package/dist/keymachine/index.d.ts.map +1 -0
- package/dist/keymachine/key-machine.gen.d.ts +461 -0
- package/dist/keymachine/key-machine.gen.d.ts.map +1 -0
- package/dist/mutations.d.ts.map +1 -1
- package/dist/offlineRecovery.d.ts +24 -0
- package/dist/offlineRecovery.d.ts.map +1 -0
- package/dist/onramp/MeshConnectFlow.d.ts +27 -0
- package/dist/onramp/MeshConnectFlow.d.ts.map +1 -0
- package/dist/onramp/MeshConnectIframe.d.ts +22 -0
- package/dist/onramp/MeshConnectIframe.d.ts.map +1 -0
- package/dist/onramp/SendFromExchangeButton.d.ts +16 -0
- package/dist/onramp/SendFromExchangeButton.d.ts.map +1 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts +31 -0
- package/dist/onramp/TrailsOnRampProvider.d.ts.map +1 -0
- package/dist/onramp/index.d.ts +13 -0
- package/dist/onramp/index.d.ts.map +1 -0
- package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts +10 -0
- package/dist/onramp/mesh/components/MeshExchangeConfirmation.d.ts.map +1 -0
- package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts +13 -0
- package/dist/onramp/mesh/components/MeshExchangeIcon.d.ts.map +1 -0
- package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts +12 -0
- package/dist/onramp/mesh/components/MeshExchangeSelection.d.ts.map +1 -0
- package/dist/onramp/mesh/components/MeshSessionOptions.d.ts +15 -0
- package/dist/onramp/mesh/components/MeshSessionOptions.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts +9 -0
- package/dist/onramp/mesh/hooks/useMeshAccessTokens.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts +11 -0
- package/dist/onramp/mesh/hooks/useMeshFundingSelection.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts +71 -0
- package/dist/onramp/mesh/hooks/useMeshOnrampFlow.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts +32 -0
- package/dist/onramp/mesh/hooks/useMeshOnrampSessionState.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts +19 -0
- package/dist/onramp/mesh/hooks/useMeshSelectedTokenBalance.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts +15 -0
- package/dist/onramp/mesh/hooks/useMeshSessionAccountBalance.d.ts.map +1 -0
- package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts +7 -0
- package/dist/onramp/mesh/hooks/useMeshSessionStorage.d.ts.map +1 -0
- package/dist/onramp/meshSessionStorage.d.ts +13 -0
- package/dist/onramp/meshSessionStorage.d.ts.map +1 -0
- package/dist/onramp/meshconnect.d.ts +32 -0
- package/dist/onramp/meshconnect.d.ts.map +1 -0
- package/dist/onramp/trailsOnramp.d.ts +32 -0
- package/dist/onramp/trailsOnramp.d.ts.map +1 -0
- package/dist/onramp-client/index.d.ts +3 -3
- package/dist/onramp-client/index.d.ts.map +1 -1
- package/dist/onrampClient.d.ts.map +1 -1
- package/dist/prepareSend.d.ts +3 -2
- package/dist/prepareSend.d.ts.map +1 -1
- package/dist/query/balance.fetchers.d.ts +27 -0
- package/dist/query/balance.fetchers.d.ts.map +1 -1
- package/dist/query/balance.hooks.d.ts +19 -0
- package/dist/query/balance.hooks.d.ts.map +1 -1
- package/dist/query/balance.queries.d.ts +18 -1
- package/dist/query/balance.queries.d.ts.map +1 -1
- package/dist/query/chains.queries.d.ts.map +1 -1
- package/dist/query/intentProtocol.queries.d.ts +32 -0
- package/dist/query/intentProtocol.queries.d.ts.map +1 -0
- package/dist/query/meld.fetchers.d.ts +1 -1
- package/dist/query/meld.fetchers.d.ts.map +1 -1
- package/dist/query/meld.hooks.d.ts +3 -3
- package/dist/query/meld.hooks.d.ts.map +1 -1
- package/dist/query/meld.queries.d.ts +1 -1
- package/dist/query/meld.queries.d.ts.map +1 -1
- package/dist/query/tokenList.queries.d.ts +54 -0
- package/dist/query/tokenList.queries.d.ts.map +1 -0
- package/dist/recover.d.ts +71 -23
- package/dist/recover.d.ts.map +1 -1
- package/dist/src-4HYDQv2T.js +48798 -0
- package/dist/tokens.d.ts +13 -0
- package/dist/tokens.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts +3 -4
- package/dist/transactionIntent/deposits/depositOrchestrator.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts +3 -4
- package/dist/transactionIntent/deposits/gaslessDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/deposits/standardDeposit.d.ts +2 -5
- package/dist/transactionIntent/deposits/standardDeposit.d.ts.map +1 -1
- package/dist/transactionIntent/handlers/intentHandler.d.ts +4 -4
- package/dist/transactionIntent/handlers/intentHandler.d.ts.map +1 -1
- package/dist/transactionIntent/helpers/transactionStateHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/quote/normalizeQuote.d.ts.map +1 -1
- package/dist/transactionIntent/quote/quoteHelpers.d.ts +2 -2
- package/dist/transactionIntent/quote/quoteHelpers.d.ts.map +1 -1
- package/dist/transactionIntent/types.d.ts +4 -4
- package/dist/transactionIntent/types.d.ts.map +1 -1
- package/dist/transactions.d.ts +4 -0
- package/dist/transactions.d.ts.map +1 -1
- package/dist/umd/trails.min.js +1371 -322
- package/dist/utils/localStorageGc.d.ts +22 -0
- package/dist/utils/localStorageGc.d.ts.map +1 -0
- package/dist/walletUtils.d.ts +2 -1
- package/dist/walletUtils.d.ts.map +1 -1
- package/dist/wallets.d.ts +13 -54
- package/dist/wallets.d.ts.map +1 -1
- package/dist/widget/components/AccountIntentTransactionHistory.d.ts.map +1 -1
- package/dist/widget/components/ClassicSwap.d.ts.map +1 -1
- package/dist/widget/components/ConnectWallet.d.ts.map +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts +1 -1
- package/dist/widget/components/ConnectedWallets.d.ts.map +1 -1
- package/dist/widget/components/DirectTransfer.d.ts +1 -1
- package/dist/widget/components/DirectTransfer.d.ts.map +1 -1
- package/dist/widget/components/Earn.d.ts +2 -6
- package/dist/widget/components/Earn.d.ts.map +1 -1
- package/dist/widget/components/FeeOption.d.ts +1 -1
- package/dist/widget/components/FeeOption.d.ts.map +1 -1
- package/dist/widget/components/FeeOptions.d.ts +1 -1
- package/dist/widget/components/FeeOptions.d.ts.map +1 -1
- package/dist/widget/components/FiatSelector.d.ts +1 -1
- package/dist/widget/components/FiatSelector.d.ts.map +1 -1
- package/dist/widget/components/FiatSelectorButton.d.ts +1 -1
- package/dist/widget/components/FiatSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Fund.d.ts +1 -1
- package/dist/widget/components/Fund.d.ts.map +1 -1
- package/dist/widget/components/FundMethods.d.ts.map +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.d.ts +1 -1
- package/dist/widget/components/FundingMethodSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/MeldHistory.d.ts +1 -1
- package/dist/widget/components/MeldHistory.d.ts.map +1 -1
- package/dist/widget/components/MeldTransactionStatus.d.ts +1 -1
- package/dist/widget/components/MeldTransactionStatus.d.ts.map +1 -1
- package/dist/widget/components/MeshExchangeAccountHeader.d.ts +9 -0
- package/dist/widget/components/MeshExchangeAccountHeader.d.ts.map +1 -0
- package/dist/widget/components/OnrampHistoryRow.d.ts +2 -2
- package/dist/widget/components/OnrampHistoryRow.d.ts.map +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.d.ts +1 -1
- package/dist/widget/components/OnrampProviderConfirmation.d.ts.map +1 -1
- package/dist/widget/components/Pay.d.ts.map +1 -1
- package/dist/widget/components/PoolDeposit.d.ts +2 -6
- package/dist/widget/components/PoolDeposit.d.ts.map +1 -1
- package/dist/widget/components/PoolWithdraw.d.ts +2 -2
- package/dist/widget/components/PoolWithdraw.d.ts.map +1 -1
- package/dist/widget/components/PulsatingButton.d.ts +9 -0
- package/dist/widget/components/PulsatingButton.d.ts.map +1 -0
- package/dist/widget/components/QRCodeWalletSelect.d.ts +1 -1
- package/dist/widget/components/QRCodeWalletSelect.d.ts.map +1 -1
- package/dist/widget/components/QuoteDetails.d.ts.map +1 -1
- package/dist/widget/components/Receipt.d.ts +1 -1
- package/dist/widget/components/Receipt.d.ts.map +1 -1
- package/dist/widget/components/RecipientSelectorButton.d.ts.map +1 -1
- package/dist/widget/components/Recipients.d.ts.map +1 -1
- package/dist/widget/components/RefundWarning.d.ts.map +1 -1
- package/dist/widget/components/Swap.d.ts +2 -6
- package/dist/widget/components/Swap.d.ts.map +1 -1
- package/dist/widget/components/TokenList.d.ts +1 -0
- package/dist/widget/components/TokenList.d.ts.map +1 -1
- package/dist/widget/components/TokenSelector.d.ts +1 -2
- package/dist/widget/components/TokenSelector.d.ts.map +1 -1
- package/dist/widget/components/TransactionDetails.d.ts +1 -0
- package/dist/widget/components/TransactionDetails.d.ts.map +1 -1
- package/dist/widget/components/TransactionHistoryItem.d.ts +1 -0
- package/dist/widget/components/TransactionHistoryItem.d.ts.map +1 -1
- package/dist/widget/components/TransferPendingVertical.d.ts +2 -1
- package/dist/widget/components/TransferPendingVertical.d.ts.map +1 -1
- package/dist/widget/components/WalletAccountHeader.d.ts +7 -0
- package/dist/widget/components/WalletAccountHeader.d.ts.map +1 -0
- package/dist/widget/components/WalletConfirmation.d.ts +2 -1
- package/dist/widget/components/WalletConfirmation.d.ts.map +1 -1
- package/dist/widget/components/WalletConnect.d.ts.map +1 -1
- package/dist/widget/components/WalletList.d.ts.map +1 -1
- package/dist/widget/components/WidgetProviders.d.ts.map +1 -1
- package/dist/widget/components/Withdraw.d.ts.map +1 -1
- package/dist/widget/index.d.ts +13 -0
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +16 -8
- package/dist/widget/modes/EarnWidget.d.ts +83 -0
- package/dist/widget/modes/EarnWidget.d.ts.map +1 -0
- package/dist/widget/modes/FundWidget.d.ts +103 -0
- package/dist/widget/modes/FundWidget.d.ts.map +1 -0
- package/dist/widget/modes/PayWidget.d.ts +86 -0
- package/dist/widget/modes/PayWidget.d.ts.map +1 -0
- package/dist/widget/modes/SwapWidget.d.ts +82 -0
- package/dist/widget/modes/SwapWidget.d.ts.map +1 -0
- package/dist/widget/modes/WithdrawWidget.d.ts +71 -0
- package/dist/widget/modes/WithdrawWidget.d.ts.map +1 -0
- package/dist/widget/providers/TrailsProvider.d.ts +5 -0
- package/dist/widget/providers/TrailsProvider.d.ts.map +1 -1
- package/dist/widget/shared/mapSharedProps.d.ts +9 -0
- package/dist/widget/shared/mapSharedProps.d.ts.map +1 -0
- package/dist/widget/shared/methodMap.d.ts +18 -0
- package/dist/widget/shared/methodMap.d.ts.map +1 -0
- package/dist/widget/shared/resolution.d.ts +22 -0
- package/dist/widget/shared/resolution.d.ts.map +1 -0
- package/dist/widget/shared/resolvePaymentSource.d.ts +34 -0
- package/dist/widget/shared/resolvePaymentSource.d.ts.map +1 -0
- package/dist/widget/shared/types.d.ts +94 -0
- package/dist/widget/shared/types.d.ts.map +1 -0
- package/dist/widget/types/commonProps.d.ts +3 -7
- package/dist/widget/types/commonProps.d.ts.map +1 -1
- package/dist/widget/utils/createWagmiConfig.d.ts +2 -2
- package/dist/widget/utils/createWagmiConfig.d.ts.map +1 -1
- package/dist/widget/utils/fundMethodSwitchState.d.ts +2 -0
- package/dist/widget/utils/fundMethodSwitchState.d.ts.map +1 -1
- package/dist/widget/utils/meldProviderUtils.d.ts +1 -1
- package/dist/widget/utils/meldProviderUtils.d.ts.map +1 -1
- package/dist/widget/utils/meshSupportedTokens.d.ts +4 -0
- package/dist/widget/utils/meshSupportedTokens.d.ts.map +1 -0
- package/dist/widget/utils/onrampConfig.d.ts +11 -0
- package/dist/widget/utils/onrampConfig.d.ts.map +1 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts +18 -0
- package/dist/widget/utils/trailsOnrampConfig.d.ts.map +1 -0
- package/dist/widget/utils/viewManagerGuards.d.ts +1 -1
- package/dist/widget/utils/viewManagerGuards.d.ts.map +1 -1
- package/dist/widget/widget.d.ts +45 -24
- package/dist/widget/widget.d.ts.map +1 -1
- package/package.json +20 -24
- package/dist/buffer.d.ts +0 -3
- package/dist/buffer.d.ts.map +0 -1
- package/dist/ccip-DStzFCYT.js +0 -230
- package/dist/index-HY9_ppit.js +0 -101240
- package/dist/onramp-client/trails-onramp.gen.d.ts +0 -570
- package/dist/onramp-client/trails-onramp.gen.d.ts.map +0 -1
- package/dist/paymasterSend.d.ts +0 -90
- package/dist/paymasterSend.d.ts.map +0 -1
- package/dist/sendUserOp.d.ts +0 -122
- package/dist/sendUserOp.d.ts.map +0 -1
- package/dist/toSimpleSmartAccount.d.ts +0 -95
- package/dist/toSimpleSmartAccount.d.ts.map +0 -1
- package/dist/transactionIntent/utils/erc20Approval.d.ts +0 -34
- package/dist/transactionIntent/utils/erc20Approval.d.ts.map +0 -1
- package/dist/utils/allowance.d.ts +0 -19
- package/dist/utils/allowance.d.ts.map +0 -1
- package/dist/widget/analytics/useWidgetAnalytics.d.ts.map +0 -1
- package/dist/widget/components/FeeBreakdown.d.ts +0 -9
- package/dist/widget/components/FeeBreakdown.d.ts.map +0 -1
- package/dist/widget/components/HideBalances.d.ts +0 -4
- package/dist/widget/components/HideBalances.d.ts.map +0 -1
- package/dist/widget/components/OnrampDeposit.d.ts +0 -10
- package/dist/widget/components/OnrampDeposit.d.ts.map +0 -1
- package/dist/widget/components/SwapSettings.d.ts +0 -4
- package/dist/widget/components/SwapSettings.d.ts.map +0 -1
- package/dist/widget/components/TruncatedAddress.d.ts +0 -12
- package/dist/widget/components/TruncatedAddress.d.ts.map +0 -1
- package/dist/widget/components/WalletImage.d.ts +0 -8
- package/dist/widget/components/WalletImage.d.ts.map +0 -1
- package/dist/widget/css/compiled.css +0 -26
- package/dist/widget/css/index.css +0 -686
- package/dist/widget/hooks/useAddressWalletIcon.d.ts.map +0 -1
- package/dist/widget/hooks/useAmountUsd.d.ts.map +0 -1
- package/dist/widget/hooks/useBalanceVisible.d.ts.map +0 -1
- package/dist/widget/hooks/useChainFilter.d.ts.map +0 -1
- package/dist/widget/hooks/useCheckout.d.ts.map +0 -1
- package/dist/widget/hooks/useClickTracking.d.ts.map +0 -1
- package/dist/widget/hooks/useCombinedHistory.d.ts.map +0 -1
- package/dist/widget/hooks/useConnector.d.ts.map +0 -1
- package/dist/widget/hooks/useCustomTokenFetch.d.ts +0 -19
- package/dist/widget/hooks/useCustomTokenFetch.d.ts.map +0 -1
- package/dist/widget/hooks/useCustomTokenSearch.d.ts.map +0 -1
- package/dist/widget/hooks/useDebounce.d.ts.map +0 -1
- package/dist/widget/hooks/useDebugScreens.d.ts.map +0 -1
- package/dist/widget/hooks/useDefaultDestinationToken.d.ts.map +0 -1
- package/dist/widget/hooks/useDefaultOriginToken.d.ts.map +0 -1
- package/dist/widget/hooks/useDepositMonitor.d.ts.map +0 -1
- package/dist/widget/hooks/useDestinationSelectedToken.d.ts.map +0 -1
- package/dist/widget/hooks/useDisplayCurrencyPreference.d.ts.map +0 -1
- package/dist/widget/hooks/useEarnPool.d.ts.map +0 -1
- package/dist/widget/hooks/useExecutingIntentsCount.d.ts.map +0 -1
- package/dist/widget/hooks/useExternalFundingReceiptSync.d.ts.map +0 -1
- package/dist/widget/hooks/useFiatOnRampCurrencies.d.ts.map +0 -1
- package/dist/widget/hooks/useFiatSelectedCurrency.d.ts.map +0 -1
- package/dist/widget/hooks/useGetIntent.d.ts.map +0 -1
- package/dist/widget/hooks/useIntentReceiptBalances.d.ts.map +0 -1
- package/dist/widget/hooks/useIntentTransactionHistory.d.ts.map +0 -1
- package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts +0 -7
- package/dist/widget/hooks/useIsConnectedWalletSmartContract.d.ts.map +0 -1
- package/dist/widget/hooks/useIsMobile.d.ts.map +0 -1
- package/dist/widget/hooks/useIsSequenceWallet.d.ts.map +0 -1
- package/dist/widget/hooks/useLocalePreference.d.ts.map +0 -1
- package/dist/widget/hooks/useMeldTransactionHistory.d.ts.map +0 -1
- package/dist/widget/hooks/useMeldTransactionStatus.d.ts.map +0 -1
- package/dist/widget/hooks/useOnRampCountryDefaults.d.ts.map +0 -1
- package/dist/widget/hooks/useOnRampPaymentMethods.d.ts.map +0 -1
- package/dist/widget/hooks/useOnRampProviderWidget.d.ts.map +0 -1
- package/dist/widget/hooks/useOnRampQuote.d.ts.map +0 -1
- package/dist/widget/hooks/useOnRampTransactionStatus.d.ts.map +0 -1
- package/dist/widget/hooks/useOriginSelectedToken.d.ts.map +0 -1
- package/dist/widget/hooks/usePayMessage.d.ts.map +0 -1
- package/dist/widget/hooks/usePriceImpactWarning.d.ts.map +0 -1
- package/dist/widget/hooks/useQuote.d.ts +0 -378
- package/dist/widget/hooks/useQuote.d.ts.map +0 -1
- package/dist/widget/hooks/useRecentTokens.d.ts.map +0 -1
- package/dist/widget/hooks/useRecipients.d.ts.map +0 -1
- package/dist/widget/hooks/useScreenTracking.d.ts +0 -2
- package/dist/widget/hooks/useScreenTracking.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedFeeOption.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedFundMethod.d.ts.map +0 -1
- package/dist/widget/hooks/useSelectedRecipient.d.ts.map +0 -1
- package/dist/widget/hooks/useSendForm.d.ts.map +0 -1
- package/dist/widget/hooks/useSwapAmount.d.ts.map +0 -1
- package/dist/widget/hooks/useSwapState.d.ts.map +0 -1
- package/dist/widget/hooks/useTargetAmount.d.ts.map +0 -1
- package/dist/widget/hooks/useTheme.d.ts.map +0 -1
- package/dist/widget/hooks/useTokenList.d.ts.map +0 -1
- package/dist/widget/hooks/useTokenWithFreshBalance.d.ts +0 -18
- package/dist/widget/hooks/useTokenWithFreshBalance.d.ts.map +0 -1
- package/dist/widget/hooks/useTrailsSendTransaction.d.ts.map +0 -1
- package/dist/widget/hooks/useViewManager.d.ts.map +0 -1
- package/dist/widget/hooks/useWalletConnectUri.d.ts +0 -11
- package/dist/widget/hooks/useWalletConnectUri.d.ts.map +0 -1
- package/dist/widget/hooks/useWalletConnectionContext.d.ts.map +0 -1
- package/dist/widget/hooks/useWidgetProps.d.ts.map +0 -1
- package/dist/widget/types.d.ts +0 -44
- package/dist/widget/types.d.ts.map +0 -1
- package/dist/widget/utils/historyUtils.d.ts +0 -18
- package/dist/widget/utils/historyUtils.d.ts.map +0 -1
- package/src/abi.ts +0 -38
- package/src/abis/erc20.ts +0 -60
- package/src/abis/trailsHydrate.ts +0 -185
- package/src/abis/trailsRouter.ts +0 -121
- package/src/abis/trailsSweep.ts +0 -32
- package/src/abortController.ts +0 -35
- package/src/analytics.ts +0 -2029
- package/src/buffer.ts +0 -10
- package/src/chainSwitch.ts +0 -95
- package/src/chains.ts +0 -565
- package/src/config.ts +0 -118
- package/src/constants.ts +0 -237
- package/src/contractUtils.ts +0 -46
- package/src/cssUtils.ts +0 -5
- package/src/customChains.ts +0 -24
- package/src/customTokens.ts +0 -147
- package/src/decoders.ts +0 -365
- package/src/ens.ts +0 -74
- package/src/error.ts +0 -268
- package/src/estimate.ts +0 -480
- package/src/explorer.ts +0 -38
- package/src/fees.ts +0 -362
- package/src/gasless.ts +0 -638
- package/src/index.ts +0 -204
- package/src/indexerClient.ts +0 -118
- package/src/intentReceiptMonitor.ts +0 -99
- package/src/intentReceiptPoller.ts +0 -327
- package/src/intents.ts +0 -1125
- package/src/localeUtils.ts +0 -244
- package/src/logger/index.ts +0 -95
- package/src/logger/useSyncLoggerDebug.ts +0 -11
- package/src/logger.ts +0 -1
- package/src/meld/components/MeldCountriesList.tsx +0 -237
- package/src/meld/components/MeldFundMethods.tsx +0 -265
- package/src/meld/components/MeldProvidersList.tsx +0 -187
- package/src/meld/components/MeldTokensList.tsx +0 -321
- package/src/meld/components/SimpleHeader.tsx +0 -35
- package/src/meld/utils/meld.ts +0 -77
- package/src/mutations.ts +0 -166
- package/src/onramp-client/index.ts +0 -54
- package/src/onramp-client/trails-onramp.gen.ts +0 -1320
- package/src/onrampClient.ts +0 -46
- package/src/paymasterSend.ts +0 -521
- package/src/placeholder.ts +0 -92
- package/src/poolUtils.ts +0 -222
- package/src/pools.ts +0 -120
- package/src/prepareSend.ts +0 -552
- package/src/query/balance.fetchers.ts +0 -623
- package/src/query/balance.hooks.ts +0 -298
- package/src/query/balance.queries.ts +0 -244
- package/src/query/chains.hooks.ts +0 -45
- package/src/query/chains.queries.ts +0 -22
- package/src/query/client.ts +0 -20
- package/src/query/fiat.fetchers.ts +0 -33
- package/src/query/fiat.hooks.ts +0 -71
- package/src/query/fiat.queries.ts +0 -67
- package/src/query/geo.fetchers.ts +0 -100
- package/src/query/geo.hooks.ts +0 -16
- package/src/query/geo.queries.ts +0 -36
- package/src/query/helpers.ts +0 -81
- package/src/query/meld.fetchers.ts +0 -97
- package/src/query/meld.hooks.ts +0 -18
- package/src/query/meld.queries.ts +0 -184
- package/src/query/persister.ts +0 -11
- package/src/query/price.fetchers.ts +0 -53
- package/src/query/price.hooks.ts +0 -46
- package/src/query/price.queries.ts +0 -364
- package/src/queryParams.ts +0 -100
- package/src/recover.ts +0 -1665
- package/src/sendUserOp.ts +0 -512
- package/src/theme.ts +0 -2
- package/src/toSimpleSmartAccount.ts +0 -567
- package/src/toast.ts +0 -110
- package/src/tokens.ts +0 -1780
- package/src/trailsClient.ts +0 -40
- package/src/transactionIntent/constants.ts +0 -15
- package/src/transactionIntent/deposits/depositOrchestrator.ts +0 -243
- package/src/transactionIntent/deposits/gaslessDeposit.ts +0 -705
- package/src/transactionIntent/deposits/index.ts +0 -3
- package/src/transactionIntent/deposits/standardDeposit.ts +0 -594
- package/src/transactionIntent/execution/index.ts +0 -1
- package/src/transactionIntent/execution/transactionState.ts +0 -38
- package/src/transactionIntent/handlers/index.ts +0 -1
- package/src/transactionIntent/handlers/intentHandler.ts +0 -1596
- package/src/transactionIntent/helpers/index.ts +0 -1
- package/src/transactionIntent/helpers/transactionStateHelpers.ts +0 -437
- package/src/transactionIntent/index.ts +0 -10
- package/src/transactionIntent/quote/feeExtractors.ts +0 -61
- package/src/transactionIntent/quote/index.ts +0 -3
- package/src/transactionIntent/quote/normalizeQuote.ts +0 -553
- package/src/transactionIntent/quote/quoteHelpers.ts +0 -117
- package/src/transactionIntent/types.ts +0 -241
- package/src/transactionIntent/utils/balanceChecker.ts +0 -103
- package/src/transactionIntent/utils/erc20Approval.ts +0 -171
- package/src/transactionIntent/utils/index.ts +0 -2
- package/src/transactionIntent/utils/resilientDepositTracker.ts +0 -171
- package/src/transactionIntent/utils/testnetHelpers.ts +0 -5
- package/src/transactionIntent/validators.ts +0 -27
- package/src/transactions.ts +0 -426
- package/src/types.d.ts +0 -16
- package/src/umd.tsx +0 -33
- package/src/utils/address.ts +0 -78
- package/src/utils/allowance.ts +0 -47
- package/src/utils/fiat.ts +0 -32
- package/src/utils/format.ts +0 -625
- package/src/utils/passthrough.ts +0 -93
- package/src/utils/time.ts +0 -118
- package/src/utils/validation.ts +0 -104
- package/src/utils.ts +0 -112
- package/src/version.ts +0 -8
- package/src/vite-env.d.ts +0 -4
- package/src/walletUtils.ts +0 -292
- package/src/wallets.ts +0 -740
- package/src/widget/analytics/useWidgetAnalytics.ts +0 -56
- package/src/widget/assets/Binance_Icon_Logo.svg +0 -14
- package/src/widget/assets/Bitfinex_Icon_Logo.svg +0 -5
- package/src/widget/assets/Coinbase_Icon_Logo.svg +0 -1
- package/src/widget/assets/Exchange-icon-black.svg +0 -5
- package/src/widget/assets/MetaMask-icon-fox-with-margins.svg +0 -31
- package/src/widget/assets/MetaMask-icon-fox.svg +0 -26
- package/src/widget/assets/MetaMask-logo-black.svg +0 -3
- package/src/widget/assets/MetaMask-logo-white.svg +0 -16
- package/src/widget/assets/Trails-logo-black.svg +0 -13
- package/src/widget/assets/Trails-logo-white.svg +0 -13
- package/src/widget/assets/WalletChange-black.svg +0 -5
- package/src/widget/assets/WalletConnect-logo-black.svg +0 -14
- package/src/widget/assets/WalletConnect-logo-blue-bg.svg +0 -11
- package/src/widget/assets/WalletConnect-logo-blue.svg +0 -14
- package/src/widget/assets/WalletConnect-logo-white.svg +0 -14
- package/src/widget/assets/WalletConnect-logo.svg +0 -40
- package/src/widget/assets/aave.svg +0 -14
- package/src/widget/assets/morpho.svg +0 -14
- package/src/widget/assets/sequence-logo.svg +0 -15
- package/src/widget/compiled.css +0 -26
- package/src/widget/components/AccountActionsDropdown.tsx +0 -31
- package/src/widget/components/AccountIntentTransactionHistory.tsx +0 -756
- package/src/widget/components/AccountIntentTransactionHistoryButton.tsx +0 -34
- package/src/widget/components/AccountSettings.tsx +0 -168
- package/src/widget/components/AddressOrEnsName.tsx +0 -24
- package/src/widget/components/AddressWalletIcon.tsx +0 -49
- package/src/widget/components/AllChainsIcon.tsx +0 -54
- package/src/widget/components/ChainFilterDropdown.tsx +0 -220
- package/src/widget/components/ChainImage.tsx +0 -40
- package/src/widget/components/ChainList.tsx +0 -158
- package/src/widget/components/ClassicSwap.tsx +0 -1744
- package/src/widget/components/ConfigDisplay.tsx +0 -158
- package/src/widget/components/ConnectWallet.tsx +0 -564
- package/src/widget/components/ConnectedWallets.tsx +0 -417
- package/src/widget/components/CopyButton.tsx +0 -108
- package/src/widget/components/CountryFilterDropdown.tsx +0 -179
- package/src/widget/components/DebugMenu.tsx +0 -50
- package/src/widget/components/DebugScreensList.tsx +0 -70
- package/src/widget/components/DebugToast.tsx +0 -63
- package/src/widget/components/DepositTracker.tsx +0 -326
- package/src/widget/components/DirectTransfer.tsx +0 -302
- package/src/widget/components/Disconnect.tsx +0 -68
- package/src/widget/components/DynamicInputStyles.tsx +0 -121
- package/src/widget/components/DynamicSizeInputField.tsx +0 -245
- package/src/widget/components/ENSAvatar.tsx +0 -33
- package/src/widget/components/Earn.tsx +0 -160
- package/src/widget/components/EarnPools.tsx +0 -417
- package/src/widget/components/EarnPoolsFilters.tsx +0 -165
- package/src/widget/components/ErrorAnimationIcon.tsx +0 -130
- package/src/widget/components/ErrorDisplay.tsx +0 -152
- package/src/widget/components/ExecutingIntentsBadge.tsx +0 -24
- package/src/widget/components/ExecutionStatusBadge.tsx +0 -53
- package/src/widget/components/FeeBreakdown.tsx +0 -155
- package/src/widget/components/FeeOption.tsx +0 -170
- package/src/widget/components/FeeOptions.tsx +0 -247
- package/src/widget/components/FiatSelector.tsx +0 -308
- package/src/widget/components/FiatSelectorButton.tsx +0 -68
- package/src/widget/components/Footer.tsx +0 -67
- package/src/widget/components/Fund.tsx +0 -2331
- package/src/widget/components/FundMethods.tsx +0 -427
- package/src/widget/components/FundWalletSelection.tsx +0 -60
- package/src/widget/components/FundingMethodSelectorButton.tsx +0 -106
- package/src/widget/components/GreenCheckAnimation.tsx +0 -119
- package/src/widget/components/HideBalances.tsx +0 -24
- package/src/widget/components/HighPriceImpactBlock.tsx +0 -44
- package/src/widget/components/HookModalContent.tsx +0 -377
- package/src/widget/components/Identicon.tsx +0 -228
- package/src/widget/components/LoadingSpinner.tsx +0 -9
- package/src/widget/components/MeldForm.tsx +0 -780
- package/src/widget/components/MeldHistory.tsx +0 -433
- package/src/widget/components/MeldStepsFlow.tsx +0 -1651
- package/src/widget/components/MeldTransactionStatus.tsx +0 -255
- package/src/widget/components/Modal.tsx +0 -86
- package/src/widget/components/OFTProgressBar.tsx +0 -89
- package/src/widget/components/OnRampProviderSelector.tsx +0 -263
- package/src/widget/components/OnrampDeposit.tsx +0 -122
- package/src/widget/components/OnrampErrorScreen.tsx +0 -163
- package/src/widget/components/OnrampHistoryRow.tsx +0 -321
- package/src/widget/components/OnrampPaymentMethods.tsx +0 -81
- package/src/widget/components/OnrampProviderConfirmation.tsx +0 -1060
- package/src/widget/components/OriginSelectionAmount.tsx +0 -144
- package/src/widget/components/OriginTransferInformation.tsx +0 -59
- package/src/widget/components/Pay.tsx +0 -1181
- package/src/widget/components/PaymentMethods.tsx +0 -198
- package/src/widget/components/PercentageMaxButtons.tsx +0 -112
- package/src/widget/components/PoolDeposit.tsx +0 -651
- package/src/widget/components/PoolWithdraw.tsx +0 -761
- package/src/widget/components/PriceImpactWarning.tsx +0 -87
- package/src/widget/components/QRCodeOptions.tsx +0 -65
- package/src/widget/components/QRCodeWalletSelect.tsx +0 -77
- package/src/widget/components/QrCode.tsx +0 -216
- package/src/widget/components/QuoteDetails.tsx +0 -1266
- package/src/widget/components/Receipt.tsx +0 -673
- package/src/widget/components/ReceiptRecoverableFunds.tsx +0 -135
- package/src/widget/components/RecentTokens.tsx +0 -66
- package/src/widget/components/RecipientSelectorButton.tsx +0 -50
- package/src/widget/components/Recipients.tsx +0 -412
- package/src/widget/components/RefundWarning.tsx +0 -66
- package/src/widget/components/RequiredPropsError.tsx +0 -33
- package/src/widget/components/ScreenHeader.tsx +0 -123
- package/src/widget/components/SearchInputField.tsx +0 -99
- package/src/widget/components/SessionTimeoutScreen.tsx +0 -103
- package/src/widget/components/ShadowPortal.tsx +0 -99
- package/src/widget/components/ShadowRootContext.tsx +0 -17
- package/src/widget/components/SimpleRecipientInputScreen.tsx +0 -91
- package/src/widget/components/SlippageToleranceSettings.tsx +0 -279
- package/src/widget/components/Swap.tsx +0 -50
- package/src/widget/components/SwapDisplay.tsx +0 -68
- package/src/widget/components/SwapSettings.tsx +0 -52
- package/src/widget/components/ThemeProvider.tsx +0 -115
- package/src/widget/components/ThemeSyncer.tsx +0 -47
- package/src/widget/components/Toast.tsx +0 -336
- package/src/widget/components/TokenDisplayNonSelectable.tsx +0 -40
- package/src/widget/components/TokenImage.tsx +0 -156
- package/src/widget/components/TokenList.tsx +0 -107
- package/src/widget/components/TokenSelector.tsx +0 -738
- package/src/widget/components/TokenSelectorButton.tsx +0 -123
- package/src/widget/components/TokenSkeleton.tsx +0 -53
- package/src/widget/components/Tooltip.tsx +0 -64
- package/src/widget/components/TrailsHookModal.tsx +0 -107
- package/src/widget/components/TransactionDetails.tsx +0 -488
- package/src/widget/components/TransactionHistoryItem.tsx +0 -767
- package/src/widget/components/TransferPendingVertical.tsx +0 -583
- package/src/widget/components/TruncatedAddress.tsx +0 -68
- package/src/widget/components/TruncatedTransactionHash.tsx +0 -74
- package/src/widget/components/UserPreferences.tsx +0 -570
- package/src/widget/components/WaasFeeOptions.tsx +0 -588
- package/src/widget/components/WalletConfirmation.tsx +0 -220
- package/src/widget/components/WalletConnect.tsx +0 -351
- package/src/widget/components/WalletConnectionPending.tsx +0 -178
- package/src/widget/components/WalletImage.tsx +0 -64
- package/src/widget/components/WalletList.tsx +0 -125
- package/src/widget/components/WidgetProviders.tsx +0 -82
- package/src/widget/components/Withdraw.tsx +0 -1088
- package/src/widget/components/YellowWarningAnimation.tsx +0 -146
- package/src/widget/hooks/useAddressWalletIcon.ts +0 -54
- package/src/widget/hooks/useAmountUsd.ts +0 -44
- package/src/widget/hooks/useBalanceVisible.tsx +0 -95
- package/src/widget/hooks/useChainFilter.tsx +0 -56
- package/src/widget/hooks/useCheckout.ts +0 -361
- package/src/widget/hooks/useClickTracking.ts +0 -74
- package/src/widget/hooks/useCombinedHistory.ts +0 -420
- package/src/widget/hooks/useConnector.tsx +0 -24
- package/src/widget/hooks/useCustomTokenFetch.tsx +0 -74
- package/src/widget/hooks/useCustomTokenSearch.tsx +0 -339
- package/src/widget/hooks/useDebounce.ts +0 -25
- package/src/widget/hooks/useDebugScreens.ts +0 -600
- package/src/widget/hooks/useDefaultDestinationToken.tsx +0 -182
- package/src/widget/hooks/useDefaultOriginToken.tsx +0 -410
- package/src/widget/hooks/useDepositMonitor.ts +0 -118
- package/src/widget/hooks/useDestinationSelectedToken.tsx +0 -310
- package/src/widget/hooks/useDisplayCurrencyPreference.tsx +0 -145
- package/src/widget/hooks/useEarnPool.tsx +0 -36
- package/src/widget/hooks/useExecutingIntentsCount.ts +0 -78
- package/src/widget/hooks/useExternalFundingReceiptSync.ts +0 -79
- package/src/widget/hooks/useFiatOnRampCurrencies.ts +0 -46
- package/src/widget/hooks/useFiatSelectedCurrency.tsx +0 -123
- package/src/widget/hooks/useGetIntent.ts +0 -54
- package/src/widget/hooks/useIntentReceiptBalances.ts +0 -141
- package/src/widget/hooks/useIntentTransactionHistory.ts +0 -785
- package/src/widget/hooks/useIsConnectedWalletSmartContract.ts +0 -43
- package/src/widget/hooks/useIsMobile.tsx +0 -50
- package/src/widget/hooks/useIsSequenceWallet.ts +0 -17
- package/src/widget/hooks/useLocalePreference.tsx +0 -187
- package/src/widget/hooks/useMeldTransactionHistory.ts +0 -184
- package/src/widget/hooks/useMeldTransactionStatus.ts +0 -707
- package/src/widget/hooks/useOnRampCountryDefaults.ts +0 -57
- package/src/widget/hooks/useOnRampPaymentMethods.ts +0 -72
- package/src/widget/hooks/useOnRampProviderWidget.ts +0 -184
- package/src/widget/hooks/useOnRampQuote.ts +0 -340
- package/src/widget/hooks/useOnRampTransactionStatus.ts +0 -196
- package/src/widget/hooks/useOriginSelectedToken.tsx +0 -253
- package/src/widget/hooks/usePayMessage.tsx +0 -496
- package/src/widget/hooks/usePriceImpactWarning.ts +0 -17
- package/src/widget/hooks/useQuote.ts +0 -1233
- package/src/widget/hooks/useRecentTokens.ts +0 -159
- package/src/widget/hooks/useRecipients.ts +0 -167
- package/src/widget/hooks/useScreenTracking.ts +0 -14
- package/src/widget/hooks/useSelectedFeeOption.tsx +0 -323
- package/src/widget/hooks/useSelectedFundMethod.tsx +0 -80
- package/src/widget/hooks/useSelectedRecipient.tsx +0 -75
- package/src/widget/hooks/useSendForm.ts +0 -1373
- package/src/widget/hooks/useSwapAmount.tsx +0 -50
- package/src/widget/hooks/useSwapState.tsx +0 -121
- package/src/widget/hooks/useTargetAmount.ts +0 -26
- package/src/widget/hooks/useTheme.tsx +0 -80
- package/src/widget/hooks/useTokenList.ts +0 -1099
- package/src/widget/hooks/useTokenWithFreshBalance.ts +0 -246
- package/src/widget/hooks/useTrailsSendTransaction.ts +0 -987
- package/src/widget/hooks/useViewManager.tsx +0 -505
- package/src/widget/hooks/useWalletConnectUri.tsx +0 -307
- package/src/widget/hooks/useWalletConnectionContext.tsx +0 -128
- package/src/widget/hooks/useWidgetProps.tsx +0 -33
- package/src/widget/index.css +0 -686
- package/src/widget/index.tsx +0 -28
- package/src/widget/providers/TrailsModalProvider.tsx +0 -238
- package/src/widget/providers/TrailsProvider.tsx +0 -150
- package/src/widget/providers/UserActivityProvider.tsx +0 -78
- package/src/widget/providers/WidgetProviderTree.tsx +0 -90
- package/src/widget/styles.ts +0 -26
- package/src/widget/types/analytics.ts +0 -22
- package/src/widget/types/commonProps.ts +0 -56
- package/src/widget/types/svg.d.ts +0 -8
- package/src/widget/types.ts +0 -51
- package/src/widget/utils/countryUtils.ts +0 -89
- package/src/widget/utils/createWagmiConfig.ts +0 -38
- package/src/widget/utils/forexRateStore.ts +0 -120
- package/src/widget/utils/fundMethodSwitchState.ts +0 -25
- package/src/widget/utils/historyFilters.ts +0 -157
- package/src/widget/utils/historyUtils.ts +0 -101
- package/src/widget/utils/localeStore.ts +0 -68
- package/src/widget/utils/meldProviderUtils.ts +0 -20
- package/src/widget/utils/statusLabel.ts +0 -3
- package/src/widget/utils/tokens.ts +0 -138
- package/src/widget/utils/transactionFailure.ts +0 -52
- package/src/widget/utils/viewManagerGuards.ts +0 -49
- package/src/widget/utils/windowUtils.ts +0 -138
- package/src/widget/widget.tsx +0 -3334
- /package/dist/{widget/hooks → hooks}/useAddressWalletIcon.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useAmountUsd.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useBalanceVisible.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useChainFilter.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useClickTracking.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useConnector.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useDebounce.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useDepositMonitor.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useDisplayCurrencyPreference.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useExecutingIntentsCount.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useFiatSelectedCurrency.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useGetIntent.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useIsMobile.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useIsSequenceWallet.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useLocalePreference.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useMeldTransactionHistory.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useMeldTransactionStatus.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useOnRampCountryDefaults.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/usePayMessage.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/usePriceImpactWarning.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useRecipients.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useSelectedFeeOption.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useSelectedRecipient.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useSwapAmount.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useTargetAmount.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useTheme.d.ts +0 -0
- /package/dist/{widget/hooks → hooks}/useWalletConnectionContext.d.ts +0 -0
package/src/wallets.ts
DELETED
|
@@ -1,740 +0,0 @@
|
|
|
1
|
-
import { sequenceWallet } from "@0xsequence/connect"
|
|
2
|
-
import { Wallet as WalletIcon } from "lucide-react"
|
|
3
|
-
import React from "react"
|
|
4
|
-
import { useConnectors as useWagmiConnectors } from "wagmi"
|
|
5
|
-
import type { EIP1193Provider } from "viem"
|
|
6
|
-
import {
|
|
7
|
-
baseAccount,
|
|
8
|
-
gemini,
|
|
9
|
-
injected,
|
|
10
|
-
safe,
|
|
11
|
-
walletConnect,
|
|
12
|
-
} from "wagmi/connectors"
|
|
13
|
-
import { getConfig } from "./config.js"
|
|
14
|
-
import {
|
|
15
|
-
DEFAULT_WALLETCONNECT_PROJECT_ID,
|
|
16
|
-
PROD_TRAILS_API_URL,
|
|
17
|
-
} from "./constants.js"
|
|
18
|
-
import WalletConnectLogo from "./widget/assets/WalletConnect-logo-blue-bg.svg"
|
|
19
|
-
import SequenceLogo from "./widget/assets/sequence-logo.svg"
|
|
20
|
-
import { useTrails } from "./widget/providers/TrailsProvider.js"
|
|
21
|
-
|
|
22
|
-
type Connector = any
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* EIP-6963 RDNS (Reverse Domain Name System) mapping for reliable wallet identification.
|
|
26
|
-
* Wagmi's multiInjectedProviderDiscovery uses these identifiers to uniquely identify wallets.
|
|
27
|
-
* Reference: https://github.com/wevm/wagmi/pull/4343
|
|
28
|
-
*/
|
|
29
|
-
export const WALLET_RDNS_MAP: Record<string, string> = {
|
|
30
|
-
"io.metamask": "metamask",
|
|
31
|
-
"io.rabby": "rabby",
|
|
32
|
-
"app.phantom": "phantom",
|
|
33
|
-
"com.coinbase.wallet": "coinbase",
|
|
34
|
-
"me.rainbow": "rainbow",
|
|
35
|
-
"app.zerion": "zerion",
|
|
36
|
-
"com.trustwallet.app": "trust",
|
|
37
|
-
"io.okx.wallet": "okx",
|
|
38
|
-
"xyz.ambire": "ambire",
|
|
39
|
-
"io.zerion": "zerion",
|
|
40
|
-
"world.bitget": "bitget",
|
|
41
|
-
"io.1inch.wallet": "1inch",
|
|
42
|
-
"com.brave.wallet": "brave",
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Reverse lookup from wallet ID to RDNS identifier
|
|
47
|
-
*/
|
|
48
|
-
export const WALLET_ID_TO_RDNS: Record<string, string> = Object.fromEntries(
|
|
49
|
-
Object.entries(WALLET_RDNS_MAP).map(([rdns, id]) => [id, rdns]),
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
export interface WalletConfig {
|
|
53
|
-
id: string
|
|
54
|
-
name: string
|
|
55
|
-
icon: string
|
|
56
|
-
connector?: Connector
|
|
57
|
-
getWalletConnectDeepLink?: (uri: string) => string
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface QRCodeWalletOption {
|
|
61
|
-
id: string
|
|
62
|
-
label: string
|
|
63
|
-
usesEip681: boolean
|
|
64
|
-
icon: string
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// WalletConnect connector singleton to avoid multiple Core initializations.
|
|
68
|
-
// Lazy-initialized to prevent module-level side effects — importing this module
|
|
69
|
-
// should NOT create a WalletConnect connector until one is actually needed.
|
|
70
|
-
// This avoids conflicts with apps that bring their own WalletConnect setup
|
|
71
|
-
// (e.g. Reown AppKit) when using hooks-only via TrailsProvider.
|
|
72
|
-
let wcConnectorSingleton: Connector | null = null
|
|
73
|
-
export function getWalletConnectConnector(): Connector {
|
|
74
|
-
if (!wcConnectorSingleton) {
|
|
75
|
-
wcConnectorSingleton = walletConnect({
|
|
76
|
-
projectId:
|
|
77
|
-
getConfig("walletConnectProjectId") || DEFAULT_WALLETCONNECT_PROJECT_ID,
|
|
78
|
-
showQrModal: false,
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
return wcConnectorSingleton
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function isInIframe() {
|
|
85
|
-
if (typeof window === "undefined") return false
|
|
86
|
-
if (window.parent === window) {
|
|
87
|
-
return false
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return true
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function safeProviderOrWalletConnect() {
|
|
94
|
-
if (isInIframe()) {
|
|
95
|
-
return safe()
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return getWalletConnectConnector()
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
102
|
-
return typeof value === "object" && value !== null
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Selector used to pick a provider from window.ethereum (or its providers array).
|
|
106
|
-
type ProviderSelector = (provider: Record<string, unknown>) => boolean
|
|
107
|
-
|
|
108
|
-
function getWindowValue(
|
|
109
|
-
windowRecord: Record<string, unknown>,
|
|
110
|
-
identifier: string | string[],
|
|
111
|
-
): unknown {
|
|
112
|
-
if (!Array.isArray(identifier)) {
|
|
113
|
-
return windowRecord[identifier]
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
let current: unknown = windowRecord
|
|
117
|
-
for (const key of identifier) {
|
|
118
|
-
if (!isRecord(current)) return undefined
|
|
119
|
-
current = current[key]
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return current
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function findInjectedProvider(
|
|
126
|
-
windowRecord: Record<string, unknown>,
|
|
127
|
-
selector: ProviderSelector,
|
|
128
|
-
): EIP1193Provider | undefined {
|
|
129
|
-
const ethereum = windowRecord.ethereum
|
|
130
|
-
const providers = isRecord(ethereum) ? ethereum.providers : undefined
|
|
131
|
-
const candidates: unknown[] = []
|
|
132
|
-
|
|
133
|
-
if (Array.isArray(providers)) {
|
|
134
|
-
candidates.push(...providers)
|
|
135
|
-
} else if (ethereum) {
|
|
136
|
-
candidates.push(ethereum)
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
for (const candidate of candidates) {
|
|
140
|
-
if (isRecord(candidate) && selector(candidate)) {
|
|
141
|
-
return candidate as EIP1193Provider
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return undefined
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// Resolve a provider using either an injected selector or a window path.
|
|
149
|
-
function resolveProvider(
|
|
150
|
-
windowRecord: Record<string, unknown>,
|
|
151
|
-
identifier: string | string[] | ProviderSelector,
|
|
152
|
-
): EIP1193Provider | undefined {
|
|
153
|
-
if (typeof identifier === "function") {
|
|
154
|
-
return findInjectedProvider(windowRecord, identifier)
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const candidate = getWindowValue(windowRecord, identifier)
|
|
158
|
-
if (!isRecord(candidate)) return undefined
|
|
159
|
-
return candidate as EIP1193Provider
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export function windowProviderOrWalletConnect(
|
|
163
|
-
walletId: string,
|
|
164
|
-
windowObjectIdentifier: string | string[] | ProviderSelector,
|
|
165
|
-
name: string,
|
|
166
|
-
) {
|
|
167
|
-
if (typeof window === "undefined") return getWalletConnectConnector()
|
|
168
|
-
|
|
169
|
-
const windowRecord = window as unknown as Record<string, unknown>
|
|
170
|
-
|
|
171
|
-
// Selector checks window.ethereum/providers; paths read from window.*
|
|
172
|
-
const provider = resolveProvider(windowRecord, windowObjectIdentifier)
|
|
173
|
-
if (!provider) return getWalletConnectConnector()
|
|
174
|
-
|
|
175
|
-
return injected({
|
|
176
|
-
target() {
|
|
177
|
-
return {
|
|
178
|
-
id: walletId,
|
|
179
|
-
name: name || walletId,
|
|
180
|
-
provider: provider,
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
})
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Hook to get all wallet connectors, creating them lazily with the correct configuration
|
|
188
|
-
*/
|
|
189
|
-
export function useConnectors(): Connector[] {
|
|
190
|
-
const { trailsApiKey, trailsApiUrl } = useTrails()
|
|
191
|
-
|
|
192
|
-
return React.useMemo(() => {
|
|
193
|
-
return getConnectorsInternal(trailsApiKey, trailsApiUrl)
|
|
194
|
-
}, [trailsApiKey, trailsApiUrl])
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Internal function to get connectors (for use outside React components)
|
|
199
|
-
* Exported for use in widget.tsx where hooks can't be used in useMemo
|
|
200
|
-
*/
|
|
201
|
-
|
|
202
|
-
// Cache connectors to prevent recreation on every call
|
|
203
|
-
const connectorsCache = new Map<string, Connector[]>()
|
|
204
|
-
|
|
205
|
-
export function getConnectorsInternal(
|
|
206
|
-
projectAccessKey?: string,
|
|
207
|
-
trailsApiUrl?: string,
|
|
208
|
-
): Connector[] {
|
|
209
|
-
const cacheKey = `${projectAccessKey || "default"}:${trailsApiUrl || "default"}`
|
|
210
|
-
|
|
211
|
-
// Return cached connectors if they exist
|
|
212
|
-
const cached = connectorsCache.get(cacheKey)
|
|
213
|
-
if (cached) {
|
|
214
|
-
return cached
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Create base connectors
|
|
218
|
-
const injectedConnector = injected()
|
|
219
|
-
const baseAccountConnector: Connector = baseAccount()
|
|
220
|
-
const geminiConnector: Connector = gemini()
|
|
221
|
-
const safeConnector: Connector = safeProviderOrWalletConnect()
|
|
222
|
-
|
|
223
|
-
// Create wallet-specific connectors
|
|
224
|
-
// Note: MetaMask and Rainbow removed - they support EIP-6963 discovery
|
|
225
|
-
const trustwalletConnector = windowProviderOrWalletConnect(
|
|
226
|
-
"trustwallet",
|
|
227
|
-
"trustwallet",
|
|
228
|
-
"Trust",
|
|
229
|
-
)
|
|
230
|
-
const phantomConnector = windowProviderOrWalletConnect(
|
|
231
|
-
"phantom",
|
|
232
|
-
["phantom", "ethereum"],
|
|
233
|
-
"Phantom",
|
|
234
|
-
)
|
|
235
|
-
const okxwalletConnector = windowProviderOrWalletConnect(
|
|
236
|
-
"okxwallet",
|
|
237
|
-
"okxwallet",
|
|
238
|
-
"OKX Wallet",
|
|
239
|
-
)
|
|
240
|
-
const zerionConnector = windowProviderOrWalletConnect(
|
|
241
|
-
"zerion",
|
|
242
|
-
"zerionWallet",
|
|
243
|
-
"Zerion",
|
|
244
|
-
)
|
|
245
|
-
const ambireConnector = windowProviderOrWalletConnect(
|
|
246
|
-
"ambire",
|
|
247
|
-
"ambire",
|
|
248
|
-
"Ambire",
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
// Note: Rabby and Coinbase removed - they support EIP-6963 discovery
|
|
252
|
-
|
|
253
|
-
// Create sequence connector with projectAccessKey
|
|
254
|
-
const sequenceConnector: any = sequenceWallet({
|
|
255
|
-
connect: {
|
|
256
|
-
app: "Trails",
|
|
257
|
-
projectAccessKey: projectAccessKey || getConfig("trailsApiKey") || "",
|
|
258
|
-
},
|
|
259
|
-
defaultNetwork: 1,
|
|
260
|
-
walletAppURL: getSequenceWalletAppUrl(trailsApiUrl),
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
const connectors = [
|
|
264
|
-
injectedConnector,
|
|
265
|
-
getWalletConnectConnector(),
|
|
266
|
-
safeConnector,
|
|
267
|
-
baseAccountConnector,
|
|
268
|
-
geminiConnector,
|
|
269
|
-
trustwalletConnector,
|
|
270
|
-
phantomConnector,
|
|
271
|
-
okxwalletConnector,
|
|
272
|
-
zerionConnector,
|
|
273
|
-
ambireConnector,
|
|
274
|
-
sequenceConnector,
|
|
275
|
-
]
|
|
276
|
-
|
|
277
|
-
// Cache the connectors before returning
|
|
278
|
-
connectorsCache.set(cacheKey, connectors)
|
|
279
|
-
|
|
280
|
-
return connectors
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Hook to get wallet configurations, creating connectors lazily with the correct configuration
|
|
285
|
-
*/
|
|
286
|
-
export function useWalletConfigs(): Record<string, WalletConfig> {
|
|
287
|
-
const { trailsApiKey, trailsApiUrl } = useTrails()
|
|
288
|
-
|
|
289
|
-
return React.useMemo(() => {
|
|
290
|
-
return getWalletConfigsInternal(trailsApiKey, trailsApiUrl)
|
|
291
|
-
}, [trailsApiKey, trailsApiUrl])
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Internal function to get wallet configs (for use outside React components)
|
|
296
|
-
*/
|
|
297
|
-
function getWalletConfigsInternal(
|
|
298
|
-
projectAccessKey?: string,
|
|
299
|
-
trailsApiUrl?: string,
|
|
300
|
-
): Record<string, WalletConfig> {
|
|
301
|
-
// Get connectors
|
|
302
|
-
const connectors = getConnectorsInternal(projectAccessKey, trailsApiUrl)
|
|
303
|
-
const [
|
|
304
|
-
injectedConnector,
|
|
305
|
-
,
|
|
306
|
-
safeConnector,
|
|
307
|
-
baseAccountConnector,
|
|
308
|
-
geminiConnector,
|
|
309
|
-
trustwalletConnector,
|
|
310
|
-
phantomConnector,
|
|
311
|
-
okxwalletConnector,
|
|
312
|
-
zerionConnector,
|
|
313
|
-
ambireConnector,
|
|
314
|
-
sequenceConnector,
|
|
315
|
-
] = connectors
|
|
316
|
-
|
|
317
|
-
// Create wallet-specific connectors with EIP-6963 priority
|
|
318
|
-
// These will check EIP-6963 first (in widget.tsx), then window properties, then WalletConnect
|
|
319
|
-
const metamaskConnector = windowProviderOrWalletConnect(
|
|
320
|
-
"metamask",
|
|
321
|
-
(provider) => provider.isMetaMask === true,
|
|
322
|
-
"MetaMask",
|
|
323
|
-
)
|
|
324
|
-
const rabbyConnector = windowProviderOrWalletConnect(
|
|
325
|
-
"rabby",
|
|
326
|
-
(provider) => provider.isRabby === true,
|
|
327
|
-
"Rabby",
|
|
328
|
-
)
|
|
329
|
-
const rainbowConnector = windowProviderOrWalletConnect(
|
|
330
|
-
"rainbow",
|
|
331
|
-
"rainbow",
|
|
332
|
-
"Rainbow",
|
|
333
|
-
)
|
|
334
|
-
const coinbaseConnector = windowProviderOrWalletConnect(
|
|
335
|
-
"coinbase",
|
|
336
|
-
"coinbaseWalletExtension",
|
|
337
|
-
"Coinbase Wallet",
|
|
338
|
-
)
|
|
339
|
-
|
|
340
|
-
return {
|
|
341
|
-
injected: {
|
|
342
|
-
id: "injected",
|
|
343
|
-
name: "Browser Wallet",
|
|
344
|
-
connector: injectedConnector,
|
|
345
|
-
icon: WalletIcon as unknown as string,
|
|
346
|
-
},
|
|
347
|
-
walletconnect: {
|
|
348
|
-
id: "walletconnect",
|
|
349
|
-
name: "WalletConnect",
|
|
350
|
-
connector: getWalletConnectConnector(),
|
|
351
|
-
icon: WalletConnectLogo as string,
|
|
352
|
-
},
|
|
353
|
-
metamask: {
|
|
354
|
-
id: "metamask",
|
|
355
|
-
name: "MetaMask",
|
|
356
|
-
connector: metamaskConnector, // EIP-6963 > window.ethereum.isMetaMask > WalletConnect
|
|
357
|
-
icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjIzIiBoZWlnaHQ9IjIzIiB4PSIzLjUiIHk9IjMuNSIgdmlld0JveD0iMCAwIDE0MS41MSAxMzYuNDIiPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im0xMzIuMjQgMTMxLjc1LTMwLjQ4LTkuMDctMjIuOTkgMTMuNzQtMTYuMDMtLjAxLTIzLTEzLjc0LTMwLjQ3IDkuMDhMMCAxMDAuNDdsOS4yNy0zNC43M0wwIDM2LjQgOS4yNyAwbDQ3LjYgMjguNDRoMjcuNzZMMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2IDkuMjcgMzQuNzItOS4yNyAzMS4zWiIvPjxwYXRoIGZpbGw9IiNGRjVDMTYiIGQ9Im05LjI3IDAgNDcuNjEgMjguNDZMNTQuOTggNDggOS4yOSAwWm0zMC40NyAxMDAuNDggMjAuOTUgMTUuOTUtMjAuOTUgNi4yNHYtMjIuMlpNNTkuMDEgNzQuMSA1NSA0OCAyOS4yMiA2NS43NWgtLjAybC4wOCAxOC4yNyAxMC40NS05LjkyaDE5LjI5Wk0xMzIuMjUgMGwtNDcuNiAyOC40Nkw4Ni41MSA0OGw0NS43Mi00OFptLTMwLjQ3IDEwMC40OC0yMC45NCAxNS45NSAyMC45NCA2LjI0di0yMi4yWm0xMC41My0zNC43M0w4Ni41MyA0OCA4Mi41IDc0LjFoMTkuMjdsMTAuNDYgOS45LjA3LTE4LjI2WiIvPjxwYXRoIGZpbGw9IiNFMzQ4MDciIGQ9Im0zOS43MyAxMjIuNjctMzAuNDYgOS4wOEwwIDEwMC40OGgzOS43M3YyMi4yWk01OS4wMiA3NC4xbDUuODIgMzcuNzEtOC4wNy0yMC45Ny0yNy40OS02LjgyIDEwLjQ2LTkuOTJINTlabTQyLjc2IDQ4LjU5IDMwLjQ3IDkuMDcgOS4yNy0zMS4yN2gtMzkuNzR6TTgyLjUgNzQuMDlsLTUuODIgMzcuNzEgOC4wNi0yMC45NyAyNy41LTYuODItMTAuNDctOS45MnoiLz48cGF0aCBmaWxsPSIjRkY4RDVEIiBkPSJtMCAxMDAuNDcgOS4yNy0zNC43M0gyOS4ybC4wNyAxOC4yNyAyNy41IDYuODIgOC4wNiAyMC45Ny00LjE1IDQuNjItMjAuOTQtMTUuOTZIMFptMTQxLjUgMC05LjI2LTM0LjczaC0xOS45M2wtLjA3IDE4LjI3LTI3LjUgNi44Mi04LjA2IDIwLjk3IDQuMTUgNC42MiAyMC45NC0xNS45NmgzOS43NFpNODQuNjQgMjguNDRINTYuODhsLTEuODkgMTkuNTQgOS44NCA2My44aDExLjg1bDkuODUtNjMuOC0xLjktMTkuNTRaIi8+PHBhdGggZmlsbD0iIzY2MTgwMCIgZD0iTTkuMjcgMCAwIDM2LjM4bDkuMjcgMjkuMzZIMjkuMkw1NC45OCA0OHptNDMuOTggODEuNjdoLTkuMDNsLTQuOTIgNC44MSAxNy40NyA0LjMzLTMuNTItOS4xNVpNMTMyLjI0IDBsOS4yNyAzNi4zOC05LjI3IDI5LjM2aC0xOS45M0w4Ni41MyA0OHpNODguMjcgODEuNjdoOS4wNGw0LjkyIDQuODItMTcuNDkgNC4zNCAzLjUzLTkuMTdabS05LjUgNDIuMyAyLjA2LTcuNTQtNC4xNS00LjYySDY0LjgybC00LjE0IDQuNjIgMi4wNSA3LjU0Ii8+PHBhdGggZmlsbD0iI0MwQzRDRCIgZD0iTTc4Ljc3IDEyMy45N3YxMi40NUg2Mi43NHYtMTIuNDVoMTYuMDJaIi8+PHBhdGggZmlsbD0iI0U3RUJGNiIgZD0ibTM5Ljc0IDEyMi42NiAyMyAxMy43NnYtMTIuNDZsLTIuMDUtNy41NHptNjIuMDMgMC0yMyAxMy43NnYtMTIuNDZsMi4wNi03LjU0eiIvPjwvc3ZnPjwvc3ZnPg==",
|
|
358
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
359
|
-
return `https://metamask.app.link/wc?uri=${encodeURIComponent(uri)}`
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
baseAccount: {
|
|
363
|
-
id: "baseAccount",
|
|
364
|
-
name: "Base",
|
|
365
|
-
connector: baseAccountConnector,
|
|
366
|
-
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAALZJREFUaEPtmjEOhDAMBNc/O14GvOzys3CAKK6eAlmaVGl2Zc+kTOU685vkc9/bnD2prZK5/TZY24z9P+g4F5hNh7/GdoG37WlAA5CATwgCxHENYISwQAMQII5rACOEBRqAAHFcAxghLNAABIjjGsAIYYEGIEAc1wBGCAs0AAHiuAYwQligAQgQxzWAEcICDUCAOK4BjBAWaAACxHENYISwQAMQII6fBjr+VHkW3+u+tfyxMpJaDgYzYxb/ALZVAAAAAElFTkSuQmCC",
|
|
367
|
-
},
|
|
368
|
-
safe: {
|
|
369
|
-
id: "safe",
|
|
370
|
-
name: "Safe",
|
|
371
|
-
connector: safeConnector,
|
|
372
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/3913df81-63c2-4413-d60b-8ff83cbed500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
373
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
374
|
-
return `https://gnosis-safe.io/wc?uri=${encodeURIComponent(uri)}`
|
|
375
|
-
},
|
|
376
|
-
},
|
|
377
|
-
rainbow: {
|
|
378
|
-
id: "rainbow",
|
|
379
|
-
name: "Rainbow",
|
|
380
|
-
connector: rainbowConnector, // EIP-6963 > window.rainbow > WalletConnect
|
|
381
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7a33d7f1-3d12-4b5c-f3ee-5cd83cb1b500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
382
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
383
|
-
return `https://rnbwapp.com/wc?uri=${encodeURIComponent(
|
|
384
|
-
uri,
|
|
385
|
-
)}&connector=connectkit`
|
|
386
|
-
},
|
|
387
|
-
},
|
|
388
|
-
trust: {
|
|
389
|
-
id: "trust",
|
|
390
|
-
name: "Trust",
|
|
391
|
-
connector: trustwalletConnector,
|
|
392
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/7677b54f-3486-46e2-4e37-bf8747814f00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
393
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
394
|
-
return `https://link.trustwallet.com/wc?uri=${encodeURIComponent(uri)}`
|
|
395
|
-
},
|
|
396
|
-
},
|
|
397
|
-
ambire: {
|
|
398
|
-
id: "ambire",
|
|
399
|
-
name: "Ambire Wallet",
|
|
400
|
-
connector: ambireConnector,
|
|
401
|
-
icon: "https://www.ambire.com/favicon.png",
|
|
402
|
-
},
|
|
403
|
-
argent: {
|
|
404
|
-
id: "argent",
|
|
405
|
-
name: "Argent",
|
|
406
|
-
connector: getWalletConnectConnector(),
|
|
407
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/215158d2-614b-49c9-410f-77aa661c3900?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
408
|
-
},
|
|
409
|
-
binance: {
|
|
410
|
-
id: "binance",
|
|
411
|
-
name: "Binance Wallet",
|
|
412
|
-
connector: getWalletConnectConnector(),
|
|
413
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/ebac7b39-688c-41e3-7912-a4fefba74600?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
414
|
-
},
|
|
415
|
-
okx: {
|
|
416
|
-
id: "okx",
|
|
417
|
-
name: "OKX Wallet",
|
|
418
|
-
connector: okxwalletConnector,
|
|
419
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/c55df831-3c52-49fc-d1d1-97a926dc0c00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
420
|
-
},
|
|
421
|
-
zerion: {
|
|
422
|
-
id: "zerion",
|
|
423
|
-
name: "Zerion",
|
|
424
|
-
connector: zerionConnector,
|
|
425
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/73f6f52f-7862-49e7-bb85-ba93ab72cc00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
426
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
427
|
-
return `https://app.zerion.io/wc?uri=${encodeURIComponent(uri)}`
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
phantom: {
|
|
431
|
-
id: "phantom",
|
|
432
|
-
name: "Phantom",
|
|
433
|
-
connector: phantomConnector,
|
|
434
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/b6ec7b81-bb4f-427d-e290-7631e6e50d00?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
435
|
-
getWalletConnectDeepLink: (_uri: string) => {
|
|
436
|
-
// TODO: https://phantom.com/learn/blog/the-complete-guide-to-phantom-deeplinks
|
|
437
|
-
// return `https://phantom.app/ul/v1/connect`
|
|
438
|
-
// For now, use the browse link to open the Phantom app
|
|
439
|
-
return `https://phantom.app/ul/browse/${encodeURIComponent(typeof window !== "undefined" ? window.location.href : "")}`
|
|
440
|
-
},
|
|
441
|
-
},
|
|
442
|
-
coinbase: {
|
|
443
|
-
id: "coinbase",
|
|
444
|
-
name: "Coinbase Wallet",
|
|
445
|
-
connector: coinbaseConnector, // EIP-6963 > window.coinbaseWalletExtension > WalletConnect
|
|
446
|
-
icon: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",
|
|
447
|
-
getWalletConnectDeepLink: (uri: string) => {
|
|
448
|
-
return `https://go.cb-w.com/wc?uri=${encodeURIComponent(uri)}`
|
|
449
|
-
},
|
|
450
|
-
},
|
|
451
|
-
rabby: {
|
|
452
|
-
id: "rabby",
|
|
453
|
-
name: "Rabby",
|
|
454
|
-
connector: rabbyConnector, // EIP-6963 > window.ethereum.isRabby > WalletConnect,
|
|
455
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/255e6ba2-8dfd-43ad-e88e-57cbb98f6800?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
456
|
-
},
|
|
457
|
-
privy: {
|
|
458
|
-
id: "privy",
|
|
459
|
-
name: "Privy",
|
|
460
|
-
icon: "https://avatars.githubusercontent.com/u/81824329?s=200&v=4",
|
|
461
|
-
},
|
|
462
|
-
gemini: {
|
|
463
|
-
id: "gemini",
|
|
464
|
-
name: "Gemini",
|
|
465
|
-
connector: geminiConnector,
|
|
466
|
-
icon: "https://explorer-api.walletconnect.com/v3/logo/sm/56a3fd87-2627-4903-fddd-205224dac500?projectId=34357d3c125c2bcf2ce2bc3309d98715",
|
|
467
|
-
},
|
|
468
|
-
sequence: {
|
|
469
|
-
id: "sequence",
|
|
470
|
-
name: "Sequence",
|
|
471
|
-
connector: sequenceConnector,
|
|
472
|
-
icon: SequenceLogo as string,
|
|
473
|
-
},
|
|
474
|
-
"sequence-waas": {
|
|
475
|
-
id: "sequence-waas",
|
|
476
|
-
name: "Sequence WaaS",
|
|
477
|
-
connector: sequenceConnector,
|
|
478
|
-
icon: SequenceLogo as string,
|
|
479
|
-
},
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Hook to get QR code wallet options
|
|
485
|
-
*/
|
|
486
|
-
export function useQRCodeWallets(): QRCodeWalletOption[] {
|
|
487
|
-
const { trailsApiKey, trailsApiUrl } = useTrails()
|
|
488
|
-
|
|
489
|
-
return React.useMemo(() => {
|
|
490
|
-
return getQRCodeWalletsInternal(trailsApiKey, trailsApiUrl)
|
|
491
|
-
}, [trailsApiKey, trailsApiUrl])
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Internal function to get QR code wallets (for use outside React components)
|
|
496
|
-
*/
|
|
497
|
-
function getQRCodeWalletsInternal(
|
|
498
|
-
projectAccessKey?: string,
|
|
499
|
-
trailsApiUrl?: string,
|
|
500
|
-
): QRCodeWalletOption[] {
|
|
501
|
-
const walletConfigs = getWalletConfigsInternal(projectAccessKey, trailsApiUrl)
|
|
502
|
-
|
|
503
|
-
return [
|
|
504
|
-
{
|
|
505
|
-
id: "metamask",
|
|
506
|
-
label: "MetaMask",
|
|
507
|
-
usesEip681: true,
|
|
508
|
-
icon: walletConfigs.metamask?.icon || "",
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
id: "coinbase",
|
|
512
|
-
label: "CB Wallet",
|
|
513
|
-
usesEip681: false,
|
|
514
|
-
icon: walletConfigs.coinbase?.icon || "",
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
id: "trust",
|
|
518
|
-
label: "Trust Wallet",
|
|
519
|
-
usesEip681: false,
|
|
520
|
-
icon: walletConfigs.trust?.icon || "",
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
id: "rabby",
|
|
524
|
-
label: "Rabby",
|
|
525
|
-
usesEip681: false,
|
|
526
|
-
icon: walletConfigs.rabby?.icon || "",
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
id: "rainbow",
|
|
530
|
-
label: "Rainbow",
|
|
531
|
-
usesEip681: false,
|
|
532
|
-
icon: walletConfigs.rainbow?.icon || "",
|
|
533
|
-
},
|
|
534
|
-
{
|
|
535
|
-
id: "phantom",
|
|
536
|
-
label: "Phantom",
|
|
537
|
-
usesEip681: false,
|
|
538
|
-
icon: walletConfigs.phantom?.icon || "",
|
|
539
|
-
},
|
|
540
|
-
] satisfies QRCodeWalletOption[]
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
const PROD_SEQUENCE_WALLET_APP_URL = "https://sequence.app"
|
|
544
|
-
const DEV_SEQUENCE_WALLET_APP_URL = "https://dev.sequence.app"
|
|
545
|
-
|
|
546
|
-
function isDevEnvironment(trailsApiUrl: string): boolean {
|
|
547
|
-
return (
|
|
548
|
-
trailsApiUrl.includes("dev-trails-api.sequence-dev.app") ||
|
|
549
|
-
trailsApiUrl.includes("dev2-trails-api.sequence-dev.app") ||
|
|
550
|
-
trailsApiUrl.includes("localhost")
|
|
551
|
-
)
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
function getSequenceWalletAppUrl(trailsApiUrl?: string): string {
|
|
555
|
-
return isDevEnvironment(trailsApiUrl || PROD_TRAILS_API_URL)
|
|
556
|
-
? DEV_SEQUENCE_WALLET_APP_URL
|
|
557
|
-
: PROD_SEQUENCE_WALLET_APP_URL
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
export const topShownWallets = [
|
|
561
|
-
"metamask",
|
|
562
|
-
"walletconnect",
|
|
563
|
-
"baseAccount",
|
|
564
|
-
"rainbow",
|
|
565
|
-
"phantom",
|
|
566
|
-
]
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Hook to get wallet icon
|
|
570
|
-
*/
|
|
571
|
-
export function useWalletIcon(walletId?: string): string {
|
|
572
|
-
const walletConfigs = useWalletConfigs()
|
|
573
|
-
|
|
574
|
-
return React.useMemo(() => {
|
|
575
|
-
if (!walletId) return ""
|
|
576
|
-
return (walletConfigs[walletId]?.icon || "") as string
|
|
577
|
-
}, [walletId, walletConfigs])
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
/**
|
|
581
|
-
* Hook to get wallet name
|
|
582
|
-
*/
|
|
583
|
-
export function useWalletName(walletId?: string): string {
|
|
584
|
-
const walletConfigs = useWalletConfigs()
|
|
585
|
-
|
|
586
|
-
return React.useMemo(() => {
|
|
587
|
-
if (!walletId) return ""
|
|
588
|
-
return (walletConfigs[walletId]?.name || "") as string
|
|
589
|
-
}, [walletId, walletConfigs])
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// Legacy functions for backward compatibility (use hooks instead)
|
|
593
|
-
export const getWalletIcon = (
|
|
594
|
-
walletId?: string,
|
|
595
|
-
projectAccessKey?: string,
|
|
596
|
-
): string => {
|
|
597
|
-
if (!walletId) return ""
|
|
598
|
-
const walletConfigs = getWalletConfigsInternal(projectAccessKey)
|
|
599
|
-
return (walletConfigs[walletId]?.icon || "") as string
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
export const getWalletName = (
|
|
603
|
-
walletId?: string,
|
|
604
|
-
projectAccessKey?: string,
|
|
605
|
-
): string => {
|
|
606
|
-
if (!walletId) return ""
|
|
607
|
-
const walletConfigs = getWalletConfigsInternal(projectAccessKey)
|
|
608
|
-
return (walletConfigs[walletId]?.name || "") as string
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* Convert a wagmi connector to a wallet ID using EIP-6963 RDNS (preferred) or name fallback.
|
|
613
|
-
* RDNS-based identification is more reliable as it uses the wallet's unique identifier
|
|
614
|
-
* announced via EIP-6963, avoiding conflicts when multiple wallets override window.ethereum.
|
|
615
|
-
*/
|
|
616
|
-
export const wagmiConnectorToWalletId = (wagmiConnector: any): string => {
|
|
617
|
-
// 1. First try RDNS from EIP-6963 info (most reliable)
|
|
618
|
-
// Wagmi's multiInjectedProviderDiscovery populates this from EIP-6963 announcements
|
|
619
|
-
const rdns = wagmiConnector?.info?.rdns
|
|
620
|
-
if (rdns && WALLET_RDNS_MAP[rdns]) {
|
|
621
|
-
return WALLET_RDNS_MAP[rdns]
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// 2. Fallback to name-based matching for non-EIP-6963 connectors
|
|
625
|
-
const wagmiConnectorName = (
|
|
626
|
-
wagmiConnector?.name ||
|
|
627
|
-
wagmiConnector?.id ||
|
|
628
|
-
""
|
|
629
|
-
).toLowerCase()
|
|
630
|
-
if (wagmiConnectorName.includes("rabby")) return "rabby"
|
|
631
|
-
if (wagmiConnectorName.includes("metamask")) return "metamask"
|
|
632
|
-
if (wagmiConnectorName.includes("walletconnect")) return "walletconnect"
|
|
633
|
-
if (wagmiConnectorName.includes("coinbase")) return "coinbase"
|
|
634
|
-
if (wagmiConnectorName.includes("base")) return "baseAccount"
|
|
635
|
-
if (wagmiConnectorName.includes("rainbow")) return "rainbow"
|
|
636
|
-
if (wagmiConnectorName.includes("trust")) return "trust"
|
|
637
|
-
if (wagmiConnectorName.includes("ambire")) return "ambire"
|
|
638
|
-
if (wagmiConnectorName.includes("argent")) return "argent"
|
|
639
|
-
if (wagmiConnectorName.includes("okx")) return "okxwallet"
|
|
640
|
-
if (wagmiConnectorName.includes("privy")) return "privy"
|
|
641
|
-
if (wagmiConnectorName.includes("gemini")) return "gemini"
|
|
642
|
-
if (wagmiConnectorName.includes("waas")) return "sequence-waas"
|
|
643
|
-
if (wagmiConnectorName.includes("sequence")) return "sequence"
|
|
644
|
-
return wagmiConnector.id || "injected"
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
export const isEmbeddedConnector = (connector?: any): boolean => {
|
|
648
|
-
if (!connector) return false
|
|
649
|
-
if (
|
|
650
|
-
connector.name?.toLowerCase()?.includes("privy") ||
|
|
651
|
-
connector.name?.toLowerCase()?.includes("sequence waas")
|
|
652
|
-
)
|
|
653
|
-
return true
|
|
654
|
-
return false
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// Hook to get combined wallets from wallet configs and wagmi connectors
|
|
658
|
-
export const useWallets = () => {
|
|
659
|
-
const connectors = useWagmiConnectors()
|
|
660
|
-
const walletConfigs = useWalletConfigs()
|
|
661
|
-
|
|
662
|
-
const allWallets = React.useMemo(() => {
|
|
663
|
-
// Get config wallets that have connectors
|
|
664
|
-
const configWallets = Object.values(walletConfigs)
|
|
665
|
-
.filter((config) => config.connector)
|
|
666
|
-
.map((config) => ({
|
|
667
|
-
id: config.id,
|
|
668
|
-
name: config.name,
|
|
669
|
-
icon: config.icon,
|
|
670
|
-
connector: config.connector,
|
|
671
|
-
source: "config" as const,
|
|
672
|
-
}))
|
|
673
|
-
|
|
674
|
-
// Get wagmi wallets
|
|
675
|
-
const wagmiWallets = connectors.map((connector) => ({
|
|
676
|
-
id: wagmiConnectorToWalletId(connector),
|
|
677
|
-
name: connector.name || "",
|
|
678
|
-
icon:
|
|
679
|
-
getWalletIcon(wagmiConnectorToWalletId(connector)) ||
|
|
680
|
-
connector.icon ||
|
|
681
|
-
"",
|
|
682
|
-
connector: connector,
|
|
683
|
-
source: "wagmi" as const,
|
|
684
|
-
}))
|
|
685
|
-
|
|
686
|
-
// Combine and deduplicate, prioritizing wagmi connector over config connector.
|
|
687
|
-
// We keep config metadata (name, icon) but always prefer the connector instance
|
|
688
|
-
// from the active Wagmi config so that consumer-provided connectors (e.g. WaaS)
|
|
689
|
-
// are used instead of the SDK's own connector instances.
|
|
690
|
-
const allWallets: any[] = []
|
|
691
|
-
|
|
692
|
-
for (const wallet of configWallets) {
|
|
693
|
-
// Always check if the active Wagmi config has a matching connector
|
|
694
|
-
const wagmiConnector = connectors.find(
|
|
695
|
-
(connector) => wagmiConnectorToWalletId(connector) === wallet.id,
|
|
696
|
-
)
|
|
697
|
-
const resolvedConnector = wagmiConnector ?? wallet.connector
|
|
698
|
-
if (!resolvedConnector) {
|
|
699
|
-
continue
|
|
700
|
-
}
|
|
701
|
-
allWallets.push({
|
|
702
|
-
id: wallet.id,
|
|
703
|
-
name: wallet.name,
|
|
704
|
-
icon: wallet.icon,
|
|
705
|
-
connector: resolvedConnector,
|
|
706
|
-
source: wagmiConnector ? ("wagmi" as const) : ("config" as const),
|
|
707
|
-
})
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
for (const wallet of wagmiWallets) {
|
|
711
|
-
if (
|
|
712
|
-
!allWallets.find((w: any) => w.id === wagmiConnectorToWalletId(wallet))
|
|
713
|
-
) {
|
|
714
|
-
const configWallet = configWallets.find(
|
|
715
|
-
(config: any) => config.id === wallet.id,
|
|
716
|
-
)
|
|
717
|
-
|
|
718
|
-
allWallets.push({
|
|
719
|
-
id: wallet.id,
|
|
720
|
-
name: configWallet?.name || wallet.name,
|
|
721
|
-
icon: configWallet?.icon || wallet.icon,
|
|
722
|
-
connector: wallet.connector,
|
|
723
|
-
source: "wagmi" as const,
|
|
724
|
-
})
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
return allWallets
|
|
729
|
-
}, [connectors, walletConfigs])
|
|
730
|
-
|
|
731
|
-
return {
|
|
732
|
-
wallets: allWallets,
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// Helper method to find wallet by ID using the hook (for use in components)
|
|
737
|
-
export const useFindWalletById = (walletId: string) => {
|
|
738
|
-
const { wallets } = useWallets()
|
|
739
|
-
return wallets.find((wallet: any) => wallet.id === walletId) || null
|
|
740
|
-
}
|