calcBlockRef function

String calcBlockRef(
  1. String blockId
)

Calculate a blockRef from a given block_id, id should starts with 0x

Implementation

String calcBlockRef(String blockId) {
  if (!blockId.startsWith("0x")) {
    throw Exception("block_id should start with 0x");
  }

  return blockId.substring(0, 18);
}