@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.
- package/dist/{eip712-C4a-JGko.d.cts → eip712-Dx9kvqtn.d.cts} +1 -0
- package/dist/{eip712-C4a-JGko.d.ts → eip712-Dx9kvqtn.d.ts} +1 -0
- package/dist/{index-BDeQNCi_.d.ts → index-BUWbuvqZ.d.ts} +1 -1
- package/dist/{index-DP6IIpIh.d.cts → index-ByNU5VpJ.d.cts} +1 -1
- package/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/reputation/index.browser.cjs +11 -3
- package/dist/reputation/index.browser.cjs.map +1 -1
- package/dist/reputation/index.browser.d.cts +2 -2
- package/dist/reputation/index.browser.d.ts +2 -2
- package/dist/reputation/index.browser.js +11 -3
- package/dist/reputation/index.browser.js.map +1 -1
- package/dist/reputation/index.cjs +11 -3
- package/dist/reputation/index.cjs.map +1 -1
- package/dist/reputation/index.d.cts +2 -2
- package/dist/reputation/index.d.ts +2 -2
- package/dist/reputation/index.js +11 -3
- package/dist/reputation/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -565,7 +565,14 @@ async function submitDelegatedAttestation(params) {
|
|
|
565
565
|
var EAS_EVENT_ABI = [
|
|
566
566
|
"event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
|
|
567
567
|
];
|
|
568
|
-
function
|
|
568
|
+
function parseEventTxHash(event) {
|
|
569
|
+
const txHash = event.transactionHash;
|
|
570
|
+
if (typeof txHash !== "string") {
|
|
571
|
+
return void 0;
|
|
572
|
+
}
|
|
573
|
+
return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
|
|
574
|
+
}
|
|
575
|
+
function parseAttestation(attestation, schema, txHash) {
|
|
569
576
|
const rawData = attestation.data ?? "0x";
|
|
570
577
|
const decoded = schema ? decodeAttestationData(schema, rawData) : {};
|
|
571
578
|
const toBigIntSafe = (value) => {
|
|
@@ -585,6 +592,7 @@ function parseAttestation(attestation, schema) {
|
|
|
585
592
|
schema: attestation.schema,
|
|
586
593
|
attester: attestation.attester,
|
|
587
594
|
recipient: attestation.recipient,
|
|
595
|
+
txHash,
|
|
588
596
|
revocable: Boolean(attestation.revocable),
|
|
589
597
|
revocationTime: toBigIntSafe(attestation.revocationTime),
|
|
590
598
|
expirationTime: toBigIntSafe(attestation.expirationTime),
|
|
@@ -643,7 +651,7 @@ async function getAttestationsForDid(params) {
|
|
|
643
651
|
if (!attestation || !attestation.uid) {
|
|
644
652
|
continue;
|
|
645
653
|
}
|
|
646
|
-
results.push(parseAttestation(attestation));
|
|
654
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
647
655
|
}
|
|
648
656
|
results.sort((a, b) => Number(b.time - a.time));
|
|
649
657
|
return results;
|
|
@@ -683,7 +691,7 @@ async function getLatestAttestations(params) {
|
|
|
683
691
|
if (!attestation || !attestation.uid) {
|
|
684
692
|
continue;
|
|
685
693
|
}
|
|
686
|
-
results.push(parseAttestation(attestation));
|
|
694
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
687
695
|
}
|
|
688
696
|
results.sort((a, b) => Number(b.time - a.time));
|
|
689
697
|
return results.slice(0, params.limit ?? 20);
|