freddiecoleman / chia-client

TypeScript client for Chia RPC interfaces.
https://www.chiaexplorer.com/
MIT License
89 stars 43 forks source link

load default config from chia root directory #10

Closed JordyBaylac closed 3 years ago

JordyBaylac commented 3 years ago

This PR has an enhancement to allow loading default port, host and certs from chia root configuration and avoid the need to specify manually.

Below is possible now:

import { FullNode } from 'chia-client';

const fullNode = new FullNode(); // options will be picked from chia config.yaml
const blockchain = await fullNode.getBlockchainState();

I have also updated some RPC calls that name were changed by the chia team (_get_block_record_byheight instead of _get_sub_block_record_by_subheight). Also _/get_unspentcoins has been deprecated and replaced by _/get_coin_records_by_puzzlehash (https://github.com/Chia-Network/chia-blockchain/wiki/RPC-Interfaces#get_coin_records_by_puzzle_hash)

freddiecoleman commented 3 years ago

Thanks for this.