Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other provider support #1

Open
nullart2 opened this issue Aug 7, 2022 · 5 comments
Open

Other provider support #1

nullart2 opened this issue Aug 7, 2022 · 5 comments

Comments

@nullart2
Copy link

nullart2 commented Aug 7, 2022

I tried to use ceramic's key-did-provider-ed25519

but seem to get this error:

provider.enable is not a function

code:

async connectOrbis(seed:string) {


    const enc = new TextEncoder();
    const authSecret = enc.encode(seed);

    const provider = new Ed25519Provider(authSecret)

    let res = await this.orbis.connect(provider);
    console.log('orbit connect', res);
  }

Thanks

@sirpy
Copy link

sirpy commented Oct 3, 2023

This should be defined as a bug.
Because it doesnt allow to use standard providers and relies only on "metamask" style providers.
If using a provider from frameworks like wagmi/usedapp/web3modal then it won't work, since the standard provider doesnt have the enable method

From looking at the code it seems enable is only for getting the account address, so instead provider.send('eth_accounts',[]) should be called and error thrown if result is empty

@donatandelic
Copy link

This should be defined as a bug. Because it doesnt allow to use standard providers and relies only on "metamask" style providers. If using a provider from frameworks like wagmi/usedapp/web3modal then it won't work, since the standard provider doesnt have the enable method

The Ed25519Provider from this issue is not a supported provider for the connect method, despite the existing enable issue.
connectWithSeed should be used instead.

@sirpy
Copy link

sirpy commented Oct 3, 2023

@donatandelic i'm talking about other eip1193 providers that want to use pkh auth
orbis will not work with providers returned from web3modal etc..., ie the standard dapp provider

@Pfed-prog
Copy link

Pfed-prog commented Dec 13, 2023

At the moment I am trying to accomplish simple querying of the data via back end and this is not possible because we have to connect to window object.
I have delved into https://did.js.org/docs/api/modules/pkh_ethereum
It works the same way only with window.ethereum

In the best case scenario, it would be amazing we could connect to Infura Provider

@donatandelic
Copy link

@Pfed-prog here's an example of using Ethers in the backend with Orbis SDK.
We had to shim window and localStorage in order to make certain dependencies work.

https://gist.github.com/donatandelic/320b739a78bca34fa929cbc7656e94a1

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

No branches or pull requests

4 participants