From 0de0d4625ec01b20d44cc3dbf107e4d9884d9640 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Fri, 8 Jul 2022 23:14:38 +0100 Subject: [PATCH] chore: remove web3 examples (#26515) --- ...nfirm-cargo-version-numbers-before-bump.sh | 1 - scripts/increment-cargo-version.sh | 1 - web3.js/examples/get_account_info.js | 25 ------------- web3.js/examples/send_sol.js | 37 ------------------- 4 files changed, 64 deletions(-) delete mode 100644 web3.js/examples/get_account_info.js delete mode 100644 web3.js/examples/send_sol.js diff --git a/scripts/confirm-cargo-version-numbers-before-bump.sh b/scripts/confirm-cargo-version-numbers-before-bump.sh index 401953a58..c6b1c68e8 100755 --- a/scripts/confirm-cargo-version-numbers-before-bump.sh +++ b/scripts/confirm-cargo-version-numbers-before-bump.sh @@ -32,7 +32,6 @@ ignores=( .cache .cargo target - web3.js/examples web3.js/test node_modules ) diff --git a/scripts/increment-cargo-version.sh b/scripts/increment-cargo-version.sh index 3c69debd4..386b2b212 100755 --- a/scripts/increment-cargo-version.sh +++ b/scripts/increment-cargo-version.sh @@ -22,7 +22,6 @@ ignores=( .cache .cargo target - web3.js/examples web3.js/test node_modules ) diff --git a/web3.js/examples/get_account_info.js b/web3.js/examples/get_account_info.js deleted file mode 100644 index 86fe6eb45..000000000 --- a/web3.js/examples/get_account_info.js +++ /dev/null @@ -1,25 +0,0 @@ -import * as web3 from '@solana/web3.js'; - -(async () => { - // Connect to cluster - var connection = new web3.Connection( - web3.clusterApiUrl('devnet'), - 'confirmed', - ); - - // Generate a new wallet keypair and airdrop SOL - var wallet = web3.Keypair.generate(); - var airdropSignature = await connection.requestAirdrop( - wallet.publicKey, - web3.LAMPORTS_PER_SOL, - ); - - //wait for airdrop confirmation - await connection.confirmTransaction(airdropSignature); - - // get account info - // account data is bytecode that needs to be deserialized - // serialization and deserialization is program specific - let account = await connection.getAccountInfo(wallet.publicKey); - console.log(account); -})(); diff --git a/web3.js/examples/send_sol.js b/web3.js/examples/send_sol.js deleted file mode 100644 index 68e772dd2..000000000 --- a/web3.js/examples/send_sol.js +++ /dev/null @@ -1,37 +0,0 @@ -import * as web3 from '@solana/web3.js'; - -(async () => { - // Connect to cluster - var connection = new web3.Connection( - web3.clusterApiUrl('devnet'), - 'confirmed', - ); - - // Generate a new random public key - var from = web3.Keypair.generate(); - var airdropSignature = await connection.requestAirdrop( - from.publicKey, - web3.LAMPORTS_PER_SOL, - ); - await connection.confirmTransaction(airdropSignature); - - // Generate a new random public key - var to = web3.Keypair.generate(); - - // Add transfer instruction to transaction - var transaction = new web3.Transaction().add( - web3.SystemProgram.transfer({ - fromPubkey: from.publicKey, - toPubkey: to.publicKey, - lamports: web3.LAMPORTS_PER_SOL / 100, - }), - ); - - // Sign transaction, broadcast, and confirm - var signature = await web3.sendAndConfirmTransaction( - connection, - transaction, - [from], - ); - console.log('SIGNATURE', signature); -})();