import { TransactionReceipt, TransactionResponse } from "@ethersproject/abstract-provider"; import { WithdrawCommitmentJson } from "./transferDefinitions/withdraw"; import { FullTransferState, FullChannelState } from "./channel"; import { Address } from "./basic"; import { ChannelDispute, TransferDispute } from "./dispute"; import { GetTransfersFilterOpts } from "./schemas/engine"; import { EngineEvent } from "."; export interface IVectorStore { connect(): Promise; disconnect(): Promise; getSchemaVersion(): Promise; updateSchemaVersion(version?: number): Promise; clear(): Promise; getChannelStates(): Promise; getChannelState(channelAddress: string): Promise; getChannelStateByParticipants(publicIdentifierA: string, publicIdentifierB: string, chainId: number): Promise; getActiveTransfers(channelAddress: string): Promise; getTransferState(transferId: string): Promise; getTransfers(filterOpts?: GetTransfersFilterOpts): Promise; saveChannelState(channelState: FullChannelState, transfer?: FullTransferState): Promise; saveChannelDispute(channelAddress: string, channelDispute: ChannelDispute): Promise; getChannelDispute(channelAddress: string): Promise; saveTransferDispute(channelAddress: string, transferDispute: TransferDispute): Promise; getTransferDispute(transferId: string): Promise; } export declare const StoredTransactionStatus: { readonly submitted: "submitted"; readonly mined: "mined"; readonly failed: "failed"; }; export declare type StoredTransactionStatus = keyof typeof StoredTransactionStatus; export declare const TransactionReason: { readonly allowance: "allowance"; readonly approveTokens: "approveTokens"; readonly disputeChannel: "disputeChannel"; readonly disputeTransfer: "disputeTransfer"; readonly defundChannel: "defundChannel"; readonly defundTransfer: "defundTransfer"; readonly depositA: "depositA"; readonly depositB: "depositB"; readonly deploy: "deploy"; readonly deployWithDepositAlice: "deployWithDepositAlice"; readonly exitChannel: "exitChannel"; readonly speedUpTransaction: "speedUpTransaction"; readonly transferTokens: "transferTokens"; readonly withdraw: "withdraw"; }; export declare type TransactionReason = keyof typeof TransactionReason; export declare type StoredTransactionAttempt = { transactionHash: string; gasLimit: string; gasPrice: string; createdAt: Date; }; export declare type StoredTransactionReceipt = { transactionHash: string; contractAddress: string; transactionIndex: number; root?: string; gasUsed: string; cumulativeGasUsed: string; logsBloom: string; blockHash: string; blockNumber: number; logs?: string; byzantium: boolean; status?: number; }; export declare type StoredTransaction = { id: string; channelAddress: string; status: StoredTransactionStatus; reason: TransactionReason; error?: string; to: Address; from: Address; data: string; value: string; chainId: number; nonce: number; attempts: StoredTransactionAttempt[]; receipt?: StoredTransactionReceipt; }; export interface IChainServiceStore { connect(): Promise; disconnect(): Promise; clear(): Promise; getTransactionById(onchainTransactionId: string): Promise; getActiveTransactions(): Promise; saveTransactionAttempt(onchainTransactionId: string, channelAddress: string, reason: TransactionReason, response: TransactionResponse): Promise; saveTransactionReceipt(onchainTransactionId: string, transaction: TransactionReceipt): Promise; saveTransactionFailure(onchainTransactionId: string, error: string, receipt?: TransactionReceipt): Promise; } export interface IEngineStore extends IVectorStore, IChainServiceStore { getWithdrawalCommitment(transferId: string): Promise; getWithdrawalCommitmentByTransactionHash(transactionHash: string): Promise; getUnsubmittedWithdrawals(channelAddress: string, withdrawalDefinition: string): Promise<{ commitment: WithdrawCommitmentJson; transfer: FullTransferState; }[]>; getTransferByRoutingId(channelAddress: string, routingId: string): Promise; getTransfersByRoutingId(routingId: string): Promise; saveWithdrawalCommitment(transferId: string, withdrawCommitment: WithdrawCommitmentJson): Promise; saveChannelStateAndTransfers(channelState: FullChannelState, activeTransfers: FullTransferState[]): Promise; } export interface IServerNodeStore extends IEngineStore { registerSubscription(publicIdentifier: string, event: T, url: string): Promise; getSubscription(publicIdentifier: string, event: T): Promise; getSubscriptions(publicIdentifier: string): Promise<{ [event: string]: string; }>; setNodeIndex(index: number, publicIdentifier: string): Promise; getNodeIndexes(): Promise<{ index: number; publicIdentifier: string; }[]>; removeNodeIndexes(): Promise; } //# sourceMappingURL=store.d.ts.map