{"id":22608969,"url":"https://github.com/bitfinexcom/bfx-api-mock-srv","last_synced_at":"2025-04-11T06:15:06.485Z","repository":{"id":52463816,"uuid":"113883501","full_name":"bitfinexcom/bfx-api-mock-srv","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-25T08:05:35.000Z","size":144,"stargazers_count":5,"open_issues_count":2,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-11T06:15:00.738Z","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":"CHANGELOG","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":"2017-12-11T16:42:23.000Z","updated_at":"2021-11-18T12:47:19.000Z","dependencies_parsed_at":"2022-09-06T13:20:55.840Z","dependency_job_id":"2f0c72cb-dade-47b8-8d62-904687eae2a4","html_url":"https://github.com/bitfinexcom/bfx-api-mock-srv","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-mock-srv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-mock-srv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-mock-srv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-api-mock-srv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-api-mock-srv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351393,"owners_count":21089272,"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:24.194Z","updated_at":"2025-04-11T06:15:06.462Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitfinex API Mock Server\n\nThis repo hosts mock servers for the WSv2 and RESTv2 Bitfinex APIs, and is\nintended for testing the Bitfinex API libraries.\n\n### Features\n\n* Provides realistic API responses for WSv2\n* Provides configurable responses for RESTv2\n* Allows for basic testing of API libraries without a live API connection\n\n### Installation\n\n```bash\nnpm i --save bfx-api-mock-srv\n```\n\n### Quickstart \u0026 Example\n\n```js\nconst assert = require('assert')\nconst debug = require('debug')('bfx:api:mock-srv:examples:endpoint-test')\nconst { MockRESTv2Server } = require('bfx-api-mock-srv')\nconst { RESTv2 } = require('bfx-api-node-rest')\n\ndebug('spawning mock server...')\n\nconst srv = new MockRESTv2Server({ listen: true })\nconst rest = new RESTv2({\n  apiKey: 'dummy',\n  apiSecret: 'dummy',\n  url: 'http://localhost:9999',\n})\n\nconst fundingOffer = [\n  41215275, 'fUSD', 1524784806000, 1524784806000, 1000, 1000, 'FRRDELTAVAR',\n  null, null, 0, 'ACTIVE', null, null, null, 0, 30, 0, 0, null, 0, 0.00207328\n]\n\nsrv.setResponse('f_offers.fUSD', [fundingOffer])\n\ndebug('requesting preset response...')\n\nrest.fundingOffers('fUSD').then(([incomingFundingOffer]) =\u003e {\n  assert.deepStrictEqual(incomingFundingOffer, fundingOffer)\n\n  debug('correct response received')\n  srv.close()\n}).catch((e) =\u003e {\n  debug(`error: ${e.message}`)\n})\n```\n\n### Docs\n\n* See [`docs/reference.md`](docs/reference.md) for API documentation\n* Refer to [`examples/`](examples) for executable examples\n\n### Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-api-mock-srv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-api-mock-srv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-api-mock-srv/lists"}