{"id":15045035,"url":"https://github.com/haveno-dex/haveno-ts","last_synced_at":"2025-04-05T20:07:17.625Z","repository":{"id":37088584,"uuid":"361567915","full_name":"haveno-dex/haveno-ts","owner":"haveno-dex","description":"TypeScript library for using Haveno","archived":false,"fork":false,"pushed_at":"2025-03-18T21:08:18.000Z","size":27537,"stargazers_count":36,"open_issues_count":4,"forks_count":34,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T19:04:26.755Z","etag":null,"topics":["api","grpc","haveno","typescript"],"latest_commit_sha":null,"homepage":"https://haveno-dex.github.io/haveno-ts/classes/HavenoClient.HavenoClient.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haveno-dex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://haveno.exchange/sponsors/"}},"created_at":"2021-04-26T00:09:29.000Z","updated_at":"2025-03-18T21:08:23.000Z","dependencies_parsed_at":"2023-10-11T12:46:32.339Z","dependency_job_id":"cf67b8ab-a5a6-4989-be0a-7e642fd5bc7e","html_url":"https://github.com/haveno-dex/haveno-ts","commit_stats":{"total_commits":391,"total_committers":16,"mean_commits":24.4375,"dds":0.07928388746803072,"last_synced_commit":"e9f527793fa7bd83d79cafadf324e8a7aa2ce606"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haveno-dex%2Fhaveno-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haveno-dex%2Fhaveno-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haveno-dex%2Fhaveno-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haveno-dex%2Fhaveno-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haveno-dex","download_url":"https://codeload.github.com/haveno-dex/haveno-ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393569,"owners_count":20931812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","grpc","haveno","typescript"],"created_at":"2024-09-24T20:51:22.445Z","updated_at":"2025-04-05T20:07:17.604Z","avatar_url":"https://github.com/haveno-dex.png","language":"TypeScript","funding_links":["https://haveno.exchange/sponsors/"],"categories":[],"sub_categories":[],"readme":"# Haveno TypeScript Library\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/haveno-dex/haveno-ts/build.yml?branch=master)\n[![Twitter Follow](https://img.shields.io/twitter/follow/HavenoDEX?style=social)](https://twitter.com/havenodex)\n[![Matrix rooms](https://img.shields.io/badge/Matrix%20room-%23haveno-blue)](https://matrix.to/#/#haveno:monero.social)\n\nTypeScript library for using Haveno.\n\n## Sample code\n\n```js\nimport { HavenoClient } from \"haveno-ts\";\n\n// create client connected to Haveno daemon\nconst alice = new HavenoClient(\"http://localhost:8080\", \"apitest\");\n\n// use Haveno daemon\nconst balances = await alice.getBalances();\nconst paymentAccounts = await alice.getPaymentAccounts();\nconst myOffers = await alice.getMyOffers(\"ETH\");\nconst offers = await alice.getOffers(\"ETH\", \"BUY\");\nconst trade = await alice.takeOffer(offers[0].getId(), paymentAccounts[0].getId());\n\n// disconnect client\nawait alice.disconnect();\n```\n\n## Sample application\n\nSee the [sample application](https://github.com/haveno-dex/haveno-sample-app) to start a Haveno daemon and connect to it from haveno-ts.\n\n## TypeDocs\n\nSee [TypeDocs](https://haveno-dex.github.io/haveno-ts/classes/HavenoClient.HavenoClient.html).\n\n## Run tests\n\nRunning the [API tests](./src/HavenoClient.test.ts) is the best way to develop and test Haveno end-to-end. [`HavenoClient.ts`](./src/HavenoClient.ts) provides the client interface to Haveno's backend daemon.\n\nYou first need to start a local Haveno network which can be done manually or using docker.\n\n### Start local Haveno network manually\n\nThis workflow is useful for local development of `haveno` and `haveno-ts`\n\n1. [Run a local Haveno test network](https://github.com/haveno-dex/haveno/blob/master/docs/installing.md) and then shut down the arbitrator, user1, and user2 or run them as daemons, e.g. `make user1-daemon-local`. You may omit the arbitrator registration steps since it's done automatically in the tests.\n2. Clone this project to the same parent directory as the haveno project: `git clone https://github.com/haveno-dex/haveno-ts`\n3. Install `envoy` proxy from your package manager of choice, for example `brew install envoy`.\n4. In a new terminal, start envoy with the config in haveno-ts/config/envoy.local.yaml: `envoy -c config/envoy.local.yaml`\n5. In a new terminal, start the funding wallet. This wallet will be funded automatically in order to fund the tests.\u003cbr\u003eFor example: `cd ~/git/haveno \u0026\u0026 make funding-wallet-local`.\n\n### Start local Haveno network with docker\n\nAlternatively use this wokflow to develop `haveno-ts` or run tests with dockerized setup:\n\nStart a local Haveno network with docker:\n\n1. `cd ~/git/haveno-ts/docker`\n2. `sudo docker-compose up`. This will start docker and initialize the network.\n\n\u003e **Docker Tips**\n\u003e * Stop: `sudo docker-compose stop`\n\u003e * Rebuild: `sudo docker-compose build`\n\u003e * Stop and delete contains: `sudo docker-compose stop`\n\n### Run client tests\n\n5. Install protobuf compiler [v29.3](https://github.com/protocolbuffers/protobuf/releases/tag/v29.3) for your system.\n6. Download `protoc-gen-js` and `protoc-gen-grpc-web` plugins and make executable as [shown here](https://github.com/grpc/grpc-web#code-generator-plugins).\n7. `cd haveno-ts`\n8. `npm install`\n9. `npm run test -- --baseCurrencyNetwork=XMR_LOCAL` to run all tests or `npm run test -- --baseCurrencyNetwork=XMR_LOCAL -t \"Can get the version\"` to run tests by name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaveno-dex%2Fhaveno-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaveno-dex%2Fhaveno-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaveno-dex%2Fhaveno-ts/lists"}