import { type OpenfortError } from '../../errors/base.js'; import { type UseQueryReturnType } from '../../query/useQuery.js'; /** A holding in the connected Solana wallet: native SOL or an SPL token. */ export type SolanaAsset = { /** Mint address, or 'native' for SOL. */ mint: string; symbol: string; name: string; /** Raw balance in base units (lamports for SOL, token base units otherwise). */ amount: bigint; decimals: number; isNative: boolean; }; /** * The TanStack query result, mirroring `useEthereumWalletAssets` from * `@openfort/react/ethereum`: `data` * is `null` rather than `undefined` before the first result, and `isIdle` * reports that the query is gated off because no wallet or cluster is available. */ export type UseSolanaWalletAssetsResult = Omit, 'data' | 'error'> & { data: SolanaAsset[] | null; error: OpenfortError | undefined; isIdle: boolean; }; /** * Returns the connected Solana wallet's balances: native SOL plus SPL token * holdings, read directly from the cluster RPC. The SVM counterpart of * `useEthereumWalletAssets` from `@openfort/react/ethereum`, feeding the * Solana asset inventory. * * The result refreshes when balances are invalidated — see `useInvalidateBalance`. * * @example * ```tsx * import { useSolanaWalletAssets } from '@openfort/react/solana' * * function SolanaBalances() { * const { data, error, isPending } = useSolanaWalletAssets() * if (isPending) return

Loading balances…

* if (error) return

{error.shortMessage}

* return

{data?.find((asset) => asset.isNative)?.amount ?? 0n} lamports

* } * ``` */ export declare function useSolanaWalletAssets(): UseSolanaWalletAssetsResult;