fix(docs): missing import (#20788)

add missing import of `Connection`
This commit is contained in:
Colin Ogoo
2021-10-26 18:44:00 +01:00
committed by GitHub
parent dec104c580
commit 521b7b79cc

View File

@ -135,7 +135,7 @@ The above code achieves creating a transaction ready to be signed and broadcaste
All that is left is to sign the transaction with keypair and send it over the network. You can accomplish sending a transaction by using `sendAndConfirmTransaction` if you wish to alert the user or do something after a transaction is finished, or use `sendTransaction` if you don't need to wait for the transaction to be confirmed. All that is left is to sign the transaction with keypair and send it over the network. You can accomplish sending a transaction by using `sendAndConfirmTransaction` if you wish to alert the user or do something after a transaction is finished, or use `sendTransaction` if you don't need to wait for the transaction to be confirmed.
```javascript ```javascript
const {sendAndConfirmTransaction, clusterApiUrl} = require("@solana/web3.js"); const {sendAndConfirmTransaction, clusterApiUrl, Connection} = require("@solana/web3.js");
let keypair = Keypair.generate(); let keypair = Keypair.generate();
let connection = new Connection(clusterApiUrl('testnet')); let connection = new Connection(clusterApiUrl('testnet'));