/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */

import {
  ethers,
  EventFilter,
  Signer,
  BigNumber,
  BigNumberish,
  PopulatedTransaction,
  BaseContract,
  ContractTransaction,
  Overrides,
  CallOverrides,
} from "ethers";
import { BytesLike } from "@ethersproject/bytes";
import { Listener, Provider } from "@ethersproject/providers";
import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
import type { TypedEventFilter, TypedEvent, TypedListener } from "./common";

interface SaleTokenInterface extends ethers.utils.Interface {
  functions: {
    "buyToken(address,uint256)": FunctionFragment;
    "getAccountInfo(address)": FunctionFragment;
    "owner()": FunctionFragment;
    "renounceOwnership()": FunctionFragment;
    "saleInfo()": FunctionFragment;
    "settleSaleToken(address)": FunctionFragment;
    "supportStableCoin(uint256)": FunctionFragment;
    "supportStableCoinExist(address)": FunctionFragment;
    "supportStableCoinSaleNumber(address)": FunctionFragment;
    "transferOwnership(address)": FunctionFragment;
    "userPosition(address)": FunctionFragment;
    "userPositonStable(address,address)": FunctionFragment;
    "withdraw()": FunctionFragment;
    "withdrawERC20Token(address,address,uint256)": FunctionFragment;
    "withdrawToken()": FunctionFragment;
  };

  encodeFunctionData(
    functionFragment: "buyToken",
    values: [string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "getAccountInfo",
    values: [string]
  ): string;
  encodeFunctionData(functionFragment: "owner", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "renounceOwnership",
    values?: undefined
  ): string;
  encodeFunctionData(functionFragment: "saleInfo", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "settleSaleToken",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "supportStableCoin",
    values: [BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "supportStableCoinExist",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "supportStableCoinSaleNumber",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "transferOwnership",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "userPosition",
    values: [string]
  ): string;
  encodeFunctionData(
    functionFragment: "userPositonStable",
    values: [string, string]
  ): string;
  encodeFunctionData(functionFragment: "withdraw", values?: undefined): string;
  encodeFunctionData(
    functionFragment: "withdrawERC20Token",
    values: [string, string, BigNumberish]
  ): string;
  encodeFunctionData(
    functionFragment: "withdrawToken",
    values?: undefined
  ): string;

  decodeFunctionResult(functionFragment: "buyToken", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "getAccountInfo",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "renounceOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "saleInfo", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "settleSaleToken",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "supportStableCoin",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "supportStableCoinExist",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "supportStableCoinSaleNumber",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "transferOwnership",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "userPosition",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "userPositonStable",
    data: BytesLike
  ): Result;
  decodeFunctionResult(functionFragment: "withdraw", data: BytesLike): Result;
  decodeFunctionResult(
    functionFragment: "withdrawERC20Token",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "withdrawToken",
    data: BytesLike
  ): Result;

  events: {
    "BuyToken(address,address,uint256,uint256,uint256,uint256,uint256)": EventFragment;
    "OwnershipTransferred(address,address)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "BuyToken"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
}

export type BuyTokenEvent = TypedEvent<
  [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber] & {
    account: string;
    token: string;
    tokenAmount: BigNumber;
    saleTokenAmount: BigNumber;
    marketValue: BigNumber;
    capMarketValue: BigNumber;
    saleVolume: BigNumber;
  }
>;

export type OwnershipTransferredEvent = TypedEvent<
  [string, string] & { previousOwner: string; newOwner: string }
>;

export class SaleToken extends BaseContract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  listeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter?: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): Array<TypedListener<EventArgsArray, EventArgsObject>>;
  off<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  on<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  once<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeListener<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>,
    listener: TypedListener<EventArgsArray, EventArgsObject>
  ): this;
  removeAllListeners<EventArgsArray extends Array<any>, EventArgsObject>(
    eventFilter: TypedEventFilter<EventArgsArray, EventArgsObject>
  ): this;

  listeners(eventName?: string): Array<Listener>;
  off(eventName: string, listener: Listener): this;
  on(eventName: string, listener: Listener): this;
  once(eventName: string, listener: Listener): this;
  removeListener(eventName: string, listener: Listener): this;
  removeAllListeners(eventName?: string): this;

  queryFilter<EventArgsArray extends Array<any>, EventArgsObject>(
    event: TypedEventFilter<EventArgsArray, EventArgsObject>,
    fromBlockOrBlockhash?: string | number | undefined,
    toBlock?: string | number | undefined
  ): Promise<Array<TypedEvent<EventArgsArray & EventArgsObject>>>;

  interface: SaleTokenInterface;

  functions: {
    buyToken(
      _tokenAddress: string,
      _tokenAmount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    getAccountInfo(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        string[],
        BigNumber[],
        BigNumber[],
        number[]
      ] & {
        saleTokenAddress: string;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
        userBuyTokenAmount: BigNumber;
        tokens: string[];
        tokensUserAmount: BigNumber[];
        tokensGlobalAmount: BigNumber[];
        tokensDecimals: number[];
      }
    >;

    owner(overrides?: CallOverrides): Promise<[string]>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    saleInfo(
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber
      ] & {
        saleToken: string;
        approver: string;
        startAt: BigNumber;
        endAt: BigNumber;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
      }
    >;

    settleSaleToken(
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    supportStableCoin(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<[string]>;

    supportStableCoinExist(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<[boolean]>;

    supportStableCoinSaleNumber(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    userPosition(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, boolean] & { value: BigNumber; isWithdraw: boolean }
    >;

    userPositonStable(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<[BigNumber]>;

    withdraw(overrides?: CallOverrides): Promise<[boolean]>;

    withdrawERC20Token(
      _token: string,
      _account: string,
      _amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;

    withdrawToken(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<ContractTransaction>;
  };

  buyToken(
    _tokenAddress: string,
    _tokenAmount: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  getAccountInfo(
    _account: string,
    overrides?: CallOverrides
  ): Promise<
    [
      string,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      string[],
      BigNumber[],
      BigNumber[],
      number[]
    ] & {
      saleTokenAddress: string;
      saleTokenAmount: BigNumber;
      marketValue: BigNumber;
      capMarketValue: BigNumber;
      saleVolume: BigNumber;
      userBuyTokenAmount: BigNumber;
      tokens: string[];
      tokensUserAmount: BigNumber[];
      tokensGlobalAmount: BigNumber[];
      tokensDecimals: number[];
    }
  >;

  owner(overrides?: CallOverrides): Promise<string>;

  renounceOwnership(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  saleInfo(
    overrides?: CallOverrides
  ): Promise<
    [
      string,
      string,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber,
      BigNumber
    ] & {
      saleToken: string;
      approver: string;
      startAt: BigNumber;
      endAt: BigNumber;
      saleTokenAmount: BigNumber;
      marketValue: BigNumber;
      capMarketValue: BigNumber;
      saleVolume: BigNumber;
    }
  >;

  settleSaleToken(
    to: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  supportStableCoin(
    arg0: BigNumberish,
    overrides?: CallOverrides
  ): Promise<string>;

  supportStableCoinExist(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<boolean>;

  supportStableCoinSaleNumber(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  transferOwnership(
    newOwner: string,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  userPosition(
    arg0: string,
    overrides?: CallOverrides
  ): Promise<[BigNumber, boolean] & { value: BigNumber; isWithdraw: boolean }>;

  userPositonStable(
    arg0: string,
    arg1: string,
    overrides?: CallOverrides
  ): Promise<BigNumber>;

  withdraw(overrides?: CallOverrides): Promise<boolean>;

  withdrawERC20Token(
    _token: string,
    _account: string,
    _amount: BigNumberish,
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  withdrawToken(
    overrides?: Overrides & { from?: string | Promise<string> }
  ): Promise<ContractTransaction>;

  callStatic: {
    buyToken(
      _tokenAddress: string,
      _tokenAmount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    getAccountInfo(
      _account: string,
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        string[],
        BigNumber[],
        BigNumber[],
        number[]
      ] & {
        saleTokenAddress: string;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
        userBuyTokenAmount: BigNumber;
        tokens: string[];
        tokensUserAmount: BigNumber[];
        tokensGlobalAmount: BigNumber[];
        tokensDecimals: number[];
      }
    >;

    owner(overrides?: CallOverrides): Promise<string>;

    renounceOwnership(overrides?: CallOverrides): Promise<void>;

    saleInfo(
      overrides?: CallOverrides
    ): Promise<
      [
        string,
        string,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber,
        BigNumber
      ] & {
        saleToken: string;
        approver: string;
        startAt: BigNumber;
        endAt: BigNumber;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
      }
    >;

    settleSaleToken(to: string, overrides?: CallOverrides): Promise<void>;

    supportStableCoin(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<string>;

    supportStableCoinExist(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<boolean>;

    supportStableCoinSaleNumber(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    transferOwnership(
      newOwner: string,
      overrides?: CallOverrides
    ): Promise<void>;

    userPosition(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<
      [BigNumber, boolean] & { value: BigNumber; isWithdraw: boolean }
    >;

    userPositonStable(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    withdraw(overrides?: CallOverrides): Promise<boolean>;

    withdrawERC20Token(
      _token: string,
      _account: string,
      _amount: BigNumberish,
      overrides?: CallOverrides
    ): Promise<void>;

    withdrawToken(overrides?: CallOverrides): Promise<void>;
  };

  filters: {
    "BuyToken(address,address,uint256,uint256,uint256,uint256,uint256)"(
      account?: null,
      token?: null,
      tokenAmount?: null,
      saleTokenAmount?: null,
      marketValue?: null,
      capMarketValue?: null,
      saleVolume?: null
    ): TypedEventFilter<
      [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber],
      {
        account: string;
        token: string;
        tokenAmount: BigNumber;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
      }
    >;

    BuyToken(
      account?: null,
      token?: null,
      tokenAmount?: null,
      saleTokenAmount?: null,
      marketValue?: null,
      capMarketValue?: null,
      saleVolume?: null
    ): TypedEventFilter<
      [string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber],
      {
        account: string;
        token: string;
        tokenAmount: BigNumber;
        saleTokenAmount: BigNumber;
        marketValue: BigNumber;
        capMarketValue: BigNumber;
        saleVolume: BigNumber;
      }
    >;

    "OwnershipTransferred(address,address)"(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;

    OwnershipTransferred(
      previousOwner?: string | null,
      newOwner?: string | null
    ): TypedEventFilter<
      [string, string],
      { previousOwner: string; newOwner: string }
    >;
  };

  estimateGas: {
    buyToken(
      _tokenAddress: string,
      _tokenAmount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    getAccountInfo(
      _account: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    owner(overrides?: CallOverrides): Promise<BigNumber>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    saleInfo(overrides?: CallOverrides): Promise<BigNumber>;

    settleSaleToken(
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    supportStableCoin(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    supportStableCoinExist(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    supportStableCoinSaleNumber(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    userPosition(arg0: string, overrides?: CallOverrides): Promise<BigNumber>;

    userPositonStable(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<BigNumber>;

    withdraw(overrides?: CallOverrides): Promise<BigNumber>;

    withdrawERC20Token(
      _token: string,
      _account: string,
      _amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;

    withdrawToken(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    buyToken(
      _tokenAddress: string,
      _tokenAmount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    getAccountInfo(
      _account: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    renounceOwnership(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    saleInfo(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    settleSaleToken(
      to: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    supportStableCoin(
      arg0: BigNumberish,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    supportStableCoinExist(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    supportStableCoinSaleNumber(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    transferOwnership(
      newOwner: string,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    userPosition(
      arg0: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    userPositonStable(
      arg0: string,
      arg1: string,
      overrides?: CallOverrides
    ): Promise<PopulatedTransaction>;

    withdraw(overrides?: CallOverrides): Promise<PopulatedTransaction>;

    withdrawERC20Token(
      _token: string,
      _account: string,
      _amount: BigNumberish,
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;

    withdrawToken(
      overrides?: Overrides & { from?: string | Promise<string> }
    ): Promise<PopulatedTransaction>;
  };
}
