UNPKG

@truenetworkio/sdk

Version:

True Network SDK is the abstracted interface for interacting with True Network nodes.

29 lines (28 loc) 1.07 kB
import { ApiPromise } from "@polkadot/api"; import { KeyringPair } from '@polkadot/keyring/types'; import { NetworkConfig } from "./utils"; export declare class TrueApi { private static instance; network: ApiPromise; account: KeyringPair; issuerHash: string | undefined; constructor(api: ApiPromise, accountKey: string, issuerHash?: string); close(): Promise<void>; static create(accountKey: string, nodeUrl?: NetworkConfig): Promise<TrueApi>; setIssuer(hash: string): Promise<void>; registerIssuer(name: string, controllers: string[]): Promise<string>; getReputationScore(algoId: number, user: string): Promise<number>; getSchemaFromHash(schemaHash: string): Promise<[string, any][] | undefined>; getIssuerFromHash(issuerHash: string): Promise<{ name: string; controllers: string[]; } | undefined>; getBalance(address: string): Promise<{ text: string; numeric: number; decimals: number; }>; } export * from './schemas'; export * from './utils'; export * from './network';