@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
|
@@ -564,7 +564,14 @@ async function submitDelegatedAttestation(params) {
|
|
|
564
564
|
var EAS_EVENT_ABI = [
|
|
565
565
|
"event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
|
|
566
566
|
];
|
|
567
|
-
function
|
|
567
|
+
function parseEventTxHash(event) {
|
|
568
|
+
const txHash = event.transactionHash;
|
|
569
|
+
if (typeof txHash !== "string") {
|
|
570
|
+
return void 0;
|
|
571
|
+
}
|
|
572
|
+
return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
|
|
573
|
+
}
|
|
574
|
+
function parseAttestation(attestation, schema, txHash) {
|
|
568
575
|
const rawData = attestation.data ?? "0x";
|
|
569
576
|
const decoded = schema ? decodeAttestationData(schema, rawData) : {};
|
|
570
577
|
const toBigIntSafe = (value) => {
|
|
@@ -584,6 +591,7 @@ function parseAttestation(attestation, schema) {
|
|
|
584
591
|
schema: attestation.schema,
|
|
585
592
|
attester: attestation.attester,
|
|
586
593
|
recipient: attestation.recipient,
|
|
594
|
+
txHash,
|
|
587
595
|
revocable: Boolean(attestation.revocable),
|
|
588
596
|
revocationTime: toBigIntSafe(attestation.revocationTime),
|
|
589
597
|
expirationTime: toBigIntSafe(attestation.expirationTime),
|
|
@@ -642,7 +650,7 @@ async function getAttestationsForDid(params) {
|
|
|
642
650
|
if (!attestation || !attestation.uid) {
|
|
643
651
|
continue;
|
|
644
652
|
}
|
|
645
|
-
results.push(parseAttestation(attestation));
|
|
653
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
646
654
|
}
|
|
647
655
|
results.sort((a, b) => Number(b.time - a.time));
|
|
648
656
|
return results;
|
|
@@ -682,7 +690,7 @@ async function getLatestAttestations(params) {
|
|
|
682
690
|
if (!attestation || !attestation.uid) {
|
|
683
691
|
continue;
|
|
684
692
|
}
|
|
685
|
-
results.push(parseAttestation(attestation));
|
|
693
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
686
694
|
}
|
|
687
695
|
results.sort((a, b) => Number(b.time - a.time));
|
|
688
696
|
return results.slice(0, params.limit ?? 20);
|