thirdweb 5.100.2-nightly-5ab59ff400cc32caa414354855fa07831ed90f3a-20250523000413 → 5.101.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/Webhook.js +105 -0
- package/dist/cjs/bridge/Webhook.js.map +1 -0
- package/dist/cjs/bridge/index.js +4 -1
- package/dist/cjs/bridge/index.js.map +1 -1
- package/dist/cjs/engine/get-status.js +1 -0
- package/dist/cjs/engine/get-status.js.map +1 -1
- package/dist/cjs/engine/server-wallet.js +4 -1
- package/dist/cjs/engine/server-wallet.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +27 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +17 -16
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +6 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +9 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js +10 -8
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/InputSelectionUI.js +6 -2
- package/dist/cjs/react/web/wallets/in-app/InputSelectionUI.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -1
- package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/cjs/utils/bytecode/resolveImplementation.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Webhook.js +102 -0
- package/dist/esm/bridge/Webhook.js.map +1 -0
- package/dist/esm/bridge/index.js +2 -0
- package/dist/esm/bridge/index.js.map +1 -1
- package/dist/esm/engine/get-status.js +1 -0
- package/dist/esm/engine/get-status.js.map +1 -1
- package/dist/esm/engine/server-wallet.js +4 -1
- package/dist/esm/engine/server-wallet.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js +23 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +17 -16
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js +6 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js +10 -8
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/InputSelectionUI.js +6 -2
- package/dist/esm/react/web/wallets/in-app/InputSelectionUI.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -1
- package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
- package/dist/esm/utils/bytecode/resolveImplementation.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/bridge/Webhook.d.ts +82 -0
- package/dist/types/bridge/Webhook.d.ts.map +1 -0
- package/dist/types/bridge/index.d.ts +4 -1
- package/dist/types/bridge/index.d.ts.map +1 -1
- package/dist/types/engine/get-status.d.ts.map +1 -1
- package/dist/types/engine/server-wallet.d.ts.map +1 -1
- package/dist/types/react/core/account/provider.d.ts +1 -1
- package/dist/types/react/core/account/provider.d.ts.map +1 -1
- package/dist/types/react/core/design-system/CustomThemeProvider.d.ts +1 -1
- package/dist/types/react/core/design-system/CustomThemeProvider.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +1 -0
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/providers/thirdweb-provider.d.ts +1 -1
- package/dist/types/react/core/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/core/wallet/provider.d.ts +1 -1
- package/dist/types/react/core/wallet/provider.d.ts.map +1 -1
- package/dist/types/react/native/providers/thirdweb-provider.d.ts +1 -1
- package/dist/types/react/native/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts +1 -1
- package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/Address.d.ts +1 -1
- package/dist/types/react/native/ui/components/Address.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/ChainIcon.d.ts +1 -1
- package/dist/types/react/native/ui/components/ChainIcon.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/Header.d.ts +1 -1
- package/dist/types/react/native/ui/components/Header.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/RNImage.d.ts +1 -1
- package/dist/types/react/native/ui/components/RNImage.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/TokenIcon.d.ts +1 -1
- package/dist/types/react/native/ui/components/TokenIcon.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts +1 -1
- package/dist/types/react/native/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/button.d.ts +2 -2
- package/dist/types/react/native/ui/components/button.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/input.d.ts +2 -2
- package/dist/types/react/native/ui/components/input.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/spacer.d.ts +1 -1
- package/dist/types/react/native/ui/components/spacer.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/text.d.ts +1 -1
- package/dist/types/react/native/ui/components/text.d.ts.map +1 -1
- package/dist/types/react/native/ui/components/view.d.ts +1 -1
- package/dist/types/react/native/ui/components/view.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectButton.d.ts +1 -1
- package/dist/types/react/native/ui/connect/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts +2 -2
- package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectedButton.d.ts +1 -1
- package/dist/types/react/native/ui/connect/ConnectedButton.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ConnectedModal.d.ts +1 -1
- package/dist/types/react/native/ui/connect/ConnectedModal.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ErrorView.d.ts +1 -1
- package/dist/types/react/native/ui/connect/ErrorView.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts +2 -2
- package/dist/types/react/native/ui/connect/ExternalWalletsList.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts +3 -3
- package/dist/types/react/native/ui/connect/InAppWalletUI.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/LoadingView.d.ts +1 -1
- package/dist/types/react/native/ui/connect/LoadingView.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts +1 -1
- package/dist/types/react/native/ui/connect/ReceiveScreen.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/SendScreen.d.ts +1 -1
- package/dist/types/react/native/ui/connect/SendScreen.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/SuccessView.d.ts +1 -1
- package/dist/types/react/native/ui/connect/SuccessView.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/TokenListScreen.d.ts +2 -2
- package/dist/types/react/native/ui/connect/TokenListScreen.d.ts.map +1 -1
- package/dist/types/react/native/ui/connect/WalletLoadingThumbnail.d.ts +1 -1
- package/dist/types/react/native/ui/connect/WalletLoadingThumbnail.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/address.d.ts +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/address.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/avatar.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/balance.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts +2 -2
- package/dist/types/react/native/ui/prebuilt/Account/blobbie.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/name.d.ts +1 -1
- package/dist/types/react/native/ui/prebuilt/Account/name.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts +2 -2
- package/dist/types/react/native/ui/prebuilt/Wallet/icon.d.ts.map +1 -1
- package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts +1 -1
- package/dist/types/react/native/ui/prebuilt/Wallet/name.d.ts.map +1 -1
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts +1 -1
- package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -1
- package/dist/types/react/web/providers/thirdweb-provider.d.ts +1 -1
- package/dist/types/react/web/providers/thirdweb-provider.d.ts.map +1 -1
- package/dist/types/react/web/providers/wallet-ui-states-provider.d.ts +1 -1
- package/dist/types/react/web/providers/wallet-ui-states-provider.d.ts.map +1 -1
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts +1 -1
- package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts +5 -5
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AllWalletsUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/AnyWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalSkeleton.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectModalSkeleton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/DeepLinkConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/InjectedConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/SmartWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Modal/TOS.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/NetworkSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/PoweredByTW.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/PoweredByTW.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletEntryButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/WalletTypeRowButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/DirectPaymentModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/EstimatedTimeAndFees.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/LazyBuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts +12 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayTokenIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/Stepper.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/TransactionModeScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +1 -1
- 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/fiat/OnRampScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts +3 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +1 -1
- 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/TokenInfoRow.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TokenInfoRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/BuyTokenInput.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/ErrorText.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/Fees.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/PayWithCrypto.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapStatusScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts +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/utils.d.ts +6 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/utils.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkProfileScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ManageWalletScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ManageWalletScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/PrivateKey.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/PrivateKey.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ReceiveFunds.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ReceiveFunds.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/SendFunds.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/StartScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/TokenSelector.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewAssets.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewNFTs.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts +2 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/ViewTokens.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectDisconnectScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletConnectReceiverScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletLogoSpinner.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.d.ts +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/WalletTransactionHistory.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/SiteEmbed.d.ts +1 -1
- package/dist/types/react/web/ui/SiteEmbed.d.ts.map +1 -1
- package/dist/types/react/web/ui/SiteLink.d.ts +1 -1
- package/dist/types/react/web/ui/SiteLink.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts +1 -1
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -1
- package/dist/types/react/web/ui/TransactionButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/OTPInput.d.ts +1 -1
- package/dist/types/react/web/ui/components/OTPInput.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/QRCode.d.ts +1 -1
- package/dist/types/react/web/ui/components/QRCode.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/StepBar.d.ts +1 -1
- package/dist/types/react/web/ui/components/StepBar.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts +1 -1
- package/dist/types/react/web/ui/components/SwitchNetwork.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/Tabs.d.ts +1 -1
- package/dist/types/react/web/ui/components/Tabs.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/TextDivider.d.ts +1 -1
- package/dist/types/react/web/ui/components/TextDivider.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/TokenIcon.d.ts +1 -1
- package/dist/types/react/web/ui/components/TokenIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts +1 -1
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/basic.d.ts +2 -2
- package/dist/types/react/web/ui/components/basic.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts +1 -1
- package/dist/types/react/web/ui/components/token/TokenRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/token/TokenSymbol.d.ts +1 -1
- package/dist/types/react/web/ui/components/token/TokenSymbol.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/address.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/address.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/name.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Account/name.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/icon.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/icon.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/name.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/name.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/provider.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Chain/provider.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/name.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/name.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts +2 -2
- package/dist/types/react/web/ui/prebuilt/Wallet/icon.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/Wallet/name.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts.map +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts +1 -1
- package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletFormUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts +1 -1
- package/dist/types/react/web/wallets/ecosystem/EcosystemWalletHeader.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts +3 -2
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletConnectUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletFormUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/InAppWalletSelectionUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts +2 -1
- package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts +1 -1
- package/dist/types/react/web/wallets/in-app/WalletAuth.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/CoinbaseSDKConnection.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/ErrorState.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/GuestLogin.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/GuestLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/LoadingScreen.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/LoadingScreen.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/LoadingState.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/OTPLoginUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/PassKeyLogin.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/SocialLogin.d.ts.map +1 -1
- package/dist/types/transaction/actions/to-serializable-transaction.d.ts +2 -2
- package/dist/types/utils/abi/decodeFunctionData.d.ts +1 -1
- package/dist/types/utils/abi/decodeFunctionData.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +1 -1
- package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
- package/dist/types/utils/bytecode/resolveImplementation.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/ecosystem/types.d.ts +4 -0
- package/dist/types/wallets/ecosystem/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/types.d.ts +4 -0
- package/dist/types/wallets/in-app/core/wallet/types.d.ts.map +1 -1
- package/dist/types/wallets/in-app/native/helpers/storage/local.d.ts +1 -1
- package/package.json +6 -5
- package/src/bridge/Webhook.test.ts +589 -0
- package/src/bridge/Webhook.ts +139 -0
- package/src/bridge/index.ts +4 -1
- package/src/engine/get-status.ts +1 -0
- package/src/engine/server-wallet.test.ts +16 -16
- package/src/engine/server-wallet.ts +4 -1
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +68 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +27 -36
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +2 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +30 -33
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +9 -0
- package/src/react/web/wallets/in-app/CountrySelector.tsx +14 -7
- package/src/react/web/wallets/in-app/InputSelectionUI.test.tsx +23 -0
- package/src/react/web/wallets/in-app/InputSelectionUI.tsx +7 -1
- package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +3 -0
- package/src/utils/bytecode/resolveImplementation.ts +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/ecosystem/types.ts +5 -0
- package/src/wallets/in-app/core/wallet/types.ts +5 -0
@@ -0,0 +1,139 @@
|
|
1
|
+
import { z } from "zod/v4-mini";
|
2
|
+
import { isAddress } from "../utils/address.js";
|
3
|
+
import { isHex } from "../utils/encoding/hex.js";
|
4
|
+
|
5
|
+
const hexSchema = z
|
6
|
+
.string()
|
7
|
+
.check(z.refine(isHex, { message: "Invalid hex string" }));
|
8
|
+
const addressSchema = z
|
9
|
+
.string()
|
10
|
+
.check(z.refine(isAddress, { message: "Invalid address" }));
|
11
|
+
|
12
|
+
const webhookSchema = z.union([
|
13
|
+
z.object({
|
14
|
+
version: z.literal(1),
|
15
|
+
data: z.object({}),
|
16
|
+
}),
|
17
|
+
z.object({
|
18
|
+
version: z.literal(2),
|
19
|
+
data: z.object({
|
20
|
+
paymentId: z.string(),
|
21
|
+
// only exists when the payment was triggered from a developer specified payment link
|
22
|
+
paymentLinkId: z.optional(z.string()),
|
23
|
+
clientId: z.string(),
|
24
|
+
action: z.enum(["TRANSFER", "BUY", "SELL"]),
|
25
|
+
status: z.enum(["PENDING", "FAILED", "COMPLETED"]),
|
26
|
+
originToken: addressSchema,
|
27
|
+
originAmount: z.string(),
|
28
|
+
destinationToken: addressSchema,
|
29
|
+
destinationAmount: z.string(),
|
30
|
+
sender: addressSchema,
|
31
|
+
receiver: addressSchema,
|
32
|
+
type: z.string(),
|
33
|
+
transactions: z.array(hexSchema),
|
34
|
+
developerFeeBps: z.coerce.number(),
|
35
|
+
developerFeeRecipient: addressSchema,
|
36
|
+
purchaseData: z.record(z.string(), z.unknown()),
|
37
|
+
}),
|
38
|
+
}),
|
39
|
+
]);
|
40
|
+
|
41
|
+
export type WebhookPayload = Exclude<
|
42
|
+
z.infer<typeof webhookSchema>,
|
43
|
+
{ version: 1 }
|
44
|
+
>;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* Parses an incoming webhook from thirdweb.
|
48
|
+
*
|
49
|
+
* @param payload - The raw text body received from thirdweb.
|
50
|
+
* @param headers - The webhook headers received from thirdweb.
|
51
|
+
* @param secret - The webhook secret to verify the payload with.
|
52
|
+
*/
|
53
|
+
export async function parse(
|
54
|
+
/**
|
55
|
+
* Raw text body received from thirdweb.
|
56
|
+
*/
|
57
|
+
payload: string,
|
58
|
+
|
59
|
+
/**
|
60
|
+
* The webhook headers received from thirdweb.
|
61
|
+
*/
|
62
|
+
headers: Record<string, string>,
|
63
|
+
|
64
|
+
/**
|
65
|
+
* The webhook secret to verify the payload with.
|
66
|
+
*/
|
67
|
+
secret: string,
|
68
|
+
|
69
|
+
/**
|
70
|
+
* The tolerance in seconds for the timestamp verification.
|
71
|
+
*/
|
72
|
+
tolerance = 300, // Default to 5 minutes if not specified
|
73
|
+
) {
|
74
|
+
// Get the signature and timestamp from headers
|
75
|
+
const receivedSignature =
|
76
|
+
headers["x-payload-signature"] || headers["x-pay-signature"];
|
77
|
+
const receivedTimestamp =
|
78
|
+
headers["x-timestamp"] || headers["x-pay-timestamp"];
|
79
|
+
|
80
|
+
if (!receivedSignature || !receivedTimestamp) {
|
81
|
+
throw new Error("Missing required webhook headers: signature or timestamp");
|
82
|
+
}
|
83
|
+
|
84
|
+
// Verify timestamp
|
85
|
+
const now = Math.floor(Date.now() / 1000);
|
86
|
+
const timestamp = Number.parseInt(receivedTimestamp, 10);
|
87
|
+
const diff = Math.abs(now - timestamp);
|
88
|
+
|
89
|
+
if (diff > tolerance) {
|
90
|
+
throw new Error(
|
91
|
+
`Webhook timestamp is too old. Difference: ${diff}s, tolerance: ${tolerance}s`,
|
92
|
+
);
|
93
|
+
}
|
94
|
+
|
95
|
+
// Generate signature using the same method as the sender
|
96
|
+
const encoder = new TextEncoder();
|
97
|
+
const key = await crypto.subtle.importKey(
|
98
|
+
"raw",
|
99
|
+
encoder.encode(secret),
|
100
|
+
{ name: "HMAC", hash: "SHA-256" },
|
101
|
+
false,
|
102
|
+
["sign"],
|
103
|
+
);
|
104
|
+
|
105
|
+
const signature = await crypto.subtle.sign(
|
106
|
+
"HMAC",
|
107
|
+
key,
|
108
|
+
encoder.encode(`${receivedTimestamp}.${payload}`),
|
109
|
+
);
|
110
|
+
|
111
|
+
// Convert the signature to hex string
|
112
|
+
const computedSignature = Array.from(new Uint8Array(signature))
|
113
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
114
|
+
.join("");
|
115
|
+
|
116
|
+
// Compare signatures
|
117
|
+
if (computedSignature !== receivedSignature) {
|
118
|
+
throw new Error("Invalid webhook signature");
|
119
|
+
}
|
120
|
+
|
121
|
+
// Parse the payload as JSON
|
122
|
+
let payloadObject: unknown;
|
123
|
+
try {
|
124
|
+
payloadObject = JSON.parse(payload) as unknown;
|
125
|
+
} catch {
|
126
|
+
throw new Error("Invalid webhook payload: not valid JSON");
|
127
|
+
}
|
128
|
+
|
129
|
+
const parsedPayload = webhookSchema.parse(payloadObject);
|
130
|
+
|
131
|
+
// v1 is no longer supported
|
132
|
+
if (parsedPayload.version === 1) {
|
133
|
+
throw new Error(
|
134
|
+
"Invalid webhook payload: version 1 is no longer supported, please upgrade to webhook version 2.",
|
135
|
+
);
|
136
|
+
}
|
137
|
+
|
138
|
+
return parsedPayload;
|
139
|
+
}
|
package/src/bridge/index.ts
CHANGED
@@ -2,9 +2,11 @@ export * as Buy from "./Buy.js";
|
|
2
2
|
export * as Sell from "./Sell.js";
|
3
3
|
export * as Transfer from "./Transfer.js";
|
4
4
|
export * as Onramp from "./Onramp.js";
|
5
|
+
export * as Webhook from "./Webhook.js";
|
5
6
|
export { status } from "./Status.js";
|
6
7
|
export { routes } from "./Routes.js";
|
7
8
|
export { chains } from "./Chains.js";
|
9
|
+
export { parse } from "./Webhook.js";
|
8
10
|
|
9
11
|
export type { Chain } from "./types/Chain.js";
|
10
12
|
export type { Quote, PreparedQuote } from "./types/Quote.js";
|
@@ -16,5 +18,6 @@ export type {
|
|
16
18
|
} from "./types/Route.js";
|
17
19
|
export type { Status } from "./types/Status.js";
|
18
20
|
export type { Token } from "./types/Token.js";
|
19
|
-
export type { Action } from "./types/BridgeAction.js";
|
20
21
|
export type { ApiError } from "./types/Errors.js";
|
22
|
+
export type { Action } from "./types/BridgeAction.js";
|
23
|
+
export type { WebhookPayload } from "./Webhook.js";
|
package/src/engine/get-status.ts
CHANGED
@@ -79,6 +79,7 @@ export async function getTransactionStatus(args: {
|
|
79
79
|
const { client, transactionId } = args;
|
80
80
|
const searchResult = await searchTransactions({
|
81
81
|
baseUrl: getThirdwebBaseUrl("engineCloud"),
|
82
|
+
bodySerializer: stringify,
|
82
83
|
fetch: getClientFetch(client),
|
83
84
|
body: {
|
84
85
|
filters: [
|
@@ -3,13 +3,14 @@ import { TEST_CLIENT } from "../../test/src/test-clients.js";
|
|
3
3
|
import { TEST_ACCOUNT_B } from "../../test/src/test-wallets.js";
|
4
4
|
import { typedData } from "../../test/src/typed-data.js";
|
5
5
|
import { arbitrumSepolia } from "../chains/chain-definitions/arbitrum-sepolia.js";
|
6
|
+
import { baseSepolia } from "../chains/chain-definitions/base-sepolia.js";
|
6
7
|
import { sepolia } from "../chains/chain-definitions/sepolia.js";
|
7
8
|
import { getContract } from "../contract/contract.js";
|
8
9
|
import { setContractURI } from "../extensions/common/__generated__/IContractMetadata/write/setContractURI.js";
|
10
|
+
import { mintTo } from "../extensions/erc20/write/mintTo.js";
|
9
11
|
import { claimTo } from "../extensions/erc1155/drops/write/claimTo.js";
|
10
12
|
import { getAllActiveSigners } from "../extensions/erc4337/__generated__/IAccountPermissions/read/getAllActiveSigners.js";
|
11
13
|
import { sendTransaction } from "../transaction/actions/send-transaction.js";
|
12
|
-
import { setThirdwebDomains } from "../utils/domains.js";
|
13
14
|
import {
|
14
15
|
DEFAULT_ACCOUNT_FACTORY_V0_6,
|
15
16
|
ENTRYPOINT_ADDRESS_v0_6,
|
@@ -32,12 +33,12 @@ describe.runIf(
|
|
32
33
|
let serverWallet: Engine.ServerWallet;
|
33
34
|
|
34
35
|
beforeAll(async () => {
|
35
|
-
setThirdwebDomains({
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
});
|
36
|
+
// setThirdwebDomains({
|
37
|
+
// rpc: "rpc.thirdweb-dev.com",
|
38
|
+
// storage: "storage.thirdweb-dev.com",
|
39
|
+
// bundler: "bundler.thirdweb-dev.com",
|
40
|
+
// engineCloud: "engine.thirdweb-dev.com",
|
41
|
+
// });
|
41
42
|
serverWallet = Engine.serverWallet({
|
42
43
|
client: TEST_CLIENT,
|
43
44
|
vaultAccessToken: process.env.VAULT_TOKEN as string,
|
@@ -81,7 +82,7 @@ describe.runIf(
|
|
81
82
|
});
|
82
83
|
const claimTx = claimTo({
|
83
84
|
contract: nftContract,
|
84
|
-
to:
|
85
|
+
to: serverWallet.address,
|
85
86
|
tokenId: 0n,
|
86
87
|
quantity: 1n,
|
87
88
|
});
|
@@ -97,16 +98,15 @@ describe.runIf(
|
|
97
98
|
});
|
98
99
|
|
99
100
|
it("should send a extension tx", async () => {
|
100
|
-
const
|
101
|
+
const tokenContract = getContract({
|
101
102
|
client: TEST_CLIENT,
|
102
|
-
chain:
|
103
|
-
address: "
|
103
|
+
chain: baseSepolia,
|
104
|
+
address: "0x87C52295891f208459F334975a3beE198fE75244",
|
104
105
|
});
|
105
|
-
const claimTx =
|
106
|
-
contract:
|
107
|
-
to:
|
108
|
-
|
109
|
-
quantity: 1n,
|
106
|
+
const claimTx = mintTo({
|
107
|
+
contract: tokenContract,
|
108
|
+
to: serverWallet.address,
|
109
|
+
amount: "0.001",
|
110
110
|
});
|
111
111
|
const tx = await sendTransaction({
|
112
112
|
account: serverWallet,
|
@@ -144,13 +144,14 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
|
|
144
144
|
|
145
145
|
const result = await sendTransaction({
|
146
146
|
baseUrl: getThirdwebBaseUrl("engineCloud"),
|
147
|
+
bodySerializer: stringify,
|
147
148
|
fetch: getClientFetch(client),
|
148
149
|
headers,
|
149
150
|
body,
|
150
151
|
});
|
151
152
|
|
152
153
|
if (result.error) {
|
153
|
-
throw new Error(`Error sending transaction: ${result.error}`);
|
154
|
+
throw new Error(`Error sending transaction: ${stringify(result.error)}`);
|
154
155
|
}
|
155
156
|
|
156
157
|
const data = result.data?.result;
|
@@ -220,6 +221,7 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
|
|
220
221
|
|
221
222
|
const signResult = await signMessage({
|
222
223
|
baseUrl: getThirdwebBaseUrl("engineCloud"),
|
224
|
+
bodySerializer: stringify,
|
223
225
|
fetch: getClientFetch(client),
|
224
226
|
headers,
|
225
227
|
body: {
|
@@ -256,6 +258,7 @@ export function serverWallet(options: ServerWalletOptions): ServerWallet {
|
|
256
258
|
|
257
259
|
const signResult = await signTypedData({
|
258
260
|
baseUrl: getThirdwebBaseUrl("engineCloud"),
|
261
|
+
bodySerializer: stringify,
|
259
262
|
fetch: getClientFetch(client),
|
260
263
|
headers,
|
261
264
|
body: {
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { ChevronDownIcon } from "@radix-ui/react-icons";
|
2
|
+
import type { FiatProvider } from "../../../../../../pay/utils/commonTypes.js";
|
3
|
+
import { iconSize, spacing } from "../../../../../core/design-system/index.js";
|
4
|
+
import { Container } from "../../../components/basic.js";
|
5
|
+
import { Button } from "../../../components/buttons.js";
|
6
|
+
import { Text } from "../../../components/text.js";
|
7
|
+
import { getProviderLabel } from "./utils.js";
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Shows the selected payment provider based on the preferred provider OR the quoted provider.
|
11
|
+
* @internal
|
12
|
+
*/
|
13
|
+
export const PayProviderSelection = (props: {
|
14
|
+
onShowProviders: () => void;
|
15
|
+
quotedProvider?: FiatProvider;
|
16
|
+
preferredProvider?: FiatProvider;
|
17
|
+
supportedProviders: FiatProvider[];
|
18
|
+
}) => {
|
19
|
+
const ProviderItem = (
|
20
|
+
<Container
|
21
|
+
flex="row"
|
22
|
+
center="y"
|
23
|
+
gap="xxs"
|
24
|
+
color="secondaryText"
|
25
|
+
style={{ padding: spacing.md }}
|
26
|
+
>
|
27
|
+
<Text size="xs">
|
28
|
+
{getProviderLabel(
|
29
|
+
props.preferredProvider ?? props.quotedProvider ?? "",
|
30
|
+
)}
|
31
|
+
</Text>
|
32
|
+
{props.supportedProviders.length > 1 && (
|
33
|
+
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
34
|
+
)}
|
35
|
+
</Container>
|
36
|
+
);
|
37
|
+
|
38
|
+
return (
|
39
|
+
<Container
|
40
|
+
bg="tertiaryBg"
|
41
|
+
flex="row"
|
42
|
+
borderColor="borderColor"
|
43
|
+
style={{
|
44
|
+
paddingLeft: spacing.md,
|
45
|
+
justifyContent: "space-between",
|
46
|
+
alignItems: "center",
|
47
|
+
borderWidth: "1px",
|
48
|
+
borderStyle: "solid",
|
49
|
+
borderBottom: "none",
|
50
|
+
}}
|
51
|
+
>
|
52
|
+
<Text size="xs" color="secondaryText">
|
53
|
+
Provider
|
54
|
+
</Text>
|
55
|
+
{props.supportedProviders.length > 1 ? (
|
56
|
+
<Button
|
57
|
+
variant="ghost"
|
58
|
+
onClick={props.onShowProviders}
|
59
|
+
style={{ padding: 0 }} // Padding is managed within children as the button is conditional
|
60
|
+
>
|
61
|
+
{ProviderItem}
|
62
|
+
</Button>
|
63
|
+
) : (
|
64
|
+
ProviderItem
|
65
|
+
)}
|
66
|
+
</Container>
|
67
|
+
);
|
68
|
+
};
|
@@ -1,15 +1,13 @@
|
|
1
|
-
import { ChevronDownIcon } from "@radix-ui/react-icons";
|
2
1
|
import { useState } from "react";
|
3
2
|
import { trackPayEvent } from "../../../../../../../analytics/track/pay.js";
|
4
3
|
import type { Chain } from "../../../../../../../chains/types.js";
|
5
4
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
6
5
|
import { NATIVE_TOKEN_ADDRESS } from "../../../../../../../constants/addresses.js";
|
7
|
-
import type { FiatProvider } from "../../../../../../../pay/utils/commonTypes.js";
|
8
6
|
import {
|
9
|
-
type
|
10
|
-
|
11
|
-
|
12
|
-
} from "../../../../../../core/design-system/index.js";
|
7
|
+
type FiatProvider,
|
8
|
+
FiatProviders,
|
9
|
+
} from "../../../../../../../pay/utils/commonTypes.js";
|
10
|
+
import type { Theme } from "../../../../../../core/design-system/index.js";
|
13
11
|
import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
|
14
12
|
import { useBuyWithFiatQuote } from "../../../../../../core/hooks/pay/useBuyWithFiatQuote.js";
|
15
13
|
import { PREFERRED_FIAT_PROVIDER_STORAGE_KEY } from "../../../../../../core/utils/storage.js";
|
@@ -26,6 +24,7 @@ import { Button } from "../../../../components/buttons.js";
|
|
26
24
|
import { Text } from "../../../../components/text.js";
|
27
25
|
import { type ERC20OrNativeToken, isNativeToken } from "../../nativeToken.js";
|
28
26
|
import { EstimatedTimeAndFees } from "../EstimatedTimeAndFees.js";
|
27
|
+
import { PayProviderSelection } from "../PayProviderSelection.js";
|
29
28
|
import { PayWithCreditCard } from "../PayWIthCreditCard.js";
|
30
29
|
import type { SelectedScreen } from "../main/types.js";
|
31
30
|
import { FiatFees } from "../swap/Fees.js";
|
@@ -84,6 +83,19 @@ export function FiatScreenContent(props: {
|
|
84
83
|
: undefined,
|
85
84
|
);
|
86
85
|
|
86
|
+
const supportedProviders = (() => {
|
87
|
+
if (!buyWithFiatOptions) return [...FiatProviders];
|
88
|
+
const options = buyWithFiatOptions?.supportedProviders ?? [];
|
89
|
+
const optionsWithPreferred =
|
90
|
+
options.length > 0
|
91
|
+
? new Set([
|
92
|
+
...(preferredProvider ? [preferredProvider] : []),
|
93
|
+
...options,
|
94
|
+
])
|
95
|
+
: FiatProviders;
|
96
|
+
return Array.from(optionsWithPreferred);
|
97
|
+
})();
|
98
|
+
|
87
99
|
const fiatQuoteQuery = useBuyWithFiatQuote(
|
88
100
|
buyWithFiatOptions !== false && tokenAmount
|
89
101
|
? {
|
@@ -98,8 +110,8 @@ export function FiatScreenContent(props: {
|
|
98
110
|
isTestMode: buyWithFiatOptions?.testMode,
|
99
111
|
purchaseData: props.payOptions.purchaseData,
|
100
112
|
fromAddress: payer.account.address,
|
101
|
-
preferredProvider: preferredProvider,
|
102
113
|
paymentLinkId: paymentLinkId,
|
114
|
+
preferredProvider: preferredProvider ?? supportedProviders[0],
|
103
115
|
}
|
104
116
|
: undefined,
|
105
117
|
);
|
@@ -159,6 +171,7 @@ export function FiatScreenContent(props: {
|
|
159
171
|
</Text>
|
160
172
|
<Spacer y="lg" />
|
161
173
|
<Providers
|
174
|
+
supportedProviders={supportedProviders}
|
162
175
|
preferredProvider={
|
163
176
|
preferredProvider || fiatQuoteQuery.data?.provider
|
164
177
|
}
|
@@ -188,35 +201,13 @@ export function FiatScreenContent(props: {
|
|
188
201
|
currency={selectedCurrency}
|
189
202
|
onSelectCurrency={showCurrencySelector}
|
190
203
|
/>
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
alignItems: "center",
|
199
|
-
borderWidth: "1px",
|
200
|
-
borderStyle: "solid",
|
201
|
-
borderBottom: "none",
|
202
|
-
}}
|
203
|
-
>
|
204
|
-
<Text size="xs" color="secondaryText">
|
205
|
-
Provider
|
206
|
-
</Text>
|
207
|
-
<Button variant="ghost" onClick={showProviders}>
|
208
|
-
<Container flex="row" center="y" gap="xxs" color="secondaryText">
|
209
|
-
<Text size="xs">
|
210
|
-
{preferredProvider
|
211
|
-
? `${preferredProvider.charAt(0).toUpperCase() + preferredProvider.slice(1).toLowerCase()}`
|
212
|
-
: fiatQuoteQuery.data?.provider
|
213
|
-
? `${fiatQuoteQuery.data?.provider.charAt(0).toUpperCase() + fiatQuoteQuery.data?.provider.slice(1).toLowerCase()}`
|
214
|
-
: ""}
|
215
|
-
</Text>
|
216
|
-
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
217
|
-
</Container>
|
218
|
-
</Button>
|
219
|
-
</Container>
|
204
|
+
{/** Shows preferred or quoted provider and conditional selection */}
|
205
|
+
<PayProviderSelection
|
206
|
+
onShowProviders={showProviders}
|
207
|
+
quotedProvider={fiatQuoteQuery.data?.provider}
|
208
|
+
preferredProvider={preferredProvider}
|
209
|
+
supportedProviders={supportedProviders}
|
210
|
+
/>
|
220
211
|
{/* Estimated time + View fees button */}
|
221
212
|
<EstimatedTimeAndFees
|
222
213
|
quoteIsLoading={fiatQuoteQuery.isLoading}
|
@@ -44,6 +44,7 @@ import { StepConnectorArrow } from "../swap/StepConnector.js";
|
|
44
44
|
import { WalletRow } from "../swap/WalletRow.js";
|
45
45
|
import { addPendingTx } from "../swap/pendingSwapTx.js";
|
46
46
|
import type { PayerInfo } from "../types.js";
|
47
|
+
import { getProviderLabel } from "../utils.js";
|
47
48
|
import { StepContainer } from "./FiatSteps.js";
|
48
49
|
|
49
50
|
type OnRampScreenState = {
|
@@ -213,7 +214,7 @@ function StepUI(props: {
|
|
213
214
|
/>
|
214
215
|
<Container flex="column" gap="3xs" center="y" style={{ flex: "1" }}>
|
215
216
|
<Text size="sm" color="primaryText">
|
216
|
-
{
|
217
|
+
{getProviderLabel(step.action)}
|
217
218
|
</Text>
|
218
219
|
|
219
220
|
<Container
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import {
|
2
|
-
type FiatProvider,
|
3
|
-
FiatProviders,
|
4
|
-
} from "../../../../../../../pay/utils/commonTypes.js";
|
1
|
+
import type { FiatProvider } from "../../../../../../../pay/utils/commonTypes.js";
|
5
2
|
import { Container } from "../../../../components/basic.js";
|
6
3
|
import { Button } from "../../../../components/buttons.js";
|
7
4
|
import { Link } from "../../../../components/text.js";
|
5
|
+
import { getProviderLabel } from "../utils.js";
|
8
6
|
/**
|
9
7
|
* @internal
|
10
8
|
*/
|
9
|
+
|
11
10
|
export function Providers(props: {
|
11
|
+
supportedProviders: FiatProvider[];
|
12
12
|
preferredProvider?: FiatProvider;
|
13
13
|
onSelect: (provider: FiatProvider) => void;
|
14
14
|
}) {
|
@@ -21,37 +21,34 @@ export function Providers(props: {
|
|
21
21
|
alignItems: "flex-start",
|
22
22
|
}}
|
23
23
|
>
|
24
|
-
{
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
24
|
+
{props.supportedProviders.map((provider) => (
|
25
|
+
<Container
|
26
|
+
key={provider}
|
27
|
+
flex="row"
|
28
|
+
expand
|
29
|
+
style={{
|
30
|
+
justifyContent: "space-between",
|
31
|
+
}}
|
32
|
+
>
|
33
|
+
<Button
|
34
|
+
fullWidth
|
35
|
+
onClick={() => props.onSelect(provider)}
|
36
|
+
variant={"link"}
|
33
37
|
>
|
34
|
-
<
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
+
<Link
|
39
|
+
color={
|
40
|
+
props.preferredProvider === provider
|
41
|
+
? "primaryText"
|
42
|
+
: "secondaryText"
|
43
|
+
}
|
44
|
+
size="sm"
|
45
|
+
hoverColor="primaryText"
|
38
46
|
>
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
-
size="sm"
|
46
|
-
hoverColor="primaryText"
|
47
|
-
>
|
48
|
-
{provider.charAt(0).toUpperCase() +
|
49
|
-
provider.slice(1).toLowerCase()}
|
50
|
-
</Link>
|
51
|
-
</Button>
|
52
|
-
</Container>
|
53
|
-
);
|
54
|
-
})}
|
47
|
+
{getProviderLabel(provider)}
|
48
|
+
</Link>
|
49
|
+
</Button>
|
50
|
+
</Container>
|
51
|
+
))}
|
55
52
|
</Container>
|
56
53
|
);
|
57
54
|
}
|
@@ -1,3 +1,12 @@
|
|
1
1
|
export function getBuyTokenAmountFontSize(value: string) {
|
2
2
|
return value.length > 10 ? "26px" : value.length > 6 ? "34px" : "50px";
|
3
3
|
}
|
4
|
+
|
5
|
+
/**
|
6
|
+
*
|
7
|
+
* @param str accepts any string but expects a fully upppercased string / type FiatProvider
|
8
|
+
* @returns Fiat provider label to be rendered used within presentation logic
|
9
|
+
*/
|
10
|
+
export function getProviderLabel(str: string) {
|
11
|
+
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
12
|
+
}
|
@@ -21,19 +21,26 @@ export function getCountrySelector(countryIsoCode: SupportedSmsCountry) {
|
|
21
21
|
export function CountrySelector({
|
22
22
|
countryCode,
|
23
23
|
setCountryCode,
|
24
|
+
allowedCountryCodes,
|
24
25
|
}: {
|
25
26
|
countryCode: string;
|
26
27
|
setCountryCode: React.Dispatch<React.SetStateAction<string>>;
|
28
|
+
allowedCountryCodes?: SupportedSmsCountry[];
|
27
29
|
}) {
|
28
30
|
const selectRef = useRef<HTMLSelectElement>(null);
|
29
31
|
|
30
|
-
const supportedCountriesForSms =
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
const supportedCountriesForSms =
|
33
|
+
allowedCountryCodes && allowedCountryCodes.length > 0
|
34
|
+
? supportedSmsCountries.filter((c) =>
|
35
|
+
allowedCountryCodes.includes(c.countryIsoCode as SupportedSmsCountry),
|
36
|
+
)
|
37
|
+
: (supportedSmsCountries ?? [
|
38
|
+
{
|
39
|
+
countryIsoCode: "US",
|
40
|
+
countryName: "United States",
|
41
|
+
phoneNumberCode: 1,
|
42
|
+
},
|
43
|
+
]);
|
37
44
|
|
38
45
|
return (
|
39
46
|
<>
|
@@ -42,4 +42,27 @@ describe("InputSelectionUI", () => {
|
|
42
42
|
|
43
43
|
expect(screen.getByRole("combobox")).toHaveValue("US +1");
|
44
44
|
});
|
45
|
+
|
46
|
+
it("should filter countries based on allowedSmsCountryCodes", () => {
|
47
|
+
const mockGetCountrySelector = vi.mocked(getCountrySelector);
|
48
|
+
mockGetCountrySelector.mockReturnValue("IN +91");
|
49
|
+
|
50
|
+
render(
|
51
|
+
<InputSelectionUI
|
52
|
+
onSelect={vi.fn()}
|
53
|
+
placeholder=""
|
54
|
+
name=""
|
55
|
+
type=""
|
56
|
+
submitButtonText=""
|
57
|
+
format="phone"
|
58
|
+
allowedSmsCountryCodes={["IN", "BR"]}
|
59
|
+
/>,
|
60
|
+
);
|
61
|
+
|
62
|
+
const options = screen.getAllByRole("option");
|
63
|
+
const optionTexts = options.map((o) => o.textContent);
|
64
|
+
expect(optionTexts.some((t) => t?.includes("India"))).toBe(true);
|
65
|
+
expect(optionTexts.some((t) => t?.includes("Brazil"))).toBe(true);
|
66
|
+
expect(optionTexts.some((t) => t?.includes("United States"))).toBe(false);
|
67
|
+
});
|
45
68
|
});
|
@@ -24,11 +24,16 @@ export function InputSelectionUI(props: {
|
|
24
24
|
format?: "phone";
|
25
25
|
disabled?: boolean;
|
26
26
|
defaultSmsCountryCode?: SupportedSmsCountry;
|
27
|
+
allowedSmsCountryCodes?: SupportedSmsCountry[];
|
27
28
|
}) {
|
28
29
|
const [countryCodeInfo, setCountryCodeInfo] = useState(
|
29
30
|
props.defaultSmsCountryCode
|
30
31
|
? getCountrySelector(props.defaultSmsCountryCode)
|
31
|
-
:
|
32
|
+
: props.allowedSmsCountryCodes &&
|
33
|
+
props.allowedSmsCountryCodes.length > 0 &&
|
34
|
+
props.allowedSmsCountryCodes[0]
|
35
|
+
? getCountrySelector(props.allowedSmsCountryCodes[0])
|
36
|
+
: "US +1",
|
32
37
|
);
|
33
38
|
const [input, setInput] = useState("");
|
34
39
|
const [error, setError] = useState<string | undefined>();
|
@@ -69,6 +74,7 @@ export function InputSelectionUI(props: {
|
|
69
74
|
<CountrySelector
|
70
75
|
countryCode={countryCodeInfo}
|
71
76
|
setCountryCode={setCountryCodeInfo}
|
77
|
+
allowedCountryCodes={props.allowedSmsCountryCodes}
|
72
78
|
/>
|
73
79
|
)}
|
74
80
|
<Input
|
@@ -451,6 +451,9 @@ export const ConnectWalletSocialOptions = (
|
|
451
451
|
defaultSmsCountryCode={
|
452
452
|
wallet.getConfig()?.auth?.defaultSmsCountryCode
|
453
453
|
}
|
454
|
+
allowedSmsCountryCodes={
|
455
|
+
wallet.getConfig()?.auth?.allowedSmsCountryCodes
|
456
|
+
}
|
454
457
|
/>
|
455
458
|
) : (
|
456
459
|
<WalletTypeRowButton
|