Skip to content

Commit

Permalink
refactor(): replace deprecated findProgramAddress with findProgramAdd…
Browse files Browse the repository at this point in the history
…ressSync

The signature '(seeds: (Buffer | Uint8Array)[], programId: PublicKey): Promise<[PublicKey, number]>' of 'web3.PublicKey.findProgramAddress' is deprecated.

Updated the code to use the recommended 'findProgramAddressSync' method for better compatibility.
  • Loading branch information
Onyewuchi Emeka committed Aug 25, 2024
1 parent e9c4d5d commit 2997cca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ account per note where each PDA is derived with the user’s public key and the
note’s title.

```typescript
const [pda, bump] = await web3.PublicKey.findProgramAddress(
const [pda, bump] = await web3.PublicKey.findProgramAddressSync(
[publicKey.toBuffer(), Buffer.from("Shopping list")],
programId,
);
Expand Down

0 comments on commit 2997cca

Please sign in to comment.