thirdweb 5.64.3-nightly-ddec3dadcc260e0d4d0ed2b43c502e0915a14203-20241029000326 → 5.64.3

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 (45) hide show
  1. package/dist/cjs/react/core/utils/isSmartWallet.js +4 -2
  2. package/dist/cjs/react/core/utils/isSmartWallet.js.map +1 -1
  3. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js +1 -1
  4. package/dist/cjs/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  5. package/dist/cjs/version.js +1 -1
  6. package/dist/cjs/version.js.map +1 -1
  7. package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +23 -17
  8. package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
  9. package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-info.js +4 -13
  10. package/dist/cjs/wallets/ecosystem/get-ecosystem-wallet-info.js.map +1 -1
  11. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js +56 -4
  12. package/dist/cjs/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  13. package/dist/cjs/wallets/in-app/core/wallet/index.js +2 -50
  14. package/dist/cjs/wallets/in-app/core/wallet/index.js.map +1 -1
  15. package/dist/esm/react/core/utils/isSmartWallet.js +4 -2
  16. package/dist/esm/react/core/utils/isSmartWallet.js.map +1 -1
  17. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js +2 -2
  18. package/dist/esm/react/web/wallets/shared/ConnectWalletSocialOptions.js.map +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js +22 -16
  22. package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-auth-options.js.map +1 -1
  23. package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-info.js +4 -13
  24. package/dist/esm/wallets/ecosystem/get-ecosystem-wallet-info.js.map +1 -1
  25. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js +56 -4
  26. package/dist/esm/wallets/in-app/core/wallet/in-app-core.js.map +1 -1
  27. package/dist/esm/wallets/in-app/core/wallet/index.js +2 -50
  28. package/dist/esm/wallets/in-app/core/wallet/index.js.map +1 -1
  29. package/dist/types/react/core/utils/isSmartWallet.d.ts.map +1 -1
  30. package/dist/types/version.d.ts +1 -1
  31. package/dist/types/version.d.ts.map +1 -1
  32. package/dist/types/wallets/ecosystem/get-ecosystem-wallet-auth-options.d.ts +5 -1
  33. package/dist/types/wallets/ecosystem/get-ecosystem-wallet-auth-options.d.ts.map +1 -1
  34. package/dist/types/wallets/ecosystem/get-ecosystem-wallet-info.d.ts.map +1 -1
  35. package/dist/types/wallets/in-app/core/wallet/in-app-core.d.ts.map +1 -1
  36. package/dist/types/wallets/in-app/core/wallet/index.d.ts +2 -3
  37. package/dist/types/wallets/in-app/core/wallet/index.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/react/core/utils/isSmartWallet.ts +4 -2
  40. package/src/react/web/wallets/shared/ConnectWalletSocialOptions.tsx +2 -2
  41. package/src/version.ts +1 -1
  42. package/src/wallets/ecosystem/get-ecosystem-wallet-auth-options.ts +36 -23
  43. package/src/wallets/ecosystem/get-ecosystem-wallet-info.ts +5 -21
  44. package/src/wallets/in-app/core/wallet/in-app-core.ts +62 -4
  45. package/src/wallets/in-app/core/wallet/index.ts +0 -59
@@ -1,12 +1,10 @@
1
1
  import { ethereum } from "../../../../chains/chain-definitions/ethereum.js";
2
2
  import type { Chain } from "../../../../chains/types.js";
3
- import { getCachedChain } from "../../../../chains/utils.js";
4
3
  import type { ThirdwebClient } from "../../../../client/client.js";
5
4
  import {
6
5
  type SocialAuthOption,
7
6
  socialAuthOptions,
8
7
  } from "../../../../wallets/types.js";
9
- import { getEcosystemOptions } from "../../../ecosystem/get-ecosystem-wallet-auth-options.js";
10
8
  import type { Account, Wallet } from "../../../interfaces/wallet.js";
11
9
  import type { EcosystemWalletId, WalletId } from "../../../wallet-types.js";
12
10
  import type {
@@ -15,7 +13,6 @@ import type {
15
13
  WalletConnectionOption,
16
14
  } from "../../../wallet-types.js";
17
15
  import type { InAppConnector } from "../interfaces/connector.js";
18
- import type { Ecosystem } from "./types.js";
19
16
 
20
17
  /**
21
18
  * Checks if the provided wallet is an in-app wallet.
@@ -40,7 +37,6 @@ export async function connectInAppWallet(
40
37
  | CreateWalletArgs<"inApp">[1]
41
38
  | CreateWalletArgs<EcosystemWalletId>[1],
42
39
  connector: InAppConnector,
43
- ecosystem: Ecosystem | undefined,
44
40
  ): Promise<[Account, Chain]> {
45
41
  if (
46
42
  // if auth mode is not specified, the default is popup
@@ -77,33 +73,6 @@ export async function connectInAppWallet(
77
73
  });
78
74
  }
79
75
 
80
- if (ecosystem) {
81
- const ecosystemOptions = await getEcosystemOptions(ecosystem.id);
82
- const smartAccountOptions = ecosystemOptions?.smartAccountOptions;
83
- if (smartAccountOptions) {
84
- const allowedChains = smartAccountOptions.chainIds;
85
- const firstAllowedChain = allowedChains[0];
86
- if (!firstAllowedChain) {
87
- throw new Error(
88
- "At least one chain must be allowed for ecosystem smart account",
89
- );
90
- }
91
- const preferredChain =
92
- options.chain && allowedChains.includes(options.chain.id)
93
- ? options.chain
94
- : getCachedChain(firstAllowedChain);
95
- return convertToSmartAccount({
96
- client: options.client,
97
- authAccount,
98
- smartAccountOptions: {
99
- chain: preferredChain,
100
- sponsorGas: smartAccountOptions.sponsorGas,
101
- factoryAddress: smartAccountOptions.accountFactoryAddress,
102
- },
103
- });
104
- }
105
- }
106
-
107
76
  return [authAccount, options.chain || ethereum] as const;
108
77
  }
109
78
 
@@ -118,7 +87,6 @@ export async function autoConnectInAppWallet(
118
87
  | CreateWalletArgs<"inApp">[1]
119
88
  | CreateWalletArgs<EcosystemWalletId>[1],
120
89
  connector: InAppConnector,
121
- ecosystem: Ecosystem | undefined,
122
90
  ): Promise<[Account, Chain]> {
123
91
  if (options.authResult && connector.loginWithAuthToken) {
124
92
  await connector.loginWithAuthToken(options.authResult);
@@ -144,33 +112,6 @@ export async function autoConnectInAppWallet(
144
112
  });
145
113
  }
146
114
 
147
- if (ecosystem) {
148
- const ecosystemOptions = await getEcosystemOptions(ecosystem.id);
149
- const smartAccountOptions = ecosystemOptions?.smartAccountOptions;
150
- if (smartAccountOptions) {
151
- const allowedChains = smartAccountOptions.chainIds;
152
- const firstAllowedChain = allowedChains[0];
153
- if (!firstAllowedChain) {
154
- throw new Error(
155
- "At least one chain must be allowed for ecosystem smart account",
156
- );
157
- }
158
- const preferredChain =
159
- options.chain && allowedChains.includes(options.chain.id)
160
- ? options.chain
161
- : getCachedChain(firstAllowedChain);
162
- return convertToSmartAccount({
163
- client: options.client,
164
- authAccount,
165
- smartAccountOptions: {
166
- chain: preferredChain,
167
- sponsorGas: smartAccountOptions.sponsorGas,
168
- factoryAddress: smartAccountOptions.accountFactoryAddress,
169
- },
170
- });
171
- }
172
- }
173
-
174
115
  return [authAccount, options.chain || ethereum] as const;
175
116
  }
176
117