import { createSolanaRpc, fetchEncodedAccount, } from '@solana/kit';
export function createRpc(url) {
    return createSolanaRpc(url);
}
// Returns MaybeEncodedAccount to preserve Kit's explicit existence-check shape.
// Callers should branch on .exists or use assertAccountExists().
export async function fetchAccount(rpc, address) {
    return fetchEncodedAccount(rpc, address);
}
/**
 * Fetches raw account data bytes, returning null when the account does not exist.
 */
export async function fetchAccountDataRaw(rpc, address) {
    const maybeAccount = await fetchEncodedAccount(rpc, address, {
        commitment: 'confirmed',
    });
    if (!maybeAccount.exists)
        return null;
    return maybeAccount.data;
}
//# sourceMappingURL=rpc.js.map