@wuwei-labs/srsly
Version:
TypeScript SDK for SRSLY
70 lines • 2.26 kB
TypeScript
/**
* @purpose Simplified releaseRental instruction wrapper
*
* Thin convenience wrapper around Codama-generated releaseRental instruction.
* Release a fleet from SRSLY rental control when contract exists but rental is inactive.
*/
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 releasing a rental
*/
export interface ReleaseRentalParams {
/**
* Signer paying for transaction fees
* Accepts string address, web3.js Keypair, or @solana/kit signer
*/
signer: UniversalSigner;
/**
* Fleet address to release from rental control
*/
fleet: Address | string;
/**
* Fleet owner's profile address (NOT borrower's)
* Optional — auto-fetched from fleet account when omitted
*/
ownerProfile?: Address | string;
/**
* Owner's faction for starbase derivation
* Can be faction name ('mud', 'oni', 'ustur') or ID (1, 2, 3)
* Optional — auto-fetched from fleet account when omitted
*/
faction?: string | number;
/**
* Sets compute units to allocate for the transaction.
* @example 200000
*/
computeUnits?: number;
}
/**
* Free a fleet from SRSLY's rental hold once the rental has been closed.
* Use `invalidateRental` instead when no contract exists.
*
* @param params - Release rental parameters
* @param config - Optional SDK configuration overrides
* @returns Kit instruction (or web3.js if PublicKey in config)
*
* @example
* ```typescript
* // Release a stuck fleet (contract must exist)
* const ix = await releaseRental({
* fleet: "FLEET_ADDRESS",
* signer: wallet,
* ownerProfile: "OWNER_PROFILE_ADDRESS",
* faction: "mud"
* });
*
* // With compute budget
* const ix2 = await releaseRental({
* fleet: fleetAddress,
* signer: adminWallet,
* ownerProfile: ownerProfileAddress,
* faction: 1,
* computeUnits: 200_000
* });
* ```
*/
export declare function releaseRental(params: ReleaseRentalParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>;
//# sourceMappingURL=releaseRental.d.ts.map