-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtochi-example.ts
33 lines (21 loc) · 1.04 KB
/
tochi-example.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Connect to the Network
// import { Connection, clusterApiUrl } from "@solana/web3.js";
// const connection = new Connection(clusterApiUrl("devnet"));
// console.log(` Connected!`)
// Read from the Network
// import { Connection, PublicKey, clusterApiUrl, LAMPORTS_PER_SOL } from "@solana/web3.js";
// const connection = new Connection(clusterApiUrl("devnet"));
// const address = new PublicKey('CenYq6bDRB7p73EjsPEpiYN7uveyPUTdXkDkgUduboaN');
// const balance = await connection.getBalance(address);
// const balanceInSol = balance / LAMPORTS_PER_SOL;
// console.log(`The balance of the account at ${address} is ${balanceInSol} SOL and ${balance} LAMPORT`);
// console.log(`✅Finished!`)
// Instruction For System Program Transfer
// import { LAMPORTS_PER_SOL, SystemProgram, Transaction } from "@solana/web3.js"
// const transaction = new Transaction()
// const sendSolInstruction = SystemProgram.transfer({
// fromPubkey: sender,
// toPubkey: recipient,
// lamports: LAMPORTS_PER_SOL * amount
// })
// transaction.add(sendSolInstruction)