{"id":19149562,"url":"https://github.com/zeriontech/defi-sdk-js","last_synced_at":"2025-10-26T12:04:00.235Z","repository":{"id":37855228,"uuid":"249757899","full_name":"zeriontech/defi-sdk-js","owner":"zeriontech","description":"JavaScript/TypeScript wrapper for DeFi SDK","archived":false,"fork":false,"pushed_at":"2024-04-25T19:20:53.000Z","size":4031,"stargazers_count":47,"open_issues_count":5,"forks_count":21,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-26T19:25:21.832Z","etag":null,"topics":["dapp","defi","defi-sdk","ethereum"],"latest_commit_sha":null,"homepage":"https://docs.zerion.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeriontech.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-03-24T16:22:00.000Z","updated_at":"2024-05-28T21:21:25.535Z","dependencies_parsed_at":"2023-10-04T14:59:29.446Z","dependency_job_id":"c1665893-94f2-48b4-9d6b-80ea316506a5","html_url":"https://github.com/zeriontech/defi-sdk-js","commit_stats":{"total_commits":148,"total_committers":5,"mean_commits":29.6,"dds":"0.29054054054054057","last_synced_commit":"756a5870fa30940bb2f89cf8f6204585d887c5a1"},"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeriontech%2Fdefi-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeriontech","download_url":"https://codeload.github.com/zeriontech/defi-sdk-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230072183,"owners_count":18168372,"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":["dapp","defi","defi-sdk","ethereum"],"created_at":"2024-11-09T08:08:43.048Z","updated_at":"2025-10-26T12:04:00.154Z","avatar_url":"https://github.com/zeriontech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# defi-sdk\n\n\u003cdiv\u003e\n  \u003ca href=\"https://www.npmjs.com/package/defi-sdk\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/defi-sdk\" alt=\"Download on NPM\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n\u003c/div\u003e\n\nA JS client for interacting with [Zerion API](https://github.com/zeriontech/zerion-api)\n\n## Install\n\n```sh\nnpm install defi-sdk\n```\n\n## Getting Started\n\n```js\nimport { client } from \"defi-sdk\";\n\nclient.configure({ url: endpoint, apiToken: API_TOKEN });\n```\n\n## API\n\n### General usage\n\n### client.subscribe(options)\n\n```js\nimport { client } from \"defi-sdk\";\n\nclient.subscribe({\n  namespace: \"assets\",\n  body: {\n    scope: [\"prices\"],\n    payload: { asset_codes: [\"eth\"], currency: \"usd\" }\n  },\n  onMessage: (event: Event, data: Response) =\u003e {\n    /* handle data */\n  }\n});\n```\n\n- `namespace`: a [`Namespace`](https://docs.zerion.io/websockets/namespaces) string\n- `event`: one of `received | changed | appended | removed`, see [Zerion Docs](https://docs.zerion.io/websockets/websocket-api-overview)\n- `body`: a [`Request`](#Request) object\n- `data`: a [`Response`](#Response) object\n\n## Domain Helpers\n\nInstead of calling `client.subscribe` and passing type information manually, the SDK provides helpers for most of the existing request [scopes](https://docs.zerion.io/websockets/websocket-api-overview#request)\n\n### `addressAssets`\n\n```js\nimport { client } from \"defi-sdk\";\n\nclient.addressAssets({\n  payload: { asset_codes: [\"eth\"], currency: \"usd\" },\n  onData: data =\u003e {\n    /* handle data */\n  }\n});\n```\n\n## Types\n\n### Request\n\n```ts\ninterface Request\u003cT, ScopeName extends string\u003e {\n  scope: ScopeName[];\n  payload: T;\n}\n```\n\n### Response\n\n```ts\ninterface Response\u003cT\u003e {\n  meta: any;\n  payload: T;\n}\n```\n\nSee `Response` in [Zerion Docs](https://docs.zerion.io/websockets/websocket-api-overview#response)\n\n## License\n\nMIT License, see the included [LICENSE](LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeriontech%2Fdefi-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeriontech%2Fdefi-sdk-js/lists"}