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,229 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prepare = prepare;
4
+ const utils_js_1 = require("../chains/utils.js");
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
+ /**
9
+ * Prepares a **finalized** Universal Bridge quote for the provided transfer request with transaction data.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { Bridge, NATIVE_TOKEN_ADDRESS } from "thirdweb";
14
+ *
15
+ * const quote = await Bridge.Transfer.prepare({
16
+ * chainId: 1,
17
+ * tokenAddress: NATIVE_TOKEN_ADDRESS,
18
+ * amount: toWei("0.01"),
19
+ * sender: "0x...",
20
+ * receiver: "0x...",
21
+ * client: thirdwebClient,
22
+ * });
23
+ * ```
24
+ *
25
+ * This will return a quote that might look like:
26
+ * ```typescript
27
+ * {
28
+ * originAmount: 10000026098875381n,
29
+ * destinationAmount: 10000000000000000n,
30
+ * blockNumber: 22026509n,
31
+ * timestamp: 1741730936680,
32
+ * estimatedExecutionTimeMs: 1000
33
+ * steps: [
34
+ * {
35
+ * originToken: {
36
+ * chainId: 1,
37
+ * address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
38
+ * symbol: "ETH",
39
+ * name: "Ethereum",
40
+ * decimals: 18,
41
+ * priceUsd: 2000,
42
+ * iconUri: "https://..."
43
+ * },
44
+ * destinationToken: {
45
+ * chainId: 1,
46
+ * address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
47
+ * symbol: "ETH",
48
+ * name: "Ethereum",
49
+ * decimals: 18,
50
+ * priceUsd: 2000,
51
+ * iconUri: "https://..."
52
+ * },
53
+ * originAmount: 10000026098875381n,
54
+ * destinationAmount: 10000000000000000n,
55
+ * estimatedExecutionTimeMs: 1000
56
+ * transactions: [
57
+ * {
58
+ * action: "approval",
59
+ * id: "0x",
60
+ * to: "0x...",
61
+ * data: "0x...",
62
+ * chainId: 1,
63
+ * type: "eip1559"
64
+ * },
65
+ * {
66
+ * action: "transfer",
67
+ * to: "0x...",
68
+ * value: 10000026098875381n,
69
+ * data: "0x...",
70
+ * chainId: 1,
71
+ * type: "eip1559"
72
+ * }
73
+ * ]
74
+ * }
75
+ * ],
76
+ * expiration: 1741730936680,
77
+ * intent: {
78
+ * chainId: 1,
79
+ * tokenAddress: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
80
+ * amount: 10000000000000000n,
81
+ * sender: "0x...",
82
+ * receiver: "0x..."
83
+ * }
84
+ * }
85
+ * ```
86
+ *
87
+ * ## Sending the transactions
88
+ * 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:
89
+ * - Approvals will have the `approval` action specified. You can perform approvals with `sendAndConfirmTransaction`, then proceed to the next transaction.
90
+ * - 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.
91
+ * - If an `expiration` timestamp is provided, all transactions must be executed before that time to guarantee successful execution at the specified price.
92
+ *
93
+ * 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.
94
+ *
95
+ * You can access this functions input and output types with `Transfer.prepare.Options` and `Transfer.prepare.Result`, respectively.
96
+ *
97
+ * You can include arbitrary data to be included on any webhooks and status responses with the `purchaseData` option.
98
+ *
99
+ * ```ts
100
+ * const quote = await Bridge.Transfer.prepare({
101
+ * chainId: 1,
102
+ * tokenAddress: NATIVE_TOKEN_ADDRESS,
103
+ * amount: toWei("0.01"),
104
+ * sender: "0x...",
105
+ * receiver: "0x...",
106
+ * purchaseData: {
107
+ * reference: "payment-123",
108
+ * metadata: {
109
+ * note: "Transfer to Alice"
110
+ * }
111
+ * },
112
+ * client: thirdwebClient,
113
+ * });
114
+ * ```
115
+ *
116
+ * ## Fees
117
+ * 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.
118
+ *
119
+ * For example, if you were to request a transfer with `feePayer` set to `receiver`:
120
+ * ```typescript
121
+ * const quote = await Bridge.Transfer.prepare({
122
+ * chainId: 1,
123
+ * tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
124
+ * amount: 100_000_000n, // 100 USDC
125
+ * sender: "0x...",
126
+ * receiver: "0x...",
127
+ * feePayer: "receiver",
128
+ * client: thirdwebClient,
129
+ * });
130
+ * ```
131
+ *
132
+ * The returned quote might look like:
133
+ * ```typescript
134
+ * {
135
+ * originAmount: 100_000_000n, // 100 USDC
136
+ * destinationAmount: 99_970_000n, // 99.97 USDC
137
+ * ...
138
+ * }
139
+ * ```
140
+ *
141
+ * If you were to request a transfer with `feePayer` set to `sender`:
142
+ * ```typescript
143
+ * const quote = await Bridge.Transfer.prepare({
144
+ * chainId: 1,
145
+ * tokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
146
+ * amount: 100_000_000n, // 100 USDC
147
+ * sender: "0x...",
148
+ * receiver: "0x...",
149
+ * feePayer: "sender",
150
+ * client: thirdwebClient,
151
+ * });
152
+ * ```
153
+ *
154
+ * The returned quote might look like:
155
+ * ```typescript
156
+ * {
157
+ * originAmount: 100_030_000n, // 100.03 USDC
158
+ * destinationAmount: 100_000_000n, // 100 USDC
159
+ * ...
160
+ * }
161
+ * ```
162
+ *
163
+ * @param options - The options for the quote.
164
+ * @param options.chainId - The chain ID of the token.
165
+ * @param options.tokenAddress - The address of the token.
166
+ * @param options.amount - The amount of the token to transfer.
167
+ * @param options.sender - The address of the sender.
168
+ * @param options.receiver - The address of the recipient.
169
+ * @param options.purchaseData - Arbitrary data to be passed to the transfer function and included with any webhooks or status calls.
170
+ * @param options.client - Your thirdweb client.
171
+ * @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".
172
+ *
173
+ * @returns A promise that resolves to a finalized quote and transactions for the requested transfer.
174
+ *
175
+ * @throws Will throw an error if there is an issue fetching the quote.
176
+ * @bridge Transfer
177
+ * @beta
178
+ */
179
+ async function prepare(options) {
180
+ const { chainId, tokenAddress, sender, receiver, client, amount, purchaseData, feePayer, } = options;
181
+ const clientFetch = (0, fetch_js_1.getClientFetch)(client);
182
+ const url = new URL(`${(0, domains_js_1.getThirdwebBaseUrl)("bridge")}/v1/transfer/prepare`);
183
+ const response = await clientFetch(url.toString(), {
184
+ method: "POST",
185
+ headers: {
186
+ "Content-Type": "application/json",
187
+ },
188
+ body: (0, json_js_1.stringify)({
189
+ transferAmountWei: amount.toString(), // legacy
190
+ amount: amount.toString(),
191
+ chainId: chainId.toString(),
192
+ tokenAddress,
193
+ sender,
194
+ receiver,
195
+ purchaseData,
196
+ feePayer,
197
+ }),
198
+ });
199
+ if (!response.ok) {
200
+ const errorJson = await response.json();
201
+ throw new Error(`${errorJson.code} | ${errorJson.message} - ${errorJson.correlationId}`);
202
+ }
203
+ const { data } = await response.json();
204
+ return {
205
+ originAmount: BigInt(data.originAmount),
206
+ destinationAmount: BigInt(data.destinationAmount),
207
+ blockNumber: data.blockNumber ? BigInt(data.blockNumber) : undefined,
208
+ timestamp: data.timestamp,
209
+ estimatedExecutionTimeMs: data.estimatedExecutionTimeMs,
210
+ steps: data.steps.map((step) => ({
211
+ ...step,
212
+ transactions: step.transactions.map((transaction) => ({
213
+ ...transaction,
214
+ value: transaction.value ? BigInt(transaction.value) : undefined,
215
+ client,
216
+ chain: (0, utils_js_1.defineChain)(transaction.chainId),
217
+ })),
218
+ })),
219
+ intent: {
220
+ chainId,
221
+ tokenAddress,
222
+ amount,
223
+ sender,
224
+ receiver,
225
+ feePayer,
226
+ },
227
+ };
228
+ }
229
+ //# sourceMappingURL=Transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transfer.js","sourceRoot":"","sources":["../../../src/bridge/Transfer.ts"],"names":[],"mappings":";;AAmLA,0BAiEC;AAnPD,iDAAiD;AAEjD,oDAAyD;AACzD,gDAAm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M,EAAE,IAAI,EAAE,GAA4B,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChE,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;QACvC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACjD,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,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,OAAO;YACP,YAAY;YACZ,MAAM;YACN,MAAM;YACN,QAAQ;YACR,QAAQ;SACT;KACF,CAAC;AACJ,CAAC"}
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.chains = exports.routes = exports.status = exports.Sell = exports.Buy = void 0;
3
+ exports.chains = exports.routes = exports.status = exports.Onramp = exports.Transfer = exports.Sell = exports.Buy = void 0;
4
4
  exports.Buy = require("./Buy.js");
5
5
  exports.Sell = require("./Sell.js");
6
+ exports.Transfer = require("./Transfer.js");
7
+ exports.Onramp = require("./Onramp.js");
6
8
  var Status_js_1 = require("./Status.js");
7
9
  Object.defineProperty(exports, "status", { enumerable: true, get: function () { return Status_js_1.status; } });
8
10
  var Routes_js_1 = require("./Routes.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;AAAA,kCAAgC;AAChC,oCAAkC;AAClC,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridge/index.ts"],"names":[],"mappings":";;;AAAA,kCAAgC;AAChC,oCAAkC;AAClC,4CAA0C;AAC1C,wCAAsC;AACtC,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA;AACf,yCAAqC;AAA5B,mGAAA,MAAM,OAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BridgeAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BridgeAction.js","sourceRoot":"","sources":["../../../../src/bridge/types/BridgeAction.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Token.js","sourceRoot":"","sources":["../../../../src/bridge/types/Token.ts"],"names":[],"mappings":""}
@@ -6,7 +6,6 @@ const ox__Bytes = require("ox/Bytes");
6
6
  const ox__Ens = require("ox/Ens");
7
7
  const ox__Hash = require("ox/Hash");
8
8
  const ox__Hex = require("ox/Hex");
9
- const viem_1 = require("viem");
10
9
  const contract_js_1 = require("../../contract/contract.js");
11
10
  const withCache_js_1 = require("../../utils/promise/withCache.js");
12
11
  const name_js_1 = require("./__generated__/L2Resolver/read/name.js");
@@ -23,7 +22,6 @@ const convertReverseNodeToBytes = (address, chainId) => {
23
22
  const chainCoinType = cointype.toString(16).toLocaleUpperCase();
24
23
  const reverseNode = ox__Ens.namehash(`${chainCoinType.toLocaleUpperCase()}.reverse`);
25
24
  const addressReverseNode = ox__Hash.keccak256(ox__AbiParameters.encodePacked(["bytes32", "bytes32"], [reverseNode, addressNode]));
26
- viem_1.keccak256;
27
25
  return addressReverseNode;
28
26
  };
29
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-l2-name.js","sourceRoot":"","sources":["../../../../src/extensions/ens/resolve-l2-name.ts"],"names":[],"mappings":";;AAiFA,sCAsCC;AAtHD,sDAAsD;AACtD,sCAAsC;AACtC,kCAAkC;AAClC,oCAAoC;AACpC,kCAAkC;AAClC,+BAAiC;AAGjC,4DAAyD;AACzD,mEAA6D;AAC7D,qEAA+D;AAY/D;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,CAAC,OAAgB,EAAE,OAAe,EAAE,EAAE;IACtE,MAAM,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,EAAa,CAAC;IAChE,oFAAoF;IACpF,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CACnC,QAAQ,CAAC,SAAS,CAChB,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAW,CAAC,CAC1D,CACF,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAAG,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAChE,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,CAClC,GAAG,aAAa,CAAC,iBAAiB,EAAE,UAAU,CAC/C,CAAC;IAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,SAAS,CAC3C,iBAAiB,CAAC,YAAY,CAC5B,CAAC,SAAS,EAAE,SAAS,C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,yBAAyB,CAC3C,OAAO,EACP,aAAa,CAAC,EAAE,IAAI,CAAC,CACtB,CAAC;QAEF,MAAM,YAAY,GAAG,MAAM,IAAA,cAAI,EAAC;YAC9B,QAAQ;YACR,IAAI,EAAE,WAAW;SAClB,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACb,IAAI,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;gBAC3C,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC,CAAC,CAAC;QAEH,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC,EACD;QACE,QAAQ,EAAE,YAAY,aAAa,IAAI,OAAO,EAAE;QAChD,aAAa;QACb,SAAS,EAAE,EAAE,GAAG,IAAI;KACrB,CACF,CAAC;AACJ,CAAC"}
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBuyWithCryptoQuote = getBuyWithCryptoQuote;
4
+ const ox_1 = require("ox");
5
+ const ox__AbiFunction = require("ox/AbiFunction");
6
+ const Bridge = require("../../bridge/index.js");
4
7
  const utils_js_1 = require("../../chains/utils.js");
5
- const fetch_js_1 = require("../../utils/fetch.js");
6
- const json_js_1 = require("../../utils/json.js");
7
- const definitions_js_1 = require("../utils/definitions.js");
8
+ const addresses_js_1 = require("../../constants/addresses.js");
9
+ const contract_js_1 = require("../../contract/contract.js");
10
+ const decimals_js_1 = require("../../extensions/erc20/read/decimals.js");
8
11
  /**
9
12
  * Get a quote of type [`BuyWithCryptoQuote`](https://portal.thirdweb.com/references/typescript/v5/BuyWithCryptoQuote) to buy any given token with crypto.
10
13
  * This quote contains the information about the swap such as token amounts, processing fees, estimated time etc.
@@ -35,65 +38,168 @@ const definitions_js_1 = require("../utils/definitions.js");
35
38
  */
36
39
  async function getBuyWithCryptoQuote(params) {
37
40
  try {
38
- const clientFetch = (0, fetch_js_1.getClientFetch)(params.client);
39
- const response = await clientFetch((0, definitions_js_1.getPayBuyWithCryptoQuoteEndpoint)(), {
40
- method: "POST",
41
- headers: {
42
- Accept: "application/json",
43
- "Content-Type": "application/json",
44
- },
45
- body: (0, json_js_1.stringify)({
46
- fromAddress: params.fromAddress,
47
- toAddress: params.toAddress,
48
- fromChainId: params.fromChainId.toString(),
49
- fromTokenAddress: params.fromTokenAddress,
50
- toChainId: params.toChainId.toString(),
51
- toTokenAddress: params.toTokenAddress,
52
- fromAmount: params.fromAmount,
53
- toAmount: params.toAmount,
54
- maxSlippageBPS: params.maxSlippageBPS,
55
- intentId: params.intentId,
56
- purchaseData: params.purchaseData,
57
- }),
58
- });
59
- // Assuming the response directly matches the SwapResponse interface
60
- if (!response.ok) {
61
- const errorObj = await response.json();
62
- if (errorObj && "error" in errorObj) {
63
- throw errorObj;
41
+ const quote = await (async () => {
42
+ if (params.toAmount) {
43
+ const destinationTokenContract = (0, contract_js_1.getContract)({
44
+ address: params.toTokenAddress,
45
+ chain: (0, utils_js_1.getCachedChain)(params.toChainId),
46
+ client: params.client,
47
+ });
48
+ const tokenDecimals = destinationTokenContract.address.toLowerCase() ===
49
+ addresses_js_1.NATIVE_TOKEN_ADDRESS
50
+ ? 18
51
+ : await (0, decimals_js_1.decimals)({
52
+ contract: destinationTokenContract,
53
+ });
54
+ const amount = ox_1.Value.from(params.toAmount, tokenDecimals);
55
+ return Bridge.Buy.prepare({
56
+ sender: params.fromAddress,
57
+ receiver: params.toAddress,
58
+ originChainId: params.fromChainId,
59
+ originTokenAddress: params.fromTokenAddress,
60
+ destinationChainId: params.toChainId,
61
+ destinationTokenAddress: params.toTokenAddress,
62
+ amount: amount,
63
+ purchaseData: params.purchaseData,
64
+ client: params.client,
65
+ });
64
66
  }
65
- throw new Error(`HTTP error! status: ${response.status}`);
66
- }
67
- const data = (await response.json())
68
- .result;
67
+ else if (params.fromAmount) {
68
+ const originTokenContract = (0, contract_js_1.getContract)({
69
+ address: params.fromTokenAddress,
70
+ chain: (0, utils_js_1.getCachedChain)(params.fromChainId),
71
+ client: params.client,
72
+ });
73
+ const tokenDecimals = await (0, decimals_js_1.decimals)({
74
+ contract: originTokenContract,
75
+ });
76
+ const amount = ox_1.Value.from(params.fromAmount, tokenDecimals);
77
+ return Bridge.Sell.prepare({
78
+ sender: params.fromAddress,
79
+ receiver: params.toAddress,
80
+ originChainId: params.fromChainId,
81
+ originTokenAddress: params.fromTokenAddress,
82
+ destinationChainId: params.toChainId,
83
+ destinationTokenAddress: params.toTokenAddress,
84
+ amount: amount,
85
+ purchaseData: params.purchaseData,
86
+ client: params.client,
87
+ });
88
+ }
89
+ throw new Error("Invalid quote request, must provide either `fromAmount` or `toAmount`");
90
+ })();
69
91
  // check if the fromAddress already has approval for the given amount
70
- const approvalData = data.approval;
92
+ const firstStep = quote.steps[0];
93
+ if (!firstStep) {
94
+ throw new Error("This quote is incompatible with getBuyWithCryptoQuote. Please use Bridge.Buy.prepare instead.");
95
+ }
96
+ const approvalTxs = firstStep.transactions.filter((tx) => tx.action === "approval");
97
+ if (approvalTxs.length > 1) {
98
+ throw new Error("This quote is incompatible with getBuyWithCryptoQuote. Please use Bridge.Buy.prepare instead.");
99
+ }
100
+ const approvalTx = approvalTxs[0];
101
+ const txs = firstStep.transactions.filter((tx) => tx.action !== "approval");
102
+ if (txs.length > 1) {
103
+ throw new Error("This quote is incompatible with getBuyWithCryptoQuote. Please use Bridge.Buy.prepare instead.");
104
+ }
105
+ const tx = txs[0];
106
+ if (!tx) {
107
+ throw new Error("This quote is incompatible with getBuyWithCryptoQuote. Please use Bridge.Buy.prepare instead.");
108
+ }
109
+ let approvalData;
110
+ if (approvalTx) {
111
+ const abiFunction = ox__AbiFunction.from([
112
+ "function approve(address spender, uint256 amount)",
113
+ ]);
114
+ const [spender, amount] = ox__AbiFunction.decodeData(abiFunction, approvalTx.data);
115
+ approvalData = {
116
+ chainId: firstStep.originToken.chainId,
117
+ tokenAddress: firstStep.originToken.address,
118
+ spenderAddress: spender,
119
+ amountWei: amount.toString(),
120
+ };
121
+ }
71
122
  const swapRoute = {
72
123
  transactionRequest: {
73
- chain: (0, utils_js_1.getCachedChain)(data.transactionRequest.chainId),
74
- client: params.client,
75
- data: data.transactionRequest.data,
76
- to: data.transactionRequest.to,
77
- value: BigInt(data.transactionRequest.value),
124
+ ...tx,
78
125
  extraGas: 50000n, // extra gas buffer
79
126
  },
80
127
  approvalData,
81
128
  swapDetails: {
82
- fromAddress: data.fromAddress,
83
- toAddress: data.toAddress,
84
- fromToken: data.fromToken,
85
- toToken: data.toToken,
86
- fromAmount: data.fromAmount,
87
- fromAmountWei: data.fromAmountWei,
88
- toAmountMinWei: data.toAmountMinWei,
89
- toAmountMin: data.toAmountMin,
90
- toAmountWei: data.toAmountWei,
91
- toAmount: data.toAmount,
92
- estimated: data.estimated,
93
- maxSlippageBPS: data.maxSlippageBPS,
129
+ fromAddress: quote.intent.sender,
130
+ toAddress: quote.intent.receiver,
131
+ fromToken: {
132
+ tokenAddress: firstStep.originToken.address,
133
+ chainId: firstStep.originToken.chainId,
134
+ decimals: firstStep.originToken.decimals,
135
+ symbol: firstStep.originToken.symbol,
136
+ name: firstStep.originToken.name,
137
+ priceUSDCents: firstStep.originToken.priceUsd * 100,
138
+ },
139
+ toToken: {
140
+ tokenAddress: firstStep.destinationToken.address,
141
+ chainId: firstStep.destinationToken.chainId,
142
+ decimals: firstStep.destinationToken.decimals,
143
+ symbol: firstStep.destinationToken.symbol,
144
+ name: firstStep.destinationToken.name,
145
+ priceUSDCents: firstStep.destinationToken.priceUsd * 100,
146
+ },
147
+ fromAmount: ox_1.Value.format(quote.originAmount, firstStep.originToken.decimals).toString(),
148
+ fromAmountWei: quote.originAmount.toString(),
149
+ toAmountMinWei: quote.destinationAmount.toString(),
150
+ toAmountMin: ox_1.Value.format(quote.destinationAmount, firstStep.destinationToken.decimals).toString(),
151
+ toAmountWei: quote.destinationAmount.toString(),
152
+ toAmount: ox_1.Value.format(quote.destinationAmount, firstStep.destinationToken.decimals).toString(),
153
+ estimated: {
154
+ fromAmountUSDCents: Number(ox_1.Value.format(quote.originAmount, firstStep.originToken.decimals)) *
155
+ firstStep.originToken.priceUsd *
156
+ 100,
157
+ toAmountMinUSDCents: Number(ox_1.Value.format(quote.destinationAmount, firstStep.destinationToken.decimals)) *
158
+ firstStep.destinationToken.priceUsd *
159
+ 100,
160
+ toAmountUSDCents: Number(ox_1.Value.format(quote.destinationAmount, firstStep.destinationToken.decimals)) *
161
+ firstStep.destinationToken.priceUsd *
162
+ 100,
163
+ slippageBPS: 0,
164
+ feesUSDCents: 0,
165
+ gasCostUSDCents: 0,
166
+ durationSeconds: firstStep.estimatedExecutionTimeMs / 1000,
167
+ },
168
+ maxSlippageBPS: 0,
94
169
  },
95
- paymentTokens: data.paymentTokens,
96
- processingFees: data.processingFees,
170
+ paymentTokens: [
171
+ {
172
+ token: {
173
+ tokenAddress: firstStep.originToken.address,
174
+ chainId: firstStep.originToken.chainId,
175
+ decimals: firstStep.originToken.decimals,
176
+ symbol: firstStep.originToken.symbol,
177
+ name: firstStep.originToken.name,
178
+ priceUSDCents: firstStep.originToken.priceUsd * 100,
179
+ },
180
+ amountWei: quote.originAmount.toString(),
181
+ amount: ox_1.Value.format(quote.originAmount, firstStep.originToken.decimals).toString(),
182
+ amountUSDCents: Number(ox_1.Value.format(quote.originAmount, firstStep.originToken.decimals)) *
183
+ firstStep.originToken.priceUsd *
184
+ 100,
185
+ },
186
+ ],
187
+ // TODO (UB): add develope and platform fees in API
188
+ processingFees: [
189
+ {
190
+ token: {
191
+ tokenAddress: firstStep.originToken.address,
192
+ chainId: firstStep.originToken.chainId,
193
+ decimals: firstStep.originToken.decimals,
194
+ symbol: firstStep.originToken.symbol,
195
+ name: firstStep.originToken.name,
196
+ priceUSDCents: firstStep.originToken.priceUsd * 100,
197
+ },
198
+ amountUSDCents: 0,
199
+ amountWei: "0",
200
+ amount: "0",
201
+ },
202
+ ],
97
203
  client: params.client,
98
204
  };
99
205
  return swapRoute;
@@ -1 +1 @@
1
- {"version":3,"file":"getQuote.js","sourceRoot":"","sources":["../../../../src/pay/buyWithCrypto/getQuote.ts"],"names":[],"mappings":";;AAqNA,sDAkFC;AAtSD,oDAAuD;AAGvD,mDAAsD;AACtD,iDAAgD;AAChD,4DAA2E;AAmL3E;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAAmC;IAEnC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAA,yBAAc,EAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,IAAA,iDAAgC,GAAE,EAAE;YACrE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,IAAI,EAAE,IAAA,mBAAS,EAAC;gBACd,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;gBAC1C,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;gBACzC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;gBACtC,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,cAAc,EAAE,MAAM,CAAC,cAAc;gBACrC,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,YAAY,EAAE,MAAM,CAAC,YAAY;aAClC,CAAC;SACH,CAAC,CAAC;QAEH,oEAAoE;QACpE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,QAAQ,GAAG,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