merge: main

This commit is contained in:
michaelessiet
2025-01-16 15:50:24 +01:00

View File

@@ -254,7 +254,7 @@ export async function withdrawFromDriftUserAccount(
const tx = new Transaction().add(...withdrawInstruction).add( const tx = new Transaction().add(...withdrawInstruction).add(
ComputeBudgetProgram.setComputeUnitPrice({ ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 0.000001 * 1000000 * 1000000, microLamports: 0.000003 * 1000000 * 1000000,
}), }),
); );
tx.recentBlockhash = latestBlockhash.blockhash; tx.recentBlockhash = latestBlockhash.blockhash;
@@ -388,9 +388,11 @@ export async function doesUserHaveDriftAccount(agent: SolanaAgentKit) {
agent.wallet.publicKey, agent.wallet.publicKey,
), ),
}); });
await user.subscribe();
user.getActivePerpPositions(); user.getActivePerpPositions();
const userAccountExists = await user.exists(); const userAccountExists = await user.exists();
await cleanUp(); await cleanUp();
await user.unsubscribe();
return { return {
hasAccount: userAccountExists, hasAccount: userAccountExists,
account: user.userAccountPublicKey, account: user.userAccountPublicKey,