thirdweb 5.43.1 → 5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841

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 (336) hide show
  1. package/dist/cjs/extensions/marketplace/direct-listings/utils.js +1 -0
  2. package/dist/cjs/extensions/marketplace/direct-listings/utils.js.map +1 -1
  3. package/dist/cjs/extensions/marketplace/english-auctions/utils.js +1 -0
  4. package/dist/cjs/extensions/marketplace/english-auctions/utils.js.map +1 -1
  5. package/dist/cjs/gas/fee-data.js +1 -1
  6. package/dist/cjs/gas/fee-data.js.map +1 -1
  7. package/dist/cjs/react/core/hooks/contract/useContractEvents.js +32 -2
  8. package/dist/cjs/react/core/hooks/contract/useContractEvents.js.map +1 -1
  9. package/dist/cjs/react/core/hooks/contract/useReadContract.js.map +1 -1
  10. package/dist/cjs/react/core/hooks/others/useWalletBalance.js +17 -2
  11. package/dist/cjs/react/core/hooks/others/useWalletBalance.js.map +1 -1
  12. package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +1 -0
  13. package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
  14. package/dist/cjs/react/core/utils/wallet.js +19 -1
  15. package/dist/cjs/react/core/utils/wallet.js.map +1 -1
  16. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +74 -4
  17. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  18. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
  19. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  20. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +2 -2
  21. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  22. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
  23. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  24. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js +8 -8
  25. package/dist/cjs/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  26. package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js +114 -0
  27. package/dist/cjs/react/web/ui/ConnectWallet/locale/fr.js.map +1 -0
  28. package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js +6 -0
  29. package/dist/cjs/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
  30. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js +12 -12
  31. package/dist/cjs/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  32. package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js +114 -0
  33. package/dist/cjs/react/web/ui/ConnectWallet/locale/kr.js.map +1 -0
  34. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js +12 -12
  35. package/dist/cjs/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  36. package/dist/cjs/react/web/ui/PayEmbed.js +8 -9
  37. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  38. package/dist/cjs/react/web/wallets/injected/locale/fr.js +27 -0
  39. package/dist/cjs/react/web/wallets/injected/locale/fr.js.map +1 -0
  40. package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js +4 -0
  41. package/dist/cjs/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
  42. package/dist/cjs/react/web/wallets/injected/locale/ja.js +8 -8
  43. package/dist/cjs/react/web/wallets/injected/locale/ja.js.map +1 -1
  44. package/dist/cjs/react/web/wallets/injected/locale/kr.js +27 -0
  45. package/dist/cjs/react/web/wallets/injected/locale/kr.js.map +1 -0
  46. package/dist/cjs/react/web/wallets/local/locale/fr.js +44 -0
  47. package/dist/cjs/react/web/wallets/local/locale/fr.js.map +1 -0
  48. package/dist/cjs/react/web/wallets/local/locale/getLocalWalletLocale.js +2 -0
  49. package/dist/cjs/react/web/wallets/local/locale/getLocalWalletLocale.js.map +1 -1
  50. package/dist/cjs/react/web/wallets/local/locale/ja.js +14 -18
  51. package/dist/cjs/react/web/wallets/local/locale/ja.js.map +1 -1
  52. package/dist/cjs/react/web/wallets/local/locale/kr.js +44 -0
  53. package/dist/cjs/react/web/wallets/local/locale/kr.js.map +1 -0
  54. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +3 -9
  55. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  56. package/dist/cjs/react/web/wallets/shared/locale/de.js +1 -0
  57. package/dist/cjs/react/web/wallets/shared/locale/de.js.map +1 -1
  58. package/dist/cjs/react/web/wallets/shared/locale/en.js +1 -0
  59. package/dist/cjs/react/web/wallets/shared/locale/en.js.map +1 -1
  60. package/dist/cjs/react/web/wallets/shared/locale/es.js +1 -0
  61. package/dist/cjs/react/web/wallets/shared/locale/es.js.map +1 -1
  62. package/dist/cjs/react/web/wallets/shared/locale/fr.js +56 -0
  63. package/dist/cjs/react/web/wallets/shared/locale/fr.js.map +1 -0
  64. package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js +4 -0
  65. package/dist/cjs/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
  66. package/dist/cjs/react/web/wallets/shared/locale/ja.js +21 -20
  67. package/dist/cjs/react/web/wallets/shared/locale/ja.js.map +1 -1
  68. package/dist/cjs/react/web/wallets/shared/locale/kr.js +56 -0
  69. package/dist/cjs/react/web/wallets/shared/locale/kr.js.map +1 -0
  70. package/dist/cjs/react/web/wallets/shared/locale/tl.js +1 -0
  71. package/dist/cjs/react/web/wallets/shared/locale/tl.js.map +1 -1
  72. package/dist/cjs/react/web/wallets/shared/locale/vi.js +1 -0
  73. package/dist/cjs/react/web/wallets/shared/locale/vi.js.map +1 -1
  74. package/dist/cjs/react/web/wallets/smartWallet/locale/fr.js +13 -0
  75. package/dist/cjs/react/web/wallets/smartWallet/locale/fr.js.map +1 -0
  76. package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +4 -0
  77. package/dist/cjs/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
  78. package/dist/cjs/react/web/wallets/smartWallet/locale/ja.js +5 -5
  79. package/dist/cjs/react/web/wallets/smartWallet/locale/ja.js.map +1 -1
  80. package/dist/cjs/react/web/wallets/smartWallet/locale/kr.js +13 -0
  81. package/dist/cjs/react/web/wallets/smartWallet/locale/kr.js.map +1 -0
  82. package/dist/cjs/react/web/wallets/walletConnect/locale.js +8 -0
  83. package/dist/cjs/react/web/wallets/walletConnect/locale.js.map +1 -1
  84. package/dist/cjs/transaction/actions/send-transaction.js +76 -5
  85. package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
  86. package/dist/cjs/transaction/prepare-contract-call.js +18 -13
  87. package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
  88. package/dist/cjs/transaction/read-contract.js +39 -6
  89. package/dist/cjs/transaction/read-contract.js.map +1 -1
  90. package/dist/cjs/version.js +1 -1
  91. package/dist/cjs/version.js.map +1 -1
  92. package/dist/cjs/wallets/in-app/web/in-app.js +4 -1
  93. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  94. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +1 -0
  95. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  96. package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js +1 -1
  97. package/dist/cjs/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
  98. package/dist/esm/extensions/marketplace/direct-listings/utils.js +1 -0
  99. package/dist/esm/extensions/marketplace/direct-listings/utils.js.map +1 -1
  100. package/dist/esm/extensions/marketplace/english-auctions/utils.js +1 -0
  101. package/dist/esm/extensions/marketplace/english-auctions/utils.js.map +1 -1
  102. package/dist/esm/gas/fee-data.js +1 -1
  103. package/dist/esm/gas/fee-data.js.map +1 -1
  104. package/dist/esm/react/core/hooks/contract/useContractEvents.js +32 -2
  105. package/dist/esm/react/core/hooks/contract/useContractEvents.js.map +1 -1
  106. package/dist/esm/react/core/hooks/contract/useReadContract.js.map +1 -1
  107. package/dist/esm/react/core/hooks/others/useWalletBalance.js +17 -2
  108. package/dist/esm/react/core/hooks/others/useWalletBalance.js.map +1 -1
  109. package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +1 -0
  110. package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
  111. package/dist/esm/react/core/utils/wallet.js +19 -1
  112. package/dist/esm/react/core/utils/wallet.js.map +1 -1
  113. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +74 -4
  114. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  115. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
  116. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  117. package/dist/esm/react/web/ui/ConnectWallet/Details.js +2 -2
  118. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  119. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
  120. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  121. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js +8 -8
  122. package/dist/esm/react/web/ui/ConnectWallet/locale/es.js.map +1 -1
  123. package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js +112 -0
  124. package/dist/esm/react/web/ui/ConnectWallet/locale/fr.js.map +1 -0
  125. package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js +6 -0
  126. package/dist/esm/react/web/ui/ConnectWallet/locale/getConnectLocale.js.map +1 -1
  127. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js +12 -12
  128. package/dist/esm/react/web/ui/ConnectWallet/locale/ja.js.map +1 -1
  129. package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js +112 -0
  130. package/dist/esm/react/web/ui/ConnectWallet/locale/kr.js.map +1 -0
  131. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js +12 -12
  132. package/dist/esm/react/web/ui/ConnectWallet/locale/tl.js.map +1 -1
  133. package/dist/esm/react/web/ui/PayEmbed.js +8 -9
  134. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  135. package/dist/esm/react/web/wallets/injected/locale/fr.js +25 -0
  136. package/dist/esm/react/web/wallets/injected/locale/fr.js.map +1 -0
  137. package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js +4 -0
  138. package/dist/esm/react/web/wallets/injected/locale/getInjectedWalletLocale.js.map +1 -1
  139. package/dist/esm/react/web/wallets/injected/locale/ja.js +8 -8
  140. package/dist/esm/react/web/wallets/injected/locale/ja.js.map +1 -1
  141. package/dist/esm/react/web/wallets/injected/locale/kr.js +25 -0
  142. package/dist/esm/react/web/wallets/injected/locale/kr.js.map +1 -0
  143. package/dist/esm/react/web/wallets/local/locale/fr.js +42 -0
  144. package/dist/esm/react/web/wallets/local/locale/fr.js.map +1 -0
  145. package/dist/esm/react/web/wallets/local/locale/getLocalWalletLocale.js +2 -0
  146. package/dist/esm/react/web/wallets/local/locale/getLocalWalletLocale.js.map +1 -1
  147. package/dist/esm/react/web/wallets/local/locale/ja.js +14 -18
  148. package/dist/esm/react/web/wallets/local/locale/ja.js.map +1 -1
  149. package/dist/esm/react/web/wallets/local/locale/kr.js +42 -0
  150. package/dist/esm/react/web/wallets/local/locale/kr.js.map +1 -0
  151. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +3 -9
  152. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  153. package/dist/esm/react/web/wallets/shared/locale/de.js +1 -0
  154. package/dist/esm/react/web/wallets/shared/locale/de.js.map +1 -1
  155. package/dist/esm/react/web/wallets/shared/locale/en.js +1 -0
  156. package/dist/esm/react/web/wallets/shared/locale/en.js.map +1 -1
  157. package/dist/esm/react/web/wallets/shared/locale/es.js +1 -0
  158. package/dist/esm/react/web/wallets/shared/locale/es.js.map +1 -1
  159. package/dist/esm/react/web/wallets/shared/locale/fr.js +54 -0
  160. package/dist/esm/react/web/wallets/shared/locale/fr.js.map +1 -0
  161. package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js +4 -0
  162. package/dist/esm/react/web/wallets/shared/locale/getConnectLocale.js.map +1 -1
  163. package/dist/esm/react/web/wallets/shared/locale/ja.js +21 -20
  164. package/dist/esm/react/web/wallets/shared/locale/ja.js.map +1 -1
  165. package/dist/esm/react/web/wallets/shared/locale/kr.js +54 -0
  166. package/dist/esm/react/web/wallets/shared/locale/kr.js.map +1 -0
  167. package/dist/esm/react/web/wallets/shared/locale/tl.js +1 -0
  168. package/dist/esm/react/web/wallets/shared/locale/tl.js.map +1 -1
  169. package/dist/esm/react/web/wallets/shared/locale/vi.js +1 -0
  170. package/dist/esm/react/web/wallets/shared/locale/vi.js.map +1 -1
  171. package/dist/esm/react/web/wallets/smartWallet/locale/fr.js +11 -0
  172. package/dist/esm/react/web/wallets/smartWallet/locale/fr.js.map +1 -0
  173. package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js +4 -0
  174. package/dist/esm/react/web/wallets/smartWallet/locale/getSmartWalletLocale.js.map +1 -1
  175. package/dist/esm/react/web/wallets/smartWallet/locale/ja.js +5 -5
  176. package/dist/esm/react/web/wallets/smartWallet/locale/ja.js.map +1 -1
  177. package/dist/esm/react/web/wallets/smartWallet/locale/kr.js +11 -0
  178. package/dist/esm/react/web/wallets/smartWallet/locale/kr.js.map +1 -0
  179. package/dist/esm/react/web/wallets/walletConnect/locale.js +8 -0
  180. package/dist/esm/react/web/wallets/walletConnect/locale.js.map +1 -1
  181. package/dist/esm/transaction/actions/send-transaction.js +76 -5
  182. package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
  183. package/dist/esm/transaction/prepare-contract-call.js +18 -13
  184. package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
  185. package/dist/esm/transaction/read-contract.js +39 -6
  186. package/dist/esm/transaction/read-contract.js.map +1 -1
  187. package/dist/esm/version.js +1 -1
  188. package/dist/esm/version.js.map +1 -1
  189. package/dist/esm/wallets/in-app/web/in-app.js +4 -1
  190. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  191. package/dist/esm/wallets/in-app/web/lib/auth/index.js +1 -0
  192. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  193. package/dist/esm/wallets/in-app/web/lib/auth/oauth.js +1 -1
  194. package/dist/esm/wallets/in-app/web/lib/auth/oauth.js.map +1 -1
  195. package/dist/types/extensions/marketplace/direct-listings/types.d.ts +1 -0
  196. package/dist/types/extensions/marketplace/direct-listings/types.d.ts.map +1 -1
  197. package/dist/types/extensions/marketplace/direct-listings/utils.d.ts.map +1 -1
  198. package/dist/types/extensions/marketplace/english-auctions/types.d.ts +1 -0
  199. package/dist/types/extensions/marketplace/english-auctions/types.d.ts.map +1 -1
  200. package/dist/types/extensions/marketplace/english-auctions/utils.d.ts.map +1 -1
  201. package/dist/types/react/core/hooks/contract/useContractEvents.d.ts +32 -2
  202. package/dist/types/react/core/hooks/contract/useContractEvents.d.ts.map +1 -1
  203. package/dist/types/react/core/hooks/contract/useReadContract.d.ts +28 -6
  204. package/dist/types/react/core/hooks/contract/useReadContract.d.ts.map +1 -1
  205. package/dist/types/react/core/hooks/others/useWalletBalance.d.ts +17 -2
  206. package/dist/types/react/core/hooks/others/useWalletBalance.d.ts.map +1 -1
  207. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -0
  208. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
  209. package/dist/types/react/core/utils/wallet.d.ts +19 -1
  210. package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
  211. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +74 -4
  212. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  213. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +17 -2
  214. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  215. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +15 -0
  216. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  217. package/dist/types/react/web/ui/ConnectWallet/locale/fr.d.ts +4 -0
  218. package/dist/types/react/web/ui/ConnectWallet/locale/fr.d.ts.map +1 -0
  219. package/dist/types/react/web/ui/ConnectWallet/locale/getConnectLocale.d.ts.map +1 -1
  220. package/dist/types/react/web/ui/ConnectWallet/locale/kr.d.ts +4 -0
  221. package/dist/types/react/web/ui/ConnectWallet/locale/kr.d.ts.map +1 -0
  222. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
  223. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  224. package/dist/types/react/web/ui/types.d.ts +1 -1
  225. package/dist/types/react/web/ui/types.d.ts.map +1 -1
  226. package/dist/types/react/web/wallets/injected/locale/fr.d.ts +7 -0
  227. package/dist/types/react/web/wallets/injected/locale/fr.d.ts.map +1 -0
  228. package/dist/types/react/web/wallets/injected/locale/getInjectedWalletLocale.d.ts.map +1 -1
  229. package/dist/types/react/web/wallets/injected/locale/ja.d.ts +2 -2
  230. package/dist/types/react/web/wallets/injected/locale/ja.d.ts.map +1 -1
  231. package/dist/types/react/web/wallets/injected/locale/kr.d.ts +7 -0
  232. package/dist/types/react/web/wallets/injected/locale/kr.d.ts.map +1 -0
  233. package/dist/types/react/web/wallets/local/locale/fr.d.ts +4 -0
  234. package/dist/types/react/web/wallets/local/locale/fr.d.ts.map +1 -0
  235. package/dist/types/react/web/wallets/local/locale/getLocalWalletLocale.d.ts.map +1 -1
  236. package/dist/types/react/web/wallets/local/locale/ja.d.ts +2 -2
  237. package/dist/types/react/web/wallets/local/locale/ja.d.ts.map +1 -1
  238. package/dist/types/react/web/wallets/local/locale/kr.d.ts +4 -0
  239. package/dist/types/react/web/wallets/local/locale/kr.d.ts.map +1 -0
  240. package/dist/types/react/web/wallets/shared/ConnectWalletSocialOptions.d.ts.map +1 -1
  241. package/dist/types/react/web/wallets/shared/locale/de.d.ts +1 -0
  242. package/dist/types/react/web/wallets/shared/locale/de.d.ts.map +1 -1
  243. package/dist/types/react/web/wallets/shared/locale/en.d.ts +1 -0
  244. package/dist/types/react/web/wallets/shared/locale/en.d.ts.map +1 -1
  245. package/dist/types/react/web/wallets/shared/locale/es.d.ts +1 -0
  246. package/dist/types/react/web/wallets/shared/locale/es.d.ts.map +1 -1
  247. package/dist/types/react/web/wallets/shared/locale/fr.d.ts +55 -0
  248. package/dist/types/react/web/wallets/shared/locale/fr.d.ts.map +1 -0
  249. package/dist/types/react/web/wallets/shared/locale/getConnectLocale.d.ts.map +1 -1
  250. package/dist/types/react/web/wallets/shared/locale/ja.d.ts +4 -3
  251. package/dist/types/react/web/wallets/shared/locale/ja.d.ts.map +1 -1
  252. package/dist/types/react/web/wallets/shared/locale/kr.d.ts +55 -0
  253. package/dist/types/react/web/wallets/shared/locale/kr.d.ts.map +1 -0
  254. package/dist/types/react/web/wallets/shared/locale/tl.d.ts +1 -0
  255. package/dist/types/react/web/wallets/shared/locale/tl.d.ts.map +1 -1
  256. package/dist/types/react/web/wallets/shared/locale/types.d.ts +1 -0
  257. package/dist/types/react/web/wallets/shared/locale/types.d.ts.map +1 -1
  258. package/dist/types/react/web/wallets/shared/locale/vi.d.ts +1 -0
  259. package/dist/types/react/web/wallets/shared/locale/vi.d.ts.map +1 -1
  260. package/dist/types/react/web/wallets/smartWallet/locale/fr.d.ts +4 -0
  261. package/dist/types/react/web/wallets/smartWallet/locale/fr.d.ts.map +1 -0
  262. package/dist/types/react/web/wallets/smartWallet/locale/getSmartWalletLocale.d.ts.map +1 -1
  263. package/dist/types/react/web/wallets/smartWallet/locale/ja.d.ts +2 -2
  264. package/dist/types/react/web/wallets/smartWallet/locale/ja.d.ts.map +1 -1
  265. package/dist/types/react/web/wallets/smartWallet/locale/kr.d.ts +4 -0
  266. package/dist/types/react/web/wallets/smartWallet/locale/kr.d.ts.map +1 -0
  267. package/dist/types/react/web/wallets/walletConnect/locale.d.ts.map +1 -1
  268. package/dist/types/transaction/actions/send-transaction.d.ts +76 -5
  269. package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
  270. package/dist/types/transaction/prepare-contract-call.d.ts +18 -13
  271. package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
  272. package/dist/types/transaction/read-contract.d.ts +39 -6
  273. package/dist/types/transaction/read-contract.d.ts.map +1 -1
  274. package/dist/types/version.d.ts +1 -1
  275. package/dist/types/version.d.ts.map +1 -1
  276. package/dist/types/wallets/in-app/web/in-app.d.ts +4 -1
  277. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  278. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +1 -0
  279. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  280. package/package.json +4 -3
  281. package/src/extensions/marketplace/direct-listings/types.ts +1 -0
  282. package/src/extensions/marketplace/direct-listings/utils.ts +1 -0
  283. package/src/extensions/marketplace/english-auctions/types.ts +1 -0
  284. package/src/extensions/marketplace/english-auctions/utils.ts +1 -0
  285. package/src/gas/fee-data.ts +1 -1
  286. package/src/react/core/hooks/contract/useContractEvents.ts +32 -2
  287. package/src/react/core/hooks/contract/useReadContract.ts +28 -6
  288. package/src/react/core/hooks/others/useWalletBalance.ts +17 -2
  289. package/src/react/core/hooks/wallets/useActiveAccount.ts +1 -0
  290. package/src/react/core/utils/wallet.ts +19 -1
  291. package/src/react/web/hooks/transaction/useSendTransaction.tsx +74 -4
  292. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +17 -2
  293. package/src/react/web/ui/ConnectWallet/Details.tsx +2 -2
  294. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +15 -0
  295. package/src/react/web/ui/ConnectWallet/locale/es.ts +8 -8
  296. package/src/react/web/ui/ConnectWallet/locale/fr.ts +118 -0
  297. package/src/react/web/ui/ConnectWallet/locale/getConnectLocale.ts +6 -0
  298. package/src/react/web/ui/ConnectWallet/locale/ja.ts +12 -12
  299. package/src/react/web/ui/ConnectWallet/locale/kr.ts +114 -0
  300. package/src/react/web/ui/ConnectWallet/locale/tl.ts +12 -12
  301. package/src/react/web/ui/PayEmbed-disconnected.test.tsx +5 -3
  302. package/src/react/web/ui/PayEmbed.test.tsx +17 -16
  303. package/src/react/web/ui/PayEmbed.tsx +9 -4
  304. package/src/react/web/ui/types.ts +3 -1
  305. package/src/react/web/wallets/injected/locale/fr.ts +27 -0
  306. package/src/react/web/wallets/injected/locale/getInjectedWalletLocale.ts +4 -0
  307. package/src/react/web/wallets/injected/locale/ja.ts +8 -10
  308. package/src/react/web/wallets/injected/locale/kr.ts +25 -0
  309. package/src/react/web/wallets/local/locale/fr.ts +51 -0
  310. package/src/react/web/wallets/local/locale/getLocalWalletLocale.ts +2 -0
  311. package/src/react/web/wallets/local/locale/ja.ts +14 -20
  312. package/src/react/web/wallets/local/locale/kr.ts +47 -0
  313. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +3 -6
  314. package/src/react/web/wallets/shared/locale/de.ts +1 -0
  315. package/src/react/web/wallets/shared/locale/en.ts +1 -0
  316. package/src/react/web/wallets/shared/locale/es.ts +1 -0
  317. package/src/react/web/wallets/shared/locale/fr.ts +59 -0
  318. package/src/react/web/wallets/shared/locale/getConnectLocale.ts +4 -0
  319. package/src/react/web/wallets/shared/locale/ja.ts +22 -21
  320. package/src/react/web/wallets/shared/locale/kr.ts +55 -0
  321. package/src/react/web/wallets/shared/locale/tl.ts +1 -0
  322. package/src/react/web/wallets/shared/locale/types.ts +1 -0
  323. package/src/react/web/wallets/shared/locale/vi.ts +1 -0
  324. package/src/react/web/wallets/smartWallet/locale/fr.ts +13 -0
  325. package/src/react/web/wallets/smartWallet/locale/getSmartWalletLocale.ts +4 -0
  326. package/src/react/web/wallets/smartWallet/locale/ja.ts +5 -7
  327. package/src/react/web/wallets/smartWallet/locale/kr.ts +11 -0
  328. package/src/react/web/wallets/walletConnect/locale.ts +9 -0
  329. package/src/transaction/actions/send-transaction.ts +76 -5
  330. package/src/transaction/prepare-contract-call.ts +18 -13
  331. package/src/transaction/read-contract.ts +39 -6
  332. package/src/version.ts +1 -1
  333. package/src/wallets/in-app/web/in-app.ts +4 -1
  334. package/src/wallets/in-app/web/lib/auth/index.ts +1 -0
  335. package/src/wallets/in-app/web/lib/auth/oauth.ts +1 -1
  336. package/src/wallets/smart/smart-wallet-integration.test.ts +6 -0
@@ -8,18 +8,89 @@ export type SendTransactionOptions = {
8
8
  gasless?: GaslessOptions;
9
9
  };
10
10
  /**
11
- * Sends a transaction using the provided wallet.
11
+ * Sends a transaction using the provided account.
12
+ *
13
+ * You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/typescript/v5/extensions/use).
12
14
  * @param options - The options for sending the transaction.
13
- * @returns A promise that resolves to the transaction hash.
14
- * @throws An error if the wallet is not connected.
15
+ * @returns A promise that resolves to the transaction result.
16
+ * @throws An error if the transaction reverts.
15
17
  * @transaction
16
18
  * @example
19
+ *
20
+ * ### Using a prepared contract call
21
+ *
22
+ * ```ts
23
+ * import { sendTransaction, getContract, prepareContractCall } from "thirdweb";
24
+ * import { sepolia } from "thirdweb/chains";
25
+ *
26
+ * const contract = getContract({
27
+ * address: "0x...",
28
+ * chain: sepolia,
29
+ * client,
30
+ * });
31
+ *
32
+ * const transaction = prepareContractCall({
33
+ * contract,
34
+ * method: "function transfer(address to, uint256 value)",
35
+ * params: [to, value],
36
+ * });
37
+ *
38
+ * const { transactionHash } = await sendTransaction({
39
+ * account,
40
+ * transaction,
41
+ * });
42
+ * ```
43
+ *
44
+ * ### Using a write extension
45
+ *
17
46
  * ```ts
18
- * import { sendTransaction } from "thirdweb";
47
+ * import { sendTransaction, getContract } from "thirdweb";
48
+ * import { sepolia } from "thirdweb/chains";
49
+ * import { mintTo } from "thirdweb/extensions/erc721";
50
+ *
51
+ * const contract = getContract({
52
+ * address: "0x...",
53
+ * chain: sepolia,
54
+ * client,
55
+ * });
56
+ *
57
+ * const transaction = mintTo({
58
+ * contract,
59
+ * to: "0x...",
60
+ * nft: {
61
+ * name: "NFT Name",
62
+ * description: "NFT Description",
63
+ * image: "https://example.com/image.png",
64
+ * },
65
+ * });
66
+ *
67
+ * const { transactionHash } = await sendTransaction({
68
+ * account,
69
+ * transaction,
70
+ * });
71
+ * ```
72
+ *
73
+ * ### Using a prepared transaction
74
+ *
75
+ * ```ts
76
+ * import { sendTransaction, getContract, prepareTransaction } from "thirdweb";
77
+ * import { sepolia } from "thirdweb/chains";
78
+ *
79
+ * const contract = getContract({
80
+ * address: "0x...",
81
+ * chain: sepolia,
82
+ * client,
83
+ * });
84
+ *
85
+ * const transaction = prepareTransaction({
86
+ * contract,
87
+ * to: "0x...",
88
+ * value: toWei("0.1"),
89
+ * });
19
90
  *
20
91
  * const { transactionHash } = await sendTransaction({
21
92
  * account,
22
- * transaction
93
+ * transaction,
23
94
  * });
24
95
  * ```
25
96
  */
@@ -1 +1 @@
1
- {"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAkChC"}
1
+ {"version":3,"file":"send-transaction.d.ts","sourceRoot":"","sources":["../../../../src/transaction/actions/send-transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAC;IAGjB,WAAW,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsFG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAkChC"}
@@ -16,36 +16,41 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
16
16
  * @returns A promise that resolves to the prepared transaction.
17
17
  * @transaction
18
18
  * @example
19
- * Usage with a human-readable method signature:
19
+ *
20
+ * ### Usage with a human-readable method signature:
21
+ *
20
22
  * ```ts
21
23
  * import { prepareContractCall } from "thirdweb";
22
24
  *
23
- * const transaction = await prepareContractCall({
25
+ * const transaction = prepareContractCall({
24
26
  * contract,
25
27
  * method: "function transfer(address to, uint256 value)",
26
28
  * params: [to, value],
27
29
  * });
28
30
  * ```
29
- * @example
30
- * Usage with explicit gas price and/or value:
31
+ *
32
+ * ### Usage with explicit gas price and/or value:
33
+ *
31
34
  * ```ts
32
35
  * import { prepareContractCall } from "thirdweb";
36
+ * import { toWei } from "thirdweb/utils";
33
37
  *
34
- * const transaction = await prepareContractCall({
38
+ * const transaction = prepareContractCall({
35
39
  * contract,
36
40
  * method: "function transfer(address to, uint256 value)",
37
41
  * params: [to, value],
38
42
  * maxFeePerGas: 30n,
39
43
  * maxPriorityFeePerGas: 1n,
40
- * value: 100000n,
44
+ * value: toWei("0.01"),
41
45
  * });
42
46
  * ```
43
- * @example
44
- * Usage with a JSON ABI function object:
47
+ *
48
+ * ### Usage with a JSON ABI function object:
49
+ *
45
50
  * ```ts
46
51
  * import { prepareContractCall } from "thirdweb";
47
52
  *
48
- * const transaction = await prepareContractCall({
53
+ * const transaction = prepareContractCall({
49
54
  * contract,
50
55
  * method: {
51
56
  * name: "transfer",
@@ -60,8 +65,9 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
60
65
  * params: [to, value],
61
66
  * });
62
67
  * ```
63
- * @example
64
- * Usage with a the ABI defined on the contract:
68
+ *
69
+ * ### Usage with a the ABI defined on the contract:
70
+ *
65
71
  * ```ts
66
72
  * import { getContract, prepareContractCall } from "thirdweb";
67
73
  * const contract = getContract({
@@ -75,8 +81,7 @@ export type PrepareContractCallOptions<TAbi extends Abi = [], TMethod extends Ab
75
81
  * });
76
82
  * ```
77
83
  *
78
- * @example
79
- * Passing extra call data to the transaction
84
+ * ### Passing extra call data to the transaction
80
85
  * ```ts
81
86
  * import { getContract, prepareContractCall } from "thirdweb";
82
87
  * const contract = getContract({
@@ -1 +1 @@
1
- {"version":3,"file":"prepare-contract-call.d.ts","sourceRoot":"","sources":["../../../src/transaction/prepare-contract-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,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K,CAAC,OAAO,SAAS,IAAI,SAAS;IACjC,MAAM,EAAE,CAAC,CAAC;CACX,GAEO,WAAW,GACX,YAAY,MAAM,EAAE,GACpB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,GAChE,uBAAuB,CAAC,IAAI,CAAC,EACjC,KAAK,CAAC,eAAe,SAAS,cAAc,CAC1C,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAC9C,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,uHA8EpE"}
1
+ {"version":3,"file":"prepare-contract-call.d.ts","sourceRoot":"","sources":["../../../src/transaction/prepare-contract-call.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,MAAM,MAAM,0BAA0B,CACpC,IAAI,SAAS,GAAG,GAAG,EAAE,EACrB,OAAO,SACH,WAAW,GACX,MAAM,GACN,CAAC,CACC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,IAAI,SAAS;IAAE,MAAM,EAAE,CAAC,CAAA;CAAE,GACvD,WAAW,GAAG,MAAM,GACpB,uBAAuB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type ReadContractOptions<TAbi extends Abi = [], TMethod extends AbiFuncti
16
16
  from?: string;
17
17
  } & ParamsOption<TPreparedMethod[1]> & Omit<PrepareTransactionOptions, "to" | "data" | "chain" | "client">, TAbi>;
18
18
  /**
19
- * Reads data from a smart contract.
19
+ * Reads state from a deployed smart contract.
20
+ *
21
+ * You can use raw read calls or read [extensions](https://portal.thirdweb.com/typescript/v5/extensions/use) to read from a contract.
22
+ *
20
23
  * @param options - The transaction options.
21
- * @returns A promise that resolves with the result of the read transaction.
24
+ * @returns A promise that resolves with the result of the read call.
22
25
  * @transaction
23
26
  * @example
27
+ *
28
+ * ### Using a contract read extension
29
+ *
24
30
  * ```ts
25
- * import { readContract } from "thirdweb";
26
- * const result = await readContract({
27
- * contract,
28
- * method: "function totalSupply() view returns (uint256)",
31
+ * import { getContract } from "thirdweb";
32
+ * import { sepolia } from "thirdweb/chains";
33
+ * import { useReadContract } from "thirdweb/react";
34
+ * import { getOwnedNFTs } form "thirdweb/extensions/erc721";
35
+ *
36
+ * const contract = getContract({
37
+ * client,
38
+ * address: "0x...",
39
+ * chain: sepolia,
40
+ * });
41
+ *
42
+ * const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
43
+ * ```
44
+ *
45
+ * ### Using a raw contract call
46
+ *
47
+ * ```ts
48
+ * import { getContract } from "thirdweb";
49
+ * import { sepolia } from "thirdweb/chains";
50
+ * import { useReadContract } from "thirdweb/react";
51
+ *
52
+ * const contract = getContract({
53
+ * client,
54
+ * address: "0x...",
55
+ * chain: sepolia,
56
+ * });
57
+ *
58
+ * const { data, isLoading } = useReadContract({
59
+ * contract,
60
+ * method: "function tokenURI(uint256 tokenId) returns (string)"});
61
+ * params: [1n],
29
62
  * });
30
63
  * ```
31
64
  */
@@ -1 +1 @@
1
- {"version":3,"file":"read-contract.d.ts","sourceRoot":"","sources":["../../../src/transaction/read-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,WAAW,EAChB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AG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,EACrE,IAAI,CACL,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,YAAY,CAChC,KAAK,CAAC,IAAI,SAAS,GAAG,EACtB,KAAK,CAAC,OAAO,SAAS,IAAI,SAAS;IACjC,MAAM,EAAE,CAAC,CAAC;CACX,GAEO,WAAW,GACX,YAAY,MAAM,EAAE,GACpB,CAAC,CAAC,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,GAChE,uBAAuB,CAAC,IAAI,CAAC,EACjC,KAAK,CAAC,eAAe,SAAS,cAAc,CAC1C,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAC3B,GAAG,cAAc,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAE9C,OAAO,EAAE,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,GAC3D,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAiFjD"}
@@ -1,2 +1,2 @@
1
- export declare const version = "5.43.1";
1
+ export declare const version = "5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2EAA2E,CAAC"}
@@ -36,7 +36,7 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
36
36
  *
37
37
  * [View all available social auth methods](https://portal.thirdweb.com/references/typescript/v5/InAppWalletSocialAuth)
38
38
  *
39
- * * ### Login with email
39
+ * ### Login with email
40
40
  *
41
41
  * ```ts
42
42
  * import { inAppWallet, preAuthenticate } from "thirdweb/wallets/in-app";
@@ -55,6 +55,7 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
55
55
  * client,
56
56
  * chain,
57
57
  * strategy: "email",
58
+ * email: "example@example.com",
58
59
  * verificationCode: "123456",
59
60
  * });
60
61
  * ```
@@ -77,8 +78,10 @@ import type { CreateWalletArgs } from "../../wallet-types.js";
77
78
  * client,
78
79
  * chain,
79
80
  * strategy: "phone",
81
+ * honeNumber: "+1234567890",
80
82
  * verificationCode: "123456",
81
83
  * });
84
+ * ```
82
85
  *
83
86
  * ### Login with passkey
84
87
  *
@@ -1 +1 @@
1
- {"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4JG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
1
+ {"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/web/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+JG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
@@ -49,6 +49,7 @@ export declare function getUserEmail(options: GetAuthenticatedUserParams): Promi
49
49
  export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams): Promise<string | undefined>;
50
50
  /**
51
51
  * Pre-authenticates the user based on the provided authentication strategy.
52
+ * Use this function to send a verification code to the user's email or phone number.
52
53
  * @param args - The arguments required for pre-authentication.
53
54
  * @returns A promise that resolves to the pre-authentication result.
54
55
  * @throws An error if the provided authentication strategy doesn't require pre-authentication.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyBhD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,uFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,kFAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,KAAK,CACP,YAAY,GACZ;IACE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CACJ,sFAMF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAyBhD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,uFAWpC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,0BAA0B,+BAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,0BAA0B,+BAM3E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,kFAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,KAAK,CACP,YAAY,GACZ;IACE,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB,CACJ,sFAMF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thirdweb",
3
- "version": "5.43.1",
3
+ "version": "5.43.3-nightly-c2e86c682868b23f56dfff8b5633a39f94b4db7a-20240803000841",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/thirdweb-dev/js.git#main"
@@ -296,12 +296,13 @@
296
296
  "expo-linking": "6.3.1",
297
297
  "expo-web-browser": "13.0.3",
298
298
  "happy-dom": "^14.12.0",
299
+ "msw": "^2.3.4",
299
300
  "react-native": "0.74.2",
300
301
  "react-native-aes-gcm-crypto": "0.2.2",
301
302
  "react-native-quick-crypto": "0.7.0-rc.6",
302
303
  "react-native-svg": "15.3.0",
303
- "vitest": "1.6.0",
304
- "typescript": "5.5.2"
304
+ "typescript": "5.5.2",
305
+ "vitest": "1.6.0"
305
306
  },
306
307
  "scripts": {
307
308
  "bench:compare": "bun run ./benchmarks/run.ts",
@@ -20,4 +20,5 @@ export type DirectListing = {
20
20
  endTimeInSeconds: bigint;
21
21
  isReservedListing: boolean;
22
22
  status: ListingStatus;
23
+ type: "direct-listing";
23
24
  };
@@ -64,6 +64,7 @@ export async function mapDirectListing(
64
64
  endTimeInSeconds: rawListing.endTimestamp,
65
65
  isReservedListing: rawListing.reserved,
66
66
  status,
67
+ type: "direct-listing",
67
68
  };
68
69
  }
69
70
 
@@ -23,4 +23,5 @@ export type EnglishAuction = {
23
23
  endTimeInSeconds: bigint;
24
24
  asset: NFT;
25
25
  status: ListingStatus;
26
+ type: "english-auction";
26
27
  };
@@ -72,5 +72,6 @@ export async function mapEnglishAuction(
72
72
  },
73
73
  timeBufferInSeconds: rawAuction.timeBufferInSeconds,
74
74
  bidBufferBps: rawAuction.bidBufferBps,
75
+ type: "english-auction",
75
76
  };
76
77
  }
@@ -143,7 +143,7 @@ async function getDynamicFeeData(
143
143
  eth_maxPriorityFeePerGas(rpcRequest).catch(() => null),
144
144
  ]);
145
145
 
146
- const baseBlockFee = block?.baseFeePerGas ? block.baseFeePerGas : 100n;
146
+ const baseBlockFee = block?.baseFeePerGas ?? 0n;
147
147
 
148
148
  const chainId = chain.id;
149
149
  // flag chain testnet & flag chain
@@ -25,10 +25,21 @@ type UseContractEventsOptions<
25
25
  };
26
26
 
27
27
  /**
28
- * Watches contract events and returns the logs.
29
- * @param options - The {@link UseContractEventsOptions | options} for watching contract events.
28
+ * Watches contract events and returns the parsed logs.
29
+ * @param options - The options for watching contract events.
30
+ * @param options.contract - The contract to watch events for.
31
+ * @param options.events - The events to watch. Shuould be an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent).
32
+ * @param options.blockRange - The number of blocks to search for events.
33
+ * @param options.enabled - Whether to enable the query.
34
+ * @param options.watch - Whether to watch for new events.
30
35
  * @returns The contract events of the watched contract events.
31
36
  * @example
37
+ *
38
+ * ### Using event extensions
39
+ *
40
+ * The `thirdweb/extesions` export contains event definitions for many popular contracts.
41
+ * You can use these event definitions to watch for specific events with a type-safe API.
42
+ *
32
43
  * ```jsx
33
44
  * import { useContractEvents } from "thirdweb/react";
34
45
  * import { tokensClaimedEvent } from "thirdweb/extensions/erc721";
@@ -39,6 +50,25 @@ type UseContractEventsOptions<
39
50
  * events: [tokensClaimedEvent({ claimer: account?.address })],
40
51
  * });
41
52
  * ```
53
+ *
54
+ * ### Using custom events
55
+ *
56
+ * You can also watch for custom events by passing an array of [prepared events](https://portal.thirdweb.com/references/typescript/v5/prepareEvent).
57
+ *
58
+ * ```jsx
59
+ * import { useContractEvents } from "thirdweb/react";
60
+ * import { prepareEvent } from "thirdweb";
61
+ *
62
+ * const myEvent = prepareEvent({
63
+ * signature: "event MyEvent(uint256 myArg)",
64
+ * });
65
+ *
66
+ * const contractEvents = useContractEvents({
67
+ * contract,
68
+ * events: [myEvent],
69
+ * });
70
+ * ```
71
+ *
42
72
  * @contract
43
73
  */
44
74
  export function useContractEvents<
@@ -28,13 +28,29 @@ type PickedQueryOptions = Prettify<
28
28
  >;
29
29
 
30
30
  /**
31
- * A hook to read from a contract.
31
+ * A hook to read state from a contract that automatically updates when the contract changes.
32
+ *
33
+ * You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.
34
+ *
32
35
  * @param options - The options for reading from a contract
33
- * @returns a query object.
36
+ * @returns a UseQueryResult object.
34
37
  * @example
35
38
  * ```jsx
39
+ * import { getContract } from "thirdweb";
40
+ * import { sepolia } from "thirdweb/chains";
36
41
  * import { useReadContract } from "thirdweb/react";
37
- * const { data, isLoading } = useReadContract({contract, method: "totalSupply"});
42
+ *
43
+ * const contract = getContract({
44
+ * client,
45
+ * address: "0x...",
46
+ * chain: sepolia,
47
+ * });
48
+ *
49
+ * const { data, isLoading } = useReadContract({
50
+ * contract,
51
+ * method: "function tokenURI(uint256 tokenId) returns (string)"});
52
+ * params: [1n],
53
+ * });
38
54
  * ```
39
55
  * @contract
40
56
  */
@@ -51,14 +67,20 @@ export function useReadContract<
51
67
  ReadContractResult<PreparedMethod<ParseMethod<abi, method>>[2]>
52
68
  >;
53
69
  /**
54
- * A hook to read from a contract.
70
+ * A hook to read state from a contract that automatically updates when the contract changes.
71
+ * You can use raw read calls or read [extensions](https://portal.thirdweb.com/react/v5/extensions) to read from a contract.
72
+ *
55
73
  * @param extension - An extension to call.
56
74
  * @param options - The read extension params.
57
- * @returns a query object.
75
+ * @returns a UseQueryResult object.
58
76
  * @example
77
+ *
78
+ * Read a contract extension let you do complex contract queries with less code.
79
+ *
59
80
  * ```jsx
60
81
  * import { useReadContract } from "thirdweb/react";
61
- * import { getOwnedNFTs } form "thirdweb/extensions/erc721"
82
+ * import { getOwnedNFTs } form "thirdweb/extensions/erc721";
83
+ *
62
84
  * const { data, isLoading } = useReadContract(getOwnedNFTs, { contract, owner: address });
63
85
  * ```
64
86
  */
@@ -23,8 +23,8 @@ export type UseWalletBalanceQueryOptions = Omit<
23
23
  >;
24
24
 
25
25
  /**
26
- * Fetch the balance of a wallet for a specific token.
27
- * @note Leave `tokenAddress` undefined to fetch the native token balance.
26
+ * Fetch the balance of a wallet in native currency or for a specific token.
27
+ * Leave `tokenAddress` undefined to fetch the native token balance.
28
28
  * @param options {@link GetWalletBalanceOptions} - The options for fetching the wallet balance.
29
29
  * @param options.chain - The chain to fetch the wallet balance from.
30
30
  * @param options.address - The address of the wallet to fetch the balance from.
@@ -33,10 +33,25 @@ export type UseWalletBalanceQueryOptions = Omit<
33
33
  * @returns {@link GetWalletBalanceResult} The result of the query.
34
34
  *
35
35
  * @example
36
+ *
37
+ * ### Fetching the native token balance
38
+ *
36
39
  * ```ts
37
40
  * import { useWalletBalance } from "thirdweb/react";
38
41
  *
42
+ * const { data, isLoading, isError } = useWalletBalance({ chain, address, client });
43
+ * console.log("balance", data?.displayValue, data?.symbol);
44
+ * ```
45
+ *
46
+ * ### Fetching a specific token balance
47
+ *
48
+ * ```ts
49
+ * import { useWalletBalance } from "thirdweb/react";
50
+ *
51
+ * const tokenAddress = "0x..."; // the ERC20 token address
52
+ *
39
53
  * const { data, isLoading, isError } = useWalletBalance({ chain, address, client, tokenAddress });
54
+ * console.log("balance", data?.displayValue, data?.symbol);
40
55
  * ```
41
56
  * @wallet
42
57
  */
@@ -9,6 +9,7 @@ import { useConnectionManagerCtx } from "../../providers/connection-manager.js";
9
9
  * import { useActiveAccount } from "thirdweb/react";
10
10
  *
11
11
  * const activeAccount = useActiveAccount();
12
+ * console.log("address", activeAccount?.address);
12
13
  * ```
13
14
  * @walletConnection
14
15
  */
@@ -122,6 +122,14 @@ export function useConnectedWalletDetails(
122
122
 
123
123
  /**
124
124
  * Returns the wallet info for the provided wallet id.
125
+ *
126
+ * @example
127
+ * ```tsx
128
+ * import { useWalletInfo } from "thirdweb/react";
129
+ *
130
+ * const { data: walletInfo } = useWalletInfo("io.metamask");
131
+ * console.log("Walelt name", walletInfo?.name);
132
+ * ```
125
133
  * @wallet
126
134
  */
127
135
  export function useWalletInfo(id: WalletId | undefined) {
@@ -141,7 +149,17 @@ export function useWalletInfo(id: WalletId | undefined) {
141
149
  }
142
150
 
143
151
  /**
144
- * Returns the wallet image for the provided wallet id.
152
+ * Returns the wallet icon for the provided wallet id.
153
+ *
154
+ * @example
155
+ * ```tsx
156
+ * import { useWalletImage } from "thirdweb/react";
157
+ *
158
+ * const { data: walletImage } = useWalletImage("io.metamask");
159
+ *
160
+ * return <img src={walletImage} alt="MetaMask logo" />;
161
+ * ```
162
+ *
145
163
  * @wallet
146
164
  */
147
165
  export function useWalletImage(id: WalletId | undefined) {
@@ -10,17 +10,87 @@ import { SetRootElementContext } from "../../../core/providers/RootElementContex
10
10
  import { TransactionModal } from "../../ui/TransactionButton/TransactionModal.js";
11
11
 
12
12
  /**
13
- * A hook to send a transaction.
14
- * @returns A mutation object to send a transaction.
13
+ * A hook to send a transaction with from the user's connected wallet.
14
+ *
15
+ * You can send a transaction with a [prepared contract call](https://portal.thirdweb.com/references/typescript/v5/prepareContractCall), a [prepared transaction](https://portal.thirdweb.com/references/typescript/v5/prepareTransaction), or using a write [Extension](https://portal.thirdweb.com/react/v5/extensions).
16
+ *
17
+ * @returns A UseMutationResult object to send a transaction.
15
18
  * @param config Configuration for the `useSendTransaction` hook.
16
19
  * Refer to [`SendTransactionConfig`](https://portal.thirdweb.com/references/typescript/v5/SendTransactionConfig) for more details.
17
20
  * @example
21
+ *
22
+ * ### Using a prepared contract call
23
+ *
18
24
  * ```tsx
19
25
  * import { useSendTransaction } from "thirdweb/react";
26
+ * import { getContract, prepareContractCall } from "thirdweb";
27
+ * import { sepolia } from "thirdweb/chains";
28
+ *
29
+ * const contract = getContract({
30
+ * address: "0x...",
31
+ * chain: sepolia,
32
+ * client,
33
+ * });
34
+ *
35
+ * const { mutate: sendTx, data: transactionResult } = useSendTransaction();
36
+ *
37
+ * const onClick = () => {
38
+ * const transaction = prepareContractCall({
39
+ * contract,
40
+ * method: "function transfer(address to, uint256 value)",
41
+ * params: [to, value],
42
+ * }),
43
+ * });
44
+ * sendTx(transaction);
45
+ * };
46
+ * ```
47
+ *
48
+ * ### Using a write extension
49
+ *
50
+ * ```tsx
51
+ * import { useSendTransaction } from "thirdweb/react";
52
+ * import { mintTo } from "thirdweb/extensions/erc721";
53
+ *
54
+ * const { mutate: sendTx, data: transactionResult } = useSendTransaction();
55
+ *
56
+ * const onClick = () => {
57
+ * const transaction = mintTo({
58
+ * contract,
59
+ * to: "0x...",
60
+ * nft: {
61
+ * name: "NFT Name",
62
+ * description: "NFT Description",
63
+ * image: "https://example.com/image.png",
64
+ * },
65
+ * });
66
+ * sendTx(transaction);
67
+ * };
68
+ * ```
69
+ *
70
+ * ### Sending a prepared transaction
71
+ *
72
+ * ```tsx
73
+ * import { useSendTransaction } from "thirdweb/react";
74
+ * import { getContract, prepareTransaction } from "thirdweb";
75
+ * import { sepolia } from "thirdweb/chains";
76
+ *
77
+ * const contract = getContract({
78
+ * address: "0x...",
79
+ * chain: sepolia,
80
+ * client,
81
+ * });
82
+ *
20
83
  * const { mutate: sendTx, data: transactionResult } = useSendTransaction();
21
84
  *
22
- * // later
23
- * sendTx(tx);
85
+ * const onClick = () => {
86
+ * const transaction = prepareTransaction({
87
+ * contract,
88
+ * to: "0x...",
89
+ * value: toWei("0.1"),
90
+ * }),
91
+ * });
92
+ * sendTx(transaction);
93
+ * };
24
94
  * ```
25
95
  *
26
96
  * @transaction