getCAIPWithChainId function

String getCAIPWithChainId(
  1. String address,
  2. int chainId, [
  3. String? msg
])

Implementation

String getCAIPWithChainId(String address, int chainId, [String? msg]) {
  if (isValidETHAddress(address)) {
    if (!address.contains('eip155:')) {
      return 'eip155:$chainId:$address';
    } else {
      return address;
    }
  } else {
    throw Error();
  }
}