Skip to content

Argent Webwallet Connector reports an empty address with starknet-react #130

@jisensee

Description

@jisensee

I have managed to get the webwallet working in my Next.js app with starknet react by upgrading my app to use

Everything kinda works out of the box but the account field that is returned by the useAccount from starknet-react always contains an empty string instead of the actual address, even though I can see that the connector is fetching the accounts from the wallet successfully.

The issue is also present in the example dapp. Everything works but the address is not shown in the UI.

I managed to "fix" it by subclassing the connector and setting the address in the account method manually:

class MyWebWalletConnector extends WebWalletConnector {
  private address?: string

  async connect() {
    const result = await super.connect()
    this.address = result.account
    return result
  }
  async account(provider: ProviderOptions | ProviderInterface) {
    const acc = await super.account(provider)
    if (this.address) {
      acc.address = this.address
    }
    return acc
  }
}

So this seems like an issue with the connector implementation and not with starknet-react to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions