/** * Write paths for the august_withdrawal_queue program: request a withdrawal, * claim (finalize) a ready one, cancel a pending one. * * Built like the vault's deposit and redeem handlers (`vault.actions.ts`): * every check the SDK can make runs before the wallet is asked to sign, every * account the transaction needs is created inside it with an idempotent * instruction, and failures surface as `AugustValidationError` (bad input or * state the caller can fix) or `AugustSDKError` (the transaction failed, with * the program's reason and the numeric code). */ import { type AnchorProvider } from '@coral-xyz/anchor'; import { type Connection, PublicKey } from '@solana/web3.js'; import type { ISolanaCancelRedeemRequestParams, ISolanaRequestRedeemParams, ISolanaRequestRedeemResult } from './types'; /** The sentence to append for a queue error the caller can act on, else empty. */ export declare function queueHint(e: unknown): string; /** The request PDA: `["withdrawal_request", queue, owner, request_id as u64 LE]`. */ export declare function deriveWithdrawalRequestPda(queue: PublicKey, owner: PublicKey, requestId: bigint, queueProgramId: PublicKey): PublicKey; /** * Escrow shares in a withdrawal request on a vault with a queue attached. * * Reads the vault state and queue in one call, checks the gate points at the * queue, and submits `request_withdrawal` from the holder's share account. The * recipient's deposit-token account is created in the same transaction when it * has none. Unless `minAssetsOut` is given, the request's floor is the current * net quote lowered by `slippageBps`, the floor `vaultRedeem` would use. * * RPC: one `getMultipleAccountsInfo` (vault state and queue), one * `getAccountInfo` for the share mint (decimals for a UI `amount`, supply for * the default floor) unless `amount` is raw and `minAssetsOut` is given, one * `getParsedTokenAccountsByOwner` for the share account, and one more read for * the payout account (the holder's, or another recipient's ATA, which may be * off-curve), then the send. * * @returns The signature, the new request's address and its id. * @throws AugustValidationError for bad input, a vault without an attached * queue, a frozen account or too few shares, all before signing. * @throws AugustSDKError when the transaction fails. */ export declare function handleSolanaRequestRedeem({ provider, connection, queueProgramId, params, }: { provider: AnchorProvider; connection: Connection; queueProgramId: PublicKey; params: ISolanaRequestRedeemParams; }): Promise; /** * Claim a request whose cooldown has run: `finalize_withdrawal`, which redeems * the escrowed shares through the vault and pays the request's recipient. * * Anyone the request permits may claim it: the holder always, and anyone else * unless it names a finalizer, in which case only that key. It is refused here, * before signing, when the caller is not permitted, the cooldown has not run, * or the window has closed; the wall clock stands in for the chain's, so at the * boundary the program may still disagree by a slot. The vault's fee-recipient * account is created in the same transaction when it has none, and so is the * request's payout account when it is the holder's own ATA and has been closed * since; any other closed or a frozen payout account is refused before * signing, since the claim could only fail. * * RPC: three reads in turn, each address coming from the account before it * (the request, its queue, then the queue's vault together with the payout * account), then the send. * * @throws AugustValidationError for a missing request or one the caller cannot * claim yet, before signing. * @throws AugustSDKError when the transaction fails, e.g. `NotEnoughLiquidity` * while the vault's reserve is deployed; the request stays pending. */ export declare function handleSolanaClaimRedeem({ provider, connection, vaultProgramId, queueProgramId, wallet, request: requestAddress, nowSeconds, }: { provider: AnchorProvider; connection: Connection; vaultProgramId: PublicKey; queueProgramId: PublicKey; wallet: PublicKey | string; request: PublicKey | string; /** Unix seconds to check eligibility against; defaults to now. */ nowSeconds?: number; }): Promise; /** * Cancel a pending request: `cancel_withdrawal` returns its shares to the * holder's share account (created in the same transaction when they closed * theirs) and closes the request, refunding its rent. Allowed at any time * while the request exists, cooldown or not, expired or not, paused or not. * * RPC: two reads in turn (the request, then its queue), one * `getParsedTokenAccountsByOwner`, then the send. * * @returns The confirmed transaction's signature. * @throws AugustValidationError for a missing request or one `wallet` did not * make, before signing. * @throws AugustSDKError when the transaction fails. */ export declare function handleSolanaCancelRedeemRequest({ provider, connection, queueProgramId, params, }: { provider: AnchorProvider; connection: Connection; queueProgramId: PublicKey; params: ISolanaCancelRedeemRequestParams; }): Promise;