cashaccounts
Advanced tools
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 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
6
2
2
29471
874