fix errors in lookup tables code example (#32055)

* fix errors in lookup tables code example

* Update lookup-tables.md

* add missing = and change variable name to txid
This commit is contained in:
Logan Yu 2023-06-20 09:56:56 -04:00 committed by GitHub
parent ce929bead2
commit 24ffc113bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -84,9 +84,7 @@ Similar to requesting another account (or PDA) from the cluster, you can fetch a
const lookupTableAddress = new web3.PublicKey("");
// get the table from the cluster
const lookupTableAccount = await connection
.getAddressLookupTable(lookupTableAddress)
.then((res) => res.value);
const lookupTableAccount = (await connection.getAddressLookupTable(lookupTableAddress)).value;
// `lookupTableAccount` will now be a `AddressLookupTableAccount` object
@ -135,7 +133,7 @@ transactionV0.sign([payer]);
const txid = await web3.sendAndConfirmTransaction(connection, transactionV0);
console.log(
`Transaction: https://explorer.solana.com/tx/${txidV0}?cluster=devnet`,
`Transaction: https://explorer.solana.com/tx/${txid}?cluster=devnet`,
);
```