0.2.0 • Published 2 years ago

@soceanfi/solana-cli-config v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Solana CLI Config

Typescript bindings for Solana CLI config (originally in rust).

No browser, intended for use in node.js based solana CLI applications.

Example Usage

import { Connection, Keypair } from "@solana/web3.js";
import { SolanaCliConfig } from "@soceanfi/solana-cli-config"

// Load the solana CLI config file from the default path ($HOME/.config/solana/cli/config.yml)
const config = SolanaCliConfig.load();

// Load the keypair from the file path specified in the config file
const keypair: Keypair = config.loadKeypair();

// Create a `Connection` object from the config
const connection: Connection = config.createConnection();