Coder Social home page Coder Social logo

Comments (6)

sequencerr avatar sequencerr commented on June 26, 2024 2
import { mainnet } from '@wagmi/core/chains';
(mainnet.rpcUrls.default.http as unknown as string[]) = ['https://some-eth-rpc.com']; // or maybe better with defineChain()

Thank you!

from web3.js.

SantiagoDevRel avatar SantiagoDevRel commented on June 26, 2024 1

Hi @sequencerr thanks for submitting this! right, the method that its sending should be eth_requestAccounts no eth_accounts, the devs will look into this, thank u!

from web3.js.

avkos avatar avkos commented on June 26, 2024

Looks like the network https://cloudflare-eth.com/ does not support eth_accounts method. Check their documentation for available RPC methods. @sequencerr

from web3.js.

avkos avatar avkos commented on June 26, 2024

if you need to send RPC that doesn't exists inside web3js. You can send it using this code

web3.requestManager.send({
  method: 'eth_requestAccounts', // method name
  params: [....], // method params
});

from web3.js.

sequencerr avatar sequencerr commented on June 26, 2024

https://developers.cloudflare.com/web3/ethereum-gateway/reference/supported-api-methods

Can I leave all in wagmi client.transport but change to some other Ethereum JSON-RPC API node Gateway url?

from web3.js.

avkos avatar avkos commented on June 26, 2024
export function clientToWeb3js(client?: Client<Transport, Chain>) {
    if (!client) {
        return new Web3()
    }

    const {transport} = client

    if (transport.type === 'fallback') {
        return new Web3(transport.transports[0].value.url) // <== HERE
    }
    return new Web3(transport) // <== HERE
}

actually, yes you can set any URL you want
But, I think using Wagmi it is better to set the correct chain in Wagmi config
https://wagmi.sh/core/api/chains

from web3.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.