{"id":27429370,"url":"https://github.com/byteball/obyte-http-client","last_synced_at":"2025-04-14T14:17:26.683Z","repository":{"id":72989816,"uuid":"454856714","full_name":"byteball/obyte-http-client","owner":"byteball","description":"HTTP client for accessing Obyte data","archived":false,"fork":false,"pushed_at":"2024-05-29T12:24:54.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T14:17:23.007Z","etag":null,"topics":["api","dag","directed-acyclic-graph","distributed-ledger-technology","dlt","obyte"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/byteball.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"custom":["https://kivach.org/repo/byteball/obyte-http-client"]}},"created_at":"2022-02-02T16:46:10.000Z","updated_at":"2024-05-29T12:24:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d89014ed-7173-40e3-9c76-4b80ea9244b3","html_url":"https://github.com/byteball/obyte-http-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fobyte-http-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fobyte-http-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fobyte-http-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byteball%2Fobyte-http-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byteball","download_url":"https://codeload.github.com/byteball/obyte-http-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894940,"owners_count":21179153,"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":["api","dag","directed-acyclic-graph","distributed-ledger-technology","dlt","obyte"],"created_at":"2025-04-14T14:17:24.714Z","updated_at":"2025-04-14T14:17:26.663Z","avatar_url":"https://github.com/byteball.png","language":"JavaScript","funding_links":["https://kivach.org/repo/byteball/obyte-http-client"],"categories":[],"sub_categories":[],"readme":"# Obyte http client\n\n## Install\n``yarn add obyte-http-client``\n\n## Use\n```js\nimport obyte from \"obyte-http-client\"\n```\n \n## Example\n\n### 1. Create an instance\n```js \nimport obyte from \"obyte-http-client\";\n\nexport default new obyte.Client({\n  testnet: true\n});\n```\n\n\n### 2. Use\n```js \nimport obyteClientInstance from \"...\"; \n\nconst witnesses = obyteClientInstance.getWitnesses();\n\n```\n\n## Methods\n\n### getWitnesses - Returns list of the current witnesses.\n\n```js\nconst witnesses = obyteClientInstance.getWitnesses(); // use cache\n\nconst witnesses = obyteClientInstance.getWitnesses(true); // update every time\n```\n\n### getPeers - Returns the list of the current peers.\n\n```js\nconst peers = obyteClientInstance.getPeers();\n```\n\n### getJoint - Request data of a specific unit.\n\n```js\nconst joint = obyteClientInstance.getJoint('k37Xlns198EHCtubX5X0kqbrnC9XYVTa0aFpR78gidM=');\n```\n\n### getLastMci - Get the last main chain index of the node you logged to.\n\n```js\nconst last_mci = obyteClientInstance.getLastMci();\n```\n\n### getHistory - Get the history of one or multiple addresses.\n\n```js\nconst history = obyteClientInstance.getHistory([\"ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q\"]);\n```\n\n### getAttestation - Get attestation unit id from a specific attested value.\n\n```js\nconst attestation = obyteClientInstance.getAttestation(\"H5EZTQE7ABFH27AUDTQFMZIALANK6RBG\", \"email\", \"obyte@obyte.org\");\n```\n\n### getAttestation - Get all attestations of a specific address.\n\n```js\nconst attestations = obyteClientInstance.getAttestations(\"ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q\");\n```\n\n### getDefinition - Get an address definition.\n\n```js\nconst definition = obyteClientInstance.getDefinition(\"TMWNLXR42CKIP4A774BQGNVBZAPHY7GH\");\n```\n\n### getBalances - Get balances from one or multiple addresses (max 100).\n\n```js\nconst balances = obyteClientInstance.getBalances([\"TMWNLXR42CKIP4A774BQGNVBZAPHY7GH\"]);\n```\n\n### getProfileUnits - Get profile unit ids from one or multiple addresses (max 100).\n\n```js\nconst profile_units = obyteClientInstance.getProfileUnits([\"TMWNLXR42CKIP4A774BQGNVBZAPHY7GH\"]);\n```\n\n### getDataFeed\n\n```js\nconst data = obyteClientInstance.getDataFeed([\"I2ADHGP4HL6J37NQAD73J7E5SKFIXJOT\"], \"timestamp\", \"none\");\n```\n\n### dryRunAa - Calculates the predicted outcome of an Autonomous Agent with a sample transaction.\n\n```js\nconst trigger = {\n  address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y', // sent from address\n  outputs: {\n    'base': 10000 // default AA bounce fee in bytes\n  },\n  data: {\n    'vest': true\n  }\n};\n\nconst result = obyteClientInstance.dryRunAa(\"TSDLQPZTSVDNC63G7YROC26CYCCZC4GO\", trigger);\n```\n\n### getAaStateVars - Get state variables of an Autonomous Agent.\n\n```js\nconst state_vars = obyteClientInstance.getAaStateVars(\"TSDLQPZTSVDNC63G7YROC26CYCCZC4GO\", \"proposal_1\");\n```\n\n### getAasByBaseAas - Get Autonomous Agents that are based on some Autonomous Agent.\n\n```js\nconst aas = obyteClientInstance.getAasByBaseAas(\"QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY\"); // or [\"QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY\"]\n\n```\n\n### getAaResponses - Get latest Autonomous Agent responses.\n\n```js\nconst responses = obyteClientInstance.getAaResponses(\"PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4\"); // or [\"PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4\"]\n```\n\n### getAaResponseChain\n\n```js\nconst response_chain = obyteClientInstance.getAaResponseChain(\"QjJsukONZ57VBVtLk/0ak1jMYNW0vw7q0So95KBJH2k=\");\n```\n\n### executeGetter - Execute AA getter function\n\n```js\nconst result = obyteClientInstance.executeGetter(\"VLKI3XMMX5YULOBA6ZXBXDPI6TXF6V3D\", \"get_exchange_result\", [0, 100]);\n```\n\n## Donations\n\nTo support our work, donate through kivach.org.\n\n[![Kivach](https://kivach.org/api/banner?repo=byteball/obyte-http-client)](https://kivach.org/repo/byteball/obyte-http-client)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fobyte-http-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyteball%2Fobyte-http-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyteball%2Fobyte-http-client/lists"}