@azpool/chia-client
Version:
TypeScript client for Chia node peer RPC interface
52 lines (37 loc) • 1.29 kB
Markdown
TypeScript client for communicating with [Chia](https://www.chia.net/) RPC interfaces. All API calls return promises.
Edit from [chia-client](https://github.com/freddiecoleman/chia-client) by Freddie Coleman
```shell
chia.host : CHIA__HOSTNAME || '0.0.0.0'
chia.ca_cert_path: CHIA__CA_CERT_PATH || false
chia.fullnode.port: CHIA__FULLNODE__PORT || 8555
chia.fullnode.cert_path : CHIA__FULLNODE__CERT_PATH
chia.fullnode.key_path : CHIA__FULLNODE__KEY_PATH
chia.wallet.port: CHIA__WALLET__PORT || 9256
chia.wallet.cert_path : CHIA__WALLET__CERT_PATH
chia.wallet.key_path : CHIA__WALLET__KEY_PATH
chia.wallet.backup_host : CHIA__WALLET__BACKUP_HOST || 'https://backup.chia.net'
```
```
const { FullNode } = require('@azpool/chia-client');
const fullNode = new FullNode({
protocol: 'http',
hostname: 'localhost',
port: 8555
});
const blockchain = await fullNode.getBlockchainState();
```
```
import { Wallet } = require('@azpool/chia-client');
const wallet = new Wallet({
protocol: 'http',
hostname: 'localhost',
port: 8555
});
const mnemonic = await wallet.generateMnemonic();
```
This client is provided by [Chia Blockchain Explorer](https://www.chiaexplorer.com).