Solana constructor

Solana({
  1. required String solanaRpcEndpoint,
  2. String? solanaWssEndpoint,
  3. Duration timeoutDuration = const Duration(seconds: 60),
})

Implementation

Solana(
    {required String solanaRpcEndpoint,
    String? solanaWssEndpoint,
    Duration timeoutDuration = const Duration(seconds: 60)}) {
  solanaWssEndpoint = solanaWssEndpoint ?? solanaRpcEndpoint.replaceAll('http', 'ws');
  client = SolanaClient(
      rpcUrl: Uri.parse(solanaRpcEndpoint), websocketUrl: Uri.parse(solanaWssEndpoint), timeout: timeoutDuration);
}