getAccountIndex function

num getAccountIndex(
  1. String? hezAccountIndex
)

Extracts the account index from the address with the hez prefix

@param {String} hezAccountIndex - Account index with hez prefix e.g. hez:DAI:4444

@returns {num} accountIndex - e.g. 4444

Implementation

num getAccountIndex(String? hezAccountIndex) {
  if (hezAccountIndex != null) {
    int colonIndex = hezAccountIndex.lastIndexOf(':') + 1;
    return num.parse(hezAccountIndex.substring(colonIndex));
  } else {
    return -1;
  }
}