thirdweb 5.100.0-nightly-713ebe0a2d6d8a409e41ce0f0317fc34b1f221bb-20250520000414 → 5.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bridge/Buy.js +1 -1
- package/dist/cjs/bridge/Onramp.js +152 -0
- package/dist/cjs/bridge/Onramp.js.map +1 -0
- package/dist/cjs/bridge/OnrampStatus.js +78 -0
- package/dist/cjs/bridge/OnrampStatus.js.map +1 -0
- package/dist/cjs/bridge/Sell.js +1 -1
- package/dist/cjs/bridge/index.js +2 -1
- package/dist/cjs/bridge/index.js.map +1 -1
- package/dist/cjs/{react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js → bridge/types/BridgeAction.js} +1 -1
- package/dist/cjs/bridge/types/BridgeAction.js.map +1 -0
- package/dist/cjs/extensions/ens/resolve-l2-name.js +0 -2
- package/dist/cjs/extensions/ens/resolve-l2-name.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getQuote.js +129 -33
- package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithFiat/getStatus.js +71 -20
- package/dist/cjs/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/cjs/pay/utils/commonTypes.js +1 -1
- package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
- package/dist/cjs/pay/utils/definitions.js +1 -13
- package/dist/cjs/pay/utils/definitions.js.map +1 -1
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
- package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +42 -38
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/core/utils/wallet.js +15 -0
- package/dist/cjs/react/core/utils/wallet.js.map +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +0 -9
- package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -177
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -15
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -60
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +133 -0
- package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
- package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +9 -1
- package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/bridge/Buy.js +1 -1
- package/dist/esm/bridge/Onramp.js +147 -0
- package/dist/esm/bridge/Onramp.js.map +1 -0
- package/dist/esm/bridge/OnrampStatus.js +75 -0
- package/dist/esm/bridge/OnrampStatus.js.map +1 -0
- package/dist/esm/bridge/Sell.js +1 -1
- package/dist/esm/bridge/index.js +1 -0
- package/dist/esm/bridge/index.js.map +1 -1
- package/dist/esm/bridge/types/BridgeAction.js +2 -0
- package/dist/esm/bridge/types/BridgeAction.js.map +1 -0
- package/dist/esm/extensions/ens/resolve-l2-name.js +0 -2
- package/dist/esm/extensions/ens/resolve-l2-name.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getQuote.js +129 -33
- package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithFiat/getStatus.js +71 -20
- package/dist/esm/pay/buyWithFiat/getStatus.js.map +1 -1
- package/dist/esm/pay/utils/commonTypes.js +1 -1
- package/dist/esm/pay/utils/commonTypes.js.map +1 -1
- package/dist/esm/pay/utils/definitions.js +0 -10
- package/dist/esm/pay/utils/definitions.js.map +1 -1
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
- package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +42 -38
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/core/utils/wallet.js +15 -0
- package/dist/esm/react/core/utils/wallet.js.map +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
- package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +0 -9
- package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +4 -180
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +2 -16
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -59
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +130 -0
- package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
- package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +9 -1
- package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/bridge/Buy.d.ts +1 -1
- package/dist/types/bridge/Onramp.d.ts +123 -0
- package/dist/types/bridge/Onramp.d.ts.map +1 -0
- package/dist/types/bridge/OnrampStatus.d.ts +108 -0
- package/dist/types/bridge/OnrampStatus.d.ts.map +1 -0
- package/dist/types/bridge/Sell.d.ts +1 -1
- package/dist/types/bridge/index.d.ts +6 -3
- package/dist/types/bridge/index.d.ts.map +1 -1
- package/dist/types/bridge/types/BridgeAction.d.ts +2 -0
- package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -0
- package/dist/types/bridge/types/Quote.d.ts +3 -65
- package/dist/types/bridge/types/Quote.d.ts.map +1 -1
- package/dist/types/bridge/types/Route.d.ts +35 -0
- package/dist/types/bridge/types/Route.d.ts.map +1 -1
- package/dist/types/bridge/types/Token.d.ts +1 -0
- package/dist/types/bridge/types/Token.d.ts.map +1 -1
- package/dist/types/extensions/ens/resolve-l2-name.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithFiat/getStatus.d.ts +1 -12
- package/dist/types/pay/buyWithFiat/getStatus.d.ts.map +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts +1 -1
- package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
- package/dist/types/pay/utils/definitions.d.ts +0 -10
- package/dist/types/pay/utils/definitions.d.ts.map +1 -1
- package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
- package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +1 -30
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts +2 -0
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -5
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +1 -3
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +15 -0
- package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -0
- package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -0
- package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/bridge/Buy.ts +1 -1
- package/src/bridge/Onramp.test.ts +118 -0
- package/src/bridge/Onramp.ts +244 -0
- package/src/bridge/OnrampStatus.ts +133 -0
- package/src/bridge/Sell.ts +1 -1
- package/src/bridge/index.ts +11 -3
- package/src/bridge/types/BridgeAction.ts +1 -0
- package/src/bridge/types/Quote.ts +3 -65
- package/src/bridge/types/Route.ts +39 -0
- package/src/bridge/types/Token.ts +1 -0
- package/src/extensions/ens/resolve-l2-name.ts +0 -2
- package/src/pay/buyWithFiat/getQuote.ts +184 -33
- package/src/pay/buyWithFiat/getStatus.ts +101 -42
- package/src/pay/convert/cryptoToFiat.test.ts +7 -5
- package/src/pay/convert/fiatToCrypto.test.ts +6 -4
- package/src/pay/utils/commonTypes.ts +1 -1
- package/src/pay/utils/definitions.ts +0 -14
- package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +0 -2
- package/src/react/core/hooks/transaction/useSendTransaction.ts +48 -41
- package/src/react/core/utils/wallet.ts +15 -0
- package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
- package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +0 -53
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +3 -510
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +2 -12
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +2 -0
- package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +19 -20
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -37
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +1 -95
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -69
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +295 -0
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +4 -3
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +20 -1
- package/src/version.ts +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -37
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -86
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -25
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -81
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -17
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -83
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -22
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -78
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -14
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts +0 -26
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +0 -16
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +0 -23
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts +0 -14
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts.map +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +0 -142
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +0 -170
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +0 -63
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx +0 -138
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx +0 -45
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts +0 -12
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"PostOnRampSwapFlow.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,KAAK,uBAAuB,EAAa,MAAM,gBAAgB,CAAC;AAKzE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,uBAAuB,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAChE,8CAoCA"}
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
2
|
-
import type { ValidBuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
3
|
-
import type { PayerInfo } from "../types.js";
|
4
|
-
export declare function FiatDetailsScreen(props: {
|
5
|
-
title: string;
|
6
|
-
status: ValidBuyWithFiatStatus;
|
7
|
-
onBack: () => void;
|
8
|
-
client: ThirdwebClient;
|
9
|
-
onDone: () => void;
|
10
|
-
transactionMode: boolean;
|
11
|
-
isEmbed: boolean;
|
12
|
-
payer: PayerInfo;
|
13
|
-
}): import("react/jsx-runtime.js").JSX.Element;
|
14
|
-
//# sourceMappingURL=FiatDetailsScreen.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"FiatDetailsScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAK3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB,8CAkGA"}
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
2
|
-
import type { PayerInfo } from "../types.js";
|
3
|
-
import type { TxStatusInfo } from "./useBuyTransactionsToShow.js";
|
4
|
-
export declare function TxDetailsScreen(props: {
|
5
|
-
title: string;
|
6
|
-
client: ThirdwebClient;
|
7
|
-
statusInfo: TxStatusInfo;
|
8
|
-
onBack: () => void;
|
9
|
-
onDone: () => void;
|
10
|
-
transactionMode: boolean;
|
11
|
-
isEmbed: boolean;
|
12
|
-
payer: PayerInfo;
|
13
|
-
}): import("react/jsx-runtime.js").JSX.Element | null;
|
14
|
-
//# sourceMappingURL=TxDetailsScreen.d.ts.map
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TxDetailsScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,YAAY,CAAC;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;CAClB,qDA6BA"}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { ValidBuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
2
|
-
import type { ValidBuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
3
|
-
export type TxStatusInfo = {
|
4
|
-
type: "swap";
|
5
|
-
status: ValidBuyWithCryptoStatus;
|
6
|
-
} | {
|
7
|
-
type: "fiat";
|
8
|
-
status: ValidBuyWithFiatStatus;
|
9
|
-
};
|
10
|
-
//# sourceMappingURL=useBuyTransactionsToShow.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useBuyTransactionsToShow.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AACpG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAEhG,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;CAClC,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC"}
|
@@ -1,142 +0,0 @@
|
|
1
|
-
import { ExternalLinkIcon } from "@radix-ui/react-icons";
|
2
|
-
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
3
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
4
|
-
import { formatNumber } from "../../../../../../../utils/formatNumber.js";
|
5
|
-
import { formatExplorerTxUrl } from "../../../../../../../utils/url.js";
|
6
|
-
import {
|
7
|
-
fontSize,
|
8
|
-
iconSize,
|
9
|
-
} from "../../../../../../core/design-system/index.js";
|
10
|
-
import { useChainExplorers } from "../../../../../../core/hooks/others/useChainQuery.js";
|
11
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
12
|
-
import { Container, Line } from "../../../../components/basic.js";
|
13
|
-
import { ButtonLink } from "../../../../components/buttons.js";
|
14
|
-
import { Text } from "../../../../components/text.js";
|
15
|
-
import { TokenInfoRow } from "../pay-transactions/TokenInfoRow.js";
|
16
|
-
import type { FiatStatusMeta } from "../pay-transactions/statusMeta.js";
|
17
|
-
import { getCurrencyMeta, getFiatIcon } from "./currencies.js";
|
18
|
-
|
19
|
-
/**
|
20
|
-
* Show a table with the details of a "OnRamp" transaction step in the "Buy with Fiat" flow.
|
21
|
-
* - Show OnRamp token as "Receive"
|
22
|
-
* - Show fiat amount as "Pay"
|
23
|
-
*/
|
24
|
-
export function OnRampTxDetailsTable(props: {
|
25
|
-
client: ThirdwebClient;
|
26
|
-
token: {
|
27
|
-
chainId: number;
|
28
|
-
address: string;
|
29
|
-
symbol: string;
|
30
|
-
amount: string;
|
31
|
-
};
|
32
|
-
fiat: {
|
33
|
-
currencySymbol: string;
|
34
|
-
amount: string;
|
35
|
-
};
|
36
|
-
statusMeta?: {
|
37
|
-
color: FiatStatusMeta["color"];
|
38
|
-
text: FiatStatusMeta["status"];
|
39
|
-
txHash?: string;
|
40
|
-
};
|
41
|
-
}) {
|
42
|
-
const onRampExplorers = useChainExplorers(
|
43
|
-
getCachedChain(props.token.chainId),
|
44
|
-
);
|
45
|
-
const onrampTxHash = props.statusMeta?.txHash;
|
46
|
-
const currencyMeta = getCurrencyMeta(props.fiat.currencySymbol);
|
47
|
-
|
48
|
-
const lineSpacer = (
|
49
|
-
<>
|
50
|
-
<Spacer y="md" />
|
51
|
-
<Line />
|
52
|
-
<Spacer y="md" />
|
53
|
-
</>
|
54
|
-
);
|
55
|
-
|
56
|
-
return (
|
57
|
-
<div>
|
58
|
-
{/* Pay */}
|
59
|
-
<Container
|
60
|
-
flex="row"
|
61
|
-
style={{
|
62
|
-
justifyContent: "space-between",
|
63
|
-
}}
|
64
|
-
>
|
65
|
-
<Text size="sm">Pay</Text>
|
66
|
-
<Container
|
67
|
-
flex="column"
|
68
|
-
gap="xxs"
|
69
|
-
style={{
|
70
|
-
alignItems: "flex-end",
|
71
|
-
}}
|
72
|
-
>
|
73
|
-
<Container flex="row" gap="xs" center="y">
|
74
|
-
{getFiatIcon(currencyMeta, "sm")}
|
75
|
-
<Text color="primaryText">
|
76
|
-
{formatNumber(Number(props.fiat.amount), 2)}{" "}
|
77
|
-
{props.fiat.currencySymbol}
|
78
|
-
</Text>
|
79
|
-
</Container>
|
80
|
-
</Container>
|
81
|
-
</Container>
|
82
|
-
|
83
|
-
{lineSpacer}
|
84
|
-
|
85
|
-
{/* Receive */}
|
86
|
-
<TokenInfoRow
|
87
|
-
chainId={props.token.chainId}
|
88
|
-
client={props.client}
|
89
|
-
label="Receive"
|
90
|
-
tokenAmount={props.token.amount}
|
91
|
-
tokenSymbol={props.token.symbol}
|
92
|
-
tokenAddress={props.token.address}
|
93
|
-
/>
|
94
|
-
|
95
|
-
{/* Status */}
|
96
|
-
{props.statusMeta && (
|
97
|
-
<>
|
98
|
-
{lineSpacer}
|
99
|
-
<Container
|
100
|
-
flex="row"
|
101
|
-
center="y"
|
102
|
-
style={{
|
103
|
-
justifyContent: "space-between",
|
104
|
-
}}
|
105
|
-
>
|
106
|
-
<Text>Status</Text>
|
107
|
-
<Container flex="row" gap="xs" center="y">
|
108
|
-
<Text color={props.statusMeta.color}>
|
109
|
-
{props.statusMeta.text}
|
110
|
-
</Text>
|
111
|
-
</Container>
|
112
|
-
</Container>
|
113
|
-
</>
|
114
|
-
)}
|
115
|
-
|
116
|
-
{lineSpacer}
|
117
|
-
|
118
|
-
{/* Transaction Hash link */}
|
119
|
-
{onrampTxHash && onRampExplorers.explorers?.[0]?.url && (
|
120
|
-
<>
|
121
|
-
<Spacer y="md" />
|
122
|
-
<ButtonLink
|
123
|
-
fullWidth
|
124
|
-
variant="outline"
|
125
|
-
href={formatExplorerTxUrl(
|
126
|
-
onRampExplorers.explorers[0]?.url,
|
127
|
-
onrampTxHash,
|
128
|
-
)}
|
129
|
-
target="_blank"
|
130
|
-
gap="xs"
|
131
|
-
style={{
|
132
|
-
fontSize: fontSize.sm,
|
133
|
-
}}
|
134
|
-
>
|
135
|
-
View on Explorer
|
136
|
-
<ExternalLinkIcon width={iconSize.sm} height={iconSize.sm} />
|
137
|
-
</ButtonLink>
|
138
|
-
</>
|
139
|
-
)}
|
140
|
-
</div>
|
141
|
-
);
|
142
|
-
}
|
@@ -1,170 +0,0 @@
|
|
1
|
-
import { useQuery } from "@tanstack/react-query";
|
2
|
-
import { useEffect, useState } from "react";
|
3
|
-
import { getCachedChain } from "../../../../../../../chains/utils.js";
|
4
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
5
|
-
import { getContract } from "../../../../../../../contract/contract.js";
|
6
|
-
import { allowance } from "../../../../../../../extensions/erc20/__generated__/IERC20/read/allowance.js";
|
7
|
-
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
8
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
9
|
-
import { getPostOnRampQuote } from "../../../../../../../pay/buyWithFiat/getPostOnRampQuote.js";
|
10
|
-
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
11
|
-
import { iconSize } from "../../../../../../core/design-system/index.js";
|
12
|
-
import { Spacer } from "../../../../components/Spacer.js";
|
13
|
-
import { Spinner } from "../../../../components/Spinner.js";
|
14
|
-
import { Container, ModalHeader } from "../../../../components/basic.js";
|
15
|
-
import { Button } from "../../../../components/buttons.js";
|
16
|
-
import { Text } from "../../../../components/text.js";
|
17
|
-
import { AccentFailIcon } from "../../../icons/AccentFailIcon.js";
|
18
|
-
import { SwapFlow } from "../swap/SwapFlow.js";
|
19
|
-
import type { PayerInfo } from "../types.js";
|
20
|
-
|
21
|
-
export function PostOnRampSwap(props: {
|
22
|
-
title: string;
|
23
|
-
client: ThirdwebClient;
|
24
|
-
buyWithFiatStatus: BuyWithFiatStatus;
|
25
|
-
onBack?: () => void;
|
26
|
-
onDone: () => void;
|
27
|
-
transactionMode: boolean;
|
28
|
-
isEmbed: boolean;
|
29
|
-
payer: PayerInfo;
|
30
|
-
onSuccess: ((status: BuyWithCryptoStatus) => void) | undefined;
|
31
|
-
}) {
|
32
|
-
const [lockedOnRampQuote, setLockedOnRampQuote] = useState<
|
33
|
-
BuyWithCryptoQuote | undefined
|
34
|
-
>(undefined);
|
35
|
-
|
36
|
-
const postOnRampQuoteQuery = useQuery({
|
37
|
-
queryKey: ["getPostOnRampQuote", props.buyWithFiatStatus],
|
38
|
-
queryFn: async () => {
|
39
|
-
return await getPostOnRampQuote({
|
40
|
-
client: props.client,
|
41
|
-
buyWithFiatStatus: props.buyWithFiatStatus,
|
42
|
-
});
|
43
|
-
},
|
44
|
-
// stop fetching if a quote is already locked
|
45
|
-
enabled: !lockedOnRampQuote,
|
46
|
-
refetchOnWindowFocus: false,
|
47
|
-
});
|
48
|
-
|
49
|
-
const allowanceQuery = useQuery({
|
50
|
-
queryKey: [
|
51
|
-
"allowance",
|
52
|
-
props.payer.account.address,
|
53
|
-
postOnRampQuoteQuery.data?.approvalData,
|
54
|
-
],
|
55
|
-
queryFn: () => {
|
56
|
-
if (!postOnRampQuoteQuery.data?.approvalData) {
|
57
|
-
return null;
|
58
|
-
}
|
59
|
-
return allowance({
|
60
|
-
contract: getContract({
|
61
|
-
client: props.client,
|
62
|
-
address: postOnRampQuoteQuery.data.swapDetails.fromToken.tokenAddress,
|
63
|
-
chain: getCachedChain(
|
64
|
-
postOnRampQuoteQuery.data.swapDetails.fromToken.chainId,
|
65
|
-
),
|
66
|
-
}),
|
67
|
-
spender: postOnRampQuoteQuery.data.approvalData.spenderAddress,
|
68
|
-
owner: props.payer.account.address,
|
69
|
-
});
|
70
|
-
},
|
71
|
-
enabled: !!postOnRampQuoteQuery.data?.approvalData,
|
72
|
-
refetchOnMount: true,
|
73
|
-
});
|
74
|
-
|
75
|
-
useEffect(() => {
|
76
|
-
if (
|
77
|
-
postOnRampQuoteQuery.data &&
|
78
|
-
!lockedOnRampQuote &&
|
79
|
-
!postOnRampQuoteQuery.isRefetching &&
|
80
|
-
!allowanceQuery.isLoading
|
81
|
-
) {
|
82
|
-
setLockedOnRampQuote(postOnRampQuoteQuery.data);
|
83
|
-
}
|
84
|
-
}, [
|
85
|
-
postOnRampQuoteQuery.data,
|
86
|
-
lockedOnRampQuote,
|
87
|
-
postOnRampQuoteQuery.isRefetching,
|
88
|
-
allowanceQuery.isLoading,
|
89
|
-
]);
|
90
|
-
|
91
|
-
if (postOnRampQuoteQuery.isError) {
|
92
|
-
return (
|
93
|
-
<Container fullHeight>
|
94
|
-
<Container p="lg">
|
95
|
-
<ModalHeader title={props.title} onBack={props.onBack} />
|
96
|
-
</Container>
|
97
|
-
|
98
|
-
<Container
|
99
|
-
style={{
|
100
|
-
minHeight: "300px",
|
101
|
-
}}
|
102
|
-
flex="column"
|
103
|
-
center="both"
|
104
|
-
p="lg"
|
105
|
-
>
|
106
|
-
<AccentFailIcon size={iconSize["3xl"]} />
|
107
|
-
<Spacer y="xl" />
|
108
|
-
<Text color="primaryText">Failed to get a price quote</Text>
|
109
|
-
<Spacer y="lg" />
|
110
|
-
|
111
|
-
<Button
|
112
|
-
fullWidth
|
113
|
-
variant="primary"
|
114
|
-
onClick={() => {
|
115
|
-
postOnRampQuoteQuery.refetch();
|
116
|
-
}}
|
117
|
-
>
|
118
|
-
Try Again
|
119
|
-
</Button>
|
120
|
-
</Container>
|
121
|
-
|
122
|
-
<Spacer y="xxl" />
|
123
|
-
</Container>
|
124
|
-
);
|
125
|
-
}
|
126
|
-
|
127
|
-
if (!lockedOnRampQuote) {
|
128
|
-
return (
|
129
|
-
<Container fullHeight>
|
130
|
-
<Container p="lg">
|
131
|
-
<ModalHeader title={props.title} onBack={props.onBack} />
|
132
|
-
</Container>
|
133
|
-
|
134
|
-
<Container
|
135
|
-
style={{
|
136
|
-
minHeight: "300px",
|
137
|
-
}}
|
138
|
-
flex="column"
|
139
|
-
center="both"
|
140
|
-
>
|
141
|
-
<Spinner size="xxl" color="accentText" />
|
142
|
-
<Spacer y="xl" />
|
143
|
-
<Text color="primaryText">Getting price quote</Text>
|
144
|
-
</Container>
|
145
|
-
|
146
|
-
<Spacer y="xxl" />
|
147
|
-
</Container>
|
148
|
-
);
|
149
|
-
}
|
150
|
-
|
151
|
-
return (
|
152
|
-
<SwapFlow
|
153
|
-
title={props.title}
|
154
|
-
payer={props.payer}
|
155
|
-
buyWithCryptoQuote={lockedOnRampQuote}
|
156
|
-
client={props.client}
|
157
|
-
onBack={props.onBack}
|
158
|
-
isFiatFlow={true}
|
159
|
-
onDone={props.onDone}
|
160
|
-
onTryAgain={() => {
|
161
|
-
setLockedOnRampQuote(undefined);
|
162
|
-
postOnRampQuoteQuery.refetch();
|
163
|
-
}}
|
164
|
-
transactionMode={props.transactionMode}
|
165
|
-
isEmbed={props.isEmbed}
|
166
|
-
onSuccess={props.onSuccess}
|
167
|
-
approvalAmount={allowanceQuery.data ?? undefined}
|
168
|
-
/>
|
169
|
-
);
|
170
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
import { useState } from "react";
|
2
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
3
|
-
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
4
|
-
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
5
|
-
import type { PayerInfo } from "../types.js";
|
6
|
-
import { type BuyWithFiatPartialQuote, FiatSteps } from "./FiatSteps.js";
|
7
|
-
import { PostOnRampSwap } from "./PostOnRampSwap.js";
|
8
|
-
|
9
|
-
// Note: It is necessary to lock in the fiat-status in state and only pass that to <PostOnRampSwap /> so it does not suddenly change during the swap process.
|
10
|
-
|
11
|
-
/**
|
12
|
-
* - Show 2 steps UI with step 2 highlighted, on continue button click:
|
13
|
-
* - Show swap flow
|
14
|
-
*/
|
15
|
-
export function PostOnRampSwapFlow(props: {
|
16
|
-
title: string;
|
17
|
-
status: BuyWithFiatStatus;
|
18
|
-
quote: BuyWithFiatPartialQuote;
|
19
|
-
client: ThirdwebClient;
|
20
|
-
onBack: () => void;
|
21
|
-
onDone: () => void;
|
22
|
-
onSwapFlowStarted: () => void;
|
23
|
-
transactionMode: boolean;
|
24
|
-
isEmbed: boolean;
|
25
|
-
payer: PayerInfo;
|
26
|
-
onSuccess: ((status: BuyWithCryptoStatus) => void) | undefined;
|
27
|
-
}) {
|
28
|
-
const [statusForSwap, setStatusForSwap] = useState<
|
29
|
-
BuyWithFiatStatus | undefined
|
30
|
-
>();
|
31
|
-
|
32
|
-
// step 2 flow
|
33
|
-
if (statusForSwap) {
|
34
|
-
return (
|
35
|
-
<PostOnRampSwap
|
36
|
-
title={props.title}
|
37
|
-
buyWithFiatStatus={statusForSwap}
|
38
|
-
client={props.client}
|
39
|
-
onDone={props.onDone}
|
40
|
-
transactionMode={props.transactionMode}
|
41
|
-
isEmbed={props.isEmbed}
|
42
|
-
payer={props.payer}
|
43
|
-
onSuccess={props.onSuccess}
|
44
|
-
/>
|
45
|
-
);
|
46
|
-
}
|
47
|
-
|
48
|
-
// show step 1 and step 2 details
|
49
|
-
return (
|
50
|
-
<FiatSteps
|
51
|
-
title={props.title}
|
52
|
-
client={props.client}
|
53
|
-
onBack={props.onBack}
|
54
|
-
partialQuote={props.quote}
|
55
|
-
step={2}
|
56
|
-
onContinue={() => {
|
57
|
-
props.onSwapFlowStarted();
|
58
|
-
setStatusForSwap(props.status);
|
59
|
-
}}
|
60
|
-
status={props.status}
|
61
|
-
/>
|
62
|
-
);
|
63
|
-
}
|
@@ -1,138 +0,0 @@
|
|
1
|
-
import { useState } from "react";
|
2
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
3
|
-
import type {
|
4
|
-
BuyWithFiatStatus,
|
5
|
-
ValidBuyWithFiatStatus,
|
6
|
-
} from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
7
|
-
import { useBuyWithFiatStatus } from "../../../../../../core/hooks/pay/useBuyWithFiatStatus.js";
|
8
|
-
import { Container, Line, ModalHeader } from "../../../../components/basic.js";
|
9
|
-
import { OnRampTxDetailsTable } from "../fiat/FiatTxDetailsTable.js";
|
10
|
-
import { PostOnRampSwapFlow } from "../fiat/PostOnRampSwapFlow.js";
|
11
|
-
import type { PayerInfo } from "../types.js";
|
12
|
-
import { getBuyWithFiatStatusMeta } from "./statusMeta.js";
|
13
|
-
|
14
|
-
export function FiatDetailsScreen(props: {
|
15
|
-
title: string;
|
16
|
-
status: ValidBuyWithFiatStatus;
|
17
|
-
onBack: () => void;
|
18
|
-
client: ThirdwebClient;
|
19
|
-
onDone: () => void;
|
20
|
-
transactionMode: boolean;
|
21
|
-
isEmbed: boolean;
|
22
|
-
payer: PayerInfo;
|
23
|
-
}) {
|
24
|
-
const initialStatus = props.status;
|
25
|
-
const [stopPolling, setStopPolling] = useState(false);
|
26
|
-
|
27
|
-
const statusQuery = useBuyWithFiatStatus(
|
28
|
-
stopPolling
|
29
|
-
? undefined
|
30
|
-
: {
|
31
|
-
client: props.client,
|
32
|
-
intentId: initialStatus.intentId,
|
33
|
-
},
|
34
|
-
);
|
35
|
-
|
36
|
-
const status: ValidBuyWithFiatStatus =
|
37
|
-
(statusQuery.data?.status === "NOT_FOUND" ? undefined : statusQuery.data) ||
|
38
|
-
initialStatus;
|
39
|
-
|
40
|
-
const hasTwoSteps = isSwapRequiredAfterOnRamp(status);
|
41
|
-
const statusMeta = getBuyWithFiatStatusMeta(status);
|
42
|
-
|
43
|
-
if (hasTwoSteps) {
|
44
|
-
const fiatQuote = status.quote;
|
45
|
-
return (
|
46
|
-
<PostOnRampSwapFlow
|
47
|
-
title={props.title}
|
48
|
-
client={props.client}
|
49
|
-
status={status}
|
50
|
-
onBack={props.onBack}
|
51
|
-
transactionMode={props.transactionMode}
|
52
|
-
isEmbed={props.isEmbed}
|
53
|
-
quote={{
|
54
|
-
fromCurrencyAmount: fiatQuote.fromCurrencyWithFees.amount,
|
55
|
-
fromCurrencySymbol: fiatQuote.fromCurrencyWithFees.currencySymbol,
|
56
|
-
onRampTokenAmount: fiatQuote.estimatedOnRampAmount,
|
57
|
-
toTokenAmount: fiatQuote.estimatedToTokenAmount,
|
58
|
-
onRampToken: {
|
59
|
-
chainId: fiatQuote.onRampToken.chainId,
|
60
|
-
tokenAddress: fiatQuote.onRampToken.tokenAddress,
|
61
|
-
name: fiatQuote.onRampToken.name,
|
62
|
-
symbol: fiatQuote.onRampToken.symbol,
|
63
|
-
},
|
64
|
-
toToken: {
|
65
|
-
chainId: fiatQuote.toToken.chainId,
|
66
|
-
tokenAddress: fiatQuote.toToken.tokenAddress,
|
67
|
-
name: fiatQuote.toToken.name,
|
68
|
-
symbol: fiatQuote.toToken.symbol,
|
69
|
-
},
|
70
|
-
}}
|
71
|
-
onDone={props.onDone}
|
72
|
-
onSwapFlowStarted={() => {
|
73
|
-
setStopPolling(true);
|
74
|
-
}}
|
75
|
-
payer={props.payer}
|
76
|
-
// viewing history - ignore onSuccess
|
77
|
-
onSuccess={undefined}
|
78
|
-
/>
|
79
|
-
);
|
80
|
-
}
|
81
|
-
|
82
|
-
return (
|
83
|
-
<Container>
|
84
|
-
<Container p="lg">
|
85
|
-
<ModalHeader title="Transaction Details" onBack={props.onBack} />
|
86
|
-
</Container>
|
87
|
-
|
88
|
-
<Line />
|
89
|
-
|
90
|
-
<Container p="lg">
|
91
|
-
<OnRampTxDetailsTable
|
92
|
-
client={props.client}
|
93
|
-
token={
|
94
|
-
status.source
|
95
|
-
? {
|
96
|
-
chainId: status.source.token.chainId,
|
97
|
-
address: status.source.token.tokenAddress,
|
98
|
-
symbol: status.source.token.symbol || "",
|
99
|
-
amount: status.source.amount,
|
100
|
-
}
|
101
|
-
: {
|
102
|
-
address: status.quote.onRampToken.tokenAddress,
|
103
|
-
amount: status.quote.estimatedOnRampAmount,
|
104
|
-
chainId: status.quote.onRampToken.chainId,
|
105
|
-
symbol: status.quote.onRampToken.symbol || "",
|
106
|
-
}
|
107
|
-
}
|
108
|
-
fiat={{
|
109
|
-
amount: status.quote.fromCurrencyWithFees.amount,
|
110
|
-
currencySymbol: status.quote.fromCurrencyWithFees.currencySymbol,
|
111
|
-
}}
|
112
|
-
statusMeta={{
|
113
|
-
color: statusMeta.color,
|
114
|
-
text: statusMeta.status,
|
115
|
-
txHash: status.source?.transactionHash,
|
116
|
-
}}
|
117
|
-
/>
|
118
|
-
</Container>
|
119
|
-
</Container>
|
120
|
-
);
|
121
|
-
}
|
122
|
-
|
123
|
-
// if the toToken is the same as the onRampToken, no swap is required
|
124
|
-
function isSwapRequiredAfterOnRamp(buyWithFiatStatus: BuyWithFiatStatus) {
|
125
|
-
if (buyWithFiatStatus.status === "NOT_FOUND") {
|
126
|
-
return false;
|
127
|
-
}
|
128
|
-
|
129
|
-
const sameChain =
|
130
|
-
buyWithFiatStatus.quote.toToken.chainId ===
|
131
|
-
buyWithFiatStatus.quote.onRampToken.chainId;
|
132
|
-
|
133
|
-
const sameToken =
|
134
|
-
buyWithFiatStatus.quote.toToken.tokenAddress ===
|
135
|
-
buyWithFiatStatus.quote.onRampToken.tokenAddress;
|
136
|
-
|
137
|
-
return !(sameChain && sameToken);
|
138
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
2
|
-
import type { PayerInfo } from "../types.js";
|
3
|
-
import { FiatDetailsScreen } from "./FiatDetailsScreen.js";
|
4
|
-
import { SwapDetailsScreen } from "./SwapDetailsScreen.js";
|
5
|
-
import type { TxStatusInfo } from "./useBuyTransactionsToShow.js";
|
6
|
-
|
7
|
-
export function TxDetailsScreen(props: {
|
8
|
-
title: string;
|
9
|
-
client: ThirdwebClient;
|
10
|
-
statusInfo: TxStatusInfo;
|
11
|
-
onBack: () => void;
|
12
|
-
onDone: () => void;
|
13
|
-
transactionMode: boolean;
|
14
|
-
isEmbed: boolean;
|
15
|
-
payer: PayerInfo;
|
16
|
-
}) {
|
17
|
-
const { statusInfo } = props;
|
18
|
-
|
19
|
-
if (statusInfo.type === "swap") {
|
20
|
-
return (
|
21
|
-
<SwapDetailsScreen
|
22
|
-
client={props.client}
|
23
|
-
status={statusInfo.status}
|
24
|
-
onBack={props.onBack}
|
25
|
-
/>
|
26
|
-
);
|
27
|
-
}
|
28
|
-
|
29
|
-
if (statusInfo.type === "fiat") {
|
30
|
-
return (
|
31
|
-
<FiatDetailsScreen
|
32
|
-
title={props.title}
|
33
|
-
client={props.client}
|
34
|
-
status={statusInfo.status}
|
35
|
-
onBack={props.onBack}
|
36
|
-
onDone={props.onDone}
|
37
|
-
transactionMode={props.transactionMode}
|
38
|
-
isEmbed={props.isEmbed}
|
39
|
-
payer={props.payer}
|
40
|
-
/>
|
41
|
-
);
|
42
|
-
}
|
43
|
-
|
44
|
-
return null;
|
45
|
-
}
|
package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { ValidBuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
2
|
-
import type { ValidBuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
3
|
-
|
4
|
-
export type TxStatusInfo =
|
5
|
-
| {
|
6
|
-
type: "swap";
|
7
|
-
status: ValidBuyWithCryptoStatus;
|
8
|
-
}
|
9
|
-
| {
|
10
|
-
type: "fiat";
|
11
|
-
status: ValidBuyWithFiatStatus;
|
12
|
-
};
|