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
<script src='path_to/ergo.js'></script>
<script>
ergo.sendTransaction(...)
</script>
const ergo = require('@ergoplatform/ergo-js');
ergo.sendTransaction(...)
import * as ergo from '@ergoplatform/ergo-js'
ergo.sendTransaction(...)
// or destructuring assignment
import { sendTransaction } from '@ergoplatform/ergo-js'
sendTransaction(...)
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)
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)
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)
import { addressFromPK } from '@ergoplatform/ergo-js'
* @param {string} pk
* @param {boolean} testNet
addressFromPK(pk, testNet)
import { addressFromSK } from '@ergoplatform/ergo-js'
* @param {string} sk
* @param {boolean} testNet
addressFromSK(pk, testNet)