@bbachain/cli-config
Version:
Typescript bindings for bbachain's CLI config (originally in Rust)
31 lines (30 loc) • 1.04 kB
TypeScript
import type { Commitment } from "@bbachain/web3.js";
import { Connection, Keypair } from "@bbachain/web3.js";
/**
* The raw config loaded from the yaml file
*/
export declare type BBAChainCliConfigRaw = {
json_rpc_url: string;
websocket_url: string;
keypair_path: string;
address_labels: {
[address in string]: string;
};
commitment: Commitment;
};
export declare const BBACHAIN_CLI_CONFIG_RAW_DEFAULT: BBAChainCliConfigRaw;
export declare class BBAChainCliConfig {
static DEFAULT_PATH: string;
keypairPath: string;
addressLabels: Map<string, string>;
commitment: Commitment;
jsonRpcUrl: string;
websocketUrl: string;
constructor({ json_rpc_url, websocket_url, keypair_path, address_labels, commitment, }: BBAChainCliConfigRaw);
static default(): BBAChainCliConfig;
static load(path?: string): BBAChainCliConfig;
toRaw(): BBAChainCliConfigRaw;
save(path?: string, overwrite?: boolean): void;
loadKeypair(): Keypair;
createConnection(): Connection;
}