init static method

dynamic init(
  1. ChainInfo chainInfo,
  2. Env env
)

Init particle-base SDK

chainInfo Chain info, for example EthereumChain, BscChain.

env Development environment.

Implementation

static init(ChainInfo chainInfo, Env env) async {
  if (Platform.isIOS) {
    await _channel.invokeMethod(
        'initialize',
        jsonEncode({
          "chain_name": chainInfo.name,
          "chain_id": chainInfo.id,
          "env": env.name
        }));
  } else {
    await _channel.invokeMethod(
        'init',
        jsonEncode({
          "chain_name": chainInfo.name,
          "chain_id": chainInfo.id,
          "env": env.name
        }));
  }
}