getSystemContract function

Future<SystemContract> getSystemContract(
  1. CKBApiClient _ckbApiClient
)

Implementation

Future<SystemContract> getSystemContract(CKBApiClient _ckbApiClient) async {
  Block block = await _ckbApiClient.genesisBlock();
  if (block.transactions == null || block.transactions.length < 2)
    throw NoSystemContactException();
  return SystemContract(block.transactions[0].outputs[1].type.codeHash,
      OutPoint(block.transactions[1].hash, "0"));
}