/* Copyright 2021 The caver-js Authors This file is part of the caver-js library. The caver-js library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The caver-js library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the caver-js. If not, see . */ import BigNumber from 'bignumber.js' import { IWallet } from '../../caver-wallet/src' import { Contract, SendOptions, SendOptionsWithFormatter } from '../../caver-contract/src' import { TransactionReceipt } from '../../caver-core/src' import { AbiItem } from '../../caver-utils/src' export interface KIP7DeployParams { name: string symbol: string decimals?: number initialSupply?: BigNumber | string } export interface KIP7DetectedObject { IKIP7: boolean IKIP7Metadata: boolean IKIP7Mintable: boolean IKIP7Burnable: boolean IKIP7Pausable: boolean } export type Data = string | number | number[] | Buffer export class KIP7 extends Contract { static byteCode: string static abi: AbiItem[] static deploy(tokenInfo: KIP7DeployParams, sendOptions: string | SendOptions): Promise static deploy(tokenInfo: KIP7DeployParams, sendOptions: SendOptionsWithFormatter): Promise static detectInterface(contractAddress: string): Promise constructor(abi?: AbiItem[]) constructor(tokenAddress: string, abi?: AbiItem[]) clone(tokenAddress?: string): KIP7 detectInterface(): Promise supportsInterface(interfaceId: string): Promise name(): Promise symbol(): Promise decimals(): Promise totalSupply(): Promise balanceOf(account: string): Promise allowance(owner: string, spender: string): Promise isMinter(account: string): Promise isPauser(account: string): Promise paused(): Promise approve(spender: string, amount: string | number | BigNumber, sendParam?: SendOptions): Promise transfer(recipient: string, amount: string | number | BigNumber, sendParam?: SendOptions): Promise transferFrom( sender: string, recipient: string, amount: string | number | BigNumber, sendParam?: SendOptions ): Promise safeTransfer(recipient: string, amount: string | number | BigNumber, sendParam?: SendOptions): Promise safeTransfer(recipient: string, amount: string | number | BigNumber, data: Data, sendParam?: SendOptions): Promise safeTransferFrom( sender: string, recipient: string, amount: string | number | BigNumber, sendParam?: SendOptions ): Promise safeTransferFrom( sender: string, recipient: string, amount: string | number | BigNumber, data: Data, sendParam?: SendOptions ): Promise mint(account: string, amount: string | number | BigNumber, sendParam?: SendOptions): Promise addMinter(account: string, sendParam?: SendOptions): Promise renounceMinter(sendParam?: SendOptions): Promise burn(amount: string | number | BigNumber, sendParam?: SendOptions): Promise burnFrom(account: string, amount: string | number | BigNumber, sendParam?: SendOptions): Promise pause(sendParam?: SendOptions): Promise unpause(sendParam?: SendOptions): Promise addPauser(account: string, sendParam?: SendOptions): Promise renouncePauser(sendParam?: SendOptions): Promise }