@hydro-protocol/hydro-client-js
Version:
Javascript SDK for the Hydro API
26 lines (25 loc) • 930 B
TypeScript
import { Account } from './HydroClient';
export interface Web3HandlerOptions {
web3Url?: string;
}
/**
* Handle building requests to the server, including authentication
* in the request header.
*/
export declare class Web3Handler {
private PROXY_ADDRESS;
private account;
private web3?;
constructor(account: Account, options?: Web3HandlerOptions);
getBalance(address?: string): Promise<string>;
wrapEth(wethAddress: string, amount: string, wait?: boolean): Promise<string>;
unwrapEth(wethAddress: string, amount: string, wait?: boolean): Promise<string>;
getAllowance(address: string): Promise<string>;
enableToken(address: string, wait?: boolean): Promise<string>;
disableToken(address: string, wait?: boolean): Promise<string>;
private getERC20Contract;
private getWethContract;
private getWeb3;
private signAndSendTransaction;
private constructTransaction;
}