Skip to content

scripts generating solana address, then claiming devnet tokens and then transferring them & interacting with a devnet program for enrollment

Notifications You must be signed in to change notification settings

dattgoswami/wba-solana-q2-2024

Repository files navigation

WBA Solana Q2 2024

TypeScript utilities for working with the Solana blockchain.

Components

  1. keygen.ts: Generates a new Solana wallet.
  2. airdrop.ts: Requests an airdrop of SOL tokens to a specified wallet on the Solana Devnet.
  3. transfer.ts: Transfers SOL between two wallets.
  4. enroll.ts: Handles enrollment operations via a smart contract using the Anchor framework.
  5. main.rs: Rust program for Base58 encoding/decoding.
  6. wba_prereq.ts: Defines types and interfaces for a specific smart contract using Anchor.

How to Use

Setup

Install all required Node.js packages by running:

npm install

Keygen.ts

  • Purpose: Generates a new keypair for a Solana wallet.
  • Command:
npm run keygen

Airdrop.ts

  • Purpose: Obtains 2 SOL tokens from the Devnet's faucet to the specified wallet.
  • Command:
npm run airdrop

Transfer.ts

  • Purpose: Transfers a fraction of SOL to another wallet.
  • Command:
npm run transfer

Enroll.ts

  • Purpose: Performs an enrollment operation via a smart contract(program) interaction.
  • Command:
npm run enroll

Main.rs (base58_converter/src/main.rs)

  • Purpose: Demonstrates Base58 encoding and decoding.
  • Usage: Replace "YOUR_PK_HERE" with your actual private key string.
cargo run

WBA Prereq (programs/wba_prereq.ts)

  • 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.

Configuration

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.

Running the Scripts

Scripts can be executed through npm scripts defined in package.json. Navigate to the directory containing your scripts and run:

npm run <script-name>

Security

  • DO NOT share your private keys (dev-wallet.json, wba-wallet.json) with anyone.

About

scripts generating solana address, then claiming devnet tokens and then transferring them & interacting with a devnet program for enrollment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published