UNPKG

@celo/contractkit

Version:

Celo's ContractKit to interact with Celo network

50 lines (49 loc) 2.23 kB
import { IERC20 } from '@celo/abis/web3/IERC20'; import BigNumber from 'bignumber.js'; import { BaseWrapper } from './BaseWrapper'; /** * ERC-20 contract only containing the non-optional functions */ export declare class Erc20Wrapper<T extends IERC20> extends BaseWrapper<T> { /** * Querying allowance. * @param from Account who has given the allowance. * @param to Address of account to whom the allowance was given. * @returns Amount of allowance. */ allowance: (owner: string, spender: string) => Promise<BigNumber>; /** * Returns the total supply of the token, that is, the amount of tokens currently minted. * @returns Total supply. */ totalSupply: () => Promise<BigNumber>; /** * Approve a user to transfer the token on behalf of another user. * @param spender The address which is being approved to spend the token. * @param value The amount of the token approved to the spender. * @return True if the transaction succeeds. */ approve: (spender: string, amount: string | number) => import("@celo/connect").CeloTransactionObject<boolean>; /** * Transfers the token from one address to another. * @param to The address to transfer the token to. * @param value The amount of the token to transfer. * @return True if the transaction succeeds. */ transfer: (recipient: string, amount: string | number) => import("@celo/connect").CeloTransactionObject<boolean>; /** * Transfers the token from one address to another on behalf of a user. * @param from The address to transfer the token from. * @param to The address to transfer the token to. * @param value The amount of the token to transfer. * @return True if the transaction succeeds. */ transferFrom: (sender: string, recipient: string, amount: string | number) => import("@celo/connect").CeloTransactionObject<boolean>; /** * Gets the balance of the specified address. * @param owner The address to query the balance of. * @return The balance of the specified address. */ balanceOf: (owner: string) => Promise<BigNumber>; } export type Erc20WrapperType<T extends IERC20> = Erc20Wrapper<T>;