{"id":23263218,"url":"https://github.com/wavesplatform/data-service-client-js","last_synced_at":"2025-10-06T17:09:42.493Z","repository":{"id":32066242,"uuid":"131414209","full_name":"wavesplatform/data-service-client-js","owner":"wavesplatform","description":"JS library for https://github.com/wavesplatform/data-service","archived":false,"fork":false,"pushed_at":"2023-01-05T03:09:08.000Z","size":2655,"stargazers_count":11,"open_issues_count":18,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-20T18:55:14.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-28T13:59:15.000Z","updated_at":"2024-11-05T17:21:43.000Z","dependencies_parsed_at":"2023-01-14T20:30:37.513Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/data-service-client-js","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/wavesplatform/data-service-client-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fdata-service-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fdata-service-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fdata-service-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fdata-service-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/data-service-client-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fdata-service-client-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278646783,"owners_count":26021512,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-19T14:15:28.324Z","updated_at":"2025-10-06T17:09:42.440Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# JS Library for Waves data services\n\n## Usage\n\n```typescript\nconst DataServiceClient = require('@waves/data-service-client-js').default;\n\n// Initialization\nconst client = new DataServiceClient({\n  rootUrl: 'http://api.wavesplatform.com/v0',\n  fetch: req =\u003e window.fetch(req).then(res =\u003e res.text()), // fetch must return string\n  parse: str =\u003e JSON.parse(str),\n});\n\n// Fetching\n(async () =\u003e {\n  const { data } = await client.getAssets('WAVES'); // data: Asset {}\n})();\n```\n\n## Methods\n\n### Response format\n\n`{ data, ...meta }`\n\n### All methods do GET requests, until query is under 2k symbols, then automatically switch to POST\n\n- getAssets:\n\n```typescript\nawait client.getAssets('WAVES'); // One { data: Asset }\nawait client.getAssets('WAVES', '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS'); // Or many { data: Asset[] }\nawait client.getAssetsByTicker('WAVES');  // Many { data: Asset[] }\nawait client.getAssetsByTicker('*');  // Many { data: Asset[] } - all assets\n```\n\n- getPairs\n\n```typescript\nconst getPairs = client.getPairs('MATCHER_ID'); // set up DEX matcher\nawait getPairs([\n  'WAVES/8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS',\n  'WAVES/474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu'\n]); // get pairs\n```\n\n- getExchangeTxs:\n\n```typescript\nawait client.getExchangeTxs('8rEwYY4wQ4bkEkk95EiyeQnvnonX6TAnU6eiBAbVSADk'); // By id { data: Tx }\nawait client.getExchangeTxs({\n  timeStart?: string | Date | number;\n  timeEnd?: string | Date | number;\n  matcher?: string;\n  sender?: string;\n  amountAsset?: string | Asset;\n  priceAsset?: string | Asset;\n  limit?: number;\n  sort?: 'asc'|'desc';\n}); // With filters { data: Tx[] }\nawait client.getExchangeTxs(); // Top 100 with default filters (timeStart = timestamp of first entry in db, timeEnd = now)\n```\n\n- aliases:\n\n```typescript\nconst alias1 = await client.aliases.getById('@askerych');\n/*\n  { data: {\n      address: '3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M',\n      alias: '@askerych'\n    }\n  }\n  */\nconst alias2 = await client.aliases.getByAddress(\n  '3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M'\n);\n/*\n  { data: [{\n      address: '3P5uMgn1xvrm7g3sbUVAGLtetkNUa1AHn2M',\n      alias: '@askerych'\n    }]\n  }\n  */\n```\n\n- getCandles:\n\n```typescript\nawait client.getCandles(amountAsset: string, priceAsset: string, {\n  timeStart: string | Date | number;\n  timeEnd?: string | Date | number;\n  interval: string; // interval pattern is xy, where x - number, y - one of m (minutes), h (hours), d (days), M (Month)\n});\nawait client.getCandles('WAVES', '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS', {\n  timeStart: '2018-12-01',\n  timeEnd: '2018-12-31',\n  interval: '1d'\n});\n```\n\n## Pagination\n\n```typescript\ntype Response\u003cT\u003e = {\n  data: T;\n  fetchMore?: TFunction;\n};\nconst response1 = await client.getExchangeTxs({ limit: 1, sort: 'asc' });\nconst data1 = response1.data;\n// Process data\n\nconst response2 = await res1.fetchMore(2); // 2 more\n```\n\n## Custom init params\n\nYou can set custom fetcher, parser and transformer for library.\n\n```typescript\ntype TLibOptions = {\n  rootUrl: string;\n  fetch?: TFunction;\n  parse?: TParser;\n  transform?: TFunction;\n};\n```\n\nThe path is fetch -\u003e parse -\u003e transform\n\n### Fetch must return string!\n\nFetch accepts (url, options)\nFetch by default is `fetch(...).then(res =\u003e res.text())`\n\nParse by default is `JSON.parse.bind(JSON)` , you can use `json-bigint`'s parse if you want to add support for bignumbers.\n\nTransform function has next signature by default (it depends on your parse function):\n\n```\n({\n  __type,\n  data,\n  ...rest\n}) =\u003e any\n```\n\nBasically you can switch on \\_\\_type and do transformations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fdata-service-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fdata-service-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fdata-service-client-js/lists"}