Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents the Integral TwapDelay contract with a method for helping execute trades.

Hierarchy

  • TwapDelay

Index

Constructors

Properties

DELAY_CODER: Interface = ...

Methods

  • getBuyCallParameters(provider: BaseProvider, chainId: ChainId, to: string, input: CurrencyValue, output: CurrencyValue, slippageTolerance: number, options?: CallOptions): Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>
  • Produces the contract address and on-chain method name to call and the hex encoded parameters to pass as arguments for a given buy call.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • to: string

      The account that should receive the output.

    • input: CurrencyValue

      The input token, either Ether or an ERC-20

    • output: CurrencyValue

      The exact output token, either Ether or an ERC-20

    • slippageTolerance: number

      How much the execution price is allowed to move unfavorably from the trade execution price.

    • Optional options: CallOptions

      Options for the call parameters

    Returns Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>

    Contract address, method name, calldata and value.

  • getDepositCallParameters(provider: BaseProvider, chainId: ChainId, to: string, firstValue: CurrencyValue, secondValue: CurrencyValue, slippageTolerance: number, pair: Pair, swapOnDeposit: boolean, options?: CallOptions): Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>
  • Produces the contract address and on-chain method name to call and the hex encoded parameters to pass as arguments for a given deposit call.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • to: string

      The account that should receive the output

    • firstValue: CurrencyValue

      The first token to deposit

    • secondValue: CurrencyValue

      The second token to deposit

    • slippageTolerance: number

      How much the execution price is allowed to move unfavorably from the trade execution price.

    • pair: Pair
    • swapOnDeposit: boolean

      Whether to perform a swap on non-proportional deposits

    • Optional options: CallOptions

      Options for the call parameters

    Returns Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>

    Contract address, method name, calldata and value

  • getGasPrice(provider: BaseProvider, chainId: ChainId): Promise<BigNumber>
  • Returns the gas price

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    Returns Promise<BigNumber>

    Gas price

  • getOrderStatus(provider: BaseProvider, chainId: ChainId, orderId: number): Promise<number>
  • Returns the order status for given order id.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • orderId: number

      Id of the order

    Returns Promise<number>

    Order status

  • getOrderStatuses(provider: BaseProvider, chainId: ChainId, orderIds: number[]): Promise<{ orderId: number; status: number }[]>
  • Returns the order statuses for given order ids.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • orderIds: number[]

      Order ids array

    Returns Promise<{ orderId: number; status: number }[]>

    Order statuses

  • getSellCallParameters(provider: BaseProvider, chainId: ChainId, to: string, input: CurrencyValue, output: CurrencyValue, slippageTolerance: number, options?: CallOptions): Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>
  • Produces the contract address and on-chain method name to call and the hex encoded parameters to pass as arguments for a given sell call.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • to: string

      The account that should receive the output.

    • input: CurrencyValue

      The exact input token, either Ether or an ERC-20

    • output: CurrencyValue

      The output token, either Ether or an ERC-20

    • slippageTolerance: number

      How much the execution price is allowed to move unfavorably from the trade execution price.

    • Optional options: CallOptions

      Options for the call parameters

    Returns Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>

    Contract address, method name, calldata and value

  • getWithdrawCallParameters(provider: BaseProvider, chainId: ChainId, to: string, firstValue: CurrencyValue, secondValue: CurrencyValue, liquidity: BigNumber, options?: CallOptions): Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>
  • Produces the contract address and on-chain method name to call and the hex encoded parameters to pass as arguments for a given withdraw call.

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • to: string

      The account that should receive the output.

    • firstValue: CurrencyValue

      The first token to withdraw

    • secondValue: CurrencyValue

      The second token to withdraw

    • liquidity: BigNumber
    • Optional options: CallOptions

      Options for the call parameters

    Returns Promise<{ calldata: string; contractAddress: string; methodName: string; value: BigNumber }>

    Contract address, method name, calldata and value