SDK | VX platform

another Website / repository for vx: Project Dashboard Main Repository of project
this project is not released yet.

VX — Small Web3 CLI SDK

This document was generated by analyzing the current workspace. It summarizes structure, usage, and known caveats to help developers and automated agents get started quickly.

Big picture

Features

Library usage (default import)

Use the SDK programmatically via the default export; CLI behavior is unchanged.

TypeScript / ESM

import vx from "@nk4dev/vx";

const rpc = vx.getRpcUrl();
const block = await vx.getBlockNumber(rpc);
const gas = await vx.getGasFees(rpc);

CommonJS

const vx = require("@nk4dev/vx");
vx.getGasFees("http://127.0.0.1:8545").then(console.log);

Named exports remain available:

import { vx as data, instance } from "@nk4dev/vx";
await data.getBalance("http://127.0.0.1:8545", "0x...");

Hardhat setup

Scaffold Hardhat into the current project using a built-in template.

vx3 setup hardhat
# then install dev dependencies
npm install -D hardhat @nomicfoundation/hardhat-toolbox

# try scripts
npm run hh:node
npm run hh:compile
npm run hh:deploy

Example: gas command output

The repository includes a vx3 gas command that prints network gas fee data. Example output:

Connecting to RPC: http://localhost:8545
Gas fee data:
  gasPrice (wei): 20000000000
  gasPrice (gwei): 20
  maxFeePerGas (wei): 2532616788
  maxFeePerGas (gwei): 2.532616788
  maxPriorityFeePerGas (wei): 1000000000
  maxPriorityFeePerGas (gwei): 1
            

Key files

Common commands (examples)

Build / test / dev workflow

  1. Install deps: npm install
  2. Build: npm run build
  3. Run CLI: npm run dev or npx vx3 <command>
  4. Local server: npx vx3 serve --debug
  5. Tests: npm test (Jest)

vx.config.json (RPC config)

The template written by src/core/rpc/config.ts is an array. Example:

[
                {
                    "host": "localhost",
                    "port": 8575,
                    "protocol": "http"
                }
            ]

Note: some code previously expected a single-object config while other parts expected an array. The loader is array-aware and returns the first object for compatibility. Consider standardizing the format to simplify code.

Debug page (Tailwind UI)

vx3 serve --debug serves a Tailwind-powered debug dashboard at /debug.

Notes

Examples

Initialize project

npx vx3 init hello-world

Create RPC config

npx vx3 rpc init

Libraries

Author

Maintainer: nk4dev