# blocksage

> A Web3 intelligence tool for analyzing blockchain data, now enhanced with additional functionalities.

Latest version **1.0.1** (published 2024-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install blocksage
pnpm add blocksage
yarn add blocksage
bun add blocksage
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-03-03 |
| First published | 2024-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | octo44 |
| Maintainers | octo44 |

## Links

- npm: https://www.npmjs.com/package/blocksage
- Repository: https://github.com/octo44/blocksage
- Issues: https://github.com/octo44/blocksage/issues
- npm.io page: https://npm.io/package/blocksage

## Dependencies (5)

- [web3](https://npm.io/package/web3.md) ^1.3.5
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [winston](https://npm.io/package/winston.md) ^3.3.3
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.1

## Recent versions

- 1.0.1 (latest) — 2024-03-03

## README

# BlockSage

BlockSage is a Web3 intelligence tool designed to enhance your blockchain data analysis. It utilizes several key dependencies to provide precise token metrics, secure environment management, external data fetching, and extensive logging capabilities.

## Features

- Token Metrics: Fetch and calculate token decimals and total supply.
- Wallet Token Balance: Retrieve the balance of a specific token for any wallet.
- Current ETH Price: Fetch the current Ethereum price from external APIs.
- Extensive Logging: Keep track of operations and errors through detailed logs.

## Installation

npm install blocksage

## Usage
First, ensure you have a .env file with your Web3 provider URL:

WEB3_PROVIDER_URL=https://mainnet.infura.io/v3/YOUR_PROJECT_ID

Then, you can use BlockSage as follows:

const BlockSage = require('blocksage');
const sage = new BlockSage(process.env.WEB3_PROVIDER_URL);

// Fetch token metrics
async function getTokenMetrics() {
    const metrics = await sage.getTokenMetrics('<TOKEN_ADDRESS>');
    console.log(metrics);
}

// Get wallet token balance
async function getWalletTokenBalance() {
    const balance = await sage.getWalletTokenBalance('<WALLET_ADDRESS>', '<TOKEN_ADDRESS>');
    console.log(balance);
}

// Fetch current ETH price
async function getCurrentEthPrice() {
    const price = await sage.fetchCurrentEthPrice();
    console.log(price);
}

getTokenMetrics();
getWalletTokenBalance();
getCurrentEthPrice();

---
_Source: https://npm.io/package/blocksage · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
