thirdweb 5.102.7-nightly-3f747601135809eedf86a150752f4b5f12c99776-20250617000426 → 5.103.1-nightly-bb09e20bcb1662c088bf8b61486df7d0d92da8d0-20250618000421
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/cjs/bridge/Routes.js +4 -1
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Token.js +57 -0
- package/dist/cjs/bridge/Token.js.map +1 -1
- package/dist/cjs/bridge/types/Errors.js +9 -0
- package/dist/cjs/bridge/types/Errors.js.map +1 -1
- package/dist/cjs/cli/bin.js +2 -2
- package/dist/cjs/cli/bin.js.map +1 -1
- package/dist/cjs/exports/react.js +9 -1
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +2 -2
- package/dist/cjs/pay/convert/cryptoToFiat.js +3 -3
- package/dist/cjs/pay/convert/cryptoToFiat.js.map +1 -1
- package/dist/cjs/pay/convert/fiatToCrypto.js +3 -3
- package/dist/cjs/pay/convert/fiatToCrypto.js.map +1 -1
- package/dist/cjs/pay/convert/get-token.js +15 -3
- package/dist/cjs/pay/convert/get-token.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -1
- package/dist/cjs/react/core/adapters/WindowAdapter.js +3 -0
- package/dist/cjs/react/core/adapters/WindowAdapter.js.map +1 -0
- package/dist/cjs/react/core/errors/mapBridgeError.js +27 -0
- package/dist/cjs/react/core/errors/mapBridgeError.js.map +1 -0
- package/dist/cjs/react/core/hooks/others/useChainQuery.js +1 -1
- package/dist/cjs/react/core/hooks/others/useChainQuery.js.map +1 -1
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +40 -0
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeError.js +94 -0
- package/dist/cjs/react/core/hooks/useBridgeError.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgePrepare.js +90 -0
- package/dist/cjs/react/core/hooks/useBridgePrepare.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeQuote.js +50 -0
- package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -0
- package/dist/cjs/react/core/hooks/useBridgeRoutes.js +61 -0
- package/dist/cjs/react/core/hooks/useBridgeRoutes.js.map +1 -0
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +154 -0
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -0
- package/dist/cjs/react/core/hooks/useStepExecutor.js +408 -0
- package/dist/cjs/react/core/hooks/useStepExecutor.js.map +1 -0
- package/dist/cjs/react/core/hooks/useTransactionDetails.js +126 -0
- package/dist/cjs/react/core/hooks/useTransactionDetails.js.map +1 -0
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js +17 -2
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/cjs/react/core/machines/paymentMachine.js +189 -0
- package/dist/cjs/react/core/machines/paymentMachine.js.map +1 -0
- package/dist/cjs/react/web/adapters/WindowAdapter.js +25 -0
- package/dist/cjs/react/web/adapters/WindowAdapter.js.map +1 -0
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +5 -0
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +107 -0
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js +177 -0
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +143 -0
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +62 -0
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js +26 -0
- package/dist/cjs/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js +122 -0
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +99 -0
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/StepRunner.js +179 -0
- package/dist/cjs/react/web/ui/Bridge/StepRunner.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +117 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +162 -0
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js +23 -0
- package/dist/cjs/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js +101 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js +57 -0
- package/dist/cjs/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +27 -0
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +121 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +80 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +83 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +111 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +71 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +54 -0
- package/dist/cjs/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js +140 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +61 -0
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/cjs/react/web/ui/ConnectWallet/constants.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +12 -0
- package/dist/cjs/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +4 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js +11 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +2 -1
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +6 -5
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +43 -4
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +8 -4
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainName.js +2 -1
- package/dist/cjs/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/cjs/react/web/ui/components/TokenIcon.js +6 -3
- package/dist/cjs/react/web/ui/components/TokenIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +1 -5
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +228 -0
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js +194 -0
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +153 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/FundWallet.stories.js +173 -0
- package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +430 -0
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +151 -0
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/StepRunner.stories.js +82 -0
- package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +180 -0
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +139 -0
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +94 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/fixtures.js +731 -0
- package/dist/cjs/stories/Bridge/fixtures.js.map +1 -0
- package/dist/cjs/stories/TokenBalanceRow.stories.js +81 -0
- package/dist/cjs/stories/TokenBalanceRow.stories.js.map +1 -0
- package/dist/cjs/stories/WalletRow.stories.js +120 -0
- package/dist/cjs/stories/WalletRow.stories.js.map +1 -0
- package/dist/cjs/stories/utils.js +19 -1
- package/dist/cjs/stories/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/bridge/Routes.js +4 -1
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Token.js +56 -0
- package/dist/esm/bridge/Token.js.map +1 -1
- package/dist/esm/bridge/types/Errors.js +9 -0
- package/dist/esm/bridge/types/Errors.js.map +1 -1
- package/dist/esm/cli/bin.js +2 -2
- package/dist/esm/cli/bin.js.map +1 -1
- package/dist/esm/exports/react.js +4 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +2 -2
- package/dist/esm/pay/convert/cryptoToFiat.js +4 -4
- package/dist/esm/pay/convert/cryptoToFiat.js.map +1 -1
- package/dist/esm/pay/convert/fiatToCrypto.js +4 -4
- package/dist/esm/pay/convert/fiatToCrypto.js.map +1 -1
- package/dist/esm/pay/convert/get-token.js +15 -3
- package/dist/esm/pay/convert/get-token.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +1 -1
- package/dist/esm/react/core/adapters/WindowAdapter.js +2 -0
- package/dist/esm/react/core/adapters/WindowAdapter.js.map +1 -0
- package/dist/esm/react/core/errors/mapBridgeError.js +23 -0
- package/dist/esm/react/core/errors/mapBridgeError.js.map +1 -0
- package/dist/esm/react/core/hooks/others/useChainQuery.js +1 -1
- package/dist/esm/react/core/hooks/others/useChainQuery.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js +37 -0
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeError.js +91 -0
- package/dist/esm/react/core/hooks/useBridgeError.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgePrepare.js +87 -0
- package/dist/esm/react/core/hooks/useBridgePrepare.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeQuote.js +47 -0
- package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -0
- package/dist/esm/react/core/hooks/useBridgeRoutes.js +58 -0
- package/dist/esm/react/core/hooks/useBridgeRoutes.js.map +1 -0
- package/dist/esm/react/core/hooks/usePaymentMethods.js +151 -0
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -0
- package/dist/esm/react/core/hooks/useStepExecutor.js +405 -0
- package/dist/esm/react/core/hooks/useStepExecutor.js.map +1 -0
- package/dist/esm/react/core/hooks/useTransactionDetails.js +123 -0
- package/dist/esm/react/core/hooks/useTransactionDetails.js.map +1 -0
- package/dist/esm/react/core/hooks/wallets/useSendToken.js +17 -2
- package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/esm/react/core/machines/paymentMachine.js +186 -0
- package/dist/esm/react/core/machines/paymentMachine.js.map +1 -0
- package/dist/esm/react/web/adapters/WindowAdapter.js +21 -0
- package/dist/esm/react/web/adapters/WindowAdapter.js.map +1 -0
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +5 -0
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +104 -0
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js +174 -0
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +140 -0
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +59 -0
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js +23 -0
- package/dist/esm/react/web/ui/Bridge/ErrorBanner.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/FundWallet.js +119 -0
- package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +96 -0
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/StepRunner.js +176 -0
- package/dist/esm/react/web/ui/Bridge/StepRunner.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +114 -0
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +159 -0
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js +20 -0
- package/dist/esm/react/web/ui/Bridge/UnsupportedTokenScreen.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js +96 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenAndChain.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js +54 -0
- package/dist/esm/react/web/ui/Bridge/common/TokenBalanceRow.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +24 -0
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +119 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +77 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js +80 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/FiatProviderSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +108 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +68 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js +51 -0
- package/dist/esm/react/web/ui/Bridge/payment-selection/WalletFiatSelection.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js +137 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/PaymentReceipt.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +58 -0
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/constants.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/icons/CreditCardIcon.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +3 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js +4 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js +9 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +2 -1
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +6 -5
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +45 -6
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +8 -4
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainName.js +2 -2
- package/dist/esm/react/web/ui/components/ChainName.js.map +1 -1
- package/dist/esm/react/web/ui/components/TokenIcon.js +7 -4
- package/dist/esm/react/web/ui/components/TokenIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +1 -5
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +226 -0
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/DirectPayment.stories.js +191 -0
- package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +150 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/FundWallet.stories.js +170 -0
- package/dist/esm/stories/Bridge/FundWallet.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js +427 -0
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +148 -0
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/StepRunner.stories.js +79 -0
- package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +177 -0
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js +136 -0
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +91 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/fixtures.js +728 -0
- package/dist/esm/stories/Bridge/fixtures.js.map +1 -0
- package/dist/esm/stories/TokenBalanceRow.stories.js +78 -0
- package/dist/esm/stories/TokenBalanceRow.stories.js.map +1 -0
- package/dist/esm/stories/WalletRow.stories.js +117 -0
- package/dist/esm/stories/WalletRow.stories.js.map +1 -0
- package/dist/esm/stories/utils.js +17 -0
- package/dist/esm/stories/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/bridge/Routes.d.ts +1 -0
- package/dist/types/bridge/Routes.d.ts.map +1 -1
- package/dist/types/bridge/Token.d.ts +48 -1
- package/dist/types/bridge/Token.d.ts.map +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -1
- package/dist/types/bridge/types/Errors.d.ts +1 -0
- package/dist/types/bridge/types/Errors.d.ts.map +1 -1
- package/dist/types/exports/react.d.ts +4 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/pay/convert/get-token.d.ts +2 -1
- package/dist/types/pay/convert/get-token.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +1 -1
- package/dist/types/react/core/adapters/WindowAdapter.d.ts +14 -0
- package/dist/types/react/core/adapters/WindowAdapter.d.ts.map +1 -0
- package/dist/types/react/core/errors/mapBridgeError.d.ts +17 -0
- package/dist/types/react/core/errors/mapBridgeError.d.ts.map +1 -0
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +14 -6
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts +54 -0
- package/dist/types/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.d.ts.map +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/useBridgeError.d.ts +72 -0
- package/dist/types/react/core/hooks/useBridgeError.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgePrepare.d.ts +75 -0
- package/dist/types/react/core/hooks/useBridgePrepare.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts +14 -0
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useBridgeRoutes.d.ts +30 -0
- package/dist/types/react/core/hooks/useBridgeRoutes.d.ts.map +1 -0
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts +36 -0
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useStepExecutor.d.ts +67 -0
- package/dist/types/react/core/hooks/useStepExecutor.d.ts.map +1 -0
- package/dist/types/react/core/hooks/useTransactionDetails.d.ts +31 -0
- package/dist/types/react/core/hooks/useTransactionDetails.d.ts.map +1 -0
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -1
- package/dist/types/react/core/machines/paymentMachine.d.ts +86 -0
- package/dist/types/react/core/machines/paymentMachine.d.ts.map +1 -0
- package/dist/types/react/web/adapters/WindowAdapter.d.ts +19 -0
- package/dist/types/react/web/adapters/WindowAdapter.d.ts.map +1 -0
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +5 -0
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +78 -0
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +325 -0
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +317 -0
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +27 -0
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts +17 -0
- package/dist/types/react/web/ui/Bridge/ErrorBanner.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +35 -0
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +57 -0
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +39 -0
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +27 -0
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +338 -0
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +13 -0
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts +16 -0
- package/dist/types/react/web/ui/Bridge/common/TokenAndChain.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts +10 -0
- package/dist/types/react/web/ui/Bridge/common/TokenBalanceRow.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +9 -0
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +36 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts +12 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/FiatProviderSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +50 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts +12 -0
- package/dist/types/react/web/ui/Bridge/payment-selection/WalletFiatSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts +24 -0
- package/dist/types/react/web/ui/Bridge/payment-success/PaymentReceipt.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +28 -0
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/constants.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/icons/CreditCardIcon.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +4 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +2 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/ChainName.d.ts +3 -0
- package/dist/types/react/web/ui/components/ChainName.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/TokenIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +90 -0
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +65 -0
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +55 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts +63 -0
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +70 -0
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +65 -0
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts +61 -0
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +58 -0
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +55 -0
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +39 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/fixtures.d.ts +37 -0
- package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -0
- package/dist/types/stories/TokenBalanceRow.stories.d.ts +53 -0
- package/dist/types/stories/TokenBalanceRow.stories.d.ts.map +1 -0
- package/dist/types/stories/WalletRow.stories.d.ts +63 -0
- package/dist/types/stories/WalletRow.stories.d.ts.map +1 -0
- package/dist/types/stories/utils.d.ts +5 -0
- package/dist/types/stories/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/utils/getWalletBalance.d.ts +1 -1
- package/dist/types/wallets/utils/getWalletBalance.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/bridge/Routes.ts +5 -0
- package/src/bridge/Status.test.ts +1 -1
- package/src/bridge/Token.ts +82 -1
- package/src/bridge/types/BridgeAction.ts +1 -1
- package/src/bridge/types/Errors.ts +11 -0
- package/src/cli/bin.ts +2 -2
- package/src/exports/react.ts +16 -0
- package/src/pay/buyWithFiat/getQuote.ts +2 -2
- package/src/pay/convert/cryptoToFiat.ts +4 -4
- package/src/pay/convert/fiatToCrypto.ts +4 -4
- package/src/pay/convert/get-token.ts +17 -4
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/react/components.md +134 -0
- package/src/react/core/adapters/.keep +2 -0
- package/src/react/core/adapters/WindowAdapter.ts +13 -0
- package/src/react/core/errors/.keep +2 -0
- package/src/react/core/errors/mapBridgeError.test.ts +98 -0
- package/src/react/core/errors/mapBridgeError.ts +25 -0
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +42 -37
- package/src/react/core/hooks/others/useChainQuery.ts +1 -1
- package/src/react/core/hooks/pay/useBuyWithFiatQuotesForProviders.ts +100 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +1 -1
- package/src/react/core/hooks/useBridgeError.ts +149 -0
- package/src/react/core/hooks/useBridgePrepare.test.ts +161 -0
- package/src/react/core/hooks/useBridgePrepare.ts +133 -0
- package/src/react/core/hooks/useBridgeQuote.ts +67 -0
- package/src/react/core/hooks/useBridgeRoutes.test.ts +137 -0
- package/src/react/core/hooks/useBridgeRoutes.ts +75 -0
- package/src/react/core/hooks/usePaymentMethods.ts +203 -0
- package/src/react/core/hooks/useStepExecutor.ts +606 -0
- package/src/react/core/hooks/useTransactionDetails.ts +177 -0
- package/src/react/core/hooks/wallets/useAutoConnectCore.test.tsx +1 -57
- package/src/react/core/hooks/wallets/useSendToken.ts +17 -3
- package/src/react/core/machines/.keep +2 -0
- package/src/react/core/machines/paymentMachine.test.ts +519 -0
- package/src/react/core/machines/paymentMachine.ts +290 -0
- package/src/react/core/types/.keep +2 -0
- package/src/react/core/utils/wallet.test.ts +77 -0
- package/src/react/native/flows/.keep +2 -0
- package/src/react/web/adapters/WindowAdapter.ts +23 -0
- package/src/react/web/adapters/adapters.test.ts +30 -0
- package/src/react/web/flows/.keep +2 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +5 -0
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +357 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +494 -0
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +473 -0
- package/src/react/web/ui/Bridge/DirectPayment.tsx +234 -0
- package/src/react/web/ui/Bridge/ErrorBanner.tsx +86 -0
- package/src/react/web/ui/Bridge/FundWallet.tsx +341 -0
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +219 -0
- package/src/react/web/ui/Bridge/StepRunner.tsx +417 -0
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +403 -0
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +485 -0
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +84 -0
- package/src/react/web/ui/Bridge/common/TokenAndChain.tsx +203 -0
- package/src/react/web/ui/Bridge/common/TokenBalanceRow.tsx +112 -0
- package/src/react/web/ui/Bridge/common/WithHeader.tsx +65 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +318 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +301 -0
- package/src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx +186 -0
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +268 -0
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +282 -0
- package/src/react/web/ui/Bridge/payment-selection/WalletFiatSelection.tsx +172 -0
- package/src/react/web/ui/Bridge/payment-success/PaymentReceipt.tsx +392 -0
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +155 -0
- package/src/react/web/ui/ConnectWallet/Details.test.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/constants.ts +1 -1
- package/src/react/web/ui/ConnectWallet/icons/CreditCardIcon.tsx +24 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +5 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +8 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +3 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx +7 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +7 -3
- package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +22 -0
- package/src/react/web/ui/PayEmbed.tsx +2 -0
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +10 -5
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +78 -25
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +15 -9
- package/src/react/web/ui/components/ChainName.tsx +4 -2
- package/src/react/web/ui/components/TokenIcon.tsx +7 -4
- package/src/react/web/ui/components/buttons.tsx +1 -5
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +267 -0
- package/src/stories/Bridge/DirectPayment.stories.tsx +225 -0
- package/src/stories/Bridge/ErrorBanner.stories.tsx +184 -0
- package/src/stories/Bridge/FundWallet.stories.tsx +196 -0
- package/src/stories/Bridge/PaymentDetails.stories.tsx +501 -0
- package/src/stories/Bridge/PaymentSelection.stories.tsx +177 -0
- package/src/stories/Bridge/StepRunner.stories.tsx +109 -0
- package/src/stories/Bridge/SuccessScreen.stories.tsx +217 -0
- package/src/stories/Bridge/TransactionPayment.stories.tsx +170 -0
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +119 -0
- package/src/stories/Bridge/fixtures.ts +802 -0
- package/src/stories/TokenBalanceRow.stories.tsx +169 -0
- package/src/stories/WalletRow.stories.tsx +166 -0
- package/src/stories/utils.tsx +35 -0
- package/src/version.ts +1 -1
- package/src/wallets/connection/autoConnectCore.test.ts +0 -53
- package/src/wallets/utils/getWalletBalance.ts +1 -1
@@ -0,0 +1,101 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.ChainIcon = void 0;
|
4
|
+
exports.TokenAndChain = TokenAndChain;
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const react_1 = require("react");
|
7
|
+
const utils_js_1 = require("../../../../../chains/utils.js");
|
8
|
+
const addresses_js_1 = require("../../../../../constants/addresses.js");
|
9
|
+
const ipfs_js_1 = require("../../../../../utils/ipfs.js");
|
10
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
11
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
12
|
+
const useChainQuery_js_1 = require("../../../../core/hooks/others/useChainQuery.js");
|
13
|
+
const walletIcon_js_1 = require("../../../../core/utils/walletIcon.js");
|
14
|
+
const nativeToken_js_1 = require("../../ConnectWallet/screens/nativeToken.js");
|
15
|
+
const ChainName_js_1 = require("../../components/ChainName.js");
|
16
|
+
const Img_js_1 = require("../../components/Img.js");
|
17
|
+
const basic_js_1 = require("../../components/basic.js");
|
18
|
+
const fallbackChainIcon_js_1 = require("../../components/fallbackChainIcon.js");
|
19
|
+
const text_js_1 = require("../../components/text.js");
|
20
|
+
function TokenAndChain({ token, client, size, style, }) {
|
21
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
22
|
+
const chain = (0, utils_js_1.getCachedChain)(token.chainId);
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", center: "y", gap: "sm", style: {
|
24
|
+
flexWrap: "nowrap",
|
25
|
+
...style,
|
26
|
+
}, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { style: {
|
27
|
+
position: "relative",
|
28
|
+
width: index_js_1.iconSize[size],
|
29
|
+
height: index_js_1.iconSize[size],
|
30
|
+
}, children: [(0, jsx_runtime_1.jsx)(TokenIconWithFallback, { token: token, size: size, client: client }), chain.id !== 1 && ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { style: {
|
31
|
+
position: "absolute",
|
32
|
+
bottom: "-2px",
|
33
|
+
right: "-6px",
|
34
|
+
width: size === "lg" || size === "xl" ? index_js_1.iconSize.sm : index_js_1.iconSize.xs,
|
35
|
+
height: size === "lg" || size === "xl" ? index_js_1.iconSize.sm : index_js_1.iconSize.xs,
|
36
|
+
borderRadius: "50%",
|
37
|
+
background: theme.colors.borderColor,
|
38
|
+
border: `1.5px solid ${theme.colors.modalBg}`,
|
39
|
+
}, children: (0, jsx_runtime_1.jsx)(exports.ChainIcon, { chain: chain, size: size === "xl" || size === "lg" ? "sm" : "xs", client: client }) }))] }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", style: { minWidth: 0 }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: size === "xl" ? "lg" : "sm", color: "primaryText", weight: 600, style: {
|
40
|
+
overflow: "hidden",
|
41
|
+
textOverflow: "ellipsis",
|
42
|
+
whiteSpace: "nowrap",
|
43
|
+
}, children: token.name }), (0, jsx_runtime_1.jsx)(ChainName_js_1.ChainName, { chain: chain, size: size === "xl" ? "sm" : "xs", client: client, short: true })] })] }));
|
44
|
+
}
|
45
|
+
function TokenIconWithFallback(props) {
|
46
|
+
const chain = (0, utils_js_1.getCachedChain)(props.token.chainId);
|
47
|
+
const chainMeta = (0, useChainQuery_js_1.useChainMetadata)(chain).data;
|
48
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
49
|
+
const tokenImage = (0, react_1.useMemo)(() => {
|
50
|
+
if ((0, nativeToken_js_1.isNativeToken)(props.token) ||
|
51
|
+
props.token.address === addresses_js_1.NATIVE_TOKEN_ADDRESS) {
|
52
|
+
if (chainMeta?.nativeCurrency.symbol === "ETH") {
|
53
|
+
return "ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/ethereum/512.png"; // ETH icon
|
54
|
+
}
|
55
|
+
return chainMeta?.icon?.url;
|
56
|
+
}
|
57
|
+
return props.token.iconUri;
|
58
|
+
}, [props.token, chainMeta?.icon?.url, chainMeta?.nativeCurrency.symbol]);
|
59
|
+
return tokenImage ? ((0, jsx_runtime_1.jsx)(Img_js_1.Img, { src: tokenImage, style: {
|
60
|
+
borderRadius: "50%",
|
61
|
+
}, width: index_js_1.iconSize[props.size], height: index_js_1.iconSize[props.size], fallbackImage: walletIcon_js_1.genericTokenIcon, client: props.client })) : ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { style: {
|
62
|
+
width: `${index_js_1.iconSize.md}px`,
|
63
|
+
height: `${index_js_1.iconSize.md}px`,
|
64
|
+
borderRadius: "50%",
|
65
|
+
backgroundColor: theme.colors.secondaryButtonBg,
|
66
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
67
|
+
display: "flex",
|
68
|
+
alignItems: "center",
|
69
|
+
justifyContent: "center",
|
70
|
+
padding: index_js_1.spacing.xs,
|
71
|
+
}, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: props.size === "xl" ? "sm" : "xs", color: "secondaryText", style: { fontWeight: 600 }, children: props.token.symbol.slice(0, 1) }) }));
|
72
|
+
}
|
73
|
+
const ChainIcon = (props) => {
|
74
|
+
const { url } = (0, useChainQuery_js_1.useChainIconUrl)(props.chain);
|
75
|
+
return ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { style: {
|
76
|
+
position: "relative",
|
77
|
+
display: "flex",
|
78
|
+
flexShrink: 0,
|
79
|
+
alignItems: "center",
|
80
|
+
}, children: (0, jsx_runtime_1.jsx)(Img_js_1.Img, { src: getSrcChainIcon({
|
81
|
+
client: props.client,
|
82
|
+
chainIconUrl: url,
|
83
|
+
}), width: index_js_1.iconSize[props.size], height: index_js_1.iconSize[props.size], fallbackImage: fallbackChainIcon_js_1.fallbackChainIcon, client: props.client }) }));
|
84
|
+
};
|
85
|
+
exports.ChainIcon = ChainIcon;
|
86
|
+
const getSrcChainIcon = (props) => {
|
87
|
+
const url = props.chainIconUrl;
|
88
|
+
if (!url) {
|
89
|
+
return fallbackChainIcon_js_1.fallbackChainIcon;
|
90
|
+
}
|
91
|
+
try {
|
92
|
+
return (0, ipfs_js_1.resolveScheme)({
|
93
|
+
uri: url,
|
94
|
+
client: props.client,
|
95
|
+
});
|
96
|
+
}
|
97
|
+
catch {
|
98
|
+
return fallbackChainIcon_js_1.fallbackChainIcon;
|
99
|
+
}
|
100
|
+
};
|
101
|
+
//# sourceMappingURL=TokenAndChain.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TokenAndChain.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/common/TokenAndChain.tsx"],"names":[],"mappings":";;;AAqBA,sCA4EC;;AAjGD,iCAAgC;AAGhC,6DAAg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C;IACL,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,wCAAiB,CAAC;IAC3B,CAAC;AACH,CAAC,CAAC"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.TokenBalanceRow = TokenBalanceRow;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const styled_1 = require("@emotion/styled");
|
6
|
+
const utils_js_1 = require("../../../../../chains/utils.js");
|
7
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
8
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
9
|
+
const FiatValue_js_1 = require("../../ConnectWallet/screens/Buy/swap/FiatValue.js");
|
10
|
+
const basic_js_1 = require("../../components/basic.js");
|
11
|
+
const buttons_js_1 = require("../../components/buttons.js");
|
12
|
+
const text_js_1 = require("../../components/text.js");
|
13
|
+
const TokenAndChain_js_1 = require("./TokenAndChain.js");
|
14
|
+
function TokenBalanceRow({ client, token, amount, onClick, style, }) {
|
15
|
+
const chain = (0, utils_js_1.getCachedChain)(token.chainId);
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(StyledButton, { onClick: () => onClick(token), variant: "secondary", style: {
|
17
|
+
display: "flex",
|
18
|
+
justifyContent: "space-between",
|
19
|
+
padding: `${index_js_1.spacing.sm} ${index_js_1.spacing.md}`,
|
20
|
+
...style,
|
21
|
+
}, children: [(0, jsx_runtime_1.jsx)(TokenAndChain_js_1.TokenAndChain, { token: token, client: client, size: "lg", style: { maxWidth: "50%", flex: 1 } }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "row", center: "y", gap: "4xs", color: "secondaryText", style: {
|
22
|
+
flex: "1",
|
23
|
+
maxWidth: "50%",
|
24
|
+
minWidth: 0,
|
25
|
+
justifyContent: "flex-end",
|
26
|
+
flexWrap: "nowrap",
|
27
|
+
}, children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", color: "secondaryText", gap: "3xs", style: {
|
28
|
+
alignItems: "flex-end",
|
29
|
+
minWidth: 0,
|
30
|
+
overflow: "hidden",
|
31
|
+
}, children: [(0, jsx_runtime_1.jsx)(FiatValue_js_1.FiatValue, { tokenAmount: amount, token: token, chain: chain, client: client, color: "primaryText", size: "sm" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "secondaryText", style: {
|
32
|
+
overflow: "hidden",
|
33
|
+
textOverflow: "ellipsis",
|
34
|
+
whiteSpace: "nowrap",
|
35
|
+
}, children: `${Number(amount).toLocaleString(undefined, {
|
36
|
+
maximumFractionDigits: 6,
|
37
|
+
minimumFractionDigits: 0,
|
38
|
+
})} ${token.symbol}` })] }) })] }));
|
39
|
+
}
|
40
|
+
const StyledButton = /* @__PURE__ */ (0, styled_1.default)(buttons_js_1.Button)((props) => {
|
41
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
42
|
+
return {
|
43
|
+
background: "transparent",
|
44
|
+
justifyContent: "space-between",
|
45
|
+
flexWrap: "nowrap",
|
46
|
+
flexDirection: "row",
|
47
|
+
padding: index_js_1.spacing.sm,
|
48
|
+
paddingRight: index_js_1.spacing.xs,
|
49
|
+
gap: index_js_1.spacing.sm,
|
50
|
+
"&:hover": {
|
51
|
+
background: theme.colors.secondaryButtonBg,
|
52
|
+
},
|
53
|
+
transition: "background 200ms ease, transform 150ms ease",
|
54
|
+
...props.style,
|
55
|
+
};
|
56
|
+
});
|
57
|
+
//# sourceMappingURL=TokenBalanceRow.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TokenBalanceRow.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/common/TokenBalanceRow.tsx"],"names":[],"mappings":";;AAYA,0CAiFC;;AA7FD,4CAAqC;AAErC,6DAAgE;AAEhE,kGAAuF;AACvF,sEAAkE;AAClE,oFAA8E;AAC9E,wDAAsD;AACtD,4DAAqD;AACrD,sDA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AAC,IAAI,GACT,EACF,uBAAC,cAAI,IACH,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,eAAe,EACrB,KAAK,EAAE;gCACL,QAAQ,EAAE,QAAQ;gCAClB,YAAY,EAAE,UAAU;gCACxB,UAAU,EAAE,QAAQ;6BACrB,YAEA,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE;gCAC3C,qBAAqB,EAAE,CAAC;gCACxB,qBAAqB,EAAE,CAAC;6BACzB,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,GACf,IACG,GACF,IACC,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC,IAAA,gBAAM,EAAC,mBAAM,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;IAC5D,MAAM,KAAK,GAAG,IAAA,uCAAc,GAAE,CAAC;IAC/B,OAAO;QACL,UAAU,EAAE,aAAa;QACzB,cAAc,EAAE,eAAe;QAC/B,QAAQ,EAAE,QAAQ;QAClB,aAAa,EAAE,KAAK;QACpB,OAAO,EAAE,kBAAO,CAAC,EAAE;QACnB,YAAY,EAAE,kBAAO,CAAC,EAAE;QACxB,GAAG,EAAE,kBAAO,CAAC,EAAE;QACf,SAAS,EAAE;YACT,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;SAC3C;QACD,UAAU,EAAE,6CAA6C;QACzD,GAAG,KAAK,CAAC,KAAK;KACf,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.WithHeader = WithHeader;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const ipfs_js_1 = require("../../../../../utils/ipfs.js");
|
6
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
7
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
8
|
+
const Spacer_js_1 = require("../../components/Spacer.js");
|
9
|
+
const basic_js_1 = require("../../components/basic.js");
|
10
|
+
const text_js_1 = require("../../components/text.js");
|
11
|
+
function WithHeader({ children, uiOptions, defaultTitle, client, }) {
|
12
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
13
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", children: [uiOptions.metadata?.image && ((0, jsx_runtime_1.jsx)("div", { style: {
|
14
|
+
width: "100%",
|
15
|
+
borderRadius: `${index_js_1.radius.md} ${index_js_1.radius.md} 0 0`,
|
16
|
+
overflow: "hidden",
|
17
|
+
aspectRatio: "16/9",
|
18
|
+
backgroundColor: theme.colors.tertiaryBg,
|
19
|
+
backgroundImage: `url(${(0, ipfs_js_1.resolveScheme)({
|
20
|
+
client,
|
21
|
+
uri: uiOptions.metadata.image,
|
22
|
+
})})`,
|
23
|
+
backgroundSize: "cover",
|
24
|
+
backgroundPosition: "center",
|
25
|
+
} })), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", px: "lg", children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "lg", color: "primaryText", weight: 700, children: uiOptions.metadata?.title || defaultTitle }), uiOptions.metadata?.description && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xs" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "secondaryText", children: uiOptions.metadata?.description })] })), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), children] })] }));
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=WithHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"WithHeader.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/common/WithHeader.tsx"],"names":[],"mappings":";;AASA,gCAuD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,CACJ,EAED,uBAAC,kBAAM,IAAC,CAAC,EAAC,IAAI,GAAG,EAChB,QAAQ,IACC,IACF,CACb,CAAC;AACJ,CAAC"}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.PaymentDetails = PaymentDetails;
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
7
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
8
|
+
const formatTokenBalance_js_1 = require("../../ConnectWallet/screens/formatTokenBalance.js");
|
9
|
+
const Spacer_js_1 = require("../../components/Spacer.js");
|
10
|
+
const basic_js_1 = require("../../components/basic.js");
|
11
|
+
const buttons_js_1 = require("../../components/buttons.js");
|
12
|
+
const text_js_1 = require("../../components/text.js");
|
13
|
+
const PaymentOverview_js_1 = require("./PaymentOverview.js");
|
14
|
+
function PaymentDetails({ uiOptions, client, paymentMethod, preparedQuote, onConfirm, onBack, onError, }) {
|
15
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
16
|
+
const handleConfirm = () => {
|
17
|
+
try {
|
18
|
+
onConfirm();
|
19
|
+
}
|
20
|
+
catch (error) {
|
21
|
+
onError(error);
|
22
|
+
}
|
23
|
+
};
|
24
|
+
// Extract common data based on quote type
|
25
|
+
const getDisplayData = () => {
|
26
|
+
switch (preparedQuote.type) {
|
27
|
+
case "transfer": {
|
28
|
+
const token = paymentMethod.type === "wallet"
|
29
|
+
? paymentMethod.originToken
|
30
|
+
: undefined;
|
31
|
+
if (!token) {
|
32
|
+
// can never happen
|
33
|
+
onError(new Error("Invalid payment method"));
|
34
|
+
return {
|
35
|
+
originToken: undefined,
|
36
|
+
destinationToken: undefined,
|
37
|
+
originAmount: "0",
|
38
|
+
destinationAmount: "0",
|
39
|
+
estimatedTime: 0,
|
40
|
+
};
|
41
|
+
}
|
42
|
+
return {
|
43
|
+
originToken: token,
|
44
|
+
destinationToken: token,
|
45
|
+
originAmount: (0, formatTokenBalance_js_1.formatTokenAmount)(preparedQuote.originAmount, token.decimals),
|
46
|
+
destinationAmount: (0, formatTokenBalance_js_1.formatTokenAmount)(preparedQuote.destinationAmount, token.decimals),
|
47
|
+
estimatedTime: preparedQuote.estimatedExecutionTimeMs,
|
48
|
+
};
|
49
|
+
}
|
50
|
+
case "buy": {
|
51
|
+
const method = paymentMethod.type === "wallet" ? paymentMethod : undefined;
|
52
|
+
if (!method) {
|
53
|
+
// can never happen
|
54
|
+
onError(new Error("Invalid payment method"));
|
55
|
+
return {
|
56
|
+
originToken: undefined,
|
57
|
+
destinationToken: undefined,
|
58
|
+
originAmount: "0",
|
59
|
+
destinationAmount: "0",
|
60
|
+
estimatedTime: 0,
|
61
|
+
};
|
62
|
+
}
|
63
|
+
return {
|
64
|
+
originToken: paymentMethod.type === "wallet"
|
65
|
+
? paymentMethod.originToken
|
66
|
+
: undefined,
|
67
|
+
destinationToken: preparedQuote.steps[preparedQuote.steps.length - 1]
|
68
|
+
?.destinationToken,
|
69
|
+
originAmount: (0, formatTokenBalance_js_1.formatTokenAmount)(preparedQuote.originAmount, method.originToken.decimals),
|
70
|
+
destinationAmount: (0, formatTokenBalance_js_1.formatTokenAmount)(preparedQuote.destinationAmount, preparedQuote.steps[preparedQuote.steps.length - 1]
|
71
|
+
?.destinationToken?.decimals ?? 18),
|
72
|
+
estimatedTime: preparedQuote.estimatedExecutionTimeMs,
|
73
|
+
};
|
74
|
+
}
|
75
|
+
case "onramp": {
|
76
|
+
const method = paymentMethod.type === "fiat" ? paymentMethod : undefined;
|
77
|
+
if (!method) {
|
78
|
+
// can never happen
|
79
|
+
onError(new Error("Invalid payment method"));
|
80
|
+
return {
|
81
|
+
originToken: undefined,
|
82
|
+
destinationToken: undefined,
|
83
|
+
originAmount: "0",
|
84
|
+
destinationAmount: "0",
|
85
|
+
estimatedTime: 0,
|
86
|
+
};
|
87
|
+
}
|
88
|
+
return {
|
89
|
+
originToken: undefined, // Onramp starts with fiat
|
90
|
+
destinationToken: preparedQuote.destinationToken,
|
91
|
+
originAmount: (0, formatTokenBalance_js_1.formatCurrencyAmount)(method.currency, Number(preparedQuote.currencyAmount)),
|
92
|
+
destinationAmount: (0, formatTokenBalance_js_1.formatTokenAmount)(preparedQuote.destinationAmount, preparedQuote.destinationToken.decimals),
|
93
|
+
estimatedTime: undefined,
|
94
|
+
};
|
95
|
+
}
|
96
|
+
default: {
|
97
|
+
throw new Error(`Unsupported bridge prepare type: ${preparedQuote.type}`);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
};
|
101
|
+
const displayData = getDisplayData();
|
102
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", fullHeight: true, p: "lg", children: [(0, jsx_runtime_1.jsx)(basic_js_1.ModalHeader, { title: "Payment Details", onBack: onBack }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "xl" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", children: [displayData.destinationToken && ((0, jsx_runtime_1.jsx)(PaymentOverview_js_1.PaymentOverview, { uiOptions: uiOptions, sender: preparedQuote.intent.sender ||
|
103
|
+
paymentMethod.payerWallet.getAccount()?.address, client: client, paymentMethod: paymentMethod, toToken: displayData.destinationToken, receiver: preparedQuote.intent.receiver, fromAmount: displayData.originAmount, toAmount: displayData.destinationAmount })), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "md" }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xs", style: { justifyContent: "center", flex: 1 }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "secondaryText", children: "Estimated Time" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "primaryText", children: displayData.estimatedTime
|
104
|
+
? `~${Math.ceil(displayData.estimatedTime / 60000)} min`
|
105
|
+
: "~2 min" })] }), preparedQuote.steps.length > 1 ? ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "xs", style: { justifyContent: "center", flex: 1 }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "secondaryText", children: "Route Length" }), (0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "sm", color: "primaryText", children: [preparedQuote.steps.length, " step", preparedQuote.steps.length !== 1 ? "s" : ""] })] })) : null] })] }), preparedQuote.steps.length > 1 && ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", children: [(0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "sm", style: {
|
106
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
107
|
+
borderRadius: index_js_1.radius.md,
|
108
|
+
backgroundColor: theme.colors.tertiaryBg,
|
109
|
+
padding: `${index_js_1.spacing.sm} ${index_js_1.spacing.md}`,
|
110
|
+
}, children: preparedQuote.steps.map((step, stepIndex) => ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "sm", children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "md", style: { alignItems: "center" }, children: [(0, jsx_runtime_1.jsx)(basic_js_1.Container, { center: "both", flex: "row", style: {
|
111
|
+
width: "24px",
|
112
|
+
height: "24px",
|
113
|
+
borderRadius: "50%",
|
114
|
+
backgroundColor: theme.colors.accentButtonBg,
|
115
|
+
color: theme.colors.accentButtonText,
|
116
|
+
fontSize: "12px",
|
117
|
+
fontWeight: "bold",
|
118
|
+
flexShrink: 0,
|
119
|
+
}, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "accentButtonText", children: stepIndex + 1 }) }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "row", center: "y", gap: "sm", style: { flex: 1 }, children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "sm", color: "primaryText", children: [step.originToken.symbol, " \u2192", " ", step.destinationToken.symbol] }), (0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "xs", color: "secondaryText", children: [step.originToken.name, " to", " ", step.destinationToken.name] })] }) })] }) }, `step-${stepIndex}-${step.originToken.address}-${step.destinationToken.address}`))) })] })), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "lg" }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "sm", children: (0, jsx_runtime_1.jsx)(buttons_js_1.Button, { variant: "accent", fullWidth: true, onClick: handleConfirm, children: "Confirm Payment" }) })] })] }));
|
120
|
+
}
|
121
|
+
//# sourceMappingURL=PaymentDetails.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PaymentDetails.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAoDb,wCAyQC;;AA3TD,kGAAuF;AACvF,sEAA0E;AAI1E,6FAG2D;AAC3D,0DAAoD;AACpD,wDAAmE;AACnE,4DAAqD;AACrD,sDAAgD;AAEhD,6DAAuD;AAoCvD,SAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,MAAM,EACN,aAAa,EACb,aAAa,EACb,SAAS,EACT,MAAM,EACN,OAAO,GACa;IACpB,MAAM,KAAK,GAAG,IAAA,uCAAc,GAAE,CAAC;IAE/B,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,CAAC;YACH,SAAS,EAAE,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAc,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC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EAAC,aAAa,aAChC,IAAI,CAAC,WAAW,CAAC,MAAM,aAAI,GAAG,EAC9B,IAAI,CAAC,gBAAgB,CAAC,MAAM,IACxB,EACP,wBAAC,cAAI,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,eAAe,aAClC,IAAI,CAAC,WAAW,CAAC,IAAI,SAAK,GAAG,EAC7B,IAAI,CAAC,gBAAgB,CAAC,IAAI,IACtB,IACG,GACF,IACF,IA9CP,QAAQ,SAAS,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,IAAI,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CA+C3E,CACb,CAAC,GACQ,IACF,CACb,EAED,uBAAC,kBAAM,IAAC,CAAC,EAAC,IAAI,GAAG,EAGjB,uBAAC,oBAAS,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,YAC/B,uBAAC,mBAAM,IAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,QAAC,OAAO,EAAE,aAAa,gCAEhD,GACC,IACF,IACF,CACb,CAAC;AACJ,CAAC"}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PaymentOverview = PaymentOverview;
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
5
|
+
const utils_js_1 = require("../../../../../chains/utils.js");
|
6
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
7
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
8
|
+
const useTransactionDetails_js_1 = require("../../../../core/hooks/useTransactionDetails.js");
|
9
|
+
const currencies_js_1 = require("../../ConnectWallet/screens/Buy/fiat/currencies.js");
|
10
|
+
const FiatValue_js_1 = require("../../ConnectWallet/screens/Buy/swap/FiatValue.js");
|
11
|
+
const StepConnector_js_1 = require("../../ConnectWallet/screens/Buy/swap/StepConnector.js");
|
12
|
+
const WalletRow_js_1 = require("../../ConnectWallet/screens/Buy/swap/WalletRow.js");
|
13
|
+
const basic_js_1 = require("../../components/basic.js");
|
14
|
+
const text_js_1 = require("../../components/text.js");
|
15
|
+
const TokenBalanceRow_js_1 = require("../common/TokenBalanceRow.js");
|
16
|
+
function PaymentOverview(props) {
|
17
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
18
|
+
const sender = props.sender ||
|
19
|
+
(props.paymentMethod.type === "wallet"
|
20
|
+
? props.paymentMethod.payerWallet.getAccount()?.address
|
21
|
+
: undefined);
|
22
|
+
const isDifferentRecipient = props.receiver.toLowerCase() !== sender?.toLowerCase();
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { bg: "tertiaryBg", flex: "column", style: {
|
24
|
+
borderRadius: index_js_1.radius.lg,
|
25
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
26
|
+
}, children: [sender && ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "row", gap: "sm", px: "md", py: "sm", style: {
|
27
|
+
borderBottom: `1px solid ${theme.colors.borderColor}`,
|
28
|
+
}, children: (0, jsx_runtime_1.jsx)(WalletRow_js_1.WalletRow, { address: sender, client: props.client, iconSize: "md", textSize: "sm" }) })), props.paymentMethod.type === "wallet" && ((0, jsx_runtime_1.jsx)(TokenBalanceRow_js_1.TokenBalanceRow, { token: props.paymentMethod.originToken, client: props.client, amount: props.fromAmount, onClick: () => { }, style: {
|
29
|
+
background: "transparent",
|
30
|
+
borderRadius: 0,
|
31
|
+
border: "none",
|
32
|
+
} })), props.paymentMethod.type === "fiat" && ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", px: "md", py: "sm", center: "y", style: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", center: "y", children: [(0, currencies_js_1.getFiatCurrencyIcon)({
|
33
|
+
currency: props.paymentMethod.currency,
|
34
|
+
size: "lg",
|
35
|
+
}), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "primaryText", style: { fontWeight: 600 }, children: props.paymentMethod.currency }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "secondaryText", children: props.paymentMethod.onramp.charAt(0).toUpperCase() +
|
36
|
+
props.paymentMethod.onramp.slice(1) })] })] }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "primaryText", style: { fontWeight: 600 }, children: props.fromAmount })] }))] }), (0, jsx_runtime_1.jsx)(StepConnector_js_1.StepConnectorArrow, {}), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", bg: "tertiaryBg", style: {
|
37
|
+
borderRadius: index_js_1.radius.lg,
|
38
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
39
|
+
}, children: [isDifferentRecipient && ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "row", gap: "sm", px: "md", py: "sm", style: {
|
40
|
+
borderBottom: `1px solid ${theme.colors.borderColor}`,
|
41
|
+
}, children: (0, jsx_runtime_1.jsx)(WalletRow_js_1.WalletRow, { address: props.receiver, client: props.client, iconSize: "md", textSize: "sm" }) })), props.uiOptions.mode === "direct_payment" && ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", p: "md", center: "y", style: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "primaryText", style: { fontWeight: 600 }, children: props.uiOptions.metadata?.title || "Payment" }), props.uiOptions.metadata?.description && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "secondaryText", children: props.uiOptions.metadata.description }))] }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { alignItems: "flex-end" }, children: [(0, jsx_runtime_1.jsx)(FiatValue_js_1.FiatValue, { tokenAmount: props.uiOptions.paymentInfo.amount, token: props.toToken, client: props.client, chain: (0, utils_js_1.defineChain)(props.toToken.chainId), weight: 600, color: "primaryText", size: "sm" }), (0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "xs", color: "secondaryText", children: [props.uiOptions.paymentInfo.amount, " ", props.toToken.symbol] })] })] })), props.uiOptions.mode === "fund_wallet" && ((0, jsx_runtime_1.jsx)(TokenBalanceRow_js_1.TokenBalanceRow, { token: props.toToken, client: props.client, amount: props.toAmount, onClick: () => { }, style: {
|
42
|
+
background: "transparent",
|
43
|
+
borderRadius: 0,
|
44
|
+
border: "none",
|
45
|
+
} })), props.uiOptions.mode === "transaction" && ((0, jsx_runtime_1.jsx)(TransactionOverViewCompact, { uiOptions: props.uiOptions, client: props.client }))] })] }));
|
46
|
+
}
|
47
|
+
const TransactionOverViewCompact = (props) => {
|
48
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
49
|
+
const txInfo = (0, useTransactionDetails_js_1.useTransactionDetails)({
|
50
|
+
transaction: props.uiOptions.transaction,
|
51
|
+
client: props.client,
|
52
|
+
});
|
53
|
+
if (!txInfo.data) {
|
54
|
+
// Skeleton loading state
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", p: "md", center: "y", style: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
56
|
+
width: "120px",
|
57
|
+
height: "16px",
|
58
|
+
backgroundColor: theme.colors.skeletonBg,
|
59
|
+
borderRadius: index_js_1.spacing.xs,
|
60
|
+
} }), props.uiOptions.metadata?.description && ((0, jsx_runtime_1.jsx)("div", { style: {
|
61
|
+
width: "80px",
|
62
|
+
height: "12px",
|
63
|
+
backgroundColor: theme.colors.skeletonBg,
|
64
|
+
borderRadius: index_js_1.spacing.xs,
|
65
|
+
} }))] }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { alignItems: "flex-end" }, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
66
|
+
width: "100px",
|
67
|
+
height: "24px",
|
68
|
+
backgroundColor: theme.colors.skeletonBg,
|
69
|
+
borderRadius: index_js_1.spacing.sm,
|
70
|
+
} }) })] }));
|
71
|
+
}
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", p: "md", center: "y", style: { justifyContent: "space-between" }, children: [(0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { flex: 1 }, children: [(0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "primaryText", style: { fontWeight: 600 }, children: props.uiOptions.metadata?.title || "Transaction" }), props.uiOptions.metadata?.description && ((0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "secondaryText", children: props.uiOptions.metadata.description }))] }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "3xs", center: "y", style: { alignItems: "flex-end" }, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "xs", color: "secondaryText", style: {
|
73
|
+
fontFamily: "monospace",
|
74
|
+
textAlign: "right",
|
75
|
+
backgroundColor: theme.colors.secondaryButtonBg,
|
76
|
+
padding: `${index_js_1.spacing.xs} ${index_js_1.spacing.sm}`,
|
77
|
+
borderRadius: index_js_1.spacing.sm,
|
78
|
+
}, children: txInfo.data.functionInfo.functionName }) })] }));
|
79
|
+
};
|
80
|
+
//# sourceMappingURL=PaymentOverview.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PaymentOverview.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx"],"names":[],"mappings":";;AAgBA,0CAoLC;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,CAAC,iBAAiB;wBAC/C,OAAO,EAAE,GAAG,kBAAO,CAAC,EAAE,IAAI,kBAAO,CAAC,EAAE,EAAE;wBACtC,YAAY,EAAE,kBAAO,CAAC,EAAE;qBACzB,YAEA,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,GACjC,GACG,IACF,CACb,CAAC;AACJ,CAAC,CAAC"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.FiatProviderSelection = FiatProviderSelection;
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
6
|
+
const react_1 = require("react");
|
7
|
+
const address_js_1 = require("../../../../../utils/address.js");
|
8
|
+
const units_js_1 = require("../../../../../utils/units.js");
|
9
|
+
const CustomThemeProvider_js_1 = require("../../../../core/design-system/CustomThemeProvider.js");
|
10
|
+
const index_js_1 = require("../../../../core/design-system/index.js");
|
11
|
+
const useBuyWithFiatQuotesForProviders_js_1 = require("../../../../core/hooks/pay/useBuyWithFiatQuotesForProviders.js");
|
12
|
+
const Img_js_1 = require("../../components/Img.js");
|
13
|
+
const Spacer_js_1 = require("../../components/Spacer.js");
|
14
|
+
const Spinner_js_1 = require("../../components/Spinner.js");
|
15
|
+
const basic_js_1 = require("../../components/basic.js");
|
16
|
+
const buttons_js_1 = require("../../components/buttons.js");
|
17
|
+
const text_js_1 = require("../../components/text.js");
|
18
|
+
const PROVIDERS = [
|
19
|
+
{
|
20
|
+
id: "coinbase",
|
21
|
+
name: "Coinbase",
|
22
|
+
description: "Fast and secure payments",
|
23
|
+
iconUri: "https://i.ibb.co/LDJ3Rk2t/Frame-5.png",
|
24
|
+
},
|
25
|
+
{
|
26
|
+
id: "stripe",
|
27
|
+
name: "Stripe",
|
28
|
+
description: "Trusted payment processing",
|
29
|
+
iconUri: "https://i.ibb.co/CpgQC2Lf/images-3.png",
|
30
|
+
},
|
31
|
+
{
|
32
|
+
id: "transak",
|
33
|
+
name: "Transak",
|
34
|
+
description: "Global payment solution",
|
35
|
+
iconUri: "https://i.ibb.co/Xx2r882p/Transak-official-symbol-1.png",
|
36
|
+
},
|
37
|
+
];
|
38
|
+
function FiatProviderSelection({ onProviderSelected, client, toChainId, toTokenAddress, toAddress, toAmount, }) {
|
39
|
+
const theme = (0, CustomThemeProvider_js_1.useCustomTheme)();
|
40
|
+
// Fetch quotes for all providers
|
41
|
+
const quoteQueries = (0, useBuyWithFiatQuotesForProviders_js_1.useBuyWithFiatQuotesForProviders)({
|
42
|
+
client,
|
43
|
+
chainId: toChainId,
|
44
|
+
tokenAddress: (0, address_js_1.checksumAddress)(toTokenAddress),
|
45
|
+
receiver: (0, address_js_1.checksumAddress)(toAddress),
|
46
|
+
amount: toAmount || "0",
|
47
|
+
currency: "USD",
|
48
|
+
});
|
49
|
+
const quotes = (0, react_1.useMemo)(() => {
|
50
|
+
return quoteQueries.map((q) => q.data).filter((q) => !!q);
|
51
|
+
}, [quoteQueries]);
|
52
|
+
// TODO: add a "remember my choice" checkbox
|
53
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "sm", children: quotes.length > 0 ? (quotes
|
54
|
+
.sort((a, b) => a.currencyAmount - b.currencyAmount)
|
55
|
+
.map((quote, index) => {
|
56
|
+
const provider = PROVIDERS.find((p) => p.id === quote.intent.onramp);
|
57
|
+
if (!provider) {
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
return ((0, jsx_runtime_1.jsx)(basic_js_1.Container, { animate: "fadein", style: {
|
61
|
+
animationDelay: `${index * 100}ms`,
|
62
|
+
}, children: (0, jsx_runtime_1.jsx)(buttons_js_1.Button, { variant: "secondary", fullWidth: true, onClick: () => onProviderSelected(provider.id), style: {
|
63
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
64
|
+
borderRadius: index_js_1.radius.md,
|
65
|
+
padding: `${index_js_1.spacing.sm} ${index_js_1.spacing.md}`,
|
66
|
+
backgroundColor: theme.colors.tertiaryBg,
|
67
|
+
textAlign: "left",
|
68
|
+
}, children: (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "row", gap: "sm", style: { width: "100%", alignItems: "center" }, children: [(0, jsx_runtime_1.jsx)(basic_js_1.Container, { style: {
|
69
|
+
width: `${index_js_1.iconSize.md}px`,
|
70
|
+
height: `${index_js_1.iconSize.md}px`,
|
71
|
+
borderRadius: "50%",
|
72
|
+
display: "flex",
|
73
|
+
alignItems: "center",
|
74
|
+
justifyContent: "center",
|
75
|
+
padding: index_js_1.spacing.xs,
|
76
|
+
overflow: "hidden",
|
77
|
+
}, children: (0, jsx_runtime_1.jsx)(Img_js_1.Img, { src: provider.iconUri, alt: provider.name, width: index_js_1.iconSize.md, height: index_js_1.iconSize.md, client: client }) }), (0, jsx_runtime_1.jsx)(basic_js_1.Container, { flex: "column", gap: "3xs", style: { flex: 1 }, children: (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "md", color: "primaryText", style: { fontWeight: 600 }, children: provider.name }) }), (0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", gap: "3xs", style: { alignItems: "flex-end" }, children: [(0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "sm", color: "primaryText", style: { fontWeight: 500 }, children: ["$", quote.currencyAmount.toLocaleString(undefined, {
|
78
|
+
minimumFractionDigits: 2,
|
79
|
+
maximumFractionDigits: 2,
|
80
|
+
}), " ", quote.currency] }), (0, jsx_runtime_1.jsxs)(text_js_1.Text, { size: "xs", color: "secondaryText", children: [(0, units_js_1.toTokens)(quote.destinationAmount, quote.destinationToken.decimals), " ", quote.destinationToken.symbol] })] })] }) }) }, provider.id));
|
81
|
+
})) : ((0, jsx_runtime_1.jsxs)(basic_js_1.Container, { flex: "column", center: "both", style: { minHeight: "120px" }, children: [(0, jsx_runtime_1.jsx)(Spinner_js_1.Spinner, { size: "lg", color: "secondaryText" }), (0, jsx_runtime_1.jsx)(Spacer_js_1.Spacer, { y: "sm" }), (0, jsx_runtime_1.jsx)(text_js_1.Text, { size: "sm", color: "secondaryText", center: true, children: "Generating quotes..." })] })) }) }));
|
82
|
+
}
|
83
|
+
//# sourceMappingURL=FiatProviderSelection.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FiatProviderSelection.js","sourceRoot":"","sources":["../../../../../../../src/react/web/ui/Bridge/payment-selection/FiatProviderSelection.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAiDb,sDAwIC;;AAxLD,iCAAgC;AAEhC,gEAAkE;AAClE,4DAAyD;AACzD,kGAAuF;AACvF,sEAIiD;AACjD,wHAAkH;AAClH,oDAA8C;AAC9C,0DAAoD;AACpD,4DAAsD;AACtD,wDAAsD;AACtD,4DAAqD;AACrD,sDAAgD;AAWhD,MAAM,SAAS,GAAG;IAChB;QACE,EAAE,EAAE,UAAmB;QACvB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,uCAAuC;KACjD;IACD;QACE,EAAE,EAAE,QAAiB;QACrB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,wCAAwC;KAClD;IACD;QACE,EAAE,EAAE,SAAkB;QACtB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,yDAAyD;KACnE;CACF,CAAC;AAEF,SAAgB,qBAAqB,CAAC,EACpC,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,cAAc,EACd,SAAS,EACT,QAAQ,GACmB;IAC3B,MAAM,KAAK,GAAG,IAAA,uCAAc,GAAE,CAAC;IAE/B,iCAAiC;IACjC,MAAM,YAAY,GAAG,IAAA,sEAAgC,EAAC;QACpD,MAAM;QACN,OAAO,EAAE,SAAS;QAClB,YAAY,EAAE,IAAA,4BAAe,EAAC,cAAc,CAAC;QAC7C,QAAQ,EAAE,IAAA,4BAAe,EA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