MCPcopy Create free account
hub / github.com/ExtropyIO/SolanaBootcamp / getBalance

Function getBalance

utils/utils.ts:30–37  ·  view source on GitHub ↗
(
  connection: Connection,
  payer: Keypair
)

Source from the content-addressed store, hash-verified

28}
29
30export async function getBalance(
31 connection: Connection,
32 payer: Keypair
33): Promise<[number, number]> {
34 let lamports = await connection.getBalance(payer.publicKey);
35 const startingBalanceSOL = lamports / LAMPORTS_PER_SOL;
36 return [startingBalanceSOL, lamports];
37}
38
39export async function feesEstimate(connection: Connection, payer: Keypair): Promise<number> {
40 const { blockhash } = await connection.getLatestBlockhash();

Callers 7

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
atLeastSolFunction · 0.85
establishEnoughSolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected