You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
To connect to astar/shiden node first install the dependencies and use ApiPromise with options.
yarn add @polkadot/api @astar-network/astar-api
Create API instance:
import{ApiPromise}from'@polkadot/api';import{WsProvider}from'@polkadot/rpc-provider';import{options}from'@astar-network/astar-api';asyncfunctionmain(){constprovider=newWsProvider('ws://localhost:9944');// OR// const provider = new WsProvider('wss://shiden.api.onfinality.io/public-ws');constapi=newApiPromise(options({ provider }));awaitapi.isReady;// Use the api// For example:console.log((awaitapi.rpc.system.properties()).toHuman());process.exit(0);}main()