@oma3/omatrust 0.1.0-alpha.4 → 0.1.0-alpha.5

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.
@@ -12,6 +12,7 @@ type AttestationQueryResult = {
12
12
  schema: Hex;
13
13
  attester: Hex;
14
14
  recipient: Hex;
15
+ txHash?: Hex;
15
16
  revocable: boolean;
16
17
  revocationTime: bigint;
17
18
  expirationTime: bigint;
@@ -12,6 +12,7 @@ type AttestationQueryResult = {
12
12
  schema: Hex;
13
13
  attester: Hex;
14
14
  recipient: Hex;
15
+ txHash?: Hex;
15
16
  revocable: boolean;
16
17
  revocationTime: bigint;
17
18
  expirationTime: bigint;
@@ -1,4 +1,4 @@
1
- import { D as Did, A as AttestationQueryResult, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, a as CallControllerWitnessResult, b as ChainConstants, c as CreatePopEip712ProofParams, d as CreatePopJwsProofParams, E as EvidencePointerProof, G as GetAttestationParams, e as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, f as PopJwsProof, g as PrepareDelegatedAttestationParams, h as PrepareDelegatedAttestationResult, i as ProofPurpose, j as ProofType, k as ProofWrapper, S as SchemaField, l as SubmitAttestationParams, m as SubmitAttestationResult, n as SubmitDelegatedAttestationParams, o as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, p as TxInteractionProof, V as VerifyAttestationParams, q as VerifyAttestationResult, r as VerifyProofParams, s as VerifyProofResult, X as X402OfferProof, t as X402ReceiptProof, u as buildDelegatedAttestationTypedData, v as buildDelegatedTypedDataFromEncoded, w as buildDnsTxtRecord, x as buildEip712Domain, y as calculateAverageUserReviewRating, z as calculateTransferAmount, F as calculateTransferAmountFromAddresses, I as callControllerWitness, J as constructSeed, K as createEvidencePointerProof, M as createPopEip712Proof, N as createPopJwsProof, O as createTxEncodedValueProof, Q as createTxInteractionProof, R as createX402OfferProof, U as createX402ReceiptProof, W as decodeAttestationData, Y as deduplicateReviews, Z as encodeAttestationData, _ as extractAddressesFromDidDocument, $ as extractExpirationTime, a0 as fetchDidDocument, a1 as formatSchemaUid, a2 as formatTransferAmount, a3 as getAttestation, a4 as getAttestationsForDid, a5 as getChainConstants, a6 as getExplorerAddressUrl, a7 as getExplorerTxUrl, a8 as getLatestAttestations, a9 as getMajorVersion, aa as getOmaTrustProofEip712Types, ab as getSchemaDetails, ac as getSupportedChainIds, ad as hashSeed, ae as isChainSupported, af as listAttestations, ag as normalizeSchema, ah as parseDnsTxtRecord, ai as prepareDelegatedAttestation, aj as schemaToString, ak as splitSignature, al as submitAttestation, am as submitDelegatedAttestation, an as verifyAttestation, ao as verifyDidDocumentControllerDid, ap as verifyEip712Signature, aq as verifyProof, ar as verifySchemaExists } from './eip712-C4a-JGko.js';
1
+ import { D as Did, A as AttestationQueryResult, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, a as CallControllerWitnessResult, b as ChainConstants, c as CreatePopEip712ProofParams, d as CreatePopJwsProofParams, E as EvidencePointerProof, G as GetAttestationParams, e as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, f as PopJwsProof, g as PrepareDelegatedAttestationParams, h as PrepareDelegatedAttestationResult, i as ProofPurpose, j as ProofType, k as ProofWrapper, S as SchemaField, l as SubmitAttestationParams, m as SubmitAttestationResult, n as SubmitDelegatedAttestationParams, o as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, p as TxInteractionProof, V as VerifyAttestationParams, q as VerifyAttestationResult, r as VerifyProofParams, s as VerifyProofResult, X as X402OfferProof, t as X402ReceiptProof, u as buildDelegatedAttestationTypedData, v as buildDelegatedTypedDataFromEncoded, w as buildDnsTxtRecord, x as buildEip712Domain, y as calculateAverageUserReviewRating, z as calculateTransferAmount, F as calculateTransferAmountFromAddresses, I as callControllerWitness, J as constructSeed, K as createEvidencePointerProof, M as createPopEip712Proof, N as createPopJwsProof, O as createTxEncodedValueProof, Q as createTxInteractionProof, R as createX402OfferProof, U as createX402ReceiptProof, W as decodeAttestationData, Y as deduplicateReviews, Z as encodeAttestationData, _ as extractAddressesFromDidDocument, $ as extractExpirationTime, a0 as fetchDidDocument, a1 as formatSchemaUid, a2 as formatTransferAmount, a3 as getAttestation, a4 as getAttestationsForDid, a5 as getChainConstants, a6 as getExplorerAddressUrl, a7 as getExplorerTxUrl, a8 as getLatestAttestations, a9 as getMajorVersion, aa as getOmaTrustProofEip712Types, ab as getSchemaDetails, ac as getSupportedChainIds, ad as hashSeed, ae as isChainSupported, af as listAttestations, ag as normalizeSchema, ah as parseDnsTxtRecord, ai as prepareDelegatedAttestation, aj as schemaToString, ak as splitSignature, al as submitAttestation, am as submitDelegatedAttestation, an as verifyAttestation, ao as verifyDidDocumentControllerDid, ap as verifyEip712Signature, aq as verifyProof, ar as verifySchemaExists } from './eip712-Dx9kvqtn.js';
2
2
 
3
3
  declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
4
4
  valid: boolean;
@@ -1,4 +1,4 @@
1
- import { D as Did, A as AttestationQueryResult, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, a as CallControllerWitnessResult, b as ChainConstants, c as CreatePopEip712ProofParams, d as CreatePopJwsProofParams, E as EvidencePointerProof, G as GetAttestationParams, e as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, f as PopJwsProof, g as PrepareDelegatedAttestationParams, h as PrepareDelegatedAttestationResult, i as ProofPurpose, j as ProofType, k as ProofWrapper, S as SchemaField, l as SubmitAttestationParams, m as SubmitAttestationResult, n as SubmitDelegatedAttestationParams, o as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, p as TxInteractionProof, V as VerifyAttestationParams, q as VerifyAttestationResult, r as VerifyProofParams, s as VerifyProofResult, X as X402OfferProof, t as X402ReceiptProof, u as buildDelegatedAttestationTypedData, v as buildDelegatedTypedDataFromEncoded, w as buildDnsTxtRecord, x as buildEip712Domain, y as calculateAverageUserReviewRating, z as calculateTransferAmount, F as calculateTransferAmountFromAddresses, I as callControllerWitness, J as constructSeed, K as createEvidencePointerProof, M as createPopEip712Proof, N as createPopJwsProof, O as createTxEncodedValueProof, Q as createTxInteractionProof, R as createX402OfferProof, U as createX402ReceiptProof, W as decodeAttestationData, Y as deduplicateReviews, Z as encodeAttestationData, _ as extractAddressesFromDidDocument, $ as extractExpirationTime, a0 as fetchDidDocument, a1 as formatSchemaUid, a2 as formatTransferAmount, a3 as getAttestation, a4 as getAttestationsForDid, a5 as getChainConstants, a6 as getExplorerAddressUrl, a7 as getExplorerTxUrl, a8 as getLatestAttestations, a9 as getMajorVersion, aa as getOmaTrustProofEip712Types, ab as getSchemaDetails, ac as getSupportedChainIds, ad as hashSeed, ae as isChainSupported, af as listAttestations, ag as normalizeSchema, ah as parseDnsTxtRecord, ai as prepareDelegatedAttestation, aj as schemaToString, ak as splitSignature, al as submitAttestation, am as submitDelegatedAttestation, an as verifyAttestation, ao as verifyDidDocumentControllerDid, ap as verifyEip712Signature, aq as verifyProof, ar as verifySchemaExists } from './eip712-C4a-JGko.cjs';
1
+ import { D as Did, A as AttestationQueryResult, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, a as CallControllerWitnessResult, b as ChainConstants, c as CreatePopEip712ProofParams, d as CreatePopJwsProofParams, E as EvidencePointerProof, G as GetAttestationParams, e as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, f as PopJwsProof, g as PrepareDelegatedAttestationParams, h as PrepareDelegatedAttestationResult, i as ProofPurpose, j as ProofType, k as ProofWrapper, S as SchemaField, l as SubmitAttestationParams, m as SubmitAttestationResult, n as SubmitDelegatedAttestationParams, o as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, p as TxInteractionProof, V as VerifyAttestationParams, q as VerifyAttestationResult, r as VerifyProofParams, s as VerifyProofResult, X as X402OfferProof, t as X402ReceiptProof, u as buildDelegatedAttestationTypedData, v as buildDelegatedTypedDataFromEncoded, w as buildDnsTxtRecord, x as buildEip712Domain, y as calculateAverageUserReviewRating, z as calculateTransferAmount, F as calculateTransferAmountFromAddresses, I as callControllerWitness, J as constructSeed, K as createEvidencePointerProof, M as createPopEip712Proof, N as createPopJwsProof, O as createTxEncodedValueProof, Q as createTxInteractionProof, R as createX402OfferProof, U as createX402ReceiptProof, W as decodeAttestationData, Y as deduplicateReviews, Z as encodeAttestationData, _ as extractAddressesFromDidDocument, $ as extractExpirationTime, a0 as fetchDidDocument, a1 as formatSchemaUid, a2 as formatTransferAmount, a3 as getAttestation, a4 as getAttestationsForDid, a5 as getChainConstants, a6 as getExplorerAddressUrl, a7 as getExplorerTxUrl, a8 as getLatestAttestations, a9 as getMajorVersion, aa as getOmaTrustProofEip712Types, ab as getSchemaDetails, ac as getSupportedChainIds, ad as hashSeed, ae as isChainSupported, af as listAttestations, ag as normalizeSchema, ah as parseDnsTxtRecord, ai as prepareDelegatedAttestation, aj as schemaToString, ak as splitSignature, al as submitAttestation, am as submitDelegatedAttestation, an as verifyAttestation, ao as verifyDidDocumentControllerDid, ap as verifyEip712Signature, aq as verifyProof, ar as verifySchemaExists } from './eip712-Dx9kvqtn.cjs';
2
2
 
3
3
  declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
4
4
  valid: boolean;
package/dist/index.cjs CHANGED
@@ -768,7 +768,14 @@ async function submitDelegatedAttestation(params) {
768
768
  var EAS_EVENT_ABI = [
769
769
  "event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
770
770
  ];
771
- function parseAttestation(attestation, schema) {
771
+ function parseEventTxHash(event) {
772
+ const txHash = event.transactionHash;
773
+ if (typeof txHash !== "string") {
774
+ return void 0;
775
+ }
776
+ return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
777
+ }
778
+ function parseAttestation(attestation, schema, txHash) {
772
779
  const rawData = attestation.data ?? "0x";
773
780
  const decoded = schema ? decodeAttestationData(schema, rawData) : {};
774
781
  const toBigIntSafe = (value) => {
@@ -788,6 +795,7 @@ function parseAttestation(attestation, schema) {
788
795
  schema: attestation.schema,
789
796
  attester: attestation.attester,
790
797
  recipient: attestation.recipient,
798
+ txHash,
791
799
  revocable: Boolean(attestation.revocable),
792
800
  revocationTime: toBigIntSafe(attestation.revocationTime),
793
801
  expirationTime: toBigIntSafe(attestation.expirationTime),
@@ -846,7 +854,7 @@ async function getAttestationsForDid(params) {
846
854
  if (!attestation || !attestation.uid) {
847
855
  continue;
848
856
  }
849
- results.push(parseAttestation(attestation));
857
+ results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
850
858
  }
851
859
  results.sort((a, b) => Number(b.time - a.time));
852
860
  return results;
@@ -886,7 +894,7 @@ async function getLatestAttestations(params) {
886
894
  if (!attestation || !attestation.uid) {
887
895
  continue;
888
896
  }
889
- results.push(parseAttestation(attestation));
897
+ results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
890
898
  }
891
899
  results.sort((a, b) => Number(b.time - a.time));
892
900
  return results.slice(0, params.limit ?? 20);