Skip to content

Commit

Permalink
Merge branch 'v6' of https://github.com/WalletConnect/web3modal into v6
Browse files Browse the repository at this point in the history
  • Loading branch information
enesozturk committed Sep 4, 2024
2 parents c18b58b + b4be62e commit 78a0c15
Show file tree
Hide file tree
Showing 25 changed files with 3,496 additions and 931 deletions.
3 changes: 2 additions & 1 deletion packages/adapters/ethers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build": "tsc --build tsconfig.build.json",
"watch": "tsc --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"test": "vitest run --coverage.enabled=true --coverage.reporter=json --coverage.reporter=json-summary --coverage.reportOnFailure=true"
},
"dependencies": {
"@walletconnect/utils": "2.14.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/adapters/ethers/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface Info {
rdns: string
}

interface EIP6963ProviderDetail {
export interface EIP6963ProviderDetail {
info: Info
provider: Provider
}
Expand All @@ -80,15 +80,15 @@ export class EVMEthersClient {

private EIP6963Providers: EIP6963ProviderDetail[] = []

private caipNetworks: CaipNetwork[] = []

private ethersConfig?: AdapterOptions['ethersConfig']

private authProvider?: W3mFrameProvider

// -- Public variables --------------------------------------------------------
public options: AppKitOptions | undefined = undefined

public caipNetworks: CaipNetwork[] = []

public chainNamespace: ChainNamespace = CommonConstantsUtil.CHAIN.EVM

public networkControllerClient?: NetworkControllerClient
Expand Down Expand Up @@ -193,7 +193,7 @@ export class EVMEthersClient {
this.appKit = appKit
this.options = options
this.caipNetworks = options.caipNetworks
this.defaultCaipNetwork = options.defaultCaipNetwork
this.defaultCaipNetwork = options.defaultCaipNetwork || options.caipNetworks[0]
this.tokens = HelpersUtil.getCaipTokens(options.tokens)
this.ethersConfig = this.createEthersConfig(options)

Expand Down Expand Up @@ -1077,8 +1077,8 @@ export class EVMEthersClient {
this.appKit?.setConnectors(w3mConnectors)
}

private async syncAuthConnector(projectId: string) {
if (typeof window !== 'undefined') {
private async syncAuthConnector(projectId: string, bypassWindowCheck = false) {
if (bypassWindowCheck || typeof window !== 'undefined') {
this.authProvider = new W3mFrameProvider(projectId)

this.appKit?.addConnector({
Expand Down
Loading

0 comments on commit 78a0c15

Please sign in to comment.