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

melis-fork-claimer

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

melis-fork-claimer - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

4

package.json

@@ -6,3 +6,3 @@ {

"license": "ISC",
"version": "1.0.9",
"version": "1.0.10",
"main": "src/index.js",

@@ -26,4 +26,4 @@ "scripts": {

"dependencies": {
"melis-api-js": "^0.12.2"
"melis-api-js": "^0.12.3"
}
}

@@ -107,2 +107,6 @@ //

/*
BTC2: {
fork: 507850,
name "Bitcoin2"
}
B2X: {

@@ -957,2 +961,3 @@ fork: 501451,

const bchDriver = melis.getCoinDriver('BCH')
const maxSliceSize = 20
const res = {}

@@ -971,19 +976,40 @@

console.log("scanning account " + account.pubId + " type: " + account.type + " meta: " + JSON.stringify(account.meta))
const slice = await melis.addressesGet(account)
// console.log("slice result: " + slice.list)
if (!slice.list) {
console.log("No addresses on melis for account " + account.pubId)
continue
}
const addrs = slice.list.map(aa => bchDriver.toLegacyAddress(aa.address))
if (doDebug)
console.log("#Addresses: " + addrs.length + "\n", addrs)
const utxos = await this.queryUtxos(addrs, {
doDebug
})
if (doDebug)
console.log("utxos:", utxos)
if (utxos.length)
let numCheckedAddrs = 0
let slicePage = 0
let unspents = []
do {
const slice = await melis.addressesGet(account, {
page: slicePage++,
size: maxSliceSize
})
// console.log("slicePage: " + slicePage + " maxSliceSize: " + maxSliceSize + " slice result: ", slice)
if (!slice.list) {
console.log("No addresses on melis for account " + account.pubId)
break
}
const addrs = slice.list.map(aa => bchDriver.toLegacyAddress(aa.address))
if (doDebug)
console.log("slicePage: " + slicePage + " maxSliceSize: " + maxSliceSize + " #Addresses: " + addrs.length + "\n", addrs)
numCheckedAddrs += addrs.length
const utxos = await this.queryUtxos(addrs, {
doDebug
})
if (doDebug)
console.log("utxos:", utxos)
if (utxos.length)
unspents = unspents.concat(utxos)
if (!slice.hasNext)
break
} while (true)
console.log("#unspents found: " + unspents.length + " numCheckedAddrs: " + numCheckedAddrs + " slices used: " + slicePage + " (sliceSize:" + maxSliceSize + ")")
if (unspents.length)
res[account.pubId] = {
utxos,
utxos: unspents,
account

@@ -990,0 +1016,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