thirdweb 5.88.7 → 5.88.8-nightly-1fa36c1d56758788a8f9053f8929497bacb2b115-20250225000329
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/contract/deployment/utils/create-2-factory.js +4 -0
- package/dist/cjs/contract/deployment/utils/create-2-factory.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/pay/buyWithFiat/isSwapRequiredPostOnramp.js +44 -0
- package/dist/cjs/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/cjs/pay/convert/type.js +30 -1
- package/dist/cjs/pay/convert/type.js.map +1 -1
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -0
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js +18 -2
- package/dist/cjs/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/cjs/react/core/providers/invalidateWalletBalance.js +6 -1
- package/dist/cjs/react/core/providers/invalidateWalletBalance.js.map +1 -1
- package/dist/cjs/react/core/utils/account.js +2 -7
- package/dist/cjs/react/core/utils/account.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/currencies/JPYIcon.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/icons/currencies/JPYIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +5 -3
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -13
- 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/FiatSteps.js +6 -26
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +541 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +23 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +8 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +21 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -0
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +4 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +2 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/rpc/rpc.js +1 -1
- package/dist/cjs/storage/upload/mobile.js +1 -1
- package/dist/cjs/storage/upload/mobile.js.map +1 -1
- package/dist/cjs/storage/upload/web-node.js +1 -0
- package/dist/cjs/storage/upload/web-node.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/web/ecosystem.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js +1 -1
- package/dist/cjs/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/esm/contract/deployment/utils/create-2-factory.js +4 -0
- package/dist/esm/contract/deployment/utils/create-2-factory.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/pay/buyWithFiat/isSwapRequiredPostOnramp.js +43 -0
- package/dist/esm/pay/buyWithFiat/isSwapRequiredPostOnramp.js.map +1 -1
- package/dist/esm/pay/convert/type.js +29 -2
- package/dist/esm/pay/convert/type.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -0
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/wallets/useSendToken.js +19 -3
- package/dist/esm/react/core/hooks/wallets/useSendToken.js.map +1 -1
- package/dist/esm/react/core/providers/invalidateWalletBalance.js +6 -1
- package/dist/esm/react/core/providers/invalidateWalletBalance.js.map +1 -1
- package/dist/esm/react/core/utils/account.js +1 -6
- package/dist/esm/react/core/utils/account.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/NetworkSelector.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/currencies/JPYIcon.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/icons/currencies/JPYIcon.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +5 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js +3 -3
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.js +0 -13
- 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/FiatSteps.js +7 -27
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +2 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +538 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js +22 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js +8 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js +18 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.js.map +1 -0
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js +5 -10
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +2 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/rpc/rpc.js +1 -1
- package/dist/esm/storage/upload/mobile.js +1 -1
- package/dist/esm/storage/upload/mobile.js.map +1 -1
- package/dist/esm/storage/upload/web-node.js +1 -0
- package/dist/esm/storage/upload/web-node.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/web/ecosystem.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js +1 -1
- package/dist/esm/wallets/in-app/web/lib/iframe-wallet.js.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts +8 -32
- package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts +7 -0
- package/dist/types/pay/buyWithFiat/isSwapRequiredPostOnramp.d.ts.map +1 -1
- package/dist/types/pay/convert/type.d.ts +2 -1
- package/dist/types/pay/convert/type.d.ts.map +1 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts +2 -1
- package/dist/types/react/core/hooks/connection/ConnectButtonProps.d.ts.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts +2 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts +6 -1
- package/dist/types/react/core/hooks/wallets/useSendToken.d.ts.map +1 -1
- package/dist/types/react/core/providers/invalidateWalletBalance.d.ts +1 -1
- package/dist/types/react/core/providers/invalidateWalletBalance.d.ts.map +1 -1
- package/dist/types/react/core/utils/account.d.ts +1 -1
- package/dist/types/react/core/utils/account.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/fiat/CurrencySelection.d.ts.map +1 -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/FiatSteps.d.ts +7 -2
- 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/{FiatFlow.d.ts → OnRampScreen.d.ts} +4 -4
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts +6 -2
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts +4 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.d.ts.map +1 -0
- 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/WalletRow.d.ts +1 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/MediaRenderer/MediaRenderer.d.ts +2 -2
- package/dist/types/react/web/ui/MediaRenderer/ModelViewer.d.ts +1 -1
- package/dist/types/storage/upload/web-node.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/in-app/web/ecosystem.d.ts +1 -1
- package/package.json +1 -1
- package/src/contract/deployment/utils/create-2-factory.ts +4 -0
- package/src/pay/buyWithFiat/getQuote.ts +9 -33
- package/src/pay/buyWithFiat/isSwapRequiredPostOnramp.ts +56 -0
- package/src/pay/convert/type.ts +30 -1
- package/src/react/core/hooks/connection/ConnectButtonProps.ts +2 -1
- package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +3 -1
- package/src/react/core/hooks/wallets/useSendToken.ts +19 -3
- package/src/react/core/providers/invalidateWalletBalance.ts +6 -1
- package/src/react/core/utils/account.ts +4 -8
- package/src/react/web/ui/ConnectWallet/NetworkSelector.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/icons/currencies/JPYIcon.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +7 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/PayWIthCreditCard.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/CurrencySelection.tsx +3 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatScreenContent.tsx +0 -19
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +9 -32
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +2 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +790 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx +38 -2
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useUISelectionStates.ts +10 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx +55 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx +18 -41
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +10 -1
- package/src/rpc/rpc.ts +1 -1
- package/src/storage/upload/mobile.ts +1 -1
- package/src/storage/upload/web-node.ts +1 -0
- package/src/version.ts +1 -1
- package/src/wallets/in-app/web/ecosystem.ts +1 -1
- package/src/wallets/in-app/web/lib/iframe-wallet.ts +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +0 -63
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +0 -116
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +0 -60
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js +0 -113
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.js.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts +0 -24
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +0 -152
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatStatusScreen.tsx +0 -258
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FiatSteps.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FiatSteps.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAwB3F,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,mCAAmC,CAAC;AAG3C,MAAM,MAAM,uBAAuB,GAAG;IACpC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE;QACX,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,uBAAuB,CAAC;IACtC,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,8CAyUA;AAyHD,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,KAAK,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,8CAqEA"}
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/{FiatFlow.d.ts → OnRampScreen.d.ts}
RENAMED
|
@@ -2,18 +2,18 @@ import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
|
|
2
2
|
import type { BuyWithFiatQuote } from "../../../../../../../pay/buyWithFiat/getQuote.js";
|
|
3
3
|
import { type BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
|
4
4
|
import type { PayerInfo } from "../types.js";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function OnRampScreen(props: {
|
|
6
6
|
title: string;
|
|
7
7
|
quote: BuyWithFiatQuote;
|
|
8
8
|
onBack: () => void;
|
|
9
9
|
client: ThirdwebClient;
|
|
10
10
|
testMode: boolean;
|
|
11
11
|
theme: "light" | "dark";
|
|
12
|
-
openedWindow: Window | null;
|
|
13
12
|
onDone: () => void;
|
|
14
13
|
transactionMode: boolean;
|
|
15
14
|
isEmbed: boolean;
|
|
16
15
|
payer: PayerInfo;
|
|
17
16
|
onSuccess: (status: BuyWithFiatStatus) => void;
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
receiverAddress: string;
|
|
18
|
+
}): import("react/jsx-runtime.js").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=OnRampScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OnRampScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAM5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mDAAmD,CAAC;AAkC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAe7C,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,eAAe,EAAE,MAAM,CAAC;CACzB,8CAiHA"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import type { SupportedFiatCurrency } from "../../../../../../../pay/convert/type.js";
|
|
2
|
+
import { iconSize } from "../../../../../../core/design-system/index.js";
|
|
1
3
|
import type { IconFC } from "../../../icons/types.js";
|
|
2
4
|
export type CurrencyMeta = {
|
|
3
|
-
shorthand:
|
|
5
|
+
shorthand: SupportedFiatCurrency;
|
|
6
|
+
countryCode: string;
|
|
4
7
|
name: string;
|
|
5
8
|
symbol: string;
|
|
6
|
-
icon
|
|
9
|
+
icon?: IconFC;
|
|
7
10
|
};
|
|
8
11
|
export declare const usdCurrency: CurrencyMeta;
|
|
9
12
|
export declare const currencies: CurrencyMeta[];
|
|
10
13
|
export declare function getCurrencyMeta(shorthand: string): CurrencyMeta;
|
|
14
|
+
export declare function getFiatIcon(currency: CurrencyMeta, size: keyof typeof iconSize): React.ReactNode;
|
|
11
15
|
//# sourceMappingURL=currencies.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"currencies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAMzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,qBAAqB,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,YAMzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,YAAY,EA0CpC,CAAC;AAEF,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,CAc/D;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,MAAM,OAAO,QAAQ,GAC1B,KAAK,CAAC,SAAS,CAWjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAE/E,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,sBAAsB,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB;IACE,EAAE,EAAE,MAAM,GAAG,uBAAuB,GAAG,eAAe,CAAC;CACxD,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACD;IACE,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IACE,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wDAAwD,CAAC;AACrG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAE/E,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,sBAAsB,CAAC;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB;IACE,EAAE,EAAE,MAAM,GAAG,uBAAuB,GAAG,eAAe,CAAC;CACxD,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GACD;IACE,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,iBAAiB,CAAC;IACtB,UAAU,EAAE,cAAc,CAAC;CAC5B,GACD;IACE,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACD;IACE,EAAE,EAAE,WAAW,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;CACzB,GACD;IACE,EAAE,EAAE,eAAe,CAAC;CACrB,GACD;IACE,EAAE,EAAE,sBAAsB,CAAC;IAC3B,UAAU,EAAE,cAAc,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepConnector.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/StepConnector.tsx"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,MAAM,EAAE,OAAO,CAAC;CACjB,8CAiDA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwapSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SwapSummary.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/SwapSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAK5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI/D,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,8CA0FA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletRow.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAI5E,OAAO,EACL,QAAQ,EACR,QAAQ,EACT,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"WalletRow.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAI5E,OAAO,EACL,QAAQ,EACR,QAAQ,EACT,MAAM,+CAA+C,CAAC;AAavD,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,8CAoDA"}
|
|
@@ -42,11 +42,11 @@ export declare const MediaRenderer: React.ForwardRefExoticComponent<MediaRendere
|
|
|
42
42
|
/**
|
|
43
43
|
* @internal Exported for tests
|
|
44
44
|
*/
|
|
45
|
-
export declare const IframePlayer: React.ForwardRefExoticComponent<Omit<MediaRendererProps, "client" | "
|
|
45
|
+
export declare const IframePlayer: React.ForwardRefExoticComponent<Omit<MediaRendererProps, "client" | "width" | "height" | "children" | "controls" | "gatewayUrl" | "mimeType"> & React.RefAttributes<HTMLIFrameElement>>;
|
|
46
46
|
/**
|
|
47
47
|
* @internal Exported for tests
|
|
48
48
|
*/
|
|
49
|
-
export declare const LinkPlayer: React.ForwardRefExoticComponent<Pick<MediaRendererProps, "src" | "
|
|
49
|
+
export declare const LinkPlayer: React.ForwardRefExoticComponent<Pick<MediaRendererProps, "src" | "alt" | "style" | "className"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
50
50
|
/**
|
|
51
51
|
* @internal
|
|
52
52
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@google/model-viewer";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { MediaRendererProps } from "./types.js";
|
|
4
|
-
declare const ModelViewer: React.ForwardRefExoticComponent<Pick<MediaRendererProps, "src" | "
|
|
4
|
+
declare const ModelViewer: React.ForwardRefExoticComponent<Pick<MediaRendererProps, "src" | "alt" | "style" | "className" | "poster"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default ModelViewer;
|
|
6
6
|
//# sourceMappingURL=ModelViewer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-node.d.ts","sourceRoot":"","sources":["../../../../src/storage/upload/web-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAsB,WAAW,CAAC,KAAK,CAAC,MAAM,SAAS,cAAc,EAAE,EACrE,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"web-node.d.ts","sourceRoot":"","sources":["../../../../src/storage/upload/web-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEhE,wBAAsB,WAAW,CAAC,KAAK,CAAC,MAAM,SAAS,cAAc,EAAE,EACrE,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,QAAQ,EACd,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,qBA+ChC"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "5.88.
|
|
1
|
+
export declare const version = "5.88.8-nightly-1fa36c1d56758788a8f9053f8929497bacb2b115-20250225000329";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2EAA2E,CAAC"}
|
|
@@ -33,7 +33,7 @@ import type { CreateWalletArgs, EcosystemWalletId } from "../../wallet-types.js"
|
|
|
33
33
|
*
|
|
34
34
|
* ### Connect to a restricted ecosystem wallet with your designated partner ID
|
|
35
35
|
*
|
|
36
|
-
* The
|
|
36
|
+
* The partner ID will be provided to you by the ecosystem with which you're integrating.
|
|
37
37
|
*
|
|
38
38
|
* ```ts
|
|
39
39
|
* import { ecosystemWallet } from "thirdweb/wallets";
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ThirdwebClient } from "../../client/client.js";
|
|
2
|
+
import type { CurrencyMeta } from "../../react/web/ui/ConnectWallet/screens/Buy/fiat/currencies.js";
|
|
2
3
|
import { getClientFetch } from "../../utils/fetch.js";
|
|
3
4
|
import { stringify } from "../../utils/json.js";
|
|
4
|
-
import type { FiatProvider } from "../utils/commonTypes.js";
|
|
5
|
+
import type { FiatProvider, PayTokenInfo } from "../utils/commonTypes.js";
|
|
5
6
|
import { getPayBuyWithFiatQuoteEndpoint } from "../utils/definitions.js";
|
|
6
|
-
|
|
7
7
|
/**
|
|
8
8
|
* Parameters for [`getBuyWithFiatQuote`](https://portal.thirdweb.com/references/typescript/v5/getBuyWithFiatQuote) function
|
|
9
9
|
* @buyCrypto
|
|
@@ -40,7 +40,7 @@ export type GetBuyWithFiatQuoteParams = {
|
|
|
40
40
|
/**
|
|
41
41
|
* Symbol of the fiat currency to buy the token with.
|
|
42
42
|
*/
|
|
43
|
-
fromCurrencySymbol: "
|
|
43
|
+
fromCurrencySymbol: CurrencyMeta["shorthand"];
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* The maximum slippage in basis points (bps) allowed for the transaction.
|
|
@@ -150,14 +150,7 @@ export type BuyWithFiatQuote = {
|
|
|
150
150
|
/**
|
|
151
151
|
* Token information for the desired token. (token the user wants to buy)
|
|
152
152
|
*/
|
|
153
|
-
toToken:
|
|
154
|
-
symbol?: string | undefined;
|
|
155
|
-
priceUSDCents?: number | undefined;
|
|
156
|
-
name?: string | undefined;
|
|
157
|
-
chainId: number;
|
|
158
|
-
tokenAddress: string;
|
|
159
|
-
decimals: number;
|
|
160
|
-
};
|
|
153
|
+
toToken: PayTokenInfo;
|
|
161
154
|
/**
|
|
162
155
|
* Address of the wallet to which the tokens will be sent.
|
|
163
156
|
*/
|
|
@@ -196,35 +189,17 @@ export type BuyWithFiatQuote = {
|
|
|
196
189
|
amount: string;
|
|
197
190
|
amountWei: string;
|
|
198
191
|
amountUSDCents: number;
|
|
199
|
-
token:
|
|
200
|
-
chainId: number;
|
|
201
|
-
decimals: number;
|
|
202
|
-
name: string;
|
|
203
|
-
priceUSDCents: number;
|
|
204
|
-
symbol: string;
|
|
205
|
-
tokenAddress: string;
|
|
206
|
-
};
|
|
192
|
+
token: PayTokenInfo;
|
|
207
193
|
};
|
|
208
194
|
|
|
209
195
|
/**
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* Only used for ERC20 + Gas on-ramp flow. This will hold the details of the gas token and amount sent for gas.
|
|
213
|
-
*
|
|
214
|
-
* In Native Currency case, extra for gas will be added to the output amount of the onramp.
|
|
196
|
+
* Routing token that will be swapped from the on-ramp token, so that it can be bridged to the destination token.
|
|
215
197
|
*/
|
|
216
|
-
|
|
198
|
+
routingToken?: {
|
|
217
199
|
amount: string;
|
|
218
200
|
amountWei: string;
|
|
219
201
|
amountUSDCents: number;
|
|
220
|
-
token:
|
|
221
|
-
chainId: number;
|
|
222
|
-
decimals: number;
|
|
223
|
-
name: string;
|
|
224
|
-
priceUSDCents: number;
|
|
225
|
-
symbol: string;
|
|
226
|
-
tokenAddress: string;
|
|
227
|
-
};
|
|
202
|
+
token: PayTokenInfo;
|
|
228
203
|
};
|
|
229
204
|
|
|
230
205
|
/**
|
|
@@ -318,6 +293,7 @@ export async function getBuyWithFiatQuote(
|
|
|
318
293
|
fromAddress: params.fromAddress,
|
|
319
294
|
toGasAmountWei: params.toGasAmountWei,
|
|
320
295
|
preferredProvider: params.preferredProvider,
|
|
296
|
+
multiHopSupported: true,
|
|
321
297
|
}),
|
|
322
298
|
});
|
|
323
299
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getAddress } from "../../utils/address.js";
|
|
2
|
+
import type { PayTokenInfo } from "../utils/commonTypes.js";
|
|
2
3
|
import type { BuyWithFiatQuote } from "./getQuote.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -26,3 +27,58 @@ export function isSwapRequiredPostOnramp(
|
|
|
26
27
|
|
|
27
28
|
return !(sameChain && sameToken);
|
|
28
29
|
}
|
|
30
|
+
|
|
31
|
+
export function getOnRampSteps(
|
|
32
|
+
buyWithFiatQuote: BuyWithFiatQuote,
|
|
33
|
+
): OnRampStep[] {
|
|
34
|
+
const isSwapRequired = isSwapRequiredPostOnramp(buyWithFiatQuote);
|
|
35
|
+
|
|
36
|
+
if (!isSwapRequired) {
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
action: "buy",
|
|
40
|
+
token: buyWithFiatQuote.toToken,
|
|
41
|
+
amount: buyWithFiatQuote.estimatedToAmountMin,
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (buyWithFiatQuote.routingToken) {
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
action: "buy",
|
|
50
|
+
token: buyWithFiatQuote.onRampToken.token,
|
|
51
|
+
amount: buyWithFiatQuote.onRampToken.amount,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
action: "swap",
|
|
55
|
+
token: buyWithFiatQuote.routingToken.token,
|
|
56
|
+
amount: buyWithFiatQuote.routingToken.amount,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
action: "bridge",
|
|
60
|
+
token: buyWithFiatQuote.toToken,
|
|
61
|
+
amount: buyWithFiatQuote.estimatedToAmountMin,
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return [
|
|
67
|
+
{
|
|
68
|
+
action: "buy",
|
|
69
|
+
token: buyWithFiatQuote.onRampToken.token,
|
|
70
|
+
amount: buyWithFiatQuote.onRampToken.amount,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
action: "swap",
|
|
74
|
+
token: buyWithFiatQuote.toToken,
|
|
75
|
+
amount: buyWithFiatQuote.estimatedToAmountMin,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type OnRampStep = {
|
|
81
|
+
action: "buy" | "swap" | "bridge";
|
|
82
|
+
token: PayTokenInfo;
|
|
83
|
+
amount: string;
|
|
84
|
+
};
|
package/src/pay/convert/type.ts
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
const SUPPORTED_FIAT_CURRENCIES = [
|
|
1
|
+
const SUPPORTED_FIAT_CURRENCIES = [
|
|
2
|
+
"USD",
|
|
3
|
+
"CAD",
|
|
4
|
+
"GBP",
|
|
5
|
+
"EUR",
|
|
6
|
+
"JPY",
|
|
7
|
+
"AUD",
|
|
8
|
+
"NZD",
|
|
9
|
+
] as const;
|
|
2
10
|
/**
|
|
3
11
|
* @internal
|
|
4
12
|
*/
|
|
5
13
|
export type SupportedFiatCurrency = (typeof SUPPORTED_FIAT_CURRENCIES)[number];
|
|
14
|
+
|
|
15
|
+
export function getFiatSymbol(showBalanceInFiat: SupportedFiatCurrency) {
|
|
16
|
+
switch (showBalanceInFiat) {
|
|
17
|
+
case "USD":
|
|
18
|
+
return "$";
|
|
19
|
+
case "CAD":
|
|
20
|
+
return "$";
|
|
21
|
+
case "GBP":
|
|
22
|
+
return "£";
|
|
23
|
+
case "EUR":
|
|
24
|
+
return "€";
|
|
25
|
+
case "JPY":
|
|
26
|
+
return "¥";
|
|
27
|
+
case "AUD":
|
|
28
|
+
return "$";
|
|
29
|
+
case "NZD":
|
|
30
|
+
return "$";
|
|
31
|
+
default:
|
|
32
|
+
return "$";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -14,6 +14,7 @@ import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
|
|
|
14
14
|
import type { AppMetadata } from "../../../../wallets/types.js";
|
|
15
15
|
import type { WalletId } from "../../../../wallets/wallet-types.js";
|
|
16
16
|
import type { NetworkSelectorProps } from "../../../web/ui/ConnectWallet/NetworkSelector.js";
|
|
17
|
+
import type { CurrencyMeta } from "../../../web/ui/ConnectWallet/screens/Buy/fiat/currencies.js";
|
|
17
18
|
import type { WelcomeScreen } from "../../../web/ui/ConnectWallet/screens/types.js";
|
|
18
19
|
import type { LocaleId } from "../../../web/ui/types.js";
|
|
19
20
|
import type { Theme } from "../../design-system/index.js";
|
|
@@ -90,7 +91,7 @@ export type PayUIOptions = Prettify<
|
|
|
90
91
|
| {
|
|
91
92
|
testMode?: boolean;
|
|
92
93
|
prefillSource?: {
|
|
93
|
-
currency?: "
|
|
94
|
+
currency?: CurrencyMeta["shorthand"];
|
|
94
95
|
};
|
|
95
96
|
preferredProvider?: FiatProvider;
|
|
96
97
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
type GetBuyWithFiatStatusParams,
|
|
5
5
|
getBuyWithFiatStatus,
|
|
6
6
|
} from "../../../../pay/buyWithFiat/getStatus.js";
|
|
7
|
+
import type { WithPickedOnceQueryOptions } from "../types.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending.
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
* @buyCrypto
|
|
35
36
|
*/
|
|
36
37
|
export function useBuyWithFiatStatus(
|
|
37
|
-
params?: GetBuyWithFiatStatusParams
|
|
38
|
+
params?: WithPickedOnceQueryOptions<GetBuyWithFiatStatusParams>,
|
|
38
39
|
): UseQueryResult<BuyWithFiatStatus> {
|
|
39
40
|
return useQuery({
|
|
40
41
|
queryKey: ["useBuyWithFiatStatus", params],
|
|
@@ -64,5 +65,6 @@ export function useBuyWithFiatStatus(
|
|
|
64
65
|
},
|
|
65
66
|
refetchIntervalInBackground: true,
|
|
66
67
|
retry: true,
|
|
68
|
+
...params?.queryOptions,
|
|
67
69
|
});
|
|
68
70
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { useMutation } from "@tanstack/react-query";
|
|
1
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
2
2
|
import type { ThirdwebClient } from "../../../../client/client.js";
|
|
3
3
|
import { getContract } from "../../../../contract/contract.js";
|
|
4
4
|
import { resolveAddress } from "../../../../extensions/ens/resolve-address.js";
|
|
5
5
|
import { transfer } from "../../../../extensions/erc20/write/transfer.js";
|
|
6
6
|
import { sendTransaction } from "../../../../transaction/actions/send-transaction.js";
|
|
7
|
+
import { waitForReceipt } from "../../../../transaction/actions/wait-for-tx-receipt.js";
|
|
7
8
|
import { prepareTransaction } from "../../../../transaction/prepare-transaction.js";
|
|
8
9
|
import { isAddress } from "../../../../utils/address.js";
|
|
9
10
|
import { isValidENSName } from "../../../../utils/ens/isValidENSName.js";
|
|
10
11
|
import { toWei } from "../../../../utils/units.js";
|
|
12
|
+
import { invalidateWalletBalance } from "../../providers/invalidateWalletBalance.js";
|
|
11
13
|
import { useActiveWallet } from "./useActiveWallet.js";
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -33,6 +35,7 @@ import { useActiveWallet } from "./useActiveWallet.js";
|
|
|
33
35
|
*/
|
|
34
36
|
export function useSendToken(client: ThirdwebClient) {
|
|
35
37
|
const wallet = useActiveWallet();
|
|
38
|
+
const queryClient = useQueryClient();
|
|
36
39
|
return useMutation({
|
|
37
40
|
async mutationFn(option: {
|
|
38
41
|
tokenAddress?: string;
|
|
@@ -83,7 +86,7 @@ export function useSendToken(client: ThirdwebClient) {
|
|
|
83
86
|
value: toWei(amount),
|
|
84
87
|
});
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
return sendTransaction({
|
|
87
90
|
transaction: sendNativeTokenTx,
|
|
88
91
|
account,
|
|
89
92
|
});
|
|
@@ -103,11 +106,24 @@ export function useSendToken(client: ThirdwebClient) {
|
|
|
103
106
|
to,
|
|
104
107
|
});
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
return sendTransaction({
|
|
107
110
|
transaction: tx,
|
|
108
111
|
account,
|
|
109
112
|
});
|
|
110
113
|
}
|
|
111
114
|
},
|
|
115
|
+
onSettled: async (data, error) => {
|
|
116
|
+
if (error) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (data?.transactionHash) {
|
|
120
|
+
await waitForReceipt({
|
|
121
|
+
transactionHash: data.transactionHash,
|
|
122
|
+
client,
|
|
123
|
+
chain: data.chain,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
invalidateWalletBalance(queryClient);
|
|
127
|
+
},
|
|
112
128
|
});
|
|
113
129
|
}
|
|
@@ -4,9 +4,14 @@ export function invalidateWalletBalance(
|
|
|
4
4
|
queryClient: QueryClient,
|
|
5
5
|
chainId?: number,
|
|
6
6
|
) {
|
|
7
|
-
|
|
7
|
+
queryClient.invalidateQueries({
|
|
8
8
|
// invalidate any walletBalance queries for this chainId
|
|
9
9
|
// TODO: add wallet address in here if we can get it somehow
|
|
10
10
|
queryKey: chainId ? ["walletBalance", chainId] : ["walletBalance"],
|
|
11
11
|
});
|
|
12
|
+
queryClient.invalidateQueries({
|
|
13
|
+
queryKey: chainId
|
|
14
|
+
? ["internal_account_balance", chainId]
|
|
15
|
+
: ["internal_account_balance"],
|
|
16
|
+
});
|
|
12
17
|
}
|
|
@@ -2,7 +2,10 @@ import type { Chain } from "../../../chains/types.js";
|
|
|
2
2
|
import type { ThirdwebClient } from "../../../client/client.js";
|
|
3
3
|
import { NATIVE_TOKEN_ADDRESS } from "../../../constants/addresses.js";
|
|
4
4
|
import { convertCryptoToFiat } from "../../../pay/convert/cryptoToFiat.js";
|
|
5
|
-
import
|
|
5
|
+
import {
|
|
6
|
+
type SupportedFiatCurrency,
|
|
7
|
+
getFiatSymbol,
|
|
8
|
+
} from "../../../pay/convert/type.js";
|
|
6
9
|
import { type Address, isAddress } from "../../../utils/address.js";
|
|
7
10
|
import { formatNumber } from "../../../utils/formatNumber.js";
|
|
8
11
|
import { shortenLargeNumber } from "../../../utils/shortenLargeNumber.js";
|
|
@@ -112,13 +115,6 @@ export async function loadAccountBalance(props: {
|
|
|
112
115
|
};
|
|
113
116
|
}
|
|
114
117
|
|
|
115
|
-
function getFiatSymbol(showBalanceInFiat: SupportedFiatCurrency) {
|
|
116
|
-
switch (showBalanceInFiat) {
|
|
117
|
-
case "USD":
|
|
118
|
-
return "$";
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
118
|
/**
|
|
123
119
|
* Format the display balance for both crypto and fiat, in the Details button and Modal
|
|
124
120
|
* If both crypto balance and fiat balance exist, we have to keep the string very short to avoid UI issues.
|
|
@@ -704,7 +704,7 @@ export const ChainButton = /* @__PURE__ */ memo(function ChainButton(props: {
|
|
|
704
704
|
{confirming && (
|
|
705
705
|
<>
|
|
706
706
|
<Text size="xs" color="accentText">
|
|
707
|
-
{locale.
|
|
707
|
+
{locale.switchingNetwork}
|
|
708
708
|
</Text>
|
|
709
709
|
<Spinner size="xs" color="accentText" />
|
|
710
710
|
</>
|
|
@@ -9,7 +9,7 @@ export const JPYIcon: IconFC = (props) => {
|
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
10
|
role="presentation"
|
|
11
11
|
>
|
|
12
|
-
<g fill="none"
|
|
12
|
+
<g fill="none" fillRule="evenodd">
|
|
13
13
|
<circle cx="16" cy="16" fill="#a81b1b" r="16" />
|
|
14
14
|
<path
|
|
15
15
|
d="M17.548 18.711v1.878h5.063v2.288h-5.063V25.5h-3.096v-2.623H9.389v-2.288h5.063v-1.878H9.389v-2.288h4.171L7.5 7.5h3.752l4.8 7.534L20.853 7.5H24.5l-6.086 8.923h4.197v2.288z"
|
|
@@ -39,8 +39,8 @@ import { DirectPaymentModeScreen } from "./DirectPaymentModeScreen.js";
|
|
|
39
39
|
import { PayTokenIcon } from "./PayTokenIcon.js";
|
|
40
40
|
import { TransactionModeScreen } from "./TransactionModeScreen.js";
|
|
41
41
|
import { CurrencySelection } from "./fiat/CurrencySelection.js";
|
|
42
|
-
import { FiatFlow } from "./fiat/FiatFlow.js";
|
|
43
42
|
import { FiatScreenContent } from "./fiat/FiatScreenContent.js";
|
|
43
|
+
import { OnRampScreen } from "./fiat/OnRampScreen.js";
|
|
44
44
|
import type { SelectedScreen } from "./main/types.js";
|
|
45
45
|
import {
|
|
46
46
|
type PaymentMethods,
|
|
@@ -312,8 +312,12 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
if (screen.id === "fiat-flow" && payer) {
|
|
315
|
+
const defaultRecipientAddress = (
|
|
316
|
+
props.payOptions as Extract<PayUIOptions, { mode: "direct_payment" }>
|
|
317
|
+
)?.paymentInfo?.sellerAddress;
|
|
318
|
+
const receiverAddress = defaultRecipientAddress || payer.account.address;
|
|
315
319
|
return (
|
|
316
|
-
<
|
|
320
|
+
<OnRampScreen
|
|
317
321
|
title={props.title}
|
|
318
322
|
transactionMode={payOptions.mode === "transaction"}
|
|
319
323
|
quote={screen.quote}
|
|
@@ -328,10 +332,10 @@ function BuyScreenContent(props: BuyScreenContentProps) {
|
|
|
328
332
|
props.payOptions.buyWithFiat?.testMode === true
|
|
329
333
|
}
|
|
330
334
|
theme={typeof props.theme === "string" ? props.theme : props.theme.type}
|
|
331
|
-
openedWindow={screen.openedWindow}
|
|
332
335
|
onDone={onDone}
|
|
333
336
|
isEmbed={props.isEmbed}
|
|
334
337
|
payer={payer}
|
|
338
|
+
receiverAddress={receiverAddress}
|
|
335
339
|
onSuccess={onFiatSuccess}
|
|
336
340
|
/>
|
|
337
341
|
);
|
|
@@ -12,7 +12,7 @@ import { Skeleton } from "../../../components/Skeleton.js";
|
|
|
12
12
|
import { Container } from "../../../components/basic.js";
|
|
13
13
|
import { Button } from "../../../components/buttons.js";
|
|
14
14
|
import { Text } from "../../../components/text.js";
|
|
15
|
-
import type
|
|
15
|
+
import { type CurrencyMeta, getFiatIcon } from "./fiat/currencies.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Shows an amount "value" and renders the selected token and chain
|
|
@@ -55,7 +55,7 @@ export function PayWithCreditCard(props: {
|
|
|
55
55
|
}}
|
|
56
56
|
gap="sm"
|
|
57
57
|
>
|
|
58
|
-
|
|
58
|
+
{getFiatIcon(props.currency, "md")}
|
|
59
59
|
<Container flex="row" center="y" gap="xxs" color="secondaryText">
|
|
60
60
|
<Text color="primaryText">{props.currency.shorthand}</Text>
|
|
61
61
|
<ChevronDownIcon width={iconSize.sm} height={iconSize.sm} />
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { useCustomTheme } from "../../../../../../core/design-system/CustomThemeProvider.js";
|
|
3
|
-
import {
|
|
4
|
-
iconSize,
|
|
5
|
-
spacing,
|
|
6
|
-
} from "../../../../../../core/design-system/index.js";
|
|
3
|
+
import { spacing } from "../../../../../../core/design-system/index.js";
|
|
7
4
|
import { Spacer } from "../../../../components/Spacer.js";
|
|
8
5
|
import { Container, Line, ModalHeader } from "../../../../components/basic.js";
|
|
9
6
|
import { Button } from "../../../../components/buttons.js";
|
|
10
7
|
import { Text } from "../../../../components/text.js";
|
|
11
|
-
import { type CurrencyMeta, currencies } from "./currencies.js";
|
|
8
|
+
import { type CurrencyMeta, currencies, getFiatIcon } from "./currencies.js";
|
|
12
9
|
|
|
13
10
|
export function CurrencySelection(props: {
|
|
14
11
|
onSelect: (currency: CurrencyMeta) => void;
|
|
@@ -33,7 +30,7 @@ export function CurrencySelection(props: {
|
|
|
33
30
|
onClick={() => props.onSelect(c)}
|
|
34
31
|
gap="sm"
|
|
35
32
|
>
|
|
36
|
-
|
|
33
|
+
{getFiatIcon(c, "lg")}
|
|
37
34
|
<Container flex="column" gap="xxs">
|
|
38
35
|
<Text color="primaryText">{c.shorthand}</Text>
|
|
39
36
|
<Text size="sm">{c.name}</Text>
|