@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
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { i as identity } from './index-QZDExA4I.cjs';
|
|
2
|
-
export { i as reputation } from './index-
|
|
2
|
+
export { i as reputation } from './index-ByNU5VpJ.cjs';
|
|
3
3
|
export { i as appRegistry } from './index-_Bkhoj8k.cjs';
|
|
4
|
-
import './eip712-
|
|
4
|
+
import './eip712-Dx9kvqtn.cjs';
|
|
5
5
|
|
|
6
6
|
declare class OmaTrustError extends Error {
|
|
7
7
|
code: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { i as identity } from './index-QZDExA4I.js';
|
|
2
|
-
export { i as reputation } from './index-
|
|
2
|
+
export { i as reputation } from './index-BUWbuvqZ.js';
|
|
3
3
|
export { i as appRegistry } from './index-_Bkhoj8k.js';
|
|
4
|
-
import './eip712-
|
|
4
|
+
import './eip712-Dx9kvqtn.js';
|
|
5
5
|
|
|
6
6
|
declare class OmaTrustError extends Error {
|
|
7
7
|
code: string;
|
package/dist/index.js
CHANGED
|
@@ -762,7 +762,14 @@ async function submitDelegatedAttestation(params) {
|
|
|
762
762
|
var EAS_EVENT_ABI = [
|
|
763
763
|
"event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
|
|
764
764
|
];
|
|
765
|
-
function
|
|
765
|
+
function parseEventTxHash(event) {
|
|
766
|
+
const txHash = event.transactionHash;
|
|
767
|
+
if (typeof txHash !== "string") {
|
|
768
|
+
return void 0;
|
|
769
|
+
}
|
|
770
|
+
return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
|
|
771
|
+
}
|
|
772
|
+
function parseAttestation(attestation, schema, txHash) {
|
|
766
773
|
const rawData = attestation.data ?? "0x";
|
|
767
774
|
const decoded = schema ? decodeAttestationData(schema, rawData) : {};
|
|
768
775
|
const toBigIntSafe = (value) => {
|
|
@@ -782,6 +789,7 @@ function parseAttestation(attestation, schema) {
|
|
|
782
789
|
schema: attestation.schema,
|
|
783
790
|
attester: attestation.attester,
|
|
784
791
|
recipient: attestation.recipient,
|
|
792
|
+
txHash,
|
|
785
793
|
revocable: Boolean(attestation.revocable),
|
|
786
794
|
revocationTime: toBigIntSafe(attestation.revocationTime),
|
|
787
795
|
expirationTime: toBigIntSafe(attestation.expirationTime),
|
|
@@ -840,7 +848,7 @@ async function getAttestationsForDid(params) {
|
|
|
840
848
|
if (!attestation || !attestation.uid) {
|
|
841
849
|
continue;
|
|
842
850
|
}
|
|
843
|
-
results.push(parseAttestation(attestation));
|
|
851
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
844
852
|
}
|
|
845
853
|
results.sort((a, b) => Number(b.time - a.time));
|
|
846
854
|
return results;
|
|
@@ -880,7 +888,7 @@ async function getLatestAttestations(params) {
|
|
|
880
888
|
if (!attestation || !attestation.uid) {
|
|
881
889
|
continue;
|
|
882
890
|
}
|
|
883
|
-
results.push(parseAttestation(attestation));
|
|
891
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
884
892
|
}
|
|
885
893
|
results.sort((a, b) => Number(b.time - a.time));
|
|
886
894
|
return results.slice(0, params.limit ?? 20);
|