@orangecheck/sdk 1.14.0 → 1.14.1

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.mjs CHANGED
@@ -748,13 +748,16 @@ async function discoverAttestations(options) {
748
748
  throw new Error("Must provide attestationId, address, or identity");
749
749
  }
750
750
  const envelopes = [];
751
+ const kept = /* @__PURE__ */ new Set();
751
752
  for (const event of events) {
752
753
  const envelope = parseAttestationFromEvent(event);
754
+ if (envelope && kept.has(envelope.attestation_id)) continue;
753
755
  if (envelope && !eventIndexesEnvelope(event, envelope)) {
754
756
  log3.warn({ eventId: event.id }, "Skipping event whose index tags disagree with its envelope");
755
757
  } else if (envelope) {
756
758
  const isValid = await verifyAttestationEnvelope(envelope);
757
759
  if (isValid) {
760
+ kept.add(envelope.attestation_id);
758
761
  envelopes.push(envelope);
759
762
  } else {
760
763
  log3.warn(