Socket
Book a DemoInstallSign in
Socket

@omisego/omg-js-utxo-merge

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omisego/omg-js-utxo-merge

A helper lib for merging utxos

1.0.1
latest
Source
npmnpm
Version published
Maintainers
5
Created
Source

omg-js-utxo-merge

A helper lib for merging utxos

Usage example


const ChildChain = require('@omisego/omg-js-childchain')
const merge = require('@omisego/omg-js-utxo-merge')

const ADDRESS = 'my address'
const PRIVATE_KEY = 'my private key'

const childChain = new ChildChain('http://watcher.ari.omg.network/')

function signTransaction (unsignedTx, numUtxos, address) {
  const privateKeys = new Array(numUtxos).fill(PRIVATE_KEY)
  const signatures = childChain.signTransaction(unsignedTx, privateKeys)
  return childChain.buildSignedTransaction(unsignedTx, signatures)
}

function submitTransaction (signedTx) {
  return childChain.submitTransaction(signedTx)
}

childChain.getUtxos(ADDRESS)
  .then(utxos => merge(utxos, ADDRESS, signTransaction, submitTransaction))


FAQs

Package last updated on 30 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.