import { TransactionReceipt, TransactionRequest, TransactionResponse } from "@ethersproject/abstract-provider"; import { BigNumber, BigNumberish } from "@ethersproject/bignumber"; import { ChainReaderEvent, ChainReaderEventMap } from "."; import { Address, HexString } from "./basic"; import { Balance, FullChannelState, FullTransferState } from "./channel"; import { ChannelDispute } from "./dispute"; import { Result, Values, VectorError } from "./error"; import { ChainServiceEvent, ChainServiceEventMap } from "./event"; import { ChainProviders, HydratedProviders } from "./network"; import { RegisteredTransfer, TransferName, TransferState, WithdrawCommitmentJson } from "./transferDefinitions"; export declare const GAS_ESTIMATES: { createChannelAndDepositAlice: BigNumber; createChannel: BigNumber; depositAlice: BigNumber; depositBob: BigNumber; withdraw: BigNumber; }; export declare const SIMPLE_WITHDRAWAL_GAS_ESTIMATE: BigNumber; export declare const ERC20Abi: string[]; export declare class ChainError extends VectorError { readonly message: Values | string; readonly context: any; static readonly type = "ChainError"; static readonly reasons: { ProviderNotFound: string; SignerNotFound: string; SenderNotInChannel: string; NegativeDepositAmount: string; NotEnoughFunds: string; FailedToDeploy: string; FailedToSendTx: string; TransferNotRegistered: string; MissingSigs: string; ResolverNeeded: string; NotInitialState: string; MultisigDeployed: string; TransferNotFound: string; TxAlreadyMined: string; TxNotFound: string; TxReverted: string; MaxGasPriceReached: string; ConfirmationTimeout: string; NonceExpired: string; }; static readonly retryableTxErrors: { BadNonce: string; InvalidNonce: string; MissingHash: string; UnderpricedReplacement: string; AncientBlockSync: string; UnableToRent: string; }; readonly canRetry: boolean; constructor(message: Values | string, context?: any); } export declare type ChainInfo = { name: string; chainId: number; shortName: string; chain: string; network: string; networkId: number; nativeCurrency: { name: string; symbol: string; decimals: number; }; assetId: { [assetId: string]: { symbol: string; mainnetEquivalent: string; }; }; rpc: string[]; faucets: string[]; infoURL: string; }; export declare type MinimalTransaction = { to: Address; value: BigNumberish; data: HexString; }; export declare type MultisigTransaction = MinimalTransaction & { nonce: BigNumberish; }; export interface IVectorChainReader { getTotalDepositedA(channelAddress: string, chainId: number, assetId: string): Promise>; getTotalDepositedB(channelAddress: string, chainId: number, assetId: string): Promise>; getChannelFactoryBytecode(channelFactoryAddress: string, chainId: number): Promise>; getChannelMastercopyAddress(channelFactoryAddress: string, chainId: number): Promise>; getChannelAddress(initiator: string, responder: string, channelFactoryAddress: string, chainId: number): Promise>; getRegisteredTransferByName(name: TransferName, transferRegistry: string, chainId: number, bytecode?: string): Promise>; getRegisteredTransferByDefinition(definition: Address, transferRegistry: string, chainId: number, bytecode?: string): Promise>; getRegisteredTransfers(transferRegistry: string, chainId: number, bytecode?: string): Promise>; create(initialState: TransferState, balance: Balance, transferDefinition: string, transferRegistryAddress: string, chainId: number, bytecode?: string): Promise>; resolve(transfer: FullTransferState, chainId: number, bytecode?: string): Promise>; getCode(address: Address, chainId: number): Promise>; getBlockNumber(chainId: number): Promise>; getGasPrice(chainId: number): Promise>; getOnchainBalance(assetId: string, balanceOf: string, chainId: number): Promise>; getDecimals(assetId: string, chainId: number): Promise>; getChainProviders(): Result; getHydratedProviders(): Result; estimateGas(chainId: number, transaction: TransactionRequest): Promise>; getTokenAllowance(tokenAddress: string, owner: string, spender: string, chainId: number): Promise>; getChannelDispute(channelAddress: string, chainId: number): Promise>; getSyncing(chainId: number): Promise>; getWithdrawalTransactionRecord(withdrawData: WithdrawCommitmentJson, channelAddress: string, chainId: number): Promise>; registerChannel(channelAddress: string, chainId: number): Promise>; on(event: T, callback: (payload: ChainReaderEventMap[T]) => void | Promise, filter?: (payload: ChainReaderEventMap[T]) => boolean): void; once(event: T, callback: (payload: ChainReaderEventMap[T]) => void | Promise, filter?: (payload: ChainReaderEventMap[T]) => boolean): void; off(event?: T): void; waitFor(event: T, timeout: number, filter?: (payload: ChainReaderEventMap[T]) => boolean): Promise; } export declare type TransactionResponseWithResult = TransactionResponse & { completed: (confirmations?: number) => Promise>; }; export interface IVectorChainService extends IVectorChainReader { sendDepositTx(channelState: FullChannelState, sender: string, amount: string, assetId: string): Promise>; sendWithdrawTx(channelState: FullChannelState, minTx: MinimalTransaction): Promise>; sendDeployChannelTx(channelState: FullChannelState, deposit?: { amount: string; assetId: string; }): Promise>; sendDisputeChannelTx(channelState: FullChannelState): Promise>; sendDefundChannelTx(channelState: FullChannelState): Promise>; sendDisputeTransferTx(transferIdToDispute: string, activeTransfers: FullTransferState[]): Promise>; sendDefundTransferTx(transferState: FullTransferState): Promise>; sendExitChannelTx(channelAddress: string, chainId: number, assetId: string, owner: string, recipient: string): Promise>; on(event: T, callback: (payload: ChainServiceEventMap[T]) => void | Promise, filter?: (payload: ChainServiceEventMap[T]) => boolean): void; once(event: T, callback: (payload: ChainServiceEventMap[T]) => void | Promise, filter?: (payload: ChainServiceEventMap[T]) => boolean): void; off(event?: T): void; waitFor(event: T, timeout: number, filter?: (payload: ChainServiceEventMap[T]) => boolean): Promise; } //# sourceMappingURL=chain.d.ts.map