import type { OpenfortEmbeddedSolanaWalletProvider, SolanaCluster, SolanaCommitment } from './types.js'; /** Decimal SOL → lamports, without floating-point loss. */ /** @internal Exported for focused validation tests; not part of a package entry point. */ export declare function solToLamports(amountSol: number): bigint; type SendSolParams = { from: string; to: string; amountSol: number; provider: OpenfortEmbeddedSolanaWalletProvider; rpcUrl: string; commitment?: SolanaCommitment; }; /** * Build, sign, and broadcast a native SOL transfer. Returns the transaction * signature (base58). The wallet pays the network fee — use {@link sendSolGasless} * to sponsor it. */ export declare function sendSol({ from, to, amountSol, provider, rpcUrl, commitment, }: SendSolParams): Promise; type SendSplTokenParams = { from: string; to: string; /** SPL mint address (base58). */ mint: string; /** Amount in token base units (already scaled by `decimals`). */ amount: bigint; decimals: number; provider: OpenfortEmbeddedSolanaWalletProvider; rpcUrl: string; commitment?: SolanaCommitment; }; /** * Reads which token program owns a mint. * * Token-2022 mints live under a different program than legacy SPL ones, and the * asset list surfaces both. Deriving the associated token account under the * wrong program yields an address that does not exist, so the transfer fails on * simulation with an error that says nothing useful. */ export declare function resolveTokenProgram(rpc: { getAccountInfo: (address: never, config?: never) => { send: () => Promise<{ value: unknown; }>; }; }, mint: string, fallback: string, commitment?: SolanaCommitment): Promise; /** * Rejects a recipient that is itself a token account. * * Deriving an associated token account for one produces an address nobody can * sign for, so the transfer would confirm and the tokens would be unspendable * forever. Pasting a token account off an explorer is an easy mistake to make, * and nothing on-chain reports it as an error. */ export declare function assertTransferableRecipient(rpc: { getAccountInfo: (address: never, config?: never) => { send: () => Promise<{ value: unknown; }>; }; }, recipient: string, commitment?: SolanaCommitment): Promise; /** * Build, sign, and broadcast an SPL token transfer. Creates the recipient's * associated token account if it doesn't exist yet (idempotent — a no-op when it * already holds the token; the sender pays the small rent). The wallet pays the * network fee — use {@link sendSplTokenGasless} to sponsor it. Returns the * transaction signature (base58). */ export declare function sendSplToken({ from, to, mint, amount, decimals, provider, rpcUrl, commitment, }: SendSplTokenParams): Promise; /** The Openfort Solana paymaster (Kora) endpoint for a cluster. */ /** @internal Exported for focused configuration tests; not part of a package entry point. */ export declare function koraRpcUrl(cluster: SolanaCluster, backendUrl?: string): string; /** * Refuses a fee payment that touches an account the caller never asked about. * * The amount and the payment destination are the paymaster's to decide, and the * user's signature is the only authority on the transaction — so a payment * instruction naming an account outside the fee transfer is debiting something * other than the fee. */ /** @internal Exported for focused validation tests; not part of a package entry point. */ export declare function assertKoraPaymentIsExpected(payment: { payment_token?: string; payment_amount?: number; payment_instruction?: { accounts?: readonly { address?: string; }[]; }; }, request: { feeToken: string; expectedAccounts: readonly string[]; }): void; type SendSolGaslessParams = { from: string; to: string; amountSol: number; provider: OpenfortEmbeddedSolanaWalletProvider; cluster: SolanaCluster; /** Project publishable key; sent to the Openfort Solana paymaster (Kora) as a Bearer token. */ publishableKey: string; /** SPL mint the user pays the network fee in. Omitted when the project pays. */ feeToken?: string; /** Openfort API base URL. Defaults to the SDK configuration. */ backendUrl?: string; /** Read endpoint used to confirm the broadcast transaction. */ rpcUrl?: string; commitment?: SolanaCommitment; }; /** Send a native SOL transfer with fees sponsored by the Openfort paymaster (Kora). */ export declare function sendSolGasless({ from, to, amountSol, provider, cluster, publishableKey, feeToken, backendUrl, rpcUrl, commitment, }: SendSolGaslessParams): Promise; type SendSplTokenGaslessParams = { from: string; to: string; /** SPL mint address (base58). */ mint: string; /** Amount in token base units (already scaled by `decimals`). */ amount: bigint; /** Decimals of `mint`, carried into the `transferChecked` instruction. */ decimals: number; provider: OpenfortEmbeddedSolanaWalletProvider; cluster: SolanaCluster; /** Project publishable key; sent to the Openfort Solana paymaster (Kora) as a Bearer token. */ publishableKey: string; /** SPL mint the user pays the network fee in. Omitted when the project pays. */ feeToken?: string; /** Openfort API base URL. Defaults to the SDK configuration. */ backendUrl?: string; /** Read endpoint used to confirm the broadcast transaction. */ rpcUrl?: string; commitment?: SolanaCommitment; }; /** Send an SPL token transfer with fees sponsored by the Openfort paymaster (Kora). */ export declare function sendSplTokenGasless({ from, to, mint, amount, decimals, provider, cluster, publishableKey, feeToken, backendUrl, rpcUrl, commitment, }: SendSplTokenGaslessParams): Promise; /** * Read the network fee (in lamports) for a single-signer transfer from the RPC * via `getFeeForMessage`. Returns null on any failure so callers can fall back to * a neutral "--" rather than a fabricated number. The base fee is per-signature * and identical for native and SPL transfers (a single fee-payer signature), so a * representative SOL transfer message is enough to price it. */ export declare function estimateSolanaTransferFeeLamports({ from, to, rpcUrl, }: { from: string; to: string; rpcUrl: string; }): Promise; export {};