/// import Moac from "./moac"; import SmartContract from "./smartContract"; /** * toolkit of erc20 * * @class ERC20 */ declare class ERC20 extends SmartContract { /** * Creates an instance of ERC20 * @memberof ERC20 */ constructor(); /** * init instance of erc20 contract * * @param {string} tokenContractAddress contract address of erc20 token * @param {Moac} moac instance * @memberof ERC20 */ init(tokenContractAddress: string, moac: Moac): void; /** * destroy instance of erc20 contract * * @memberof ERC20 */ destroy(): void; /** * request name of erc20 token * * @returns {Promise} name of erc20 token * @memberof ERC20 */ name(): Promise; /** * request symbol of erc20 token * * @returns {Promise} symbol of erc20 token * @memberof ERC20 */ symbol(): Promise; /** * request decimals of erc20 token * * @returns {Promise} decimals of erc20 token * @memberof ERC20 */ decimals(): Promise; /** * request totalSupply of erc20 token * * @returns {Promise} decimals of erc20 token * @memberof ERC20 */ totalSupply(): Promise; /** * request balance of erc20 token * * @param {string} address moac address * @returns {Promise} resolve '0' if request failed, the precision rely on decimal function * @memberof ERC20 */ balanceOf(address: string): Promise; /** * transfer erc20 token * * @param {string} secret moac secret of sender address * @param {string} to address of destination * @param {string} amount amount * @param {ITransactionOption} options specify gasPrice, nonce, gasLimit etc. * @returns {Promise} resolve hash if successful * @memberof ERC20 */ transfer(secret: string, to: string, amount: string, options?: ITransactionOption): Promise; /** * Token owner can approve for `spender` to transferFrom(...) `tokens` from the token owner's account * * @param {string} secret moac secret of sender address * @param {string} spender address of spender * @param {string} amount amount * @param {ITransactionOption} options specify gasPrice, nonce, gasLimit etc. * @returns {Promise} resolve hash if successful * @memberof ERC20 */ approve(secret: string, spender: string, amount: string, options?: ITransactionOption): Promise; /** * Returns the amount of tokens approved by the owner that can be transferred to the spender's account * * @param {string} secret moac secret of sender address * @param {string} to address of destination * @param {string} amount amount * @returns {Promise} resolve hash if successful * @memberof ERC20 */ allowance(owner: string, spender: string): Promise; /** * Transfer `tokens` from the `from` account to the `to` account * * @param {string} secret moac secret of sender address * @param {string} from address of from * @param {string} to address of destination * @param {string} amount amount * @param {ITransactionOption} options specify gasPrice, nonce, gasLimit etc. * @returns {Promise} resolve hash if successful * @memberof ERC20 */ transferFrom(secret: string, from: string, to: string, amount: string, options?: ITransactionOption): Promise; } export default ERC20;