@nosana/kit
Version:
Nosana KIT
23 lines • 861 B
JavaScript
export async function stop({ market, node }, { deps, client, getRequiredWallet, getStaticAccounts }) {
try {
const wallet = getRequiredWallet();
// Get static accounts
const { jobsProgram, ...staticAccounts } = await getStaticAccounts();
// Use provided node or default to wallet address
const nodeAddress = node ?? wallet.address;
return client.getStopInstruction({
market,
node: nodeAddress,
authority: wallet,
...staticAccounts,
}, {
programAddress: jobsProgram,
});
}
catch (err) {
const errorMessage = `Failed to create stop instruction: ${err instanceof Error ? err.message : String(err)}`;
deps.logger.error(errorMessage);
throw new Error(errorMessage);
}
}
//# sourceMappingURL=stop.js.map