-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
23 lines (12 loc) · 807 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { clusterApiUrl, Connection, Keypair, LAMPORTS_PER_SOL } from '@solana/web3.js';
import { createMint, getOrCreateAssociatedTokenAccount, mintTo, transfer } from '@solana/spl-token';
(async () => {
// Step 1: Connect to cluster and generate a new Keypair
// Step 2: Airdrop SOL into your from wallet
// Step 3: Create new token mint and get the token account of the fromWallet address
//If the token account does not exist, create it
//Step 4: Mint a new token to the from account
//Step 5: Get the token account of the to-wallet address and if it does not exist, create it
//Step 6: Transfer the new token to the to-wallet's token account that was just created
// Transfer the new token to the "toTokenAccount" we just created
})();