UNPKG

dab-js-without-registry

Version:
50 lines (49 loc) 1.21 kB
import type { Principal } from '@dfinity/principal'; export declare type DetailType = bigint | Array<DetailType> | Array<number> | string | true | false | number | Principal; export declare type DetailValue = { 'I64': bigint; } | { 'U64': bigint; } | { 'Vec': Array<DetailValue>; } | { 'Slice': Array<number>; } | { 'Text': string; } | { 'True': null; } | { 'False': null; } | { 'Float': number; } | { 'Principal': Principal; }; export declare type Error = { 'NotAuthorized': null; } | { 'BadParameters': null; } | { 'Unknown': string; } | { 'NonExistentItem': null; }; export interface Metadata { 'thumbnail': string; 'name': string; 'frontend': [] | [string]; 'description': string; 'principal_id': Principal; 'details': Array<[string, DetailValue]>; } export declare type Response = { 'Ok': [] | [string]; } | { 'Err': Error; }; export default interface RegistryStandard { 'add': (arg_1: Metadata) => Promise<Response>; 'get': (arg_0: Principal) => Promise<[] | [Metadata]>; 'name': () => Promise<string>; 'remove': (arg_0: Principal) => Promise<Response>; }