@wuwei-labs/srsly
Version:
TypeScript SDK for SRSLY
39 lines • 1.58 kB
TypeScript
/**
* @purpose Simplified deleteContractThread instruction wrapper
*
* Thin convenience wrapper around Codama-generated deleteContractThread instruction.
* Admin-only instruction to delete a contract's thread for schema migrations.
* Unlike closeContractThread, does not require the contract account.
*/
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 admin-deleting a contract automation thread
*/
export interface DeleteContractThreadParams {
/**
* Admin authority (must be config.admin)
* Accepts string address, web3.js Keypair, or @solana/kit signer
*/
admin: UniversalSigner;
/** Contract address whose thread to delete (used to derive thread PDA) */
contract: Address | string;
/**
* Sets compute units to allocate for the transaction.
* @example 400000
*/
computeUnits?: number;
}
/**
* Admin variant of `closeContractThread` that doesn't require the
* contract account on-chain — used when the contract is already deleted
* or unparseable.
*
* @param params - Thread deletion parameters
* @param config - Optional SDK configuration overrides
* @returns Kit instruction (or web3.js if PublicKey in config)
*/
export declare function deleteContractThread(params: DeleteContractThreadParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
//# sourceMappingURL=deleteContractThread.d.ts.map