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

Commit 1819e67

Browse files
Resolve UnitializedAccount error
1 parent 45928b6 commit 1819e67

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/actions/placeBid.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,11 @@ export const placeBid = async ({
8282
////
8383
} else {
8484
// create a new account for bid
85-
const account = Keypair.generate();
86-
const createBidderPotTransaction = new CreateTokenAccount(
87-
{ feePayer: bidder },
88-
{
89-
newAccountPubkey: account.publicKey,
90-
lamports: accountRentExempt,
91-
mint: auctionTokenMint,
92-
owner: auction,
93-
},
94-
);
95-
txBatch.addSigner(account);
96-
txBatch.addTransaction(createBidderPotTransaction);
97-
bidderPotToken = account.publicKey;
85+
bidderPotToken = await AuctionProgram.findProgramAddress([
86+
Buffer.from(AuctionProgram.PREFIX),
87+
bidderPot.toBuffer(),
88+
Buffer.from('bidder_pot_token'),
89+
]);
9890
////
9991
}
10092

0 commit comments

Comments
 (0)