New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@omisego/omg-js-childchain

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omisego/omg-js-childchain - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

test/encodeUtxoTest.js

4

package.json
{
"name": "@omisego/omg-js-childchain",
"version": "0.1.7",
"version": "0.1.8",
"description": "Module to interact with OMG ChildChain",

@@ -41,3 +41,3 @@ "keywords": [

},
"gitHead": "96445b5c2197d63dabf93da9484934c26d8fd689"
"gitHead": "80ba66efc5e93f05ca69772edb7cec127ae38b27"
}

@@ -83,2 +83,8 @@ /*

async getChallengeData (utxo) {
// Calculate the utxoPos
const utxoPos = transaction.encodeUtxoPos(utxo)
return watcherApi.get(`${this.watcherUrl}/utxo/${utxoPos}/challenge_data`)
}
/**

@@ -85,0 +91,0 @@ * Create an unsigned transaction

@@ -17,2 +17,3 @@ /*

const { InvalidArgumentError } = require('@omisego/omg-js-util')
const Web3Utils = require('web3-utils')

@@ -25,3 +26,3 @@ const MAX_INPUTS = 2

const BLOCK_OFFSET = 1000000000
const BLOCK_OFFSET = Web3Utils.toBN(1000000000)
const TX_OFFSET = 10000

@@ -108,3 +109,5 @@

function encodeUtxoPos (utxo) {
return BLOCK_OFFSET * utxo.blknum + TX_OFFSET * utxo.txindex + utxo.oindex
const blk = Web3Utils.toBN(utxo.blknum).mul(BLOCK_OFFSET)
const tx = Web3Utils.toBN(utxo.txindex).muln(TX_OFFSET)
return blk.add(tx).addn(utxo.oindex)
}

@@ -111,0 +114,0 @@

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