import { type ActorSubclass, HttpAgent, SignIdentity } from '@dfinity/agent'; import type { InterfaceFactory } from '@dfinity/candid/lib/cjs/idl'; import { DelegationChain, DelegationIdentity } from '@dfinity/identity'; import { Principal } from '@dfinity/principal'; export interface CreateActorResult { actor: ActorSubclass; agent: HttpAgent; } export declare function createConnection(delegationIdentity: DelegationIdentity, canisterId: string, interfaceFactory: InterfaceFactory, actor?: ActorSubclass, agent?: HttpAgent): BaseConnection; export declare const requestDelegation: (identity: SignIdentity, { canisterId, date }: { canisterId?: string; date?: Date; }) => Promise; export declare function _createActor(interfaceFactory: InterfaceFactory, canisterId: string, identity?: SignIdentity): Promise>; export interface AbstractConnection { delegationIdentity: SignIdentity; actor?: ActorSubclass; agent?: HttpAgent; canisterId?: string; getActor(): Promise>; } export declare class BaseConnection implements AbstractConnection { delegationIdentity: SignIdentity; canisterId: string; interfaceFactory: InterfaceFactory; actor?: ActorSubclass | undefined; agent?: HttpAgent | undefined; constructor(delegationIdentity: SignIdentity, canisterId: string, interfaceFactory: InterfaceFactory, actor?: ActorSubclass | undefined, agent?: HttpAgent | undefined); getActor(): Promise>; protected _getActor(canisterId: string, interfaceFactory: InterfaceFactory, _date?: Date): Promise>; } export interface IIDelegationResult { delegation: { pubkey: Uint8Array; expiration: bigint; targets?: Principal[] | string[]; }; signature: Uint8Array; } export interface DelegationMessage { kind: string; delegations: IIDelegationResult[]; userPublicKey: Uint8Array; } export interface DelegationResult { delegationIdentity: DelegationIdentity; delegationChain: DelegationChain; } export declare function handleDelegation(message: DelegationMessage, key: SignIdentity): Promise; export declare const executeWithLogging: (func: () => Promise) => Promise;