mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-06-03 15:11:32 +00:00
merge: main
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user