logo

web3.js

To interact with Darwinia nodes, you can use web3.js library.
Getting Started — web3.js 1.0.0 documentation

Connecting with MetaMask

typescript
import Web3 from 'web3'; const web3 = new Web3(Web3.givenProvider); // web3.eth

Connecting through RPC

typescript
import Web3 from 'web3'; // const web3 = new Web3("https://pangolin-rpc.darwinia.network"); // const web3 = new Web3("https://pangoro-rpc.darwinia.network"); // const web3 = new Web3("https://crab-rpc.darwinia.network"); const web3 = new Web3("https://rpc.darwinia.network"); // web3.eth

Powered by Notaku