@ardier16/q-js-sdk
Version:
Typescript Library to interact with Q System Contracts
32 lines (31 loc) • 1.28 kB
TypeScript
/// <reference types="bn.js" />
import Web3 from 'web3';
import { AddressWithBalance } from '..';
export { Web3 };
export interface ConnectionInfo {
networkId: number;
nodeInfo: string;
rpcUrl: string;
}
export declare class Web3Adapter {
readonly web3: Web3;
constructor(web3: Web3);
readonly ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
readonly SDK_VERSION: string;
toWei: {
(val: import("bn.js"), unit?: import("web3-utils").Unit): import("bn.js");
(val: string, unit?: import("web3-utils").Unit): string;
};
fromWei: (value: string | import("bn.js"), unit?: import("web3-utils").Unit) => string;
toBN: (value: string | number) => import("bn.js");
startProviderEngine(): boolean;
stopProviderEngine(): boolean;
getRpcUrl(): string;
getConnectionInfo(): Promise<ConnectionInfo>;
getDefaultAccount(): Promise<string>;
getAccounts(): Promise<string[]>;
getTotalQInExistence(): Promise<number>;
getBalance(address: string, convertToQ?: boolean): Promise<string>;
getBalances(addresses: string[], convertToQ?: boolean): Promise<AddressWithBalance[]>;
forEachAddress<T>(addresses: string[], operation: (address: string, i?: number) => Promise<T>): Promise<T[]>;
}