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

wallet-tx-scanner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wallet-tx-scanner - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

57

lib/index.js

@@ -34,2 +34,5 @@ const axios = require('axios');

url: 'https://api-arbitrum.etherscan.io/api'
},
bitcoin: {
url: 'https://blockchain.info/rawaddr/'
}

@@ -54,23 +57,39 @@ };

try {
const { key, url } = this.protectedKeys[network];
const response = await axios.get(url, {
params: {
module: 'account',
action: 'txlist',
address,
apikey: key
}
});
if (!response.data.result || response.data.result.length === 0) {
return {
success: false,
message: 'No transactions found'
};
switch (network) {
case 'bitcoin':
const resBitcoin = await axios.get(`${this.protectedKeys[network].url}${address}`);
if (!resBitcoin.data.txs || resBitcoin.data.txs.length === 0) {
return {
success: false,
message: 'No transactions found'
};
}
return {
success: true,
data: resBitcoin.data.txs
};
default:
const { key, url } = this.protectedKeys[network];
const response = await axios.get(url, {
params: {
module: 'account',
action: 'txlist',
address,
apikey: key
}
});
if (!response.data.result || response.data.result.length === 0) {
return {
success: false,
message: 'No transactions found'
};
}
return {
success: true,
data: response.data.result
};
}
return {
success: true,
data: response.data.result
};
} catch (error) {

@@ -77,0 +96,0 @@ return {

{
"name": "wallet-tx-scanner",
"version": "1.0.0",
"version": "1.0.1",
"description": "Helps to quickly retrieve transactions from the blockchain knowing only the wallet address",

@@ -24,3 +24,3 @@ "main": "./lib/index.js",

"dependencies": {
"axios": "^1.4.0",
"axios": "^1.5.0",
"axios-mock-adapter": "^1.21.5",

@@ -27,0 +27,0 @@ "chai": "^4.3.7"

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