thirdweb 5.100.2-nightly-88533d9113dc07c97cfaf0162591477c7056e69b-20250522000412 → 5.100.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bridge/Buy.js +15 -3
- package/dist/cjs/bridge/Buy.js.map +1 -1
- package/dist/cjs/bridge/Chains.js +7 -1
- package/dist/cjs/bridge/Chains.js.map +1 -1
- package/dist/cjs/bridge/Onramp.js +11 -2
- package/dist/cjs/bridge/Onramp.js.map +1 -1
- package/dist/cjs/bridge/OnrampStatus.js +7 -1
- package/dist/cjs/bridge/OnrampStatus.js.map +1 -1
- package/dist/cjs/bridge/Routes.js +7 -1
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Sell.js +15 -3
- package/dist/cjs/bridge/Sell.js.map +1 -1
- package/dist/cjs/bridge/Status.js +7 -1
- package/dist/cjs/bridge/Status.js.map +1 -1
- package/dist/cjs/bridge/Transfer.js +9 -2
- package/dist/cjs/bridge/Transfer.js.map +1 -1
- package/dist/cjs/bridge/types/Errors.js +31 -0
- package/dist/cjs/bridge/types/Errors.js.map +1 -0
- 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/exports/react.js +6 -4
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +6 -4
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getQuote.js +2 -0
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +1 -0
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js +2 -1
- package/dist/cjs/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +1 -0
- package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useAuthToken.js +42 -0
- package/dist/cjs/react/core/hooks/wallets/useAuthToken.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.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/PayWIthCreditCard.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +20 -23
- 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 +5 -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/swap/SwapScreenContent.js +2 -5
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js +9 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js +1 -1
- package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/cjs/react/web/utils/errors.js +20 -1
- package/dist/cjs/react/web/utils/errors.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/utils/ens/avatar.js +1 -1
- package/dist/cjs/utils/ens/avatar.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +17 -0
- package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/esm/bridge/Buy.js +15 -3
- package/dist/esm/bridge/Buy.js.map +1 -1
- package/dist/esm/bridge/Chains.js +7 -1
- package/dist/esm/bridge/Chains.js.map +1 -1
- package/dist/esm/bridge/Onramp.js +11 -2
- package/dist/esm/bridge/Onramp.js.map +1 -1
- package/dist/esm/bridge/OnrampStatus.js +7 -1
- package/dist/esm/bridge/OnrampStatus.js.map +1 -1
- package/dist/esm/bridge/Routes.js +7 -1
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Sell.js +15 -3
- package/dist/esm/bridge/Sell.js.map +1 -1
- package/dist/esm/bridge/Status.js +7 -1
- package/dist/esm/bridge/Status.js.map +1 -1
- package/dist/esm/bridge/Transfer.js +9 -2
- package/dist/esm/bridge/Transfer.js.map +1 -1
- package/dist/esm/bridge/types/Errors.js +27 -0
- package/dist/esm/bridge/types/Errors.js.map +1 -0
- 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/exports/react.js +2 -1
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +2 -1
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getQuote.js +2 -0
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +1 -0
- package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js +2 -1
- package/dist/esm/pay/buyWithFiat/getPostOnRampQuote.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +1 -0
- package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useAuthToken.js +39 -0
- package/dist/esm/react/core/hooks/wallets/useAuthToken.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +4 -4
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.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/PayWIthCreditCard.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +20 -23
- 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 +5 -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/swap/SwapScreenContent.js +2 -5
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/utils.js.map +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js +1 -1
- package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
- package/dist/esm/react/web/utils/errors.js +20 -1
- package/dist/esm/react/web/utils/errors.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/utils/ens/avatar.js +1 -1
- package/dist/esm/utils/ens/avatar.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +17 -0
- package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
- package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
- package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
- package/dist/types/bridge/Buy.d.ts +4 -0
- package/dist/types/bridge/Buy.d.ts.map +1 -1
- package/dist/types/bridge/Chains.d.ts.map +1 -1
- package/dist/types/bridge/Onramp.d.ts +4 -0
- package/dist/types/bridge/Onramp.d.ts.map +1 -1
- package/dist/types/bridge/OnrampStatus.d.ts.map +1 -1
- package/dist/types/bridge/Routes.d.ts.map +1 -1
- package/dist/types/bridge/Sell.d.ts +4 -0
- package/dist/types/bridge/Sell.d.ts.map +1 -1
- package/dist/types/bridge/Status.d.ts.map +1 -1
- package/dist/types/bridge/Transfer.d.ts +4 -0
- package/dist/types/bridge/Transfer.d.ts.map +1 -1
- package/dist/types/bridge/index.d.ts +2 -1
- package/dist/types/bridge/index.d.ts.map +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -1
- package/dist/types/bridge/types/Errors.d.ts +14 -0
- package/dist/types/bridge/types/Errors.d.ts.map +1 -0
- package/dist/types/bridge/types/Route.d.ts +2 -2
- package/dist/types/bridge/types/Route.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/exports/react.d.ts +2 -1
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +2 -1
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts +4 -0
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts +4 -0
- package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getPostOnRampQuote.d.ts +5 -1
- package/dist/types/pay/buyWithFiat/getPostOnRampQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts +4 -0
- package/dist/types/pay/buyWithFiat/getQuote.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/hooks/wallets/useAuthToken.d.ts +26 -0
- package/dist/types/react/core/hooks/wallets/useAuthToken.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/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/fiat/FiatScreenContent.d.ts +2 -1
- 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/OnRampScreen.d.ts +1 -0
- 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 +2 -1
- 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/swap/SwapScreenContent.d.ts +1 -0
- 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/TransferConfirmationScreen.d.ts +1 -0
- 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 -0
- 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/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/PayEmbed.d.ts +4 -0
- package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
- package/dist/types/react/web/utils/errors.d.ts +2 -8
- package/dist/types/react/web/utils/errors.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts +2 -1
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts +1 -0
- package/dist/types/react/web/wallets/in-app/InputSelectionUI.d.ts.map +1 -1
- package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.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/interfaces/connector.d.ts +2 -0
- package/dist/types/wallets/in-app/core/interfaces/connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/in-app-core.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/native-connector.d.ts +2 -1
- package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +2 -1
- package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
- package/dist/types/wallets/interfaces/wallet.d.ts +10 -0
- package/dist/types/wallets/interfaces/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/bridge/Buy.ts +19 -6
- package/src/bridge/Chains.ts +7 -1
- package/src/bridge/Onramp.ts +16 -3
- package/src/bridge/OnrampStatus.ts +7 -3
- package/src/bridge/Routes.test.ts +1 -1
- package/src/bridge/Routes.ts +7 -1
- package/src/bridge/Sell.ts +19 -6
- package/src/bridge/Status.ts +7 -3
- package/src/bridge/Transfer.ts +13 -3
- package/src/bridge/index.ts +2 -1
- package/src/bridge/types/BridgeAction.ts +1 -1
- package/src/bridge/types/Errors.ts +24 -0
- package/src/bridge/types/Route.ts +2 -2
- 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/exports/react.native.ts +2 -1
- package/src/exports/react.ts +2 -1
- package/src/pay/buyWithCrypto/getQuote.ts +7 -0
- package/src/pay/buyWithCrypto/getTransfer.ts +6 -0
- package/src/pay/buyWithFiat/getPostOnRampQuote.ts +7 -0
- package/src/pay/buyWithFiat/getQuote.ts +6 -0
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +1 -0
- package/src/react/core/hooks/wallets/useAuthToken.ts +41 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +6 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayProviderSelection.tsx +68 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +63 -105
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +8 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/Providers.tsx +30 -33
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapScreenContent.tsx +9 -38
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferConfirmationScreen.tsx +3 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TransferFlow.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/utils.ts +9 -0
- package/src/react/web/ui/PayEmbed.tsx +6 -0
- package/src/react/web/utils/errors.ts +24 -8
- 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/utils/ens/avatar.ts +1 -1
- package/src/version.ts +1 -1
- package/src/wallets/ecosystem/types.ts +5 -0
- package/src/wallets/in-app/core/interfaces/connector.ts +2 -0
- package/src/wallets/in-app/core/wallet/in-app-core.ts +15 -0
- package/src/wallets/in-app/core/wallet/types.ts +5 -0
- package/src/wallets/in-app/native/native-connector.ts +1 -1
- package/src/wallets/in-app/web/lib/web-connector.ts +1 -1
- package/src/wallets/interfaces/wallet.ts +11 -1
@@ -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: {
|
@@ -9,10 +9,11 @@ export type {
|
|
9
9
|
|
10
10
|
// wallet hooks
|
11
11
|
export { useActiveWallet } from "../react/core/hooks/wallets/useActiveWallet.js";
|
12
|
-
export { useAdminWallet } from "../react/core/hooks/wallets/useAdminWallet.js";
|
13
12
|
export { useActiveWalletChain } from "../react/core/hooks/wallets/useActiveWalletChain.js";
|
14
13
|
export { useActiveWalletConnectionStatus } from "../react/core/hooks/wallets/useActiveWalletConnectionStatus.js";
|
15
14
|
export { useActiveAccount } from "../react/core/hooks/wallets/useActiveAccount.js";
|
15
|
+
export { useAdminWallet } from "../react/core/hooks/wallets/useAdminWallet.js";
|
16
|
+
export { useAuthToken } from "../react/core/hooks/wallets/useAuthToken.js";
|
16
17
|
export { useAutoConnect } from "../react/native/hooks/wallets/useAutoConnect.js";
|
17
18
|
export { useConnect } from "../react/core/hooks/wallets/useConnect.js";
|
18
19
|
export { useConnectedWallets } from "../react/core/hooks/wallets/useConnectedWallets.js";
|
package/src/exports/react.ts
CHANGED
@@ -40,10 +40,11 @@ export type { MediaRendererProps } from "../react/web/ui/MediaRenderer/types.js"
|
|
40
40
|
|
41
41
|
// wallet hooks
|
42
42
|
export { useActiveWallet } from "../react/core/hooks/wallets/useActiveWallet.js";
|
43
|
-
export { useAdminWallet } from "../react/core/hooks/wallets/useAdminWallet.js";
|
44
43
|
export { useActiveWalletChain } from "../react/core/hooks/wallets/useActiveWalletChain.js";
|
45
44
|
export { useActiveWalletConnectionStatus } from "../react/core/hooks/wallets/useActiveWalletConnectionStatus.js";
|
46
45
|
export { useActiveAccount } from "../react/core/hooks/wallets/useActiveAccount.js";
|
46
|
+
export { useAdminWallet } from "../react/core/hooks/wallets/useAdminWallet.js";
|
47
|
+
export { useAuthToken } from "../react/core/hooks/wallets/useAuthToken.js";
|
47
48
|
export { useAutoConnect } from "../react/web/hooks/wallets/useAutoConnect.js";
|
48
49
|
export { useConnect } from "../react/core/hooks/wallets/useConnect.js";
|
49
50
|
export { useConnectedWallets } from "../react/core/hooks/wallets/useConnectedWallets.js";
|
@@ -83,6 +83,11 @@ export type GetBuyWithCryptoQuoteParams = {
|
|
83
83
|
* For example, if you want to allow a maximum slippage of 0.5%, you should specify `50` bps.
|
84
84
|
*/
|
85
85
|
maxSlippageBPS?: number;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* @hidden
|
89
|
+
*/
|
90
|
+
paymentLinkId?: string;
|
86
91
|
} & (
|
87
92
|
| {
|
88
93
|
/**
|
@@ -203,6 +208,7 @@ export async function getBuyWithCryptoQuote(
|
|
203
208
|
amount: amount,
|
204
209
|
purchaseData: params.purchaseData,
|
205
210
|
client: params.client,
|
211
|
+
paymentLinkId: params.paymentLinkId,
|
206
212
|
});
|
207
213
|
} else if (params.fromAmount) {
|
208
214
|
const originTokenContract = getContract({
|
@@ -224,6 +230,7 @@ export async function getBuyWithCryptoQuote(
|
|
224
230
|
amount: amount,
|
225
231
|
purchaseData: params.purchaseData,
|
226
232
|
client: params.client,
|
233
|
+
paymentLinkId: params.paymentLinkId,
|
227
234
|
});
|
228
235
|
}
|
229
236
|
throw new Error(
|
@@ -60,6 +60,11 @@ export type GetBuyWithCryptoTransferParams = {
|
|
60
60
|
* For direct transfers, specify who will pay for the transfer fee. Can be "sender" or "receiver".
|
61
61
|
*/
|
62
62
|
feePayer?: "sender" | "receiver";
|
63
|
+
|
64
|
+
/**
|
65
|
+
* @hidden
|
66
|
+
*/
|
67
|
+
paymentLinkId?: string;
|
63
68
|
};
|
64
69
|
|
65
70
|
/**
|
@@ -127,6 +132,7 @@ export async function getBuyWithCryptoTransfer(
|
|
127
132
|
receiver: params.toAddress,
|
128
133
|
client: params.client,
|
129
134
|
feePayer: params.feePayer,
|
135
|
+
paymentLinkId: params.paymentLinkId,
|
130
136
|
});
|
131
137
|
|
132
138
|
const firstStep = quote.steps[0];
|
@@ -21,6 +21,11 @@ export type GetPostOnRampQuoteParams = {
|
|
21
21
|
* The "Buy with fiat" transaction status object returned by [`getBuyWithFiatStatus`](https://portal.thirdweb.com/typescript/v5/getBuyWithFiatStatus) function
|
22
22
|
*/
|
23
23
|
buyWithFiatStatus: BuyWithFiatStatus;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
paymentLinkId?: string;
|
24
29
|
};
|
25
30
|
|
26
31
|
/**
|
@@ -61,6 +66,7 @@ export type GetPostOnRampQuoteParams = {
|
|
61
66
|
export async function getPostOnRampQuote({
|
62
67
|
client,
|
63
68
|
buyWithFiatStatus,
|
69
|
+
paymentLinkId,
|
64
70
|
}: GetPostOnRampQuoteParams): Promise<BuyWithCryptoQuote> {
|
65
71
|
if (buyWithFiatStatus.status === "NOT_FOUND") {
|
66
72
|
throw new Error("Invalid buyWithFiatStatus");
|
@@ -77,5 +83,6 @@ export async function getPostOnRampQuote({
|
|
77
83
|
toChainId: buyWithFiatStatus.quote.toToken.chainId,
|
78
84
|
toTokenAddress: buyWithFiatStatus.quote.toToken.tokenAddress,
|
79
85
|
toAmount: buyWithFiatStatus.quote.estimatedToTokenAmount,
|
86
|
+
paymentLinkId: paymentLinkId,
|
80
87
|
});
|
81
88
|
}
|
@@ -95,6 +95,11 @@ export type GetBuyWithFiatQuoteParams = {
|
|
95
95
|
* By default, we choose a recommended provider based on the location of the user, KYC status, and currency.
|
96
96
|
*/
|
97
97
|
preferredProvider?: FiatProvider;
|
98
|
+
|
99
|
+
/**
|
100
|
+
* @hidden
|
101
|
+
*/
|
102
|
+
paymentLinkId?: string;
|
98
103
|
};
|
99
104
|
|
100
105
|
/**
|
@@ -321,6 +326,7 @@ export async function getBuyWithFiatQuote(
|
|
321
326
|
currency: params.fromCurrencySymbol,
|
322
327
|
maxSteps: 2,
|
323
328
|
onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // force onramp to native token to avoid missing gas issues
|
329
|
+
paymentLinkId: params.paymentLinkId,
|
324
330
|
});
|
325
331
|
|
326
332
|
// Determine tokens based on steps rules
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import { useActiveAccount } from "./useActiveAccount.js";
|
2
|
+
import { useActiveWallet } from "./useActiveWallet.js";
|
3
|
+
|
4
|
+
/**
|
5
|
+
* A hook that returns the authentication token (JWT) for the currently active wallet.
|
6
|
+
* This token can be used to authorize API calls to your backend server.
|
7
|
+
*
|
8
|
+
* @returns The JWT string if the active wallet is an in-app wallet and matches the active account, null otherwise
|
9
|
+
*
|
10
|
+
* @example
|
11
|
+
* ```tsx
|
12
|
+
* function MyComponent() {
|
13
|
+
* const authToken = useAuthToken();
|
14
|
+
*
|
15
|
+
* const fetchData = async () => {
|
16
|
+
* const response = await fetch('https://api.example.com/data', {
|
17
|
+
* headers: {
|
18
|
+
* 'Authorization': `Bearer ${authToken}`
|
19
|
+
* }
|
20
|
+
* });
|
21
|
+
* // ... handle response
|
22
|
+
* };
|
23
|
+
* }
|
24
|
+
* ```
|
25
|
+
*
|
26
|
+
* @wallet
|
27
|
+
*/
|
28
|
+
export function useAuthToken() {
|
29
|
+
const activeWallet = useActiveWallet();
|
30
|
+
const activeAccount = useActiveAccount();
|
31
|
+
// if the active wallet is an in-app wallet and the active account is the same as the active wallet's account, return the auth token for the in-app wallet
|
32
|
+
if (
|
33
|
+
activeWallet?.getAuthToken &&
|
34
|
+
activeAccount &&
|
35
|
+
activeAccount.address === activeWallet.getAccount()?.address
|
36
|
+
) {
|
37
|
+
return activeWallet.getAuthToken();
|
38
|
+
}
|
39
|
+
// all other wallets don't expose an auth token for now
|
40
|
+
return null;
|
41
|
+
}
|
@@ -83,6 +83,7 @@ export type BuyScreenProps = {
|
|
83
83
|
connectOptions: PayEmbedConnectOptions | undefined;
|
84
84
|
hiddenWallets?: WalletId[];
|
85
85
|
isEmbed: boolean;
|
86
|
+
paymentLinkId?: string;
|
86
87
|
};
|
87
88
|
|
88
89
|
/**
|
@@ -151,6 +152,7 @@ type BuyScreenContentProps = {
|
|
151
152
|
hiddenWallets?: WalletId[];
|
152
153
|
connectOptions: PayEmbedConnectOptions | undefined;
|
153
154
|
isEmbed: boolean;
|
155
|
+
paymentLinkId?: string;
|
154
156
|
};
|
155
157
|
|
156
158
|
/**
|
@@ -347,6 +349,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
347
349
|
<OnRampScreen
|
348
350
|
title={props.title}
|
349
351
|
transactionMode={payOptions.mode === "transaction"}
|
352
|
+
paymentLinkId={props.paymentLinkId}
|
350
353
|
quote={screen.quote}
|
351
354
|
onBack={() => {
|
352
355
|
setScreen({
|
@@ -395,6 +398,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
395
398
|
});
|
396
399
|
}}
|
397
400
|
onSuccess={onSwapSuccess}
|
401
|
+
paymentLinkId={props.paymentLinkId}
|
398
402
|
/>
|
399
403
|
);
|
400
404
|
}
|
@@ -530,6 +534,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
530
534
|
{screen.id === "buy-with-crypto" && activeAccount && (
|
531
535
|
<SwapScreenContent
|
532
536
|
setScreen={setScreen}
|
537
|
+
paymentLinkId={props.paymentLinkId}
|
533
538
|
tokenAmount={deferredTokenAmount}
|
534
539
|
toChain={toChain}
|
535
540
|
toToken={toToken}
|
@@ -585,6 +590,7 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
585
590
|
payer={payer}
|
586
591
|
setTokenAmount={setTokenAmount}
|
587
592
|
setHasEditedAmount={setHasEditedAmount}
|
593
|
+
paymentLinkId={props.paymentLinkId}
|
588
594
|
/>
|
589
595
|
)}
|
590
596
|
|
@@ -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,16 +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
|
-
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
9
6
|
import {
|
10
|
-
type
|
11
|
-
|
12
|
-
|
13
|
-
} 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";
|
14
11
|
import type { PayUIOptions } from "../../../../../../core/hooks/connection/ConnectButtonProps.js";
|
15
12
|
import { useBuyWithFiatQuote } from "../../../../../../core/hooks/pay/useBuyWithFiatQuote.js";
|
16
13
|
import { PREFERRED_FIAT_PROVIDER_STORAGE_KEY } from "../../../../../../core/utils/storage.js";
|
@@ -25,9 +22,9 @@ import { Spinner } from "../../../../components/Spinner.js";
|
|
25
22
|
import { Container } from "../../../../components/basic.js";
|
26
23
|
import { Button } from "../../../../components/buttons.js";
|
27
24
|
import { Text } from "../../../../components/text.js";
|
28
|
-
import { TokenSymbol } from "../../../../components/token/TokenSymbol.js";
|
29
25
|
import { type ERC20OrNativeToken, isNativeToken } from "../../nativeToken.js";
|
30
26
|
import { EstimatedTimeAndFees } from "../EstimatedTimeAndFees.js";
|
27
|
+
import { PayProviderSelection } from "../PayProviderSelection.js";
|
31
28
|
import { PayWithCreditCard } from "../PayWIthCreditCard.js";
|
32
29
|
import type { SelectedScreen } from "../main/types.js";
|
33
30
|
import { FiatFees } from "../swap/Fees.js";
|
@@ -50,6 +47,7 @@ export function FiatScreenContent(props: {
|
|
50
47
|
payer: PayerInfo;
|
51
48
|
setTokenAmount: (amount: string) => void;
|
52
49
|
setHasEditedAmount: (hasEdited: boolean) => void;
|
50
|
+
paymentLinkId: undefined | string;
|
53
51
|
}) {
|
54
52
|
const {
|
55
53
|
toToken,
|
@@ -60,6 +58,7 @@ export function FiatScreenContent(props: {
|
|
60
58
|
toChain,
|
61
59
|
showCurrencySelector,
|
62
60
|
selectedCurrency,
|
61
|
+
paymentLinkId,
|
63
62
|
} = props;
|
64
63
|
const defaultRecipientAddress = (
|
65
64
|
props.payOptions as Extract<PayUIOptions, { mode: "direct_payment" }>
|
@@ -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,7 +110,8 @@ export function FiatScreenContent(props: {
|
|
98
110
|
isTestMode: buyWithFiatOptions?.testMode,
|
99
111
|
purchaseData: props.payOptions.purchaseData,
|
100
112
|
fromAddress: payer.account.address,
|
101
|
-
|
113
|
+
paymentLinkId: paymentLinkId,
|
114
|
+
preferredProvider: preferredProvider ?? supportedProviders[0],
|
102
115
|
}
|
103
116
|
: undefined,
|
104
117
|
);
|
@@ -158,6 +171,7 @@ export function FiatScreenContent(props: {
|
|
158
171
|
</Text>
|
159
172
|
<Spacer y="lg" />
|
160
173
|
<Providers
|
174
|
+
supportedProviders={supportedProviders}
|
161
175
|
preferredProvider={
|
162
176
|
preferredProvider || fiatQuoteQuery.data?.provider
|
163
177
|
}
|
@@ -187,35 +201,13 @@ export function FiatScreenContent(props: {
|
|
187
201
|
currency={selectedCurrency}
|
188
202
|
onSelectCurrency={showCurrencySelector}
|
189
203
|
/>
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
alignItems: "center",
|
198
|
-
borderWidth: "1px",
|
199
|
-
borderStyle: "solid",
|
200
|
-
borderBottom: "none",
|
201
|
-
}}
|
202
|
-
>
|
203
|
-
<Text size="xs" color="secondaryText">
|
204
|
-
Provider
|
205
|
-
</Text>
|
206
|
-
<Button variant="ghost" onClick={showProviders}>
|
207
|
-
<Container flex="row" center="y" gap="xxs" color="secondaryText">
|
208
|
-
<Text size="xs">
|
209
|
-
{preferredProvider
|
210
|
-
? `${preferredProvider.charAt(0).toUpperCase() + preferredProvider.slice(1).toLowerCase()}`
|
211
|
-
: fiatQuoteQuery.data?.provider
|
212
|
-
? `${fiatQuoteQuery.data?.provider.charAt(0).toUpperCase() + fiatQuoteQuery.data?.provider.slice(1).toLowerCase()}`
|
213
|
-
: ""}
|
214
|
-
</Text>
|
215
|
-
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
216
|
-
</Container>
|
217
|
-
</Button>
|
218
|
-
</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
|
+
/>
|
219
211
|
{/* Estimated time + View fees button */}
|
220
212
|
<EstimatedTimeAndFees
|
221
213
|
quoteIsLoading={fiatQuoteQuery.isLoading}
|
@@ -227,77 +219,43 @@ export function FiatScreenContent(props: {
|
|
227
219
|
{/* Error message */}
|
228
220
|
{errorMsg && (
|
229
221
|
<div>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
chain={toChain}
|
237
|
-
size="sm"
|
238
|
-
inline
|
239
|
-
color="danger"
|
240
|
-
/>
|
241
|
-
</Text>
|
242
|
-
) : (
|
243
|
-
<div>
|
244
|
-
<Text color="danger" size="xs" center multiline>
|
245
|
-
{errorMsg.title}
|
246
|
-
</Text>
|
247
|
-
<Text size="xs" center multiline>
|
248
|
-
{errorMsg.message}
|
249
|
-
</Text>
|
250
|
-
</div>
|
251
|
-
)}
|
222
|
+
<Text color="danger" size="xs" center multiline>
|
223
|
+
{errorMsg.title}
|
224
|
+
</Text>
|
225
|
+
<Text size="xs" center multiline>
|
226
|
+
{errorMsg.message}
|
227
|
+
</Text>
|
252
228
|
</div>
|
253
229
|
)}
|
254
230
|
</Container>
|
255
231
|
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
walletType: payer.wallet.id,
|
284
|
-
toChainId: toChain.id,
|
285
|
-
toToken: isNativeToken(toToken) ? undefined : toToken.address,
|
286
|
-
});
|
287
|
-
handleSubmit();
|
288
|
-
}}
|
289
|
-
gap="xs"
|
290
|
-
>
|
291
|
-
{fiatQuoteQuery.isLoading ? (
|
292
|
-
<>
|
293
|
-
Getting price quote
|
294
|
-
<Spinner size="sm" color="accentButtonText" />
|
295
|
-
</>
|
296
|
-
) : (
|
297
|
-
"Continue"
|
298
|
-
)}
|
299
|
-
</Button>
|
300
|
-
)}
|
232
|
+
<Button
|
233
|
+
variant={disableSubmit ? "outline" : "accent"}
|
234
|
+
data-disabled={disableSubmit}
|
235
|
+
disabled={disableSubmit}
|
236
|
+
fullWidth
|
237
|
+
onClick={() => {
|
238
|
+
trackPayEvent({
|
239
|
+
event: "confirm_onramp_quote",
|
240
|
+
client: client,
|
241
|
+
walletAddress: payer.account.address,
|
242
|
+
walletType: payer.wallet.id,
|
243
|
+
toChainId: toChain.id,
|
244
|
+
toToken: isNativeToken(toToken) ? undefined : toToken.address,
|
245
|
+
});
|
246
|
+
handleSubmit();
|
247
|
+
}}
|
248
|
+
gap="xs"
|
249
|
+
>
|
250
|
+
{fiatQuoteQuery.isLoading ? (
|
251
|
+
<>
|
252
|
+
Getting price quote
|
253
|
+
<Spinner size="sm" color="accentButtonText" />
|
254
|
+
</>
|
255
|
+
) : (
|
256
|
+
"Continue"
|
257
|
+
)}
|
258
|
+
</Button>
|
301
259
|
</Container>
|
302
260
|
);
|
303
261
|
}
|
@@ -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 = {
|
@@ -71,6 +72,7 @@ export function OnRampScreen(props: {
|
|
71
72
|
payer: PayerInfo;
|
72
73
|
onSuccess: (status: BuyWithFiatStatus) => void;
|
73
74
|
receiverAddress: string;
|
75
|
+
paymentLinkId?: string;
|
74
76
|
}) {
|
75
77
|
const connectedWallets = useConnectedWallets();
|
76
78
|
const isAutoMode = isInAppSigner({
|
@@ -85,6 +87,7 @@ export function OnRampScreen(props: {
|
|
85
87
|
payer: props.payer,
|
86
88
|
theme: props.theme,
|
87
89
|
isAutoMode,
|
90
|
+
paymentLinkId: props.paymentLinkId,
|
88
91
|
});
|
89
92
|
const firstStepChainId = state.steps[0]?.step.token.chainId;
|
90
93
|
return (
|
@@ -211,7 +214,7 @@ function StepUI(props: {
|
|
211
214
|
/>
|
212
215
|
<Container flex="column" gap="3xs" center="y" style={{ flex: "1" }}>
|
213
216
|
<Text size="sm" color="primaryText">
|
214
|
-
{
|
217
|
+
{getProviderLabel(step.action)}
|
215
218
|
</Text>
|
216
219
|
|
217
220
|
<Container
|
@@ -288,6 +291,7 @@ function useOnRampScreenState(props: {
|
|
288
291
|
payer: PayerInfo;
|
289
292
|
theme: "light" | "dark";
|
290
293
|
isAutoMode?: boolean;
|
294
|
+
paymentLinkId?: string;
|
291
295
|
}): OnRampScreenState {
|
292
296
|
const onRampSteps = getOnRampSteps(props.quote);
|
293
297
|
const [currentStepIndex, setCurrentStepIndex] = useState(0);
|
@@ -322,6 +326,7 @@ function useOnRampScreenState(props: {
|
|
322
326
|
client: props.client,
|
323
327
|
payer: props.payer,
|
324
328
|
isFiatFlow: true,
|
329
|
+
paymentLinkId: props.paymentLinkId,
|
325
330
|
});
|
326
331
|
|
327
332
|
// Track swap status
|
@@ -615,6 +620,7 @@ function useSwapMutation(props: {
|
|
615
620
|
client: ThirdwebClient;
|
616
621
|
payer: PayerInfo;
|
617
622
|
isFiatFlow: boolean;
|
623
|
+
paymentLinkId?: string;
|
618
624
|
}) {
|
619
625
|
const queryClient = useQueryClient();
|
620
626
|
return useMutation({
|
@@ -646,6 +652,7 @@ function useSwapMutation(props: {
|
|
646
652
|
toTokenAddress: toToken.tokenAddress,
|
647
653
|
fromAddress: account.address,
|
648
654
|
toAddress: account.address,
|
655
|
+
paymentLinkId: props.paymentLinkId,
|
649
656
|
client: props.client,
|
650
657
|
});
|
651
658
|
|