Skip to content

Solana web3.js Client

Andrei Montchik edited this page Apr 15, 2026 · 1 revision

Docs

  1. Install NodeJS
  2. Enable Corepack: corepack enable
  3. Enable Corepack, that will make Yarn available: corepack enable
  4. Install the Solana Web3.js client: yarn add @solana/web3.js
  5. Install Typescript: npm install -g typescript
  6. Install the BN JavaScript library and it's Typescript definitions: npm install bn.js @types/bn.js --save
  7. Run the tsc --init command in the scripts directory to generate the default TypeScript configuration file. It will setup some helpful flags. Consider commenting out the "strict": true to disable strict type checking.

Usage Examples

Build and Run

  1. To generate the JavaScript file, run tsc in the scripts directory. It will pick up the TypeScript compiler configuration from the tsconfig.json file and compile all TypeScript files.
  2. Run the JavaScript file: node <SCRIPT_NAME.js>

CLI

  • List of NodeJS modules: npm ls.

Clone this wiki locally