diff --git a/.changeset/neat-poems-impress.md b/.changeset/neat-poems-impress.md new file mode 100644 index 00000000000..aa6081adb73 --- /dev/null +++ b/.changeset/neat-poems-impress.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Added optional flag to ecosystem wallet creation for skipping fetching of default ecosystem info defined in the dashboard. diff --git a/packages/thirdweb/src/wallets/ecosystem/types.ts b/packages/thirdweb/src/wallets/ecosystem/types.ts index 8072a4d6661..4a6fdb1d185 100644 --- a/packages/thirdweb/src/wallets/ecosystem/types.ts +++ b/packages/thirdweb/src/wallets/ecosystem/types.ts @@ -23,6 +23,10 @@ export type EcosystemWalletCreationOptions = { * The partnerId of the ecosystem wallet to connect to */ partnerId?: string; + /** + * Optional flag to skip fetching and usage of ecosystem's info default account abstraction settings + */ + skipEcosystemInfo?: boolean; }; export type EcosystemWalletConnectionOptions = InAppWalletConnectionOptions; diff --git a/packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts b/packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts index 2a652b5bd71..c06232bbd62 100644 --- a/packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts +++ b/packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts @@ -78,7 +78,7 @@ export function createInAppWallet(args: { ecosystem, ); - if (ecosystem) { + if (ecosystem && !createOptions?.skipEcosystemInfo) { const ecosystemOptions = await getEcosystemInfo(ecosystem.id); const smartAccountOptions = ecosystemOptions?.smartAccountOptions; if (smartAccountOptions) { @@ -132,7 +132,7 @@ export function createInAppWallet(args: { ecosystem, ); - if (ecosystem) { + if (ecosystem && !createOptions?.skipEcosystemInfo) { const ecosystemOptions = await getEcosystemInfo(ecosystem.id); const smartAccountOptions = ecosystemOptions?.smartAccountOptions; if (smartAccountOptions) { @@ -206,7 +206,7 @@ export function createInAppWallet(args: { ecosystem, ); - if (ecosystem) { + if (ecosystem && !createOptions?.skipEcosystemInfo) { const ecosystemOptions = await getEcosystemInfo(ecosystem.id); const smartAccountOptions = ecosystemOptions?.smartAccountOptions; if (smartAccountOptions) { diff --git a/packages/thirdweb/src/wallets/in-app/core/wallet/types.ts b/packages/thirdweb/src/wallets/in-app/core/wallet/types.ts index 7d0a048ad85..3578336d513 100644 --- a/packages/thirdweb/src/wallets/in-app/core/wallet/types.ts +++ b/packages/thirdweb/src/wallets/in-app/core/wallet/types.ts @@ -87,5 +87,9 @@ export type InAppWalletCreationOptions = * Whether to hide the private key export button in the Connect Modal */ hidePrivateKeyExport?: boolean; + /** + * Optional flag to skip fetching and usage of ecosystem's info default account abstraction settings + */ + skipEcosystemInfo?: boolean; } | undefined; diff --git a/packages/thirdweb/src/wallets/in-app/web/ecosystem.ts b/packages/thirdweb/src/wallets/in-app/web/ecosystem.ts index 2f887c5ae3a..cec6fcabc54 100644 --- a/packages/thirdweb/src/wallets/in-app/web/ecosystem.ts +++ b/packages/thirdweb/src/wallets/in-app/web/ecosystem.ts @@ -67,6 +67,7 @@ export function ecosystemWallet( options: [], // controlled by ecosystem }, partnerId: ecosystem.partnerId, + skipEcosystemInfo: createOptions?.skipEcosystemInfo, }, connectorFactory: async (client: ThirdwebClient) => { const { InAppWebConnector } = await import("./lib/web-connector.js");