thirdweb 5.108.6 → 5.108.8
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/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/cjs/react/core/hooks/usePaymentMethods.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/Bridge/BuyWidget.js +185 -99
- package/dist/cjs/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js +210 -56
- package/dist/cjs/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js +233 -105
- package/dist/cjs/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/cjs/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/cjs/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js +199 -36
- package/dist/cjs/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/cjs/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/cjs/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js +52 -0
- package/dist/cjs/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js +36 -0
- package/dist/cjs/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js +58 -0
- package/dist/cjs/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js +20 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js +34 -0
- package/dist/cjs/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/cjs/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- 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.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/cjs/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/cjs/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js +19 -147
- package/dist/cjs/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/cjs/react/web/ui/Bridge/types.js +3 -0
- package/dist/cjs/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/cjs/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js +115 -0
- package/dist/cjs/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/cjs/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js +27 -306
- package/dist/cjs/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js +21 -128
- package/dist/cjs/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/StepRunner.stories.js +13 -39
- package/dist/cjs/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js +13 -101
- package/dist/cjs/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js +49 -0
- package/dist/cjs/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js +53 -0
- package/dist/cjs/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js +11 -79
- package/dist/cjs/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/cjs/stories/Bridge/fixtures.js +21 -62
- package/dist/cjs/stories/Bridge/fixtures.js.map +1 -1
- package/dist/cjs/stories/BuyWidget.stories.js +44 -8
- package/dist/cjs/stories/BuyWidget.stories.js.map +1 -1
- package/dist/cjs/stories/utils.js +5 -2
- package/dist/cjs/stories/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/x402/common.js +3 -5
- package/dist/cjs/x402/common.js.map +1 -1
- package/dist/cjs/x402/facilitator.js +3 -4
- package/dist/cjs/x402/facilitator.js.map +1 -1
- package/dist/cjs/x402/schemas.js +4 -0
- package/dist/cjs/x402/schemas.js.map +1 -1
- package/dist/cjs/x402/settle-payment.js +6 -5
- package/dist/cjs/x402/settle-payment.js.map +1 -1
- package/dist/cjs/x402/sign.js +2 -6
- package/dist/cjs/x402/sign.js.map +1 -1
- package/dist/cjs/x402/types.js.map +1 -1
- package/dist/cjs/x402/verify-payment.js +6 -5
- package/dist/cjs/x402/verify-payment.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/hooks/usePaymentMethods.js +1 -2
- package/dist/esm/react/core/hooks/usePaymentMethods.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/Bridge/BuyWidget.js +185 -99
- package/dist/esm/react/web/ui/Bridge/BuyWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js +211 -57
- package/dist/esm/react/web/ui/Bridge/CheckoutWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js +7 -7
- package/dist/esm/react/web/ui/Bridge/DirectPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/FundWallet.js +237 -109
- package/dist/esm/react/web/ui/Bridge/FundWallet.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js +1 -7
- package/dist/esm/react/web/ui/Bridge/QuoteLoader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js +16 -12
- package/dist/esm/react/web/ui/Bridge/TransactionPayment.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js +198 -36
- package/dist/esm/react/web/ui/Bridge/TransactionWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js +2 -2
- package/dist/esm/react/web/ui/Bridge/bridge-widget/bridge-widget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js +4 -5
- package/dist/esm/react/web/ui/Bridge/common/WithHeader.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js +49 -0
- package/dist/esm/react/web/ui/Bridge/common/active-wallet-details.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js +33 -0
- package/dist/esm/react/web/ui/Bridge/common/decimal-input.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js +55 -0
- package/dist/esm/react/web/ui/Bridge/common/selected-token-button.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js +17 -0
- package/dist/esm/react/web/ui/Bridge/common/token-balance.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js +31 -0
- package/dist/esm/react/web/ui/Bridge/common/token-query.js.map +1 -0
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentDetails.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js +7 -7
- package/dist/esm/react/web/ui/Bridge/payment-details/PaymentOverview.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-selection/PaymentSelection.js +1 -4
- 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.map +1 -1
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js +3 -3
- package/dist/esm/react/web/ui/Bridge/payment-success/SuccessScreen.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js +8 -11
- package/dist/esm/react/web/ui/Bridge/swap-widget/SwapWidget.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js +16 -144
- package/dist/esm/react/web/ui/Bridge/swap-widget/swap-ui.js.map +1 -1
- package/dist/esm/react/web/ui/Bridge/types.js +2 -0
- package/dist/esm/react/web/ui/Bridge/types.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +4 -2
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/formatTokenBalance.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +17 -10
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js +1 -1
- package/dist/esm/react/web/ui/components/CopyIcon.js.map +1 -1
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js +112 -0
- package/dist/esm/stories/Bridge/CheckoutWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js +7 -111
- package/dist/esm/stories/Bridge/ErrorBanner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js +28 -307
- package/dist/esm/stories/Bridge/PaymentDetails.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js +22 -129
- package/dist/esm/stories/Bridge/PaymentSelection.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/StepRunner.stories.js +12 -38
- package/dist/esm/stories/Bridge/StepRunner.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js +14 -102
- package/dist/esm/stories/Bridge/SuccessScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js +46 -0
- package/dist/esm/stories/Bridge/Transaction/TransactionWidget.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js +50 -0
- package/dist/esm/stories/Bridge/Transaction/useSendTransactionModal.stories.js.map +1 -0
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js +12 -80
- package/dist/esm/stories/Bridge/UnsupportedTokenScreen.stories.js.map +1 -1
- package/dist/esm/stories/Bridge/fixtures.js +15 -56
- package/dist/esm/stories/Bridge/fixtures.js.map +1 -1
- package/dist/esm/stories/BuyWidget.stories.js +37 -9
- package/dist/esm/stories/BuyWidget.stories.js.map +1 -1
- package/dist/esm/stories/utils.js +6 -3
- package/dist/esm/stories/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/x402/common.js +3 -5
- package/dist/esm/x402/common.js.map +1 -1
- package/dist/esm/x402/facilitator.js +3 -4
- package/dist/esm/x402/facilitator.js.map +1 -1
- package/dist/esm/x402/schemas.js +5 -1
- package/dist/esm/x402/schemas.js.map +1 -1
- package/dist/esm/x402/settle-payment.js +6 -5
- package/dist/esm/x402/settle-payment.js.map +1 -1
- package/dist/esm/x402/sign.js +2 -6
- package/dist/esm/x402/sign.js.map +1 -1
- package/dist/esm/x402/types.js.map +1 -1
- package/dist/esm/x402/verify-payment.js +6 -5
- package/dist/esm/x402/verify-payment.js.map +1 -1
- package/dist/scripts/bridge-widget.d.ts +3 -3
- package/dist/scripts/bridge-widget.js +113 -150
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +6 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts +1 -2
- package/dist/types/react/core/hooks/usePaymentMethods.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts +7 -12
- package/dist/types/react/web/ui/Bridge/BuyWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts +5 -8
- package/dist/types/react/web/ui/Bridge/CheckoutWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts +15 -12
- package/dist/types/react/web/ui/Bridge/DirectPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts +33 -15
- package/dist/types/react/web/ui/Bridge/FundWallet.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts +9 -12
- package/dist/types/react/web/ui/Bridge/QuoteLoader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts +7 -7
- package/dist/types/react/web/ui/Bridge/StepRunner.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts +14 -7
- package/dist/types/react/web/ui/Bridge/TransactionPayment.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts +3 -5
- package/dist/types/react/web/ui/Bridge/TransactionWidget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts +4 -3
- package/dist/types/react/web/ui/Bridge/UnsupportedTokenScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts +3 -3
- package/dist/types/react/web/ui/Bridge/bridge-widget/bridge-widget.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts +4 -4
- package/dist/types/react/web/ui/Bridge/common/WithHeader.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/active-wallet-details.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts +6 -0
- package/dist/types/react/web/ui/Bridge/common/decimal-input.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts +13 -0
- package/dist/types/react/web/ui/Bridge/common/selected-token-button.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts +8 -0
- package/dist/types/react/web/ui/Bridge/common/token-balance.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts +15 -0
- package/dist/types/react/web/ui/Bridge/common/token-query.d.ts.map +1 -0
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts +13 -11
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentDetails.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts +8 -3
- package/dist/types/react/web/ui/Bridge/payment-details/PaymentOverview.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/PaymentSelection.d.ts +12 -16
- 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 +1 -1
- package/dist/types/react/web/ui/Bridge/payment-selection/TokenSelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts +6 -6
- package/dist/types/react/web/ui/Bridge/payment-success/SuccessScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/swap-widget/swap-ui.d.ts.map +1 -1
- package/dist/types/react/web/ui/Bridge/types.d.ts +39 -0
- package/dist/types/react/web/ui/Bridge/types.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts +2 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/formatTokenBalance.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +0 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +3 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyIcon.d.ts +1 -0
- package/dist/types/react/web/ui/components/CopyIcon.d.ts.map +1 -1
- package/dist/types/script-exports/bridge-widget-script.d.ts +3 -3
- package/dist/types/script-exports/bridge-widget-script.d.ts.map +1 -1
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts +25 -0
- package/dist/types/stories/Bridge/CheckoutWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts +3 -47
- package/dist/types/stories/Bridge/ErrorBanner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts +3 -56
- package/dist/types/stories/Bridge/PaymentDetails.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts +5 -63
- package/dist/types/stories/Bridge/PaymentSelection.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts +4 -52
- package/dist/types/stories/Bridge/StepRunner.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts +4 -54
- package/dist/types/stories/Bridge/SuccessScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts +11 -0
- package/dist/types/stories/Bridge/Transaction/TransactionWidget.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts +18 -0
- package/dist/types/stories/Bridge/Transaction/useSendTransactionModal.stories.d.ts.map +1 -0
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts +3 -34
- package/dist/types/stories/Bridge/UnsupportedTokenScreen.stories.d.ts.map +1 -1
- package/dist/types/stories/Bridge/fixtures.d.ts +19 -17
- package/dist/types/stories/Bridge/fixtures.d.ts.map +1 -1
- package/dist/types/stories/BuyWidget.stories.d.ts +9 -1
- package/dist/types/stories/BuyWidget.stories.d.ts.map +1 -1
- package/dist/types/stories/utils.d.ts +0 -2
- package/dist/types/stories/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/x402/common.d.ts.map +1 -1
- package/dist/types/x402/facilitator.d.ts +4 -5
- package/dist/types/x402/facilitator.d.ts.map +1 -1
- package/dist/types/x402/schemas.d.ts +21 -0
- package/dist/types/x402/schemas.d.ts.map +1 -1
- package/dist/types/x402/settle-payment.d.ts.map +1 -1
- package/dist/types/x402/types.d.ts +5 -4
- package/dist/types/x402/types.d.ts.map +1 -1
- package/dist/types/x402/verify-payment.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/react/core/hooks/transaction/useSendTransaction.ts +6 -0
- package/src/react/core/hooks/usePaymentMethods.ts +1 -4
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/Bridge/BuyWidget.tsx +355 -160
- package/src/react/web/ui/Bridge/CheckoutWidget.tsx +384 -107
- package/src/react/web/ui/Bridge/DirectPayment.tsx +34 -26
- package/src/react/web/ui/Bridge/FundWallet.tsx +610 -266
- package/src/react/web/ui/Bridge/QuoteLoader.tsx +10 -20
- package/src/react/web/ui/Bridge/StepRunner.tsx +7 -7
- package/src/react/web/ui/Bridge/TransactionPayment.tsx +35 -25
- package/src/react/web/ui/Bridge/TransactionWidget.tsx +395 -71
- package/src/react/web/ui/Bridge/UnsupportedTokenScreen.tsx +3 -3
- package/src/react/web/ui/Bridge/bridge-widget/bridge-widget.tsx +16 -14
- package/src/react/web/ui/Bridge/common/WithHeader.tsx +13 -19
- package/src/react/web/ui/Bridge/common/active-wallet-details.tsx +103 -0
- package/src/react/web/ui/Bridge/common/decimal-input.tsx +61 -0
- package/src/react/web/ui/Bridge/common/selected-token-button.tsx +168 -0
- package/src/react/web/ui/Bridge/common/token-balance.tsx +23 -0
- package/src/react/web/ui/Bridge/common/token-query.ts +49 -0
- package/src/react/web/ui/Bridge/payment-details/PaymentDetails.tsx +23 -14
- package/src/react/web/ui/Bridge/payment-details/PaymentOverview.tsx +36 -22
- package/src/react/web/ui/Bridge/payment-selection/PaymentSelection.tsx +11 -22
- package/src/react/web/ui/Bridge/payment-selection/TokenSelection.tsx +1 -1
- package/src/react/web/ui/Bridge/payment-success/SuccessScreen.tsx +7 -8
- package/src/react/web/ui/Bridge/swap-widget/SwapWidget.tsx +14 -12
- package/src/react/web/ui/Bridge/swap-widget/swap-ui.tsx +19 -332
- package/src/react/web/ui/Bridge/types.ts +47 -0
- package/src/react/web/ui/ConnectWallet/Details.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +1 -5
- package/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts +5 -1
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +1 -2
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +44 -27
- package/src/react/web/ui/components/CopyIcon.tsx +11 -2
- package/src/script-exports/bridge-widget-script.tsx +3 -3
- package/src/script-exports/readme.md +1 -8
- package/src/stories/Bridge/CheckoutWidget.stories.tsx +147 -0
- package/src/stories/Bridge/ErrorBanner.stories.tsx +13 -138
- package/src/stories/Bridge/PaymentDetails.stories.tsx +34 -349
- package/src/stories/Bridge/PaymentSelection.stories.tsx +28 -156
- package/src/stories/Bridge/StepRunner.stories.tsx +18 -65
- package/src/stories/Bridge/SuccessScreen.stories.tsx +21 -130
- package/src/stories/Bridge/Transaction/TransactionWidget.stories.tsx +63 -0
- package/src/stories/Bridge/Transaction/useSendTransactionModal.stories.tsx +68 -0
- package/src/stories/Bridge/UnsupportedTokenScreen.stories.tsx +19 -108
- package/src/stories/Bridge/fixtures.ts +36 -63
- package/src/stories/BuyWidget.stories.tsx +103 -8
- package/src/stories/utils.tsx +16 -9
- package/src/version.ts +1 -1
- package/src/x402/common.ts +2 -5
- package/src/x402/facilitator.ts +8 -8
- package/src/x402/schemas.ts +10 -0
- package/src/x402/settle-payment.ts +7 -6
- package/src/x402/sign.ts +3 -8
- package/src/x402/types.ts +5 -4
- package/src/x402/verify-payment.ts +7 -6
- package/dist/cjs/react/core/machines/paymentMachine.js +0 -191
- package/dist/cjs/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js +0 -129
- package/dist/cjs/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js +0 -258
- package/dist/cjs/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js +0 -222
- package/dist/cjs/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/FundWallet.stories.js +0 -201
- package/dist/cjs/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js +0 -168
- package/dist/cjs/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/esm/react/core/machines/paymentMachine.js +0 -188
- package/dist/esm/react/core/machines/paymentMachine.js.map +0 -1
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js +0 -126
- package/dist/esm/react/web/ui/Bridge/BridgeOrchestrator.js.map +0 -1
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js +0 -255
- package/dist/esm/stories/Bridge/BridgeOrchestrator.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/DirectPayment.stories.js +0 -219
- package/dist/esm/stories/Bridge/DirectPayment.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/FundWallet.stories.js +0 -198
- package/dist/esm/stories/Bridge/FundWallet.stories.js.map +0 -1
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js +0 -165
- package/dist/esm/stories/Bridge/TransactionPayment.stories.js.map +0 -1
- package/dist/types/react/core/machines/paymentMachine.d.ts +0 -89
- package/dist/types/react/core/machines/paymentMachine.d.ts.map +0 -1
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts +0 -99
- package/dist/types/react/web/ui/Bridge/BridgeOrchestrator.d.ts.map +0 -1
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts +0 -97
- package/dist/types/stories/Bridge/BridgeOrchestrator.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts +0 -69
- package/dist/types/stories/Bridge/DirectPayment.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts +0 -67
- package/dist/types/stories/Bridge/FundWallet.stories.d.ts.map +0 -1
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts +0 -60
- package/dist/types/stories/Bridge/TransactionPayment.stories.d.ts.map +0 -1
- package/src/react/core/machines/paymentMachine.test.ts +0 -519
- package/src/react/core/machines/paymentMachine.ts +0 -295
- package/src/react/web/ui/Bridge/BridgeOrchestrator.tsx +0 -425
- package/src/stories/Bridge/BridgeOrchestrator.stories.tsx +0 -298
- package/src/stories/Bridge/DirectPayment.stories.tsx +0 -256
- package/src/stories/Bridge/FundWallet.stories.tsx +0 -227
- package/src/stories/Bridge/TransactionPayment.stories.tsx +0 -202
|
@@ -12,12 +12,11 @@ import {
|
|
|
12
12
|
type UseBridgePrepareParams,
|
|
13
13
|
useBridgePrepare,
|
|
14
14
|
} from "../../../core/hooks/useBridgePrepare.js";
|
|
15
|
-
import type { PaymentMethod } from "../../../core/machines/paymentMachine.js";
|
|
16
15
|
import { Container } from "../components/basic.js";
|
|
17
16
|
import { Spacer } from "../components/Spacer.js";
|
|
18
17
|
import { Spinner } from "../components/Spinner.js";
|
|
19
18
|
import { Text } from "../components/text.js";
|
|
20
|
-
import type {
|
|
19
|
+
import type { PaymentMethod } from "./types.js";
|
|
21
20
|
|
|
22
21
|
interface QuoteLoaderProps {
|
|
23
22
|
/**
|
|
@@ -38,10 +37,10 @@ interface QuoteLoaderProps {
|
|
|
38
37
|
/**
|
|
39
38
|
* The sender address
|
|
40
39
|
*/
|
|
41
|
-
sender
|
|
40
|
+
sender: string | undefined;
|
|
42
41
|
|
|
43
42
|
/**
|
|
44
|
-
* The receiver address
|
|
43
|
+
* The receiver address
|
|
45
44
|
*/
|
|
46
45
|
receiver: string;
|
|
47
46
|
|
|
@@ -62,30 +61,26 @@ interface QuoteLoaderProps {
|
|
|
62
61
|
* Called when an error occurs
|
|
63
62
|
*/
|
|
64
63
|
onError: (error: Error) => void;
|
|
65
|
-
|
|
66
64
|
/**
|
|
67
65
|
* Called when user wants to go back
|
|
68
66
|
*/
|
|
69
|
-
onBack
|
|
67
|
+
onBack: (() => void) | undefined;
|
|
70
68
|
|
|
71
69
|
/**
|
|
72
70
|
* Optional purchase data for the payment
|
|
73
71
|
*/
|
|
74
|
-
purchaseData
|
|
72
|
+
purchaseData: PurchaseData | undefined;
|
|
75
73
|
|
|
76
74
|
/**
|
|
77
75
|
* Optional payment link ID for the payment
|
|
78
76
|
*/
|
|
79
|
-
paymentLinkId
|
|
77
|
+
paymentLinkId: string | undefined;
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
*/
|
|
84
|
-
uiOptions: UIOptions;
|
|
79
|
+
feePayer: "sender" | "receiver" | undefined;
|
|
80
|
+
mode: "direct_payment" | "fund_wallet" | "transaction";
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
export function QuoteLoader({
|
|
88
|
-
uiOptions,
|
|
89
84
|
destinationToken,
|
|
90
85
|
paymentMethod,
|
|
91
86
|
amount,
|
|
@@ -96,14 +91,9 @@ export function QuoteLoader({
|
|
|
96
91
|
onError,
|
|
97
92
|
purchaseData,
|
|
98
93
|
paymentLinkId,
|
|
94
|
+
feePayer,
|
|
95
|
+
mode,
|
|
99
96
|
}: QuoteLoaderProps) {
|
|
100
|
-
// For now, we'll use a simple buy operation
|
|
101
|
-
// This will be expanded to handle different bridge types based on the payment method
|
|
102
|
-
const feePayer =
|
|
103
|
-
uiOptions.mode === "direct_payment"
|
|
104
|
-
? uiOptions.paymentInfo.feePayer
|
|
105
|
-
: undefined;
|
|
106
|
-
const mode = uiOptions.mode;
|
|
107
97
|
const request: BridgePrepareRequest = getBridgeParams({
|
|
108
98
|
amount,
|
|
109
99
|
client,
|
|
@@ -27,14 +27,14 @@ import { Spacer } from "../components/Spacer.js";
|
|
|
27
27
|
import { Spinner } from "../components/Spinner.js";
|
|
28
28
|
import { Text } from "../components/text.js";
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
title
|
|
30
|
+
type StepRunnerProps = {
|
|
31
|
+
title: string | undefined;
|
|
32
32
|
request: BridgePrepareRequest;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Wallet instance for executing transactions
|
|
36
36
|
*/
|
|
37
|
-
wallet
|
|
37
|
+
wallet: Wallet | undefined;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Thirdweb client for API calls
|
|
@@ -49,7 +49,7 @@ interface StepRunnerProps {
|
|
|
49
49
|
/**
|
|
50
50
|
* Whether to automatically start the transaction process
|
|
51
51
|
*/
|
|
52
|
-
autoStart
|
|
52
|
+
autoStart: boolean;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Called when all steps are completed - receives array of completed status results
|
|
@@ -59,18 +59,18 @@ interface StepRunnerProps {
|
|
|
59
59
|
/**
|
|
60
60
|
* Called when user cancels the flow
|
|
61
61
|
*/
|
|
62
|
-
onCancel
|
|
62
|
+
onCancel: (() => void) | undefined;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Called when user clicks the back button
|
|
66
66
|
*/
|
|
67
|
-
onBack
|
|
67
|
+
onBack: () => void;
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Prepared quote to use
|
|
71
71
|
*/
|
|
72
72
|
preparedQuote: BridgePrepareResult;
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
|
|
75
75
|
export function StepRunner({
|
|
76
76
|
title,
|
|
@@ -3,6 +3,8 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
3
3
|
import type { TokenWithPrices } from "../../../../bridge/types/Token.js";
|
|
4
4
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
|
5
5
|
import { NATIVE_TOKEN_ADDRESS } from "../../../../constants/addresses.js";
|
|
6
|
+
import type { SupportedFiatCurrency } from "../../../../pay/convert/type.js";
|
|
7
|
+
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
|
6
8
|
import {
|
|
7
9
|
type Address,
|
|
8
10
|
getAddress,
|
|
@@ -28,15 +30,21 @@ import { ChainName } from "../components/ChainName.js";
|
|
|
28
30
|
import { Spacer } from "../components/Spacer.js";
|
|
29
31
|
import { Text } from "../components/text.js";
|
|
30
32
|
import type { PayEmbedConnectOptions } from "../PayEmbed.js";
|
|
31
|
-
import type { UIOptions } from "./BridgeOrchestrator.js";
|
|
32
33
|
import { ChainIcon } from "./common/TokenAndChain.js";
|
|
33
34
|
import { WithHeader } from "./common/WithHeader.js";
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
type TransactionPaymentProps = {
|
|
36
37
|
/**
|
|
37
38
|
* UI configuration and mode
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
|
+
transaction: PreparedTransaction;
|
|
41
|
+
currency: SupportedFiatCurrency;
|
|
42
|
+
buttonLabel: string | undefined;
|
|
43
|
+
metadata: {
|
|
44
|
+
title: string | undefined;
|
|
45
|
+
description: string | undefined;
|
|
46
|
+
image: string | undefined;
|
|
47
|
+
};
|
|
40
48
|
|
|
41
49
|
/**
|
|
42
50
|
* ThirdwebClient for blockchain interactions
|
|
@@ -67,29 +75,32 @@ export interface TransactionPaymentProps {
|
|
|
67
75
|
* @default true
|
|
68
76
|
*/
|
|
69
77
|
showThirdwebBranding?: boolean;
|
|
70
|
-
}
|
|
78
|
+
};
|
|
71
79
|
|
|
72
80
|
export function TransactionPayment({
|
|
73
|
-
|
|
81
|
+
transaction,
|
|
74
82
|
client,
|
|
75
83
|
onContinue,
|
|
76
84
|
onExecuteTransaction,
|
|
77
85
|
connectOptions,
|
|
86
|
+
currency,
|
|
78
87
|
showThirdwebBranding = true,
|
|
88
|
+
buttonLabel: _buttonLabel,
|
|
89
|
+
metadata,
|
|
79
90
|
}: TransactionPaymentProps) {
|
|
80
91
|
const theme = useCustomTheme();
|
|
81
92
|
const activeAccount = useActiveAccount();
|
|
82
93
|
const wallet = useActiveWallet();
|
|
83
94
|
|
|
84
95
|
// Get chain metadata for native currency symbol
|
|
85
|
-
const chainMetadata = useChainMetadata(
|
|
96
|
+
const chainMetadata = useChainMetadata(transaction.chain);
|
|
86
97
|
|
|
87
98
|
// Use the extracted hook for transaction details
|
|
88
99
|
const transactionDataQuery = useTransactionDetails({
|
|
89
100
|
client,
|
|
90
|
-
transaction:
|
|
101
|
+
transaction: transaction,
|
|
91
102
|
wallet,
|
|
92
|
-
currency:
|
|
103
|
+
currency: currency,
|
|
93
104
|
});
|
|
94
105
|
|
|
95
106
|
// We can't use useWalletBalance here because erc20Value is a possibly async value
|
|
@@ -99,12 +110,10 @@ export function TransactionPayment({
|
|
|
99
110
|
if (!activeAccount?.address) {
|
|
100
111
|
return "0";
|
|
101
112
|
}
|
|
102
|
-
const erc20Value = await resolvePromisedValue(
|
|
103
|
-
uiOptions.transaction.erc20Value,
|
|
104
|
-
);
|
|
113
|
+
const erc20Value = await resolvePromisedValue(transaction.erc20Value);
|
|
105
114
|
const walletBalance = await getWalletBalance({
|
|
106
115
|
address: activeAccount?.address,
|
|
107
|
-
chain:
|
|
116
|
+
chain: transaction.chain,
|
|
108
117
|
tokenAddress:
|
|
109
118
|
erc20Value?.tokenAddress.toLowerCase() !== NATIVE_TOKEN_ADDRESS
|
|
110
119
|
? erc20Value?.tokenAddress
|
|
@@ -123,14 +132,15 @@ export function TransactionPayment({
|
|
|
123
132
|
transactionDataQuery.data?.functionInfo?.functionName || "Contract Call";
|
|
124
133
|
const isLoading = transactionDataQuery.isLoading || chainMetadata.isLoading;
|
|
125
134
|
|
|
126
|
-
const buttonLabel =
|
|
135
|
+
const buttonLabel = _buttonLabel || `Execute ${functionName}`;
|
|
127
136
|
|
|
128
137
|
if (isLoading) {
|
|
129
138
|
return (
|
|
130
139
|
<WithHeader
|
|
131
140
|
client={client}
|
|
132
|
-
|
|
133
|
-
|
|
141
|
+
title={metadata.title || "Transaction"}
|
|
142
|
+
description={metadata.description}
|
|
143
|
+
image={metadata.image}
|
|
134
144
|
>
|
|
135
145
|
{/* Loading Header */}
|
|
136
146
|
<SkeletonHeader theme={theme} />
|
|
@@ -182,8 +192,9 @@ export function TransactionPayment({
|
|
|
182
192
|
return (
|
|
183
193
|
<WithHeader
|
|
184
194
|
client={client}
|
|
185
|
-
|
|
186
|
-
|
|
195
|
+
title={metadata.title || "Transaction"}
|
|
196
|
+
description={metadata.description}
|
|
197
|
+
image={metadata.image}
|
|
187
198
|
>
|
|
188
199
|
{/* Cost and Function Name section */}
|
|
189
200
|
<Container
|
|
@@ -258,7 +269,7 @@ export function TransactionPayment({
|
|
|
258
269
|
Address
|
|
259
270
|
</Text>
|
|
260
271
|
<a
|
|
261
|
-
href={`https://thirdweb.com/${
|
|
272
|
+
href={`https://thirdweb.com/${transaction.chain.id}/${transaction.to}`}
|
|
262
273
|
rel="noopener noreferrer"
|
|
263
274
|
style={{
|
|
264
275
|
color: theme.colors.accentText,
|
|
@@ -268,7 +279,7 @@ export function TransactionPayment({
|
|
|
268
279
|
}}
|
|
269
280
|
target="_blank"
|
|
270
281
|
>
|
|
271
|
-
{shortenAddress(
|
|
282
|
+
{shortenAddress(transaction.to as string)}
|
|
272
283
|
</a>
|
|
273
284
|
</Container>
|
|
274
285
|
|
|
@@ -286,13 +297,9 @@ export function TransactionPayment({
|
|
|
286
297
|
Network
|
|
287
298
|
</Text>
|
|
288
299
|
<Container center="y" flex="row" gap="3xs">
|
|
289
|
-
<ChainIcon
|
|
290
|
-
chain={uiOptions.transaction.chain}
|
|
291
|
-
client={client}
|
|
292
|
-
size="xs"
|
|
293
|
-
/>
|
|
300
|
+
<ChainIcon chain={transaction.chain} client={client} size="xs" />
|
|
294
301
|
<ChainName
|
|
295
|
-
chain={
|
|
302
|
+
chain={transaction.chain}
|
|
296
303
|
client={client}
|
|
297
304
|
color="primaryText"
|
|
298
305
|
short
|
|
@@ -405,6 +412,9 @@ export function TransactionPayment({
|
|
|
405
412
|
transactionDataQuery.data.tokenInfo,
|
|
406
413
|
getAddress(activeAccount.address),
|
|
407
414
|
);
|
|
415
|
+
} else {
|
|
416
|
+
// if token not supported, can't go into buy flow, so skip to execute transaction
|
|
417
|
+
onExecuteTransaction();
|
|
408
418
|
}
|
|
409
419
|
}}
|
|
410
420
|
style={{
|