@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.
@@ -1,5 +1,5 @@
1
- import { D as Did } from '../eip712-C4a-JGko.js';
2
- export { 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 } from '../eip712-Dx9kvqtn.js';
2
+ export { 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';
3
3
 
4
4
  declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
5
5
  valid: boolean;
@@ -558,7 +558,14 @@ async function submitDelegatedAttestation(params) {
558
558
  var EAS_EVENT_ABI = [
559
559
  "event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
560
560
  ];
561
- function parseAttestation(attestation, schema) {
561
+ function parseEventTxHash(event) {
562
+ const txHash = event.transactionHash;
563
+ if (typeof txHash !== "string") {
564
+ return void 0;
565
+ }
566
+ return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
567
+ }
568
+ function parseAttestation(attestation, schema, txHash) {
562
569
  const rawData = attestation.data ?? "0x";
563
570
  const decoded = schema ? decodeAttestationData(schema, rawData) : {};
564
571
  const toBigIntSafe = (value) => {
@@ -578,6 +585,7 @@ function parseAttestation(attestation, schema) {
578
585
  schema: attestation.schema,
579
586
  attester: attestation.attester,
580
587
  recipient: attestation.recipient,
588
+ txHash,
581
589
  revocable: Boolean(attestation.revocable),
582
590
  revocationTime: toBigIntSafe(attestation.revocationTime),
583
591
  expirationTime: toBigIntSafe(attestation.expirationTime),
@@ -636,7 +644,7 @@ async function getAttestationsForDid(params) {
636
644
  if (!attestation || !attestation.uid) {
637
645
  continue;
638
646
  }
639
- results.push(parseAttestation(attestation));
647
+ results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
640
648
  }
641
649
  results.sort((a, b) => Number(b.time - a.time));
642
650
  return results;
@@ -676,7 +684,7 @@ async function getLatestAttestations(params) {
676
684
  if (!attestation || !attestation.uid) {
677
685
  continue;
678
686
  }
679
- results.push(parseAttestation(attestation));
687
+ results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
680
688
  }
681
689
  results.sort((a, b) => Number(b.time - a.time));
682
690
  return results.slice(0, params.limit ?? 20);