A JS daemon client for chia rpc with dynamically generated end points

Downloads in past


1610.6.010 days ago4 months agoMinified + gzip package size for chia-daemon in KB


Version Version Monthly Downloads Total Downloads A JS client for chia daemon with dynamically generated end points

Getting Started

```bash npm install npm test ```


Basic Usage

Each service is a field on the services property of the ChiaDaemon.
  • Since all service calls go through the daemon there is no need for other endpoint configuration
  • All RPC calls are async
  • Since all rpc call are dyanmically invoked there is no need to update the library with new chia release.
(i.e. if you invoke it will call make an RPC to a function named foo at that endpoint and error if it doesn't exist there) ```javascript import { ChiaDaemon, loadUIConfig } from 'chia-daemon'; const daemon = new ChiaDaemon(loadUIConfig(), 'my-chia-app'); const connected = await daemon.connect(); if (connected) {
const state = await;
} ```

Payload Helpers

Includes helper functions to get request payloads right:

Get the OpenAPI responseBody Schema Descriptor

```javascript console.log(daemon.fullnode.getPayloadDescriptor('openconnection')); { type: 'object', required: 'ip', 'port' , properties: {
ip: { type: 'string', format: 'ipaddress' },
port: { type: 'integer' }
} } ```

Get a Payload Object Instance

```javascript const connection = daemon.fullnode.makePayload('openconnection'); console.log(payload); { ip: '', port: 0 } connection.ip = ''; connection.port = 4444; await daemon.fullnode.openconnection(connection); ```