cic-client
Version:
Typescript libraries for building CIC client applications
69 lines (68 loc) • 1.83 kB
TypeScript
/**
* Provides a representation of a token transfer transaction, aswell as a processor to detect transfer events.
*
* @module erc20
*/
import { BN } from 'bn';
import { Log, Tx } from './tx';
declare const topics: {
transfer: string;
};
/**
* A Transfer instance represents a single ERC20 token transfer.
*
* @class Transfer
*/
declare class Transfer {
from: string;
to: string;
token: string;
value: BigInt;
tx: Tx;
/**
*
* @param tx A transaction object
* @param token Ethereum address of ERC20 token transferred
* @param from Ethereum address of sender
* @param to Ethereum address of receipient
* @param value Value of transfer
*/
constructor(tx: Tx, token: string, from: string, to: string, value: BigInt);
/**
* Scans a transaction log for transfer event.
*
* @static
* @param w3 A connected Web3 object
* @param success State of transaction
* @param token Token address to find transfer for
* @param log A Web3 transaction receipt logs array
* @return transfer Instance of Transfer if transfer is found, undefined if not.
*/
static processLog(w3: any, success: boolean, token: string, log: Log): Promise<Transfer>;
}
/**
* Metadata for a single ERC20 token.
*
* @class Token
*
*/
declare class Token {
address: string;
name: string;
decimals: number;
totalSupply: BN;
symbol: string;
/**
*
* @param address Ethereum address of token contract
* @param name ERC20 token name
* @param symbol ERC20 token symbol
*/
constructor(address: string, name: string, symbol: string, decimals: number, totalSupply: BN);
/**
* Informal string representation of token.
*
*/
toString(): string;
}
export { Transfer, Token, topics, };