Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@omisego/omg-js-util

Package Overview
Dependencies
Maintainers
6
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5

src/ethErrorReason.js

4

package.json
{
"name": "@omisego/omg-js-util",
"version": "3.0.0-alpha.4",
"version": "3.0.0-alpha.5",
"description": "OMG util module",

@@ -30,3 +30,3 @@ "main": "src/index.js",

},
"gitHead": "73bd9623820d5e13f8b1487d3a4b4f7621d74797"
"gitHead": "cae561670c71319ed2d2e66ce0adf402da308b06"
}

@@ -21,3 +21,6 @@ /*

hexToBytes: require('./hexToBytes'),
ArgTypes: require('./ArgTypes')
ArgTypes: require('./ArgTypes'),
hexPrefix: require('./hexPrefix'),
ethErrorReason: require('./ethErrorReason')
}

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

const getToSignHash = require('./signHash')
const hexPrefix = require('./hexPrefix')

@@ -117,5 +118,5 @@ const MAX_INPUTS = 4

*/
encode: function ({ transactionType, inputs, outputs, metadata, signatures }) {
encode: function ({ transactionType, inputs, outputs, metadata, signatures }, { signed = true } = {}) {
const txArray = [transactionType]
signatures && txArray.unshift(signatures)
signatures && signed && txArray.unshift(signatures)
const inputArray = []

@@ -138,5 +139,10 @@ const outputArray = []

txArray.push(metadata)
return `0x${rlp.encode(txArray).toString('hex')}`
return hexPrefix(rlp.encode(txArray).toString('hex'))
},
rlpDecode: function (hash) {
const rawTx = Buffer.isBuffer(hash) ? hash : Buffer.from(hash.replace('0x', ''), 'hex')
return rlp.decode(rawTx)
},
/**

@@ -143,0 +149,0 @@ * Decodes an RLP encoded transaction

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