import { BigNumber } from "bignumber.js";
import { Web3 } from "web3";
import { Address, Hash, SchemePermissions } from "./commonTypes";
export declare class Utils {
    static readonly NULL_ADDRESS: Address;
    static readonly NULL_HASH: Hash;
    static setDeployedAddresses(addresses: any): void;
    static getDeployedAddress(contractName: string): Address | undefined;
    /**
     * Returns Truffle contract wrapper given the name of the contract (like "SchemeRegistrar").
     * Optimized for synchronicity issues encountered with MetaMask.
     * Throws an exception if it can't load the contract.
     * Uses the asynchronous web.eth.getAccounts to obtain the default account (good with MetaMask).
     * @param contractName like "SchemeRegistrar"
     */
    static requireContract(contractName: string): Promise<any>;
    /**
     * Returns the web3 object.
     * When called for the first time, web3 is initialized from the Arc.js configuration.
     * Throws an exception when web3 cannot be initialized.
     * @param - Optional when true to refetch web3, in case the network has changed.
     */
    static getWeb3(refetch?: boolean): Promise<Web3>;
    /**
     * Returns the address of the default user account.
     *
     * Has the side-effect of setting web3.eth.defaultAccount.
     *
     * Throws an exception on failure.
     */
    static getDefaultAccount(): Promise<string>;
    /**
     * Ask MetaMask to prompt the user for permission to access their wallet. MetaMask
     * will insert the user's accounts into the existing Web3 object.  If you are watching
     * for account changes then you will receive a notification
     * (see [AccountService.initiateAccountWatch](/arc.js/api/classes/AccountService#initiateAccountWatch)).
     *
     * Note that this won't work if you have passed `false` for `InitializeArcOptions.useMetamaskEthereumWeb3Provider`
     * when you called `InitializeArcJs`.
     *
     * @returns true or false depending on whether the user approves of account sharing.
     */
    static getUserApprovalForAccounts(): Promise<boolean>;
    /**
     * Return the current token balance for the given token and agent.
     */
    static getTokenBalance(agentAddress: Address, tokenAddress: Address): Promise<BigNumber>;
    /**
     * Return the current ETH balance for the given agent.
     */
    static getEthBalance(agentAddress: Address): Promise<BigNumber>;
    /**
     * Return the hash of a string the same way solidity would, and to a format that will be
     * properly translated into a bytes32 that solidity expects
     * @param str a string
     */
    static SHA3(str: string): string;
    /**
     * Return the tightly-packed hash of any arbitrary array of
     * objects just as Solidity's `keccak256` function would do.
     *
     * Items in the `types` array must appear in the same order in which the values would be
     * passed to Solidity's `keccak256` function.
     *
     * Type names can be:
     *   - `bytes[N]` - fails if (N < 1 || N > 32)
     *   - `string`
     *   - `bool`
     *   - `address`
     *   - `uint[N]`  - fails if ((N % 8) || (N < 8) || (N > 256))
     *   - `int[N]`   - fails if ((N % 8) || (N < 8) || (N > 256))
     *
     * Use `bytes32` for a Hash value
     *
     * See: https://github.com/ethereumjs/ethereumjs-abi
     *
     * @param types array of type names.
     * @param values - the values to pack and hash.  These must appear in the same order in which the types are ordered.
     */
    static keccak256(types: Array<string>, values: Array<any>): string;
    /**
     * Convert scheme permissions string to a number
     * @param {string} permissions
     */
    static permissionsStringToNumber(permissions: string): SchemePermissions;
    /**
     * Convert SchemePermissions | DefaultSchemePermissions to a scheme permissions string
     * @param {Number} permissions
     */
    static numberToPermissionsString(permissions: SchemePermissions): string;
    /**
     * Returns address of the global GEN token.
     */
    static getGenTokenAddress(): string;
    /**
     * Returns promise of the name of the current or given network
     * @param id Optional id of the network
     */
    static getNetworkName(id?: number): Promise<string>;
    /**
     * Returns promise of the id of the current network
     * @param - Optional when true to refetch the network id, in case
     * it has changed.
     */
    static getNetworkId(): Promise<number>;
    private static contractCache;
    private static web3;
    private static alreadyTriedAndFailed;
    private static networkId;
    private static deployedContractAddresses;
    private static clearContractCache;
}
export { Web3 } from "web3";
