2.7.0 • Published 3 years ago

elrondjs v2.7.0

Weekly downloads
2,083
License
ISC
Repository
github
Last release
3 years ago

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

2.7.0

3 years ago

2.6.0

3 years ago

2.5.0

3 years ago

2.4.1

3 years ago

2.3.2

3 years ago

2.4.0

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.12.1

3 years ago

1.12.0

3 years ago

1.11.1

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.9.2

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago