UNPKG

@wuwei-labs/srsly

Version:
53 lines 1.8 kB
/** * @purpose Simplified deleteBorrower instruction wrapper * * Thin convenience wrapper around Codama-generated deleteBorrower instruction. * Admin-only instruction to delete borrower state for schema migrations. * Uses UncheckedAccount to bypass deserialization for old-format accounts. */ 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 deleting borrower state */ export interface DeleteBorrowerParams { /** * Admin authority (must be config.admin) * Accepts string address, web3.js Keypair, or @solana/kit signer */ admin: UniversalSigner; /** * Borrower wallet address who will receive the lamport refund */ borrower: Address | string; /** * BorrowerState PDA address to delete */ borrowerState: Address | string; /** * Sets compute units to allocate for the transaction. * @example 100000 */ computeUnits?: number; } /** * Admin escape hatch to delete an unparseable BorrowerState (used during * schema migrations). Returns rent to the borrower wallet. * * @param params - Delete borrower parameters * @param config - Optional SDK configuration overrides * @returns Kit instruction (or web3.js if PublicKey in config) * * @example * ```typescript * const ix = await deleteBorrower({ * admin: adminWallet, * borrower: "BORROWER_WALLET_ADDRESS", * borrowerState: "BORROWER_STATE_PDA_ADDRESS" * }); * ``` */ export declare function deleteBorrower(params: DeleteBorrowerParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>; //# sourceMappingURL=deleteBorrower.d.ts.map