@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/README.md +58 -7
- package/dist/identity/index.cjs +1 -2
- package/dist/identity/index.cjs.map +1 -1
- package/dist/identity/index.js +2 -3
- package/dist/identity/index.js.map +1 -1
- package/dist/index.cjs +1 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/reputation/index.cjs +1 -2
- package/dist/reputation/index.cjs.map +1 -1
- package/dist/reputation/index.js +1 -2
- package/dist/reputation/index.js.map +1 -1
- package/package.json +17 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { keccak256, toUtf8Bytes,
|
|
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
|
-
|
|
245
|
-
return getAddress(truncated);
|
|
244
|
+
return `0x${didHash.slice(-40).toLowerCase()}`;
|
|
246
245
|
}
|
|
247
246
|
function didToAddress(did) {
|
|
248
247
|
return computeDidAddress(computeDidHash(did));
|