thirdweb 5.29.3-nightly-ffaff744f72d2cb22896e7501677b48f76ea857a-20240614184424 → 5.29.3-nightly-f8e0c5f84bb3a07a2911b5fce51da3983bb2e9e9-20240614190203

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 (150) hide show
  1. package/dist/cjs/exports/{react-native.js → react.native.js} +1 -1
  2. package/dist/cjs/exports/{react-native.js.map → react.native.js.map} +1 -1
  3. package/dist/cjs/exports/wallets/embedded.js +4 -4
  4. package/dist/cjs/exports/wallets/embedded.js.map +1 -1
  5. package/dist/cjs/exports/wallets/in-app.js +4 -3
  6. package/dist/cjs/exports/wallets/in-app.js.map +1 -1
  7. package/dist/cjs/exports/wallets/in-app.native.js +17 -0
  8. package/dist/cjs/exports/wallets/in-app.native.js.map +1 -0
  9. package/dist/cjs/exports/wallets.js +10 -7
  10. package/dist/cjs/exports/wallets.js.map +1 -1
  11. package/dist/cjs/exports/{react-native/wallets.js → wallets.native.js} +13 -11
  12. package/dist/cjs/exports/wallets.native.js.map +1 -0
  13. package/dist/cjs/react/web/ui/ConnectWallet/Details.js +1 -1
  14. package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
  15. package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
  16. package/dist/cjs/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
  17. package/dist/cjs/version.js +1 -1
  18. package/dist/cjs/wallets/create-wallet.js +3 -128
  19. package/dist/cjs/wallets/create-wallet.js.map +1 -1
  20. package/dist/cjs/wallets/in-app/core/authentication/type.js +6 -1
  21. package/dist/cjs/wallets/in-app/core/authentication/type.js.map +1 -1
  22. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +100 -0
  23. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
  24. package/dist/cjs/wallets/in-app/core/wallet/index.js +14 -6
  25. package/dist/cjs/wallets/in-app/core/wallet/index.js.map +1 -1
  26. package/dist/cjs/wallets/in-app/{core/authentication → native/auth}/index.js +15 -42
  27. package/dist/cjs/wallets/in-app/native/auth/index.js.map +1 -0
  28. package/dist/cjs/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
  29. package/dist/cjs/wallets/in-app/native/auth/native-auth.js.map +1 -0
  30. package/dist/cjs/wallets/in-app/native/in-app.js +69 -0
  31. package/dist/cjs/wallets/in-app/native/in-app.js.map +1 -0
  32. package/dist/cjs/wallets/in-app/native/native-connector.js +9 -10
  33. package/dist/cjs/wallets/in-app/native/native-connector.js.map +1 -1
  34. package/dist/cjs/wallets/in-app/web/in-app.js +69 -0
  35. package/dist/cjs/wallets/in-app/web/in-app.js.map +1 -0
  36. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js +219 -0
  37. package/dist/cjs/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
  38. package/dist/cjs/wallets/in-app/web/lib/auth/index.js +121 -208
  39. package/dist/cjs/wallets/in-app/web/lib/auth/index.js.map +1 -1
  40. package/dist/cjs/wallets/in-app/web/lib/web-connector.js +3 -4
  41. package/dist/cjs/wallets/in-app/web/lib/web-connector.js.map +1 -1
  42. package/dist/esm/exports/{react-native.js → react.native.js} +1 -1
  43. package/dist/esm/exports/{react-native.js.map → react.native.js.map} +1 -1
  44. package/dist/esm/exports/wallets/embedded.js +3 -2
  45. package/dist/esm/exports/wallets/embedded.js.map +1 -1
  46. package/dist/esm/exports/wallets/in-app.js +4 -2
  47. package/dist/esm/exports/wallets/in-app.js.map +1 -1
  48. package/dist/esm/exports/wallets/in-app.native.js +9 -0
  49. package/dist/esm/exports/wallets/in-app.native.js.map +1 -0
  50. package/dist/esm/exports/wallets.js +7 -4
  51. package/dist/esm/exports/wallets.js.map +1 -1
  52. package/dist/esm/exports/wallets.native.js +23 -0
  53. package/dist/esm/exports/wallets.native.js.map +1 -0
  54. package/dist/esm/react/web/ui/ConnectWallet/Details.js +1 -1
  55. package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
  56. package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js +1 -1
  57. package/dist/esm/react/web/wallets/in-app/InAppWalletOTPLoginUI.js.map +1 -1
  58. package/dist/esm/version.js +1 -1
  59. package/dist/esm/wallets/create-wallet.js +1 -125
  60. package/dist/esm/wallets/create-wallet.js.map +1 -1
  61. package/dist/esm/wallets/in-app/core/authentication/type.js +5 -0
  62. package/dist/esm/wallets/in-app/core/authentication/type.js.map +1 -1
  63. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +95 -0
  64. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -0
  65. package/dist/esm/wallets/in-app/core/wallet/index.js +14 -6
  66. package/dist/esm/wallets/in-app/core/wallet/index.js.map +1 -1
  67. package/dist/esm/wallets/in-app/{core/authentication → native/auth}/index.js +14 -40
  68. package/dist/esm/wallets/in-app/native/auth/index.js.map +1 -0
  69. package/dist/esm/wallets/in-app/native/{auth.js → auth/native-auth.js} +9 -9
  70. package/dist/esm/wallets/in-app/native/auth/native-auth.js.map +1 -0
  71. package/dist/esm/wallets/in-app/native/in-app.js +65 -0
  72. package/dist/esm/wallets/in-app/native/in-app.js.map +1 -0
  73. package/dist/esm/wallets/in-app/native/native-connector.js +2 -3
  74. package/dist/esm/wallets/in-app/native/native-connector.js.map +1 -1
  75. package/dist/esm/wallets/in-app/web/in-app.js +65 -0
  76. package/dist/esm/wallets/in-app/web/in-app.js.map +1 -0
  77. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js +215 -0
  78. package/dist/esm/wallets/in-app/web/lib/auth/iframe-auth.js.map +1 -0
  79. package/dist/esm/wallets/in-app/web/lib/auth/index.js +115 -206
  80. package/dist/esm/wallets/in-app/web/lib/auth/index.js.map +1 -1
  81. package/dist/esm/wallets/in-app/web/lib/web-connector.js +2 -3
  82. package/dist/esm/wallets/in-app/web/lib/web-connector.js.map +1 -1
  83. package/dist/types/exports/{react-native.d.ts → react.native.d.ts} +1 -1
  84. package/dist/types/exports/{react-native.d.ts.map → react.native.d.ts.map} +1 -1
  85. package/dist/types/exports/wallets/embedded.d.ts +3 -2
  86. package/dist/types/exports/wallets/embedded.d.ts.map +1 -1
  87. package/dist/types/exports/wallets/in-app.d.ts +3 -2
  88. package/dist/types/exports/wallets/in-app.d.ts.map +1 -1
  89. package/dist/types/exports/wallets/in-app.native.d.ts +5 -0
  90. package/dist/types/exports/wallets/in-app.native.d.ts.map +1 -0
  91. package/dist/types/exports/wallets.d.ts +4 -3
  92. package/dist/types/exports/wallets.d.ts.map +1 -1
  93. package/dist/types/exports/{react-native/wallets.d.ts → wallets.native.d.ts} +20 -19
  94. package/dist/types/exports/wallets.native.d.ts.map +1 -0
  95. package/dist/types/version.d.ts +1 -1
  96. package/dist/types/wallets/create-wallet.d.ts +0 -53
  97. package/dist/types/wallets/create-wallet.d.ts.map +1 -1
  98. package/dist/types/wallets/in-app/core/authentication/type.d.ts +4 -0
  99. package/dist/types/wallets/in-app/core/authentication/type.d.ts.map +1 -1
  100. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts +16 -0
  101. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -0
  102. package/dist/types/wallets/in-app/core/wallet/index.d.ts +3 -2
  103. package/dist/types/wallets/in-app/core/wallet/index.d.ts.map +1 -1
  104. package/dist/types/wallets/in-app/{core/authentication → native/auth}/index.d.ts +3 -12
  105. package/dist/types/wallets/in-app/native/auth/index.d.ts.map +1 -0
  106. package/dist/types/wallets/in-app/native/{auth.d.ts → auth/native-auth.d.ts} +3 -3
  107. package/dist/types/wallets/in-app/native/auth/native-auth.d.ts.map +1 -0
  108. package/dist/types/wallets/in-app/native/in-app.d.ts +56 -0
  109. package/dist/types/wallets/in-app/native/in-app.d.ts.map +1 -0
  110. package/dist/types/wallets/in-app/native/native-connector.d.ts.map +1 -1
  111. package/dist/types/wallets/in-app/web/in-app.d.ts +56 -0
  112. package/dist/types/wallets/in-app/web/in-app.d.ts.map +1 -0
  113. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts +141 -0
  114. package/dist/types/wallets/in-app/web/lib/auth/iframe-auth.d.ts.map +1 -0
  115. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts +78 -137
  116. package/dist/types/wallets/in-app/web/lib/auth/index.d.ts.map +1 -1
  117. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts +1 -1
  118. package/dist/types/wallets/in-app/web/lib/web-connector.d.ts.map +1 -1
  119. package/package.json +9 -3
  120. package/src/exports/wallets/embedded.ts +4 -3
  121. package/src/exports/wallets/in-app.native.ts +18 -0
  122. package/src/exports/wallets/in-app.ts +6 -3
  123. package/src/exports/{react-native/wallets.ts → wallets.native.ts} +21 -19
  124. package/src/exports/wallets.ts +11 -5
  125. package/src/react/web/ui/ConnectWallet/Details.tsx +1 -1
  126. package/src/react/web/wallets/in-app/InAppWalletOTPLoginUI.tsx +1 -1
  127. package/src/version.ts +1 -1
  128. package/src/wallets/create-wallet.ts +1 -146
  129. package/src/wallets/in-app/core/authentication/type.ts +13 -0
  130. package/src/wallets/in-app/core/wallet/in-app-core.ts +134 -0
  131. package/src/wallets/in-app/core/wallet/index.ts +16 -5
  132. package/src/wallets/in-app/{core/authentication → native/auth}/index.ts +15 -57
  133. package/src/wallets/in-app/native/{auth.ts → auth/native-auth.ts} +10 -10
  134. package/src/wallets/in-app/native/in-app.ts +70 -0
  135. package/src/wallets/in-app/native/native-connector.ts +2 -2
  136. package/src/wallets/in-app/web/in-app.ts +70 -0
  137. package/src/wallets/in-app/web/lib/auth/iframe-auth.ts +266 -0
  138. package/src/wallets/in-app/web/lib/auth/index.ts +124 -249
  139. package/src/wallets/in-app/web/lib/web-connector.ts +2 -2
  140. package/dist/cjs/exports/react-native/wallets.js.map +0 -1
  141. package/dist/cjs/wallets/in-app/core/authentication/index.js.map +0 -1
  142. package/dist/cjs/wallets/in-app/native/auth.js.map +0 -1
  143. package/dist/esm/exports/react-native/wallets.js +0 -23
  144. package/dist/esm/exports/react-native/wallets.js.map +0 -1
  145. package/dist/esm/wallets/in-app/core/authentication/index.js.map +0 -1
  146. package/dist/esm/wallets/in-app/native/auth.js.map +0 -1
  147. package/dist/types/exports/react-native/wallets.d.ts.map +0 -1
  148. package/dist/types/wallets/in-app/core/authentication/index.d.ts.map +0 -1
  149. package/dist/types/wallets/in-app/native/auth.d.ts.map +0 -1
  150. /package/src/exports/{react-native.ts → react.native.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/authentication/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GACjC;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACN,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG;IACxD,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC9D,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B;IACE,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAA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OAAO,GACf;IACE,MAAM,EAAE,gBAAgB,CAAC,UAAU,CAAC;CACrC,GACD;IACE,MAAM,EAAE,gBAAgB,CAAC,8BAA8B,CAAC;IACxD,WAAW,EAAE,WAAW,CAAC;CAC1B,GACD;IACE,MAAM,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,GACD,eAAe,CAAC"}
1
+ {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/authentication/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,MAAM,yBAAyB,GACjC;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACN,MAAM,MAAM,eAAe,GAAG,yBAAyB,GAAG;IACxD,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC9D,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B;IACE,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACD;IACE,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,MAA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AAC,UAAU,CAAC;CACrC,GACD;IACE,MAAM,EAAE,gBAAgB,CAAC,8BAA8B,CAAC;IACxD,WAAW,EAAE,WAAW,CAAC;CAC1B,GACD;IACE,MAAM,EAAE,gBAAgB,CAAC,oBAAoB,CAAC;IAC9C,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,GACD,eAAe,CAAC;AAEpB,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,QAAQ,GAAG,UAAU,GAAG,OAAO,EAC/B,YAAY,CAKb,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import type { Wallet } from "../../../interfaces/wallet.js";
3
+ import type { CreateWalletArgs } from "../../../wallet-types.js";
4
+ import type { InAppConnector } from "../interfaces/connector.js";
5
+ /**
6
+ * @internal
7
+ */
8
+ export declare function getOrCreateInAppWalletConnector(client: ThirdwebClient, connectorFactory: (client: ThirdwebClient) => Promise<InAppConnector>): Promise<InAppConnector>;
9
+ /**
10
+ * @internal
11
+ */
12
+ export declare function createInAppWallet(args: {
13
+ createOptions?: CreateWalletArgs<"inApp">[1];
14
+ connectorFactory: (client: ThirdwebClient) => Promise<InAppConnector>;
15
+ }): Wallet<"inApp">;
16
+ //# sourceMappingURL=in-app-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-app-core.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/in-app-core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAW,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIjE;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,cAAc,EACtB,gBAAgB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,2BAQtE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACvE,GAAG,MAAM,CAAC,OAAO,CAAC,CAsGlB"}
@@ -2,6 +2,7 @@ import type { Chain } from "../../../../chains/types.js";
2
2
  import type { Account, Wallet } from "../../../interfaces/wallet.js";
3
3
  import type { WalletId } from "../../../wallet-types.js";
4
4
  import type { CreateWalletArgs, WalletAutoConnectionOption, WalletConnectionOption } from "../../../wallet-types.js";
5
+ import type { InAppConnector } from "../interfaces/connector.js";
5
6
  /**
6
7
  * Checks if the provided wallet is an in-app wallet.
7
8
  *
@@ -12,9 +13,9 @@ export declare function isInAppWallet(wallet: Wallet<WalletId>): wallet is Walle
12
13
  /**
13
14
  * @internal
14
15
  */
15
- export declare function connectInAppWallet(options: WalletConnectionOption<"inApp">, createOptions: CreateWalletArgs<"inApp">[1]): Promise<[Account, Chain]>;
16
+ export declare function connectInAppWallet(options: WalletConnectionOption<"inApp">, createOptions: CreateWalletArgs<"inApp">[1], connector: InAppConnector): Promise<[Account, Chain]>;
16
17
  /**
17
18
  * @internal
18
19
  */
19
- export declare function autoConnectInAppWallet(options: WalletAutoConnectionOption<"inApp">, createOptions: CreateWalletArgs<"inApp">[1]): Promise<[Account, Chain]>;
20
+ export declare function autoConnectInAppWallet(options: WalletAutoConnectionOption<"inApp">, createOptions: CreateWalletArgs<"inApp">[1], connector: InAppConnector): Promise<[Account, Chain]>;
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GACvB,MAAM,IAAI,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC,CAExC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,EACxC,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC1C,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAmB3B;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAC5C,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC1C,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAsB3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/wallet/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,GACvB,MAAM,IAAI,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC,CAExC;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,sBAAsB,CAAC,OAAO,CAAC,EACxC,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3C,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAiB3B;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,0BAA0B,CAAC,OAAO,CAAC,EAC5C,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3C,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAqB3B"}
@@ -1,12 +1,4 @@
1
- import type { ThirdwebClient } from "../../../../client/client.js";
2
- import { type AuthArgsType, type AuthLoginReturnType, AuthProvider, type PreAuthArgsType } from "./type.js";
3
- export type GetAuthenticatedUserParams = {
4
- client: ThirdwebClient;
5
- };
6
- /**
7
- * @internal
8
- */
9
- export declare function logoutAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("./type.js").LogoutReturnType>;
1
+ import { type AuthArgsType, type AuthLoginReturnType, type GetAuthenticatedUserParams, type PreAuthArgsType } from "../../core/authentication/type.js";
10
2
  /**
11
3
  * Retrieves the authenticated user for the active in-app wallet.
12
4
  * @param options - The arguments for retrieving the authenticated user.
@@ -22,7 +14,7 @@ export declare function logoutAuthenticatedUser(options: GetAuthenticatedUserPar
22
14
  * ```
23
15
  * @wallet
24
16
  */
25
- export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("./type.js").InitializedUser | undefined>;
17
+ export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("../../core/authentication/type.js").InitializedUser | undefined>;
26
18
  /**
27
19
  * Retrieves the authenticated user email for the active in-app wallet.
28
20
  * @param options - The arguments for retrieving the authenticated user.
@@ -68,7 +60,7 @@ export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams):
68
60
  * ```
69
61
  * @wallet
70
62
  */
71
- export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("./type.js").SendEmailOtpReturnType>;
63
+ export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("../../core/authentication/type.js").SendEmailOtpReturnType>;
72
64
  /**
73
65
  * Authenticates the user based on the provided authentication arguments.
74
66
  * @param args - The authentication arguments.
@@ -87,5 +79,4 @@ export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("
87
79
  * @wallet
88
80
  */
89
81
  export declare function authenticate(args: AuthArgsType): Promise<AuthLoginReturnType>;
90
- export declare const oauthStrategyToAuthProvider: Record<"google" | "facebook" | "apple", AuthProvider>;
91
82
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/native/auth/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAErB,MAAM,mCAAmC,CAAC;AAkB3C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,0BAA0B,oFAWpC;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,+EAG1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
@@ -1,5 +1,5 @@
1
- import type { ThirdwebClient } from "../../../client/client.js";
2
- import { type AuthStoredTokenWithCookieReturnType, type OauthOption, type SendEmailOtpReturnType } from "../core/authentication/type.js";
1
+ import type { ThirdwebClient } from "../../../../client/client.js";
2
+ import { type AuthStoredTokenWithCookieReturnType, type OauthOption, type SendEmailOtpReturnType } from "../../core/authentication/type.js";
3
3
  export declare function sendVerificationEmail(options: {
4
4
  email: string;
5
5
  client: ThirdwebClient;
@@ -26,4 +26,4 @@ export declare function authEndpoint(authOptions: {
26
26
  export declare function deleteActiveAccount(options: {
27
27
  client: ThirdwebClient;
28
28
  }): Promise<boolean>;
29
- //# sourceMappingURL=auth.d.ts.map
29
+ //# sourceMappingURL=native-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-auth.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/native/auth/native-auth.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAEL,KAAK,mCAAmC,EACxC,KAAK,WAAW,EAEhB,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;AA8B3C,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2ClC;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA2ClC;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,mCAAmC,CAAC,CA+D/C;AAED,wBAAsB,WAAW,CAC/B,YAAY,EAAE,WAAW,EACzB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CAkF9C;AAED,wBAAsB,SAAS,CAC7B,WAAW,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EAC9C,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CA0C9C;AAED,wBAAsB,YAAY,CAChC,WAAW,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,EACvD,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,mCAAmC,CAAC,CA+C9C;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,OAAO,CAAC,CAQnB"}
@@ -0,0 +1,56 @@
1
+ import type { Wallet } from "../../interfaces/wallet.js";
2
+ import type { CreateWalletArgs } from "../../wallet-types.js";
3
+ /**
4
+ * Creates an in-app wallet.
5
+ * @param createOptions - configuration options
6
+ * @returns The created in-app wallet.
7
+ * @example
8
+ * ```ts
9
+ * import { inAppWallet } from "thirdweb/wallets";
10
+ *
11
+ * const wallet = inAppWallet();
12
+ *
13
+ * const account = await wallet.connect({
14
+ * client,
15
+ * chain,
16
+ * strategy: "google",
17
+ * });
18
+ * ```
19
+ *
20
+ * Enable smart accounts and sponsor gas for your users:
21
+ * ```ts
22
+ * import { inAppWallet } from "thirdweb/wallets";
23
+ * const wallet = inAppWallet({
24
+ * smartAccount: {
25
+ * chain: sepolia,
26
+ * sponsorGas: true,
27
+ * },
28
+ * });
29
+ * ```
30
+ *
31
+ * Specify a logo for your login page
32
+ * ```ts
33
+ * import { inAppWallet } from "thirdweb/wallets";
34
+ * const wallet = inAppWallet({
35
+ * metadata: {
36
+ * image: {
37
+ * src: "https://example.com/logo.png",
38
+ * alt: "My logo",
39
+ * width: 100,
40
+ * height: 100,
41
+ * },
42
+ * },
43
+ * });
44
+ * ```
45
+ *
46
+ * Hide the ability to export the private key within the Connect Modal
47
+ * ```ts
48
+ * import { inAppWallet } from "thirdweb/wallets";
49
+ * const wallet = inAppWallet({
50
+ * hidePrivateKeyExport: true
51
+ * });
52
+ * ```
53
+ * @wallet
54
+ */
55
+ export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
56
+ //# sourceMappingURL=in-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-app.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/in-app.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"native-connector.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/native-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAE5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAetE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,sBAAsB;IAIrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IA6BjC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmBnE,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAyDxD,gBAAgB;IA+BxB,mBAAmB;YAIX,WAAW;YAgCX,SAAS;YAqBT,YAAY;IAwB1B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGpC"}
1
+ {"version":3,"file":"native-connector.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/in-app/native/native-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAErB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAG5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAetE,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,qBAAa,oBAAqB,YAAW,cAAc;IACzD,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,sBAAsB;IAIrC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IA6BjC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmBnE,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAyDxD,gBAAgB;IA+BxB,mBAAmB;YAIX,WAAW;YAgCX,SAAS;YAqBT,YAAY;IAwB1B,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAGpC"}
@@ -0,0 +1,56 @@
1
+ import type { Wallet } from "../../interfaces/wallet.js";
2
+ import type { CreateWalletArgs } from "../../wallet-types.js";
3
+ /**
4
+ * Creates an in-app wallet.
5
+ * @param createOptions - configuration options
6
+ * @returns The created in-app wallet.
7
+ * @example
8
+ * ```ts
9
+ * import { inAppWallet } from "thirdweb/wallets";
10
+ *
11
+ * const wallet = inAppWallet();
12
+ *
13
+ * const account = await wallet.connect({
14
+ * client,
15
+ * chain,
16
+ * strategy: "google",
17
+ * });
18
+ * ```
19
+ *
20
+ * Enable smart accounts and sponsor gas for your users:
21
+ * ```ts
22
+ * import { inAppWallet } from "thirdweb/wallets";
23
+ * const wallet = inAppWallet({
24
+ * smartAccount: {
25
+ * chain: sepolia,
26
+ * sponsorGas: true,
27
+ * },
28
+ * });
29
+ * ```
30
+ *
31
+ * Specify a logo for your login page
32
+ * ```ts
33
+ * import { inAppWallet } from "thirdweb/wallets";
34
+ * const wallet = inAppWallet({
35
+ * metadata: {
36
+ * image: {
37
+ * src: "https://example.com/logo.png",
38
+ * alt: "My logo",
39
+ * width: 100,
40
+ * height: 100,
41
+ * },
42
+ * },
43
+ * });
44
+ * ```
45
+ *
46
+ * Hide the ability to export the private key within the Connect Modal
47
+ * ```ts
48
+ * import { inAppWallet } from "thirdweb/wallets";
49
+ * const wallet = inAppWallet({
50
+ * hidePrivateKeyExport: true
51
+ * });
52
+ * ```
53
+ * @wallet
54
+ */
55
+ export declare function inAppWallet(createOptions?: CreateWalletArgs<"inApp">[1]): Wallet<"inApp">;
56
+ //# sourceMappingURL=in-app.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,WAAW,CACzB,aAAa,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAC3C,MAAM,CAAC,OAAO,CAAC,CAUjB"}
@@ -0,0 +1,141 @@
1
+ import type { ThirdwebClient } from "../../../../../client/client.js";
2
+ import type { AuthAndWalletRpcReturnType, AuthLoginReturnType, AuthStoredTokenWithCookieReturnType, LogoutReturnType, SendEmailOtpReturnType } from "../../../core/authentication/type.js";
3
+ import type { ClientIdWithQuerierType } from "../../types.js";
4
+ import { LocalStorage } from "../../utils/Storage/LocalStorage.js";
5
+ import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
6
+ import { BaseLogin } from "./base-login.js";
7
+ export type AuthQuerierTypes = {
8
+ logout: undefined;
9
+ initIframe: {
10
+ clientId: string;
11
+ authCookie: string;
12
+ walletUserId: string;
13
+ deviceShareStored: string;
14
+ };
15
+ loginWithStoredTokenDetails: {
16
+ storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
17
+ recoveryCode?: string;
18
+ };
19
+ };
20
+ /**
21
+ *
22
+ */
23
+ export declare class Auth {
24
+ protected client: ThirdwebClient;
25
+ protected AuthQuerier: InAppWalletIframeCommunicator<AuthQuerierTypes>;
26
+ protected localStorage: LocalStorage;
27
+ protected onAuthSuccess: (authResults: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
28
+ private BaseLogin;
29
+ /**
30
+ * Used to manage the user's auth states. This should not be instantiated directly.
31
+ * Call {@link InAppWalletSdk.auth} instead.
32
+ * @internal
33
+ */
34
+ constructor({ client, querier, onAuthSuccess, baseUrl, }: ClientIdWithQuerierType & {
35
+ baseUrl: string;
36
+ onAuthSuccess: (authDetails: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
37
+ });
38
+ private preLogin;
39
+ private postLogin;
40
+ loginWithAuthToken(authToken: AuthStoredTokenWithCookieReturnType, recoveryCode?: string): Promise<AuthLoginReturnType>;
41
+ /**
42
+ * Used to log the user into their thirdweb wallet on your platform via a myriad of auth providers
43
+ * @example
44
+ * ```typescript
45
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "YOUR_CLIENT_ID", chain: "Polygon"})
46
+ * try {
47
+ * const user = await thirdwebInAppWallet.auth.loginWithModal();
48
+ * // user is now logged in
49
+ * } catch (e) {
50
+ * // User closed modal or something else went wrong during the authentication process
51
+ * console.error(e)
52
+ * }
53
+ * ```
54
+ * @returns `{{user: InitializedUser}}` An InitializedUser object.
55
+ */
56
+ loginWithModal(): Promise<AuthLoginReturnType>;
57
+ /**
58
+ * Used to log the user into their thirdweb wallet using email OTP
59
+ * @example
60
+ * ```typescript
61
+ * // Basic Flow
62
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
63
+ * try {
64
+ * // prompts user to enter the code they received
65
+ * const user = await thirdwebInAppWallet.auth.loginWithThirdwebEmailOtp({ email : "you@example.com" });
66
+ * // user is now logged in
67
+ * } catch (e) {
68
+ * // User closed the OTP modal or something else went wrong during the authentication process
69
+ * console.error(e)
70
+ * }
71
+ * ```
72
+ * @param args - args.email: We will send the email an OTP that needs to be entered in order for them to be logged in.
73
+ * @returns `{{user: InitializedUser}}` An InitializedUser object. See {@link InAppWalletSdk.getUser} for more
74
+ */
75
+ loginWithEmailOtp(args: Parameters<BaseLogin["loginWithEmailOtp"]>[0]): Promise<AuthLoginReturnType>;
76
+ /**
77
+ * @internal
78
+ */
79
+ loginWithCustomJwt(args: Parameters<BaseLogin["loginWithCustomJwt"]>[0]): Promise<AuthLoginReturnType>;
80
+ /**
81
+ * @internal
82
+ */
83
+ loginWithCustomAuthEndpoint(args: Parameters<BaseLogin["loginWithCustomAuthEndpoint"]>[0]): Promise<AuthLoginReturnType>;
84
+ /**
85
+ * @internal
86
+ */
87
+ loginWithOauth(args: Parameters<BaseLogin["loginWithOauth"]>[0]): Promise<AuthLoginReturnType>;
88
+ /**
89
+ * A headless way to send the users at the passed email an OTP code.
90
+ * You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
91
+ * @example
92
+ * @param param0.email
93
+ * ```typescript
94
+ * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
95
+ * // sends user an OTP code
96
+ * try {
97
+ * await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
98
+ * } catch(e) {
99
+ * // Error Sending user's email an OTP code
100
+ * console.error(e);
101
+ * }
102
+ *
103
+ * // Then when your user is ready to verify their OTP
104
+ * try {
105
+ * const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
106
+ * } catch(e) {
107
+ * // Error verifying the OTP code
108
+ * console.error(e)
109
+ * }
110
+ * ```
111
+ * @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
112
+ * @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
113
+ * @internal
114
+ */
115
+ sendEmailLoginOtp({ email, }: Parameters<BaseLogin["sendEmailLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
116
+ /**
117
+ * @internal
118
+ */
119
+ sendSmsLoginOtp({ phoneNumber, }: Parameters<BaseLogin["sendSmsLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
120
+ /**
121
+ * Used to verify the otp that the user receives from thirdweb
122
+ *
123
+ * See {@link Auth.sendEmailLoginOtp} for how the headless call flow looks like. Simply swap out the calls to `loginWithThirdwebEmailOtp` with `verifyThirdwebEmailLoginOtp`
124
+ * @param args - props.email We will send the email an OTP that needs to be entered in order for them to be logged in.
125
+ * props.otp The code that the user received in their email
126
+ * @returns `{{user: InitializedUser}}` An InitializedUser object containing the user's status, wallet, authDetails, and more
127
+ * @internal
128
+ */
129
+ verifyEmailLoginOtp(args: Parameters<BaseLogin["verifyEmailLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
130
+ /**
131
+ * @internal
132
+ */
133
+ verifySmsLoginOtp(args: Parameters<BaseLogin["verifySmsLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
134
+ /**
135
+ * Logs any existing user out of their wallet.
136
+ * @returns `{{success: boolean}}` true if a user is successfully logged out. false if there's no user currently logged in.
137
+ * @internal
138
+ */
139
+ logout(): Promise<LogoutReturnType>;
140
+ }
141
+ //# sourceMappingURL=iframe-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe-auth.d.ts","sourceRoot":"","sources":["../../../../../../../src/wallets/in-app/web/lib/auth/iframe-auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,mCAAmC,EACnC,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AACtH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CA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I/B;;OAEG;IACG,2BAA2B,CAC/B,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;OAEG;IACG,cAAc,CAClB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,GAC/C,OAAO,CAAC,mBAAmB,CAAC;IAI/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,iBAAiB,CAAC,EACtB,KAAK,GACN,EAAE,UAAU,CACX,SAAS,CAAC,mBAAmB,CAAC,CAC/B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMtC;;OAEG;IACG,eAAe,CAAC,EACpB,WAAW,GACZ,EAAE,UAAU,CACX,SAAS,CAAC,iBAAiB,CAAC,CAC7B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAMtC;;;;;;;;OAQG;IACG,mBAAmB,CACvB,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IAKvD;;OAEG;IACG,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAI3E;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAY1C"}
@@ -1,141 +1,82 @@
1
- import type { ThirdwebClient } from "../../../../../client/client.js";
2
- import type { AuthAndWalletRpcReturnType, AuthLoginReturnType, AuthStoredTokenWithCookieReturnType, LogoutReturnType, SendEmailOtpReturnType } from "../../../core/authentication/type.js";
3
- import type { ClientIdWithQuerierType } from "../../types.js";
4
- import { LocalStorage } from "../../utils/Storage/LocalStorage.js";
5
- import type { InAppWalletIframeCommunicator } from "../../utils/iFrameCommunication/InAppWalletIframeCommunicator.js";
6
- import { BaseLogin } from "./base-login.js";
7
- export type AuthQuerierTypes = {
8
- logout: undefined;
9
- initIframe: {
10
- clientId: string;
11
- authCookie: string;
12
- walletUserId: string;
13
- deviceShareStored: string;
14
- };
15
- loginWithStoredTokenDetails: {
16
- storedToken: AuthStoredTokenWithCookieReturnType["storedToken"];
17
- recoveryCode?: string;
18
- };
19
- };
1
+ import { type AuthArgsType, type AuthLoginReturnType, type GetAuthenticatedUserParams, type PreAuthArgsType } from "../../../core/authentication/type.js";
20
2
  /**
3
+ * Retrieves the authenticated user for the active in-app wallet.
4
+ * @param options - The arguments for retrieving the authenticated user.
5
+ * @returns The authenticated user if logged in and wallet initialized, otherwise undefined.
6
+ * @example
7
+ * ```ts
8
+ * import { getAuthenticatedUser } from "thirdweb/wallets/in-app";
21
9
  *
10
+ * const user = await getAuthenticatedUser({ client });
11
+ * if (user) {
12
+ * console.log(user.walletAddress);
13
+ * }
14
+ * ```
15
+ * @wallet
22
16
  */
23
- export declare class Auth {
24
- protected client: ThirdwebClient;
25
- protected AuthQuerier: InAppWalletIframeCommunicator<AuthQuerierTypes>;
26
- protected localStorage: LocalStorage;
27
- protected onAuthSuccess: (authResults: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
28
- private BaseLogin;
29
- /**
30
- * Used to manage the user's auth states. This should not be instantiated directly.
31
- * Call {@link InAppWalletSdk.auth} instead.
32
- * @internal
33
- */
34
- constructor({ client, querier, onAuthSuccess, baseUrl, }: ClientIdWithQuerierType & {
35
- baseUrl: string;
36
- onAuthSuccess: (authDetails: AuthAndWalletRpcReturnType) => Promise<AuthLoginReturnType>;
37
- });
38
- private preLogin;
39
- private postLogin;
40
- loginWithAuthToken(authToken: AuthStoredTokenWithCookieReturnType, recoveryCode?: string): Promise<AuthLoginReturnType>;
41
- /**
42
- * Used to log the user into their thirdweb wallet on your platform via a myriad of auth providers
43
- * @example
44
- * ```typescript
45
- * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "YOUR_CLIENT_ID", chain: "Polygon"})
46
- * try {
47
- * const user = await thirdwebInAppWallet.auth.loginWithModal();
48
- * // user is now logged in
49
- * } catch (e) {
50
- * // User closed modal or something else went wrong during the authentication process
51
- * console.error(e)
52
- * }
53
- * ```
54
- * @returns `{{user: InitializedUser}}` An InitializedUser object.
55
- */
56
- loginWithModal(): Promise<AuthLoginReturnType>;
57
- /**
58
- * Used to log the user into their thirdweb wallet using email OTP
59
- * @example
60
- * ```typescript
61
- * // Basic Flow
62
- * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
63
- * try {
64
- * // prompts user to enter the code they received
65
- * const user = await thirdwebInAppWallet.auth.loginWithThirdwebEmailOtp({ email : "you@example.com" });
66
- * // user is now logged in
67
- * } catch (e) {
68
- * // User closed the OTP modal or something else went wrong during the authentication process
69
- * console.error(e)
70
- * }
71
- * ```
72
- * @param args - args.email: We will send the email an OTP that needs to be entered in order for them to be logged in.
73
- * @returns `{{user: InitializedUser}}` An InitializedUser object. See {@link InAppWalletSdk.getUser} for more
74
- */
75
- loginWithEmailOtp(args: Parameters<BaseLogin["loginWithEmailOtp"]>[0]): Promise<AuthLoginReturnType>;
76
- /**
77
- * @internal
78
- */
79
- loginWithCustomJwt(args: Parameters<BaseLogin["loginWithCustomJwt"]>[0]): Promise<AuthLoginReturnType>;
80
- /**
81
- * @internal
82
- */
83
- loginWithCustomAuthEndpoint(args: Parameters<BaseLogin["loginWithCustomAuthEndpoint"]>[0]): Promise<AuthLoginReturnType>;
84
- /**
85
- * @internal
86
- */
87
- loginWithOauth(args: Parameters<BaseLogin["loginWithOauth"]>[0]): Promise<AuthLoginReturnType>;
88
- /**
89
- * A headless way to send the users at the passed email an OTP code.
90
- * You need to then call {@link Auth.verifyEmailLoginOtp} in order to complete the login process
91
- * @example
92
- * @param param0.email
93
- * ```typescript
94
- * const thirdwebInAppWallet = new InAppWalletSdk({clientId: "", chain: "Polygon"});
95
- * // sends user an OTP code
96
- * try {
97
- * await thirdwebInAppWallet.auth.sendEmailLoginOtp({ email : "you@example.com" });
98
- * } catch(e) {
99
- * // Error Sending user's email an OTP code
100
- * console.error(e);
101
- * }
102
- *
103
- * // Then when your user is ready to verify their OTP
104
- * try {
105
- * const user = await thirdwebInAppWallet.auth.verifyEmailLoginOtp({ email: "you@example.com", otp: "6-DIGIT_CODE_HERE" });
106
- * } catch(e) {
107
- * // Error verifying the OTP code
108
- * console.error(e)
109
- * }
110
- * ```
111
- * @param param0 - param0.email We will send the email an OTP that needs to be entered in order for them to be logged in.
112
- * @returns `{{ isNewUser: boolean }}` IsNewUser indicates if the user is a new user to your platform
113
- * @internal
114
- */
115
- sendEmailLoginOtp({ email, }: Parameters<BaseLogin["sendEmailLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
116
- /**
117
- * @internal
118
- */
119
- sendSmsLoginOtp({ phoneNumber, }: Parameters<BaseLogin["sendSmsLoginOtp"]>[0]): Promise<SendEmailOtpReturnType>;
120
- /**
121
- * Used to verify the otp that the user receives from thirdweb
122
- *
123
- * See {@link Auth.sendEmailLoginOtp} for how the headless call flow looks like. Simply swap out the calls to `loginWithThirdwebEmailOtp` with `verifyThirdwebEmailLoginOtp`
124
- * @param args - props.email We will send the email an OTP that needs to be entered in order for them to be logged in.
125
- * props.otp The code that the user received in their email
126
- * @returns `{{user: InitializedUser}}` An InitializedUser object containing the user's status, wallet, authDetails, and more
127
- * @internal
128
- */
129
- verifyEmailLoginOtp(args: Parameters<BaseLogin["verifyEmailLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
130
- /**
131
- * @internal
132
- */
133
- verifySmsLoginOtp(args: Parameters<BaseLogin["verifySmsLoginOtp"]>[0]): Promise<AuthLoginReturnType>;
134
- /**
135
- * Logs any existing user out of their wallet.
136
- * @returns `{{success: boolean}}` true if a user is successfully logged out. false if there's no user currently logged in.
137
- * @internal
138
- */
139
- logout(): Promise<LogoutReturnType>;
140
- }
17
+ export declare function getAuthenticatedUser(options: GetAuthenticatedUserParams): Promise<import("../../../core/authentication/type.js").InitializedUser | undefined>;
18
+ /**
19
+ * Retrieves the authenticated user email for the active in-app wallet.
20
+ * @param options - The arguments for retrieving the authenticated user.
21
+ * @returns The authenticated user email if logged in and wallet initialized, otherwise undefined.
22
+ * @example
23
+ * ```ts
24
+ * import { getUserEmail } from "thirdweb/wallets/in-app";
25
+ *
26
+ * const email = await getUserEmail({ client });
27
+ * console.log(email);
28
+ * ```
29
+ * @wallet
30
+ */
31
+ export declare function getUserEmail(options: GetAuthenticatedUserParams): Promise<string | undefined>;
32
+ /**
33
+ * Retrieves the authenticated user phone number for the active embedded wallet.
34
+ * @param options - The arguments for retrieving the authenticated user.
35
+ * @returns The authenticated user phone number if authenticated with phone number, otherwise undefined.
36
+ * @example
37
+ * ```ts
38
+ * import { getUserPhoneNumber } from "thirdweb/wallets/embedded";
39
+ *
40
+ * const phoneNumber = await getUserPhoneNumber({ client });
41
+ * console.log(phoneNumber);
42
+ * ```
43
+ * @wallet
44
+ */
45
+ export declare function getUserPhoneNumber(options: GetAuthenticatedUserParams): Promise<string | undefined>;
46
+ /**
47
+ * Pre-authenticates the user based on the provided authentication strategy.
48
+ * @param args - The arguments required for pre-authentication.
49
+ * @returns A promise that resolves to the pre-authentication result.
50
+ * @throws An error if the provided authentication strategy doesn't require pre-authentication.
51
+ * @example
52
+ * ```ts
53
+ * import { preAuthenticate } from "thirdweb/wallets/in-app";
54
+ *
55
+ * const result = await preAuthenticate({
56
+ * client,
57
+ * strategy: "email",
58
+ * email: "example@example.org",
59
+ * });
60
+ * ```
61
+ * @wallet
62
+ */
63
+ export declare function preAuthenticate(args: PreAuthArgsType): Promise<import("../../../core/authentication/type.js").SendEmailOtpReturnType>;
64
+ /**
65
+ * Authenticates the user based on the provided authentication arguments.
66
+ * @param args - The authentication arguments.
67
+ * @returns A promise that resolves to the authentication result.
68
+ * @example
69
+ * ```ts
70
+ * import { authenticate } from "thirdweb/wallets/in-app";
71
+ *
72
+ * const result = await authenticate({
73
+ * client,
74
+ * strategy: "email",
75
+ * email: "example@example.org",
76
+ * verificationCode: "123456",
77
+ * });
78
+ * ```
79
+ * @wallet
80
+ */
81
+ export declare function authenticate(args: AuthArgsType): Promise<AuthLoginReturnType>;
141
82
  //# sourceMappingURL=index.d.ts.map