@oma3/omatrust 0.1.0-alpha.0

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.
@@ -0,0 +1,415 @@
1
+ type Hex = `0x${string}`;
2
+ type Did = string;
3
+ type ProofType = "pop-jws" | "pop-eip712" | "x402-receipt" | "evidence-pointer" | "tx-encoded-value" | "tx-interaction" | "x402-offer";
4
+ type ProofPurpose = "shared-control" | "commercial-tx";
5
+ type SchemaField = {
6
+ name: string;
7
+ type: string;
8
+ value?: unknown;
9
+ };
10
+ type AttestationQueryResult = {
11
+ uid: Hex;
12
+ schema: Hex;
13
+ attester: Hex;
14
+ recipient: Hex;
15
+ revocable: boolean;
16
+ revocationTime: bigint;
17
+ expirationTime: bigint;
18
+ time: bigint;
19
+ refUID: Hex;
20
+ data: Record<string, unknown>;
21
+ raw?: Hex;
22
+ };
23
+ type ProofWrapper = {
24
+ proofType: ProofType;
25
+ proofObject: unknown;
26
+ proofPurpose?: ProofPurpose;
27
+ version?: number;
28
+ issuedAt?: number;
29
+ expiresAt?: number;
30
+ };
31
+ type TxEncodedValueProof = ProofWrapper & {
32
+ proofType: "tx-encoded-value";
33
+ proofPurpose: ProofPurpose;
34
+ proofObject: {
35
+ chainId: string;
36
+ txHash: Hex;
37
+ };
38
+ };
39
+ type TxInteractionProof = ProofWrapper & {
40
+ proofType: "tx-interaction";
41
+ proofPurpose: "commercial-tx";
42
+ proofObject: {
43
+ chainId: string;
44
+ txHash: Hex;
45
+ };
46
+ };
47
+ type PopEip712Proof = ProofWrapper & {
48
+ proofType: "pop-eip712";
49
+ proofObject: {
50
+ domain: {
51
+ name: string;
52
+ version: string;
53
+ chainId: number;
54
+ verifyingContract?: Hex;
55
+ };
56
+ message: {
57
+ signer: string;
58
+ authorizedEntity: string;
59
+ signingPurpose: string;
60
+ creationTimestamp: number;
61
+ expirationTimestamp: number;
62
+ randomValue: Hex;
63
+ statement: string;
64
+ };
65
+ signature: Hex;
66
+ };
67
+ };
68
+ type PopJwsProof = ProofWrapper & {
69
+ proofType: "pop-jws";
70
+ proofObject: string;
71
+ };
72
+ type X402ReceiptProof = ProofWrapper & {
73
+ proofType: "x402-receipt";
74
+ proofPurpose: "commercial-tx";
75
+ proofObject: Record<string, unknown>;
76
+ };
77
+ type X402OfferProof = ProofWrapper & {
78
+ proofType: "x402-offer";
79
+ proofPurpose: "commercial-tx";
80
+ proofObject: Record<string, unknown>;
81
+ };
82
+ type EvidencePointerProof = ProofWrapper & {
83
+ proofType: "evidence-pointer";
84
+ proofPurpose: "shared-control";
85
+ proofObject: {
86
+ url: string;
87
+ };
88
+ };
89
+ type ChainConstants = {
90
+ base: bigint;
91
+ range: bigint;
92
+ decimals: number;
93
+ nativeSymbol: string;
94
+ };
95
+ type SubmitAttestationParams = {
96
+ signer: unknown;
97
+ chainId: number;
98
+ easContractAddress: Hex;
99
+ schemaUid: Hex;
100
+ schema: SchemaField[] | string;
101
+ data: Record<string, unknown>;
102
+ revocable?: boolean;
103
+ expirationTime?: bigint | number;
104
+ refUid?: Hex;
105
+ value?: bigint | number;
106
+ };
107
+ type SubmitAttestationResult = {
108
+ uid: Hex;
109
+ txHash: Hex;
110
+ receipt?: unknown;
111
+ };
112
+ type PrepareDelegatedAttestationParams = {
113
+ chainId: number;
114
+ easContractAddress: Hex;
115
+ schemaUid: Hex;
116
+ schema: SchemaField[] | string;
117
+ data: Record<string, unknown>;
118
+ attester: Hex;
119
+ nonce: bigint | number;
120
+ revocable?: boolean;
121
+ expirationTime?: bigint | number;
122
+ refUid?: Hex;
123
+ value?: bigint | number;
124
+ deadline?: bigint | number;
125
+ };
126
+ type PrepareDelegatedAttestationResult = {
127
+ delegatedRequest: Record<string, unknown>;
128
+ typedData: {
129
+ domain: Record<string, unknown>;
130
+ types: Record<string, unknown>;
131
+ message: Record<string, unknown>;
132
+ };
133
+ };
134
+ type SubmitDelegatedAttestationParams = {
135
+ relayUrl: string;
136
+ prepared: PrepareDelegatedAttestationResult;
137
+ signature: Hex | string;
138
+ attester?: Hex;
139
+ };
140
+ type SubmitDelegatedAttestationResult = {
141
+ uid: Hex;
142
+ txHash?: Hex;
143
+ status: "submitted" | "confirmed";
144
+ };
145
+ type GetAttestationParams = {
146
+ uid: Hex;
147
+ provider: unknown;
148
+ easContractAddress: Hex;
149
+ schema?: SchemaField[] | string;
150
+ };
151
+ type ListAttestationsParams = {
152
+ did: Did;
153
+ provider: unknown;
154
+ easContractAddress: Hex;
155
+ schemas?: Hex[];
156
+ limit?: number;
157
+ fromBlock?: number;
158
+ toBlock?: number;
159
+ };
160
+ type VerifyAttestationParams = {
161
+ attestation: AttestationQueryResult;
162
+ provider?: unknown;
163
+ checks?: ProofType[];
164
+ context?: Record<string, unknown>;
165
+ };
166
+ type VerifyAttestationResult = {
167
+ valid: boolean;
168
+ checks: Record<string, boolean>;
169
+ reasons: string[];
170
+ };
171
+ type CallControllerWitnessParams = {
172
+ gatewayUrl: string;
173
+ attestationUid: Hex;
174
+ chainId: number;
175
+ easContract: Hex;
176
+ schemaUid: Hex;
177
+ subject: Did;
178
+ controller: Did;
179
+ timeoutMs?: number;
180
+ };
181
+ type CallControllerWitnessResult = {
182
+ ok: boolean;
183
+ method: "dns-txt" | "did-json";
184
+ details?: unknown;
185
+ };
186
+ type VerifyProofParams = {
187
+ proof: ProofWrapper;
188
+ provider?: unknown;
189
+ expectedSubject?: Did;
190
+ expectedController?: Did;
191
+ };
192
+ type VerifyProofResult = {
193
+ valid: boolean;
194
+ proofType: ProofType;
195
+ reason?: string;
196
+ };
197
+
198
+ declare function submitAttestation(params: SubmitAttestationParams): Promise<SubmitAttestationResult>;
199
+
200
+ declare function buildDelegatedAttestationTypedData(params: PrepareDelegatedAttestationParams): {
201
+ domain: Record<string, unknown>;
202
+ types: Record<string, unknown>;
203
+ message: Record<string, unknown>;
204
+ };
205
+ declare function splitSignature(signature: Hex | string): {
206
+ v: number;
207
+ r: Hex;
208
+ s: Hex;
209
+ };
210
+ declare function prepareDelegatedAttestation(params: PrepareDelegatedAttestationParams): Promise<PrepareDelegatedAttestationResult>;
211
+ declare function submitDelegatedAttestation(params: SubmitDelegatedAttestationParams): Promise<SubmitDelegatedAttestationResult>;
212
+
213
+ declare function getAttestation(params: GetAttestationParams): Promise<AttestationQueryResult>;
214
+ declare function getAttestationsForDid(params: ListAttestationsParams): Promise<AttestationQueryResult[]>;
215
+ declare function listAttestations(params: ListAttestationsParams): Promise<AttestationQueryResult[]>;
216
+ type GetLatestAttestationsParams = {
217
+ provider: unknown;
218
+ easContractAddress: Hex;
219
+ schemas?: Hex[];
220
+ limit?: number;
221
+ fromBlock?: number;
222
+ };
223
+ declare function getLatestAttestations(params: GetLatestAttestationsParams): Promise<AttestationQueryResult[]>;
224
+ declare function deduplicateReviews(attestations: AttestationQueryResult[]): AttestationQueryResult[];
225
+ declare function calculateAverageUserReviewRating(attestations: AttestationQueryResult[]): number;
226
+ declare function getMajorVersion(version: string): number;
227
+
228
+ declare function verifyProof(params: VerifyProofParams): Promise<VerifyProofResult>;
229
+ declare function verifyAttestation(params: VerifyAttestationParams): Promise<VerifyAttestationResult>;
230
+
231
+ declare function normalizeSchema(schema: SchemaField[] | string): SchemaField[];
232
+ declare function schemaToString(schema: SchemaField[] | string): string;
233
+ declare function encodeAttestationData(schema: SchemaField[] | string, data: Record<string, unknown>): Hex;
234
+ declare function decodeAttestationData(schema: SchemaField[] | string, encodedData: Hex): Record<string, unknown>;
235
+ declare function extractExpirationTime(data: Record<string, unknown>): bigint | number | undefined;
236
+
237
+ declare function verifySchemaExists(schemaRegistry: unknown, schemaUid: Hex): Promise<boolean>;
238
+ declare function getSchemaDetails(schemaRegistry: unknown, schemaUid: Hex): Promise<{
239
+ uid: Hex;
240
+ schema: string;
241
+ resolver: Hex;
242
+ revocable: boolean;
243
+ }>;
244
+ declare function formatSchemaUid(schemaUid: string): Hex;
245
+
246
+ declare function callControllerWitness(params: CallControllerWitnessParams): Promise<CallControllerWitnessResult>;
247
+
248
+ declare function getSupportedChainIds(): number[];
249
+ declare function isChainSupported(chainId: number): boolean;
250
+ declare function getChainConstants(chainId: number, purpose: ProofPurpose): ChainConstants;
251
+ declare function constructSeed(subjectDidHash: Hex, counterpartyDidHash: Hex, purpose: ProofPurpose): Uint8Array;
252
+ declare function hashSeed(seedBytes: Uint8Array, chainId: number): Hex;
253
+ declare function calculateTransferAmount(subject: string, counterparty: string, chainId: number, purpose: ProofPurpose): bigint;
254
+ declare function calculateTransferAmountFromAddresses(subjectAddress: string, counterpartyAddress: string, chainId: number, purpose: ProofPurpose): bigint;
255
+ declare function createTxEncodedValueProof(chainId: number, txHash: Hex, purpose: ProofPurpose): TxEncodedValueProof;
256
+ declare function formatTransferAmount(amount: bigint | number, chainId: number): string;
257
+ declare function getExplorerTxUrl(chainId: number, txHash: Hex): string;
258
+ declare function getExplorerAddressUrl(chainId: number, address: string): string;
259
+
260
+ declare function createTxInteractionProof(chainId: number, txHash: Hex): TxInteractionProof;
261
+
262
+ type CreatePopEip712ProofParams = {
263
+ signer: string;
264
+ authorizedEntity: string;
265
+ signingPurpose: ProofPurpose;
266
+ chainId: number;
267
+ creationTimestamp?: number;
268
+ expirationTimestamp?: number;
269
+ randomValue?: Hex;
270
+ statement?: string;
271
+ };
272
+ declare function createPopEip712Proof(params: CreatePopEip712ProofParams, signFn: (typedData: Record<string, unknown>) => Promise<Hex>): Promise<PopEip712Proof>;
273
+
274
+ type CreatePopJwsProofParams = {
275
+ issuer: Did;
276
+ audience: Did;
277
+ purpose: ProofPurpose;
278
+ issuedAt?: number;
279
+ expiresAt?: number;
280
+ nonce?: string;
281
+ };
282
+ declare function createPopJwsProof(params: CreatePopJwsProofParams, signFn: (payload: Record<string, unknown>, header: Record<string, unknown>) => Promise<string>): Promise<PopJwsProof>;
283
+
284
+ declare function createX402ReceiptProof(receipt: Record<string, unknown>): X402ReceiptProof;
285
+ declare function createX402OfferProof(offer: Record<string, unknown>): X402OfferProof;
286
+
287
+ declare function createEvidencePointerProof(url: string): EvidencePointerProof;
288
+
289
+ declare function parseDnsTxtRecord(record: string): {
290
+ version?: string;
291
+ controller?: Did;
292
+ [key: string]: string | undefined;
293
+ };
294
+ declare function buildDnsTxtRecord(controllerDid: Did): string;
295
+ declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did): Promise<{
296
+ valid: boolean;
297
+ record?: string;
298
+ reason?: string;
299
+ }>;
300
+
301
+ declare function fetchDidDocument(domain: string): Promise<Record<string, unknown>>;
302
+ declare function extractAddressesFromDidDocument(didDocument: Record<string, unknown>): string[];
303
+ declare function verifyDidDocumentControllerDid(didDocument: Record<string, unknown>, expectedControllerDid: Did): {
304
+ valid: boolean;
305
+ reason?: string;
306
+ };
307
+
308
+ declare function buildEip712Domain(name: string, version: string, chainId: number, verifyingContract: Hex): {
309
+ name: string;
310
+ version: string;
311
+ chainId: number;
312
+ verifyingContract: Hex;
313
+ };
314
+ declare function getOmaTrustProofEip712Types(): {
315
+ primaryType: string;
316
+ types: Record<string, Array<{
317
+ name: string;
318
+ type: string;
319
+ }>>;
320
+ };
321
+ declare function verifyEip712Signature(typedData: {
322
+ domain: Record<string, unknown>;
323
+ types: Record<string, unknown>;
324
+ message: Record<string, unknown>;
325
+ }, signature: Hex | string): {
326
+ valid: boolean;
327
+ signer?: string;
328
+ };
329
+
330
+ type index_AttestationQueryResult = AttestationQueryResult;
331
+ type index_CallControllerWitnessParams = CallControllerWitnessParams;
332
+ type index_CallControllerWitnessResult = CallControllerWitnessResult;
333
+ type index_ChainConstants = ChainConstants;
334
+ type index_CreatePopEip712ProofParams = CreatePopEip712ProofParams;
335
+ type index_CreatePopJwsProofParams = CreatePopJwsProofParams;
336
+ type index_Did = Did;
337
+ type index_EvidencePointerProof = EvidencePointerProof;
338
+ type index_GetAttestationParams = GetAttestationParams;
339
+ type index_GetLatestAttestationsParams = GetLatestAttestationsParams;
340
+ type index_Hex = Hex;
341
+ type index_ListAttestationsParams = ListAttestationsParams;
342
+ type index_PopEip712Proof = PopEip712Proof;
343
+ type index_PopJwsProof = PopJwsProof;
344
+ type index_PrepareDelegatedAttestationParams = PrepareDelegatedAttestationParams;
345
+ type index_PrepareDelegatedAttestationResult = PrepareDelegatedAttestationResult;
346
+ type index_ProofPurpose = ProofPurpose;
347
+ type index_ProofType = ProofType;
348
+ type index_ProofWrapper = ProofWrapper;
349
+ type index_SchemaField = SchemaField;
350
+ type index_SubmitAttestationParams = SubmitAttestationParams;
351
+ type index_SubmitAttestationResult = SubmitAttestationResult;
352
+ type index_SubmitDelegatedAttestationParams = SubmitDelegatedAttestationParams;
353
+ type index_SubmitDelegatedAttestationResult = SubmitDelegatedAttestationResult;
354
+ type index_TxEncodedValueProof = TxEncodedValueProof;
355
+ type index_TxInteractionProof = TxInteractionProof;
356
+ type index_VerifyAttestationParams = VerifyAttestationParams;
357
+ type index_VerifyAttestationResult = VerifyAttestationResult;
358
+ type index_VerifyProofParams = VerifyProofParams;
359
+ type index_VerifyProofResult = VerifyProofResult;
360
+ type index_X402OfferProof = X402OfferProof;
361
+ type index_X402ReceiptProof = X402ReceiptProof;
362
+ declare const index_buildDelegatedAttestationTypedData: typeof buildDelegatedAttestationTypedData;
363
+ declare const index_buildDnsTxtRecord: typeof buildDnsTxtRecord;
364
+ declare const index_buildEip712Domain: typeof buildEip712Domain;
365
+ declare const index_calculateAverageUserReviewRating: typeof calculateAverageUserReviewRating;
366
+ declare const index_calculateTransferAmount: typeof calculateTransferAmount;
367
+ declare const index_calculateTransferAmountFromAddresses: typeof calculateTransferAmountFromAddresses;
368
+ declare const index_callControllerWitness: typeof callControllerWitness;
369
+ declare const index_constructSeed: typeof constructSeed;
370
+ declare const index_createEvidencePointerProof: typeof createEvidencePointerProof;
371
+ declare const index_createPopEip712Proof: typeof createPopEip712Proof;
372
+ declare const index_createPopJwsProof: typeof createPopJwsProof;
373
+ declare const index_createTxEncodedValueProof: typeof createTxEncodedValueProof;
374
+ declare const index_createTxInteractionProof: typeof createTxInteractionProof;
375
+ declare const index_createX402OfferProof: typeof createX402OfferProof;
376
+ declare const index_createX402ReceiptProof: typeof createX402ReceiptProof;
377
+ declare const index_decodeAttestationData: typeof decodeAttestationData;
378
+ declare const index_deduplicateReviews: typeof deduplicateReviews;
379
+ declare const index_encodeAttestationData: typeof encodeAttestationData;
380
+ declare const index_extractAddressesFromDidDocument: typeof extractAddressesFromDidDocument;
381
+ declare const index_extractExpirationTime: typeof extractExpirationTime;
382
+ declare const index_fetchDidDocument: typeof fetchDidDocument;
383
+ declare const index_formatSchemaUid: typeof formatSchemaUid;
384
+ declare const index_formatTransferAmount: typeof formatTransferAmount;
385
+ declare const index_getAttestation: typeof getAttestation;
386
+ declare const index_getAttestationsForDid: typeof getAttestationsForDid;
387
+ declare const index_getChainConstants: typeof getChainConstants;
388
+ declare const index_getExplorerAddressUrl: typeof getExplorerAddressUrl;
389
+ declare const index_getExplorerTxUrl: typeof getExplorerTxUrl;
390
+ declare const index_getLatestAttestations: typeof getLatestAttestations;
391
+ declare const index_getMajorVersion: typeof getMajorVersion;
392
+ declare const index_getOmaTrustProofEip712Types: typeof getOmaTrustProofEip712Types;
393
+ declare const index_getSchemaDetails: typeof getSchemaDetails;
394
+ declare const index_getSupportedChainIds: typeof getSupportedChainIds;
395
+ declare const index_hashSeed: typeof hashSeed;
396
+ declare const index_isChainSupported: typeof isChainSupported;
397
+ declare const index_listAttestations: typeof listAttestations;
398
+ declare const index_normalizeSchema: typeof normalizeSchema;
399
+ declare const index_parseDnsTxtRecord: typeof parseDnsTxtRecord;
400
+ declare const index_prepareDelegatedAttestation: typeof prepareDelegatedAttestation;
401
+ declare const index_schemaToString: typeof schemaToString;
402
+ declare const index_splitSignature: typeof splitSignature;
403
+ declare const index_submitAttestation: typeof submitAttestation;
404
+ declare const index_submitDelegatedAttestation: typeof submitDelegatedAttestation;
405
+ declare const index_verifyAttestation: typeof verifyAttestation;
406
+ declare const index_verifyDidDocumentControllerDid: typeof verifyDidDocumentControllerDid;
407
+ declare const index_verifyDnsTxtControllerDid: typeof verifyDnsTxtControllerDid;
408
+ declare const index_verifyEip712Signature: typeof verifyEip712Signature;
409
+ declare const index_verifyProof: typeof verifyProof;
410
+ declare const index_verifySchemaExists: typeof verifySchemaExists;
411
+ declare namespace index {
412
+ export { type index_AttestationQueryResult as AttestationQueryResult, type index_CallControllerWitnessParams as CallControllerWitnessParams, type index_CallControllerWitnessResult as CallControllerWitnessResult, type index_ChainConstants as ChainConstants, type index_CreatePopEip712ProofParams as CreatePopEip712ProofParams, type index_CreatePopJwsProofParams as CreatePopJwsProofParams, type index_Did as Did, type index_EvidencePointerProof as EvidencePointerProof, type index_GetAttestationParams as GetAttestationParams, type index_GetLatestAttestationsParams as GetLatestAttestationsParams, type index_Hex as Hex, type index_ListAttestationsParams as ListAttestationsParams, type index_PopEip712Proof as PopEip712Proof, type index_PopJwsProof as PopJwsProof, type index_PrepareDelegatedAttestationParams as PrepareDelegatedAttestationParams, type index_PrepareDelegatedAttestationResult as PrepareDelegatedAttestationResult, type index_ProofPurpose as ProofPurpose, type index_ProofType as ProofType, type index_ProofWrapper as ProofWrapper, type index_SchemaField as SchemaField, type index_SubmitAttestationParams as SubmitAttestationParams, type index_SubmitAttestationResult as SubmitAttestationResult, type index_SubmitDelegatedAttestationParams as SubmitDelegatedAttestationParams, type index_SubmitDelegatedAttestationResult as SubmitDelegatedAttestationResult, type index_TxEncodedValueProof as TxEncodedValueProof, type index_TxInteractionProof as TxInteractionProof, type index_VerifyAttestationParams as VerifyAttestationParams, type index_VerifyAttestationResult as VerifyAttestationResult, type index_VerifyProofParams as VerifyProofParams, type index_VerifyProofResult as VerifyProofResult, type index_X402OfferProof as X402OfferProof, type index_X402ReceiptProof as X402ReceiptProof, index_buildDelegatedAttestationTypedData as buildDelegatedAttestationTypedData, index_buildDnsTxtRecord as buildDnsTxtRecord, index_buildEip712Domain as buildEip712Domain, index_calculateAverageUserReviewRating as calculateAverageUserReviewRating, index_calculateTransferAmount as calculateTransferAmount, index_calculateTransferAmountFromAddresses as calculateTransferAmountFromAddresses, index_callControllerWitness as callControllerWitness, index_constructSeed as constructSeed, index_createEvidencePointerProof as createEvidencePointerProof, index_createPopEip712Proof as createPopEip712Proof, index_createPopJwsProof as createPopJwsProof, index_createTxEncodedValueProof as createTxEncodedValueProof, index_createTxInteractionProof as createTxInteractionProof, index_createX402OfferProof as createX402OfferProof, index_createX402ReceiptProof as createX402ReceiptProof, index_decodeAttestationData as decodeAttestationData, index_deduplicateReviews as deduplicateReviews, index_encodeAttestationData as encodeAttestationData, index_extractAddressesFromDidDocument as extractAddressesFromDidDocument, index_extractExpirationTime as extractExpirationTime, index_fetchDidDocument as fetchDidDocument, index_formatSchemaUid as formatSchemaUid, index_formatTransferAmount as formatTransferAmount, index_getAttestation as getAttestation, index_getAttestationsForDid as getAttestationsForDid, index_getChainConstants as getChainConstants, index_getExplorerAddressUrl as getExplorerAddressUrl, index_getExplorerTxUrl as getExplorerTxUrl, index_getLatestAttestations as getLatestAttestations, index_getMajorVersion as getMajorVersion, index_getOmaTrustProofEip712Types as getOmaTrustProofEip712Types, index_getSchemaDetails as getSchemaDetails, index_getSupportedChainIds as getSupportedChainIds, index_hashSeed as hashSeed, index_isChainSupported as isChainSupported, index_listAttestations as listAttestations, index_normalizeSchema as normalizeSchema, index_parseDnsTxtRecord as parseDnsTxtRecord, index_prepareDelegatedAttestation as prepareDelegatedAttestation, index_schemaToString as schemaToString, index_splitSignature as splitSignature, index_submitAttestation as submitAttestation, index_submitDelegatedAttestation as submitDelegatedAttestation, index_verifyAttestation as verifyAttestation, index_verifyDidDocumentControllerDid as verifyDidDocumentControllerDid, index_verifyDnsTxtControllerDid as verifyDnsTxtControllerDid, index_verifyEip712Signature as verifyEip712Signature, index_verifyProof as verifyProof, index_verifySchemaExists as verifySchemaExists };
413
+ }
414
+
415
+ export { fetchDidDocument as $, type AttestationQueryResult as A, calculateTransferAmountFromAddresses as B, type CallControllerWitnessParams as C, type Did as D, type EvidencePointerProof as E, callControllerWitness as F, type GetAttestationParams as G, type Hex as H, constructSeed as I, createEvidencePointerProof as J, createPopEip712Proof as K, type ListAttestationsParams as L, createPopJwsProof as M, createTxEncodedValueProof as N, createTxInteractionProof as O, type PopEip712Proof as P, createX402OfferProof as Q, createX402ReceiptProof as R, type SchemaField as S, type TxEncodedValueProof as T, decodeAttestationData as U, type VerifyAttestationParams as V, deduplicateReviews as W, type X402OfferProof as X, encodeAttestationData as Y, extractAddressesFromDidDocument as Z, extractExpirationTime as _, type CallControllerWitnessResult as a, formatSchemaUid as a0, formatTransferAmount as a1, getAttestation as a2, getAttestationsForDid as a3, getChainConstants as a4, getExplorerAddressUrl as a5, getExplorerTxUrl as a6, getLatestAttestations as a7, getMajorVersion as a8, getOmaTrustProofEip712Types as a9, getSchemaDetails as aa, getSupportedChainIds as ab, hashSeed as ac, isChainSupported as ad, listAttestations as ae, normalizeSchema as af, parseDnsTxtRecord as ag, prepareDelegatedAttestation as ah, schemaToString as ai, splitSignature as aj, submitAttestation as ak, submitDelegatedAttestation as al, verifyAttestation as am, verifyDidDocumentControllerDid as an, verifyDnsTxtControllerDid as ao, verifyEip712Signature as ap, verifyProof as aq, verifySchemaExists as ar, type ChainConstants as b, type CreatePopEip712ProofParams as c, type CreatePopJwsProofParams as d, type GetLatestAttestationsParams as e, type PopJwsProof as f, type PrepareDelegatedAttestationParams as g, type PrepareDelegatedAttestationResult as h, index as i, type ProofPurpose as j, type ProofType as k, type ProofWrapper as l, type SubmitAttestationParams as m, type SubmitAttestationResult as n, type SubmitDelegatedAttestationParams as o, type SubmitDelegatedAttestationResult as p, type TxInteractionProof as q, type VerifyAttestationResult as r, type VerifyProofParams as s, type VerifyProofResult as t, type X402ReceiptProof as u, buildDelegatedAttestationTypedData as v, buildDnsTxtRecord as w, buildEip712Domain as x, calculateAverageUserReviewRating as y, calculateTransferAmount as z };
@@ -0,0 +1,90 @@
1
+ type Hex$1 = `0x${string}`;
2
+ type Did = string;
3
+ declare function isValidDid(did: string): boolean;
4
+ declare function extractDidMethod(did: Did): string | null;
5
+ declare function extractDidIdentifier(did: Did): string | null;
6
+ declare function normalizeDomain(domain: string): string;
7
+ declare function normalizeDidWeb(input: string): Did;
8
+ declare function normalizeDidPkh(input: string): Did;
9
+ declare function normalizeDidHandle(input: string): Did;
10
+ declare function normalizeDidKey(input: string): Did;
11
+ declare function normalizeDid(input: string): Did;
12
+ declare function computeDidHash(did: Did): Hex$1;
13
+ declare function computeDidAddress(didHash: Hex$1): Hex$1;
14
+ declare function didToAddress(did: Did): Hex$1;
15
+ declare function validateDidAddress(did: Did, address: Hex$1): boolean;
16
+ declare function buildDidWeb(domain: string): Did;
17
+ declare function buildDidPkh(namespace: string, chainId: string | number, address: string): Did;
18
+ declare function buildEvmDidPkh(chainId: string | number, address: string): Did;
19
+ declare function buildDidPkhFromCaip10(caip10: string): Did;
20
+ declare function getChainIdFromDidPkh(did: Did): string | null;
21
+ declare function getAddressFromDidPkh(did: Did): string | null;
22
+ declare function getNamespaceFromDidPkh(did: Did): string | null;
23
+ declare function isEvmDidPkh(did: Did): boolean;
24
+ declare function getDomainFromDidWeb(did: Did): string | null;
25
+ declare function extractAddressFromDid(identifier: string): string;
26
+
27
+ type Caip10 = string;
28
+ type ParsedCaip10 = {
29
+ namespace: string;
30
+ reference: string;
31
+ address: string;
32
+ };
33
+ type ParsedCaip2 = {
34
+ namespace: string;
35
+ reference: string;
36
+ };
37
+ declare function parseCaip10(input: string): ParsedCaip10;
38
+ declare function buildCaip10(namespace: string, reference: string, address: string): Caip10;
39
+ declare function normalizeCaip10(input: string): Caip10;
40
+ declare function buildCaip2(namespace: string, reference: string): string;
41
+ declare function parseCaip2(caip2: string): ParsedCaip2;
42
+
43
+ type Hex = `0x${string}`;
44
+ declare function canonicalizeJson(obj: unknown): string;
45
+ declare function canonicalizeForHash(obj: unknown): {
46
+ jcsJson: string;
47
+ hash: Hex;
48
+ };
49
+ declare function hashCanonicalizedJson(obj: unknown, algorithm: "keccak256" | "sha256"): Hex;
50
+
51
+ type index_Caip10 = Caip10;
52
+ type index_Did = Did;
53
+ type index_ParsedCaip10 = ParsedCaip10;
54
+ type index_ParsedCaip2 = ParsedCaip2;
55
+ declare const index_buildCaip10: typeof buildCaip10;
56
+ declare const index_buildCaip2: typeof buildCaip2;
57
+ declare const index_buildDidPkh: typeof buildDidPkh;
58
+ declare const index_buildDidPkhFromCaip10: typeof buildDidPkhFromCaip10;
59
+ declare const index_buildDidWeb: typeof buildDidWeb;
60
+ declare const index_buildEvmDidPkh: typeof buildEvmDidPkh;
61
+ declare const index_canonicalizeForHash: typeof canonicalizeForHash;
62
+ declare const index_canonicalizeJson: typeof canonicalizeJson;
63
+ declare const index_computeDidAddress: typeof computeDidAddress;
64
+ declare const index_computeDidHash: typeof computeDidHash;
65
+ declare const index_didToAddress: typeof didToAddress;
66
+ declare const index_extractAddressFromDid: typeof extractAddressFromDid;
67
+ declare const index_extractDidIdentifier: typeof extractDidIdentifier;
68
+ declare const index_extractDidMethod: typeof extractDidMethod;
69
+ declare const index_getAddressFromDidPkh: typeof getAddressFromDidPkh;
70
+ declare const index_getChainIdFromDidPkh: typeof getChainIdFromDidPkh;
71
+ declare const index_getDomainFromDidWeb: typeof getDomainFromDidWeb;
72
+ declare const index_getNamespaceFromDidPkh: typeof getNamespaceFromDidPkh;
73
+ declare const index_hashCanonicalizedJson: typeof hashCanonicalizedJson;
74
+ declare const index_isEvmDidPkh: typeof isEvmDidPkh;
75
+ declare const index_isValidDid: typeof isValidDid;
76
+ declare const index_normalizeCaip10: typeof normalizeCaip10;
77
+ declare const index_normalizeDid: typeof normalizeDid;
78
+ declare const index_normalizeDidHandle: typeof normalizeDidHandle;
79
+ declare const index_normalizeDidKey: typeof normalizeDidKey;
80
+ declare const index_normalizeDidPkh: typeof normalizeDidPkh;
81
+ declare const index_normalizeDidWeb: typeof normalizeDidWeb;
82
+ declare const index_normalizeDomain: typeof normalizeDomain;
83
+ declare const index_parseCaip10: typeof parseCaip10;
84
+ declare const index_parseCaip2: typeof parseCaip2;
85
+ declare const index_validateDidAddress: typeof validateDidAddress;
86
+ declare namespace index {
87
+ export { type index_Caip10 as Caip10, type index_Did as Did, type Hex$1 as Hex, type index_ParsedCaip10 as ParsedCaip10, type index_ParsedCaip2 as ParsedCaip2, index_buildCaip10 as buildCaip10, index_buildCaip2 as buildCaip2, index_buildDidPkh as buildDidPkh, index_buildDidPkhFromCaip10 as buildDidPkhFromCaip10, index_buildDidWeb as buildDidWeb, index_buildEvmDidPkh as buildEvmDidPkh, index_canonicalizeForHash as canonicalizeForHash, index_canonicalizeJson as canonicalizeJson, index_computeDidAddress as computeDidAddress, index_computeDidHash as computeDidHash, index_didToAddress as didToAddress, index_extractAddressFromDid as extractAddressFromDid, index_extractDidIdentifier as extractDidIdentifier, index_extractDidMethod as extractDidMethod, index_getAddressFromDidPkh as getAddressFromDidPkh, index_getChainIdFromDidPkh as getChainIdFromDidPkh, index_getDomainFromDidWeb as getDomainFromDidWeb, index_getNamespaceFromDidPkh as getNamespaceFromDidPkh, index_hashCanonicalizedJson as hashCanonicalizedJson, index_isEvmDidPkh as isEvmDidPkh, index_isValidDid as isValidDid, index_normalizeCaip10 as normalizeCaip10, index_normalizeDid as normalizeDid, index_normalizeDidHandle as normalizeDidHandle, index_normalizeDidKey as normalizeDidKey, index_normalizeDidPkh as normalizeDidPkh, index_normalizeDidWeb as normalizeDidWeb, index_normalizeDomain as normalizeDomain, index_parseCaip10 as parseCaip10, index_parseCaip2 as parseCaip2, index_validateDidAddress as validateDidAddress };
88
+ }
89
+
90
+ export { normalizeDidKey as A, normalizeDidPkh as B, type Caip10 as C, type Did as D, normalizeDidWeb as E, normalizeDomain as F, parseCaip10 as G, type Hex$1 as H, parseCaip2 as I, validateDidAddress as J, type ParsedCaip10 as P, type ParsedCaip2 as a, buildCaip10 as b, buildCaip2 as c, buildDidPkh as d, buildDidPkhFromCaip10 as e, buildDidWeb as f, buildEvmDidPkh as g, canonicalizeForHash as h, index as i, canonicalizeJson as j, computeDidAddress as k, computeDidHash as l, didToAddress as m, extractAddressFromDid as n, extractDidIdentifier as o, extractDidMethod as p, getAddressFromDidPkh as q, getChainIdFromDidPkh as r, getDomainFromDidWeb as s, getNamespaceFromDidPkh as t, hashCanonicalizedJson as u, isEvmDidPkh as v, isValidDid as w, normalizeCaip10 as x, normalizeDid as y, normalizeDidHandle as z };
@@ -0,0 +1,90 @@
1
+ type Hex$1 = `0x${string}`;
2
+ type Did = string;
3
+ declare function isValidDid(did: string): boolean;
4
+ declare function extractDidMethod(did: Did): string | null;
5
+ declare function extractDidIdentifier(did: Did): string | null;
6
+ declare function normalizeDomain(domain: string): string;
7
+ declare function normalizeDidWeb(input: string): Did;
8
+ declare function normalizeDidPkh(input: string): Did;
9
+ declare function normalizeDidHandle(input: string): Did;
10
+ declare function normalizeDidKey(input: string): Did;
11
+ declare function normalizeDid(input: string): Did;
12
+ declare function computeDidHash(did: Did): Hex$1;
13
+ declare function computeDidAddress(didHash: Hex$1): Hex$1;
14
+ declare function didToAddress(did: Did): Hex$1;
15
+ declare function validateDidAddress(did: Did, address: Hex$1): boolean;
16
+ declare function buildDidWeb(domain: string): Did;
17
+ declare function buildDidPkh(namespace: string, chainId: string | number, address: string): Did;
18
+ declare function buildEvmDidPkh(chainId: string | number, address: string): Did;
19
+ declare function buildDidPkhFromCaip10(caip10: string): Did;
20
+ declare function getChainIdFromDidPkh(did: Did): string | null;
21
+ declare function getAddressFromDidPkh(did: Did): string | null;
22
+ declare function getNamespaceFromDidPkh(did: Did): string | null;
23
+ declare function isEvmDidPkh(did: Did): boolean;
24
+ declare function getDomainFromDidWeb(did: Did): string | null;
25
+ declare function extractAddressFromDid(identifier: string): string;
26
+
27
+ type Caip10 = string;
28
+ type ParsedCaip10 = {
29
+ namespace: string;
30
+ reference: string;
31
+ address: string;
32
+ };
33
+ type ParsedCaip2 = {
34
+ namespace: string;
35
+ reference: string;
36
+ };
37
+ declare function parseCaip10(input: string): ParsedCaip10;
38
+ declare function buildCaip10(namespace: string, reference: string, address: string): Caip10;
39
+ declare function normalizeCaip10(input: string): Caip10;
40
+ declare function buildCaip2(namespace: string, reference: string): string;
41
+ declare function parseCaip2(caip2: string): ParsedCaip2;
42
+
43
+ type Hex = `0x${string}`;
44
+ declare function canonicalizeJson(obj: unknown): string;
45
+ declare function canonicalizeForHash(obj: unknown): {
46
+ jcsJson: string;
47
+ hash: Hex;
48
+ };
49
+ declare function hashCanonicalizedJson(obj: unknown, algorithm: "keccak256" | "sha256"): Hex;
50
+
51
+ type index_Caip10 = Caip10;
52
+ type index_Did = Did;
53
+ type index_ParsedCaip10 = ParsedCaip10;
54
+ type index_ParsedCaip2 = ParsedCaip2;
55
+ declare const index_buildCaip10: typeof buildCaip10;
56
+ declare const index_buildCaip2: typeof buildCaip2;
57
+ declare const index_buildDidPkh: typeof buildDidPkh;
58
+ declare const index_buildDidPkhFromCaip10: typeof buildDidPkhFromCaip10;
59
+ declare const index_buildDidWeb: typeof buildDidWeb;
60
+ declare const index_buildEvmDidPkh: typeof buildEvmDidPkh;
61
+ declare const index_canonicalizeForHash: typeof canonicalizeForHash;
62
+ declare const index_canonicalizeJson: typeof canonicalizeJson;
63
+ declare const index_computeDidAddress: typeof computeDidAddress;
64
+ declare const index_computeDidHash: typeof computeDidHash;
65
+ declare const index_didToAddress: typeof didToAddress;
66
+ declare const index_extractAddressFromDid: typeof extractAddressFromDid;
67
+ declare const index_extractDidIdentifier: typeof extractDidIdentifier;
68
+ declare const index_extractDidMethod: typeof extractDidMethod;
69
+ declare const index_getAddressFromDidPkh: typeof getAddressFromDidPkh;
70
+ declare const index_getChainIdFromDidPkh: typeof getChainIdFromDidPkh;
71
+ declare const index_getDomainFromDidWeb: typeof getDomainFromDidWeb;
72
+ declare const index_getNamespaceFromDidPkh: typeof getNamespaceFromDidPkh;
73
+ declare const index_hashCanonicalizedJson: typeof hashCanonicalizedJson;
74
+ declare const index_isEvmDidPkh: typeof isEvmDidPkh;
75
+ declare const index_isValidDid: typeof isValidDid;
76
+ declare const index_normalizeCaip10: typeof normalizeCaip10;
77
+ declare const index_normalizeDid: typeof normalizeDid;
78
+ declare const index_normalizeDidHandle: typeof normalizeDidHandle;
79
+ declare const index_normalizeDidKey: typeof normalizeDidKey;
80
+ declare const index_normalizeDidPkh: typeof normalizeDidPkh;
81
+ declare const index_normalizeDidWeb: typeof normalizeDidWeb;
82
+ declare const index_normalizeDomain: typeof normalizeDomain;
83
+ declare const index_parseCaip10: typeof parseCaip10;
84
+ declare const index_parseCaip2: typeof parseCaip2;
85
+ declare const index_validateDidAddress: typeof validateDidAddress;
86
+ declare namespace index {
87
+ export { type index_Caip10 as Caip10, type index_Did as Did, type Hex$1 as Hex, type index_ParsedCaip10 as ParsedCaip10, type index_ParsedCaip2 as ParsedCaip2, index_buildCaip10 as buildCaip10, index_buildCaip2 as buildCaip2, index_buildDidPkh as buildDidPkh, index_buildDidPkhFromCaip10 as buildDidPkhFromCaip10, index_buildDidWeb as buildDidWeb, index_buildEvmDidPkh as buildEvmDidPkh, index_canonicalizeForHash as canonicalizeForHash, index_canonicalizeJson as canonicalizeJson, index_computeDidAddress as computeDidAddress, index_computeDidHash as computeDidHash, index_didToAddress as didToAddress, index_extractAddressFromDid as extractAddressFromDid, index_extractDidIdentifier as extractDidIdentifier, index_extractDidMethod as extractDidMethod, index_getAddressFromDidPkh as getAddressFromDidPkh, index_getChainIdFromDidPkh as getChainIdFromDidPkh, index_getDomainFromDidWeb as getDomainFromDidWeb, index_getNamespaceFromDidPkh as getNamespaceFromDidPkh, index_hashCanonicalizedJson as hashCanonicalizedJson, index_isEvmDidPkh as isEvmDidPkh, index_isValidDid as isValidDid, index_normalizeCaip10 as normalizeCaip10, index_normalizeDid as normalizeDid, index_normalizeDidHandle as normalizeDidHandle, index_normalizeDidKey as normalizeDidKey, index_normalizeDidPkh as normalizeDidPkh, index_normalizeDidWeb as normalizeDidWeb, index_normalizeDomain as normalizeDomain, index_parseCaip10 as parseCaip10, index_parseCaip2 as parseCaip2, index_validateDidAddress as validateDidAddress };
88
+ }
89
+
90
+ export { normalizeDidKey as A, normalizeDidPkh as B, type Caip10 as C, type Did as D, normalizeDidWeb as E, normalizeDomain as F, parseCaip10 as G, type Hex$1 as H, parseCaip2 as I, validateDidAddress as J, type ParsedCaip10 as P, type ParsedCaip2 as a, buildCaip10 as b, buildCaip2 as c, buildDidPkh as d, buildDidPkhFromCaip10 as e, buildDidWeb as f, buildEvmDidPkh as g, canonicalizeForHash as h, index as i, canonicalizeJson as j, computeDidAddress as k, computeDidHash as l, didToAddress as m, extractAddressFromDid as n, extractDidIdentifier as o, extractDidMethod as p, getAddressFromDidPkh as q, getChainIdFromDidPkh as r, getDomainFromDidWeb as s, getNamespaceFromDidPkh as t, hashCanonicalizedJson as u, isEvmDidPkh as v, isValidDid as w, normalizeCaip10 as x, normalizeDid as y, normalizeDidHandle as z };