create static method

Future<JrpcTransport> create({
  1. required JrpcConnection jrpcConnection,
})

Implementation

static Future<JrpcTransport> create({
  required JrpcConnection jrpcConnection,
}) async {
  final instance = JrpcTransport._(jrpcConnection);

  final lib = createLib();
  instance.transport = await lib.newStaticMethodJrpcTransportImpl(
    jrpcConnection: jrpcConnection.connection,
  );

  instance.networkId = await instance.getNetworkId();

  instance.connectionParamsHash =
      getHash('jrpc:${jrpcConnection.settings.endpoint}');

  return instance;
}