This package has been deprecated

Author message:

ElrondJS is now deprecated and no longer maintained. Please use @elrondnetwork/erdjs instead.

elrondjs
TypeScript icon, indicating that this package has built-in type declarations

2.7.0 • Public • Published

elrond.js

NPM module Join the community Follow on Twitter

Javascript SDK for the Elrond blockchain.

Features:

  • Generate and load wallets (Ledger wallets too!)
  • Sign and broadcast transactions
  • Query the blockchain and work with smart contracts
  • Cross-platform: Node.js, Browser, Web workers and React Native.
  • Typescript definitions 🔥
  • Full documentation

Installation

Note: Node 12 or above is required to use elrondjs

npm install --save elrondjs

Usage

Example - Claiming rewards from the Mainnet delegation contract

import { Contract, ProxyProvider, BasicWallet } from 'elrondjs'

(async () => {
  // create connection to network
  const proxy = new ProxyProvider('https://api.elrond.com')

  // load wallet
  const wallet = BasicWallet.fromMnemonic('YOUR MNEMONIC HERE'),

  // create contract interface
  // and tell it to use our provider and wallet
  const c = await Contract.at('erd1qqqqqqqqqqqqqpgqxwakt2g7u9atsnr03gqcgmhcv38pt7mkd94q6shuwt', {
    provider: proxy,
    signer: wallet,
  })

  // make the claim!
  await c.invoke('claimRewards', [], {
    gasLimit: 250000000
  })
})()

For usage and full documentation see https://elrondjs.erd.dev.

Contributors guide

To build the lib and watch for changes:

npm run dev

To build the lib for production:

npm run build

To build the docs:

npm run build-docs

To publish a new release:

npm run release

To run the tests, first run npm run devnet in a separate terminal to start a local test network. Then run:

npm test

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i elrondjs

Weekly Downloads

0

Version

2.7.0

License

ISC

Unpacked Size

822 kB

Total Files

83

Last publish

Collaborators

  • hiddentao