@hertzflow/sdk-v2
v0.1.2
Published
TypeScript SDK for integrating with the HertzFlow protocol.
Downloads
112
Maintainers
Readme
@hertzflow/sdk-v2
TypeScript SDK for the HertzFlow protocol. Read markets, positions, orders, and submit transactions from viem-based applications.
Currently supported: BNB Smart Chain Testnet (chainId
97). BNB Smart Chain mainnet is planned.
Installation
npm install @hertzflow/sdk-v2 viem
# or
pnpm add @hertzflow/sdk-v2 viem
# or
yarn add @hertzflow/sdk-v2 viemviem is a peer dependency.
Quick Start
import { HertzFlowSDK } from "@hertzflow/sdk-v2";
const sdk = new HertzFlowSDK({
chainId: 97,
rpcUrl: "https://bsc-testnet-rpc.publicnode.com",
oracleUrl: "https://oracle-aggregator.testnet.htzfl.link",
statsUrl: "https://data-statistics-query.testnet.htzfl.link",
});
const markets = await sdk.markets.getMarkets();
const { tokensData } = await sdk.tokens.getTokensData();
const { pricesData } = await sdk.tokens.getTokenRecentPrices();
sdk.setAccount("0xYourAccount");
const { positionsData } = await sdk.positions.getPositions({
prices: pricesData ?? {},
marketsData: markets,
tokensData,
});For write transactions, supply a walletClient in the config (or call sdk.setWalletClient(walletClient)).
Documentation
Full API reference, configuration options, and trading examples:
https://hertzflow.gitbook.io/hertzflow-docs/tech-docs/hertzflow-sdk
Topics covered:
- SDK configuration and runtime methods
- Markets, tokens, positions, orders, trades
- Fee and gas estimation
- Event subscriptions
- Claims, referrals, and approvals
- Liquidity (HzLP / HzV) transactions
- Direct contract composition with exported ABIs
License
MIT
