UNPKG

@q-dev/q-js-sdk

Version:

Typescript Library to interact with Q System Contracts

25 lines (24 loc) 1.13 kB
import { AddressWithBalance } from '..'; import { Signer, utils, providers, BigNumberish } from 'ethers'; import { SignerOrProvider } from '../types'; export interface ConnectionInfo { networkId: number; nodeInfo: string; rpcUrl: string; } export declare class Web3Adapter { readonly signerOrProvider: SignerOrProvider; readonly provider: providers.Provider; readonly signer?: Signer; constructor(signerOrProvider: SignerOrProvider); readonly ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; readonly ZERO_BYTES_32 = "0x0000000000000000000000000000000000000000000000000000000000000000"; readonly SDK_VERSION: string; toWei: typeof utils.parseUnits; fromWei(value: BigNumberish, unitName?: BigNumberish): string; getDefaultAccount(): Promise<string>; 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[]>; getBlockNumber(): Promise<number>; }