1.6.0 • Published 4 years ago
@ergoplatform/ergo-js v1.6.0
Ergo-js
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)
1.6.0
4 years ago
1.5.0
5 years ago
1.4.2
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.2.8
5 years ago
1.2.7
5 years ago
1.2.6
5 years ago
1.1.6
5 years ago
1.1.5
5 years ago
1.1.4
5 years ago
1.1.3
5 years ago
1.1.2
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago