Skip to content

Conversation

@Vorobeyko
Copy link
Contributor

No description provided.

}

this.logger.debug(
`Starting a new browser context (temp context: ${browserContextPath})`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you print the path instead of the previous value?

Image

if (!background)
background = await this.browserContext.waitForEvent('serviceworker');
this.extensionId = background.url().split('/')[2];
if (this.walletExtensionStartPath) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use the WalletConnectTypes here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, browser context doesn’t know anything about wallets

private walletPage: WalletPage<
WalletConnectTypes.WC | WalletConnectTypes.EOA | WalletConnectTypes.IFRAME
| WalletConnectTypes.WC
| WalletConnectTypes.WC_SDK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we unite the WC and WC_SDK?

await this.walletPage.setupNetwork(this.options.networkConfig);
await this.walletPage.changeNetwork(this.options.networkConfig.chainName);
await this.browserContextService.closePages();
if (this.options.walletConfig.WALLET_TYPE !== WalletConnectTypes.WC_SDK) {
Copy link
Contributor

@jake4take jake4take Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move it to the private method?

@@ -84,9 +87,13 @@ export class BrowserService {
await this.setupWithNode();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we have any changes in the setupWithNode method?

EXTENSION_WALLET_NAME: 'wcSDK',
CONNECTED_WALLET_NAME: 'WalletConnect',
CONNECT_BUTTON_NAME: 'WalletConnect',
STORE_EXTENSION_ID: 'nkbihfbeogaeaoehlefnkodbefgpgknn',
Copy link
Contributor

@jake4take jake4take Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you keep parameters are unnecessary for the WC_SDK here?

}

async setup() {
if (this.options.walletConfig.WALLET_TYPE === WalletConnectTypes.WC_SDK) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can try not to add this condition here

}

private setWalletPage() {
if (this.options.walletConfig.WALLET_TYPE === WalletConnectTypes.WC_SDK) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move it to the switch..case condition below?

} from './pages/elements';
import { getAddress } from 'viem';
import { isPopularMainnetNetwork, isPopularTestnetNetwork } from './helper';
import { WCSessionRequest } from '../../walletConnect/wc.service';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fill the index file and fix the import lines everywhere?


/** Confirm transaction */
async confirmTx(page: Page) {
async confirmTx(page: Page | WCSessionRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the same format here?
page: T extends WalletConnectTypes.WC_SDK ? WCSessionRequest : Page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants