Skip to content

Commit

Permalink
[docs] corrected use of confirmTransaction in examples (solana-labs#2…
Browse files Browse the repository at this point in the history
…8547)

fix: updated method calls
  • Loading branch information
nickfrosty authored Oct 24, 2022
1 parent a422387 commit 2090ad0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/src/developing/clients/javascript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });
```

First, we set up the account Keypair and connection so that we have an account to make allocate on the testnet. We also create a payer Keypair and airdrop some sol so we can pay for the allocate transaction.
Expand Down Expand Up @@ -309,7 +309,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

let allocateTransaction = new web3.Transaction({
feePayer: payer.publicKey,
Expand Down
13 changes: 7 additions & 6 deletions docs/src/developing/clients/javascript-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

let toAccount = web3.Keypair.generate();

Expand Down Expand Up @@ -253,7 +253,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

// Allocate Account Data
let allocatedAccount = web3.Keypair.generate();
Expand Down Expand Up @@ -365,7 +365,8 @@ let airdropSignature = await connection.requestAirdrop(
fromPublicKey.publicKey,
web3.LAMPORTS_PER_SOL,
);
await connection.confirmTransaction(airdropSignature);

await connection.confirmTransaction({ signature: airdropSignature });

// Sign Message with Ethereum Key
let plaintext = Buffer.from("string address");
Expand Down Expand Up @@ -412,7 +413,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

let type = web3.SYSTEM_INSTRUCTION_LAYOUTS.Transfer;
let data = Buffer.alloc(type.layout.span);
Expand Down Expand Up @@ -532,7 +533,7 @@ let airdropSignature = await connection.requestAirdrop(
web3.LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

// Get Minimum amount for rent exemption
let minimumAmount = await connection.getMinimumBalanceForRentExemption(
Expand Down Expand Up @@ -681,7 +682,7 @@ let airdropSignature = await connection.requestAirdrop(
fromPublicKey.publicKey,
web3.LAMPORTS_PER_SOL,
);
await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

// Create Account
let stakeAccount = web3.Keypair.generate();
Expand Down
2 changes: 1 addition & 1 deletion docs/src/integrations/retrying-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ const sleep = async (ms: number) => {
LAMPORTS_PER_SOL,
);

await connection.confirmTransaction(airdropSignature);
await connection.confirmTransaction({ signature: airdropSignature });

const blockhashResponse = await connection.getLatestBlockhashAndContext();
const lastValidBlockHeight = blockhashResponse.context.slot + 150;
Expand Down

0 comments on commit 2090ad0

Please sign in to comment.