thirdweb 5.69.1-nightly-f368793375d099eec53569330af7a083e558e483-20241120000334 → 5.70.0-nightly-ecaa304a812188da3c81888bb52ca6064093c139-20241121000332

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 (398) hide show
  1. package/dist/cjs/client/client.js +1 -0
  2. package/dist/cjs/client/client.js.map +1 -1
  3. package/dist/cjs/exports/react.js +32 -3
  4. package/dist/cjs/exports/react.js.map +1 -1
  5. package/dist/cjs/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +1 -1
  6. package/dist/cjs/extensions/modules/common/checkModulesCompatibility.js +5 -0
  7. package/dist/cjs/extensions/modules/common/checkModulesCompatibility.js.map +1 -1
  8. package/dist/cjs/extensions/prebuilts/deploy-pack.js +1 -0
  9. package/dist/cjs/extensions/prebuilts/deploy-pack.js.map +1 -1
  10. package/dist/cjs/extensions/thirdweb/write/publish.js +4 -0
  11. package/dist/cjs/extensions/thirdweb/write/publish.js.map +1 -1
  12. package/dist/cjs/react/core/hooks/others/useChainQuery.js +3 -3
  13. package/dist/cjs/react/core/hooks/rpc/useBlockNumber.js +1 -1
  14. package/dist/cjs/react/core/hooks/wallets/useCapabilities.js +1 -1
  15. package/dist/cjs/react/core/hooks/wallets/useSendCalls.js +3 -3
  16. package/dist/cjs/react/core/providers/connection-manager.js +3 -0
  17. package/dist/cjs/react/core/providers/connection-manager.js.map +1 -1
  18. package/dist/cjs/react/core/utils/wallet.js +2 -1
  19. package/dist/cjs/react/core/utils/wallet.js.map +1 -1
  20. package/dist/cjs/react/core/utils/walletIcon.js +2 -0
  21. package/dist/cjs/react/core/utils/walletIcon.js.map +1 -1
  22. package/dist/cjs/react/native/hooks/wallets/useProfiles.js +1 -1
  23. package/dist/cjs/react/native/providers/thirdweb-provider.js +1 -0
  24. package/dist/cjs/react/native/providers/thirdweb-provider.js.map +1 -1
  25. package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js +1 -0
  26. package/dist/cjs/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
  27. package/dist/cjs/react/native/ui/connect/ConnectModal.js +1 -0
  28. package/dist/cjs/react/native/ui/connect/ConnectModal.js.map +1 -1
  29. package/dist/cjs/react/native/ui/transaction/TransactionButton.js +1 -0
  30. package/dist/cjs/react/native/ui/transaction/TransactionButton.js.map +1 -1
  31. package/dist/cjs/react/web/hooks/wallets/useProfiles.js +1 -1
  32. package/dist/cjs/react/web/providers/thirdweb-provider.js +1 -0
  33. package/dist/cjs/react/web/providers/thirdweb-provider.js.map +1 -1
  34. package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js +1 -0
  35. package/dist/cjs/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
  36. package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js +19 -4
  37. package/dist/cjs/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
  38. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +21 -19
  39. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  40. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +18 -13
  41. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  42. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -0
  43. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  44. package/dist/cjs/react/web/ui/PayEmbed.js +1 -0
  45. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  46. package/dist/cjs/react/web/ui/SiteEmbed.js +3 -2
  47. package/dist/cjs/react/web/ui/SiteEmbed.js.map +1 -1
  48. package/dist/cjs/react/web/ui/SiteLink.js +2 -1
  49. package/dist/cjs/react/web/ui/SiteLink.js.map +1 -1
  50. package/dist/cjs/react/web/ui/TransactionButton/index.js +1 -0
  51. package/dist/cjs/react/web/ui/TransactionButton/index.js.map +1 -1
  52. package/dist/cjs/react/web/ui/prebuilt/Account/address.js +49 -0
  53. package/dist/cjs/react/web/ui/prebuilt/Account/address.js.map +1 -0
  54. package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js +144 -0
  55. package/dist/cjs/react/web/ui/prebuilt/Account/avatar.js.map +1 -0
  56. package/dist/cjs/react/web/ui/prebuilt/Account/balance.js +122 -0
  57. package/dist/cjs/react/web/ui/prebuilt/Account/balance.js.map +1 -0
  58. package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js +16 -0
  59. package/dist/cjs/react/web/ui/prebuilt/Account/blobbie.js.map +1 -0
  60. package/dist/cjs/react/web/ui/prebuilt/Account/name.js +106 -0
  61. package/dist/cjs/react/web/ui/prebuilt/Account/name.js.map +1 -0
  62. package/dist/cjs/react/web/ui/prebuilt/Account/provider.js +43 -0
  63. package/dist/cjs/react/web/ui/prebuilt/Account/provider.js.map +1 -0
  64. package/dist/cjs/react/web/ui/prebuilt/NFT/description.js +69 -0
  65. package/dist/cjs/react/web/ui/prebuilt/NFT/description.js.map +1 -0
  66. package/dist/cjs/react/web/ui/prebuilt/NFT/hooks.js +45 -0
  67. package/dist/cjs/react/web/ui/prebuilt/NFT/hooks.js.map +1 -0
  68. package/dist/cjs/react/web/ui/prebuilt/NFT/media.js +82 -0
  69. package/dist/cjs/react/web/ui/prebuilt/NFT/media.js.map +1 -0
  70. package/dist/cjs/react/web/ui/prebuilt/NFT/name.js +68 -0
  71. package/dist/cjs/react/web/ui/prebuilt/NFT/name.js.map +1 -0
  72. package/dist/cjs/react/web/ui/prebuilt/NFT/provider.js +55 -0
  73. package/dist/cjs/react/web/ui/prebuilt/NFT/provider.js.map +1 -0
  74. package/dist/cjs/react/web/ui/prebuilt/Token/icon.js +113 -0
  75. package/dist/cjs/react/web/ui/prebuilt/Token/icon.js.map +1 -0
  76. package/dist/cjs/react/web/ui/prebuilt/Token/name.js +137 -0
  77. package/dist/cjs/react/web/ui/prebuilt/Token/name.js.map +1 -0
  78. package/dist/cjs/react/web/ui/prebuilt/Token/provider.js +54 -0
  79. package/dist/cjs/react/web/ui/prebuilt/Token/provider.js.map +1 -0
  80. package/dist/cjs/react/web/ui/prebuilt/Token/symbol.js +134 -0
  81. package/dist/cjs/react/web/ui/prebuilt/Token/symbol.js.map +1 -0
  82. package/dist/cjs/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js +1 -0
  83. package/dist/cjs/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js.map +1 -1
  84. package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -0
  85. package/dist/cjs/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
  86. package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +1 -0
  87. package/dist/cjs/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -1
  88. package/dist/cjs/storage/unpin.js +1 -1
  89. package/dist/cjs/storage/upload.js +1 -0
  90. package/dist/cjs/storage/upload.js.map +1 -1
  91. package/dist/cjs/transaction/actions/to-serializable-transaction.js +1 -1
  92. package/dist/cjs/transaction/actions/zksync/send-eip712-transaction.js +5 -0
  93. package/dist/cjs/transaction/actions/zksync/send-eip712-transaction.js.map +1 -1
  94. package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js +5 -0
  95. package/dist/cjs/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
  96. package/dist/cjs/utils/config.js +9 -0
  97. package/dist/cjs/utils/config.js.map +1 -1
  98. package/dist/cjs/utils/json.js +7 -4
  99. package/dist/cjs/utils/json.js.map +1 -1
  100. package/dist/cjs/version.js +1 -1
  101. package/dist/cjs/wallets/eip5792/get-calls-status.js +1 -1
  102. package/dist/cjs/wallets/eip5792/get-capabilities.js +1 -1
  103. package/dist/cjs/wallets/eip5792/send-calls.js +2 -2
  104. package/dist/cjs/wallets/eip5792/wait-for-bundle.js +1 -1
  105. package/dist/cjs/wallets/in-app/core/users/getUser.js +1 -1
  106. package/dist/cjs/wallets/smart/smart-wallet.js +1 -0
  107. package/dist/cjs/wallets/smart/smart-wallet.js.map +1 -1
  108. package/dist/esm/client/client.js +1 -0
  109. package/dist/esm/client/client.js.map +1 -1
  110. package/dist/esm/exports/react.js +17 -1
  111. package/dist/esm/exports/react.js.map +1 -1
  112. package/dist/esm/extensions/erc721/lazyMinting/read/getBatchesToReveal.js +1 -1
  113. package/dist/esm/extensions/modules/common/checkModulesCompatibility.js +5 -0
  114. package/dist/esm/extensions/modules/common/checkModulesCompatibility.js.map +1 -1
  115. package/dist/esm/extensions/prebuilts/deploy-pack.js +1 -0
  116. package/dist/esm/extensions/prebuilts/deploy-pack.js.map +1 -1
  117. package/dist/esm/extensions/thirdweb/write/publish.js +4 -0
  118. package/dist/esm/extensions/thirdweb/write/publish.js.map +1 -1
  119. package/dist/esm/react/core/hooks/others/useChainQuery.js +3 -3
  120. package/dist/esm/react/core/hooks/rpc/useBlockNumber.js +1 -1
  121. package/dist/esm/react/core/hooks/wallets/useCapabilities.js +1 -1
  122. package/dist/esm/react/core/hooks/wallets/useSendCalls.js +3 -3
  123. package/dist/esm/react/core/providers/connection-manager.js +3 -0
  124. package/dist/esm/react/core/providers/connection-manager.js.map +1 -1
  125. package/dist/esm/react/core/utils/wallet.js +2 -1
  126. package/dist/esm/react/core/utils/wallet.js.map +1 -1
  127. package/dist/esm/react/core/utils/walletIcon.js +2 -0
  128. package/dist/esm/react/core/utils/walletIcon.js.map +1 -1
  129. package/dist/esm/react/native/hooks/wallets/useProfiles.js +1 -1
  130. package/dist/esm/react/native/providers/thirdweb-provider.js +1 -0
  131. package/dist/esm/react/native/providers/thirdweb-provider.js.map +1 -1
  132. package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js +1 -0
  133. package/dist/esm/react/native/ui/AutoConnect/AutoConnect.js.map +1 -1
  134. package/dist/esm/react/native/ui/connect/ConnectModal.js +1 -0
  135. package/dist/esm/react/native/ui/connect/ConnectModal.js.map +1 -1
  136. package/dist/esm/react/native/ui/transaction/TransactionButton.js +1 -0
  137. package/dist/esm/react/native/ui/transaction/TransactionButton.js.map +1 -1
  138. package/dist/esm/react/web/hooks/wallets/useProfiles.js +1 -1
  139. package/dist/esm/react/web/providers/thirdweb-provider.js +1 -0
  140. package/dist/esm/react/web/providers/thirdweb-provider.js.map +1 -1
  141. package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js +1 -0
  142. package/dist/esm/react/web/ui/AutoConnect/AutoConnect.js.map +1 -1
  143. package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js +19 -4
  144. package/dist/esm/react/web/ui/ConnectWallet/Blobbie.js.map +1 -1
  145. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +21 -19
  146. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  147. package/dist/esm/react/web/ui/ConnectWallet/Details.js +19 -14
  148. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  149. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +1 -0
  150. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  151. package/dist/esm/react/web/ui/PayEmbed.js +1 -0
  152. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  153. package/dist/esm/react/web/ui/SiteEmbed.js +3 -2
  154. package/dist/esm/react/web/ui/SiteEmbed.js.map +1 -1
  155. package/dist/esm/react/web/ui/SiteLink.js +2 -1
  156. package/dist/esm/react/web/ui/SiteLink.js.map +1 -1
  157. package/dist/esm/react/web/ui/TransactionButton/index.js +1 -0
  158. package/dist/esm/react/web/ui/TransactionButton/index.js.map +1 -1
  159. package/dist/esm/react/web/ui/prebuilt/Account/address.js +46 -0
  160. package/dist/esm/react/web/ui/prebuilt/Account/address.js.map +1 -0
  161. package/dist/esm/react/web/ui/prebuilt/Account/avatar.js +141 -0
  162. package/dist/esm/react/web/ui/prebuilt/Account/avatar.js.map +1 -0
  163. package/dist/esm/react/web/ui/prebuilt/Account/balance.js +119 -0
  164. package/dist/esm/react/web/ui/prebuilt/Account/balance.js.map +1 -0
  165. package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js +13 -0
  166. package/dist/esm/react/web/ui/prebuilt/Account/blobbie.js.map +1 -0
  167. package/dist/esm/react/web/ui/prebuilt/Account/name.js +103 -0
  168. package/dist/esm/react/web/ui/prebuilt/Account/name.js.map +1 -0
  169. package/dist/esm/react/web/ui/prebuilt/Account/provider.js +39 -0
  170. package/dist/esm/react/web/ui/prebuilt/Account/provider.js.map +1 -0
  171. package/dist/esm/react/web/ui/prebuilt/NFT/description.js +66 -0
  172. package/dist/esm/react/web/ui/prebuilt/NFT/description.js.map +1 -0
  173. package/dist/esm/react/web/ui/prebuilt/NFT/hooks.js +41 -0
  174. package/dist/esm/react/web/ui/prebuilt/NFT/hooks.js.map +1 -0
  175. package/dist/esm/react/web/ui/prebuilt/NFT/media.js +79 -0
  176. package/dist/esm/react/web/ui/prebuilt/NFT/media.js.map +1 -0
  177. package/dist/esm/react/web/ui/prebuilt/NFT/name.js +65 -0
  178. package/dist/esm/react/web/ui/prebuilt/NFT/name.js.map +1 -0
  179. package/dist/esm/react/web/ui/prebuilt/NFT/provider.js +50 -0
  180. package/dist/esm/react/web/ui/prebuilt/NFT/provider.js.map +1 -0
  181. package/dist/esm/react/web/ui/prebuilt/Token/icon.js +110 -0
  182. package/dist/esm/react/web/ui/prebuilt/Token/icon.js.map +1 -0
  183. package/dist/esm/react/web/ui/prebuilt/Token/name.js +134 -0
  184. package/dist/esm/react/web/ui/prebuilt/Token/name.js.map +1 -0
  185. package/dist/esm/react/web/ui/prebuilt/Token/provider.js +50 -0
  186. package/dist/esm/react/web/ui/prebuilt/Token/provider.js.map +1 -0
  187. package/dist/esm/react/web/ui/prebuilt/Token/symbol.js +131 -0
  188. package/dist/esm/react/web/ui/prebuilt/Token/symbol.js.map +1 -0
  189. package/dist/esm/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js +1 -0
  190. package/dist/esm/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.js.map +1 -1
  191. package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js +1 -0
  192. package/dist/esm/react/web/ui/prebuilt/thirdweb/ClaimButton/index.js.map +1 -1
  193. package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js +1 -0
  194. package/dist/esm/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.js.map +1 -1
  195. package/dist/esm/storage/unpin.js +1 -1
  196. package/dist/esm/storage/upload.js +1 -0
  197. package/dist/esm/storage/upload.js.map +1 -1
  198. package/dist/esm/transaction/actions/to-serializable-transaction.js +1 -1
  199. package/dist/esm/transaction/actions/zksync/send-eip712-transaction.js +5 -0
  200. package/dist/esm/transaction/actions/zksync/send-eip712-transaction.js.map +1 -1
  201. package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js +5 -0
  202. package/dist/esm/utils/any-evm/zksync/isZkSyncChain.js.map +1 -1
  203. package/dist/esm/utils/config.js +9 -0
  204. package/dist/esm/utils/config.js.map +1 -1
  205. package/dist/esm/utils/json.js +6 -2
  206. package/dist/esm/utils/json.js.map +1 -1
  207. package/dist/esm/version.js +1 -1
  208. package/dist/esm/wallets/eip5792/get-calls-status.js +1 -1
  209. package/dist/esm/wallets/eip5792/get-capabilities.js +1 -1
  210. package/dist/esm/wallets/eip5792/send-calls.js +2 -2
  211. package/dist/esm/wallets/eip5792/wait-for-bundle.js +1 -1
  212. package/dist/esm/wallets/in-app/core/users/getUser.js +1 -1
  213. package/dist/esm/wallets/smart/smart-wallet.js +1 -0
  214. package/dist/esm/wallets/smart/smart-wallet.js.map +1 -1
  215. package/dist/types/client/client.d.ts +1 -0
  216. package/dist/types/client/client.d.ts.map +1 -1
  217. package/dist/types/exports/react.d.ts +14 -1
  218. package/dist/types/exports/react.d.ts.map +1 -1
  219. package/dist/types/extensions/erc721/lazyMinting/read/getBatchesToReveal.d.ts +1 -1
  220. package/dist/types/extensions/modules/common/checkModulesCompatibility.d.ts +5 -0
  221. package/dist/types/extensions/modules/common/checkModulesCompatibility.d.ts.map +1 -1
  222. package/dist/types/extensions/prebuilts/deploy-pack.d.ts +1 -0
  223. package/dist/types/extensions/prebuilts/deploy-pack.d.ts.map +1 -1
  224. package/dist/types/extensions/thirdweb/write/publish.d.ts +4 -0
  225. package/dist/types/extensions/thirdweb/write/publish.d.ts.map +1 -1
  226. package/dist/types/react/core/hooks/others/useChainQuery.d.ts +3 -3
  227. package/dist/types/react/core/hooks/rpc/useBlockNumber.d.ts +1 -1
  228. package/dist/types/react/core/hooks/wallets/useCapabilities.d.ts +1 -1
  229. package/dist/types/react/core/hooks/wallets/useSendCalls.d.ts +3 -3
  230. package/dist/types/react/core/providers/connection-manager.d.ts +3 -0
  231. package/dist/types/react/core/providers/connection-manager.d.ts.map +1 -1
  232. package/dist/types/react/core/utils/wallet.d.ts +2 -1
  233. package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
  234. package/dist/types/react/core/utils/walletIcon.d.ts +2 -0
  235. package/dist/types/react/core/utils/walletIcon.d.ts.map +1 -1
  236. package/dist/types/react/native/hooks/wallets/useProfiles.d.ts +1 -1
  237. package/dist/types/react/native/providers/thirdweb-provider.d.ts +1 -0
  238. package/dist/types/react/native/providers/thirdweb-provider.d.ts.map +1 -1
  239. package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts +1 -0
  240. package/dist/types/react/native/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
  241. package/dist/types/react/native/ui/connect/ConnectModal.d.ts +1 -0
  242. package/dist/types/react/native/ui/connect/ConnectModal.d.ts.map +1 -1
  243. package/dist/types/react/native/ui/transaction/TransactionButton.d.ts +1 -0
  244. package/dist/types/react/native/ui/transaction/TransactionButton.d.ts.map +1 -1
  245. package/dist/types/react/web/hooks/wallets/useProfiles.d.ts +1 -1
  246. package/dist/types/react/web/providers/thirdweb-provider.d.ts +1 -0
  247. package/dist/types/react/web/providers/thirdweb-provider.d.ts.map +1 -1
  248. package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts +1 -0
  249. package/dist/types/react/web/ui/AutoConnect/AutoConnect.d.ts.map +1 -1
  250. package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts +22 -5
  251. package/dist/types/react/web/ui/ConnectWallet/Blobbie.d.ts.map +1 -1
  252. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +2 -1
  253. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  254. package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
  255. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +1 -0
  256. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  257. package/dist/types/react/web/ui/PayEmbed.d.ts +2 -2
  258. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  259. package/dist/types/react/web/ui/SiteEmbed.d.ts +3 -2
  260. package/dist/types/react/web/ui/SiteEmbed.d.ts.map +1 -1
  261. package/dist/types/react/web/ui/SiteLink.d.ts +2 -1
  262. package/dist/types/react/web/ui/SiteLink.d.ts.map +1 -1
  263. package/dist/types/react/web/ui/TransactionButton/index.d.ts +1 -0
  264. package/dist/types/react/web/ui/TransactionButton/index.d.ts.map +1 -1
  265. package/dist/types/react/web/ui/prebuilt/Account/address.d.ts +52 -0
  266. package/dist/types/react/web/ui/prebuilt/Account/address.d.ts.map +1 -0
  267. package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts +142 -0
  268. package/dist/types/react/web/ui/prebuilt/Account/avatar.d.ts.map +1 -0
  269. package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts +137 -0
  270. package/dist/types/react/web/ui/prebuilt/Account/balance.d.ts.map +1 -0
  271. package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts +8 -0
  272. package/dist/types/react/web/ui/prebuilt/Account/blobbie.d.ts.map +1 -0
  273. package/dist/types/react/web/ui/prebuilt/Account/name.d.ts +119 -0
  274. package/dist/types/react/web/ui/prebuilt/Account/name.d.ts.map +1 -0
  275. package/dist/types/react/web/ui/prebuilt/Account/provider.d.ts +45 -0
  276. package/dist/types/react/web/ui/prebuilt/Account/provider.d.ts.map +1 -0
  277. package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts +59 -0
  278. package/dist/types/react/web/ui/prebuilt/NFT/description.d.ts.map +1 -0
  279. package/dist/types/react/web/ui/prebuilt/NFT/hooks.d.ts +14 -0
  280. package/dist/types/react/web/ui/prebuilt/NFT/hooks.d.ts.map +1 -0
  281. package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts +75 -0
  282. package/dist/types/react/web/ui/prebuilt/NFT/media.d.ts.map +1 -0
  283. package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts +59 -0
  284. package/dist/types/react/web/ui/prebuilt/NFT/name.d.ts.map +1 -0
  285. package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts +55 -0
  286. package/dist/types/react/web/ui/prebuilt/NFT/provider.d.ts.map +1 -0
  287. package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts +95 -0
  288. package/dist/types/react/web/ui/prebuilt/Token/icon.d.ts.map +1 -0
  289. package/dist/types/react/web/ui/prebuilt/Token/name.d.ts +140 -0
  290. package/dist/types/react/web/ui/prebuilt/Token/name.d.ts.map +1 -0
  291. package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts +61 -0
  292. package/dist/types/react/web/ui/prebuilt/Token/provider.d.ts.map +1 -0
  293. package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts +137 -0
  294. package/dist/types/react/web/ui/prebuilt/Token/symbol.d.ts.map +1 -0
  295. package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts +1 -0
  296. package/dist/types/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.d.ts.map +1 -1
  297. package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts +1 -0
  298. package/dist/types/react/web/ui/prebuilt/thirdweb/ClaimButton/index.d.ts.map +1 -1
  299. package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts +1 -0
  300. package/dist/types/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.d.ts.map +1 -1
  301. package/dist/types/storage/unpin.d.ts +1 -1
  302. package/dist/types/storage/upload.d.ts +1 -0
  303. package/dist/types/storage/upload.d.ts.map +1 -1
  304. package/dist/types/transaction/actions/to-serializable-transaction.d.ts +1 -1
  305. package/dist/types/transaction/actions/zksync/send-eip712-transaction.d.ts +5 -0
  306. package/dist/types/transaction/actions/zksync/send-eip712-transaction.d.ts.map +1 -1
  307. package/dist/types/utils/any-evm/zksync/isZkSyncChain.d.ts +5 -0
  308. package/dist/types/utils/any-evm/zksync/isZkSyncChain.d.ts.map +1 -1
  309. package/dist/types/utils/config.d.ts +9 -0
  310. package/dist/types/utils/config.d.ts.map +1 -1
  311. package/dist/types/utils/json.d.ts +1 -1
  312. package/dist/types/utils/json.d.ts.map +1 -1
  313. package/dist/types/version.d.ts +1 -1
  314. package/dist/types/wallets/eip5792/get-calls-status.d.ts +1 -1
  315. package/dist/types/wallets/eip5792/get-capabilities.d.ts +1 -1
  316. package/dist/types/wallets/eip5792/send-calls.d.ts +2 -2
  317. package/dist/types/wallets/eip5792/wait-for-bundle.d.ts +1 -1
  318. package/dist/types/wallets/in-app/core/users/getUser.d.ts +1 -1
  319. package/dist/types/wallets/smart/smart-wallet.d.ts +1 -0
  320. package/dist/types/wallets/smart/smart-wallet.d.ts.map +1 -1
  321. package/package.json +1 -1
  322. package/src/client/client.ts +1 -0
  323. package/src/exports/react.ts +56 -2
  324. package/src/extensions/erc721/lazyMinting/read/getBatchesToReveal.ts +1 -1
  325. package/src/extensions/modules/common/checkModulesCompatibility.ts +5 -0
  326. package/src/extensions/prebuilts/deploy-pack.ts +1 -0
  327. package/src/extensions/thirdweb/write/publish.ts +4 -0
  328. package/src/react/core/hooks/others/useChainQuery.ts +3 -3
  329. package/src/react/core/hooks/rpc/useBlockNumber.ts +1 -1
  330. package/src/react/core/hooks/wallets/useCapabilities.ts +1 -1
  331. package/src/react/core/hooks/wallets/useSendCalls.ts +3 -3
  332. package/src/react/core/providers/connection-manager.tsx +3 -0
  333. package/src/react/core/utils/wallet.ts +2 -1
  334. package/src/react/core/utils/walletIcon.ts +2 -0
  335. package/src/react/native/hooks/wallets/useProfiles.ts +1 -1
  336. package/src/react/native/providers/thirdweb-provider.tsx +1 -0
  337. package/src/react/native/ui/AutoConnect/AutoConnect.tsx +1 -0
  338. package/src/react/native/ui/connect/ConnectModal.tsx +1 -0
  339. package/src/react/native/ui/transaction/TransactionButton.tsx +1 -0
  340. package/src/react/web/hooks/wallets/useProfiles.ts +1 -1
  341. package/src/react/web/providers/thirdweb-provider.tsx +1 -0
  342. package/src/react/web/ui/AutoConnect/AutoConnect.tsx +1 -0
  343. package/src/react/web/ui/ConnectWallet/Blobbie.tsx +31 -4
  344. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +36 -32
  345. package/src/react/web/ui/ConnectWallet/Details.tsx +91 -58
  346. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +1 -0
  347. package/src/react/web/ui/PayEmbed.tsx +2 -2
  348. package/src/react/web/ui/SiteEmbed.tsx +3 -2
  349. package/src/react/web/ui/SiteLink.tsx +2 -1
  350. package/src/react/web/ui/TransactionButton/index.tsx +1 -0
  351. package/src/react/web/ui/prebuilt/Account/address.test.tsx +28 -0
  352. package/src/react/web/ui/prebuilt/Account/address.tsx +64 -0
  353. package/src/react/web/ui/prebuilt/Account/avatar.test.tsx +48 -0
  354. package/src/react/web/ui/prebuilt/Account/avatar.tsx +221 -0
  355. package/src/react/web/ui/prebuilt/Account/balance.test.tsx +54 -0
  356. package/src/react/web/ui/prebuilt/Account/balance.tsx +202 -0
  357. package/src/react/web/ui/prebuilt/Account/blobbie.tsx +12 -0
  358. package/src/react/web/ui/prebuilt/Account/name.test.tsx +62 -0
  359. package/src/react/web/ui/prebuilt/Account/name.tsx +175 -0
  360. package/src/react/web/ui/prebuilt/Account/provider.test.tsx +38 -0
  361. package/src/react/web/ui/prebuilt/Account/provider.tsx +69 -0
  362. package/src/react/web/ui/prebuilt/NFT/NFT.test.tsx +17 -14
  363. package/src/react/web/ui/prebuilt/NFT/description.tsx +87 -0
  364. package/src/react/web/ui/prebuilt/NFT/hooks.tsx +53 -0
  365. package/src/react/web/ui/prebuilt/NFT/media.tsx +119 -0
  366. package/src/react/web/ui/prebuilt/NFT/name.tsx +85 -0
  367. package/src/react/web/ui/prebuilt/NFT/provider.tsx +75 -0
  368. package/src/react/web/ui/prebuilt/Token/icon.tsx +164 -0
  369. package/src/react/web/ui/prebuilt/Token/name.tsx +201 -0
  370. package/src/react/web/ui/prebuilt/Token/provider.tsx +86 -0
  371. package/src/react/web/ui/prebuilt/Token/symbol.tsx +201 -0
  372. package/src/react/web/ui/prebuilt/thirdweb/BuyDirectListingButton/index.tsx +1 -0
  373. package/src/react/web/ui/prebuilt/thirdweb/ClaimButton/index.tsx +1 -0
  374. package/src/react/web/ui/prebuilt/thirdweb/CreateDirectListingButton/index.tsx +1 -0
  375. package/src/storage/unpin.ts +1 -1
  376. package/src/storage/upload.ts +1 -0
  377. package/src/transaction/actions/to-serializable-transaction.ts +1 -1
  378. package/src/transaction/actions/zksync/send-eip712-transaction.ts +5 -0
  379. package/src/utils/any-evm/zksync/isZkSyncChain.ts +5 -0
  380. package/src/utils/config.ts +9 -0
  381. package/src/utils/json.ts +8 -2
  382. package/src/version.ts +1 -1
  383. package/src/wallets/eip5792/get-calls-status.ts +1 -1
  384. package/src/wallets/eip5792/get-capabilities.ts +1 -1
  385. package/src/wallets/eip5792/send-calls.ts +2 -2
  386. package/src/wallets/eip5792/wait-for-bundle.ts +1 -1
  387. package/src/wallets/in-app/core/users/getUser.ts +1 -1
  388. package/src/wallets/smart/smart-wallet.ts +1 -0
  389. package/dist/cjs/react/web/ui/prebuilt/NFT/NFT.js +0 -217
  390. package/dist/cjs/react/web/ui/prebuilt/NFT/NFT.js.map +0 -1
  391. package/dist/esm/react/web/ui/prebuilt/NFT/NFT.js +0 -212
  392. package/dist/esm/react/web/ui/prebuilt/NFT/NFT.js.map +0 -1
  393. package/dist/types/react/web/ui/prebuilt/NFT/NFT.d.ts +0 -76
  394. package/dist/types/react/web/ui/prebuilt/NFT/NFT.d.ts.map +0 -1
  395. package/src/extensions/prebuilts/deploy-published.test.ts +0 -132
  396. package/src/react/web/ui/prebuilt/NFT/NFT.tsx +0 -272
  397. package/src/wallets/smart/smart-wallet-integration-v07.test.ts +0 -270
  398. package/src/wallets/smart/smart-wallet-integration.test.ts +0 -375
@@ -15,6 +15,7 @@ import type { Chain } from "../../../../chains/types.js";
15
15
  import type { ThirdwebClient } from "../../../../client/client.js";
16
16
  import { getContract } from "../../../../contract/contract.js";
17
17
  import { getLastAuthProvider } from "../../../../react/core/utils/storage.js";
18
+ import { shortenAddress } from "../../../../utils/address.js";
18
19
  import { isContractDeployed } from "../../../../utils/bytecode/is-contract-deployed.js";
19
20
  import { formatNumber } from "../../../../utils/formatNumber.js";
20
21
  import { webLocalStorage } from "../../../../utils/storage/webStorage.js";
@@ -67,10 +68,7 @@ import type {
67
68
  SupportedTokens,
68
69
  } from "../../../core/utils/defaultTokens.js";
69
70
  import { hasSmartAccount } from "../../../core/utils/isSmartWallet.js";
70
- import {
71
- useConnectedWalletDetails,
72
- useWalletInfo,
73
- } from "../../../core/utils/wallet.js";
71
+ import { useWalletInfo } from "../../../core/utils/wallet.js";
74
72
  import { WalletUIStatesProvider } from "../../providers/wallet-ui-states-provider.js";
75
73
  import { ChainIcon } from "../components/ChainIcon.js";
76
74
  import { CopyIcon } from "../components/CopyIcon.js";
@@ -86,8 +84,13 @@ import { Button, IconButton } from "../components/buttons.js";
86
84
  import { Link, Text } from "../components/text.js";
87
85
  import { fadeInAnimation } from "../design-system/animations.js";
88
86
  import { StyledButton } from "../design-system/elements.js";
87
+ import { AccountAddress } from "../prebuilt/Account/address.js";
88
+ import { AccountAvatar } from "../prebuilt/Account/avatar.js";
89
+ import { AccountBalance } from "../prebuilt/Account/balance.js";
90
+ import { AccountBlobbie } from "../prebuilt/Account/blobbie.js";
91
+ import { AccountName } from "../prebuilt/Account/name.js";
92
+ import { AccountProvider } from "../prebuilt/Account/provider.js";
89
93
  import type { LocaleId } from "../types.js";
90
- import { Blobbie } from "./Blobbie.js";
91
94
  import { MenuButton, MenuLink } from "./MenuButton.js";
92
95
  import { ScreenSetupContext, useSetupScreen } from "./Modal/screen.js";
93
96
  import {
@@ -140,18 +143,10 @@ export const ConnectedWalletDetails: React.FC<{
140
143
  connectOptions: DetailsModalConnectOptions | undefined;
141
144
  }> = (props) => {
142
145
  const { connectLocale: locale, client } = props;
143
-
144
146
  const setRootEl = useContext(SetRootElementContext);
145
147
  const activeAccount = useActiveAccount();
146
148
  const walletChain = useActiveWalletChain();
147
149
 
148
- const { pfp, name, balanceQuery } = useConnectedWalletDetails(
149
- client,
150
- walletChain,
151
- activeAccount,
152
- props.detailsButton?.displayBalanceToken,
153
- );
154
-
155
150
  function closeModal() {
156
151
  setRootEl(null);
157
152
  }
@@ -199,8 +194,6 @@ export const ConnectedWalletDetails: React.FC<{
199
194
  );
200
195
  }
201
196
 
202
- const avatarSrc = props.detailsButton?.connectedAccountAvatarUrl || pfp;
203
-
204
197
  const combinedClassName = `${TW_CONNECTED_WALLET} ${props.detailsButton?.className || ""}`;
205
198
 
206
199
  return (
@@ -219,10 +212,10 @@ export const ConnectedWalletDetails: React.FC<{
219
212
  height: "35px",
220
213
  }}
221
214
  >
222
- {avatarSrc ? (
215
+ {props.detailsButton?.connectedAccountAvatarUrl ? (
223
216
  <img
224
217
  alt=""
225
- src={avatarSrc}
218
+ src={props.detailsButton.connectedAccountAvatarUrl}
226
219
  style={{
227
220
  height: "100%",
228
221
  width: "100%",
@@ -230,7 +223,16 @@ export const ConnectedWalletDetails: React.FC<{
230
223
  }}
231
224
  />
232
225
  ) : (
233
- activeAccount && <Blobbie address={activeAccount.address} size={35} />
226
+ activeAccount && (
227
+ <AccountAvatar
228
+ loadingComponent={<AccountBlobbie size={35} />}
229
+ fallbackComponent={<AccountBlobbie size={35} />}
230
+ queryOptions={{
231
+ refetchOnWindowFocus: false,
232
+ refetchOnMount: false,
233
+ }}
234
+ />
235
+ )
234
236
  )}
235
237
  </Container>
236
238
  <Container
@@ -243,29 +245,47 @@ export const ConnectedWalletDetails: React.FC<{
243
245
  }}
244
246
  >
245
247
  {/* Address */}
246
- <Text
247
- size="xs"
248
- color="primaryText"
249
- weight={500}
250
- className={`${TW_CONNECTED_WALLET}__address`}
251
- >
252
- {props.detailsButton?.connectedAccountName ?? name}
253
- </Text>
254
-
255
- {/* Balance */}
256
- {balanceQuery.data ? (
248
+ {props.detailsButton?.connectedAccountName ? (
257
249
  <Text
258
- className={`${TW_CONNECTED_WALLET}__balance`}
259
250
  size="xs"
260
- color="secondaryText"
261
- weight={400}
251
+ color="primaryText"
252
+ weight={500}
253
+ className={`${TW_CONNECTED_WALLET}__address`}
262
254
  >
263
- {formatBalanceOnButton(Number(balanceQuery.data.displayValue))}{" "}
264
- {balanceQuery.data.symbol}
255
+ {props.detailsButton.connectedAccountName}
265
256
  </Text>
266
257
  ) : (
267
- <Skeleton height={fontSize.xs} width="70px" />
258
+ <Text
259
+ size="xs"
260
+ color="primaryText"
261
+ weight={500}
262
+ className={`${TW_CONNECTED_WALLET}__address`}
263
+ >
264
+ <AccountName
265
+ loadingComponent={<AccountAddress formatFn={shortenAddress} />}
266
+ fallbackComponent={<AccountAddress formatFn={shortenAddress} />}
267
+ />
268
+ </Text>
268
269
  )}
270
+
271
+ <Text
272
+ className={`${TW_CONNECTED_WALLET}__balance`}
273
+ size="xs"
274
+ color="secondaryText"
275
+ weight={400}
276
+ >
277
+ <AccountBalance
278
+ chain={walletChain}
279
+ loadingComponent={<Skeleton height={fontSize.xs} width="70px" />}
280
+ fallbackComponent={<Skeleton height={fontSize.xs} width="70px" />}
281
+ formatFn={formatBalanceOnButton}
282
+ tokenAddress={
283
+ props.detailsButton?.displayBalanceToken?.[
284
+ Number(walletChain?.id)
285
+ ]
286
+ }
287
+ />
288
+ </Text>
269
289
  </Container>
270
290
  </WalletInfoButton>
271
291
  );
@@ -295,12 +315,6 @@ function DetailsModal(props: {
295
315
  const { client, locale } = props;
296
316
  const walletChain = useActiveWalletChain();
297
317
  const activeAccount = useActiveAccount();
298
- const { pfp, name, balanceQuery } = useConnectedWalletDetails(
299
- client,
300
- walletChain,
301
- activeAccount,
302
- props.displayBalanceToken,
303
- );
304
318
  const theme = parseTheme(props.theme);
305
319
 
306
320
  const activeWallet = useActiveWallet();
@@ -363,12 +377,15 @@ function DetailsModal(props: {
363
377
  <Text color="primaryText" size="md" multiline>
364
378
  {chainNameQuery.name || `Unknown chain #${walletChain?.id}`}
365
379
  <Text color="secondaryText" size="xs">
366
- {balanceQuery.data ? (
367
- formatNumber(Number(balanceQuery.data.displayValue), 9)
368
- ) : (
369
- <Skeleton height="1em" width="100px" />
370
- )}{" "}
371
- {balanceQuery.data?.symbol}
380
+ <AccountBalance
381
+ fallbackComponent={<Skeleton height="1em" width="100px" />}
382
+ loadingComponent={<Skeleton height="1em" width="100px" />}
383
+ formatFn={(num: number) => formatNumber(num, 9)}
384
+ chain={walletChain}
385
+ tokenAddress={
386
+ props.displayBalanceToken?.[Number(walletChain?.id)]
387
+ }
388
+ />
372
389
  </Text>
373
390
  </Text>
374
391
  )}
@@ -384,8 +401,6 @@ function DetailsModal(props: {
384
401
  </MenuButton>
385
402
  );
386
403
 
387
- const avatarSrc = props.detailsModal?.connectedAccountAvatarUrl ?? pfp;
388
-
389
404
  const { hideSendFunds, hideReceiveFunds, hideBuyFunds } =
390
405
  props.detailsModal || {};
391
406
 
@@ -407,9 +422,9 @@ function DetailsModal(props: {
407
422
  overflow: "hidden",
408
423
  }}
409
424
  >
410
- {avatarSrc ? (
425
+ {props.detailsModal?.connectedAccountAvatarUrl ? (
411
426
  <img
412
- src={avatarSrc}
427
+ src={props.detailsModal.connectedAccountAvatarUrl}
413
428
  style={{
414
429
  height: "100%",
415
430
  width: "100%",
@@ -419,9 +434,9 @@ function DetailsModal(props: {
419
434
  />
420
435
  ) : (
421
436
  activeAccount && (
422
- <Blobbie
423
- address={activeAccount.address}
424
- size={Number(iconSize.xxl)}
437
+ <AccountAvatar
438
+ loadingComponent={<AccountBlobbie size={Number(iconSize.xxl)} />}
439
+ fallbackComponent={<AccountBlobbie size={Number(iconSize.xxl)} />}
425
440
  />
426
441
  )
427
442
  )}
@@ -496,9 +511,22 @@ function DetailsModal(props: {
496
511
  alignItems: "center",
497
512
  }}
498
513
  >
499
- <Text color="primaryText" weight={500} size="md">
500
- {props.detailsModal?.connectedAccountName ?? name}
501
- </Text>
514
+ {props.detailsModal?.connectedAccountName ? (
515
+ <Text color="primaryText" weight={500} size="md">
516
+ {props.detailsModal.connectedAccountName}
517
+ </Text>
518
+ ) : (
519
+ <Text color="primaryText" weight={500} size="md">
520
+ <AccountName
521
+ loadingComponent={
522
+ <AccountAddress formatFn={shortenAddress} />
523
+ }
524
+ fallbackComponent={
525
+ <AccountAddress formatFn={shortenAddress} />
526
+ }
527
+ />
528
+ </Text>
529
+ )}
502
530
  <IconButton>
503
531
  <CopyIcon
504
532
  text={activeAccount?.address || ""}
@@ -964,7 +992,12 @@ function DetailsModal(props: {
964
992
  }
965
993
  }}
966
994
  >
967
- {content}
995
+ <AccountProvider
996
+ address={activeAccount?.address || ""}
997
+ client={client}
998
+ >
999
+ {content}
1000
+ </AccountProvider>
968
1001
  </Modal>
969
1002
  </ScreenSetupContext.Provider>
970
1003
  </WalletUIStatesProvider>
@@ -177,6 +177,7 @@ import { useSetupScreen } from "./screen.js";
177
177
  *
178
178
  * @returns A JSX element that renders the <ConnectEmbed> component.
179
179
  * @component
180
+ * @walletConnection
180
181
  */
181
182
  export function ConnectEmbed(props: ConnectEmbedProps) {
182
183
  const activeWallet = useActiveWallet();
@@ -29,8 +29,7 @@ import type { LocaleId } from "./types.js";
29
29
  */
30
30
  export type PayEmbedProps = {
31
31
  /**
32
- * Override the default tokens shown in PayEmbed uI
33
- * @component
32
+ * Override the default tokens shown in PayEmbed UI
34
33
  * By default, PayEmbed shows a few popular tokens for Pay supported chains
35
34
  * @example
36
35
  *
@@ -157,6 +156,7 @@ export type PayEmbedProps = {
157
156
  * }}
158
157
  * />
159
158
  * ```
159
+ * @buyCrypto
160
160
  */
161
161
  export function PayEmbed(props: PayEmbedProps) {
162
162
  const localeQuery = useConnectLocale(props.locale || "en_US");
@@ -11,9 +11,9 @@ import { useActiveWallet } from "../../core/hooks/wallets/useActiveWallet.js";
11
11
  /**
12
12
  * Embeds another thirdweb-supported site for seamless in-app and ecosystem wallet connection.
13
13
  *
14
- * @note Make sure the embedded site includes <AutoConnect /> and supports frame ancestors, see [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) for more information.
14
+ * Make sure the embedded site includes <AutoConnect /> and supports frame ancestors, see [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) for more information.
15
15
  *
16
- * @note The embedded site must support the connected wallet (ecosystem or in-app).
16
+ * The embedded site must support the connected wallet (ecosystem or in-app).
17
17
  *
18
18
  * @param {Object} props - The props to pass to the iframe
19
19
  * @param {String} props.src - The URL of the site to embed
@@ -26,6 +26,7 @@ import { useActiveWallet } from "../../core/hooks/wallets/useActiveWallet.js";
26
26
  *
27
27
  * <SiteEmbed src="https://thirdweb.com" client={thirdwebClient} ecosystem={{ id: "ecosystem.thirdweb" }} />
28
28
  * ```
29
+ * @walletConnection
29
30
  */
30
31
  export function SiteEmbed({
31
32
  src,
@@ -11,7 +11,7 @@ import { useActiveWallet } from "../../core/hooks/wallets/useActiveWallet.js";
11
11
  /**
12
12
  * Creates a link to another thirdweb-supported site with wallet connection parameters.
13
13
  *
14
- * @note The target site must support the connected wallet (ecosystem or in-app).
14
+ * The target site must support the connected wallet (ecosystem or in-app).
15
15
  *
16
16
  * @param {Object} props - The props to pass to the anchor tag
17
17
  * @param {String} props.href - The URL of the site to link to
@@ -27,6 +27,7 @@ import { useActiveWallet } from "../../core/hooks/wallets/useActiveWallet.js";
27
27
  * Visit Site
28
28
  * </SiteLink>
29
29
  * ```
30
+ * @walletConnection
30
31
  */
31
32
  export function SiteLink({
32
33
  href,
@@ -129,6 +129,7 @@ import { Button } from "../components/buttons.js";
129
129
  * </TransactionButton>
130
130
  * ```
131
131
  * @component
132
+ * @transaction
132
133
  */
133
134
  export function TransactionButton(props: TransactionButtonProps) {
134
135
  const {
@@ -0,0 +1,28 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { render, screen, waitFor } from "~test/react-render.js";
3
+ import { TEST_CLIENT } from "~test/test-clients.js";
4
+ import { shortenAddress } from "../../../../../utils/address.js";
5
+ import { AccountAddress } from "./address.js";
6
+ import { AccountProvider } from "./provider.js";
7
+
8
+ describe.runIf(process.env.TW_SECRET_KEY)("AccountAddress component", () => {
9
+ it("should format the address properly", () => {
10
+ render(
11
+ <AccountProvider
12
+ address="0x12345674b599ce99958242b3D3741e7b01841DF3"
13
+ client={TEST_CLIENT}
14
+ >
15
+ <AccountAddress formatFn={shortenAddress} />
16
+ </AccountProvider>,
17
+ );
18
+
19
+ waitFor(() =>
20
+ expect(
21
+ screen.getByText("0x1234...1DF3", {
22
+ exact: true,
23
+ selector: "span",
24
+ }),
25
+ ).toBeInTheDocument(),
26
+ );
27
+ });
28
+ });
@@ -0,0 +1,64 @@
1
+ "use client";
2
+
3
+ import { useAccountContext } from "./provider.js";
4
+
5
+ /**
6
+ * @component
7
+ * @account
8
+ */
9
+ export interface AccountAddressProps
10
+ extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
11
+ /**
12
+ * The function used to transform (format) the wallet address
13
+ * Specifically useful for shortening the wallet.
14
+ *
15
+ * This function should take in a string and output a string
16
+ */
17
+ formatFn?: (str: string) => string;
18
+ }
19
+
20
+ /**
21
+ *
22
+ * @returns a <span> containing the full wallet address of the account
23
+ *
24
+ * @example
25
+ * ### Basic usage
26
+ * ```tsx
27
+ * import { AccountProvider, AccountAddress } from "thirdweb/react";
28
+ *
29
+ * <AccountProvider address="0x12345674b599ce99958242b3D3741e7b01841DF3" client={TW_CLIENT}>
30
+ * <AccountAddress />
31
+ * </AccountProvider>
32
+ * ```
33
+ * Result:
34
+ * ```html
35
+ * <span>0x12345674b599ce99958242b3D3741e7b01841DF3</span>
36
+ * ```
37
+ *
38
+ *
39
+ * ### Shorten the address
40
+ * ```tsx
41
+ * import { AccountProvider, AccountAddress } from "thirdweb/react";
42
+ * import { shortenAddress } from "thirdweb/utils";
43
+ *
44
+ * <AccountProvider address="0x12345674b599ce99958242b3D3741e7b01841DF3" client={TW_CLIENT}>
45
+ * <AccountAddress formatFn={shortenAddress} />
46
+ * </AccountProvider>
47
+ * ```
48
+ * Result:
49
+ * ```html
50
+ * <span>0x1234...1DF3</span>
51
+ * ```
52
+ *
53
+ * @component
54
+ * @account
55
+ * @beta
56
+ */
57
+ export function AccountAddress({
58
+ formatFn,
59
+ ...restProps
60
+ }: AccountAddressProps) {
61
+ const { address } = useAccountContext();
62
+ const value = formatFn ? formatFn(address) : address;
63
+ return <span {...restProps}>{value}</span>;
64
+ }
@@ -0,0 +1,48 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { render, screen, waitFor } from "~test/react-render.js";
3
+ import { TEST_CLIENT } from "~test/test-clients.js";
4
+ import { TEST_ACCOUNT_A } from "~test/test-wallets.js";
5
+ import { AccountAvatar } from "./avatar.js";
6
+ import { AccountProvider } from "./provider.js";
7
+
8
+ describe.runIf(process.env.TW_SECRET_KEY)("AccountAvatar component", () => {
9
+ it("should render an image", () => {
10
+ render(
11
+ <AccountProvider
12
+ address={"0x12345674b599ce99958242b3D3741e7b01841DF3"}
13
+ client={TEST_CLIENT}
14
+ >
15
+ <AccountAvatar />
16
+ </AccountProvider>,
17
+ );
18
+
19
+ waitFor(() => expect(screen.getByRole("img")).toBeInTheDocument());
20
+ });
21
+
22
+ it("should fallback properly if failed to load", () => {
23
+ render(
24
+ <AccountProvider address={TEST_ACCOUNT_A.address} client={TEST_CLIENT}>
25
+ <AccountAvatar fallbackComponent={<span>oops</span>} />
26
+ </AccountProvider>,
27
+ );
28
+
29
+ waitFor(() =>
30
+ expect(
31
+ screen.getByText("oops", {
32
+ exact: true,
33
+ selector: "span",
34
+ }),
35
+ ).toBeInTheDocument(),
36
+ );
37
+ });
38
+
39
+ it("should NOT render anything if fail to resolve avatar", () => {
40
+ render(
41
+ <AccountProvider address={"invalid-wallet-address"} client={TEST_CLIENT}>
42
+ <AccountAvatar />
43
+ </AccountProvider>,
44
+ );
45
+
46
+ waitFor(() => expect(screen.getByRole("img")).not.toBeInTheDocument());
47
+ });
48
+ });