@wuwei-labs/srsly
Version:
[](https://www.npmjs.com/package/ts-sdk-example)
44 lines • 1.53 kB
TypeScript
import { Address } from '@solana/kit';
import { CloseRentalInstruction, getCloseRentalInstructionAsync } from '../codama';
/**
* Simplified parameters for closing a rental
*/
export interface CloseRentalParams {
/**
* The borrower address (not a signer in this transaction)
*/
borrower: Address<string>;
/**
* The owner's token account address for receiving ATLAS
*/
ownerTokenAccount: Address<string>;
/**
* The rental contract account address
*/
contract: Address<string>;
}
/**
* Asynchronously creates an instruction to close a rental with minimal required parameters.
* This is called by an owner to close a rental that was previously accepted by a borrower.
* Derives rentalState, rentalThread, rentalTokenAccount and rentalAuthority automatically if not provided.
*
* @example
* ```typescript
* // Create the instruction with minimal parameters
* const ix = await closeRental({
* borrower: borrowerAddress,
* ownerTokenAccount: ownerTokenAccountAddress,
* contract: contractAddress
* });
*
* // Add to transaction and sign
* const tx = new Transaction().add(ix);
* await sendAndConfirmTransaction(connection, tx, [owner]);
* ```
*
* @param params The simplified parameters for closing a rental
* @returns A promise that resolves to the instruction to close a rental
*/
export declare function closeRental(params: CloseRentalParams): Promise<CloseRentalInstruction>;
export { getCloseRentalInstructionAsync };
//# sourceMappingURL=close.d.ts.map