/** * @module staking * @description Agent staking lifecycle — init, deposit, request unstake, * complete unstake, and fetch stake accounts. * * @category Modules * @since v0.7.0 * @packageDocumentation */ import { type PublicKey, type TransactionSignature } from "@solana/web3.js"; import { BN } from "@coral-xyz/anchor"; import { BaseModule } from "./base"; import type { AgentStakeData } from "../types"; /** * @name StakingModule * @description Manages agent stake accounts — init, deposit, unstake, and fetch. * * @category Modules * @since v0.7.0 * @extends BaseModule */ export declare class StakingModule extends BaseModule { deriveStake(agentPda: PublicKey): readonly [PublicKey, number]; initStake(agentWallet: PublicKey, initialDeposit: BN | number | bigint): Promise; deposit(agentWallet: PublicKey, amount: BN | number | bigint): Promise; requestUnstake(agentWallet: PublicKey, amount: BN | number | bigint): Promise; completeUnstake(agentWallet: PublicKey): Promise; /** * Close a legacy stake account after its agent PDA has already been closed. * * Normal v1.0.0 agent closure returns stake automatically via `agent.close()`. * This helper exists for v0.18-era accounts where the agent was closed while * the permanent collateral floor stayed in the StakePDA. */ closeStake(agentWallet: PublicKey): Promise; fetch(agentPda: PublicKey): Promise; fetchNullable(agentPda: PublicKey): Promise; fetchByPda(stakePda: PublicKey): Promise; /** * Compute the maximum amount that can be requested via `requestUnstake` * without breaching the on-chain {@link MIN_AGENT_STAKE_LAMPORTS} floor. * * Returns 0 if the agent is already at (or below) the floor. * * @since v0.11.0 */ getMaxUnstakeLamports(stake: AgentStakeData): bigint; /** * Returns the lamport delta the agent must `deposit` to satisfy the * per-escrow stake-coverage requirement for `escrowLamports`. 0 if already * sufficient. Useful for a UI "top up to open this escrow" button. * * Mirrors the on-chain check in `create_escrow_v2` (v0.11 H-1). * * @since v0.11.0 */ getRequiredTopUp(stake: AgentStakeData, escrowLamports: bigint): bigint; } //# sourceMappingURL=staking.d.ts.map