useSolanaConnection

1function useSolanaConnection(opts): SolanaConnection;

Defined in: account-kit/react/src/hooks/useSolanaConnection.ts:39

This hook is used for establishing a connection to Solana and returns the connection object and the signer object.

Example

import { 
function useSolanaConnection(opts?: SolanaConnectionHookParams): SolanaConnection

This hook is used for establishing a connection to Solana and returns the connection object and the signer object.

useSolanaConnection
} from "@account-kit/react";
const {
const connection: Connection | null

The solana connection used to send the transaction

connection
} =
function useSolanaConnection(opts?: SolanaConnectionHookParams): SolanaConnection

This hook is used for establishing a connection to Solana and returns the connection object and the signer object.

useSolanaConnection
();

Parameters

ParameterTypeDescription

opts

SolanaConnectionHookParams

Options for the hook to get setup

Returns

SolanaConnection

The transaction hook.