UNPKG

@wuwei-labs/srsly

Version:
52 lines 1.69 kB
/** * @purpose Simplified closeRental instruction wrapper * * Thin convenience wrapper around Codama-generated closeRental instruction. * Closes a completed rental and returns the fleet to the owner. */ 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 rental */ export interface CloseRentalParams { /** * Payer for the transaction (usually the owner) * Accepts string address, web3.js Keypair, or @solana/kit signer */ payer: UniversalSigner; /** * Contract address to close the rental from */ contract: Address | string; /** * Borrower address (optional) * If not provided, automatically fetched from the active rental state. * Falls back to payer if rental state doesn't exist. */ borrower?: Address | string; /** * Sets compute units to allocate for the transaction. * @example 400000 */ computeUnits?: number; } /** * Finalize a completed rental and return the fleet to the owner. * * @param params - Rental closure parameters (payer, contract) * @param config - Optional SDK configuration overrides * @returns Kit instruction (or web3.js if PublicKey in config) * * @example * ```typescript * const ix = await closeRental({ * payer: ownerWallet, * contract: contractAddress * }); * ``` */ export declare function closeRental(params: CloseRentalParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>; //# sourceMappingURL=closeRental.d.ts.map