thirdweb 5.43.2 → 5.43.3-nightly-baefa5e9c7d72fd8645b0e33452a83fc0ef229d4-20240804000345

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 (132) 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/react/core/hooks/contract/useContractEvents.js +32 -2
  6. package/dist/cjs/react/core/hooks/contract/useContractEvents.js.map +1 -1
  7. package/dist/cjs/react/core/hooks/contract/useReadContract.js.map +1 -1
  8. package/dist/cjs/react/core/hooks/others/useWalletBalance.js +17 -2
  9. package/dist/cjs/react/core/hooks/others/useWalletBalance.js.map +1 -1
  10. package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js +1 -0
  11. package/dist/cjs/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
  12. package/dist/cjs/react/core/utils/wallet.js +19 -1
  13. package/dist/cjs/react/core/utils/wallet.js.map +1 -1
  14. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js +74 -4
  15. package/dist/cjs/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  16. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
  17. package/dist/cjs/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  18. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
  19. package/dist/cjs/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  20. package/dist/cjs/react/web/ui/PayEmbed.js +8 -9
  21. package/dist/cjs/react/web/ui/PayEmbed.js.map +1 -1
  22. package/dist/cjs/transaction/actions/send-transaction.js +76 -5
  23. package/dist/cjs/transaction/actions/send-transaction.js.map +1 -1
  24. package/dist/cjs/transaction/prepare-contract-call.js +18 -13
  25. package/dist/cjs/transaction/prepare-contract-call.js.map +1 -1
  26. package/dist/cjs/transaction/read-contract.js +39 -6
  27. package/dist/cjs/transaction/read-contract.js.map +1 -1
  28. package/dist/cjs/utils/fetch.js +12 -1
  29. package/dist/cjs/utils/fetch.js.map +1 -1
  30. package/dist/cjs/version.js +1 -1
  31. package/dist/cjs/version.js.map +1 -1
  32. package/dist/cjs/wallets/in-app/web/in-app.js +4 -1
  33. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -1
  34. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +1 -0
  35. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  36. package/dist/esm/extensions/marketplace/direct-listings/utils.js +1 -0
  37. package/dist/esm/extensions/marketplace/direct-listings/utils.js.map +1 -1
  38. package/dist/esm/extensions/marketplace/english-auctions/utils.js +1 -0
  39. package/dist/esm/extensions/marketplace/english-auctions/utils.js.map +1 -1
  40. package/dist/esm/react/core/hooks/contract/useContractEvents.js +32 -2
  41. package/dist/esm/react/core/hooks/contract/useContractEvents.js.map +1 -1
  42. package/dist/esm/react/core/hooks/contract/useReadContract.js.map +1 -1
  43. package/dist/esm/react/core/hooks/others/useWalletBalance.js +17 -2
  44. package/dist/esm/react/core/hooks/others/useWalletBalance.js.map +1 -1
  45. package/dist/esm/react/core/hooks/wallets/useActiveAccount.js +1 -0
  46. package/dist/esm/react/core/hooks/wallets/useActiveAccount.js.map +1 -1
  47. package/dist/esm/react/core/utils/wallet.js +19 -1
  48. package/dist/esm/react/core/utils/wallet.js.map +1 -1
  49. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js +74 -4
  50. package/dist/esm/react/web/hooks/transaction/useSendTransaction.js.map +1 -1
  51. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js +17 -2
  52. package/dist/esm/react/web/ui/ConnectWallet/ConnectButton.js.map +1 -1
  53. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js +15 -0
  54. package/dist/esm/react/web/ui/ConnectWallet/Modal/ConnectEmbed.js.map +1 -1
  55. package/dist/esm/react/web/ui/PayEmbed.js +8 -9
  56. package/dist/esm/react/web/ui/PayEmbed.js.map +1 -1
  57. package/dist/esm/transaction/actions/send-transaction.js +76 -5
  58. package/dist/esm/transaction/actions/send-transaction.js.map +1 -1
  59. package/dist/esm/transaction/prepare-contract-call.js +18 -13
  60. package/dist/esm/transaction/prepare-contract-call.js.map +1 -1
  61. package/dist/esm/transaction/read-contract.js +39 -6
  62. package/dist/esm/transaction/read-contract.js.map +1 -1
  63. package/dist/esm/utils/fetch.js +12 -1
  64. package/dist/esm/utils/fetch.js.map +1 -1
  65. package/dist/esm/version.js +1 -1
  66. package/dist/esm/version.js.map +1 -1
  67. package/dist/esm/wallets/in-app/web/in-app.js +4 -1
  68. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -1
  69. package/dist/esm/wallets/in-app/web/lib/auth/index.js +1 -0
  70. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  71. package/dist/types/extensions/marketplace/direct-listings/types.d.ts +1 -0
  72. package/dist/types/extensions/marketplace/direct-listings/types.d.ts.map +1 -1
  73. package/dist/types/extensions/marketplace/direct-listings/utils.d.ts.map +1 -1
  74. package/dist/types/extensions/marketplace/english-auctions/types.d.ts +1 -0
  75. package/dist/types/extensions/marketplace/english-auctions/types.d.ts.map +1 -1
  76. package/dist/types/extensions/marketplace/english-auctions/utils.d.ts.map +1 -1
  77. package/dist/types/react/core/hooks/contract/useContractEvents.d.ts +32 -2
  78. package/dist/types/react/core/hooks/contract/useContractEvents.d.ts.map +1 -1
  79. package/dist/types/react/core/hooks/contract/useReadContract.d.ts +28 -6
  80. package/dist/types/react/core/hooks/contract/useReadContract.d.ts.map +1 -1
  81. package/dist/types/react/core/hooks/others/useWalletBalance.d.ts +17 -2
  82. package/dist/types/react/core/hooks/others/useWalletBalance.d.ts.map +1 -1
  83. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts +1 -0
  84. package/dist/types/react/core/hooks/wallets/useActiveAccount.d.ts.map +1 -1
  85. package/dist/types/react/core/utils/wallet.d.ts +19 -1
  86. package/dist/types/react/core/utils/wallet.d.ts.map +1 -1
  87. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts +74 -4
  88. package/dist/types/react/web/hooks/transaction/useSendTransaction.d.ts.map +1 -1
  89. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts +17 -2
  90. package/dist/types/react/web/ui/ConnectWallet/ConnectButton.d.ts.map +1 -1
  91. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts +15 -0
  92. package/dist/types/react/web/ui/ConnectWallet/Modal/ConnectEmbed.d.ts.map +1 -1
  93. package/dist/types/react/web/ui/PayEmbed.d.ts +1 -0
  94. package/dist/types/react/web/ui/PayEmbed.d.ts.map +1 -1
  95. package/dist/types/transaction/actions/send-transaction.d.ts +76 -5
  96. package/dist/types/transaction/actions/send-transaction.d.ts.map +1 -1
  97. package/dist/types/transaction/prepare-contract-call.d.ts +18 -13
  98. package/dist/types/transaction/prepare-contract-call.d.ts.map +1 -1
  99. package/dist/types/transaction/read-contract.d.ts +39 -6
  100. package/dist/types/transaction/read-contract.d.ts.map +1 -1
  101. package/dist/types/utils/fetch.d.ts.map +1 -1
  102. package/dist/types/version.d.ts +1 -1
  103. package/dist/types/version.d.ts.map +1 -1
  104. package/dist/types/wallets/in-app/web/in-app.d.ts +4 -1
  105. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -1
  106. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +1 -0
  107. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  108. package/package.json +4 -3
  109. package/src/extensions/marketplace/direct-listings/types.ts +1 -0
  110. package/src/extensions/marketplace/direct-listings/utils.ts +1 -0
  111. package/src/extensions/marketplace/english-auctions/types.ts +1 -0
  112. package/src/extensions/marketplace/english-auctions/utils.ts +1 -0
  113. package/src/react/core/hooks/contract/useContractEvents.ts +32 -2
  114. package/src/react/core/hooks/contract/useReadContract.ts +28 -6
  115. package/src/react/core/hooks/others/useWalletBalance.ts +17 -2
  116. package/src/react/core/hooks/wallets/useActiveAccount.ts +1 -0
  117. package/src/react/core/utils/wallet.ts +19 -1
  118. package/src/react/web/hooks/transaction/useSendTransaction.tsx +74 -4
  119. package/src/react/web/ui/ConnectWallet/ConnectButton.tsx +17 -2
  120. package/src/react/web/ui/ConnectWallet/Modal/ConnectEmbed.tsx +15 -0
  121. package/src/react/web/ui/PayEmbed-disconnected.test.tsx +5 -3
  122. package/src/react/web/ui/PayEmbed.test.tsx +17 -16
  123. package/src/react/web/ui/PayEmbed.tsx +9 -4
  124. package/src/transaction/actions/send-transaction.ts +76 -5
  125. package/src/transaction/prepare-contract-call.ts +18 -13
  126. package/src/transaction/read-contract.ts +39 -6
  127. package/src/utils/encoding/hex.test.ts +11 -0
  128. package/src/utils/fetch.ts +12 -1
  129. package/src/version.ts +1 -1
  130. package/src/wallets/in-app/web/in-app.ts +4 -1
  131. package/src/wallets/in-app/web/lib/auth/index.ts +1 -0
  132. package/src/wallets/smart/smart-wallet-integration.test.ts +6 -0
@@ -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,KAAK,YAAY,EACjB,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,kBAAkB,EAAuB,MAAM,MAAM,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;A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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 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAehE;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,SAAS,UANpE,MAAM,SAAS,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,WAgB/C,MAAM,SACJ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,KACjE,OAAO,CAAC,QAAQ,CAAC,EAsDrB;AAaD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAyBlD;AAKD;;GAEG;AACH,wBAAgB,kBAAkB,uBA0BjC"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/utils/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAehE;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,SAAS,UANpE,MAAM,SAAS,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,WAgB/C,MAAM,SACJ,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,KACjE,OAAO,CAAC,QAAQ,CAAC,EAuDrB;AAaD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAyBlD;AAeD;;GAEG;AACH,wBAAgB,kBAAkB,uBA0BjC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "5.43.2";
1
+ export declare const version = "5.43.3-nightly-baefa5e9c7d72fd8645b0e33452a83fc0ef229d4-20240804000345";
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.2",
3
+ "version": "5.43.3-nightly-baefa5e9c7d72fd8645b0e33452a83fc0ef229d4-20240804000345",
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
  }
@@ -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
@@ -87,14 +87,29 @@ const TW_CONNECT_WALLET = "tw-connect-wallet";
87
87
  * ### Customizing the default chain to connect to
88
88
  *
89
89
  * ```tsx
90
- * import { base } from "thirdweb/chains";
90
+ * import { sepolia } from "thirdweb/chains";
91
91
  *
92
92
  * <ConnectButton
93
93
  * client={client}
94
- * chain={base}
94
+ * chain={sepolia}
95
95
  * />
96
96
  * ```
97
97
  *
98
+ * ### Enabling Account Abstraction
99
+ *
100
+ * By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts.
101
+ * And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored.
102
+ *
103
+ * ```tsx
104
+ * <ConnectButton
105
+ * client={client}
106
+ * accountAbstraction={{
107
+ * chain: sepolia,
108
+ * sponsorGas: true,
109
+ * }}
110
+ * />;
111
+ * ```
112
+ *
98
113
  * ### Enabling sign in with ethereum (Auth)
99
114
  *
100
115
  * ```tsx
@@ -96,6 +96,21 @@ import { useSetupScreen } from "./screen.js";
96
96
  * />
97
97
  * ```
98
98
  *
99
+ * ### Enabling Account Abstraction
100
+ *
101
+ * By passing the `accountAbstraction` prop, ALL connected wallets will be converted to smart accounts.
102
+ * And by setting `sponsorGas` to `true`, all transactions done with those smart accounts will be sponsored.
103
+ *
104
+ * ```tsx
105
+ * <ConnectEmbed
106
+ * client={client}
107
+ * accountAbstraction={{
108
+ * chain: sepolia,
109
+ * sponsorGas: true,
110
+ * }}
111
+ * />;
112
+ * ```
113
+ *
99
114
  * ### Enabling sign in with ethereum (Auth)
100
115
  *
101
116
  * ```tsx
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from "vitest";
2
- import { render } from "../../../../test/src/react-render.js";
2
+ import { render, waitFor } from "../../../../test/src/react-render.js";
3
3
  import { TEST_CLIENT } from "../../../../test/src/test-clients.js";
4
4
  import { PayEmbed } from "./PayEmbed.js";
5
5
 
@@ -8,8 +8,10 @@ describe.runIf(process.env.TW_SECRET_KEY)(
8
8
  () => {
9
9
  it("renders a connect wallet button when a wallet is not connected", async () => {
10
10
  const { findByText } = render(<PayEmbed client={TEST_CLIENT} />);
11
- const connectWalletButton = await findByText("Connect Wallet");
12
- expect(connectWalletButton).toBeInTheDocument();
11
+ waitFor(async () => {
12
+ const connectWalletButton = await findByText("Connect Wallet");
13
+ expect(connectWalletButton).toBeInTheDocument();
14
+ });
13
15
  });
14
16
  },
15
17
  );
@@ -1,6 +1,6 @@
1
1
  import { userEvent } from "@testing-library/user-event";
2
2
  import { describe, expect, it } from "vitest";
3
- import { render } from "../../../../test/src/react-render.js";
3
+ import { render, waitFor } from "../../../../test/src/react-render.js";
4
4
  import { TEST_CLIENT } from "../../../../test/src/test-clients.js";
5
5
  import { PayEmbed } from "./PayEmbed.js";
6
6
 
@@ -11,24 +11,25 @@ describe.runIf(!!process.env.TW_SECRET_KEY)(
11
11
  const { findByRole } = render(<PayEmbed client={TEST_CLIENT} />, {
12
12
  setConnectedWallet: true,
13
13
  });
14
- const connectWalletButton: HTMLElement = await findByRole("button", {
15
- name: "Continue",
16
- });
17
- // continue button is disabled when no amount is entered
18
- expect(connectWalletButton).toBeDisabled();
19
-
20
- // user enters an amount
21
- const tokenInput = await findByRole("textbox");
22
- await userEvent.type(tokenInput, "1");
14
+ waitFor(async () => {
15
+ const connectWalletButton: HTMLElement = await findByRole("button", {
16
+ name: "Continue",
17
+ });
18
+ // continue button is disabled when no amount is entered
19
+ expect(connectWalletButton).toBeDisabled();
20
+ // user enters an amount
21
+ const tokenInput = await findByRole("textbox");
22
+ await userEvent.type(tokenInput, "1");
23
23
 
24
- // continue button is enabled
25
- expect(connectWalletButton).not.toBeDisabled();
24
+ // continue button is enabled
25
+ expect(connectWalletButton).not.toBeDisabled();
26
26
 
27
- // user clears the amount
28
- await userEvent.clear(tokenInput);
27
+ // user clears the amount
28
+ await userEvent.clear(tokenInput);
29
29
 
30
- // continue button is disabled again
31
- expect(connectWalletButton).toBeDisabled();
30
+ // continue button is disabled again
31
+ expect(connectWalletButton).toBeDisabled();
32
+ });
32
33
  });
33
34
  },
34
35
  );
@@ -126,6 +126,8 @@ export type PayEmbedProps = {
126
126
  connectOptions?: PayEmbedConnectOptions;
127
127
 
128
128
  style?: React.CSSProperties;
129
+
130
+ className?: string;
129
131
  };
130
132
 
131
133
  /**
@@ -184,10 +186,9 @@ export function PayEmbed(props: PayEmbedProps) {
184
186
  </div>
185
187
  );
186
188
  } else {
187
- // show and hide screens with CSS to not lose state when switching between them
188
189
  content = (
189
190
  <>
190
- <div style={{ display: screen === "buy" ? "inherit" : "none" }}>
191
+ {screen === "buy" && (
191
192
  <BuyScreen
192
193
  title={metadata?.name || "Buy"}
193
194
  isEmbed={true}
@@ -208,7 +209,7 @@ export function PayEmbed(props: PayEmbedProps) {
208
209
  connectOptions={props.connectOptions}
209
210
  onBack={undefined}
210
211
  />
211
- </div>
212
+ )}
212
213
 
213
214
  {screen === "execute-tx" &&
214
215
  props.payOptions?.mode === "transaction" &&
@@ -230,7 +231,11 @@ export function PayEmbed(props: PayEmbedProps) {
230
231
 
231
232
  return (
232
233
  <CustomThemeProvider theme={theme}>
233
- <EmbedContainer modalSize="compact">
234
+ <EmbedContainer
235
+ modalSize="compact"
236
+ style={props.style}
237
+ className={props.className}
238
+ >
234
239
  <DynamicHeight>{content}</DynamicHeight>
235
240
  </EmbedContainer>
236
241
  </CustomThemeProvider>