@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Did, 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-
|
|
1
|
+
import { D as Did, 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';
|
|
2
2
|
|
|
3
3
|
declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
|
|
4
4
|
valid: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as Did, 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-
|
|
1
|
+
import { D as Did, 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.cjs';
|
|
2
2
|
|
|
3
3
|
declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
|
|
4
4
|
valid: boolean;
|
package/dist/index.cjs
CHANGED
|
@@ -768,7 +768,14 @@ async function submitDelegatedAttestation(params) {
|
|
|
768
768
|
var EAS_EVENT_ABI = [
|
|
769
769
|
"event Attested(address indexed recipient, address indexed attester, bytes32 uid, bytes32 indexed schemaUID)"
|
|
770
770
|
];
|
|
771
|
-
function
|
|
771
|
+
function parseEventTxHash(event) {
|
|
772
|
+
const txHash = event.transactionHash;
|
|
773
|
+
if (typeof txHash !== "string") {
|
|
774
|
+
return void 0;
|
|
775
|
+
}
|
|
776
|
+
return /^0x[0-9a-fA-F]{64}$/.test(txHash) ? txHash : void 0;
|
|
777
|
+
}
|
|
778
|
+
function parseAttestation(attestation, schema, txHash) {
|
|
772
779
|
const rawData = attestation.data ?? "0x";
|
|
773
780
|
const decoded = schema ? decodeAttestationData(schema, rawData) : {};
|
|
774
781
|
const toBigIntSafe = (value) => {
|
|
@@ -788,6 +795,7 @@ function parseAttestation(attestation, schema) {
|
|
|
788
795
|
schema: attestation.schema,
|
|
789
796
|
attester: attestation.attester,
|
|
790
797
|
recipient: attestation.recipient,
|
|
798
|
+
txHash,
|
|
791
799
|
revocable: Boolean(attestation.revocable),
|
|
792
800
|
revocationTime: toBigIntSafe(attestation.revocationTime),
|
|
793
801
|
expirationTime: toBigIntSafe(attestation.expirationTime),
|
|
@@ -846,7 +854,7 @@ async function getAttestationsForDid(params) {
|
|
|
846
854
|
if (!attestation || !attestation.uid) {
|
|
847
855
|
continue;
|
|
848
856
|
}
|
|
849
|
-
results.push(parseAttestation(attestation));
|
|
857
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
850
858
|
}
|
|
851
859
|
results.sort((a, b) => Number(b.time - a.time));
|
|
852
860
|
return results;
|
|
@@ -886,7 +894,7 @@ async function getLatestAttestations(params) {
|
|
|
886
894
|
if (!attestation || !attestation.uid) {
|
|
887
895
|
continue;
|
|
888
896
|
}
|
|
889
|
-
results.push(parseAttestation(attestation));
|
|
897
|
+
results.push(parseAttestation(attestation, void 0, parseEventTxHash(event)));
|
|
890
898
|
}
|
|
891
899
|
results.sort((a, b) => Number(b.time - a.time));
|
|
892
900
|
return results.slice(0, params.limit ?? 20);
|