@oma3/omatrust 0.1.0-alpha.0 → 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { keccak256, toUtf8Bytes, getAddress, isAddress, sha256, ZeroAddress, Signature, Contract, formatUnits, verifyTypedData, hexlify, randomBytes, id } from 'ethers';
1
+ import { keccak256, toUtf8Bytes, isAddress, getAddress, sha256, ZeroAddress, Signature, Contract, formatUnits, verifyTypedData, hexlify, randomBytes, id } from 'ethers';
2
2
  import canonicalize from 'canonicalize';
3
3
  import { SchemaEncoder, EAS } from '@ethereum-attestation-service/eas-sdk';
4
4
  import { resolveTxt } from 'dns/promises';
@@ -241,8 +241,7 @@ function computeDidAddress(didHash) {
241
241
  if (!/^0x[0-9a-fA-F]{64}$/.test(didHash)) {
242
242
  throw new OmaTrustError("INVALID_DID", "didHash must be 32-byte hex", { didHash });
243
243
  }
244
- const truncated = `0x${didHash.slice(-40)}`;
245
- return getAddress(truncated);
244
+ return `0x${didHash.slice(-40).toLowerCase()}`;
246
245
  }
247
246
  function didToAddress(did) {
248
247
  return computeDidAddress(computeDidHash(did));