- Enroll in the WBA program on Devnet using your GitHub handle:
- File: ts/prereqs/enroll.ts
- Description: This script contains the main logic for interacting with the WBA program on the Solana Devnet using TypeScript.
- WBA IDL: Defined in ts/programs/wba_prereq.ts, which specifies the TypeScript type and object for the WBA Interface Definition Language (IDL).
- 🚀 View transaction details
- Enroll in the WBA program on Devnet using your GitHub handle:
- File: prereqs.rs
- Description: This script provides the logic to enroll in the WBA program using Rust.
- 🚀 View transaction details
Explore the WBA Program.
Before starting, ensure you have the following:
- Node.js and Yarn: These are required for running the scripts.
- Solana Wallet Keypairs: You should have two wallet keypairs stored at the following locations:
./cluster1/wallet/dev-wallet.json
./cluster1/wallet/wba-wallet.json
Single entrypoint for wallets and accounts:
- File: config/index.ts
import { dev_wallet, wba_wallet } from "../cluster1/wallet";
export const ACCOUNTS = {
MINT: "",
};
export const RPC_ENDPOINT = "https://api.devnet.solana.com";
export const WALLETS = {
WBA_WALLET: wba_wallet,
DEV_WALLET: dev_wallet,
};
- Install Dependencies
yarn
- Run the script
yarn spl_init
- Accounts: Everything on-chain is an account.
- Programs: Stateless executable code.
- SPL Token Program (Native Program): A standard program on Solana for creating fungible/non-fungible tokens.
- Mint: The source of new tokens, responsible for creating them.
- Token Accounts: Hold balances of tokens and are associated with specific mints.
- ATA (Associated Token Account): Simplifies token management, unique to wallet and mint.
- PDA (Program Derived Address): A derived account address using a bump, seed, and program ID for deterministic addresses.
- ATA (Associated Token Account): Simplifies token management, unique to wallet and mint.
- SPL Token Program (Native Program): A standard program on Solana for creating fungible/non-fungible tokens.
- Transactions: Use Proof-of-History to order and verify instructions atomically.
- IDL (Interface Definition Language): Defines interfaces for Solana programs, enabling client interactions.
- Blinks and Actions: Use URLs to create and execute Solana transactions from any web platform
-
spl-init mint address : H9x1N93bxgcN7jU25matB4FTtRTTXVJdcja8AxCNrHU View transaction details
-
spl-mint ata: 5wVyEksqjFC6kWvkxwkg8SDrdbkYzX2ChmfgMJpMwKmv View transaction details
-
- Create metadata: View transaction details
- Update metadata: View transaction details
-
nft_mint - Mint an RUG NFT using umi:
- Generate image: nft_image.ts
- Create metadata: nft_metadata.ts
- Mint NFT: View transaction
- State: represents the program's persistent data model, maintaining essential information for the program's operation.
- Account: essential elements required for instructions to execute. Each instruction interacts with one or more accounts to perform its operations.
- PDA Account:
- created deterministically using
seeds
and theprogram ID
. - owned by the program, allowing only the program to modify its state.
- enables cross-program invocation (CPI), allowing the program to sign transactions on behalf of the account without needing a private key.
- created deterministically using
- Instruction : operations that define the logic for specific actions, such as
initialize()
,upvote()
, anddownvote()
. They interact with accounts, manage parameters, and modify state securely. - Context
<T>
parameters: encapsulates all accounts and data needed for each instruction, as defined by the corresponding account structs.
- Delegation: transfers authority over NFTs from the user to the program.
- FreezeDelegatedAccountCPI: locks NFTs to prevent transfers while staked.
- ThawDelegatedAccountCPI: unlocks NFTs during unstaking.
- Timestamp: tracks when the NFT was last staked, used to calculate rewards and enforce freeze periods.