import { CoinStruct } from '@mysten/sui/jsonRpc'; import { NaviSdkServiceOptions } from './services.js'; export type NaviSuiNetwork = 'mainnet' | 'testnet' | 'devnet' | 'localnet' | (string & {}); export type NaviSuiGrpcEndpoint = { url: string; headers?: Record; fetchInit?: Omit; fetch?: typeof fetch; }; export type NaviSuiGraphQLEndpoint = { url: string; headers?: Record; fetch?: typeof fetch; }; export type NaviSuiGrpcOptions = { client: NaviCoreClient; url?: never; headers?: never; fetchInit?: never; fetch?: never; } | NaviSuiGrpcEndpoint; export type NaviSuiGraphQLOptions = { client: NaviCoreClient & { query?(options: any): Promise; }; url?: never; headers?: never; fetch?: never; } | NaviSuiGraphQLEndpoint; export type NaviSuiLegacyJsonRpcOptions = { client: NaviJsonRpcCompatClient; url?: never; } | { url: string; }; export type NaviSuiClientOptions = { network: NaviSuiNetwork; grpc: NaviSuiGrpcOptions; graphql?: NaviSuiGraphQLOptions; /** * @deprecated JSON-RPC is a short-lived compatibility transport. New main paths must use gRPC/Core. */ legacyJsonRpc?: NaviSuiLegacyJsonRpcOptions; services?: NaviSdkServiceOptions; }; export type NaviSuiClientBundle = { network: NaviSuiNetwork; coreClient: NaviCoreClient; grpc: NaviCoreClient; graphql?: NaviCoreClient & { query?(options: any): Promise; }; /** * @deprecated JSON-RPC is a short-lived compatibility transport. */ legacyJsonRpc?: NaviJsonRpcCompatClient; services?: NaviSdkServiceOptions; }; type SuiAddressBalanceLike = { coinType?: string | null; balance?: string | number | bigint | null; totalBalance?: string | number | bigint | null; coinBalance?: string | number | bigint | null; addressBalance?: string | number | bigint | null; fundsInAddressBalance?: string | number | bigint | null; coinObjectCount?: number | null; }; export type NaviCoreClient = { core: unknown; }; export type NaviJsonRpcCompatClient = NaviCoreClient & { devInspectTransactionBlock(options: any): Promise; dryRunTransactionBlock(options: any): Promise; executeTransactionBlock(options: any): Promise; getAllCoins(options: any): Promise; getCoinMetadata(options: any): Promise; getCoins(options: any): Promise; getDynamicFieldObject(options: any): Promise; getObject(options: any): Promise; getTransactionBlock(options: any): Promise; multiGetObjects(options: any): Promise; signAndExecuteTransaction(options: any): Promise; waitForTransaction(options: any): Promise; }; export type NaviSuiClient = NaviCoreClient & Partial; export type NaviAddressBalance = { coinType: string; totalBalance: string; coinBalance: string; addressBalance: string; coinObjectCount?: number; }; export declare class NaviMissingGraphQLClientError extends Error { constructor(capability: string); } export declare function normalizeAddressBalance(balance: SuiAddressBalanceLike, fallbackCoinType?: string): NaviAddressBalance; export declare function getCoinObjectOnlyBalance(coins: CoinStruct[], coinType?: string): string; export declare function getAddressBalance(client: NaviCoreClient, options: { owner: string; coinType?: string; }): Promise; export declare function listAddressBalances(client: NaviCoreClient, options: { owner: string; cursor?: string | null; limit?: number; }): Promise<{ balances: NaviAddressBalance[]; nextCursor: string | null; }>; export declare function createNaviLegacyJsonRpcClient(network: NaviSuiNetwork, legacyJsonRpc: NaviSuiLegacyJsonRpcOptions): NaviJsonRpcCompatClient; export declare function createNaviSuiClientBundle(options: NaviSuiClientOptions): NaviSuiClientBundle; export declare function requireNaviGraphQLClient(bundle: Pick, capability: string): NaviCoreClient & { query?(options: any): Promise; }; /** Public mainnet gRPC endpoint used when no client is provided (same idea as v1's getFullnodeUrl('mainnet')). */ export declare const PUBLIC_MAINNET_GRPC_URL = "https://fullnode.mainnet.sui.io:443"; export declare function createNaviSuiClient(options: NaviSuiClientOptions): NaviSuiClientBundle; /** * @deprecated JSON-RPC is a short-lived compatibility transport. Use * `createNaviSuiClientBundle({ network, grpc, legacyJsonRpc? })` for release paths. */ export declare function createNaviSuiClient(url: string, network?: NaviSuiNetwork): NaviJsonRpcCompatClient; export declare function createNaviSuiClient(): NaviSuiClient; export {}; //# sourceMappingURL=sui.d.ts.map