import { DidStdFee, ISignInputs, MethodSpecificIdAlgo, VerificationMethods, DIDDocumentExternal } from '@swisstronik/sdk'; import { Coin, DeliverTxResponse } from '@cosmjs/stargate'; import { IAgentContext, IKeyManager, IPluginMethodMap, IIdentifier, VerifiableCredential, IVerifyCredentialArgs, IVerifyResult, VerifiablePresentation, IVerifyPresentationArgs, IError, ICreateVerifiableCredentialArgs, ICredentialIssuer, IDIDManager, IDataStore, IResolver, W3CVerifiableCredential, ICredentialVerifier } from '@veramo/core'; import { LinkedResource, TImportableEd25519Key, ResourcePayload, StatusList2021ResourcePayload, DefaultStatusList2021ResourceTypes, DefaultStatusList2021StatusPurposeTypes, DefaultStatusList2021Encoding, DefaultStatusList2021StatusPurposeType } from '../did-manager/didProvider'; import { CosmosAccessControlCondition, LitCompatibleCosmosChain, LitNetwork } from '../dkg-threshold/litProtocol.js'; export type IContext = IAgentContext; export type TExportedDIDDocWithKeys = { didDoc: DIDDocumentExternal; keys: TImportableEd25519Key[]; versionId?: string; }; export type TExportedDIDDocWithLinkedResourceWithKeys = TExportedDIDDocWithKeys & { linkedResource: LinkedResource; }; export type LinkedResourceMetadataResolutionResult = { resourceURI: string; resourceCollectionId: string; resourceId: string; resourceName: string; resourceType: string; mediaType: string; resourceVersion?: string; created: string; checksum: string; previousVersionId: string | null; nextVersionId: string | null; }; export type DIDMetadataDereferencingResult = { '@context': 'https://w3id.org/did-resolution/v1'; dereferencingMetadata: { contentType: string; error?: string; retrieved: string; did: { didString: string; methodSpecificId: string; method: string; }; }; contentStream: { created: string; versionId: string; linkedResourceMetadata: LinkedResourceMetadataResolutionResult[]; }; contentMetadata: Record; }; export type ShallowTypedTx = { body: { messages: any[]; memo: string; timeout_height: string; extension_options: any[]; non_critical_extension_options: any[]; }; auth_info: { signer_infos: { public_key: { '@type': string; key: string; }; mode_info: { single: { mode: string; }; }; sequence: string; }[]; fee: { amount: Coin[]; gas_limit: string; payer: string; granter: string; }; tip: any | null; }; signatures: string[]; }; export type ShallowTypedTxTxResponses = { height: string; txhash: string; codespace: string; code: number; data: string; raw_log: string; logs: any[]; info: string; gas_wanted: string; gas_used: string; tx: ShallowTypedTx; timestamp: string; events: any[]; }; export type ShallowTypedTxsResponse = { txs: ShallowTypedTx[]; tx_responses: ShallowTypedTxTxResponses[]; pagination: string | null; total: string; } | undefined; export type BlockResponse = { block_id: BlockID; block: Block; sdk_block: Block; }; export type Block = { header: Header; data: Data; evidence: Evidence; last_commit: LastCommit; }; export type Data = { txs: any[]; }; export type Evidence = { evidence: any[]; }; export type Header = { version: Version; chain_id: string; height: string; time: string; last_block_id: BlockID; last_commit_hash: string; data_hash: string; validators_hash: string; next_validators_hash: string; consensus_hash: string; app_hash: string; last_results_hash: string; evidence_hash: string; proposer_address: string; }; export type BlockID = { hash: string; part_set_header: PartSetHeader; }; export type PartSetHeader = { total: number; hash: string; }; export type Version = { block: string; app: string; }; export type LastCommit = { height: string; round: number; block_id: BlockID; signatures: Signature[]; }; export type Signature = { block_id_flag: string; validator_address?: string; timestamp: Date; signature?: string; }; export type VerificationResult = { verified: boolean; revoked?: boolean; suspended?: boolean; error?: IVerifyResult['error']; }; export type StatusCheckResult = { revoked?: boolean; suspended?: boolean; error?: IError; }; export type RevocationResult = { revoked: boolean; error?: IError; statusList?: StatusList2021Revocation; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type BulkRevocationResult = { revoked: boolean[]; error?: IError; statusList?: StatusList2021Revocation; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type SuspensionResult = { suspended: boolean; error?: IError; statusList?: StatusList2021Suspension; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type BulkSuspensionResult = { suspended: boolean[]; error?: IError; statusList?: StatusList2021Suspension; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type UnsuspensionResult = { unsuspended: boolean; error?: IError; statusList?: StatusList2021Suspension; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type BulkUnsuspensionResult = { unsuspended: boolean[]; error?: IError; statusList?: StatusList2021Suspension; symmetricKey?: string; published?: boolean; resourceMetadata?: LinkedResourceMetadataResolutionResult; }; export type Bitstring = string; export type StatusList2021Revocation = { StatusList2021: { statusPurpose: typeof DefaultStatusList2021StatusPurposeTypes.revocation; encodedList: string; validFrom: string; validUntil?: string; }; metadata: { type: typeof DefaultStatusList2021ResourceTypes.revocation; encrypted: boolean; encoding: DefaultStatusList2021Encoding; encryptedSymmetricKey?: string; paymentConditions?: PaymentCondition[]; }; }; export type StatusList2021Suspension = { StatusList2021: { statusPurpose: typeof DefaultStatusList2021StatusPurposeTypes.suspension; encodedList: string; validFrom: string; validUntil?: string; }; metadata: { type: typeof DefaultStatusList2021ResourceTypes.suspension; encrypted: boolean; encoding: DefaultStatusList2021Encoding; encryptedSymmetricKey?: string; paymentConditions?: PaymentCondition[]; }; }; export type AccessControlConditionType = typeof AccessControlConditionTypes[keyof typeof AccessControlConditionTypes]; export type AccessControlConditionReturnValueComparator = typeof AccessControlConditionReturnValueComparators[keyof typeof AccessControlConditionReturnValueComparators]; export type PaymentCondition = { feePaymentAddress: string; feePaymentAmount: string; intervalInSeconds: number; blockHeight?: string; type: Extract; }; export type DkgOptions = { chain?: Extract; network?: LitNetwork; }; export type CreateStatusList2021Result = { created: boolean; error?: Error; resource: StatusList2021Revocation | StatusList2021Suspension; resourceMetadata: LinkedResourceMetadataResolutionResult; encrypted?: boolean; symmetricKey?: string; }; export type TransactionResult = { successful: boolean; transactionHash?: string; events?: DeliverTxResponse['events']; rawLog?: string; txResponse?: DeliverTxResponse; error?: IError; }; export type ObservationResult = { subscribed: boolean; meetsCondition: boolean; transactionHash?: string; events?: DeliverTxResponse['events']; rawLog?: string; txResponse?: ShallowTypedTxTxResponses; error?: IError; }; export declare const AccessControlConditionTypes: { readonly timelockPayment: "timelockPayment"; readonly memoNonce: "memoNonce"; readonly balance: "balance"; }; export declare const AccessControlConditionReturnValueComparators: { readonly lessThan: "<"; readonly greaterThan: ">"; readonly equalTo: "="; readonly lessThanOrEqualTo: "<="; readonly greaterThanOrEqualTo: ">="; }; export declare const RemoteListPattern: RegExp; export declare const CreateIdentifierMethodName = "swisstronikCreateIdentifier"; export declare const UpdateIdentifierMethodName = "swisstronikUpdateIdentifier"; export declare const DeactivateIdentifierMethodName = "swisstronikDeactivateIdentifier"; export declare const CreateResourceMethodName = "swisstronikCreateLinkedResource"; export declare const CreateStatusList2021MethodName = "swisstronikCreateStatusList2021"; export declare const BroadcastStatusList2021MethodName = "swisstronikBroadcastStatusList2021"; export declare const GenerateDidDocMethodName = "swisstronikGenerateDidDoc"; export declare const GenerateDidDocWithLinkedResourceMethodName = "swisstronikGenerateDidDocWithLinkedResource"; export declare const GenerateKeyPairMethodName = "swisstronikGenerateIdentityKeys"; export declare const GenerateVersionIdMethodName = "swisstronikGenerateVersionId"; export declare const GenerateStatusList2021MethodName = "swisstronikGenerateStatusList2021"; export declare const IssueRevocableCredentialWithStatusList2021MethodName = "swisstronikIssueRevocableCredentialWithStatusList2021"; export declare const IssueSuspendableCredentialWithStatusList2021MethodName = "swisstronikIssueSuspendableCredentialWithStatusList2021"; export declare const VerifyCredentialMethodName = "swisstronikVerifyCredential"; export declare const VerifyPresentationMethodName = "swisstronikVerifyPresentation"; export declare const CheckCredentialStatusMethodName = "swisstronikCheckCredentialStatus"; export declare const RevokeCredentialMethodName = "swisstronikRevokeCredential"; export declare const RevokeCredentialsMethodName = "swisstronikRevokeCredentials"; export declare const SuspendCredentialMethodName = "swisstronikSuspendCredential"; export declare const SuspendCredentialsMethodName = "swisstronikSuspendCredentials"; export declare const UnsuspendCredentialMethodName = "swisstronikUnsuspendCredential"; export declare const UnsuspendCredentialsMethodName = "swisstronikUnsuspendCredentials"; export declare const TransactSendTokensMethodName = "swisstronikTransactSendTokens"; export declare const ObservePaymentConditionMethodName = "swisstronikObservePaymentCondition"; export declare const DIDPrefix = "did"; export declare const SwisstronikDIDMethod = "swtr"; export interface ISwisstronikCreateIdentifierArgs { kms: string; alias: string; document: DIDDocumentExternal; keys?: TImportableEd25519Key[]; versionId?: string; fee?: DidStdFee; } export interface ISwisstronikUpdateIdentifierArgs { kms: string; document: DIDDocumentExternal; keys?: TImportableEd25519Key[]; versionId?: string; fee?: DidStdFee; } export interface ISwisstronikDeactivateIdentifierArgs { kms: string; document: DIDDocumentExternal; keys?: TImportableEd25519Key[]; fee?: DidStdFee; } export interface ISwisstronikCreateLinkedResourceArgs { kms: string; payload: ResourcePayload; file?: string; signInputs?: ISignInputs[]; fee?: DidStdFee; } export interface ISwisstronikCreateStatusList2021Args { kms: string; issuerDid: string; statusListName: string; statusPurpose: DefaultStatusList2021StatusPurposeType; encrypted: boolean; paymentConditions?: PaymentCondition[]; dkgOptions?: DkgOptions; resourceVersion?: ResourcePayload['version']; alsoKnownAs?: ResourcePayload['alsoKnownAs']; statusListLength?: number; statusListEncoding?: DefaultStatusList2021Encoding; validUntil?: string; returnSymmetricKey?: boolean; } export interface ISwisstronikCreateUnencryptedStatusList2021Args { kms: string; payload: StatusList2021ResourcePayload; file?: string; signInputs?: ISignInputs[]; fee?: DidStdFee; } export interface ISwisstronikBroadcastStatusList2021Args { kms: string; payload: StatusList2021ResourcePayload; file?: string; signInputs?: ISignInputs[]; fee?: DidStdFee; } export interface ISwisstronikGenerateDIDDocumentArgs { verificationMethod: VerificationMethods; methodSpecificIdAlgo: MethodSpecificIdAlgo; } export interface ISwisstronikGenerateDIDDocumentWithLinkedResourceArgs extends ISwisstronikGenerateDIDDocumentArgs { [key: string]: any; } export interface ISwisstronikGenerateKeyPairArgs { [key: string]: any; } export interface ISwisstronikGenerateVersionIdArgs { [key: string]: any; } export interface ISwisstronikGenerateStatusList2021Args { length?: number; buffer?: Uint8Array; bitstringEncoding?: DefaultStatusList2021Encoding; } export interface ISwisstronikIssueRevocableCredentialWithStatusList2021Args { issuanceOptions: ICreateVerifiableCredentialArgs; statusOptions: { statusPurpose: 'revocation'; statusListName: string; statusListIndex?: number; statusListVersion?: string; statusListRangeStart?: number; statusListRangeEnd?: number; indexNotIn?: number[]; }; } export interface ISwisstronikIssueSuspendableCredentialWithStatusList2021Args { issuanceOptions: ICreateVerifiableCredentialArgs; statusOptions: { statusPurpose: 'suspension'; statusListName: string; statusListIndex?: number; statusListVersion?: string; statusListRangeStart?: number; statusListRangeEnd?: number; indexNotIn?: number[]; }; } export interface ISwisstronikVerifyCredentialWithStatusList2021Args { credential: W3CVerifiableCredential; verificationArgs?: IVerifyCredentialArgs; fetchList?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikVerifyPresentationWithStatusList2021Args { presentation: VerifiablePresentation; verificationArgs?: IVerifyPresentationArgs; fetchList?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikCheckCredentialStatusWithStatusList2021Args { credential?: W3CVerifiableCredential; statusOptions?: ISwisstronikCheckCredentialWithStatusList2021StatusOptions; fetchList?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikRevokeCredentialWithStatusList2021Args { credential?: W3CVerifiableCredential; revocationOptions?: ISwisstronikRevokeCredentialWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikRevokeBulkCredentialsWithStatusList2021Args { credentials?: W3CVerifiableCredential[]; revocationOptions?: ISwisstronikRevokeBulkCredentialsWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikSuspendCredentialWithStatusList2021Args { credential?: W3CVerifiableCredential; suspensionOptions?: ISwisstronikSuspendCredentialWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikSuspendBulkCredentialsWithStatusList2021Args { credentials?: W3CVerifiableCredential[]; suspensionOptions?: ISwisstronikSuspendBulkCredentialsWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikUnsuspendCredentialWithStatusList2021Args { credential?: W3CVerifiableCredential; unsuspensionOptions?: ISwisstronikUnsuspendCredentialWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikUnsuspendBulkCredentialsWithStatusList2021Args { credentials?: W3CVerifiableCredential[]; unsuspensionOptions?: ISwisstronikUnsuspendBulkCredentialsWithStatusList2021Options; fetchList?: boolean; publish?: boolean; publishEncrypted?: boolean; symmetricKey?: string; paymentConditions?: PaymentCondition[]; writeToFile?: boolean; returnUpdatedStatusList?: boolean; returnSymmetricKey?: boolean; returnStatusListMetadata?: boolean; dkgOptions?: DkgOptions; options?: ISwisstronikStatusList2021Options; } export interface ISwisstronikTransactSendTokensArgs { recipientAddress: string; amount: Coin; memo?: string; txBytes?: Uint8Array; returnTxResponse?: boolean; } export interface ISwisstronikObservePaymentConditionArgs { recipientAddress?: string; amount?: Coin; intervalInSeconds?: number; blockHeight?: string; comparator?: Extract>; [UpdateIdentifierMethodName]: (args: ISwisstronikUpdateIdentifierArgs, context: IContext) => Promise>; [DeactivateIdentifierMethodName]: (args: ISwisstronikDeactivateIdentifierArgs, context: IContext) => Promise; [CreateResourceMethodName]: (args: ISwisstronikCreateLinkedResourceArgs, context: IContext) => Promise; [CreateStatusList2021MethodName]: (args: ISwisstronikCreateStatusList2021Args, context: IContext) => Promise; [BroadcastStatusList2021MethodName]: (args: ISwisstronikBroadcastStatusList2021Args, context: IContext) => Promise; [GenerateDidDocMethodName]: (args: ISwisstronikGenerateDIDDocumentArgs, context: IContext) => Promise; [GenerateDidDocWithLinkedResourceMethodName]: (args: ISwisstronikGenerateDIDDocumentWithLinkedResourceArgs, context: IContext) => Promise; [GenerateKeyPairMethodName]: (args: ISwisstronikGenerateKeyPairArgs, context: IContext) => Promise; [GenerateVersionIdMethodName]: (args: ISwisstronikGenerateVersionIdArgs, context: IContext) => Promise; [GenerateStatusList2021MethodName]: (args: ISwisstronikGenerateStatusList2021Args, context: IContext) => Promise; [IssueRevocableCredentialWithStatusList2021MethodName]: (args: ISwisstronikIssueRevocableCredentialWithStatusList2021Args, context: IContext) => Promise; [IssueSuspendableCredentialWithStatusList2021MethodName]: (args: ISwisstronikIssueSuspendableCredentialWithStatusList2021Args, context: IContext) => Promise; [VerifyCredentialMethodName]: (args: ISwisstronikVerifyCredentialWithStatusList2021Args, context: IContext) => Promise; [VerifyPresentationMethodName]: (args: ISwisstronikVerifyPresentationWithStatusList2021Args, context: IContext) => Promise; [CheckCredentialStatusMethodName]: (args: ISwisstronikCheckCredentialStatusWithStatusList2021Args, context: IContext) => Promise; [RevokeCredentialMethodName]: (args: ISwisstronikRevokeCredentialWithStatusList2021Args, context: IContext) => Promise; [RevokeCredentialsMethodName]: (args: ISwisstronikRevokeBulkCredentialsWithStatusList2021Args, context: IContext) => Promise; [SuspendCredentialMethodName]: (args: ISwisstronikSuspendCredentialWithStatusList2021Args, context: IContext) => Promise; [SuspendCredentialsMethodName]: (args: ISwisstronikSuspendBulkCredentialsWithStatusList2021Args, context: IContext) => Promise; [UnsuspendCredentialMethodName]: (args: ISwisstronikUnsuspendCredentialWithStatusList2021Args, context: IContext) => Promise; [UnsuspendCredentialsMethodName]: (args: ISwisstronikUnsuspendBulkCredentialsWithStatusList2021Args, context: IContext) => Promise; [TransactSendTokensMethodName]: (args: ISwisstronikTransactSendTokensArgs, context: IContext) => Promise; [ObservePaymentConditionMethodName]: (args: ISwisstronikObservePaymentConditionArgs, context: IContext) => Promise; } //# sourceMappingURL=ISwisstronikPlugin.d.ts.map