Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 3db25f2

Browse files
authored
docs: Update ATA derivation example to use findProgramAddressSync (#4068)
1 parent 9c1ee63 commit 3db25f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/associated-token-account.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ const SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID: PublicKey = new PublicKey(
6464
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
6565
);
6666

67-
async function findAssociatedTokenAddress(
67+
function findAssociatedTokenAddress(
6868
walletAddress: PublicKey,
6969
tokenMintAddress: PublicKey
70-
): Promise<PublicKey> {
71-
return (await PublicKey.findProgramAddress(
70+
): PublicKey {
71+
return PublicKey.findProgramAddressSync(
7272
[
7373
walletAddress.toBuffer(),
7474
TOKEN_PROGRAM_ID.toBuffer(),
7575
tokenMintAddress.toBuffer(),
7676
],
7777
SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
78-
))[0];
78+
)[0];
7979
}
8080
```
8181

0 commit comments

Comments
 (0)