Socket
Book a DemoInstallSign in
Socket

@astar-network/astar-api

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@astar-network/astar-api

Astar JS API

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
1
-96.55%
Maintainers
0
Weekly downloads
 
Created
Source

license

@astar-network api

This library provides additional typing information for user to access Astar's modules by using polkadot.js

Getting Started

More documentation and examples on wiki

  • Install dependencies
yarn add @polkadot/api @astar-network/astar-api@beta
  • Create API instance
import { ApiPromise } from '@polkadot/api';
import { WsProvider } from '@polkadot/rpc-provider';
import { options } from '@astar-network/astar-api';

async function main() {
    const provider = new WsProvider('wss://localhost:9944');
    const api = new ApiPromise(options({ provider }));
    await api.isReady;

    // use the api
    //..
}

main()
  • Use api to interact with node
// query and display account data
const data = await api.query.system.account('5F98oWfz2r5rcRVnP9VCndg33DAAsky3iuoBSpaPUbgN9AJn');
console.log(data.toHuman())

Packages

  • api
    • Contains necessary options to create a polkadot.js API instance
  • type-definitions
    • Polkadot.js type definitions for Astar Network.
  • types
    • Polkadot.js auto-generated types for Astar Network.

FAQs

Package last updated on 09 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.