thirdweb 5.105.9 → 5.105.10
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/chains/chain-definitions/t-rex-testnet.js +20 -0
- package/dist/cjs/chains/chain-definitions/t-rex-testnet.js.map +1 -0
- package/dist/cjs/exports/chains.js +3 -1
- package/dist/cjs/exports/chains.js.map +1 -1
- package/dist/cjs/insight/common.js +0 -5
- package/dist/cjs/insight/common.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -44
- package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -2
- package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
- package/dist/cjs/react/core/hooks/useBridgeQuote.js +3 -1
- package/dist/cjs/react/core/hooks/useBridgeQuote.js.map +1 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +6 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/cjs/react/core/utils/storage.js +1 -2
- package/dist/cjs/react/core/utils/storage.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
- package/dist/cjs/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +11 -6
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +1 -7
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +0 -112
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +1 -30
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +0 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js +3 -3
- package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/buttons.js +0 -2
- package/dist/cjs/react/web/ui/components/buttons.js.map +1 -1
- package/dist/cjs/react/web/ui/components/text.js +0 -1
- package/dist/cjs/react/web/ui/components/text.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js +0 -1
- package/dist/cjs/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js +0 -1
- package/dist/cjs/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/chains/chain-definitions/t-rex-testnet.js +17 -0
- package/dist/esm/chains/chain-definitions/t-rex-testnet.js.map +1 -0
- package/dist/esm/exports/chains.js +1 -0
- package/dist/esm/exports/chains.js.map +1 -1
- package/dist/esm/insight/common.js +0 -4
- package/dist/esm/insight/common.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js +0 -43
- package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +2 -1
- package/dist/esm/pay/utils/commonTypes.js.map +1 -1
- package/dist/esm/react/core/hooks/useBridgeQuote.js +3 -1
- package/dist/esm/react/core/hooks/useBridgeQuote.js.map +1 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js +6 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js.map +1 -1
- package/dist/esm/react/core/utils/storage.js +0 -1
- package/dist/esm/react/core/utils/storage.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +7 -2
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +3 -2
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js +4 -3
- package/dist/esm/react/web/ui/Bridge/payment-selection/TokenSelection.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +12 -7
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +1 -7
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/WalletSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +1 -110
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/ReceiveFunds.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +3 -32
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +0 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/components/Modal.js +1 -1
- package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
- package/dist/esm/react/web/ui/components/buttons.js +0 -2
- package/dist/esm/react/web/ui/components/buttons.js.map +1 -1
- package/dist/esm/react/web/ui/components/text.js +0 -1
- package/dist/esm/react/web/ui/components/text.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/GetStartedScreen.js +0 -1
- package/dist/esm/react/web/wallets/shared/GetStartedScreen.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js +0 -1
- package/dist/esm/react/web/wallets/shared/OTPLoginUI.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts +7 -0
- package/dist/types/chains/chain-definitions/t-rex-testnet.d.ts.map +1 -0
- package/dist/types/exports/chains.d.ts +1 -0
- package/dist/types/exports/chains.d.ts.map +1 -1
- package/dist/types/insight/common.d.ts +0 -1
- package/dist/types/insight/common.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +0 -3
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts +0 -7
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +2 -1
- package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts +2 -1
- package/dist/types/react/core/hooks/useBridgeQuote.d.ts.map +1 -1
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/types/react/core/utils/storage.d.ts +0 -1
- package/dist/types/react/core/utils/storage.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +5 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts +2 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +0 -1
- 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/types.d.ts +0 -29
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Modal.d.ts +0 -4
- package/dist/types/react/web/ui/components/Modal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/buttons.d.ts +2 -1
- package/dist/types/react/web/ui/components/buttons.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/text.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/chains/chain-definitions/t-rex-testnet.ts +17 -0
- package/src/exports/chains.ts +1 -0
- package/src/insight/common.ts +0 -5
- package/src/pay/buyWithCrypto/getStatus.ts +0 -5
- package/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts +0 -56
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/react/core/hooks/useBridgeQuote.ts +4 -0
- package/src/react/core/hooks/usePaymentMethods.ts +8 -1
- package/src/react/core/utils/storage.ts +0 -1
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +9 -1
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +8 -0
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +6 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +52 -43
- package/src/react/web/ui/ConnectWallet/MenuButton.tsx +0 -1
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +5 -9
- package/src/react/web/ui/ConnectWallet/WalletSelector.tsx +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +0 -39
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +0 -160
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +0 -9
- package/src/react/web/ui/ConnectWallet/screens/ReceiveFunds.tsx +0 -1
- package/src/react/web/ui/PayEmbed.tsx +3 -66
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +0 -1
- package/src/react/web/ui/components/Modal.tsx +1 -1
- package/src/react/web/ui/components/buttons.tsx +1 -3
- package/src/react/web/ui/components/text.tsx +0 -1
- package/src/react/web/wallets/shared/GetStartedScreen.tsx +0 -1
- package/src/react/web/wallets/shared/OTPLoginUI.tsx +0 -1
- package/src/version.ts +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -468
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -116
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -29
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -11
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -28
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -26
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -58
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -59
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -118
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -32
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -108
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -45
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -532
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -21
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -39
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -134
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -11
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -106
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -23
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -50
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -68
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -225
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -12
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -39
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -55
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -49
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -176
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -69
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -34
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -194
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -344
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -198
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -54
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
- package/dist/cjs/react/web/ui/components/Drawer.js +0 -123
- package/dist/cjs/react/web/ui/components/Drawer.js.map +0 -1
- package/dist/cjs/react/web/ui/components/StepBar.js +0 -16
- package/dist/cjs/react/web/ui/components/StepBar.js.map +0 -1
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js +0 -19
- package/dist/cjs/react/web/ui/components/SwitchNetwork.js.map +0 -1
- package/dist/cjs/react/web/ui/components/token/TokenRow.js +0 -43
- package/dist/cjs/react/web/ui/components/token/TokenRow.js.map +0 -1
- package/dist/cjs/react/web/utils/errors.js +0 -44
- package/dist/cjs/react/web/utils/errors.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +0 -465
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js +0 -113
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js +0 -26
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +0 -24
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js +0 -23
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +0 -55
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js +0 -55
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/Stepper.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js +0 -115
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +0 -29
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -105
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -42
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +0 -529
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +0 -18
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js +0 -36
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +0 -129
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js +0 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -103
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js +0 -20
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -47
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js +0 -65
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js +0 -221
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js +0 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js +0 -35
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js +0 -52
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js +0 -46
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js +0 -173
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js +0 -66
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +0 -31
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +0 -191
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +0 -341
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js +0 -12
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +0 -195
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +0 -11
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js +0 -51
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.js.map +0 -1
- package/dist/esm/react/web/ui/components/Drawer.js +0 -119
- package/dist/esm/react/web/ui/components/Drawer.js.map +0 -1
- package/dist/esm/react/web/ui/components/StepBar.js +0 -13
- package/dist/esm/react/web/ui/components/StepBar.js.map +0 -1
- package/dist/esm/react/web/ui/components/SwitchNetwork.js +0 -16
- package/dist/esm/react/web/ui/components/SwitchNetwork.js.map +0 -1
- package/dist/esm/react/web/ui/components/token/TokenRow.js +0 -40
- package/dist/esm/react/web/ui/components/token/TokenRow.js.map +0 -1
- package/dist/esm/react/web/utils/errors.js +0 -41
- package/dist/esm/react/web/utils/errors.js.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts +0 -3
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts +0 -12
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +0 -8
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts +0 -20
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts +0 -55
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts +0 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +0 -32
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts +0 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +0 -23
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +0 -21
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +0 -32
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +0 -18
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +0 -15
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +0 -22
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts +0 -25
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts +0 -25
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts +0 -6
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/Drawer.d.ts +0 -25
- package/dist/types/react/web/ui/components/Drawer.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/StepBar.d.ts +0 -5
- package/dist/types/react/web/ui/components/StepBar.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +0 -6
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +0 -1
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts +0 -14
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +0 -1
- package/dist/types/react/web/utils/errors.d.ts +0 -8
- package/dist/types/react/web/utils/errors.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +0 -1075
- package/src/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.tsx +0 -286
- package/src/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.tsx +0 -85
- package/src/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.tsx +0 -13
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +0 -68
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.tsx +0 -48
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx +0 -104
- package/src/react/web/ui/ConnectWallet/screens/Buy/Stepper.tsx +0 -91
- package/src/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.tsx +0 -395
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +0 -61
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +0 -263
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +0 -85
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +0 -775
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +0 -54
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useEnabledPaymentMethods.ts +0 -65
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +0 -193
- package/src/react/web/ui/ConnectWallet/screens/Buy/openOnRamppopup.tsx +0 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +0 -294
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.tsx +0 -56
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +0 -80
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -77
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.tsx +0 -154
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.tsx +0 -377
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.tsx +0 -20
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.tsx +0 -109
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.tsx +0 -114
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.tsx +0 -117
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +0 -359
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.tsx +0 -232
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +0 -111
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +0 -448
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +0 -558
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +0 -56
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +0 -282
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +0 -23
- package/src/react/web/ui/ConnectWallet/screens/Buy/usePayerSetup.tsx +0 -61
- package/src/react/web/ui/components/Drawer.tsx +0 -171
- package/src/react/web/ui/components/StepBar.tsx +0 -25
- package/src/react/web/ui/components/SwitchNetwork.tsx +0 -35
- package/src/react/web/ui/components/token/TokenRow.tsx +0 -135
- package/src/react/web/utils/errors.ts +0 -52
@@ -1,80 +0,0 @@
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
2
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
3
|
-
import { getBuyWithCryptoStatusMeta } from "./statusMeta.js";
|
4
|
-
|
5
|
-
describe("getBuyWithCryptoStatusMeta", () => {
|
6
|
-
it('returns "Unknown" for NOT_FOUND status', () => {
|
7
|
-
const result = getBuyWithCryptoStatusMeta({
|
8
|
-
status: "NOT_FOUND",
|
9
|
-
} as BuyWithCryptoStatus);
|
10
|
-
expect(result).toEqual({
|
11
|
-
color: "secondaryText",
|
12
|
-
status: "Unknown",
|
13
|
-
});
|
14
|
-
});
|
15
|
-
|
16
|
-
it('returns "Bridging" for WAITING_BRIDGE subStatus', () => {
|
17
|
-
const result = getBuyWithCryptoStatusMeta({
|
18
|
-
status: "PENDING",
|
19
|
-
subStatus: "WAITING_BRIDGE",
|
20
|
-
} as BuyWithCryptoStatus);
|
21
|
-
expect(result).toEqual({
|
22
|
-
color: "accentText",
|
23
|
-
loading: true,
|
24
|
-
status: "Bridging",
|
25
|
-
});
|
26
|
-
});
|
27
|
-
|
28
|
-
it('returns "Incomplete" for PARTIAL_SUCCESS subStatus', () => {
|
29
|
-
const result = getBuyWithCryptoStatusMeta({
|
30
|
-
status: "COMPLETED",
|
31
|
-
subStatus: "PARTIAL_SUCCESS",
|
32
|
-
} as BuyWithCryptoStatus);
|
33
|
-
expect(result).toEqual({
|
34
|
-
color: "secondaryText",
|
35
|
-
status: "Incomplete",
|
36
|
-
});
|
37
|
-
});
|
38
|
-
|
39
|
-
it('returns "Pending" for PENDING status', () => {
|
40
|
-
const result = getBuyWithCryptoStatusMeta({
|
41
|
-
status: "PENDING",
|
42
|
-
} as BuyWithCryptoStatus);
|
43
|
-
expect(result).toEqual({
|
44
|
-
color: "accentText",
|
45
|
-
loading: true,
|
46
|
-
status: "Pending",
|
47
|
-
});
|
48
|
-
});
|
49
|
-
|
50
|
-
it('returns "Failed" for FAILED status', () => {
|
51
|
-
const result = getBuyWithCryptoStatusMeta({
|
52
|
-
status: "FAILED",
|
53
|
-
} as BuyWithCryptoStatus);
|
54
|
-
expect(result).toEqual({
|
55
|
-
color: "danger",
|
56
|
-
status: "Failed",
|
57
|
-
});
|
58
|
-
});
|
59
|
-
|
60
|
-
it('returns "Completed" for COMPLETED status', () => {
|
61
|
-
const result = getBuyWithCryptoStatusMeta({
|
62
|
-
status: "COMPLETED",
|
63
|
-
} as BuyWithCryptoStatus);
|
64
|
-
expect(result).toEqual({
|
65
|
-
color: "success",
|
66
|
-
status: "Completed",
|
67
|
-
});
|
68
|
-
});
|
69
|
-
|
70
|
-
it('returns "Unknown" for unhandled status', () => {
|
71
|
-
const result = getBuyWithCryptoStatusMeta({
|
72
|
-
// @ts-ignore Test purpose
|
73
|
-
status: "Unknown",
|
74
|
-
});
|
75
|
-
expect(result).toEqual({
|
76
|
-
color: "secondaryText",
|
77
|
-
status: "Unknown",
|
78
|
-
});
|
79
|
-
});
|
80
|
-
});
|
@@ -1,77 +0,0 @@
|
|
1
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
2
|
-
import type { Theme } from "../../../../../../core/design-system/index.js";
|
3
|
-
|
4
|
-
export type StatusMeta = {
|
5
|
-
status: string;
|
6
|
-
color: keyof Theme["colors"];
|
7
|
-
loading?: true;
|
8
|
-
};
|
9
|
-
|
10
|
-
export function getBuyWithCryptoStatusMeta(
|
11
|
-
cryptoStatus: BuyWithCryptoStatus,
|
12
|
-
): StatusMeta {
|
13
|
-
if (cryptoStatus.status === "NOT_FOUND") {
|
14
|
-
return {
|
15
|
-
color: "secondaryText",
|
16
|
-
status: "Unknown",
|
17
|
-
};
|
18
|
-
}
|
19
|
-
|
20
|
-
const subStatus = cryptoStatus.subStatus;
|
21
|
-
const status = cryptoStatus.status;
|
22
|
-
|
23
|
-
if (subStatus === "WAITING_BRIDGE") {
|
24
|
-
return {
|
25
|
-
color: "accentText",
|
26
|
-
loading: true,
|
27
|
-
status: "Bridging",
|
28
|
-
};
|
29
|
-
}
|
30
|
-
|
31
|
-
if (subStatus === "PARTIAL_SUCCESS") {
|
32
|
-
return {
|
33
|
-
color: "secondaryText",
|
34
|
-
status: "Incomplete",
|
35
|
-
};
|
36
|
-
}
|
37
|
-
|
38
|
-
if (status === "PENDING") {
|
39
|
-
return {
|
40
|
-
color: "accentText",
|
41
|
-
loading: true,
|
42
|
-
status: "Pending",
|
43
|
-
};
|
44
|
-
}
|
45
|
-
|
46
|
-
if (status === "FAILED") {
|
47
|
-
return {
|
48
|
-
color: "danger",
|
49
|
-
status: "Failed",
|
50
|
-
};
|
51
|
-
}
|
52
|
-
|
53
|
-
if (status === "COMPLETED") {
|
54
|
-
return {
|
55
|
-
color: "success",
|
56
|
-
status: "Completed",
|
57
|
-
};
|
58
|
-
}
|
59
|
-
|
60
|
-
return {
|
61
|
-
color: "secondaryText",
|
62
|
-
status: "Unknown",
|
63
|
-
};
|
64
|
-
}
|
65
|
-
|
66
|
-
export type FiatStatusMeta = {
|
67
|
-
status: string;
|
68
|
-
color: keyof Theme["colors"];
|
69
|
-
loading?: true;
|
70
|
-
step: 1 | 2;
|
71
|
-
progressStatus:
|
72
|
-
| "pending"
|
73
|
-
| "completed"
|
74
|
-
| "failed"
|
75
|
-
| "actionRequired"
|
76
|
-
| "unknown";
|
77
|
-
};
|
@@ -1,154 +0,0 @@
|
|
1
|
-
import { useRef } from "react";
|
2
|
-
import type { Chain } from "../../../../../../../chains/types.js";
|
3
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
-
import { fontSize } from "../../../../../../core/design-system/index.js";
|
5
|
-
import { Container } from "../../../../components/basic.js";
|
6
|
-
import { Input } from "../../../../components/formElements.js";
|
7
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
8
|
-
import { TokenRow } from "../../../../components/token/TokenRow.js";
|
9
|
-
import { TokenSymbol } from "../../../../components/token/TokenSymbol.js";
|
10
|
-
import type { ERC20OrNativeToken } from "../../nativeToken.js";
|
11
|
-
import { getBuyTokenAmountFontSize } from "../utils.js";
|
12
|
-
import { FiatValue } from "./FiatValue.js";
|
13
|
-
|
14
|
-
/**
|
15
|
-
* @internal
|
16
|
-
*/
|
17
|
-
export function BuyTokenInput(props: {
|
18
|
-
token: ERC20OrNativeToken;
|
19
|
-
chain: Chain;
|
20
|
-
value: string;
|
21
|
-
onChange: (value: string) => void;
|
22
|
-
onSelectToken: () => void;
|
23
|
-
client: ThirdwebClient;
|
24
|
-
hideTokenSelector?: boolean;
|
25
|
-
freezeAmount?: boolean;
|
26
|
-
freezeChainAndToken?: boolean;
|
27
|
-
}) {
|
28
|
-
const getWidth = () => {
|
29
|
-
let chars = props.value.replace(".", "").length;
|
30
|
-
const hasDot = props.value.includes(".");
|
31
|
-
if (hasDot) {
|
32
|
-
chars += 0.3;
|
33
|
-
}
|
34
|
-
return `calc(${`${Math.max(1, chars)}ch`} + 6px)`;
|
35
|
-
};
|
36
|
-
|
37
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
38
|
-
|
39
|
-
return (
|
40
|
-
<Container>
|
41
|
-
{/* Input */}
|
42
|
-
{/** biome-ignore lint/a11y/noStaticElementInteractions: TODO */}
|
43
|
-
{/** biome-ignore lint/a11y/useKeyWithClickEvents: TODO */}
|
44
|
-
<div
|
45
|
-
onClick={() => {
|
46
|
-
inputRef.current?.focus();
|
47
|
-
}}
|
48
|
-
>
|
49
|
-
<Container
|
50
|
-
center="both"
|
51
|
-
flex="row"
|
52
|
-
gap="xs"
|
53
|
-
style={{
|
54
|
-
flexWrap: "nowrap",
|
55
|
-
}}
|
56
|
-
>
|
57
|
-
<Input
|
58
|
-
data-placeholder={props.value === ""}
|
59
|
-
disabled={props.freezeAmount}
|
60
|
-
inputMode="decimal"
|
61
|
-
onChange={(e) => {
|
62
|
-
let value = e.target.value;
|
63
|
-
|
64
|
-
// Replace comma with period if it exists
|
65
|
-
value = value.replace(",", ".");
|
66
|
-
|
67
|
-
if (value.startsWith(".")) {
|
68
|
-
value = `0${value}`;
|
69
|
-
}
|
70
|
-
|
71
|
-
const numValue = Number(value);
|
72
|
-
if (Number.isNaN(numValue)) {
|
73
|
-
return;
|
74
|
-
}
|
75
|
-
|
76
|
-
if (value.startsWith("0") && !value.startsWith("0.")) {
|
77
|
-
props.onChange(value.slice(1));
|
78
|
-
} else {
|
79
|
-
props.onChange(value);
|
80
|
-
}
|
81
|
-
}}
|
82
|
-
onClick={(e) => {
|
83
|
-
// put cursor at the end of the input
|
84
|
-
if (props.value === "") {
|
85
|
-
e.currentTarget.setSelectionRange(
|
86
|
-
e.currentTarget.value.length,
|
87
|
-
e.currentTarget.value.length,
|
88
|
-
);
|
89
|
-
}
|
90
|
-
}}
|
91
|
-
pattern="^[0-9]*[.,]?[0-9]*$"
|
92
|
-
placeholder="0"
|
93
|
-
ref={inputRef}
|
94
|
-
style={{
|
95
|
-
border: "none",
|
96
|
-
borderRadius: "0",
|
97
|
-
boxShadow: "none",
|
98
|
-
fontSize: getBuyTokenAmountFontSize(props.value),
|
99
|
-
fontWeight: 600,
|
100
|
-
maxWidth: "calc(100% - 100px)",
|
101
|
-
padding: "0",
|
102
|
-
paddingBlock: "2px",
|
103
|
-
textAlign: "right",
|
104
|
-
width: getWidth(),
|
105
|
-
}}
|
106
|
-
tabIndex={-1}
|
107
|
-
type="text"
|
108
|
-
value={props.value || "0"}
|
109
|
-
variant="outline"
|
110
|
-
/>
|
111
|
-
<TokenSymbol
|
112
|
-
chain={props.chain}
|
113
|
-
color="secondaryText"
|
114
|
-
size="lg"
|
115
|
-
token={props.token}
|
116
|
-
/>
|
117
|
-
</Container>
|
118
|
-
</div>
|
119
|
-
|
120
|
-
<Container
|
121
|
-
center="both"
|
122
|
-
flex="row"
|
123
|
-
style={{
|
124
|
-
height: fontSize.xl,
|
125
|
-
}}
|
126
|
-
>
|
127
|
-
<FiatValue
|
128
|
-
chain={props.chain}
|
129
|
-
client={props.client}
|
130
|
-
size="md"
|
131
|
-
token={props.token}
|
132
|
-
tokenAmount={props.value}
|
133
|
-
/>
|
134
|
-
</Container>
|
135
|
-
|
136
|
-
{!props.hideTokenSelector && (
|
137
|
-
<>
|
138
|
-
<Spacer y="md" />
|
139
|
-
|
140
|
-
{/* Token / Chain selector */}
|
141
|
-
<Container center="x" flex="row">
|
142
|
-
<TokenRow
|
143
|
-
chain={props.chain}
|
144
|
-
client={props.client}
|
145
|
-
freezeChainAndToken={props.freezeChainAndToken}
|
146
|
-
onSelectToken={props.onSelectToken}
|
147
|
-
token={props.token}
|
148
|
-
/>
|
149
|
-
</Container>
|
150
|
-
</>
|
151
|
-
)}
|
152
|
-
</Container>
|
153
|
-
);
|
154
|
-
}
|
@@ -1,377 +0,0 @@
|
|
1
|
-
import { useMemo, useState } from "react";
|
2
|
-
import { trackPayEvent } from "../../../../../../../analytics/track/pay.js";
|
3
|
-
import type { Chain } from "../../../../../../../chains/types.js";
|
4
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
5
|
-
import { getContract } from "../../../../../../../contract/contract.js";
|
6
|
-
import { approve } from "../../../../../../../extensions/erc20/write/approve.js";
|
7
|
-
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
8
|
-
import { sendBatchTransaction } from "../../../../../../../transaction/actions/send-batch-transaction.js";
|
9
|
-
import { sendTransaction } from "../../../../../../../transaction/actions/send-transaction.js";
|
10
|
-
import {
|
11
|
-
type WaitForReceiptOptions,
|
12
|
-
waitForReceipt,
|
13
|
-
} from "../../../../../../../transaction/actions/wait-for-tx-receipt.js";
|
14
|
-
import { useCustomTheme } from "../../../../../../core/design-system/CustomThemeProvider.js";
|
15
|
-
import { Container, ModalHeader } from "../../../../components/basic.js";
|
16
|
-
import { Button } from "../../../../components/buttons.js";
|
17
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
18
|
-
import { Spinner } from "../../../../components/Spinner.js";
|
19
|
-
import { StepBar } from "../../../../components/StepBar.js";
|
20
|
-
import { SwitchNetworkButton } from "../../../../components/SwitchNetwork.js";
|
21
|
-
import { Text } from "../../../../components/text.js";
|
22
|
-
import { StyledDiv } from "../../../../design-system/elements.js";
|
23
|
-
import type { ERC20OrNativeToken } from "../../nativeToken.js";
|
24
|
-
import { Step } from "../Stepper.js";
|
25
|
-
import type { PayerInfo } from "../types.js";
|
26
|
-
import { ErrorText } from "./ErrorText.js";
|
27
|
-
import { addPendingTx } from "./pendingSwapTx.js";
|
28
|
-
import { SwapSummary } from "./SwapSummary.js";
|
29
|
-
|
30
|
-
/**
|
31
|
-
* @internal
|
32
|
-
*/
|
33
|
-
export function SwapConfirmationScreen(props: {
|
34
|
-
title: string;
|
35
|
-
onBack?: () => void;
|
36
|
-
client: ThirdwebClient;
|
37
|
-
quote: BuyWithCryptoQuote;
|
38
|
-
setSwapTxHash: (txHash: string) => void;
|
39
|
-
onTryAgain: () => void;
|
40
|
-
toChain: Chain;
|
41
|
-
toAmount: string;
|
42
|
-
toTokenSymbol: string;
|
43
|
-
fromChain: Chain;
|
44
|
-
toToken: ERC20OrNativeToken;
|
45
|
-
fromAmount: string;
|
46
|
-
fromToken: ERC20OrNativeToken;
|
47
|
-
fromTokenSymbol: string;
|
48
|
-
isFiatFlow: boolean;
|
49
|
-
payer: PayerInfo;
|
50
|
-
preApprovedAmount?: bigint;
|
51
|
-
}) {
|
52
|
-
const approveTxRequired =
|
53
|
-
props.quote.approvalData &&
|
54
|
-
props.preApprovedAmount !== undefined &&
|
55
|
-
props.preApprovedAmount < BigInt(props.quote.approvalData.amountWei);
|
56
|
-
const needsApprovalStep =
|
57
|
-
approveTxRequired && !props.payer.account.sendBatchTransaction;
|
58
|
-
const initialStep = needsApprovalStep ? "approval" : "swap";
|
59
|
-
|
60
|
-
const [step, setStep] = useState<"approval" | "swap">(initialStep);
|
61
|
-
const [error, setError] = useState<string | undefined>();
|
62
|
-
const [status, setStatus] = useState<
|
63
|
-
"pending" | "success" | "error" | "idle"
|
64
|
-
>("idle");
|
65
|
-
|
66
|
-
const receiver = props.quote.swapDetails.toAddress;
|
67
|
-
const sender = props.quote.swapDetails.fromAddress;
|
68
|
-
|
69
|
-
const uiErrorMessage = useMemo(() => {
|
70
|
-
if (step === "approval" && status === "error" && error) {
|
71
|
-
if (
|
72
|
-
error.toLowerCase().includes("user rejected") ||
|
73
|
-
error.toLowerCase().includes("user closed modal") ||
|
74
|
-
error.toLowerCase().includes("user denied")
|
75
|
-
) {
|
76
|
-
return {
|
77
|
-
message: "Your wallet rejected the approval request.",
|
78
|
-
title: "Failed to Approve",
|
79
|
-
};
|
80
|
-
}
|
81
|
-
if (error.toLowerCase().includes("insufficient funds for gas")) {
|
82
|
-
return {
|
83
|
-
message:
|
84
|
-
"You do not have enough native funds to approve the transaction.",
|
85
|
-
title: "Insufficient Native Funds",
|
86
|
-
};
|
87
|
-
}
|
88
|
-
return {
|
89
|
-
message:
|
90
|
-
"Your wallet failed to approve the transaction for an unknown reason. Please try again or contact support.",
|
91
|
-
title: "Failed to Approve",
|
92
|
-
};
|
93
|
-
}
|
94
|
-
|
95
|
-
if (step === "swap" && status === "error" && error) {
|
96
|
-
if (
|
97
|
-
error.toLowerCase().includes("user rejected") ||
|
98
|
-
error.toLowerCase().includes("user closed modal") ||
|
99
|
-
error.toLowerCase().includes("user denied")
|
100
|
-
) {
|
101
|
-
return {
|
102
|
-
message: "Your wallet rejected the confirmation request.",
|
103
|
-
title: "Failed to Confirm",
|
104
|
-
};
|
105
|
-
}
|
106
|
-
if (error.toLowerCase().includes("insufficient funds for gas")) {
|
107
|
-
return {
|
108
|
-
message:
|
109
|
-
"You do not have enough native funds to confirm the transaction.",
|
110
|
-
title: "Insufficient Native Funds",
|
111
|
-
};
|
112
|
-
}
|
113
|
-
return {
|
114
|
-
message:
|
115
|
-
"Your wallet failed to confirm the transaction for an unknown reason. Please try again or contact support.",
|
116
|
-
title: "Failed to Confirm",
|
117
|
-
};
|
118
|
-
}
|
119
|
-
|
120
|
-
return undefined;
|
121
|
-
}, [error, step, status]);
|
122
|
-
|
123
|
-
return (
|
124
|
-
<Container p="lg">
|
125
|
-
<ModalHeader onBack={props.onBack} title={props.title} />
|
126
|
-
|
127
|
-
{props.isFiatFlow ? (
|
128
|
-
<>
|
129
|
-
<Spacer y="lg" />
|
130
|
-
<StepBar currentStep={2} steps={2} />
|
131
|
-
<Spacer y="sm" />
|
132
|
-
<Text size="xs">
|
133
|
-
Step 2 of 2 - Converting {props.fromTokenSymbol} to{" "}
|
134
|
-
{props.toTokenSymbol}
|
135
|
-
</Text>
|
136
|
-
<Spacer y="md" />
|
137
|
-
</>
|
138
|
-
) : (
|
139
|
-
<>
|
140
|
-
<Spacer y="lg" />
|
141
|
-
<Text size="sm">Confirm payment</Text>
|
142
|
-
<Spacer y="md" />
|
143
|
-
</>
|
144
|
-
)}
|
145
|
-
|
146
|
-
<SwapSummary
|
147
|
-
client={props.client}
|
148
|
-
fromAmount={props.fromAmount}
|
149
|
-
fromChain={props.fromChain}
|
150
|
-
fromToken={props.fromToken}
|
151
|
-
receiver={receiver}
|
152
|
-
sender={sender}
|
153
|
-
toAmount={props.toAmount}
|
154
|
-
toChain={props.toChain}
|
155
|
-
toToken={props.toToken}
|
156
|
-
/>
|
157
|
-
|
158
|
-
<Spacer y="md" />
|
159
|
-
|
160
|
-
{/* Show 2 steps - Approve and confirm */}
|
161
|
-
{needsApprovalStep && (
|
162
|
-
<>
|
163
|
-
<Spacer y="sm" />
|
164
|
-
<Container
|
165
|
-
center="y"
|
166
|
-
color="accentText"
|
167
|
-
flex="row"
|
168
|
-
gap="sm"
|
169
|
-
style={{
|
170
|
-
justifyContent: "space-between",
|
171
|
-
}}
|
172
|
-
>
|
173
|
-
<Step
|
174
|
-
isActive={step === "approval"}
|
175
|
-
isDone={step === "swap"}
|
176
|
-
label={step === "approval" ? "Approve" : "Approved"}
|
177
|
-
/>
|
178
|
-
<ConnectorLine />
|
179
|
-
<Step isActive={step === "swap"} isDone={false} label="Confirm" />
|
180
|
-
</Container>
|
181
|
-
<Spacer y="lg" />
|
182
|
-
</>
|
183
|
-
)}
|
184
|
-
|
185
|
-
{uiErrorMessage && (
|
186
|
-
<>
|
187
|
-
<ErrorText
|
188
|
-
message={uiErrorMessage.message}
|
189
|
-
title={uiErrorMessage.title}
|
190
|
-
/>
|
191
|
-
<Spacer y="md" />
|
192
|
-
</>
|
193
|
-
)}
|
194
|
-
|
195
|
-
{props.payer.chain.id !== props.fromChain.id ? (
|
196
|
-
<>
|
197
|
-
<Spacer y="xs" />
|
198
|
-
<SwitchNetworkButton
|
199
|
-
fullWidth
|
200
|
-
switchChain={async () => {
|
201
|
-
await props.payer.wallet.switchChain(props.fromChain);
|
202
|
-
}}
|
203
|
-
variant="accent"
|
204
|
-
/>
|
205
|
-
</>
|
206
|
-
) : (
|
207
|
-
<>
|
208
|
-
<Spacer y="xs" />
|
209
|
-
<Button
|
210
|
-
disabled={status === "pending"}
|
211
|
-
fullWidth
|
212
|
-
gap="xs"
|
213
|
-
onClick={async () => {
|
214
|
-
const wallet = props.payer.wallet;
|
215
|
-
|
216
|
-
// in case the wallet is not on the same chain as the fromToken, switch to it
|
217
|
-
if (wallet.getChain()?.id !== props.fromChain.id) {
|
218
|
-
await wallet.switchChain(props.fromChain);
|
219
|
-
}
|
220
|
-
|
221
|
-
const account = wallet.getAccount();
|
222
|
-
|
223
|
-
if (!account) {
|
224
|
-
throw new Error("Payer wallet has no account");
|
225
|
-
}
|
226
|
-
|
227
|
-
if (step === "approval" && props.quote.approvalData) {
|
228
|
-
try {
|
229
|
-
setStatus("pending");
|
230
|
-
|
231
|
-
trackPayEvent({
|
232
|
-
amountWei: props.quote.swapDetails.fromAmountWei,
|
233
|
-
chainId: props.quote.swapDetails.fromToken.chainId,
|
234
|
-
client: props.client,
|
235
|
-
event: "prompt_swap_approval",
|
236
|
-
fromToken: props.quote.swapDetails.fromToken.tokenAddress,
|
237
|
-
toChainId: props.quote.swapDetails.toToken.chainId,
|
238
|
-
toToken: props.quote.swapDetails.toToken.tokenAddress,
|
239
|
-
walletAddress: account.address,
|
240
|
-
walletType: wallet.id,
|
241
|
-
});
|
242
|
-
|
243
|
-
const transaction = approve({
|
244
|
-
amountWei: BigInt(props.quote.approvalData.amountWei),
|
245
|
-
contract: getContract({
|
246
|
-
address: props.quote.swapDetails.fromToken.tokenAddress,
|
247
|
-
chain: props.fromChain,
|
248
|
-
client: props.client,
|
249
|
-
}),
|
250
|
-
spender: props.quote.approvalData.spenderAddress,
|
251
|
-
});
|
252
|
-
|
253
|
-
const tx = await sendTransaction({
|
254
|
-
account: account,
|
255
|
-
transaction,
|
256
|
-
});
|
257
|
-
|
258
|
-
await waitForReceipt({ ...tx, maxBlocksWaitTime: 50 });
|
259
|
-
|
260
|
-
trackPayEvent({
|
261
|
-
amountWei: props.quote.swapDetails.fromAmountWei,
|
262
|
-
chainId: props.quote.swapDetails.fromToken.chainId,
|
263
|
-
client: props.client,
|
264
|
-
event: "swap_approval_success",
|
265
|
-
fromToken: props.quote.swapDetails.fromToken.tokenAddress,
|
266
|
-
toChainId: props.quote.swapDetails.toToken.chainId,
|
267
|
-
toToken: props.quote.swapDetails.toToken.tokenAddress,
|
268
|
-
walletAddress: account.address,
|
269
|
-
walletType: wallet.id,
|
270
|
-
});
|
271
|
-
|
272
|
-
setStep("swap");
|
273
|
-
setStatus("idle");
|
274
|
-
} catch (e) {
|
275
|
-
console.error(e);
|
276
|
-
setError((e as Error).message);
|
277
|
-
setStatus("error");
|
278
|
-
}
|
279
|
-
}
|
280
|
-
|
281
|
-
if (step === "swap") {
|
282
|
-
setStatus("pending");
|
283
|
-
try {
|
284
|
-
trackPayEvent({
|
285
|
-
amountWei: props.quote.swapDetails.fromAmountWei,
|
286
|
-
chainId: props.quote.swapDetails.fromToken.chainId,
|
287
|
-
client: props.client,
|
288
|
-
event: "prompt_swap_execution",
|
289
|
-
fromToken: props.quote.swapDetails.fromToken.tokenAddress,
|
290
|
-
toChainId: props.quote.swapDetails.toToken.chainId,
|
291
|
-
toToken: props.quote.swapDetails.toToken.tokenAddress,
|
292
|
-
walletAddress: account.address,
|
293
|
-
walletType: wallet.id,
|
294
|
-
});
|
295
|
-
const tx = props.quote.transactionRequest;
|
296
|
-
let _swapTx: WaitForReceiptOptions;
|
297
|
-
// check if we can batch approval and swap
|
298
|
-
const canBatch = account.sendBatchTransaction;
|
299
|
-
if (
|
300
|
-
canBatch &&
|
301
|
-
props.quote.approvalData &&
|
302
|
-
approveTxRequired
|
303
|
-
) {
|
304
|
-
const approveTx = approve({
|
305
|
-
amountWei: BigInt(props.quote.approvalData.amountWei),
|
306
|
-
contract: getContract({
|
307
|
-
address: props.quote.swapDetails.fromToken.tokenAddress,
|
308
|
-
chain: props.fromChain,
|
309
|
-
client: props.client,
|
310
|
-
}),
|
311
|
-
spender: props.quote.approvalData.spenderAddress,
|
312
|
-
});
|
313
|
-
|
314
|
-
_swapTx = await sendBatchTransaction({
|
315
|
-
account: account,
|
316
|
-
transactions: [approveTx, tx],
|
317
|
-
});
|
318
|
-
} else {
|
319
|
-
_swapTx = await sendTransaction({
|
320
|
-
account: account,
|
321
|
-
transaction: tx,
|
322
|
-
});
|
323
|
-
}
|
324
|
-
|
325
|
-
trackPayEvent({
|
326
|
-
amountWei: props.quote.swapDetails.fromAmountWei,
|
327
|
-
chainId: props.quote.swapDetails.fromToken.chainId,
|
328
|
-
client: props.client,
|
329
|
-
event: "swap_execution_success",
|
330
|
-
fromToken: props.quote.swapDetails.fromToken.tokenAddress,
|
331
|
-
toChainId: props.quote.swapDetails.toToken.chainId,
|
332
|
-
toToken: props.quote.swapDetails.toToken.tokenAddress,
|
333
|
-
walletAddress: account.address,
|
334
|
-
walletType: wallet.id,
|
335
|
-
});
|
336
|
-
|
337
|
-
// do not add pending tx if the swap is part of fiat flow
|
338
|
-
if (!props.isFiatFlow) {
|
339
|
-
addPendingTx({
|
340
|
-
chainId: _swapTx.chain.id,
|
341
|
-
txHash: _swapTx.transactionHash,
|
342
|
-
type: "swap",
|
343
|
-
});
|
344
|
-
}
|
345
|
-
|
346
|
-
props.setSwapTxHash(_swapTx.transactionHash);
|
347
|
-
} catch (e) {
|
348
|
-
console.error(e);
|
349
|
-
setStatus("error");
|
350
|
-
setError((e as Error).message);
|
351
|
-
}
|
352
|
-
}
|
353
|
-
}}
|
354
|
-
variant="accent"
|
355
|
-
>
|
356
|
-
{step === "approval" &&
|
357
|
-
(status === "pending" ? "Approving" : "Approve")}
|
358
|
-
{step === "swap" &&
|
359
|
-
(status === "pending" ? "Confirming" : "Confirm")}
|
360
|
-
{status === "pending" && (
|
361
|
-
<Spinner color="accentButtonText" size="sm" />
|
362
|
-
)}
|
363
|
-
</Button>
|
364
|
-
</>
|
365
|
-
)}
|
366
|
-
</Container>
|
367
|
-
);
|
368
|
-
}
|
369
|
-
|
370
|
-
export const ConnectorLine = /* @__PURE__ */ StyledDiv(() => {
|
371
|
-
const theme = useCustomTheme();
|
372
|
-
return {
|
373
|
-
background: theme.colors.borderColor,
|
374
|
-
flex: 1,
|
375
|
-
height: "4px",
|
376
|
-
};
|
377
|
-
});
|