UNPKG

@wuwei-labs/srsly

Version:

[![npm version](https://img.shields.io/npm/v/ts-sdk-example.svg)](https://www.npmjs.com/package/ts-sdk-example)

39 lines 1.36 kB
import { Address, TransactionSigner } from '@solana/kit'; import { CancelRentalInstruction, getCancelRentalInstructionAsync } from '../codama'; /** * Simplified parameters for canceling a rental */ export interface CancelRentalParams { /** * The borrower wallet that will sign the transaction */ borrower: TransactionSigner<string>; /** * The rental contract account address */ contract: Address<string>; } /** * Asynchronously creates an instruction to cancel a rental with minimal required parameters. * Derives rentalState, rentalThread, borrowerTokenAccount, rentalTokenAccount and * rentalAuthority automatically if not provided. * * @example * ```typescript * // Create the instruction with minimal parameters - just borrower and contract * const ix = await cancelRental({ * borrower: wallet, * contract: contractAddress * }); * * // Add to transaction and sign * const tx = new Transaction().add(ix); * await sendAndConfirmTransaction(connection, tx, [wallet]); * ``` * * @param params The simplified parameters for canceling a rental * @returns A promise that resolves to the instruction to cancel a rental */ export declare function cancelRental(params: CancelRentalParams): Promise<CancelRentalInstruction>; export { getCancelRentalInstructionAsync }; //# sourceMappingURL=cancel.d.ts.map