addressToBytes static method

List<int> addressToBytes(
  1. String address
)

convert address string to bytes without padding special addresses.

Implementation

static List<int> addressToBytes(String address) {
  address = StringUtils.strip0x(address);
  List<int>? bytes = BytesUtils.tryFromHexString(
    address,
    paddingZero: address.length < 2,
  );
  if (bytes?.length != SuiAddrConst.addressBytesLength) {
    throw AddressConverterException.addressValidationFailed(
      details: {"address": address},
    );
  }
  return bytes!;
}