{"id":22994262,"url":"https://github.com/jccdex/jcc_rpc","last_synced_at":"2025-08-13T22:31:32.983Z","repository":{"id":32870379,"uuid":"143134886","full_name":"JCCDex/jcc_rpc","owner":"JCCDex","description":"A javascript restful api for interacting with the jingchang server","archived":false,"fork":false,"pushed_at":"2023-01-04T21:37:13.000Z","size":1486,"stargazers_count":5,"open_issues_count":18,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-13T19:57:17.791Z","etag":null,"topics":["cross-chain","dex","javascript","jccdex","rest-api","rpc"],"latest_commit_sha":null,"homepage":"","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/JCCDex.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}},"created_at":"2018-08-01T09:32:55.000Z","updated_at":"2021-08-09T07:05:28.000Z","dependencies_parsed_at":"2023-01-14T22:29:29.073Z","dependency_job_id":null,"html_url":"https://github.com/JCCDex/jcc_rpc","commit_stats":null,"previous_names":["jccdex/jc_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCCDex%2Fjcc_rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCCDex%2Fjcc_rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCCDex%2Fjcc_rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JCCDex%2Fjcc_rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JCCDex","download_url":"https://codeload.github.com/JCCDex/jcc_rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229783667,"owners_count":18123530,"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":["cross-chain","dex","javascript","jccdex","rest-api","rpc"],"created_at":"2024-12-15T05:17:39.260Z","updated_at":"2024-12-15T05:17:39.872Z","avatar_url":"https://github.com/JCCDex.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jcc_rpc\n\n![npm](https://img.shields.io/npm/v/jcc_rpc.svg)\n[![Build Status](https://travis-ci.com/JCCDex/jcc_rpc.svg?branch=master)](https://travis-ci.com/JCCDex/jcc_rpc)\n[![Coverage Status](https://coveralls.io/repos/github/JCCDex/jcc_rpc/badge.svg?branch=master)](https://coveralls.io/github/JCCDex/jcc_rpc?branch=master)\n[![npm downloads](https://img.shields.io/npm/dm/jcc_rpc.svg)](http://npm-stat.com/charts.html?package=jcc_rpc)\n\n## Installation\n\n```javascript\nnpm install jcc_rpc\n```\n\n## Docs\n\nsee [docs](https://github.com/JCCDex/jcc_rpc/tree/master/docs)\n\n## SubscribeTask\n\nAdded [`SubscribeTask`](https://github.com/JCCDex/jcc_rpc/blob/master/src/subscribe.ts) class since v0.2.3.\n\n```javascript\n// By requesting config as an example\n\nconst { SubscribeFactory, ConfigFactory } = require(\"jcc_rpc\");\n\nconst configInst = ConfigFactory.init([\"https://jccdex.cn\"]);\n\nconst subscribeInst = SubscribeFactory.init();\n\n// task name\nconst TASK_NAME = \"pollingConfig\";\n// task function\nconst task = configInst.getConfig.bind(configInst);\n// whether polling, default true\nconst polling = true;\n// polling interval, default 5000(ms)\nconst timer = 10000;\n\nconst callback = (err, res) =\u003e {\n  console.log(err);\n  console.log(res);\n};\n\nsubscribeInst\n  // register task\n  .register(TASK_NAME, task, polling, timer)\n  // watch task\n  .on(TASK_NAME, callback)\n  // start task\n  .start(TASK_NAME)\n  // stop polling given task\n  .stopPolling(TASK_NAME)\n  // remove given task\n  .removeTask(TASK_NAME)\n  // remove all tasks\n  .removeAll()\n  // stop polling all tasks\n  .stopAll()\n  // cancel watch\n  .off(TASK_NAME, callback);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjccdex%2Fjcc_rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjccdex%2Fjcc_rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjccdex%2Fjcc_rpc/lists"}