Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.6 to 0.5.0

51

index.js

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

const bitcoincashjs = require('bitcoincashjs-lib');
const bch = require('bitcore-lib-cash');
const bchaddr = require('bchaddrjs-slp');

@@ -172,6 +171,3 @@ const bchRPC = require('bitcoin-cash-rpc');

async trustedSearch(handle) {
const split = this.splitHandle(handle);
const { username, number, collision } = split;
const results = await this.trustedBitdbLookup(username, number);
const results = await this.trustedBitdbLookup(handle);
let data = results.c;

@@ -198,2 +194,3 @@ let array = [];

const emoji = this.calculateEmoji(transactionhash, blockhash);
const payment = await this.parsePaymentInfo(opreturn);

@@ -381,15 +378,12 @@ const collision = this.calculateCollisionHash(blockhash, transactionhash);

case '01':
address = new bch.Address(
hash,
'livenet',
'pubkeyhash'
).toCashAddress();
address = cashaddr.encode(
'bitcoincash',
'P2PKH',
Uint8Array.from(hash)
);
break;
case '02':
address = new bch.Address(
hash,
'livenet',
'scripthash'
).toCashAddress();
address = cashaddr.encode('bitcoincash', 'P2SH', Uint8Array.from(hash));
break;

@@ -402,16 +396,16 @@

break;
// token registrations
case '81':
address = new bch.Address(
hash,
'livenet',
'pubkeyhash'
).toCashAddress();
address = cashaddr.encode(
'bitcoincash',
'P2PKH',
Uint8Array.from(hash)
);
address = this.toSlpAddress(address);
break;
case '82':
address = new bch.Address(
hash,
'livenet',
'scripthash'
).toCashAddress();
address = cashaddr.encode('bitcoincash', 'P2SH', Uint8Array.from(hash));
address = this.toSlpAddress(address);
break;

@@ -423,2 +417,3 @@

);
address = this.toSlpAddress(address);
break;

@@ -438,5 +433,7 @@ }

const split = this.splitHandle(handle);
const { username, number, collision } = split;
let accountNumber = parseInt(number);
const height = genesisBlock + accountNumber;

@@ -461,2 +458,3 @@

const response = await axios.get(`https://bitdb.bch.sx/q/${urlString}`);
if (response.data === undefined) {

@@ -694,4 +692,2 @@ throw new Error('error bitdb lookup');

}
console.log('test', s.toString());
return s;

@@ -857,3 +853,2 @@ }

}
return {

@@ -860,0 +855,0 @@ username: handle[0],

{
"name": "cashaccounts",
"version": "0.4.6",
"version": "0.5.0",
"description": "decentralized identity system for bitcoin cash by Jonathan Silverblood",

@@ -17,3 +17,2 @@ "main": "index.js",

"bitcoincashjs-lib": "https://github.com/Bitcoin-com/bitcoincashjs-lib.git",
"bitcore-lib-cash": "https://github.com/paOol/bitcore-lib-cash.git",
"cashaddrjs": "^0.3.3"

@@ -20,0 +19,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