UNPKG

@snowflake-so/safe-saber-walletkit

Version:

Snowflake Safe forked version of @saberhq/use-solana package. Used for integration purpose.

27 lines (26 loc) 989 B
import type { Network, NetworkConfig } from '@saberhq/solana-contrib'; import type { Commitment } from '@solana/web3.js'; import { Connection } from '@solana/web3.js'; import type { StorageAdapter } from '../storage'; export declare type PartialNetworkConfigMap = { [N in Network]?: Partial<NetworkConfig>; }; export interface ConnectionContext { connection: Connection; sendConnection: Connection; network: Network; setNetwork: (val: Network) => void | Promise<void>; endpoint: string; setEndpoints: (endpoints: Omit<NetworkConfig, 'name'>) => void | Promise<void>; } export interface ConnectionArgs { defaultNetwork?: Network; networkConfigs?: PartialNetworkConfigMap; commitment?: Commitment; storageAdapter: StorageAdapter; } /** * Handles the connection to the Solana nodes. * @returns */ export declare const useConnectionInternal: ({ defaultNetwork, networkConfigs, commitment, storageAdapter, }: ConnectionArgs) => ConnectionContext;