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
package/dist/cjs/bridge/Buy.js
CHANGED
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.quote = quote;
|
4
4
|
exports.prepare = prepare;
|
5
5
|
const utils_js_1 = require("../chains/utils.js");
|
6
|
+
const domains_js_1 = require("../utils/domains.js");
|
6
7
|
const fetch_js_1 = require("../utils/fetch.js");
|
7
8
|
const json_js_1 = require("../utils/json.js");
|
8
|
-
const constants_js_1 = require("./constants.js");
|
9
9
|
/**
|
10
10
|
* Retrieves a Universal Bridge quote for the provided buy intent. The quote will specify the necessary `originAmount` to receive the desired `destinationAmount`, which is specified with the `buyAmountWei` option.
|
11
11
|
*
|
@@ -104,12 +104,13 @@ async function quote(options) {
|
|
104
104
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, client, maxSteps, } = options;
|
105
105
|
const amount = "buyAmountWei" in options ? options.buyAmountWei : options.amount;
|
106
106
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
107
|
-
const url = new URL(`${
|
107
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/buy/quote`);
|
108
108
|
url.searchParams.set("originChainId", originChainId.toString());
|
109
109
|
url.searchParams.set("originTokenAddress", originTokenAddress);
|
110
110
|
url.searchParams.set("destinationChainId", destinationChainId.toString());
|
111
111
|
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
|
112
112
|
url.searchParams.set("buyAmountWei", amount.toString());
|
113
|
+
url.searchParams.set("amount", amount.toString());
|
113
114
|
if (maxSteps) {
|
114
115
|
url.searchParams.set("maxSteps", maxSteps.toString());
|
115
116
|
}
|
@@ -156,7 +157,7 @@ async function quote(options) {
|
|
156
157
|
* This will return a quote that might look like:
|
157
158
|
* ```typescript
|
158
159
|
* {
|
159
|
-
* originAmount:
|
160
|
+
* originAmount: 2000030000n,
|
160
161
|
* destinationAmount: 1000000000000000000n,
|
161
162
|
* blockNumber: 22026509n,
|
162
163
|
* timestamp: 1741730936680,
|
@@ -165,11 +166,11 @@ async function quote(options) {
|
|
165
166
|
* {
|
166
167
|
* originToken: {
|
167
168
|
* chainId: 1,
|
168
|
-
* address: "
|
169
|
-
* symbol: "
|
170
|
-
* name: "
|
171
|
-
* decimals:
|
172
|
-
* priceUsd:
|
169
|
+
* address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
170
|
+
* symbol: "USDC",
|
171
|
+
* name: "USDC",
|
172
|
+
* decimals: 6,
|
173
|
+
* priceUsd: 1,
|
173
174
|
* iconUri: "https://..."
|
174
175
|
* },
|
175
176
|
* destinationToken: {
|
@@ -181,7 +182,7 @@ async function quote(options) {
|
|
181
182
|
* priceUsd: 2000,
|
182
183
|
* iconUri: "https://..."
|
183
184
|
* },
|
184
|
-
* originAmount:
|
185
|
+
* originAmount: 2000030000n,
|
185
186
|
* destinationAmount: 1000000000000000000n,
|
186
187
|
* estimatedExecutionTimeMs: 1000
|
187
188
|
* transactions: [
|
@@ -207,7 +208,7 @@ async function quote(options) {
|
|
207
208
|
* expiration: 1741730936680,
|
208
209
|
* intent: {
|
209
210
|
* originChainId: 1,
|
210
|
-
* originTokenAddress: "
|
211
|
+
* originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
211
212
|
* destinationChainId: 10,
|
212
213
|
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
213
214
|
* amount: 1000000000000000000n
|
@@ -216,7 +217,7 @@ async function quote(options) {
|
|
216
217
|
* ```
|
217
218
|
*
|
218
219
|
* ## Sending the transactions
|
219
|
-
* The `transactions` array is a series of
|
220
|
+
* 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:
|
220
221
|
* - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
|
221
222
|
* - 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.
|
222
223
|
* - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
|
@@ -277,14 +278,15 @@ async function quote(options) {
|
|
277
278
|
async function prepare(options) {
|
278
279
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, sender, receiver, client, amount, purchaseData, maxSteps, } = options;
|
279
280
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
280
|
-
const url = new URL(`${
|
281
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/buy/prepare`);
|
281
282
|
const response = await clientFetch(url.toString(), {
|
282
283
|
method: "POST",
|
283
284
|
headers: {
|
284
285
|
"Content-Type": "application/json",
|
285
286
|
},
|
286
287
|
body: (0, json_js_1.stringify)({
|
287
|
-
buyAmountWei: amount.toString(),
|
288
|
+
buyAmountWei: amount.toString(), // legacy
|
289
|
+
amount: amount.toString(),
|
288
290
|
originChainId: originChainId.toString(),
|
289
291
|
originTokenAddress,
|
290
292
|
destinationChainId: destinationChainId.toString(),
|
@@ -321,6 +323,8 @@ async function prepare(options) {
|
|
321
323
|
destinationChainId,
|
322
324
|
destinationTokenAddress,
|
323
325
|
amount,
|
326
|
+
sender,
|
327
|
+
receiver,
|
324
328
|
},
|
325
329
|
};
|
326
330
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Buy.js","sourceRoot":"","sources":["../../../src/bridge/Buy.ts"],"names":[],"mappings":";;AAsGA,
|
1
|
+
{"version":3,"file":"Buy.js","sourceRoot":"","sources":["../../../src/bridge/Buy.ts"],"names":[],"mappings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AC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;QACpE,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;QACvD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/B,GAAG,IAAI;YACP,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;gBACpD,GAAG,WAAW;gBACd,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;gBAChE,MAAM;gBACN,KAAK,EAAE,IAAA,sBAAW,EAAC,WAAW,CAAC,OAAO,CAAC;aACxC,CAAC,CAAC;SACJ,CAAC,CAAC;QACH,MAAM,EAAE;YACN,aAAa;YACb,kBAAkB;YAClB,kBAAkB;YAClB,uBAAuB;YACvB,MAAM;YACN,MAAM;YACN,QAAQ;SACT;KACF,CAAC;AACJ,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.chains = chains;
|
4
|
+
const domains_js_1 = require("../utils/domains.js");
|
4
5
|
const fetch_js_1 = require("../utils/fetch.js");
|
5
|
-
const constants_js_1 = require("./constants.js");
|
6
6
|
/**
|
7
7
|
* Retrieves supported Universal Bridge chains.
|
8
8
|
*
|
@@ -53,7 +53,7 @@ const constants_js_1 = require("./constants.js");
|
|
53
53
|
async function chains(options) {
|
54
54
|
const { client } = options;
|
55
55
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
56
|
-
const url = new URL(`${
|
56
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/chains`);
|
57
57
|
const response = await clientFetch(url.toString());
|
58
58
|
if (!response.ok) {
|
59
59
|
const errorJson = await response.json();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Chains.js","sourceRoot":"","sources":["../../../src/bridge/Chains.ts"],"names":[],"mappings":";;AAoDA,wBAcC;AAjED,
|
1
|
+
{"version":3,"file":"Chains.js","sourceRoot":"","sources":["../../../src/bridge/Chains.ts"],"names":[],"mappings":";;AAoDA,wBAcC;AAjED,oDAAyD;AACzD,gDAAmD;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACI,KAAK,UAAU,MAAM,CAAC,OAAuB;IAClD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAEjE,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAsB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
@@ -0,0 +1,152 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.status = void 0;
|
4
|
+
exports.prepare = prepare;
|
5
|
+
const domains_js_1 = require("../utils/domains.js");
|
6
|
+
const fetch_js_1 = require("../utils/fetch.js");
|
7
|
+
const json_js_1 = require("../utils/json.js");
|
8
|
+
// export status within the Onramp module
|
9
|
+
var OnrampStatus_js_1 = require("./OnrampStatus.js");
|
10
|
+
Object.defineProperty(exports, "status", { enumerable: true, get: function () { return OnrampStatus_js_1.status; } });
|
11
|
+
/**
|
12
|
+
* Prepares an onramp transaction, returning a link from the specified provider to onramp to the specified token.
|
13
|
+
*
|
14
|
+
* @example
|
15
|
+
* ```typescript
|
16
|
+
* import { Bridge } from "thirdweb";
|
17
|
+
* import { ethereum } from "thirdweb/chains";
|
18
|
+
* import { NATIVE_TOKEN_ADDRESS, toWei } from "thirdweb/utils";
|
19
|
+
*
|
20
|
+
* const preparedOnramp = await Bridge.Onramp.prepare({
|
21
|
+
* client: thirdwebClient,
|
22
|
+
* onramp: "stripe",
|
23
|
+
* chainId: ethereum.id,
|
24
|
+
* tokenAddress: NATIVE_TOKEN_ADDRESS,
|
25
|
+
* receiver: "0x...", // receiver's address
|
26
|
+
* amount: toWei("10"), // 10 of the destination token
|
27
|
+
* // Optional params:
|
28
|
+
* // sender: "0x...", // sender's address
|
29
|
+
* // onrampTokenAddress: NATIVE_TOKEN_ADDRESS, // token to initially onramp to
|
30
|
+
* // onrampChainId: 1, // chain to initially onramp to
|
31
|
+
* // currency: "USD",
|
32
|
+
* // maxSteps: 2,
|
33
|
+
* // purchaseData: { customId: "123" }
|
34
|
+
* });
|
35
|
+
*
|
36
|
+
* console.log(preparedOnramp.link); // URL to redirect the user to
|
37
|
+
* console.log(preparedOnramp.currencyAmount); // Amount in fiat the user will pay
|
38
|
+
* ```
|
39
|
+
*
|
40
|
+
* This function returns a quote that might look like:
|
41
|
+
* ```typescript
|
42
|
+
* {
|
43
|
+
* id: "123e4567-e89b-12d3-a456-426614174000",
|
44
|
+
* link: "https://onramp.example.com/session?id=...",
|
45
|
+
* currency: "USD",
|
46
|
+
* currencyAmount: 10.52,
|
47
|
+
* destinationAmount: 10000000000000000000n, // 10 ETH if decimals 18
|
48
|
+
* timestamp: 1689812800,
|
49
|
+
* expiration: 1689842800,
|
50
|
+
* steps: [
|
51
|
+
* // ... further steps if any post-onramp swaps are needed
|
52
|
+
* ],
|
53
|
+
* intent: {
|
54
|
+
* onramp: "stripe",
|
55
|
+
* chainId: 1,
|
56
|
+
* tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
57
|
+
* receiver: "0x...",
|
58
|
+
* amount: "10000000000000000000"
|
59
|
+
* }
|
60
|
+
* }
|
61
|
+
* ```
|
62
|
+
*
|
63
|
+
* @param options - The options for preparing the onramp.
|
64
|
+
* @param options.client - Your thirdweb client.
|
65
|
+
* @param options.onramp - The onramp provider to use (e.g., "stripe", "coinbase", "transak").
|
66
|
+
* @param options.chainId - The destination chain ID.
|
67
|
+
* @param options.tokenAddress - The destination token address.
|
68
|
+
* @param options.receiver - The address that will receive the output token.
|
69
|
+
* @param [options.amount] - The desired token amount in wei.
|
70
|
+
* @param [options.purchaseData] - Arbitrary purchase data.
|
71
|
+
* @param [options.sender] - An optional address to associate as the onramp sender.
|
72
|
+
* @param [options.onrampTokenAddress] - The token to initially onramp to if the destination token is not supported by the provider.
|
73
|
+
* @param [options.onrampChainId] - The chain ID to initially onramp to if the destination chain is not supported.
|
74
|
+
* @param [options.currency] - The currency for the onramp (e.g., "USD", "GBP"). Defaults to user's preferred or "USD".
|
75
|
+
* @param [options.maxSteps] - Maximum number of post-onramp steps.
|
76
|
+
* @param [options.excludeChainIds] - Chain IDs to exclude from the route (string or array of strings).
|
77
|
+
*
|
78
|
+
* @returns A promise that resolves to the prepared onramp details, including the link and quote.
|
79
|
+
* @throws Will throw an error if there is an issue preparing the onramp.
|
80
|
+
* @bridge Onramp
|
81
|
+
* @beta
|
82
|
+
*/
|
83
|
+
async function prepare(options) {
|
84
|
+
const { client, onramp, chainId, tokenAddress, receiver, amount, purchaseData, sender, onrampTokenAddress, onrampChainId, currency, maxSteps, excludeChainIds, } = options;
|
85
|
+
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
86
|
+
const url = `${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/onramp/prepare`;
|
87
|
+
const apiRequestBody = {
|
88
|
+
onramp,
|
89
|
+
chainId: Number(chainId),
|
90
|
+
tokenAddress,
|
91
|
+
receiver,
|
92
|
+
};
|
93
|
+
if (amount !== undefined) {
|
94
|
+
apiRequestBody.amount = amount.toString();
|
95
|
+
}
|
96
|
+
if (purchaseData !== undefined) {
|
97
|
+
apiRequestBody.purchaseData = purchaseData;
|
98
|
+
}
|
99
|
+
if (sender !== undefined) {
|
100
|
+
apiRequestBody.sender = sender;
|
101
|
+
}
|
102
|
+
if (onrampTokenAddress !== undefined) {
|
103
|
+
apiRequestBody.onrampTokenAddress = onrampTokenAddress;
|
104
|
+
}
|
105
|
+
if (onrampChainId !== undefined) {
|
106
|
+
apiRequestBody.onrampChainId = Number(onrampChainId);
|
107
|
+
}
|
108
|
+
if (currency !== undefined) {
|
109
|
+
apiRequestBody.currency = currency;
|
110
|
+
}
|
111
|
+
if (maxSteps !== undefined) {
|
112
|
+
apiRequestBody.maxSteps = maxSteps;
|
113
|
+
}
|
114
|
+
if (excludeChainIds !== undefined) {
|
115
|
+
apiRequestBody.excludeChainIds = Array.isArray(excludeChainIds)
|
116
|
+
? excludeChainIds.join(",")
|
117
|
+
: excludeChainIds;
|
118
|
+
}
|
119
|
+
const response = await clientFetch(url, {
|
120
|
+
method: "POST",
|
121
|
+
headers: {
|
122
|
+
"Content-Type": "application/json",
|
123
|
+
},
|
124
|
+
body: (0, json_js_1.stringify)(apiRequestBody),
|
125
|
+
});
|
126
|
+
if (!response.ok) {
|
127
|
+
const errorJson = await response.json();
|
128
|
+
throw new Error(`${errorJson.code || response.status} | ${errorJson.message || response.statusText} - ${errorJson.correlationId || "N/A"}`);
|
129
|
+
}
|
130
|
+
const { data } = await response.json();
|
131
|
+
// Transform amounts from string to bigint where appropriate
|
132
|
+
const transformedSteps = data.steps.map((step) => ({
|
133
|
+
...step,
|
134
|
+
originAmount: BigInt(step.originAmount),
|
135
|
+
destinationAmount: BigInt(step.destinationAmount),
|
136
|
+
transactions: step.transactions.map((tx) => ({
|
137
|
+
...tx,
|
138
|
+
value: tx.value ? BigInt(tx.value) : undefined,
|
139
|
+
})),
|
140
|
+
}));
|
141
|
+
const intentFromResponse = {
|
142
|
+
...data.intent,
|
143
|
+
amount: data.intent.amount ? data.intent.amount : undefined,
|
144
|
+
};
|
145
|
+
return {
|
146
|
+
...data,
|
147
|
+
destinationAmount: BigInt(data.destinationAmount),
|
148
|
+
steps: transformedSteps,
|
149
|
+
intent: intentFromResponse,
|
150
|
+
};
|
151
|
+
}
|
152
|
+
//# sourceMappingURL=Onramp.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Onramp.js","sourceRoot":"","sources":["../../../src/bridge/Onramp.ts"],"names":[],"mappings":";;;AA+HA,0BAgGC;AA7ND,oDAAyD;AACzD,gDAAmD;AACnD,8CAA6C;AAI7C,yCAAyC;AACzC,qDAA2C;AAAlC,yGAAA,MAAM,OAAA;AA8Cf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACI,KAAK,UAAU,OAAO,CAC3B,OAAwB;IAExB,MAAM,EACJ,MAAM,EACN,MAAM,EACN,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,eAAe,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,oBAAoB,CAAC;IAEhE,MAAM,cAAc,GAAyB;QAC3C,MAAM;QACN,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;QACxB,YAAY;QACZ,QAAQ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|
+
exports.status = status;
|
4
|
+
const domains_js_1 = require("../utils/domains.js");
|
5
|
+
const fetch_js_1 = require("../utils/fetch.js");
|
6
|
+
/**
|
7
|
+
* Retrieves the status of an Onramp session created via {@link Bridge.Onramp.prepare}. The
|
8
|
+
* status will include any on-chain transactions that have occurred as a result of the onramp
|
9
|
+
* as well as any arbitrary `purchaseData` that was supplied when the onramp was
|
10
|
+
* prepared.
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```typescript
|
14
|
+
* import { Bridge } from "thirdweb";
|
15
|
+
*
|
16
|
+
* const onrampStatus = await Bridge.Onramp.status({
|
17
|
+
* id: "022218cc-96af-4291-b90c-dadcb47571ec",
|
18
|
+
* client: thirdwebClient,
|
19
|
+
* });
|
20
|
+
*
|
21
|
+
* // Possible results:
|
22
|
+
* // {
|
23
|
+
* // status: "CREATED",
|
24
|
+
* // transactions: [],
|
25
|
+
* // purchaseData: {
|
26
|
+
* // orderId: "abc-123",
|
27
|
+
* // },
|
28
|
+
* // }
|
29
|
+
* //
|
30
|
+
* // or
|
31
|
+
* // {
|
32
|
+
* // status: "PENDING",
|
33
|
+
* // transactions: [],
|
34
|
+
* // purchaseData: {
|
35
|
+
* // orderId: "abc-123",
|
36
|
+
* // },
|
37
|
+
* // }
|
38
|
+
* //
|
39
|
+
* // or
|
40
|
+
* // {
|
41
|
+
* // status: "COMPLETED",
|
42
|
+
* // transactions: [
|
43
|
+
* // {
|
44
|
+
* // chainId: 1,
|
45
|
+
* // transactionHash:
|
46
|
+
* // "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
|
47
|
+
* // },
|
48
|
+
* // ],
|
49
|
+
* // purchaseData: {
|
50
|
+
* // orderId: "abc-123",
|
51
|
+
* // },
|
52
|
+
* // }
|
53
|
+
* ```
|
54
|
+
*
|
55
|
+
* @param options - The options for fetching the onramp status.
|
56
|
+
* @param options.id - The UUID returned from {@link Bridge.Onramp.prepare}.
|
57
|
+
* @param options.client - Your thirdweb client instance.
|
58
|
+
*
|
59
|
+
* @returns A promise that resolves to the status of the onramp session.
|
60
|
+
*
|
61
|
+
* @throws Will throw an error if there is an issue fetching the status.
|
62
|
+
* @bridge Onramp
|
63
|
+
* @beta
|
64
|
+
*/
|
65
|
+
async function status(options) {
|
66
|
+
const { id, client } = options;
|
67
|
+
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
68
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/onramp/status`);
|
69
|
+
url.searchParams.set("id", id);
|
70
|
+
const response = await clientFetch(url.toString());
|
71
|
+
if (!response.ok) {
|
72
|
+
const errorJson = await response.json();
|
73
|
+
throw new Error(`${errorJson.code || response.status} | ${errorJson.message || response.statusText} - ${errorJson.correlationId || "N/A"}`);
|
74
|
+
}
|
75
|
+
const { data } = await response.json();
|
76
|
+
return data;
|
77
|
+
}
|
78
|
+
//# sourceMappingURL=OnrampStatus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"OnrampStatus.js","sourceRoot":"","sources":["../../../src/bridge/OnrampStatus.ts"],"names":[],"mappings":";;AAgEA,wBAiBC;AA/ED,oDAAyD;AACzD,gDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACI,KAAK,UAAU,MAAM,CAAC,OAAuB;IAClD,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE/B,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IACxE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAE/B,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CACb,GAAG,SAAS,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAM,MAAM,SAAS,CAAC,OAAO,IAAI,QAAQ,CAAC,UAAU,MAAM,SAAS,CAAC,aAAa,IAAI,KAAK,EAAE,CAC3H,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAA4B,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.routes = routes;
|
4
|
+
const domains_js_1 = require("../utils/domains.js");
|
4
5
|
const fetch_js_1 = require("../utils/fetch.js");
|
5
|
-
const constants_js_1 = require("./constants.js");
|
6
6
|
/**
|
7
7
|
* Retrieves supported Universal Bridge routes based on the provided filters.
|
8
8
|
*
|
@@ -121,7 +121,7 @@ const constants_js_1 = require("./constants.js");
|
|
121
121
|
async function routes(options) {
|
122
122
|
const { client, originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, maxSteps, sortBy, limit, offset, } = options;
|
123
123
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
124
|
-
const url = new URL(`${
|
124
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/routes`);
|
125
125
|
if (originChainId) {
|
126
126
|
url.searchParams.set("originChainId", originChainId.toString());
|
127
127
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../../src/bridge/Routes.ts"],"names":[],"mappings":";;AAyHA,wBAgDC;AAvKD,
|
1
|
+
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../../src/bridge/Routes.ts"],"names":[],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V,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,CAAC,IAAI,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAsB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/cjs/bridge/Sell.js
CHANGED
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.quote = quote;
|
4
4
|
exports.prepare = prepare;
|
5
5
|
const utils_js_1 = require("../chains/utils.js");
|
6
|
+
const domains_js_1 = require("../utils/domains.js");
|
6
7
|
const fetch_js_1 = require("../utils/fetch.js");
|
7
8
|
const json_js_1 = require("../utils/json.js");
|
8
|
-
const constants_js_1 = require("./constants.js");
|
9
9
|
/**
|
10
10
|
* Retrieves a Universal Bridge quote for the provided sell intent. The quote will specify the expected `destinationAmount` that will be received in exchange for the specified `originAmount`, which is specified with the `sellAmountWei` option.
|
11
11
|
*
|
@@ -103,12 +103,13 @@ const constants_js_1 = require("./constants.js");
|
|
103
103
|
async function quote(options) {
|
104
104
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, amount, client, maxSteps, } = options;
|
105
105
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
106
|
-
const url = new URL(`${
|
106
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/sell/quote`);
|
107
107
|
url.searchParams.set("originChainId", originChainId.toString());
|
108
108
|
url.searchParams.set("originTokenAddress", originTokenAddress);
|
109
109
|
url.searchParams.set("destinationChainId", destinationChainId.toString());
|
110
110
|
url.searchParams.set("destinationTokenAddress", destinationTokenAddress);
|
111
111
|
url.searchParams.set("sellAmountWei", amount.toString());
|
112
|
+
url.searchParams.set("amount", amount.toString());
|
112
113
|
if (typeof maxSteps !== "undefined") {
|
113
114
|
url.searchParams.set("maxSteps", maxSteps.toString());
|
114
115
|
}
|
@@ -154,7 +155,7 @@ async function quote(options) {
|
|
154
155
|
* This will return a quote that might look like:
|
155
156
|
* ```typescript
|
156
157
|
* {
|
157
|
-
* originAmount:
|
158
|
+
* originAmount: 2000000000n,
|
158
159
|
* destinationAmount: 9980000000000000000n,
|
159
160
|
* blockNumber: 22026509n,
|
160
161
|
* timestamp: 1741730936680,
|
@@ -163,11 +164,11 @@ async function quote(options) {
|
|
163
164
|
* {
|
164
165
|
* originToken: {
|
165
166
|
* chainId: 1,
|
166
|
-
* address: "
|
167
|
-
* symbol: "
|
168
|
-
* name: "
|
169
|
-
* decimals:
|
170
|
-
* priceUsd:
|
167
|
+
* address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
168
|
+
* symbol: "USDC",
|
169
|
+
* name: "USDC",
|
170
|
+
* decimals: 6,
|
171
|
+
* priceUsd: 1,
|
171
172
|
* iconUri: "https://..."
|
172
173
|
* },
|
173
174
|
* destinationToken: {
|
@@ -179,7 +180,7 @@ async function quote(options) {
|
|
179
180
|
* priceUsd: 2000,
|
180
181
|
* iconUri: "https://..."
|
181
182
|
* },
|
182
|
-
* originAmount:
|
183
|
+
* originAmount: 2000000000n,
|
183
184
|
* destinationAmount: 9980000000000000000n,
|
184
185
|
* estimatedExecutionTimeMs: 1000
|
185
186
|
* }
|
@@ -205,16 +206,16 @@ async function quote(options) {
|
|
205
206
|
* expiration: 1741730936680,
|
206
207
|
* intent: {
|
207
208
|
* originChainId: 1,
|
208
|
-
* originTokenAddress:
|
209
|
+
* originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
209
210
|
* destinationChainId: 10,
|
210
|
-
* destinationTokenAddress:
|
211
|
-
* amount:
|
211
|
+
* destinationTokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
212
|
+
* amount: 2000000000n
|
212
213
|
* }
|
213
214
|
* }
|
214
215
|
* ```
|
215
216
|
*
|
216
217
|
* ## Sending the transactions
|
217
|
-
* The `transactions` array is a series of
|
218
|
+
* The `transactions` array is a series of transactions ready to be executed (with `sendTransaction`) must be executed one after the other in order to fulfill the complete route. There are a few things to keep in mind when executing these transactions:
|
218
219
|
* - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
|
219
220
|
* - 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.
|
220
221
|
* - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
|
@@ -275,7 +276,7 @@ async function quote(options) {
|
|
275
276
|
async function prepare(options) {
|
276
277
|
const { originChainId, originTokenAddress, destinationChainId, destinationTokenAddress, amount, sender, receiver, client, purchaseData, maxSteps, } = options;
|
277
278
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
278
|
-
const url = new URL(`${
|
279
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/sell/prepare`);
|
279
280
|
const response = await clientFetch(url.toString(), {
|
280
281
|
method: "POST",
|
281
282
|
headers: {
|
@@ -283,6 +284,7 @@ async function prepare(options) {
|
|
283
284
|
},
|
284
285
|
body: (0, json_js_1.stringify)({
|
285
286
|
sellAmountWei: amount.toString(),
|
287
|
+
amount: amount.toString(),
|
286
288
|
originChainId: originChainId.toString(),
|
287
289
|
originTokenAddress,
|
288
290
|
destinationChainId: destinationChainId.toString(),
|
@@ -320,6 +322,8 @@ async function prepare(options) {
|
|
320
322
|
destinationChainId,
|
321
323
|
destinationTokenAddress,
|
322
324
|
amount,
|
325
|
+
sender,
|
326
|
+
receiver,
|
323
327
|
purchaseData,
|
324
328
|
},
|
325
329
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Sell.js","sourceRoot":"","sources":["../../../src/bridge/Sell.ts"],"names":[],"mappings":";;AAsGA,
|
1
|
+
{"version":3,"file":"Sell.js","sourceRoot":"","sources":["../../../src/bridge/Sell.ts"],"names":[],"mappings":";;AAsGA,sBA+CC;AAkKD,0BAwEC;AA9XD,iDAAiD;AAEjD,oDAAyD;AACzD,gDAAmD;AACnD,8CAA6C;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FG;AACI,KAAK,UAAU,KAAK,CAAC,OAAsB;IAChD,MAAM,EACJ,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,MAAM,EACN,MAAM,EACN,QAAQ,GACT,GAAG,OAAO,CAAC;IAEZ,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IACrE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,oBA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"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.status = status;
|
4
|
+
const domains_js_1 = require("../utils/domains.js");
|
4
5
|
const fetch_js_1 = require("../utils/fetch.js");
|
5
|
-
const constants_js_1 = require("./constants.js");
|
6
6
|
/**
|
7
7
|
* Retrieves a Universal Bridge quote for the provided sell intent. The quote will specify the expected `destinationAmount` that will be received in exchange for the specified `originAmount`, which is specified with the `sellAmountWei` option.
|
8
8
|
*
|
@@ -105,7 +105,7 @@ async function status(options) {
|
|
105
105
|
const { transactionHash, client } = options;
|
106
106
|
const chainId = "chainId" in options ? options.chainId : options.chain.id;
|
107
107
|
const clientFetch = (0, fetch_js_1.getClientFetch)(client);
|
108
|
-
const url = new URL(`${
|
108
|
+
const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/status`);
|
109
109
|
url.searchParams.set("transactionHash", transactionHash);
|
110
110
|
url.searchParams.set("chainId", chainId.toString());
|
111
111
|
const response = await clientFetch(url.toString());
|
@@ -117,6 +117,7 @@ async function status(options) {
|
|
117
117
|
if (data.status === "FAILED") {
|
118
118
|
return {
|
119
119
|
status: "FAILED",
|
120
|
+
paymentId: data.paymentId,
|
120
121
|
transactions: data.transactions,
|
121
122
|
};
|
122
123
|
}
|
@@ -129,11 +130,18 @@ async function status(options) {
|
|
129
130
|
originTokenAddress: data.originTokenAddress,
|
130
131
|
destinationTokenAddress: data.destinationTokenAddress,
|
131
132
|
transactions: data.transactions,
|
133
|
+
originToken: data.originToken,
|
134
|
+
destinationToken: data.destinationToken,
|
135
|
+
sender: data.sender,
|
136
|
+
receiver: data.receiver,
|
137
|
+
paymentId: data.paymentId,
|
138
|
+
purchaseData: data.purchaseData,
|
132
139
|
};
|
133
140
|
}
|
134
141
|
if (data.status === "NOT_FOUND") {
|
135
142
|
return {
|
136
143
|
status: "NOT_FOUND",
|
144
|
+
paymentId: data.paymentId,
|
137
145
|
transactions: [],
|
138
146
|
};
|
139
147
|
}
|
@@ -146,6 +154,11 @@ async function status(options) {
|
|
146
154
|
originTokenAddress: data.originTokenAddress,
|
147
155
|
destinationTokenAddress: data.destinationTokenAddress,
|
148
156
|
transactions: data.transactions,
|
157
|
+
originToken: data.originToken,
|
158
|
+
destinationToken: data.destinationToken,
|
159
|
+
sender: data.sender,
|
160
|
+
receiver: data.receiver,
|
161
|
+
paymentId: data.paymentId,
|
149
162
|
purchaseData: data.purchaseData,
|
150
163
|
};
|
151
164
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/bridge/Status.ts"],"names":[],"mappings":";;AAyGA,
|
1
|
+
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../../src/bridge/Status.ts"],"names":[],"mappings":";;AAyGA,wBAoEC;AA1KD,oDAAyD;AACzD,gDAAmD;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AACI,KAAK,UAAU,MAAM,CAAC,OAAuB;IAClD,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC5C,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;IAE1E,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,IAAA,+BAAkB,EAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IACjE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;IACzD,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEpD,MAAM,QAA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