import type { EarnClient, ServerKeyShare, SignMessageContext, WalletMetadata } from '@dynamic-labs-wallet/node'; import { Transaction, VersionedTransaction } from '@solana/web3.js'; import type { ClaimEarnRewardsParams, DepositToEarnVaultParams, EarnTransactionResult, ExecuteEarnTransactionParams, WithdrawFromEarnVaultParams } from './earn.types.js'; type EarnStepErrorCode = 'yield_step_expired' | 'yield_step_failed' | 'yield_step_send_failed' | 'yield_step_confirmation_unknown'; /** * A transaction in the sequence could not land. Transactions before `ordinal` already * confirmed on-chain, so the action may be partially applied. */ export declare class EarnSolanaStepError extends Error { readonly code: EarnStepErrorCode; readonly ordinal: number; readonly signature?: string; constructor({ cause, code, ordinal, reason, signature, total, }: { cause?: Error; code: EarnStepErrorCode; ordinal: number; reason: string; signature?: string; total: number; }); } type SignEarnTransaction = (args: { walletMetadata: WalletMetadata; transaction: Transaction | VersionedTransaction; password?: string; externalServerKeyShares?: ServerKeyShare[]; sponsor?: boolean; chainId?: string; context?: SignMessageContext; }) => Promise; /** Primitives the Earn client borrows from whoever owns the wallet. */ export type SvmEarnClientDeps = { getEarnClient: () => EarnClient; signTransaction: SignEarnTransaction; }; /** * Builds a stateless Earn client for Solana vaults: it prepares vault actions through the * Dynamic API and executes the returned ordered transaction sequence one transaction at a * time — never in parallel, because a later transaction can depend on the state an earlier * one wrote. If one fails, the sequence stops and the thrown {@link EarnSolanaStepError} * reports how much of the action already landed. * * Gas sponsorship is opt-in (`sponsored: true`): vault transactions are built with the * owner as fee payer, unlike the browser SDK which sponsors automatically. */ export declare const createSvmEarnClient: ({ getEarnClient, signTransaction }: SvmEarnClientDeps) => { executeEarnTransaction: ({ signingPayload, walletMetadata, password, externalServerKeyShares, sponsored, rpcUrl, chainId, context, onStepChange, onTransactionStepChange, }: ExecuteEarnTransactionParams) => Promise; depositToEarnVault: ({ vaultId, amount, receiverAddress, traceContext, ...walletParams }: DepositToEarnVaultParams) => Promise; withdrawFromEarnVault: ({ vaultId, amount, receiverAddress, traceContext, ...walletParams }: WithdrawFromEarnVaultParams) => Promise; claimEarnRewards: ({ vaultId, traceContext, ...walletParams }: ClaimEarnRewardsParams) => Promise; }; export {}; //# sourceMappingURL=earn.client.d.ts.map