import { Interface } from '@ethersproject/abi'; import { Provider } from '@ethersproject/abstract-provider'; import { BigNumber } from '@ethersproject/bignumber'; import { PopulatedTransaction } from '@ethersproject/contracts'; import { BigNumberish } from 'ethers'; import { Router } from './router'; import { DestRequest, Pool, PoolInfo, PoolToken } from './types'; import { BridgeToken, FeeConfig, Query } from '../module'; /** * Enum representing the type of a SynapseBridge token. * NotSupported: the token is not supported by the SynapseBridge contract. * Redeem: the token is supported by the SynapseBridge contract by burning or minting on this chain. * Deposit: the token is supported by the SynapseBridge contract by depositing or withdrawing on this chain. */ export declare enum BridgeTokenType { NotSupported = -1, Redeem = 0, Deposit = 1 } /** * Wrapper class for interacting with a SynapseRouter contract. * Abstracts away the contract interaction: the Router users don't need to know about the contract, * or the data structures used to interact with it. */ export declare class SynapseRouter extends Router { static routerInterface: Interface; readonly address: string; private readonly routerContract; private bridgeContractCache?; private readonly originEvents; constructor(chainId: number, provider: Provider, address: string); getOriginAmountOut(tokenIn: string, bridgeTokens: string[], amountIn: BigNumberish): Promise; getDestinationAmountOut(requests: DestRequest[], tokenOut: string): Promise; getConnectedBridgeTokens(tokenOut: string): Promise; getBridgeFees(token: string, amount: BigNumber): Promise<{ feeAmount: BigNumber; feeConfig: FeeConfig; }>; bridge(to: string, chainId: number, token: string, amount: BigNumberish, originQuery: Query, destQuery: Query): Promise; /** * @inheritdoc Router.getSynapseTxId */ getSynapseTxId(txHash: string): Promise; /** * @inheritdoc Router.getBridgeTxStatus */ getBridgeTxStatus(synapseTxId: string): Promise; private getBridgeContract; chainGasAmount(): Promise; getBridgeTokenType(token: string): Promise; getPoolTokens(poolAddress: string): Promise; getPoolInfo(poolAddress: string): Promise; getAllPools(): Promise; calculateAddLiquidity(poolAddress: string, amounts: BigNumberish[]): Promise; calculateRemoveLiquidity(poolAddress: string, amount: BigNumberish): Promise; calculateWithdrawOneToken(poolAddress: string, amount: BigNumberish, tokenIndex: number): Promise; getAmountOut(tokenIn: string, tokenOut: string, amountIn: BigNumberish): Promise; swap(to: string, token: string, amount: BigNumberish, query: Query): Promise; }