{"id":22608993,"url":"https://github.com/bitfinexcom/bitfinex-terminal-order-book","last_synced_at":"2025-03-28T22:44:12.407Z","repository":{"id":141634091,"uuid":"322393738","full_name":"bitfinexcom/bitfinex-terminal-order-book","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-21T10:04:41.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-26T01:20:17.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bitfinexcom.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-17T19:33:10.000Z","updated_at":"2022-04-29T16:44:00.000Z","dependencies_parsed_at":"2023-03-13T10:30:27.903Z","dependency_job_id":null,"html_url":"https://github.com/bitfinexcom/bitfinex-terminal-order-book","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-terminal-order-book","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-terminal-order-book/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-terminal-order-book/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbitfinex-terminal-order-book/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bitfinex-terminal-order-book/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112641,"owners_count":20725300,"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":[],"created_at":"2024-12-08T15:10:30.685Z","updated_at":"2025-03-28T22:44:12.364Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitfinex-terminal-order-book\n\nBitfinex Orderbook Query API\n\n```\nnpm install bitfinex-terminal-order-book\n```\n\n## Usage\n\n```js\nconst buyer = dazaar.buy(card)\n\n// make sure to follow the payment guide\nbuyer.on('feed', function (feed) {\n  const o = new Orderbook(feed)\n})\n```\n\nSee https://github.com/bitfinexcom/bitfinex-terminal for more.\n\n## Orderbook API\n\n#### `const o = new Orderbook(feed, [pair])`\n\nCreate a new orderbook. `feed` should be a Hypercore and `pair` is the string key identifying the order book pair.\nYou only need to pass in `pair` if you plan to append to the feed.\n\nWhen using Dazaar, you'd get the feed from the `feed` event.\n\n```js\nbuyer.on('feed', function (feed) {\n  const o = new Orderbook(feed)\n})\n```\n\n#### `const book = await o.get(timestamp)`\n\nWill find the first orderbook snapshot `\u003e=` than the timestamp.\n\n#### `const stream = o.createReadStream([options])`\n\nMake a stream of snapshots. Options include:\n\n```js\n{\n  gte: \u003ctimestamp\u003e // find timestamps greater or equal to this\n  le: \u003ctimestamp\u003e, // find timestamps less than this\n  limit: \u003cnumber\u003e, // how many to get at max?\n  live: \u003cbool\u003e // keep the stream open?\n}\n```\n\nThe stream is also async iterable.\n\n#### `const { pair } = await o.info()`\n\nGet metadata about the orderbook. `pair` is the currency pair for it.\n\n#### `const book = await o.latest()`\n\nGet the latest entry added.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbitfinex-terminal-order-book","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbitfinex-terminal-order-book","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbitfinex-terminal-order-book/lists"}