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

basecoin

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basecoin - npm Package Compare versions

Comparing version 2.2.3 to 2.3.0

2

package.json
{
"name": "basecoin",
"version": "2.2.3",
"version": "2.3.0",
"description": "Client for Tendermint's basecoin cryptocurrency",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -47,5 +47,5 @@ 'use strict'

if (err) return this.emit('error', err)
let { block } = event[1].data[1]
block.data.txs = block.data.txs.map((txHex) => {
let txBytes = Buffer.from(txHex, 'hex')
let { block } = event.data.data
block.data.txs = block.data.txs.map((txBase64) => {
let txBytes = Buffer.from(txBase64, 'base64')
return Tx.decode(txBytes)

@@ -66,3 +66,2 @@ })

let res = yield this.rpc.status(next)
// let appHash = Buffer.from(res[1].latest_app_hash, 'hex')

@@ -72,21 +71,8 @@ // TODO: use js-merkleeyes

path: '/key',
data: key.toString('hex'),
data: key.toString('base64'),
prove: true
}, next)
// let proof = Buffer.from(res[1].response.proof, 'hex')
if (!res[1].response.value) return null
let accountBytes = Buffer.from(res[1].response.value, 'hex')
// let proofHeight = res[1].response.height
if (!res.response.value) return null
let accountBytes = Buffer.from(res.response.value, 'base64')
// TODO: verify proofs
// res = yield this.crypto.verifyMerkleProof(proof, next)
// if (!res.isValid) {
// throw Error('Account proof is invalid')
// }
// if (!res.rootHash.equals(appHash)) {
// throw Error(`Proof contains incorrect root:
// current app hash: ${appHash.toString('hex')}
// proof root hash: ${res.rootHash.toString('hex')}`)
// }
let account = Account.decode(accountBytes)

@@ -100,3 +86,3 @@ if (account.key && !account.key.address().equals(address)) {

* sendTx (tx, next) {
let txBytes = Tx.encode(tx).toString('hex')
let txBytes = Tx.encode(tx).toString('base64')
return yield this.rpc.broadcastTxCommit({ tx: txBytes }, next)

@@ -118,3 +104,3 @@ }

maxHeight: 1e10
}, next))[1].block_metas
}, next)).block_metas
if (headers.length === 0) {

@@ -134,5 +120,5 @@ headers.height = from

txs.height = height
for (let [ , { block } ] of blocks) {
for (let { block } of blocks) {
for (let txBytes of block.data.txs) {
let tx = Tx.decode(Buffer.from(txBytes, 'hex'))
let tx = Tx.decode(Buffer.from(txBytes, 'base64'))
if (isTxRelevant(tx, addrs)) {

@@ -139,0 +125,0 @@ tx.time = new Date(block.header.time).getTime()

Sorry, the diff of this file is not supported yet

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