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

cashaccounts

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cashaccounts - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

55

index.js

@@ -93,2 +93,41 @@ const EmojiList = require('./emoji_names.json');

/**
* get metadata on cashaccount from your node
*
* @param {*} transaction transaction hex
* @returns {object}
* @memberof CashAccounts
*/
async trustlessLookup(transaction) {
const tx = await this.bchNode.decodeRawTransaction(transaction);
const raw = await this.bchNode.getRawTransaction(tx.txid, 1);
const { blockhash, txid } = raw;
const block = await this.bchNode.getBlock(blockhash);
const { height } = block;
const opreturn = tx.vout.find(x => x.scriptPubKey.type === 'nulldata')
.scriptPubKey.asm;
let number = this.calculateNumber(height);
const emoji = this.calculateEmoji(txid, blockhash);
const payment = await this.parsePaymentInfo(opreturn);
const collision = this.calculateCollisionHash(blockhash, txid);
const name = await this.parseName(opreturn);
const object = {
identifier: `${name}#${number}`,
information: {
emoji: emoji,
name: name,
number: number,
collision: { hash: collision, count: 0, length: 0 },
payment: payment
}
};
return object;
}
/**
* get metadata on cashaccount

@@ -165,3 +204,3 @@ *

/**
* Parse cashaccount OPRETURN
* Parse cashaccount payment info
*

@@ -187,2 +226,16 @@ * @param {string} opreturn

/**
* Parse cashaccount name
*
* @param {string} opreturn
* @returns {object} get name from registration opreturn
* @memberof CashAccount
*/
async parseName(opreturn) {
const split = opreturn.split(' ');
const name = Buffer.from(split[2], 'hex');
let string = name.toString('ascii');
return string;
}
/**
* get address(es) by handle

@@ -189,0 +242,0 @@ *

2

package.json
{
"name": "cashaccounts",
"version": "0.2.1",
"version": "0.2.2",
"description": "decentralized identity system for bitcoin cash by Jonathan Silverblood",

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

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