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.
Files changed (348) hide show
  1. package/dist/cjs/bridge/Buy.js +17 -13
  2. package/dist/cjs/bridge/Buy.js.map +1 -1
  3. package/dist/cjs/bridge/Chains.js +2 -2
  4. package/dist/cjs/bridge/Chains.js.map +1 -1
  5. package/dist/cjs/bridge/Onramp.js +152 -0
  6. package/dist/cjs/bridge/Onramp.js.map +1 -0
  7. package/dist/cjs/bridge/OnrampStatus.js +78 -0
  8. package/dist/cjs/bridge/OnrampStatus.js.map +1 -0
  9. package/dist/cjs/bridge/Routes.js +2 -2
  10. package/dist/cjs/bridge/Routes.js.map +1 -1
  11. package/dist/cjs/bridge/Sell.js +18 -14
  12. package/dist/cjs/bridge/Sell.js.map +1 -1
  13. package/dist/cjs/bridge/Status.js +15 -2
  14. package/dist/cjs/bridge/Status.js.map +1 -1
  15. package/dist/cjs/bridge/Transfer.js +229 -0
  16. package/dist/cjs/bridge/Transfer.js.map +1 -0
  17. package/dist/cjs/bridge/index.js +3 -1
  18. package/dist/cjs/bridge/index.js.map +1 -1
  19. package/dist/cjs/bridge/types/BridgeAction.js +3 -0
  20. package/dist/cjs/bridge/types/BridgeAction.js.map +1 -0
  21. package/dist/cjs/bridge/types/Token.js +3 -0
  22. package/dist/cjs/bridge/types/Token.js.map +1 -0
  23. package/dist/cjs/extensions/ens/resolve-l2-name.js +0 -2
  24. package/dist/cjs/extensions/ens/resolve-l2-name.js.map +1 -1
  25. package/dist/cjs/pay/buyWithCrypto/getQuote.js +159 -53
  26. package/dist/cjs/pay/buyWithCrypto/getQuote.js.map +1 -1
  27. package/dist/cjs/pay/buyWithCrypto/getStatus.js +160 -14
  28. package/dist/cjs/pay/buyWithCrypto/getStatus.js.map +1 -1
  29. package/dist/cjs/pay/buyWithCrypto/getTransfer.js +95 -37
  30. package/dist/cjs/pay/buyWithCrypto/getTransfer.js.map +1 -1
  31. package/dist/cjs/pay/buyWithFiat/getQuote.js +129 -33
  32. package/dist/cjs/pay/buyWithFiat/getQuote.js.map +1 -1
  33. package/dist/cjs/pay/buyWithFiat/getStatus.js +71 -20
  34. package/dist/cjs/pay/buyWithFiat/getStatus.js.map +1 -1
  35. package/dist/cjs/pay/utils/commonTypes.js +1 -1
  36. package/dist/cjs/pay/utils/commonTypes.js.map +1 -1
  37. package/dist/cjs/pay/utils/definitions.js +1 -43
  38. package/dist/cjs/pay/utils/definitions.js.map +1 -1
  39. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
  40. package/dist/cjs/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
  41. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +44 -38
  42. package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  43. package/dist/cjs/react/core/utils/wallet.js +15 -0
  44. package/dist/cjs/react/core/utils/wallet.js.map +1 -1
  45. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +1 -1
  46. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  47. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -23
  48. package/dist/cjs/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  49. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js +1 -1
  50. package/dist/cjs/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  51. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
  52. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  53. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +0 -177
  54. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  55. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
  56. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
  57. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
  58. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
  59. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +0 -15
  60. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  61. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -60
  62. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
  63. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
  64. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  65. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
  66. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
  67. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +4 -4
  68. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
  69. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +83 -34
  70. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
  71. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js +133 -0
  72. package/dist/cjs/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
  73. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
  74. package/dist/cjs/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  75. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js +9 -1
  76. package/dist/cjs/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  77. package/dist/cjs/utils/any-evm/zksync/constants.js +1 -0
  78. package/dist/cjs/utils/any-evm/zksync/constants.js.map +1 -1
  79. package/dist/cjs/utils/domains.js +3 -0
  80. package/dist/cjs/utils/domains.js.map +1 -1
  81. package/dist/cjs/version.js +1 -1
  82. package/dist/cjs/version.js.map +1 -1
  83. package/dist/esm/bridge/Buy.js +17 -13
  84. package/dist/esm/bridge/Buy.js.map +1 -1
  85. package/dist/esm/bridge/Chains.js +2 -2
  86. package/dist/esm/bridge/Chains.js.map +1 -1
  87. package/dist/esm/bridge/Onramp.js +147 -0
  88. package/dist/esm/bridge/Onramp.js.map +1 -0
  89. package/dist/esm/bridge/OnrampStatus.js +75 -0
  90. package/dist/esm/bridge/OnrampStatus.js.map +1 -0
  91. package/dist/esm/bridge/Routes.js +2 -2
  92. package/dist/esm/bridge/Routes.js.map +1 -1
  93. package/dist/esm/bridge/Sell.js +18 -14
  94. package/dist/esm/bridge/Sell.js.map +1 -1
  95. package/dist/esm/bridge/Status.js +15 -2
  96. package/dist/esm/bridge/Status.js.map +1 -1
  97. package/dist/esm/bridge/Transfer.js +226 -0
  98. package/dist/esm/bridge/Transfer.js.map +1 -0
  99. package/dist/esm/bridge/index.js +2 -0
  100. package/dist/esm/bridge/index.js.map +1 -1
  101. package/dist/esm/bridge/types/BridgeAction.js +2 -0
  102. package/dist/esm/bridge/types/BridgeAction.js.map +1 -0
  103. package/dist/esm/bridge/types/Token.js +2 -0
  104. package/dist/esm/bridge/types/Token.js.map +1 -0
  105. package/dist/esm/extensions/ens/resolve-l2-name.js +0 -2
  106. package/dist/esm/extensions/ens/resolve-l2-name.js.map +1 -1
  107. package/dist/esm/pay/buyWithCrypto/getQuote.js +159 -53
  108. package/dist/esm/pay/buyWithCrypto/getQuote.js.map +1 -1
  109. package/dist/esm/pay/buyWithCrypto/getStatus.js +160 -14
  110. package/dist/esm/pay/buyWithCrypto/getStatus.js.map +1 -1
  111. package/dist/esm/pay/buyWithCrypto/getTransfer.js +95 -37
  112. package/dist/esm/pay/buyWithCrypto/getTransfer.js.map +1 -1
  113. package/dist/esm/pay/buyWithFiat/getQuote.js +129 -33
  114. package/dist/esm/pay/buyWithFiat/getQuote.js.map +1 -1
  115. package/dist/esm/pay/buyWithFiat/getStatus.js +71 -20
  116. package/dist/esm/pay/buyWithFiat/getStatus.js.map +1 -1
  117. package/dist/esm/pay/utils/commonTypes.js +1 -1
  118. package/dist/esm/pay/utils/commonTypes.js.map +1 -1
  119. package/dist/esm/pay/utils/definitions.js +0 -35
  120. package/dist/esm/pay/utils/definitions.js.map +1 -1
  121. package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js +1 -3
  122. package/dist/esm/react/core/hooks/pay/useBuyWithFiatStatus.js.map +1 -1
  123. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +44 -38
  124. package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
  125. package/dist/esm/react/core/utils/wallet.js +15 -0
  126. package/dist/esm/react/core/utils/wallet.js.map +1 -1
  127. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +1 -1
  128. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  129. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js +1 -23
  130. package/dist/esm/react/web/ui/ConnectWallet/TransactionsScreen.js.map +1 -1
  131. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js +1 -1
  132. package/dist/esm/react/web/ui/ConnectWallet/locale/en.js.map +1 -1
  133. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +1 -1
  134. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  135. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js +4 -180
  136. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.js.map +1 -1
  137. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js +2 -10
  138. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.js.map +1 -1
  139. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js +5 -8
  140. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.js.map +1 -1
  141. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js +2 -16
  142. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.js.map +1 -1
  143. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js +0 -59
  144. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.js.map +1 -1
  145. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js +3 -1
  146. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.js.map +1 -1
  147. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js +1 -1
  148. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.js.map +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js +1 -1
  150. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.js.map +1 -1
  151. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js +84 -34
  152. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.js.map +1 -1
  153. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js +130 -0
  154. package/dist/esm/react/web/ui/TransactionButton/DepositScreen.js.map +1 -0
  155. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js +4 -3
  156. package/dist/esm/react/web/ui/TransactionButton/ExecutingScreen.js.map +1 -1
  157. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js +9 -1
  158. package/dist/esm/react/web/ui/TransactionButton/TransactionModal.js.map +1 -1
  159. package/dist/esm/utils/any-evm/zksync/constants.js +1 -0
  160. package/dist/esm/utils/any-evm/zksync/constants.js.map +1 -1
  161. package/dist/esm/utils/domains.js +3 -0
  162. package/dist/esm/utils/domains.js.map +1 -1
  163. package/dist/esm/version.js +1 -1
  164. package/dist/esm/version.js.map +1 -1
  165. package/dist/types/bridge/Buy.d.ts +11 -9
  166. package/dist/types/bridge/Buy.d.ts.map +1 -1
  167. package/dist/types/bridge/Onramp.d.ts +123 -0
  168. package/dist/types/bridge/Onramp.d.ts.map +1 -0
  169. package/dist/types/bridge/OnrampStatus.d.ts +108 -0
  170. package/dist/types/bridge/OnrampStatus.d.ts.map +1 -0
  171. package/dist/types/bridge/Sell.d.ts +13 -11
  172. package/dist/types/bridge/Sell.d.ts.map +1 -1
  173. package/dist/types/bridge/Status.d.ts.map +1 -1
  174. package/dist/types/bridge/Transfer.d.ts +199 -0
  175. package/dist/types/bridge/Transfer.d.ts.map +1 -0
  176. package/dist/types/bridge/index.d.ts +7 -3
  177. package/dist/types/bridge/index.d.ts.map +1 -1
  178. package/dist/types/bridge/types/BridgeAction.d.ts +2 -0
  179. package/dist/types/bridge/types/BridgeAction.d.ts.map +1 -0
  180. package/dist/types/bridge/types/Quote.d.ts +3 -65
  181. package/dist/types/bridge/types/Quote.d.ts.map +1 -1
  182. package/dist/types/bridge/types/Route.d.ts +38 -17
  183. package/dist/types/bridge/types/Route.d.ts.map +1 -1
  184. package/dist/types/bridge/types/Status.d.ts +15 -0
  185. package/dist/types/bridge/types/Status.d.ts.map +1 -1
  186. package/dist/types/bridge/types/Token.d.ts +11 -0
  187. package/dist/types/bridge/types/Token.d.ts.map +1 -0
  188. package/dist/types/extensions/ens/resolve-l2-name.d.ts.map +1 -1
  189. package/dist/types/pay/buyWithCrypto/commonTypes.d.ts +0 -9
  190. package/dist/types/pay/buyWithCrypto/commonTypes.d.ts.map +1 -1
  191. package/dist/types/pay/buyWithCrypto/getQuote.d.ts.map +1 -1
  192. package/dist/types/pay/buyWithCrypto/getStatus.d.ts +1 -1
  193. package/dist/types/pay/buyWithCrypto/getStatus.d.ts.map +1 -1
  194. package/dist/types/pay/buyWithCrypto/getTransfer.d.ts.map +1 -1
  195. package/dist/types/pay/buyWithFiat/getQuote.d.ts.map +1 -1
  196. package/dist/types/pay/buyWithFiat/getStatus.d.ts +1 -12
  197. package/dist/types/pay/buyWithFiat/getStatus.d.ts.map +1 -1
  198. package/dist/types/pay/utils/commonTypes.d.ts +1 -1
  199. package/dist/types/pay/utils/commonTypes.d.ts.map +1 -1
  200. package/dist/types/pay/utils/definitions.d.ts +0 -35
  201. package/dist/types/pay/utils/definitions.d.ts.map +1 -1
  202. package/dist/types/react/core/hooks/pay/useBuyWithFiatStatus.d.ts.map +1 -1
  203. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -0
  204. package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  205. package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
  206. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  207. package/dist/types/react/web/ui/ConnectWallet/TransactionsScreen.d.ts.map +1 -1
  208. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts +1 -30
  209. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.d.ts.map +1 -1
  210. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts +2 -0
  211. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/types.d.ts.map +1 -1
  212. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts +2 -0
  213. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.d.ts.map +1 -1
  214. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts +0 -5
  215. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.d.ts.map +1 -1
  216. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts +1 -3
  217. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.d.ts.map +1 -1
  218. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.d.ts.map +1 -1
  219. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts +0 -1
  220. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.d.ts.map +1 -1
  221. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts +8 -4
  222. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.d.ts.map +1 -1
  223. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts +15 -0
  224. package/dist/types/react/web/ui/TransactionButton/DepositScreen.d.ts.map +1 -0
  225. package/dist/types/react/web/ui/TransactionButton/ExecutingScreen.d.ts.map +1 -1
  226. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts +1 -0
  227. package/dist/types/react/web/ui/TransactionButton/TransactionModal.d.ts.map +1 -1
  228. package/dist/types/utils/any-evm/zksync/constants.d.ts.map +1 -1
  229. package/dist/types/utils/domains.d.ts +6 -0
  230. package/dist/types/utils/domains.d.ts.map +1 -1
  231. package/dist/types/version.d.ts +1 -1
  232. package/dist/types/version.d.ts.map +1 -1
  233. package/package.json +15 -15
  234. package/src/bridge/Buy.ts +19 -13
  235. package/src/bridge/Chains.ts +2 -2
  236. package/src/bridge/Onramp.test.ts +118 -0
  237. package/src/bridge/Onramp.ts +244 -0
  238. package/src/bridge/OnrampStatus.ts +133 -0
  239. package/src/bridge/Routes.ts +2 -2
  240. package/src/bridge/Sell.ts +20 -14
  241. package/src/bridge/Status.ts +15 -2
  242. package/src/bridge/Transfer.test.ts +76 -0
  243. package/src/bridge/Transfer.ts +270 -0
  244. package/src/bridge/index.ts +12 -3
  245. package/src/bridge/types/BridgeAction.ts +1 -0
  246. package/src/bridge/types/Quote.ts +3 -65
  247. package/src/bridge/types/Route.ts +42 -17
  248. package/src/bridge/types/Status.ts +15 -1
  249. package/src/bridge/types/Token.ts +11 -0
  250. package/src/extensions/ens/resolve-l2-name.ts +0 -2
  251. package/src/pay/buyWithCrypto/commonTypes.ts +0 -10
  252. package/src/pay/buyWithCrypto/getQuote.ts +210 -100
  253. package/src/pay/buyWithCrypto/getStatus.ts +213 -20
  254. package/src/pay/buyWithCrypto/getTransfer.ts +129 -61
  255. package/src/pay/buyWithFiat/getQuote.ts +184 -33
  256. package/src/pay/buyWithFiat/getStatus.ts +101 -42
  257. package/src/pay/convert/cryptoToFiat.test.ts +7 -5
  258. package/src/pay/convert/fiatToCrypto.test.ts +6 -4
  259. package/src/pay/utils/commonTypes.ts +1 -1
  260. package/src/pay/utils/definitions.ts +0 -48
  261. package/src/react/core/hooks/pay/useBuyWithFiatStatus.ts +0 -2
  262. package/src/react/core/hooks/transaction/useSendTransaction.ts +53 -52
  263. package/src/react/core/utils/wallet.ts +15 -0
  264. package/src/react/web/hooks/transaction/useSendTransaction.tsx +1 -0
  265. package/src/react/web/ui/ConnectWallet/TransactionsScreen.tsx +5 -64
  266. package/src/react/web/ui/ConnectWallet/locale/en.ts +1 -1
  267. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +3 -1
  268. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatSteps.tsx +3 -510
  269. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/OnRampScreen.tsx +2 -12
  270. package/src/react/web/ui/ConnectWallet/screens/Buy/main/types.ts +2 -0
  271. package/src/react/web/ui/ConnectWallet/screens/Buy/main/useBuyTxStates.ts +19 -20
  272. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/SwapDetailsScreen.tsx +1 -37
  273. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.test.ts +1 -95
  274. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/statusMeta.ts +0 -69
  275. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/WalletRow.tsx +3 -1
  276. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/fetchBalancesForWallet.tsx +1 -1
  277. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/pendingSwapTx.ts +1 -3
  278. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/useSwapSupportedChains.ts +118 -63
  279. package/src/react/web/ui/TransactionButton/DepositScreen.tsx +295 -0
  280. package/src/react/web/ui/TransactionButton/ExecutingScreen.tsx +4 -5
  281. package/src/react/web/ui/TransactionButton/TransactionModal.tsx +20 -1
  282. package/src/utils/any-evm/zksync/constants.ts +1 -0
  283. package/src/utils/domain.test.ts +1 -0
  284. package/src/utils/domains.ts +8 -0
  285. package/src/version.ts +1 -1
  286. package/dist/cjs/bridge/constants.js +0 -5
  287. package/dist/cjs/bridge/constants.js.map +0 -1
  288. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -37
  289. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
  290. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -86
  291. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
  292. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -25
  293. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
  294. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -54
  295. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
  296. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -52
  297. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
  298. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -81
  299. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
  300. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -17
  301. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
  302. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -138
  303. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
  304. package/dist/esm/bridge/constants.js +0 -2
  305. package/dist/esm/bridge/constants.js.map +0 -1
  306. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js +0 -34
  307. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.js.map +0 -1
  308. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js +0 -83
  309. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.js.map +0 -1
  310. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js +0 -22
  311. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.js.map +0 -1
  312. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js +0 -51
  313. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.js.map +0 -1
  314. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js +0 -48
  315. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.js.map +0 -1
  316. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js +0 -78
  317. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.js.map +0 -1
  318. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js +0 -14
  319. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.js.map +0 -1
  320. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js +0 -135
  321. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.js.map +0 -1
  322. package/dist/types/bridge/constants.d.ts +0 -2
  323. package/dist/types/bridge/constants.d.ts.map +0 -1
  324. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts +0 -26
  325. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.d.ts.map +0 -1
  326. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts +0 -16
  327. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.d.ts.map +0 -1
  328. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts +0 -23
  329. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.d.ts.map +0 -1
  330. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts +0 -10
  331. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.d.ts.map +0 -1
  332. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts +0 -9
  333. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.d.ts.map +0 -1
  334. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts +0 -14
  335. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.d.ts.map +0 -1
  336. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts +0 -14
  337. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.d.ts.map +0 -1
  338. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts +0 -21
  339. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.d.ts.map +0 -1
  340. package/src/bridge/constants.ts +0 -1
  341. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatTxDetailsTable.tsx +0 -142
  342. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwap.tsx +0 -170
  343. package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/PostOnRampSwapFlow.tsx +0 -63
  344. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistory.tsx +0 -163
  345. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/BuyTxHistoryButton.tsx +0 -127
  346. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/FiatDetailsScreen.tsx +0 -138
  347. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/TxDetailsScreen.tsx +0 -45
  348. package/src/react/web/ui/ConnectWallet/screens/Buy/pay-transactions/useBuyTransactionsToShow.ts +0 -191
@@ -0,0 +1,270 @@
1
+ import type { Address as ox__Address } from "ox";
2
+ import { defineChain } from "../chains/utils.js";
3
+ import type { ThirdwebClient } from "../client/client.js";
4
+ import { getThirdwebBaseUrl } from "../utils/domains.js";
5
+ import { getClientFetch } from "../utils/fetch.js";
6
+ import { stringify } from "../utils/json.js";
7
+ import type { PreparedQuote } from "./types/Quote.js";
8
+
9
+ /**
10
+ * Prepares a **finalized** Universal Bridge quote for the provided transfer request with transaction data.
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
15
+ *
16
+ * const quote = await Bridge.Transfer.prepare({
17
+ * chainId: 1,
18
+ * tokenAddress: NATIVE_TOKEN_ADDRESS,
19
+ * amount: toWei("0.01"),
20
+ * sender: "0x...",
21
+ * receiver: "0x...",
22
+ * client: thirdwebClient,
23
+ * });
24
+ * ```
25
+ *
26
+ * This will return a quote that might look like:
27
+ * ```typescript
28
+ * {
29
+ * originAmount: 10000026098875381n,
30
+ * destinationAmount: 10000000000000000n,
31
+ * blockNumber: 22026509n,
32
+ * timestamp: 1741730936680,
33
+ * estimatedExecutionTimeMs: 1000
34
+ * steps: [
35
+ * {
36
+ * originToken: {
37
+ * chainId: 1,
38
+ * address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
39
+ * symbol: "ETH",
40
+ * name: "Ethereum",
41
+ * decimals: 18,
42
+ * priceUsd: 2000,
43
+ * iconUri: "https://..."
44
+ * },
45
+ * destinationToken: {
46
+ * chainId: 1,
47
+ * address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
48
+ * symbol: "ETH",
49
+ * name: "Ethereum",
50
+ * decimals: 18,
51
+ * priceUsd: 2000,
52
+ * iconUri: "https://..."
53
+ * },
54
+ * originAmount: 10000026098875381n,
55
+ * destinationAmount: 10000000000000000n,
56
+ * estimatedExecutionTimeMs: 1000
57
+ * transactions: [
58
+ * {
59
+ * action: "approval",
60
+ * id: "0x",
61
+ * to: "0x...",
62
+ * data: "0x...",
63
+ * chainId: 1,
64
+ * type: "eip1559"
65
+ * },
66
+ * {
67
+ * action: "transfer",
68
+ * to: "0x...",
69
+ * value: 10000026098875381n,
70
+ * data: "0x...",
71
+ * chainId: 1,
72
+ * type: "eip1559"
73
+ * }
74
+ * ]
75
+ * }
76
+ * ],
77
+ * expiration: 1741730936680,
78
+ * intent: {
79
+ * chainId: 1,
80
+ * tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
81
+ * amount: 10000000000000000n,
82
+ * sender: "0x...",
83
+ * receiver: "0x..."
84
+ * }
85
+ * }
86
+ * ```
87
+ *
88
+ * ## Sending the transactions
89
+ * The `transactions` array is a series of [ox](https://oxlib.sh) EIP-1559 transactions that 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:
90
+ * - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
91
+ * - 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.
92
+ * - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
93
+ *
94
+ * NOTE: To get the status of each non-approval transaction, use `Bridge.status` rather than checking for transaction inclusion. This function will ensure full completion of the transfer.
95
+ *
96
+ * You can access this functions input and output types with `Transfer.prepare.Options` and `Transfer.prepare.Result`, respectively.
97
+ *
98
+ * You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option.
99
+ *
100
+ * ```ts
101
+ * const quote = await Bridge.Transfer.prepare({
102
+ * chainId: 1,
103
+ * tokenAddress: NATIVE_TOKEN_ADDRESS,
104
+ * amount: toWei("0.01"),
105
+ * sender: "0x...",
106
+ * receiver: "0x...",
107
+ * purchaseData: {
108
+ * reference: "payment-123",
109
+ * metadata: {
110
+ * note: "Transfer to Alice"
111
+ * }
112
+ * },
113
+ * client: thirdwebClient,
114
+ * });
115
+ * ```
116
+ *
117
+ * ## Fees
118
+ * There may be fees associated with the transfer. These fees are paid by the `feePayer` address, which defaults to the `sender` address. You can specify a different address with the `feePayer` option. If you do not specify an option or explicitly specify `sender`, the fees will be added to the input amount. If you specify the `receiver` as the fee payer the fees will be subtracted from the destination amount.
119
+ *
120
+ * For example, if you were to request a transfer with `feePayer` set to `receiver`:
121
+ * ```typescript
122
+ * const quote = await Bridge.Transfer.prepare({
123
+ * chainId: 1,
124
+ * tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
125
+ * amount: 100_000_000n, // 100 USDC
126
+ * sender: "0x...",
127
+ * receiver: "0x...",
128
+ * feePayer: "receiver",
129
+ * client: thirdwebClient,
130
+ * });
131
+ * ```
132
+ *
133
+ * The returned quote might look like:
134
+ * ```typescript
135
+ * {
136
+ * originAmount: 100_000_000n, // 100 USDC
137
+ * destinationAmount: 99_970_000n, // 99.97 USDC
138
+ * ...
139
+ * }
140
+ * ```
141
+ *
142
+ * If you were to request a transfer with `feePayer` set to `sender`:
143
+ * ```typescript
144
+ * const quote = await Bridge.Transfer.prepare({
145
+ * chainId: 1,
146
+ * tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
147
+ * amount: 100_000_000n, // 100 USDC
148
+ * sender: "0x...",
149
+ * receiver: "0x...",
150
+ * feePayer: "sender",
151
+ * client: thirdwebClient,
152
+ * });
153
+ * ```
154
+ *
155
+ * The returned quote might look like:
156
+ * ```typescript
157
+ * {
158
+ * originAmount: 100_030_000n, // 100.03 USDC
159
+ * destinationAmount: 100_000_000n, // 100 USDC
160
+ * ...
161
+ * }
162
+ * ```
163
+ *
164
+ * @param options - The options for the quote.
165
+ * @param options.chainId - The chain ID of the token.
166
+ * @param options.tokenAddress - The address of the token.
167
+ * @param options.amount - The amount of the token to transfer.
168
+ * @param options.sender - The address of the sender.
169
+ * @param options.receiver - The address of the recipient.
170
+ * @param options.purchaseData - Arbitrary data to be passed to the transfer function and included with any webhooks or status calls.
171
+ * @param options.client - Your thirdweb client.
172
+ * @param [options.feePayer] - The address that will pay the fees for the transfer. If not specified, the sender will be used. Values can be "sender" or "receiver".
173
+ *
174
+ * @returns A promise that resolves to a finalized quote and transactions for the requested transfer.
175
+ *
176
+ * @throws Will throw an error if there is an issue fetching the quote.
177
+ * @bridge Transfer
178
+ * @beta
179
+ */
180
+ export async function prepare(
181
+ options: prepare.Options,
182
+ ): Promise<prepare.Result> {
183
+ const {
184
+ chainId,
185
+ tokenAddress,
186
+ sender,
187
+ receiver,
188
+ client,
189
+ amount,
190
+ purchaseData,
191
+ feePayer,
192
+ } = options;
193
+
194
+ const clientFetch = getClientFetch(client);
195
+ const url = new URL(`${getThirdwebBaseUrl("bridge")}/v1/transfer/prepare`);
196
+
197
+ const response = await clientFetch(url.toString(), {
198
+ method: "POST",
199
+ headers: {
200
+ "Content-Type": "application/json",
201
+ },
202
+ body: stringify({
203
+ transferAmountWei: amount.toString(), // legacy
204
+ amount: amount.toString(),
205
+ chainId: chainId.toString(),
206
+ tokenAddress,
207
+ sender,
208
+ receiver,
209
+ purchaseData,
210
+ feePayer,
211
+ }),
212
+ });
213
+ if (!response.ok) {
214
+ const errorJson = await response.json();
215
+ throw new Error(
216
+ `${errorJson.code} | ${errorJson.message} - ${errorJson.correlationId}`,
217
+ );
218
+ }
219
+
220
+ const { data }: { data: PreparedQuote } = await response.json();
221
+ return {
222
+ originAmount: BigInt(data.originAmount),
223
+ destinationAmount: BigInt(data.destinationAmount),
224
+ blockNumber: data.blockNumber ? BigInt(data.blockNumber) : undefined,
225
+ timestamp: data.timestamp,
226
+ estimatedExecutionTimeMs: data.estimatedExecutionTimeMs,
227
+ steps: data.steps.map((step) => ({
228
+ ...step,
229
+ transactions: step.transactions.map((transaction) => ({
230
+ ...transaction,
231
+ value: transaction.value ? BigInt(transaction.value) : undefined,
232
+ client,
233
+ chain: defineChain(transaction.chainId),
234
+ })),
235
+ })),
236
+ intent: {
237
+ chainId,
238
+ tokenAddress,
239
+ amount,
240
+ sender,
241
+ receiver,
242
+ feePayer,
243
+ },
244
+ };
245
+ }
246
+
247
+ export declare namespace prepare {
248
+ type Options = {
249
+ chainId: number;
250
+ tokenAddress: ox__Address.Address;
251
+ sender: ox__Address.Address;
252
+ receiver: ox__Address.Address;
253
+ amount: bigint;
254
+ client: ThirdwebClient;
255
+ purchaseData?: unknown;
256
+ feePayer?: "sender" | "receiver";
257
+ };
258
+
259
+ type Result = PreparedQuote & {
260
+ intent: {
261
+ chainId: number;
262
+ tokenAddress: ox__Address.Address;
263
+ amount: bigint;
264
+ sender: ox__Address.Address;
265
+ receiver: ox__Address.Address;
266
+ purchaseData?: unknown;
267
+ feePayer?: "sender" | "receiver";
268
+ };
269
+ };
270
+ }
@@ -1,10 +1,19 @@
1
1
  export * as Buy from "./Buy.js";
2
2
  export * as Sell from "./Sell.js";
3
+ export * as Transfer from "./Transfer.js";
4
+ export * as Onramp from "./Onramp.js";
3
5
  export { status } from "./Status.js";
4
6
  export { routes } from "./Routes.js";
5
7
  export { chains } from "./Chains.js";
6
8
 
7
- export type { Status } from "./types/Status.js";
8
- export type { Route } from "./types/Route.js";
9
- export type { Quote, PreparedQuote } from "./types/Quote.js";
10
9
  export type { Chain } from "./types/Chain.js";
10
+ export type { Quote, PreparedQuote } from "./types/Quote.js";
11
+ export type {
12
+ Route,
13
+ RouteQuoteStep,
14
+ RouteStep,
15
+ RouteTransaction,
16
+ } from "./types/Route.js";
17
+ export type { Status } from "./types/Status.js";
18
+ export type { Token } from "./types/Token.js";
19
+ export type { BridgeAction } from "./types/BridgeAction.js";
@@ -0,0 +1 @@
1
+ export type BridgeAction = "approval" | "transfer" | "buy" | "sell";
@@ -1,6 +1,4 @@
1
- import type { Hex as ox__Hex } from "ox";
2
- import type { Chain } from "../../chains/types.js";
3
- import type { ThirdwebClient } from "../../client/client.js";
1
+ import type { RouteQuoteStep, RouteStep } from "./Route.js";
4
2
 
5
3
  export type Quote = {
6
4
  /**
@@ -26,29 +24,7 @@ export type Quote = {
26
24
  /**
27
25
  * The steps required to complete the quote.
28
26
  */
29
- steps: Array<{
30
- originToken: {
31
- chainId: number;
32
- address: ox__Hex.Hex;
33
- symbol: string;
34
- name: string;
35
- decimals: number;
36
- priceUsd: number;
37
- iconUri: string;
38
- };
39
- destinationToken: {
40
- chainId: number;
41
- address: ox__Hex.Hex;
42
- symbol: string;
43
- name: string;
44
- decimals: number;
45
- priceUsd: number;
46
- iconUri: string;
47
- };
48
- originAmount: bigint;
49
- destinationAmount: bigint;
50
- estimatedExecutionTimeMs: number;
51
- }>;
27
+ steps: RouteQuoteStep[];
52
28
  };
53
29
 
54
30
  export type PreparedQuote = {
@@ -79,43 +55,5 @@ export type PreparedQuote = {
79
55
  /**
80
56
  * A series of steps required to complete the quote, along with the transactions to execute in order.
81
57
  */
82
- steps: Array<{
83
- originToken: {
84
- chainId: number;
85
- address: ox__Hex.Hex;
86
- symbol: string;
87
- name: string;
88
- decimals: number;
89
- priceUsd: number;
90
- iconUri: string;
91
- };
92
- destinationToken: {
93
- chainId: number;
94
- address: ox__Hex.Hex;
95
- symbol: string;
96
- name: string;
97
- decimals: number;
98
- priceUsd: number;
99
- iconUri: string;
100
- };
101
- originAmount: bigint;
102
- destinationAmount: bigint;
103
- estimatedExecutionTimeMs: number;
104
- transactions: Array<{
105
- data: ox__Hex.Hex;
106
- to: ox__Hex.Hex;
107
- value?: bigint | undefined;
108
- chainId: number;
109
- /**
110
- * The action this transaction performs. This can be "approval", "transfer", "buy", or "sell".
111
- */
112
- action: "approval" | "transfer" | "buy" | "sell";
113
- /**
114
- * The transaction ID, used for tracking purposes.
115
- */
116
- id: ox__Hex.Hex;
117
- client: ThirdwebClient;
118
- chain: Chain;
119
- }>;
120
- }>;
58
+ steps: RouteStep[];
121
59
  };
@@ -1,20 +1,45 @@
1
- import type { Address as ox__Address } from "ox";
1
+ import type { Hex as ox__Hex } from "ox";
2
+ import type { Chain } from "../../chains/types.js";
3
+ import type { ThirdwebClient } from "../../client/client.js";
4
+ import type { BridgeAction } from "./BridgeAction.js";
5
+ import type { Token } from "./Token.js";
2
6
 
3
7
  export type Route = {
4
- originToken: {
5
- chainId: number;
6
- address: ox__Address.Address;
7
- decimals: number;
8
- symbol: string;
9
- name: string;
10
- iconUri?: string;
11
- };
12
- destinationToken: {
13
- chainId: number;
14
- address: string;
15
- decimals: number;
16
- symbol: string;
17
- name: string;
18
- iconUri?: string;
19
- };
8
+ originToken: Token;
9
+ destinationToken: Token;
10
+ };
11
+
12
+ export type RouteQuoteStep = {
13
+ originToken: Token;
14
+ destinationToken: Token;
15
+ originAmount: bigint;
16
+ destinationAmount: bigint;
17
+ estimatedExecutionTimeMs: number;
18
+ };
19
+
20
+ export type RouteStep = {
21
+ originToken: Token;
22
+ destinationToken: Token;
23
+ originAmount: bigint;
24
+ destinationAmount: bigint;
25
+ estimatedExecutionTimeMs: number;
26
+ transactions: RouteTransaction[];
27
+ };
28
+
29
+ export type RouteTransaction = {
30
+ data: ox__Hex.Hex;
31
+ to: ox__Hex.Hex;
32
+ value?: bigint | undefined;
33
+ chainId: number;
34
+
35
+ /**
36
+ * The action this transaction performs. This can be "approval", "transfer", "buy", or "sell".
37
+ */
38
+ action: BridgeAction;
39
+ /**
40
+ * The transaction ID, used for tracking purposes.
41
+ */
42
+ id: ox__Hex.Hex;
43
+ client: ThirdwebClient;
44
+ chain: Chain;
20
45
  };
@@ -1,14 +1,19 @@
1
1
  import type { Address as ox__Address, Hex as ox__Hex } from "ox";
2
-
2
+ import type { Token } from "./Token.js";
3
3
  export type Status =
4
4
  | {
5
5
  status: "COMPLETED";
6
+ paymentId: string;
6
7
  originAmount: bigint;
7
8
  destinationAmount: bigint;
8
9
  originChainId: number;
9
10
  destinationChainId: number;
10
11
  originTokenAddress: ox__Address.Address;
11
12
  destinationTokenAddress: ox__Address.Address;
13
+ originToken: Token;
14
+ destinationToken: Token;
15
+ sender: ox__Address.Address;
16
+ receiver: ox__Address.Address;
12
17
  transactions: Array<{
13
18
  chainId: number;
14
19
  transactionHash: ox__Hex.Hex;
@@ -17,24 +22,33 @@ export type Status =
17
22
  }
18
23
  | {
19
24
  status: "PENDING";
25
+ paymentId: string;
20
26
  originAmount: bigint;
21
27
  originChainId: number;
22
28
  destinationChainId: number;
23
29
  originTokenAddress: ox__Address.Address;
24
30
  destinationTokenAddress: ox__Address.Address;
31
+ originToken: Token;
32
+ destinationToken: Token;
33
+ sender: ox__Address.Address;
34
+ receiver: ox__Address.Address;
25
35
  transactions: Array<{
26
36
  chainId: number;
27
37
  transactionHash: ox__Hex.Hex;
28
38
  }>;
39
+ purchaseData?: unknown;
29
40
  }
30
41
  | {
31
42
  status: "FAILED";
43
+ paymentId: string;
32
44
  transactions: Array<{
33
45
  chainId: number;
34
46
  transactionHash: ox__Hex.Hex;
35
47
  }>;
48
+ purchaseData?: unknown;
36
49
  }
37
50
  | {
38
51
  status: "NOT_FOUND";
52
+ paymentId: string;
39
53
  transactions: [];
40
54
  };
@@ -0,0 +1,11 @@
1
+ import type { Address as ox__Address } from "ox";
2
+
3
+ export type Token = {
4
+ chainId: number;
5
+ address: ox__Address.Address;
6
+ decimals: number;
7
+ symbol: string;
8
+ name: string;
9
+ iconUri?: string;
10
+ priceUsd: number;
11
+ };
@@ -4,7 +4,6 @@ import * as ox__Bytes from "ox/Bytes";
4
4
  import * as ox__Ens from "ox/Ens";
5
5
  import * as ox__Hash from "ox/Hash";
6
6
  import * as ox__Hex from "ox/Hex";
7
- import { keccak256 } from "viem";
8
7
  import type { Chain } from "../../chains/types.js";
9
8
  import type { ThirdwebClient } from "../../client/client.js";
10
9
  import { getContract } from "../../contract/contract.js";
@@ -47,7 +46,6 @@ const convertReverseNodeToBytes = (address: Address, chainId: number) => {
47
46
  [reverseNode, addressNode],
48
47
  ),
49
48
  );
50
- keccak256;
51
49
  return addressReverseNode;
52
50
  };
53
51
 
@@ -10,16 +10,6 @@ export type QuoteTokenInfo = {
10
10
  symbol?: string;
11
11
  };
12
12
 
13
- export type QuoteTransactionRequest = {
14
- data: string;
15
- to: string;
16
- value: string;
17
- from: string;
18
- chainId: number;
19
- gasPrice: string;
20
- gasLimit: string;
21
- };
22
-
23
13
  export type QuoteApprovalInfo = {
24
14
  chainId: number;
25
15
  tokenAddress: string;