TypeScript utilities for working with the Solana blockchain.
- keygen.ts: Generates a new Solana wallet.
- airdrop.ts: Requests an airdrop of SOL tokens to a specified wallet on the Solana Devnet.
- transfer.ts: Transfers SOL between two wallets.
- enroll.ts: Handles enrollment operations via a smart contract using the Anchor framework.
- main.rs: Rust program for Base58 encoding/decoding.
- wba_prereq.ts: Defines types and interfaces for a specific smart contract using Anchor.
Install all required Node.js packages by running:
npm install
- Purpose: Generates a new keypair for a Solana wallet.
- Command:
npm run keygen
- Purpose: Obtains 2 SOL tokens from the Devnet's faucet to the specified wallet.
- Command:
npm run airdrop
- Purpose: Transfers a fraction of SOL to another wallet.
- Command:
npm run transfer
- Purpose: Performs an enrollment operation via a smart contract(program) interaction.
- Command:
npm run enroll
- Purpose: Demonstrates Base58 encoding and decoding.
- Usage: Replace
"YOUR_PK_HERE"
with your actual private key string.
cargo run
- File:
wba_prereq.ts
- Description: Contains the interface and types for the
wba_prereq
smart contract. - Usage: Utilized by the
enroll.ts
for contract interaction.
Ensure your dev-wallet.json
(new wallet created using keygen.ts) and wba-wallet.json
(exported wallet) contain the correct private keys for interaction with the blockchain.
Scripts can be executed through npm scripts defined in package.json
. Navigate to the directory containing your scripts and run:
npm run <script-name>
- DO NOT share your private keys (
dev-wallet.json
,wba-wallet.json
) with anyone.