Skip to content

Commit ced76d9

Browse files
committed
feat(ecosystems): add flag for skipping default ecosystem info fetch
1 parent fb4d0a2 commit ced76d9

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.changeset/neat-poems-impress.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Added optional flag to ecosystem wallet creation for skipping fetching of default ecosystem info defined in the dashboard.

packages/thirdweb/src/wallets/ecosystem/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export type EcosystemWalletCreationOptions = {
2323
* The partnerId of the ecosystem wallet to connect to
2424
*/
2525
partnerId?: string;
26+
/**
27+
* Optional flag to skip fetching and usage of ecosystem's info default account abstraction settings
28+
*/
29+
skipEcosystemInfo?: boolean;
2630
};
2731

2832
export type EcosystemWalletConnectionOptions = InAppWalletConnectionOptions;

packages/thirdweb/src/wallets/in-app/core/wallet/in-app-core.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function createInAppWallet(args: {
7878
ecosystem,
7979
);
8080

81-
if (ecosystem) {
81+
if (ecosystem && !createOptions?.skipEcosystemInfo) {
8282
const ecosystemOptions = await getEcosystemInfo(ecosystem.id);
8383
const smartAccountOptions = ecosystemOptions?.smartAccountOptions;
8484
if (smartAccountOptions) {
@@ -132,7 +132,7 @@ export function createInAppWallet(args: {
132132
ecosystem,
133133
);
134134

135-
if (ecosystem) {
135+
if (ecosystem && !createOptions?.skipEcosystemInfo) {
136136
const ecosystemOptions = await getEcosystemInfo(ecosystem.id);
137137
const smartAccountOptions = ecosystemOptions?.smartAccountOptions;
138138
if (smartAccountOptions) {
@@ -206,7 +206,7 @@ export function createInAppWallet(args: {
206206
ecosystem,
207207
);
208208

209-
if (ecosystem) {
209+
if (ecosystem && !createOptions?.skipEcosystemInfo) {
210210
const ecosystemOptions = await getEcosystemInfo(ecosystem.id);
211211
const smartAccountOptions = ecosystemOptions?.smartAccountOptions;
212212
if (smartAccountOptions) {

packages/thirdweb/src/wallets/in-app/core/wallet/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,9 @@ export type InAppWalletCreationOptions =
8787
* Whether to hide the private key export button in the Connect Modal
8888
*/
8989
hidePrivateKeyExport?: boolean;
90+
/**
91+
* Optional flag to skip fetching and usage of ecosystem's info default account abstraction settings
92+
*/
93+
skipEcosystemInfo?: boolean;
9094
}
9195
| undefined;

packages/thirdweb/src/wallets/in-app/web/ecosystem.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function ecosystemWallet(
6767
options: [], // controlled by ecosystem
6868
},
6969
partnerId: ecosystem.partnerId,
70+
skipEcosystemInfo: createOptions?.skipEcosystemInfo,
7071
},
7172
connectorFactory: async (client: ThirdwebClient) => {
7273
const { InAppWebConnector } = await import("./lib/web-connector.js");

0 commit comments

Comments
 (0)