@ergoplatform/ergo-js

JS library for Ergo integration

Showing:

Popularity

Downloads/wk

74

GitHub Stars

11

Maintenance

Last Commit

2yrs ago

Contributors

7

Package

Dependencies

7

Size (min+gzip)

186.0KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Ergo-js

codecov Build Status

Installing

import in body

<script src='path_to/dist/ergo.js'></script> 

With npm:

npm install @ergoplatform/ergo-js

Or yarn:

yarn add @ergoplatform/ergo-js

Usage

In body:

<script src='path_to/ergo.js'></script>
<script>
  ergo.sendTransaction(...)
</script> 

In Node.js:

const ergo = require('@ergoplatform/ergo-js');

ergo.sendTransaction(...)

Import syntax:

import * as ergo from '@ergoplatform/ergo-js'

ergo.sendTransaction(...)

// or destructuring assignment

import { sendTransaction } from '@ergoplatform/ergo-js'

sendTransaction(...)

Documentation

Default send transaction

import { sendTransaction } from '@ergoplatform/ergo-js'

* @param  {String} recipient
* @param  {Number} amount
* @param  {Number} fee
* @param  {Array[Object({ id: number, amount: number, sk(hex): string })]}} boxesToSpend
* @param  {String} chargeAddress
* @param  {Number} height
* @param  {Boolean} testNet = false

sendTransaction(recipient, amount, fee, boxesToSpend, chargeAddress, height, testNet)

Send transaction only with sk

import { sendWithoutBoxId } from '@ergoplatform/ergo-js'

* @param  {String} recipient
* @param  {Number} amount
* @param  {Number} fee
* @param  {String || Array[String]} sk
* @param  {Boolean} testNet = false

sendWithoutBoxId(recipient, amount, fee, sk, testNet) 

Form transaction and returns it

import { formTransaction } from '@ergoplatform/ergo-js'

* @param  {String} recipient
* @param  {Number} amount
* @param  {Number} fee
* @param  {Array[Object({ id: number, amount: number, sk(hex): string })]} boxesToSpend
* @param  {String} chargeAddress
* @param  {Number} height

formTransaction(recipient, amount, fee, boxesToSpend, chargeAddress, height)

Generate charge address from public key

import { addressFromPK } from '@ergoplatform/ergo-js'

* @param  {string} pk
* @param  {boolean} testNet

addressFromPK(pk, testNet)

Generate charge address from private key

import { addressFromSK } from '@ergoplatform/ergo-js'

* @param  {string} sk
* @param  {boolean} testNet

addressFromSK(pk, testNet)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100