EVM Explorer TypeScript Climate SDK.
This repository provides TypeScript types and functions for fetching data regarding energy consumption and carbon emissions related to popular cryptocurrencies such as Bitcoin, Ethereum, and Dogecoin, as well as Dovu carbon credit data.
- BitcoinDogeEnergy
- EthereumEnergy
- AddressDovu
- PriceDovu
- MarketDebtDovu
- fetchBitcoin(date: string): Promise
- fetchDogecoin(date: string): Promise
- fetchEthereum(date: string): Promise
- fetchAddressDovu(address: string): Promise
- fetchPriceDovu(): Promise
- fetchMarketDebtDovu(): Promise
npm install @evmexplorer/climate
or
yarn add @evmexplorer/climate
To fetch energy-related data for Bitcoin, Ethereum, or Dogecoin, you can use the respective fetch functions:
import { fetchBitcoin } from '@evmexplorer/climate';
// Example to fetch Bitcoin data for a specific date
const bitcoinData = await fetchBitcoin('20250301');
console.log(bitcoinData);
To fetch carbon credit data related to specific addresses or general market debt:
import {
fetchAddressDovu,
fetchPriceDovu,
fetchMarketDebtDovu,
} from '@evmexplorer/climate';
// Example to fetch the Dovu carbon compensation data for an address
const addressDovu = await fetchAddressDovu(
'0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
);
console.log(addressDovu);
// Fetch the current price of Dovu carbon credits
const dovuPrice = await fetchPriceDovu();
console.log(dovuPrice);
// Fetch market debt details of Dovu
const marketDebt = await fetchMarketDebtDovu();
console.log(marketDebt);
type BitcoinDogeEnergy = {
'24hr_kWh': string;
'24hr_kgCO2': string;
Output_kWh: string;
Output_kgCO2: string;
};
type EthereumEnergy = {
'24hr_kWh': string;
'24hr_kgCO2': string;
Gas_unit_Wh: string;
Gas_unit_gCO2: string;
};
type AddressDovu = {
account: string;
address_carbon_emissions: number;
address_gas_used: number;
address_transaction_count: number;
dov_per_kg: number;
dov_price: number;
dov_to_buy: number;
};
type PriceDovu = {
currency: string;
price: number;
quote_created_at: string;
ticker_symbol: string;
};
type MarketDebtDovu = {
date: string;
total_gas: number;
gas_used: number;
day_change: number;
percent_day_change: number;
total_carbon_debt: number;
day_carbon_debt: number;
day_change_carbon_debt: number;
cost_to_offset: number;
};
EVM Explorer Climate Smart Contracts Page
EVM Explorer - Tracking Smart Contract Transaction Data