@wuwei-labs/srsly
Version:
TypeScript SDK for SRSLY
37 lines • 1.4 kB
TypeScript
/**
* @purpose Simplified closeContractThread instruction wrapper
*
* Thin convenience wrapper around Codama-generated closeContractThread instruction.
* Closes a per-contract automation thread and reclaims rent.
*/
import { type Address } from '@solana/kit';
import { type SdkConfig } from '../utils/config';
import { type UniversalSigner } from '../utils/signer';
import { prepareInstructions } from '../utils/instructions';
/**
* Parameters for closing a contract automation thread
*/
export interface CloseContractThreadParams {
/**
* Contract owner (must be the contract's owner)
* Accepts string address, web3.js Keypair, or @solana/kit signer
*/
owner: UniversalSigner;
/** Contract address whose thread to close */
contract: Address | string;
/**
* Sets compute units to allocate for the transaction.
* @example 400000
*/
computeUnits?: number;
}
/**
* Close a contract's automation thread and all of its fibers, reclaiming
* rent to the owner.
*
* @param params - Thread closing parameters
* @param config - Optional SDK configuration overrides
* @returns Kit instruction (or web3.js if PublicKey in config)
*/
export declare function closeContractThread(params: CloseContractThreadParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
//# sourceMappingURL=closeContractThread.d.ts.map