import { SignedOffchainAttestation, decodeBase64ZippedBase64, zipAndEncodeToBase64 } from "@ethereum-attestation-service/eas-sdk"; import { ethers, Signer } from "ethers"; import { OffchainAttestationParams } from "@ethereum-attestation-service/eas-sdk/dist/offchain/offchain"; import { Attestable } from "../libs/Attestable"; import { AttestableObject } from "../libs/AttestableObject"; import { KeyPair, KeysArray } from "../libs/KeyPair"; export { SignedOffchainAttestation, decodeBase64ZippedBase64, zipAndEncodeToBase64 }; export declare enum AbiFieldTypes { bool = "bool", uint8 = "uint8", uint16 = "uint16", uint32 = "uint32", uint64 = "uint64", uint128 = "uint128", uint256 = "uint256", address = "address", string = "string", bytes = "bytes", bytes32 = "bytes32" } export interface SchemaField { name: string; type: AbiFieldTypes | string; isCommitment?: boolean; } export interface TicketSchema { fields: SchemaField[]; } export interface EasTicketCreationOptions { recipient?: string; schema?: string; revocable?: boolean; refUID?: string; validity?: { from: number; to: number; }; } export interface EasJson { sig: SignedOffchainAttestation; signer: string; secret?: string; } export declare class EasAsnEmbeddedSchema { attestation: Uint8Array; signature: Uint8Array; domain: Uint8Array; } export declare class EasTicketAttestation extends AttestableObject implements Attestable { private schema; private signingConfig?; private rpcMap?; private issuerKeys?; private static DEFAULT_OFFCHAIN_VERSION; private signedAttestation; private signerAddress; private signerPublicKey; private decodedData?; private commitmentSecret?; private conferenceKeys?; private crypto; /** * * @param schema The schema for the attestation. This must always be provided. * @param signingConfig The EAS SDK config and signer - required only to create & revoke attestations. * @param rpcMap A map of RPC nodes required for revocation checks * @param issuerKeys A map of valid issuer keys for signature validation purposes */ constructor(schema: TicketSchema, signingConfig?: { EASconfig: { address: string; version: string; chainId: number; }; signer: Signer; offChainVersion?: number | undefined; } | undefined, rpcMap?: { [chainId: number]: string; } | undefined, issuerKeys?: KeysArray | undefined); private getEasSchema; private checkAttestationIsLoaded; /** * Issue a new offchain attestation for the provided ID * @param data * @param options * @param commitmentType */ createEasAttestation(data: { [key: string]: string | number; }, options?: EasTicketCreationOptions, commitmentType?: string): Promise; private createCommitment; getEasJson(): EasJson; getEasUid(message?: OffchainAttestationParams): string; getEncoded(): string; getAttestationData(): { [fieldName: string]: any; }; getAttestationField(fieldName: string): any; verifyIdCommitment(commitValue: string, commitSecret?: bigint, commitmentType?: string): void; validateEasAttestation(skipRevocationCheck?: boolean): Promise; private checkRevocation; revokeEasAttestation(uid?: string): Promise; bulkRevokeEasAttestations(uids: string[]): Promise; loadEasAttestation(attestation: SignedOffchainAttestation, keys?: KeysArray, commitmentSecret?: string): void; loadFromEncoded(base64: string, keys?: KeysArray, commitmentSecret?: string): void; getAbiEncodedParts(): { domain: string; attestation: string; signature: string; }; getBinaryEncoded(format: "abi" | "asn", compressed?: boolean): ArrayBuffer; getAsnEncoded(compressed?: boolean): ArrayBuffer; getAbiEncoded(compressed?: boolean): Uint8Array; loadBinaryEncoded(format: "abi" | "asn", bytes: ArrayBuffer | Uint8Array, keys?: KeysArray, compressed?: boolean): void; loadAbiEncoded(bytes: ArrayBuffer | Uint8Array, keys?: KeysArray, compressed?: boolean): void; loadAsnEncoded(bytes: ArrayBuffer | Uint8Array, keys?: KeysArray, compressed?: boolean): void; loadAbiEncodedParts(parts: { domain: string | Uint8Array; attestation: string | Uint8Array; signature: string | Uint8Array; }, keys?: KeysArray): void; checkValidity(): boolean; private processKeysParam; private recoverSignerInfo; verify(): boolean; getSignerKeyPair(): KeyPair; getSignerKey(): string; getSignerAddress(): string; getCommitment(): Uint8Array; getDerEncoding(): string; protected commitment: Uint8Array; protected encoded: string; fromBytes(bytes: ArrayBuffer | Uint8Array, keys: KeysArray): void; }