UNPKG

@q-dev/q-ts-gdk-sdk

Version:

Typescript Library to interact with GDK Contracts

54 lines (53 loc) 2.32 kB
/// <reference types="node" /> import type BN from "bn.js"; import type { ContractOptions } from "web3-eth-contract"; import type { EventLog } from "web3-core"; import type { EventEmitter } from "events"; import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types"; export interface EventOptions { filter?: object; fromBlock?: BlockType; topics?: string[]; } export type Approval = ContractEventLog<{ owner: string; spender: string; value: string; 0: string; 1: string; 2: string; }>; export type Transfer = ContractEventLog<{ from: string; to: string; value: string; 0: string; 1: string; 2: string; }>; export interface IERC20MetadataUpgradeable extends BaseContract { constructor(jsonInterface: any[], address?: string, options?: ContractOptions): IERC20MetadataUpgradeable; clone(): IERC20MetadataUpgradeable; methods: { allowance(owner: string, spender: string): NonPayableTransactionObject<string>; approve(spender: string, amount: number | string | BN): NonPayableTransactionObject<boolean>; balanceOf(account: string): NonPayableTransactionObject<string>; decimals(): NonPayableTransactionObject<string>; name(): NonPayableTransactionObject<string>; symbol(): NonPayableTransactionObject<string>; totalSupply(): NonPayableTransactionObject<string>; transfer(to: string, amount: number | string | BN): NonPayableTransactionObject<boolean>; transferFrom(from: string, to: string, amount: number | string | BN): NonPayableTransactionObject<boolean>; }; events: { Approval(cb?: Callback<Approval>): EventEmitter; Approval(options?: EventOptions, cb?: Callback<Approval>): EventEmitter; Transfer(cb?: Callback<Transfer>): EventEmitter; Transfer(options?: EventOptions, cb?: Callback<Transfer>): EventEmitter; allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter; }; once(event: "Approval", cb: Callback<Approval>): void; once(event: "Approval", options: EventOptions, cb: Callback<Approval>): void; once(event: "Transfer", cb: Callback<Transfer>): void; once(event: "Transfer", options: EventOptions, cb: Callback<Transfer>): void; }