Socket
Socket
Sign inDemoInstall

@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


Version published
Weekly downloads
0
decreased by-100%
Maintainers
5
Weekly downloads
 
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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc