thirdweb 5.99.3 → 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 +17 -13
- package/dist/cjs/bridge/Buy.js.map +1 -1
- package/dist/cjs/bridge/Chains.js +2 -2
- package/dist/cjs/bridge/Chains.js.map +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/Routes.js +2 -2
- package/dist/cjs/bridge/Routes.js.map +1 -1
- package/dist/cjs/bridge/Sell.js +18 -14
- package/dist/cjs/bridge/Sell.js.map +1 -1
- package/dist/cjs/bridge/Status.js +15 -2
- package/dist/cjs/bridge/Status.js.map +1 -1
- package/dist/cjs/bridge/Transfer.js +229 -0
- package/dist/cjs/bridge/Transfer.js.map +1 -0
- package/dist/cjs/bridge/index.js +3 -1
- package/dist/cjs/bridge/index.js.map +1 -1
- package/dist/cjs/bridge/types/BridgeAction.js +3 -0
- package/dist/cjs/bridge/types/BridgeAction.js.map +1 -0
- package/dist/cjs/bridge/types/Token.js +3 -0
- package/dist/cjs/bridge/types/Token.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/buyWithCrypto/getQuote.js +159 -53
- package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/cjs/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/cjs/pay/buyWithCrypto/getTransfer.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 -43
- 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 +44 -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 +1 -23
- 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/BuyScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.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/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +4 -4
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +83 -34
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.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/utils/any-evm/zksync/constants.js +1 -0
- package/dist/cjs/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/cjs/utils/domains.js +3 -0
- package/dist/cjs/utils/domains.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 +17 -13
- package/dist/esm/bridge/Buy.js.map +1 -1
- package/dist/esm/bridge/Chains.js +2 -2
- package/dist/esm/bridge/Chains.js.map +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/Routes.js +2 -2
- package/dist/esm/bridge/Routes.js.map +1 -1
- package/dist/esm/bridge/Sell.js +18 -14
- package/dist/esm/bridge/Sell.js.map +1 -1
- package/dist/esm/bridge/Status.js +15 -2
- package/dist/esm/bridge/Status.js.map +1 -1
- package/dist/esm/bridge/Transfer.js +226 -0
- package/dist/esm/bridge/Transfer.js.map +1 -0
- package/dist/esm/bridge/index.js +2 -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/bridge/types/Token.js +2 -0
- package/dist/esm/bridge/types/Token.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/buyWithCrypto/getQuote.js +159 -53
- package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getStatus.js +160 -14
- package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
- package/dist/esm/pay/buyWithCrypto/getTransfer.js +95 -37
- package/dist/esm/pay/buyWithCrypto/getTransfer.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 -35
- 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 +44 -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 +1 -23
- 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/BuyScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.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/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +84 -34
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.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/utils/any-evm/zksync/constants.js +1 -0
- package/dist/esm/utils/any-evm/zksync/constants.js.map +1 -1
- package/dist/esm/utils/domains.js +3 -0
- package/dist/esm/utils/domains.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 +11 -9
- package/dist/types/bridge/Buy.d.ts.map +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 +13 -11
- 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 +199 -0
- package/dist/types/bridge/Transfer.d.ts.map +1 -0
- package/dist/types/bridge/index.d.ts +7 -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 +38 -17
- package/dist/types/bridge/types/Route.d.ts.map +1 -1
- package/dist/types/bridge/types/Status.d.ts +15 -0
- package/dist/types/bridge/types/Status.d.ts.map +1 -1
- package/dist/types/bridge/types/Token.d.ts +11 -0
- package/dist/types/bridge/types/Token.d.ts.map +1 -0
- package/dist/types/extensions/ens/resolve-l2-name.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts +0 -9
- package/dist/types/pay/buyWithCrypto/commonTypes.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts +1 -1
- package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
- package/dist/types/pay/buyWithCrypto/getTransfer.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 -35
- 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/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +8 -4
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.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/utils/any-evm/zksync/constants.d.ts.map +1 -1
- package/dist/types/utils/domains.d.ts +6 -0
- package/dist/types/utils/domains.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 +19 -13
- package/src/bridge/Chains.ts +2 -2
- 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/Routes.ts +2 -2
- package/src/bridge/Sell.ts +20 -14
- package/src/bridge/Status.ts +15 -2
- package/src/bridge/Transfer.test.ts +76 -0
- package/src/bridge/Transfer.ts +270 -0
- package/src/bridge/index.ts +12 -3
- package/src/bridge/types/BridgeAction.ts +1 -0
- package/src/bridge/types/Quote.ts +3 -65
- package/src/bridge/types/Route.ts +42 -17
- package/src/bridge/types/Status.ts +15 -1
- package/src/bridge/types/Token.ts +11 -0
- package/src/extensions/ens/resolve-l2-name.ts +0 -2
- package/src/pay/buyWithCrypto/commonTypes.ts +0 -10
- package/src/pay/buyWithCrypto/getQuote.ts +210 -100
- package/src/pay/buyWithCrypto/getStatus.ts +213 -20
- package/src/pay/buyWithCrypto/getTransfer.ts +129 -61
- 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 -48
- package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +0 -2
- package/src/react/core/hooks/transaction/useSendTransaction.ts +53 -52
- 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 +5 -64
- package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +3 -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/ConnectWallet/screens/Buy/swap/WalletRow.tsx +3 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +1 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +1 -3
- package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +118 -63
- package/src/react/web/ui/TransactionButton/DepositScreen.tsx +295 -0
- package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +4 -5
- package/src/react/web/ui/TransactionButton/TransactionModal.tsx +20 -1
- package/src/utils/any-evm/zksync/constants.ts +1 -0
- package/src/utils/domain.test.ts +1 -0
- package/src/utils/domains.ts +8 -0
- package/src/version.ts +1 -1
- package/dist/cjs/bridge/constants.js +0 -5
- package/dist/cjs/bridge/constants.js.map +0 -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/BuyTxHistory.js +0 -54
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -52
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.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 +0 -138
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/esm/bridge/constants.js +0 -2
- package/dist/esm/bridge/constants.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/BuyTxHistory.js +0 -51
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -48
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.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 -135
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
- package/dist/types/bridge/constants.d.ts +0 -2
- package/dist/types/bridge/constants.d.ts.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/BuyTxHistory.d.ts +0 -10
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +0 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts +0 -9
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.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 -21
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts.map +0 -1
- package/src/bridge/constants.ts +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/BuyTxHistory.tsx +0 -163
- package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +0 -127
- 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 -191
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useBuyTxStates.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAInG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAEjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAGjF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,qBAAqB,EAAE,uBAAuB,CAAC;
|
1
|
+
{"version":3,"file":"useBuyTxStates.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAInG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAEjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAGjF,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,qBAAqB,EAAE,uBAAuB,CAAC;IAC/C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;;;;;;;;;;;;UAoHA"}
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
2
2
|
import type { BuyWithCryptoQuote } from "../../../../../../../pay/buyWithCrypto/getQuote.js";
|
3
3
|
import type { ValidBuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
4
|
-
export declare function SwapDetailsScreen(props: {
|
5
|
-
status: ValidBuyWithCryptoStatus;
|
6
|
-
onBack: () => void;
|
7
|
-
client: ThirdwebClient;
|
8
|
-
}): import("react/jsx-runtime.js").JSX.Element;
|
9
4
|
export declare function SwapTxDetailsTable(props: {
|
10
5
|
type: "quote";
|
11
6
|
quote: BuyWithCryptoQuote;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SwapDetailsScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;
|
1
|
+
{"version":3,"file":"SwapDetailsScreen.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qDAAqD,CAAC;AA+CpG,wBAAgB,kBAAkB,CAChC,KAAK,EACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,cAAc,CAAC;CACxB,GACD;IACE,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,wBAAwB,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,8CAwON"}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import type { BuyWithCryptoStatus } from "../../../../../../../pay/buyWithCrypto/getStatus.js";
|
2
|
-
import type { BuyWithFiatStatus } from "../../../../../../../pay/buyWithFiat/getStatus.js";
|
3
2
|
import type { Theme } from "../../../../../../core/design-system/index.js";
|
4
3
|
export type StatusMeta = {
|
5
4
|
status: string;
|
@@ -12,7 +11,6 @@ export type FiatStatusMeta = {
|
|
12
11
|
color: keyof Theme["colors"];
|
13
12
|
loading?: true;
|
14
13
|
step: 1 | 2;
|
15
|
-
progressStatus: "pending" | "completed" | "failed" | "actionRequired" | "
|
14
|
+
progressStatus: "pending" | "completed" | "failed" | "actionRequired" | "unknown";
|
16
15
|
};
|
17
|
-
export declare function getBuyWithFiatStatusMeta(fiatStatus: BuyWithFiatStatus): FiatStatusMeta;
|
18
16
|
//# sourceMappingURL=statusMeta.d.ts.map
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"statusMeta.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"statusMeta.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC/F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,+CAA+C,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,mBAAmB,GAChC,UAAU,CAoDZ;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,cAAc,EACV,SAAS,GACT,WAAW,GACX,QAAQ,GACR,gBAAgB,GAChB,SAAS,CAAC;CACf,CAAC"}
|
@@ -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;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,
|
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,8CAsDA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pendingSwapTx.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GACd;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;
|
1
|
+
{"version":3,"file":"pendingSwapTx.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts"],"names":[],"mappings":"AAEA,KAAK,aAAa,GACd;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIN;;GAEG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,aAAa,SAIjD,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Chain } from "../../../../../../../chains/types.js";
|
2
2
|
import type { ThirdwebClient } from "../../../../../../../client/client.js";
|
3
|
+
import type { Address } from "../../../../../../../utils/address.js";
|
3
4
|
export type SupportedChainAndTokens = Array<{
|
4
5
|
chain: Chain;
|
5
6
|
tokens: Array<{
|
@@ -11,11 +12,10 @@ export type SupportedChainAndTokens = Array<{
|
|
11
12
|
icon?: string;
|
12
13
|
}>;
|
13
14
|
}>;
|
14
|
-
export declare function fetchBuySupportedDestinations(client: ThirdwebClient, isTestMode?: boolean): Promise<SupportedChainAndTokens>;
|
15
15
|
/**
|
16
16
|
* @internal
|
17
17
|
*/
|
18
|
-
export declare function useBuySupportedDestinations(client: ThirdwebClient,
|
18
|
+
export declare function useBuySupportedDestinations(client: ThirdwebClient, _isTestMode?: boolean): import("@tanstack/react-query").UseQueryResult<SupportedChainAndTokens, Error>;
|
19
19
|
export declare function useBuySupportedSources(options: {
|
20
20
|
client: ThirdwebClient;
|
21
21
|
destinationChainId: number;
|
@@ -23,13 +23,17 @@ export declare function useBuySupportedSources(options: {
|
|
23
23
|
}): import("@tanstack/react-query").UseQueryResult<{
|
24
24
|
chain: Readonly<import("../../../../../../../chains/types.js").ChainOptions & {
|
25
25
|
rpc: string;
|
26
|
-
}
|
26
|
+
}> | {
|
27
|
+
readonly id: number;
|
28
|
+
readonly rpc: `https://${number}.${string}`;
|
29
|
+
};
|
27
30
|
tokens: {
|
28
|
-
address:
|
31
|
+
address: Address;
|
29
32
|
buyWithCryptoEnabled: boolean;
|
30
33
|
buyWithFiatEnabled: boolean;
|
31
34
|
name: string;
|
32
35
|
symbol: string;
|
36
|
+
icon?: string;
|
33
37
|
}[];
|
34
38
|
}[], Error>;
|
35
39
|
//# sourceMappingURL=useSwapSupportedChains.d.ts.map
|
package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSwapSupportedChains.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useSwapSupportedChains.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAGrE,MAAM,MAAM,uBAAuB,GAAG,KAAK,CAAC;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,KAAK,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,kBAAkB,EAAE,OAAO,CAAC;QAC5B,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ,CAAC,CAAC;AA0EH;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,cAAc,EACtB,WAAW,CAAC,EAAE,OAAO,kFAQtB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE;IAC9C,MAAM,EAAE,cAAc,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;CACjC;;;;;;;;iBAkBkB,OAAO;8BACM,OAAO;4BACT,OAAO;cACrB,MAAM;gBACJ,MAAM;eACP,MAAM;;YAqCtB"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { ThirdwebClient } from "../../../../client/client.js";
|
2
|
+
import type { PreparedTransaction } from "../../../../transaction/prepare-transaction.js";
|
3
|
+
import type { ConnectLocale } from "../ConnectWallet/locale/types.js";
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
* @internal
|
7
|
+
*/
|
8
|
+
export declare function DepositScreen(props: {
|
9
|
+
onBack: (() => void) | undefined;
|
10
|
+
connectLocale: ConnectLocale;
|
11
|
+
client: ThirdwebClient;
|
12
|
+
tx: PreparedTransaction;
|
13
|
+
onDone: () => void;
|
14
|
+
}): import("react/jsx-runtime.js").JSX.Element;
|
15
|
+
//# sourceMappingURL=DepositScreen.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DepositScreen.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/DepositScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAiB1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAqDtE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACjC,aAAa,EAAE,aAAa,CAAC;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,EAAE,EAAE,mBAAmB,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,8CAiMA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExecutingScreen.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/ExecutingScreen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAY1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,
|
1
|
+
{"version":3,"file":"ExecutingScreen.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/ExecutingScreen.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAY1F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,8CA4GA"}
|
@@ -17,6 +17,7 @@ type ModalProps = {
|
|
17
17
|
tx: PreparedTransaction;
|
18
18
|
payOptions: PayUIOptions;
|
19
19
|
onTxSent: (data: WaitForReceiptOptions) => void;
|
20
|
+
modalMode: "buy" | "deposit";
|
20
21
|
};
|
21
22
|
export declare function TransactionModal(props: ModalProps): import("react/jsx-runtime.js").JSX.Element;
|
22
23
|
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TransactionModal.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/TransactionModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAG1F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AAGzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAK5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"TransactionModal.d.ts","sourceRoot":"","sources":["../../../../../../src/react/web/ui/TransactionButton/TransactionModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAG1F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AAGzF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAK5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;IAChC,EAAE,EAAE,mBAAmB,CAAC;IACxB,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;CAC9B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,8CA4CjD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/utils/any-evm/zksync/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EACnC,4CAAqD,CAAC;AACxD,eAAO,MAAM,yBAAyB,EACpC,4CAAqD,CAAC;AACxD,eAAO,MAAM,mBAAmB,+CAA+C,CAAC;
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/utils/any-evm/zksync/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EACnC,4CAAqD,CAAC;AACxD,eAAO,MAAM,yBAAyB,EACpC,4CAAqD,CAAC;AACxD,eAAO,MAAM,mBAAmB,+CAA+C,CAAC;AAEhF,eAAO,MAAM,qBAAqB,oBAA2C,CAAC;AAE9E,eAAO,MAAM,mBAAmB,sEAEtB,CAAC;AAEX,eAAO,MAAM,wBAAwB,EACnC,o0LAA60L,CAAC;AAEh1L,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;EAyBb,CAAC;AAEX,eAAO,MAAM,eAAe,EAC1B,osSAA6sS,CAAC"}
|
@@ -44,6 +44,11 @@ type DomainOverrides = {
|
|
44
44
|
* @default "engine.thirdweb.com"
|
45
45
|
*/
|
46
46
|
engineCloud?: string;
|
47
|
+
/**
|
48
|
+
* The base URL for the universal bridge service.
|
49
|
+
* @default "bridge.thirdweb.com"
|
50
|
+
*/
|
51
|
+
bridge?: string;
|
47
52
|
};
|
48
53
|
export declare const DEFAULT_RPC_URL = "rpc.thirdweb.com";
|
49
54
|
export declare const setThirdwebDomains: (DomainOverrides: DomainOverrides) => void;
|
@@ -60,6 +65,7 @@ export declare const getThirdwebDomains: () => {
|
|
60
65
|
analytics: string;
|
61
66
|
insight: string;
|
62
67
|
engineCloud: string;
|
68
|
+
bridge: string;
|
63
69
|
};
|
64
70
|
/**
|
65
71
|
* @internal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/utils/domains.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAwBlD,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,eAAe,SAalE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;SA1FvB,MAAM;YAKH,MAAM;iBAKD,MAAM;SAKd,MAAM;aAKF,MAAM;aAKN,MAAM;eAKJ,MAAM;aAKR,MAAM;iBAKF,MAAM;YAKX,MAAM;CA+ChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,eAAe,WAMhE,CAAC;AAIF,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,GAAG,IAAI,SAE/C,CAAC;AAEF,eAAO,MAAM,aAAa,qBAEzB,CAAC"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "5.
|
1
|
+
export declare const version = "5.100.0";
|
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,YAAY,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "thirdweb",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.100.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/thirdweb-dev/js.git#main"
|
@@ -175,7 +175,7 @@
|
|
175
175
|
"./dist/types/exports/react.d.ts"
|
176
176
|
],
|
177
177
|
"react-native": [
|
178
|
-
"./dist/types/exports/react
|
178
|
+
"./dist/types/exports/react.native.d.ts"
|
179
179
|
],
|
180
180
|
"rpc": [
|
181
181
|
"./dist/types/exports/rpc.d.ts"
|
@@ -334,30 +334,30 @@
|
|
334
334
|
"@mobile-wallet-protocol/client": "1.0.0",
|
335
335
|
"@react-native-async-storage/async-storage": "2.1.2",
|
336
336
|
"@size-limit/preset-big-lib": "11.2.0",
|
337
|
-
"@storybook/addon-essentials": "8.6.
|
338
|
-
"@storybook/addon-interactions": "8.6.
|
339
|
-
"@storybook/addon-links": "8.6.
|
340
|
-
"@storybook/addon-onboarding": "8.6.
|
341
|
-
"@storybook/react": "8.6.
|
342
|
-
"@storybook/react-vite": "8.6.
|
343
|
-
"@storybook/test": "8.6.
|
337
|
+
"@storybook/addon-essentials": "8.6.14",
|
338
|
+
"@storybook/addon-interactions": "8.6.14",
|
339
|
+
"@storybook/addon-links": "8.6.14",
|
340
|
+
"@storybook/addon-onboarding": "8.6.14",
|
341
|
+
"@storybook/react": "8.6.14",
|
342
|
+
"@storybook/react-vite": "8.6.14",
|
343
|
+
"@storybook/test": "8.6.14",
|
344
344
|
"@testing-library/jest-dom": "^6.6.3",
|
345
345
|
"@testing-library/react": "^16.3.0",
|
346
346
|
"@testing-library/user-event": "^14.6.1",
|
347
347
|
"@types/cross-spawn": "^6.0.6",
|
348
348
|
"@types/prompts": "2.4.9",
|
349
|
-
"@types/react": "19.1.
|
349
|
+
"@types/react": "19.1.4",
|
350
350
|
"@viem/anvil": "0.0.10",
|
351
351
|
"@vitejs/plugin-react": "^4.4.1",
|
352
352
|
"@vitest/coverage-v8": "3.1.2",
|
353
|
-
"@vitest/ui": "3.1.
|
353
|
+
"@vitest/ui": "3.1.4",
|
354
354
|
"dotenv-mono": "^1.3.14",
|
355
355
|
"ethers5": "npm:ethers@5",
|
356
356
|
"ethers6": "npm:ethers@6",
|
357
357
|
"expo-linking": "7.0.5",
|
358
358
|
"expo-web-browser": "14.0.2",
|
359
359
|
"happy-dom": "17.4.4",
|
360
|
-
"knip": "5.
|
360
|
+
"knip": "5.56.0",
|
361
361
|
"msw": "2.7.5",
|
362
362
|
"prettier": "3.5.3",
|
363
363
|
"react": "19.1.0",
|
@@ -370,12 +370,12 @@
|
|
370
370
|
"rimraf": "6.0.1",
|
371
371
|
"sharp": "^0.33.5",
|
372
372
|
"size-limit": "11.2.0",
|
373
|
-
"storybook": "8.6.
|
373
|
+
"storybook": "8.6.14",
|
374
374
|
"typedoc": "0.27.9",
|
375
375
|
"typedoc-better-json": "0.9.4",
|
376
376
|
"typescript": "5.8.3",
|
377
|
-
"vite": "6.3.
|
378
|
-
"vitest": "3.1.
|
377
|
+
"vite": "6.3.5",
|
378
|
+
"vitest": "3.1.4"
|
379
379
|
},
|
380
380
|
"scripts": {
|
381
381
|
"bench:compare": "bun run ./benchmarks/run.ts",
|
package/src/bridge/Buy.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Address as ox__Address } from "ox";
|
2
2
|
import { defineChain } from "../chains/utils.js";
|
3
3
|
import type { ThirdwebClient } from "../client/client.js";
|
4
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
4
5
|
import { getClientFetch } from "../utils/fetch.js";
|
5
6
|
import { stringify } from "../utils/json.js";
|
6
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
7
7
|
import type { PreparedQuote, Quote } from "./types/Quote.js";
|
8
8
|
|
9
9
|
/**
|
@@ -113,12 +113,13 @@ export async function quote(options: quote.Options): Promise<quote.Result> {
|
|
113
113
|
"buyAmountWei" in options ? options.buyAmountWei : options.amount;
|
114
114
|
|
115
115
|
const clientFetch = getClientFetch(client);
|
116
|
-
const url = new URL(`${
|
116
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/buy/quote`);
|
117
117
|
url.searchParams.set("originChainId", originChainId.toString());
|
118
118
|
url.searchParams.set("originTokenAddress", originTokenAddress);
|
119
119
|
url.searchParams.set("destinationChainId", destinationChainId.toString());
|
120
120
|
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
|
121
121
|
url.searchParams.set("buyAmountWei", amount.toString());
|
122
|
+
url.searchParams.set("amount", amount.toString());
|
122
123
|
if (maxSteps) {
|
123
124
|
url.searchParams.set("maxSteps", maxSteps.toString());
|
124
125
|
}
|
@@ -199,7 +200,7 @@ export declare namespace quote {
|
|
199
200
|
* This will return a quote that might look like:
|
200
201
|
* ```typescript
|
201
202
|
* {
|
202
|
-
* originAmount:
|
203
|
+
* originAmount: 2000030000n,
|
203
204
|
* destinationAmount: 1000000000000000000n,
|
204
205
|
* blockNumber: 22026509n,
|
205
206
|
* timestamp: 1741730936680,
|
@@ -208,11 +209,11 @@ export declare namespace quote {
|
|
208
209
|
* {
|
209
210
|
* originToken: {
|
210
211
|
* chainId: 1,
|
211
|
-
* address: "
|
212
|
-
* symbol: "
|
213
|
-
* name: "
|
214
|
-
* decimals:
|
215
|
-
* priceUsd:
|
212
|
+
* address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
213
|
+
* symbol: "USDC",
|
214
|
+
* name: "USDC",
|
215
|
+
* decimals: 6,
|
216
|
+
* priceUsd: 1,
|
216
217
|
* iconUri: "https://..."
|
217
218
|
* },
|
218
219
|
* destinationToken: {
|
@@ -224,7 +225,7 @@ export declare namespace quote {
|
|
224
225
|
* priceUsd: 2000,
|
225
226
|
* iconUri: "https://..."
|
226
227
|
* },
|
227
|
-
* originAmount:
|
228
|
+
* originAmount: 2000030000n,
|
228
229
|
* destinationAmount: 1000000000000000000n,
|
229
230
|
* estimatedExecutionTimeMs: 1000
|
230
231
|
* transactions: [
|
@@ -250,7 +251,7 @@ export declare namespace quote {
|
|
250
251
|
* expiration: 1741730936680,
|
251
252
|
* intent: {
|
252
253
|
* originChainId: 1,
|
253
|
-
* originTokenAddress: "
|
254
|
+
* originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
254
255
|
* destinationChainId: 10,
|
255
256
|
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
256
257
|
* amount: 1000000000000000000n
|
@@ -259,7 +260,7 @@ export declare namespace quote {
|
|
259
260
|
* ```
|
260
261
|
*
|
261
262
|
* ## Sending the transactions
|
262
|
-
* The `transactions` array is a series of
|
263
|
+
* The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:
|
263
264
|
* - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
|
264
265
|
* - All transactions are assumed to be executed by the `sender` address, regardless of which chain they are on. The final transaction will use the `receiver` as the recipient address.
|
265
266
|
* - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
|
@@ -334,7 +335,7 @@ export async function prepare(
|
|
334
335
|
} = options;
|
335
336
|
|
336
337
|
const clientFetch = getClientFetch(client);
|
337
|
-
const url = new URL(`${
|
338
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/buy/prepare`);
|
338
339
|
|
339
340
|
const response = await clientFetch(url.toString(), {
|
340
341
|
method: "POST",
|
@@ -342,7 +343,8 @@ export async function prepare(
|
|
342
343
|
"Content-Type": "application/json",
|
343
344
|
},
|
344
345
|
body: stringify({
|
345
|
-
buyAmountWei: amount.toString(),
|
346
|
+
buyAmountWei: amount.toString(), // legacy
|
347
|
+
amount: amount.toString(),
|
346
348
|
originChainId: originChainId.toString(),
|
347
349
|
originTokenAddress,
|
348
350
|
destinationChainId: destinationChainId.toString(),
|
@@ -382,6 +384,8 @@ export async function prepare(
|
|
382
384
|
destinationChainId,
|
383
385
|
destinationTokenAddress,
|
384
386
|
amount,
|
387
|
+
sender,
|
388
|
+
receiver,
|
385
389
|
},
|
386
390
|
};
|
387
391
|
}
|
@@ -407,6 +411,8 @@ export declare namespace prepare {
|
|
407
411
|
destinationChainId: number;
|
408
412
|
destinationTokenAddress: ox__Address.Address;
|
409
413
|
amount: bigint;
|
414
|
+
sender: ox__Address.Address;
|
415
|
+
receiver: ox__Address.Address;
|
410
416
|
purchaseData?: unknown;
|
411
417
|
};
|
412
418
|
};
|
package/src/bridge/Chains.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ThirdwebClient } from "../client/client.js";
|
2
|
+
import { getThirdwebBaseUrl } from "../utils/domains.js";
|
2
3
|
import { getClientFetch } from "../utils/fetch.js";
|
3
|
-
import { UNIVERSAL_BRIDGE_URL } from "./constants.js";
|
4
4
|
import type { Chain } from "./types/Chain.js";
|
5
5
|
|
6
6
|
/**
|
@@ -54,7 +54,7 @@ export async function chains(options: chains.Options): Promise<chains.Result> {
|
|
54
54
|
const { client } = options;
|
55
55
|
|
56
56
|
const clientFetch = getClientFetch(client);
|
57
|
-
const url = new URL(`${
|
57
|
+
const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/chains`);
|
58
58
|
|
59
59
|
const response = await clientFetch(url.toString());
|
60
60
|
if (!response.ok) {
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import { toWei } from "src/utils/units.js";
|
2
|
+
import { describe, expect, it } from "vitest";
|
3
|
+
import { TEST_CLIENT } from "~test/test-clients.js";
|
4
|
+
import * as Onramp from "./Onramp.js";
|
5
|
+
|
6
|
+
// Use the same receiver address as other bridge tests
|
7
|
+
const RECEIVER_ADDRESS = "0x2a4f24F935Eb178e3e7BA9B53A5Ee6d8407C0709";
|
8
|
+
const NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
|
9
|
+
|
10
|
+
/**
|
11
|
+
* These tests call the real Bridge Onramp API. They are executed only when a
|
12
|
+
* `TW_SECRET_KEY` environment variable is present, mirroring the behaviour of
|
13
|
+
* the other bridge tests in this package.
|
14
|
+
*/
|
15
|
+
describe.runIf(process.env.TW_SECRET_KEY)("Bridge.Onramp.prepare", () => {
|
16
|
+
it("should prepare an onramp successfully", async () => {
|
17
|
+
const prepared = await Onramp.prepare({
|
18
|
+
client: TEST_CLIENT,
|
19
|
+
onramp: "stripe",
|
20
|
+
chainId: 1,
|
21
|
+
tokenAddress: NATIVE_TOKEN_ADDRESS,
|
22
|
+
receiver: RECEIVER_ADDRESS,
|
23
|
+
amount: toWei("0.01"),
|
24
|
+
});
|
25
|
+
|
26
|
+
expect(prepared).toBeDefined();
|
27
|
+
|
28
|
+
// The destinationAmount should be a bigint and greater than zero
|
29
|
+
expect(typeof prepared.destinationAmount).toBe("bigint");
|
30
|
+
expect(prepared.destinationAmount > 0n).toBe(true);
|
31
|
+
|
32
|
+
// A redirect link for the user should be provided
|
33
|
+
expect(prepared.link).toBeDefined();
|
34
|
+
expect(typeof prepared.link).toBe("string");
|
35
|
+
|
36
|
+
// Intent must be present and reference the correct receiver
|
37
|
+
expect(prepared.intent).toBeDefined();
|
38
|
+
expect(prepared.intent.receiver.toLowerCase()).toBe(
|
39
|
+
RECEIVER_ADDRESS.toLowerCase(),
|
40
|
+
);
|
41
|
+
|
42
|
+
// Steps array should be defined (it may be empty if the provider supports the destination token natively)
|
43
|
+
expect(Array.isArray(prepared.steps)).toBe(true);
|
44
|
+
});
|
45
|
+
|
46
|
+
it("should surface any errors", async () => {
|
47
|
+
await expect(
|
48
|
+
Onramp.prepare({
|
49
|
+
client: TEST_CLIENT,
|
50
|
+
onramp: "stripe",
|
51
|
+
chainId: 444, // Unsupported chain ID
|
52
|
+
tokenAddress: NATIVE_TOKEN_ADDRESS,
|
53
|
+
receiver: RECEIVER_ADDRESS,
|
54
|
+
amount: toWei("0.01"),
|
55
|
+
}),
|
56
|
+
).rejects.toThrowError();
|
57
|
+
});
|
58
|
+
|
59
|
+
it("should prepare a Coinbase onramp successfully", async () => {
|
60
|
+
const prepared = await Onramp.prepare({
|
61
|
+
client: TEST_CLIENT,
|
62
|
+
onramp: "coinbase",
|
63
|
+
chainId: 1,
|
64
|
+
tokenAddress: NATIVE_TOKEN_ADDRESS,
|
65
|
+
receiver: RECEIVER_ADDRESS,
|
66
|
+
amount: toWei("0.01"),
|
67
|
+
});
|
68
|
+
|
69
|
+
expect(prepared).toBeDefined();
|
70
|
+
|
71
|
+
// The destinationAmount should be a bigint and greater than zero
|
72
|
+
expect(typeof prepared.destinationAmount).toBe("bigint");
|
73
|
+
expect(prepared.destinationAmount > 0n).toBe(true);
|
74
|
+
|
75
|
+
// A redirect link for the user should be provided
|
76
|
+
expect(prepared.link).toBeDefined();
|
77
|
+
expect(typeof prepared.link).toBe("string");
|
78
|
+
|
79
|
+
// Intent must be present and reference the correct receiver
|
80
|
+
expect(prepared.intent).toBeDefined();
|
81
|
+
expect(prepared.intent.receiver.toLowerCase()).toBe(
|
82
|
+
RECEIVER_ADDRESS.toLowerCase(),
|
83
|
+
);
|
84
|
+
|
85
|
+
// Steps array should be defined (it may be empty if the provider supports the destination token natively)
|
86
|
+
expect(Array.isArray(prepared.steps)).toBe(true);
|
87
|
+
});
|
88
|
+
|
89
|
+
it("should prepare a Transak onramp successfully", async () => {
|
90
|
+
const prepared = await Onramp.prepare({
|
91
|
+
client: TEST_CLIENT,
|
92
|
+
onramp: "transak",
|
93
|
+
chainId: 1,
|
94
|
+
tokenAddress: NATIVE_TOKEN_ADDRESS,
|
95
|
+
receiver: RECEIVER_ADDRESS,
|
96
|
+
amount: toWei("0.01"),
|
97
|
+
});
|
98
|
+
|
99
|
+
expect(prepared).toBeDefined();
|
100
|
+
|
101
|
+
// The destinationAmount should be a bigint and greater than zero
|
102
|
+
expect(typeof prepared.destinationAmount).toBe("bigint");
|
103
|
+
expect(prepared.destinationAmount > 0n).toBe(true);
|
104
|
+
|
105
|
+
// A redirect link for the user should be provided
|
106
|
+
expect(prepared.link).toBeDefined();
|
107
|
+
expect(typeof prepared.link).toBe("string");
|
108
|
+
|
109
|
+
// Intent must be present and reference the correct receiver
|
110
|
+
expect(prepared.intent).toBeDefined();
|
111
|
+
expect(prepared.intent.receiver.toLowerCase()).toBe(
|
112
|
+
RECEIVER_ADDRESS.toLowerCase(),
|
113
|
+
);
|
114
|
+
|
115
|
+
// Steps array should be defined (it may be empty if the provider supports the destination token natively)
|
116
|
+
expect(Array.isArray(prepared.steps)).toBe(true);
|
117
|
+
});
|
118
|
+
});
|