UNPKG

@wuwei-labs/srsly

Version:
70 lines 2.32 kB
/** * @purpose Simplified invalidateRental instruction wrapper * * Thin convenience wrapper around Codama-generated invalidateRental instruction. * Emergency function to invalidate a fleet's rental status when contract doesn't exist. */ 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 invalidating a rental */ export interface InvalidateRentalParams { /** * Signer paying for transaction fees * Accepts string address, web3.js Keypair, or @solana/kit signer */ signer: UniversalSigner; /** * Fleet address to invalidate rental status for */ 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; } /** * Emergency clear of a fleet's SAGE rental flag when no SRSLY contract * exists. Use `releaseRental` instead when a contract still exists. * * @param params - Invalidate rental parameters * @param config - Optional SDK configuration overrides * @returns Kit instruction (or web3.js if PublicKey in config) * * @example * ```typescript * // Emergency invalidation of a stuck fleet (contract doesn't exist) * const ix = await invalidateRental({ * fleet: "FLEET_ADDRESS", * signer: wallet, * ownerProfile: "OWNER_PROFILE_ADDRESS", * faction: "mud" * }); * * // With compute budget * const ix2 = await invalidateRental({ * fleet: fleetAddress, * signer: adminWallet, * ownerProfile: ownerProfileAddress, * faction: 1, * computeUnits: 200_000 * }); * ``` */ export declare function invalidateRental(params: InvalidateRentalParams, config?: Partial<SdkConfig>): Promise<ReturnType<typeof prepareInstructions>>; //# sourceMappingURL=invalidateRental.d.ts.map