@hashpower/oracle-abi
v3.0.0
Published
ABIs and deployment addresses for the Hashpower hashprice oracle contracts (HashpriceBTC, HashpriceUSD) on Base
Maintainers
Readme
@hashpower/oracle-abi
ABIs and deployment addresses for the Hashpower hashprice oracle contracts on Base.
Both oracles implement Chainlink's AggregatorV3Interface — read the live price with latestRoundData():
| Contract | answer meaning | Decimals |
| --- | --- | --- |
| HashpriceUSD | 100 TH/s/day in USD | 8 |
| HashpriceBTC | 100 TH/s/day in satoshis | 8 |
Usage
import { HashpriceUSDAbi } from "@hashpower/oracle-abi";
import deployments from "@hashpower/oracle-abi/deployments.json" with { type: "json" };
// "testnet" (Base Sepolia) or "mainnet" (Base)
const env = process.env.HASHPOWER_ENV ?? "testnet";
const { contracts } = deployments.environments[env];
const [, answer] = await client.readContract({
address: contracts.HashpriceUSD,
abi: HashpriceUSDAbi,
functionName: "latestRoundData",
});Raw JSON ABIs (for subgraphs and non-TypeScript consumers) are available under @hashpower/oracle-abi/json/<Contract>.json.
Historical data
Query the oracles subgraph (URLs in deployments.json under environments.<env>.subgraphs.oracles) for hashprice history and candles.
How this package is built
Contents are generated — do not edit by hand:
src/is copied from../contracts/abi(the Hardhat codegen output, drift-checked in CI) byscripts/build.mjs, then compiled todist/.deployments.jsonis the canonical address manifest for this repo; it is updated when contracts are (re)deployed.
Publishing happens from CI (see .github/workflows/publish-oracle-abi.yml). A dev publish updates environments.testnet and is tagged dev (minor bump). A main publish updates environments.mainnet and is tagged latest; the first mainnet cut is 3.0.0, skipping any major npm has already used.
