mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2026-02-19 01:17:07 +00:00
TypeScript library for using Haveno
- TypeScript 99.2%
- Dockerfile 0.3%
- JavaScript 0.3%
- Shell 0.2%
| .github | ||
| config | ||
| dist | ||
| docker | ||
| docs | ||
| scripts | ||
| src | ||
| .editorconfig | ||
| .eslintignore | ||
| .eslintrc.json | ||
| .gitignore | ||
| .project | ||
| _config.yml | ||
| babel.config.js | ||
| jest.config.cjs | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
Haveno TypeScript Library
TypeScript library for using Haveno.
Sample code
import { HavenoClient } from "haveno-ts";
// create client connected to Haveno daemon
const alice = new HavenoClient("http://localhost:8080", "apitest");
// use Haveno daemon
const balances = await alice.getBalances();
const paymentAccounts = await alice.getPaymentAccounts();
const myOffers = await alice.getMyOffers("ETH");
const offers = await alice.getOffers("ETH", "BUY");
const trade = await alice.takeOffer(offers[0].getId(), paymentAccounts[0].getId());
// disconnect client
await alice.disconnect();
Sample application
See the sample application to start a Haveno daemon and connect to it from haveno-ts.
TypeDocs
See TypeDocs.
Run API Tests
See instructions.