[docs] corrected use of confirmTransaction in examples (#28547)
fix: updated method calls
This commit is contained in:
parent
a422387ca8
commit
2090ad0c2e
|
@ -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.
|
||||
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -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(
|
||||
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue