UNPKG

dab-js-without-registry

Version:
37 lines (36 loc) 1.46 kB
import { HttpAgent } from '@dfinity/agent'; import Registry from './standard_registry'; import { FormattedMetadata } from '../utils/registry'; import { Principal } from '@dfinity/principal'; interface CanisterMetadata { url: string; name: string; description: string; version: number; logo_url: string; } export declare class CanisterRegistry extends Registry { constructor(agent?: HttpAgent); getAll: () => Promise<FormattedMetadata[]>; } export declare const getCanisterInfo: ({ canisterId, agent }: { canisterId: Principal | string; agent?: HttpAgent | undefined; }) => Promise<CanisterMetadata | undefined>; export declare const getMultipleCanisterInfo: ({ canisterIds, agent }: { canisterIds: (string | Principal)[]; agent?: HttpAgent | undefined; }) => Promise<CanisterMetadata[] | undefined>; export declare const getAll: (agent?: HttpAgent | undefined) => Promise<CanisterMetadata[]>; declare const _default: { getCanisterInfo: ({ canisterId, agent }: { canisterId: string | Principal; agent?: HttpAgent | undefined; }) => Promise<CanisterMetadata | undefined>; getMultipleCanisterInfo: ({ canisterIds, agent }: { canisterIds: (string | Principal)[]; agent?: HttpAgent | undefined; }) => Promise<CanisterMetadata[] | undefined>; getAll: (agent: HttpAgent) => () => Promise<FormattedMetadata[]>; }; export default _default;