code: function getChecksumAddress(address) {
      if (typeof (address) !== 'string' || !address.match(/^0x[0-9A-Fa-f]{40}$/)) {
          errors.throwError('invalid address', errors.INVALID_ARGUMENT, { arg: 'address', value: address });
      }
      address = address.toLowerCase();
      var chars = address.substring(2).split('');
      var hashed = new Uint8Array(40);
      for (var i_1 = 0; i_1 < 40; i_1++) {
          hashed[i_1] = chars[i_1].charCodeAt(0);
      }
      hashed = bytes_1.arrayify(keccak256_1.keccak256(hashed));
      for (var i = 0; i < 40; i += 2) {
          if ((hashed[i >> 1] >> 4) >= 8) {
              chars[i] = chars[i].toUpperCase();
          }
          if ((hashed[i >> 1] & 0x0f) >= 8) {
              chars[i + 1] = chars[i + 1].toUpperCase();
          }
      }
      return '0x' + chars.join('');
  }
docs: /////////////////////////////