thirdweb 5.99.3 → 5.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bridge/Buy.js +17 -13
- package/dist/cjs/bridge/Buy.js.map +1 -1
- package/dist/cjs/bridge/Chains.js +2 -2
- package/dist/cjs/bridge/Chains.js.map +1 -1
- package/dist/cjs/bridge/Onramp.js +152 -0
- package/dist/cjs/bridge/Onramp.js.map +1 -0
- package/dist/cjs/bridge/OnrampStatus.js +78 -0
- package/dist/cjs/bridge/OnrampStatus.js.map +1 -0
- package/dist/cjs/bridge/Routes.js +2 -2
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Sell.js +18 -14
- package/dist/cjs/bridge/Sell.js.map +1 -1
- package/dist/cjs/bridge/Status.js +15 -2
- package/dist/cjs/bridge/Status.js.map +1 -1
- package/dist/cjs/bridge/Transfer.js +229 -0
- package/dist/cjs/bridge/Transfer.js.map +1 -0
- package/dist/cjs/bridge/index.js +3 -1
- package/dist/cjs/bridge/index.js.map +1 -1
- package/dist/cjs/bridge/types/BridgeAction.js +3 -0
- package/dist/cjs/bridge/types/BridgeAction.js.map +1 -0
- package/dist/cjs/bridge/types/Token.js +3 -0
- package/dist/cjs/bridge/types/Token.js.map +1 -0
- package/dist/cjs/extensions/ens/resolve-l2-name.js +0 -2
- package/dist/cjs/extensions/ens/resolve-l2-name.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +159 -53
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +129 -33
- package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getStatus.js +71 -20
- package/dist/cjs/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -1
- package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
- package/dist/cjs/pay/utils/definitions.js +1 -43
- package/dist/cjs/pay/utils/definitions.js.map +1 -1
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +44 -38
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +15 -0
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -23
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -177
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -60
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +83 -34
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +133 -0
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +9 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/utils/any-evm/zksync/constants.js +1 -0
- package/dist/cjs/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/cjs/utils/domains.js +3 -0
- package/dist/cjs/utils/domains.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Buy.js +17 -13
- package/dist/esm/bridge/Buy.js.map +1 -1
- package/dist/esm/bridge/Chains.js +2 -2
- package/dist/esm/bridge/Chains.js.map +1 -1
- package/dist/esm/bridge/Onramp.js +147 -0
- package/dist/esm/bridge/Onramp.js.map +1 -0
- package/dist/esm/bridge/OnrampStatus.js +75 -0
- package/dist/esm/bridge/OnrampStatus.js.map +1 -0
- package/dist/esm/bridge/Routes.js +2 -2
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Sell.js +18 -14
- package/dist/esm/bridge/Sell.js.map +1 -1
- package/dist/esm/bridge/Status.js +15 -2
- package/dist/esm/bridge/Status.js.map +1 -1
- package/dist/esm/bridge/Transfer.js +226 -0
- package/dist/esm/bridge/Transfer.js.map +1 -0
- package/dist/esm/bridge/index.js +2 -0
- package/dist/esm/bridge/index.js.map +1 -1
- package/dist/esm/bridge/types/BridgeAction.js +2 -0
- package/dist/esm/bridge/types/BridgeAction.js.map +1 -0
- package/dist/esm/bridge/types/Token.js +2 -0
- package/dist/esm/bridge/types/Token.js.map +1 -0
- package/dist/esm/extensions/ens/resolve-l2-name.js +0 -2
- package/dist/esm/extensions/ens/resolve-l2-name.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js +159 -53
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +129 -33
- package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getStatus.js +71 -20
- package/dist/esm/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +1 -1
- package/dist/esm/pay/utils/commonTypes.js.map +1 -1
- package/dist/esm/pay/utils/definitions.js +0 -35
- package/dist/esm/pay/utils/definitions.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +44 -38
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +15 -0
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -23
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +4 -180
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +2 -16
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -59
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +84 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +130 -0
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +9 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/utils/any-evm/zksync/constants.js +1 -0
- package/dist/esm/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/esm/utils/domains.js +3 -0
- package/dist/esm/utils/domains.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/bridge/Buy.d.ts +11 -9
- package/dist/types/bridge/Buy.d.ts.map +1 -1
- package/dist/types/bridge/Onramp.d.ts +123 -0
- package/dist/types/bridge/Onramp.d.ts.map +1 -0
- package/dist/types/bridge/OnrampStatus.d.ts +108 -0
- package/dist/types/bridge/OnrampStatus.d.ts.map +1 -0
- package/dist/types/bridge/Sell.d.ts +13 -11
- package/dist/types/bridge/Sell.d.ts.map +1 -1
- package/dist/types/bridge/Status.d.ts.map +1 -1
- package/dist/types/bridge/Transfer.d.ts +199 -0
- package/dist/types/bridge/Transfer.d.ts.map +1 -0
- package/dist/types/bridge/index.d.ts +7 -3
- package/dist/types/bridge/index.d.ts.map +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts +2 -0
- package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -0
- package/dist/types/bridge/types/Quote.d.ts +3 -65
- package/dist/types/bridge/types/Quote.d.ts.map +1 -1
- package/dist/types/bridge/types/Route.d.ts +38 -17
- package/dist/types/bridge/types/Route.d.ts.map +1 -1
- package/dist/types/bridge/types/Status.d.ts +15 -0
- package/dist/types/bridge/types/Status.d.ts.map +1 -1
- package/dist/types/bridge/types/Token.d.ts +11 -0
- package/dist/types/bridge/types/Token.d.ts.map +1 -0
- package/dist/types/extensions/ens/resolve-l2-name.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts +0 -9
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getStatus.d.ts +1 -12
- package/dist/types/pay/buyWithFiat/getStatus.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
- package/dist/types/pay/utils/definitions.d.ts +0 -35
- package/dist/types/pay/utils/definitions.d.ts.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +1 -30
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +2 -0
- 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/main/useBuyTxStates.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +1 -3
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.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/Buy/swap/pendingSwapTx.d.ts +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +8 -4
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +15 -0
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/utils/any-evm/zksync/constants.d.ts.map +1 -1
- package/dist/types/utils/domains.d.ts +6 -0
- package/dist/types/utils/domains.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 +15 -15
- package/src/bridge/Buy.ts +19 -13
- package/src/bridge/Chains.ts +2 -2
- package/src/bridge/Onramp.test.ts +118 -0
- package/src/bridge/Onramp.ts +244 -0
- package/src/bridge/OnrampStatus.ts +133 -0
- package/src/bridge/Routes.ts +2 -2
- package/src/bridge/Sell.ts +20 -14
- package/src/bridge/Status.ts +15 -2
- package/src/bridge/Transfer.test.ts +76 -0
- package/src/bridge/Transfer.ts +270 -0
- package/src/bridge/index.ts +12 -3
- package/src/bridge/types/BridgeAction.ts +1 -0
- package/src/bridge/types/Quote.ts +3 -65
- package/src/bridge/types/Route.ts +42 -17
- package/src/bridge/types/Status.ts +15 -1
- package/src/bridge/types/Token.ts +11 -0
- package/src/extensions/ens/resolve-l2-name.ts +0 -2
- package/src/pay/buyWithCrypto/commonTypes.ts +0 -10
- package/src/pay/buyWithCrypto/getQuote.ts +210 -100
- package/src/pay/buyWithCrypto/getStatus.ts +213 -20
- package/src/pay/buyWithCrypto/getTransfer.ts +129 -61
- package/src/pay/buyWithFiat/getQuote.ts +184 -33
- package/src/pay/buyWithFiat/getStatus.ts +101 -42
- package/src/pay/convert/cryptoToFiat.test.ts +7 -5
- package/src/pay/convert/fiatToCrypto.test.ts +6 -4
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/pay/utils/definitions.ts +0 -48
- package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +0 -2
- package/src/react/core/hooks/transaction/useSendTransaction.ts +53 -52
- package/src/react/core/utils/wallet.ts +15 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +5 -64
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +3 -510
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +2 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +2 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +19 -20
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -37
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +1 -95
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -69
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +1 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +118 -63
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +295 -0
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +4 -5
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +20 -1
- package/src/utils/any-evm/zksync/constants.ts +1 -0
- package/src/utils/domain.test.ts +1 -0
- package/src/utils/domains.ts +8 -0
- package/src/version.ts +1 -1
- package/dist/cjs/bridge/constants.js +0 -5
- package/dist/cjs/bridge/constants.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -37
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -86
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -25
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -54
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -52
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -81
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -17
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -138
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/esm/bridge/constants.js +0 -2
- package/dist/esm/bridge/constants.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -83
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -22
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -51
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -48
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -78
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -14
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -135
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/types/bridge/constants.d.ts +0 -2
- package/dist/types/bridge/constants.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +0 -23
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts +0 -9
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts +0 -21
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts.map +0 -1
- package/src/bridge/constants.ts +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +0 -142
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +0 -170
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +0 -63
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +0 -163
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +0 -127
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx +0 -138
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx +0 -45
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts +0 -191
@@ -1,142 +0,0 @@
|
|
1
|
-
import { ExternalLinkIcon } from "@radix-ui/react-icons";
|
2
|
-
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
3
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
-
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
|
-
import { formatExplorerTxUrl } from "../../../../../../../utils/url.js";
|
6
|
-
import {
|
7
|
-
fontSize,
|
8
|
-
iconSize,
|
9
|
-
} from "../../../../../../core/design-system/index.js";
|
10
|
-
import { useChainExplorers } from "../../../../../../core/hooks/others/useChainQuery.js";
|
11
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
12
|
-
import { Container, Line } from "../../../../components/basic.js";
|
13
|
-
import { ButtonLink } from "../../../../components/buttons.js";
|
14
|
-
import { Text } from "../../../../components/text.js";
|
15
|
-
import { TokenInfoRow } from "../pay-transactions/TokenInfoRow.js";
|
16
|
-
import type { FiatStatusMeta } from "../pay-transactions/statusMeta.js";
|
17
|
-
import { getCurrencyMeta, getFiatIcon } from "./currencies.js";
|
18
|
-
|
19
|
-
/**
|
20
|
-
* Show a table with the details of a "OnRamp" transaction step in the "Buy with Fiat" flow.
|
21
|
-
* - Show OnRamp token as "Receive"
|
22
|
-
* - Show fiat amount as "Pay"
|
23
|
-
*/
|
24
|
-
export function OnRampTxDetailsTable(props: {
|
25
|
-
client: ThirdwebClient;
|
26
|
-
token: {
|
27
|
-
chainId: number;
|
28
|
-
address: string;
|
29
|
-
symbol: string;
|
30
|
-
amount: string;
|
31
|
-
};
|
32
|
-
fiat: {
|
33
|
-
currencySymbol: string;
|
34
|
-
amount: string;
|
35
|
-
};
|
36
|
-
statusMeta?: {
|
37
|
-
color: FiatStatusMeta["color"];
|
38
|
-
text: FiatStatusMeta["status"];
|
39
|
-
txHash?: string;
|
40
|
-
};
|
41
|
-
}) {
|
42
|
-
const onRampExplorers = useChainExplorers(
|
43
|
-
getCachedChain(props.token.chainId),
|
44
|
-
);
|
45
|
-
const onrampTxHash = props.statusMeta?.txHash;
|
46
|
-
const currencyMeta = getCurrencyMeta(props.fiat.currencySymbol);
|
47
|
-
|
48
|
-
const lineSpacer = (
|
49
|
-
<>
|
50
|
-
<Spacer y="md" />
|
51
|
-
<Line />
|
52
|
-
<Spacer y="md" />
|
53
|
-
</>
|
54
|
-
);
|
55
|
-
|
56
|
-
return (
|
57
|
-
<div>
|
58
|
-
{/* Pay */}
|
59
|
-
<Container
|
60
|
-
flex="row"
|
61
|
-
style={{
|
62
|
-
justifyContent: "space-between",
|
63
|
-
}}
|
64
|
-
>
|
65
|
-
<Text size="sm">Pay</Text>
|
66
|
-
<Container
|
67
|
-
flex="column"
|
68
|
-
gap="xxs"
|
69
|
-
style={{
|
70
|
-
alignItems: "flex-end",
|
71
|
-
}}
|
72
|
-
>
|
73
|
-
<Container flex="row" gap="xs" center="y">
|
74
|
-
{getFiatIcon(currencyMeta, "sm")}
|
75
|
-
<Text color="primaryText">
|
76
|
-
{formatNumber(Number(props.fiat.amount), 2)}{" "}
|
77
|
-
{props.fiat.currencySymbol}
|
78
|
-
</Text>
|
79
|
-
</Container>
|
80
|
-
</Container>
|
81
|
-
</Container>
|
82
|
-
|
83
|
-
{lineSpacer}
|
84
|
-
|
85
|
-
{/* Receive */}
|
86
|
-
<TokenInfoRow
|
87
|
-
chainId={props.token.chainId}
|
88
|
-
client={props.client}
|
89
|
-
label="Receive"
|
90
|
-
tokenAmount={props.token.amount}
|
91
|
-
tokenSymbol={props.token.symbol}
|
92
|
-
tokenAddress={props.token.address}
|
93
|
-
/>
|
94
|
-
|
95
|
-
{/* Status */}
|
96
|
-
{props.statusMeta && (
|
97
|
-
<>
|
98
|
-
{lineSpacer}
|
99
|
-
<Container
|
100
|
-
flex="row"
|
101
|
-
center="y"
|
102
|
-
style={{
|
103
|
-
justifyContent: "space-between",
|
104
|
-
}}
|
105
|
-
>
|
106
|
-
<Text>Status</Text>
|
107
|
-
<Container flex="row" gap="xs" center="y">
|
108
|
-
<Text color={props.statusMeta.color}>
|
109
|
-
{props.statusMeta.text}
|
110
|
-
</Text>
|
111
|
-
</Container>
|
112
|
-
</Container>
|
113
|
-
</>
|
114
|
-
)}
|
115
|
-
|
116
|
-
{lineSpacer}
|
117
|
-
|
118
|
-
{/* Transaction Hash link */}
|
119
|
-
{onrampTxHash && onRampExplorers.explorers?.[0]?.url && (
|
120
|
-
<>
|
121
|
-
<Spacer y="md" />
|
122
|
-
<ButtonLink
|
123
|
-
fullWidth
|
124
|
-
variant="outline"
|
125
|
-
href={formatExplorerTxUrl(
|
126
|
-
onRampExplorers.explorers[0]?.url,
|
127
|
-
onrampTxHash,
|
128
|
-
)}
|
129
|
-
target="_blank"
|
130
|
-
gap="xs"
|
131
|
-
style={{
|
132
|
-
fontSize: fontSize.sm,
|
133
|
-
}}
|
134
|
-
>
|
135
|
-
View on Explorer
|
136
|
-
<ExternalLinkIcon width={iconSize.sm} height={iconSize.sm} />
|
137
|
-
</ButtonLink>
|
138
|
-
</>
|
139
|
-
)}
|
140
|
-
</div>
|
141
|
-
);
|
142
|
-
}
|
@@ -1,170 +0,0 @@
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
2
|
-
import { useEffect, useState } from "react";
|
3
|
-
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
4
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
5
|
-
import { getContract } from "../../../../../../../contract/contract.js";
|
6
|
-
import { allowance } from "../../../../../../../extensions/erc20/__generated__/IERC20/read/allowance.js";
|
7
|
-
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
8
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
9
|
-
import { getPostOnRampQuote } from "../../../../../../../pay/buyWithFiat/getPostOnRampQuote.js";
|
10
|
-
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
11
|
-
import { iconSize } from "../../../../../../core/design-system/index.js";
|
12
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
13
|
-
import { Spinner } from "../../../../components/Spinner.js";
|
14
|
-
import { Container, ModalHeader } from "../../../../components/basic.js";
|
15
|
-
import { Button } from "../../../../components/buttons.js";
|
16
|
-
import { Text } from "../../../../components/text.js";
|
17
|
-
import { AccentFailIcon } from "../../../icons/AccentFailIcon.js";
|
18
|
-
import { SwapFlow } from "../swap/SwapFlow.js";
|
19
|
-
import type { PayerInfo } from "../types.js";
|
20
|
-
|
21
|
-
export function PostOnRampSwap(props: {
|
22
|
-
title: string;
|
23
|
-
client: ThirdwebClient;
|
24
|
-
buyWithFiatStatus: BuyWithFiatStatus;
|
25
|
-
onBack?: () => void;
|
26
|
-
onDone: () => void;
|
27
|
-
transactionMode: boolean;
|
28
|
-
isEmbed: boolean;
|
29
|
-
payer: PayerInfo;
|
30
|
-
onSuccess: ((status: BuyWithCryptoStatus) => void) | undefined;
|
31
|
-
}) {
|
32
|
-
const [lockedOnRampQuote, setLockedOnRampQuote] = useState<
|
33
|
-
BuyWithCryptoQuote | undefined
|
34
|
-
>(undefined);
|
35
|
-
|
36
|
-
const postOnRampQuoteQuery = useQuery({
|
37
|
-
queryKey: ["getPostOnRampQuote", props.buyWithFiatStatus],
|
38
|
-
queryFn: async () => {
|
39
|
-
return await getPostOnRampQuote({
|
40
|
-
client: props.client,
|
41
|
-
buyWithFiatStatus: props.buyWithFiatStatus,
|
42
|
-
});
|
43
|
-
},
|
44
|
-
// stop fetching if a quote is already locked
|
45
|
-
enabled: !lockedOnRampQuote,
|
46
|
-
refetchOnWindowFocus: false,
|
47
|
-
});
|
48
|
-
|
49
|
-
const allowanceQuery = useQuery({
|
50
|
-
queryKey: [
|
51
|
-
"allowance",
|
52
|
-
props.payer.account.address,
|
53
|
-
postOnRampQuoteQuery.data?.approvalData,
|
54
|
-
],
|
55
|
-
queryFn: () => {
|
56
|
-
if (!postOnRampQuoteQuery.data?.approvalData) {
|
57
|
-
return null;
|
58
|
-
}
|
59
|
-
return allowance({
|
60
|
-
contract: getContract({
|
61
|
-
client: props.client,
|
62
|
-
address: postOnRampQuoteQuery.data.swapDetails.fromToken.tokenAddress,
|
63
|
-
chain: getCachedChain(
|
64
|
-
postOnRampQuoteQuery.data.swapDetails.fromToken.chainId,
|
65
|
-
),
|
66
|
-
}),
|
67
|
-
spender: postOnRampQuoteQuery.data.approvalData.spenderAddress,
|
68
|
-
owner: props.payer.account.address,
|
69
|
-
});
|
70
|
-
},
|
71
|
-
enabled: !!postOnRampQuoteQuery.data?.approvalData,
|
72
|
-
refetchOnMount: true,
|
73
|
-
});
|
74
|
-
|
75
|
-
useEffect(() => {
|
76
|
-
if (
|
77
|
-
postOnRampQuoteQuery.data &&
|
78
|
-
!lockedOnRampQuote &&
|
79
|
-
!postOnRampQuoteQuery.isRefetching &&
|
80
|
-
!allowanceQuery.isLoading
|
81
|
-
) {
|
82
|
-
setLockedOnRampQuote(postOnRampQuoteQuery.data);
|
83
|
-
}
|
84
|
-
}, [
|
85
|
-
postOnRampQuoteQuery.data,
|
86
|
-
lockedOnRampQuote,
|
87
|
-
postOnRampQuoteQuery.isRefetching,
|
88
|
-
allowanceQuery.isLoading,
|
89
|
-
]);
|
90
|
-
|
91
|
-
if (postOnRampQuoteQuery.isError) {
|
92
|
-
return (
|
93
|
-
<Container fullHeight>
|
94
|
-
<Container p="lg">
|
95
|
-
<ModalHeader title={props.title} onBack={props.onBack} />
|
96
|
-
</Container>
|
97
|
-
|
98
|
-
<Container
|
99
|
-
style={{
|
100
|
-
minHeight: "300px",
|
101
|
-
}}
|
102
|
-
flex="column"
|
103
|
-
center="both"
|
104
|
-
p="lg"
|
105
|
-
>
|
106
|
-
<AccentFailIcon size={iconSize["3xl"]} />
|
107
|
-
<Spacer y="xl" />
|
108
|
-
<Text color="primaryText">Failed to get a price quote</Text>
|
109
|
-
<Spacer y="lg" />
|
110
|
-
|
111
|
-
<Button
|
112
|
-
fullWidth
|
113
|
-
variant="primary"
|
114
|
-
onClick={() => {
|
115
|
-
postOnRampQuoteQuery.refetch();
|
116
|
-
}}
|
117
|
-
>
|
118
|
-
Try Again
|
119
|
-
</Button>
|
120
|
-
</Container>
|
121
|
-
|
122
|
-
<Spacer y="xxl" />
|
123
|
-
</Container>
|
124
|
-
);
|
125
|
-
}
|
126
|
-
|
127
|
-
if (!lockedOnRampQuote) {
|
128
|
-
return (
|
129
|
-
<Container fullHeight>
|
130
|
-
<Container p="lg">
|
131
|
-
<ModalHeader title={props.title} onBack={props.onBack} />
|
132
|
-
</Container>
|
133
|
-
|
134
|
-
<Container
|
135
|
-
style={{
|
136
|
-
minHeight: "300px",
|
137
|
-
}}
|
138
|
-
flex="column"
|
139
|
-
center="both"
|
140
|
-
>
|
141
|
-
<Spinner size="xxl" color="accentText" />
|
142
|
-
<Spacer y="xl" />
|
143
|
-
<Text color="primaryText">Getting price quote</Text>
|
144
|
-
</Container>
|
145
|
-
|
146
|
-
<Spacer y="xxl" />
|
147
|
-
</Container>
|
148
|
-
);
|
149
|
-
}
|
150
|
-
|
151
|
-
return (
|
152
|
-
<SwapFlow
|
153
|
-
title={props.title}
|
154
|
-
payer={props.payer}
|
155
|
-
buyWithCryptoQuote={lockedOnRampQuote}
|
156
|
-
client={props.client}
|
157
|
-
onBack={props.onBack}
|
158
|
-
isFiatFlow={true}
|
159
|
-
onDone={props.onDone}
|
160
|
-
onTryAgain={() => {
|
161
|
-
setLockedOnRampQuote(undefined);
|
162
|
-
postOnRampQuoteQuery.refetch();
|
163
|
-
}}
|
164
|
-
transactionMode={props.transactionMode}
|
165
|
-
isEmbed={props.isEmbed}
|
166
|
-
onSuccess={props.onSuccess}
|
167
|
-
approvalAmount={allowanceQuery.data ?? undefined}
|
168
|
-
/>
|
169
|
-
);
|
170
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { useState } from "react";
|
2
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
3
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
4
|
-
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
5
|
-
import type { PayerInfo } from "../types.js";
|
6
|
-
import { type BuyWithFiatPartialQuote, FiatSteps } from "./FiatSteps.js";
|
7
|
-
import { PostOnRampSwap } from "./PostOnRampSwap.js";
|
8
|
-
|
9
|
-
// Note: It is necessary to lock in the fiat-status in state and only pass that to <PostOnRampSwap /> so it does not suddenly change during the swap process.
|
10
|
-
|
11
|
-
/**
|
12
|
-
* - Show 2 steps UI with step 2 highlighted, on continue button click:
|
13
|
-
* - Show swap flow
|
14
|
-
*/
|
15
|
-
export function PostOnRampSwapFlow(props: {
|
16
|
-
title: string;
|
17
|
-
status: BuyWithFiatStatus;
|
18
|
-
quote: BuyWithFiatPartialQuote;
|
19
|
-
client: ThirdwebClient;
|
20
|
-
onBack: () => void;
|
21
|
-
onDone: () => void;
|
22
|
-
onSwapFlowStarted: () => void;
|
23
|
-
transactionMode: boolean;
|
24
|
-
isEmbed: boolean;
|
25
|
-
payer: PayerInfo;
|
26
|
-
onSuccess: ((status: BuyWithCryptoStatus) => void) | undefined;
|
27
|
-
}) {
|
28
|
-
const [statusForSwap, setStatusForSwap] = useState<
|
29
|
-
BuyWithFiatStatus | undefined
|
30
|
-
>();
|
31
|
-
|
32
|
-
// step 2 flow
|
33
|
-
if (statusForSwap) {
|
34
|
-
return (
|
35
|
-
<PostOnRampSwap
|
36
|
-
title={props.title}
|
37
|
-
buyWithFiatStatus={statusForSwap}
|
38
|
-
client={props.client}
|
39
|
-
onDone={props.onDone}
|
40
|
-
transactionMode={props.transactionMode}
|
41
|
-
isEmbed={props.isEmbed}
|
42
|
-
payer={props.payer}
|
43
|
-
onSuccess={props.onSuccess}
|
44
|
-
/>
|
45
|
-
);
|
46
|
-
}
|
47
|
-
|
48
|
-
// show step 1 and step 2 details
|
49
|
-
return (
|
50
|
-
<FiatSteps
|
51
|
-
title={props.title}
|
52
|
-
client={props.client}
|
53
|
-
onBack={props.onBack}
|
54
|
-
partialQuote={props.quote}
|
55
|
-
step={2}
|
56
|
-
onContinue={() => {
|
57
|
-
props.onSwapFlowStarted();
|
58
|
-
setStatusForSwap(props.status);
|
59
|
-
}}
|
60
|
-
status={props.status}
|
61
|
-
/>
|
62
|
-
);
|
63
|
-
}
|
@@ -1,163 +0,0 @@
|
|
1
|
-
"use client";
|
2
|
-
import { ArrowRightIcon, CrossCircledIcon } from "@radix-ui/react-icons";
|
3
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
-
import {
|
5
|
-
fontSize,
|
6
|
-
iconSize,
|
7
|
-
spacing,
|
8
|
-
} from "../../../../../../core/design-system/index.js";
|
9
|
-
import { Skeleton } from "../../../../components/Skeleton.js";
|
10
|
-
import { Spinner } from "../../../../components/Spinner.js";
|
11
|
-
import { Container } from "../../../../components/basic.js";
|
12
|
-
import { Button } from "../../../../components/buttons.js";
|
13
|
-
import { Text } from "../../../../components/text.js";
|
14
|
-
import {
|
15
|
-
BuyTxHistoryButton,
|
16
|
-
BuyTxHistoryButtonHeight,
|
17
|
-
} from "./BuyTxHistoryButton.js";
|
18
|
-
import {
|
19
|
-
type TxStatusInfo,
|
20
|
-
useBuyTransactionsToShow,
|
21
|
-
} from "./useBuyTransactionsToShow.js";
|
22
|
-
|
23
|
-
/**
|
24
|
-
* @internal
|
25
|
-
*/
|
26
|
-
export function PayTxHistoryList(props: {
|
27
|
-
client: ThirdwebClient;
|
28
|
-
onSelectTx: (tx: TxStatusInfo) => void;
|
29
|
-
}) {
|
30
|
-
const {
|
31
|
-
pageIndex,
|
32
|
-
setPageIndex,
|
33
|
-
txInfosToShow,
|
34
|
-
hidePagination,
|
35
|
-
isLoading,
|
36
|
-
pagination,
|
37
|
-
} = useBuyTransactionsToShow(props.client);
|
38
|
-
|
39
|
-
const noTransactions = txInfosToShow.length === 0;
|
40
|
-
|
41
|
-
return (
|
42
|
-
<Container
|
43
|
-
scrollY
|
44
|
-
flex="column"
|
45
|
-
fullHeight
|
46
|
-
style={{
|
47
|
-
width: "100%",
|
48
|
-
minHeight: "250px",
|
49
|
-
maxHeight: "370px",
|
50
|
-
paddingBottom: spacing.lg,
|
51
|
-
}}
|
52
|
-
>
|
53
|
-
<Container flex="column" gap="xs" expand>
|
54
|
-
{noTransactions && !isLoading && (
|
55
|
-
<Container
|
56
|
-
flex="column"
|
57
|
-
gap="md"
|
58
|
-
center="both"
|
59
|
-
color="secondaryText"
|
60
|
-
style={{
|
61
|
-
minHeight: "250px",
|
62
|
-
}}
|
63
|
-
>
|
64
|
-
<CrossCircledIcon width={iconSize.xl} height={iconSize.xl} />
|
65
|
-
<Text>No Transactions</Text>
|
66
|
-
</Container>
|
67
|
-
)}
|
68
|
-
|
69
|
-
{noTransactions && isLoading && (
|
70
|
-
<Container
|
71
|
-
flex="row"
|
72
|
-
center="both"
|
73
|
-
style={{
|
74
|
-
minHeight: "250px",
|
75
|
-
}}
|
76
|
-
>
|
77
|
-
<Spinner size="xl" color="accentText" />
|
78
|
-
</Container>
|
79
|
-
)}
|
80
|
-
|
81
|
-
{txInfosToShow.length > 0 && (
|
82
|
-
<Container animate="fadein" flex="column" gap="xs">
|
83
|
-
{txInfosToShow.map((txInfo) => {
|
84
|
-
return (
|
85
|
-
<BuyTxHistoryButton
|
86
|
-
key={
|
87
|
-
txInfo.type === "swap"
|
88
|
-
? txInfo.status.source?.transactionHash
|
89
|
-
: txInfo.status.intentId
|
90
|
-
}
|
91
|
-
txInfo={txInfo}
|
92
|
-
client={props.client}
|
93
|
-
onClick={() => {
|
94
|
-
props.onSelectTx(txInfo);
|
95
|
-
}}
|
96
|
-
/>
|
97
|
-
);
|
98
|
-
})}
|
99
|
-
</Container>
|
100
|
-
)}
|
101
|
-
|
102
|
-
{isLoading && txInfosToShow.length > 0 && (
|
103
|
-
<>
|
104
|
-
<Skeleton width="100%" height={BuyTxHistoryButtonHeight} />
|
105
|
-
<Skeleton width="100%" height={BuyTxHistoryButtonHeight} />
|
106
|
-
<Skeleton width="100%" height={BuyTxHistoryButtonHeight} />
|
107
|
-
</>
|
108
|
-
)}
|
109
|
-
</Container>
|
110
|
-
|
111
|
-
{pagination && !hidePagination && (
|
112
|
-
<Container py="md">
|
113
|
-
<div
|
114
|
-
style={{
|
115
|
-
display: "grid",
|
116
|
-
gridTemplateColumns: "1fr 1fr",
|
117
|
-
gap: spacing.sm,
|
118
|
-
}}
|
119
|
-
>
|
120
|
-
<Button
|
121
|
-
variant="outline"
|
122
|
-
gap="xs"
|
123
|
-
disabled={pageIndex === 0}
|
124
|
-
data-disabled={pageIndex === 0}
|
125
|
-
style={{
|
126
|
-
fontSize: fontSize.sm,
|
127
|
-
paddingBlock: spacing.sm,
|
128
|
-
}}
|
129
|
-
onClick={() => {
|
130
|
-
setPageIndex((prev) => prev - 1);
|
131
|
-
}}
|
132
|
-
>
|
133
|
-
<ArrowRightIcon
|
134
|
-
width={iconSize.sm}
|
135
|
-
height={iconSize.sm}
|
136
|
-
style={{
|
137
|
-
transform: "rotate(180deg)",
|
138
|
-
}}
|
139
|
-
/>
|
140
|
-
Prev
|
141
|
-
</Button>
|
142
|
-
<Button
|
143
|
-
variant="outline"
|
144
|
-
gap="xs"
|
145
|
-
disabled={!pagination.hasNextPage}
|
146
|
-
data-disabled={!pagination.hasNextPage}
|
147
|
-
style={{
|
148
|
-
fontSize: fontSize.sm,
|
149
|
-
paddingBlock: spacing.sm,
|
150
|
-
}}
|
151
|
-
onClick={() => {
|
152
|
-
setPageIndex((prev) => prev + 1);
|
153
|
-
}}
|
154
|
-
>
|
155
|
-
Next
|
156
|
-
<ArrowRightIcon width={iconSize.sm} height={iconSize.sm} />
|
157
|
-
</Button>
|
158
|
-
</div>
|
159
|
-
</Container>
|
160
|
-
)}
|
161
|
-
</Container>
|
162
|
-
);
|
163
|
-
}
|
@@ -1,127 +0,0 @@
|
|
1
|
-
import styled from "@emotion/styled";
|
2
|
-
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
3
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
-
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
|
-
import { useCustomTheme } from "../../../../../../core/design-system/CustomThemeProvider.js";
|
6
|
-
import { spacing } from "../../../../../../core/design-system/index.js";
|
7
|
-
import { ChainName } from "../../../../components/ChainName.js";
|
8
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
9
|
-
import { Container } from "../../../../components/basic.js";
|
10
|
-
import { Button } from "../../../../components/buttons.js";
|
11
|
-
import { Text } from "../../../../components/text.js";
|
12
|
-
import { PayTokenIcon } from "../PayTokenIcon.js";
|
13
|
-
import {
|
14
|
-
getBuyWithCryptoStatusMeta,
|
15
|
-
getBuyWithFiatStatusMeta,
|
16
|
-
} from "./statusMeta.js";
|
17
|
-
import type { TxStatusInfo } from "./useBuyTransactionsToShow.js";
|
18
|
-
|
19
|
-
export const BuyTxHistoryButtonHeight = "62px";
|
20
|
-
|
21
|
-
export function BuyTxHistoryButton(props: {
|
22
|
-
txInfo: TxStatusInfo;
|
23
|
-
client: ThirdwebClient;
|
24
|
-
onClick?: () => void;
|
25
|
-
}) {
|
26
|
-
const statusMeta =
|
27
|
-
props.txInfo.type === "swap"
|
28
|
-
? getBuyWithCryptoStatusMeta(props.txInfo.status)
|
29
|
-
: getBuyWithFiatStatusMeta(props.txInfo.status);
|
30
|
-
|
31
|
-
return (
|
32
|
-
<TxButton
|
33
|
-
onClick={props.onClick}
|
34
|
-
variant="secondary"
|
35
|
-
fullWidth
|
36
|
-
style={{
|
37
|
-
paddingBlock: spacing.sm,
|
38
|
-
}}
|
39
|
-
>
|
40
|
-
<Container
|
41
|
-
flex="row"
|
42
|
-
center="y"
|
43
|
-
gap="sm"
|
44
|
-
style={{
|
45
|
-
flex: 1,
|
46
|
-
}}
|
47
|
-
>
|
48
|
-
<PayTokenIcon
|
49
|
-
client={props.client}
|
50
|
-
chain={getCachedChain(props.txInfo.status.quote.toToken.chainId)}
|
51
|
-
size="md"
|
52
|
-
token={{
|
53
|
-
address: props.txInfo.status.quote.toToken.tokenAddress,
|
54
|
-
}}
|
55
|
-
/>
|
56
|
-
|
57
|
-
<div
|
58
|
-
style={{
|
59
|
-
flex: 1,
|
60
|
-
display: "flex",
|
61
|
-
flexDirection: "column",
|
62
|
-
justifyContent: "center",
|
63
|
-
}}
|
64
|
-
>
|
65
|
-
{/* Row 1 */}
|
66
|
-
<Container
|
67
|
-
flex="row"
|
68
|
-
gap="xs"
|
69
|
-
center="y"
|
70
|
-
style={{
|
71
|
-
justifyContent: "space-between",
|
72
|
-
}}
|
73
|
-
>
|
74
|
-
<Text size="sm" color="primaryText">
|
75
|
-
Buy{" "}
|
76
|
-
{formatNumber(
|
77
|
-
Number(
|
78
|
-
props.txInfo.type === "swap"
|
79
|
-
? props.txInfo.status.quote.toAmount
|
80
|
-
: props.txInfo.status.quote.estimatedToTokenAmount,
|
81
|
-
),
|
82
|
-
6,
|
83
|
-
)}{" "}
|
84
|
-
{props.txInfo.status.quote.toToken.symbol}
|
85
|
-
</Text>
|
86
|
-
</Container>
|
87
|
-
|
88
|
-
<Spacer y="xxs" />
|
89
|
-
|
90
|
-
{/* Row 2 */}
|
91
|
-
<Container
|
92
|
-
flex="row"
|
93
|
-
center="y"
|
94
|
-
gap="xxs"
|
95
|
-
style={{
|
96
|
-
justifyContent: "space-between",
|
97
|
-
}}
|
98
|
-
>
|
99
|
-
<ChainName
|
100
|
-
chain={getCachedChain(props.txInfo.status.quote.toToken.chainId)}
|
101
|
-
size="xs"
|
102
|
-
client={props.client}
|
103
|
-
/>
|
104
|
-
</Container>
|
105
|
-
</div>
|
106
|
-
</Container>
|
107
|
-
|
108
|
-
{/* Status */}
|
109
|
-
<Container flex="row" gap="xxs" center="y">
|
110
|
-
<Text size="xs" color={statusMeta.color}>
|
111
|
-
{statusMeta.status}
|
112
|
-
</Text>
|
113
|
-
</Container>
|
114
|
-
</TxButton>
|
115
|
-
);
|
116
|
-
}
|
117
|
-
|
118
|
-
const TxButton = /* @__PURE__ */ styled(Button)(() => {
|
119
|
-
const theme = useCustomTheme();
|
120
|
-
return {
|
121
|
-
background: theme.colors.tertiaryBg,
|
122
|
-
"&:hover": {
|
123
|
-
background: theme.colors.secondaryButtonBg,
|
124
|
-
},
|
125
|
-
height: BuyTxHistoryButtonHeight,
|
126
|
-
};
|
127
|
-
});
|