Files
linea-monorepo/postman/src/core/persistence/IMessageDBService.ts
Victorien Gauch f58c12a455 Feat/272 split sdk and postman (#381)
* feat: split postman and sdk

* fix: update postman client and sendMessage script

* fix: clean the sdk

* fix: update sdk dependencies

* fix: remove .env.sample file

* fix: remove testing helpers from the build

* fix: update gas provider in linea sdk and update postman client

* fix: update postman dependencies

* fix: update postman dockerfile and fix tests imports and types

* fix: remove unused code in the sdk + move typechain folder

* fix: remove unused code + fix imports in postman

* fix: pnpm lock file issue

* fix: import issue

* fix: case sensitive file issue

* fix: update sdk fees options and update exports

* fix: remove postman unused code and adjust imports and tests

* fix: update contracts abis + clean error parsing

* fix: update postman based on new SDk changes

* add readme + remove unused interface in postman

* fix: rename Base.ts file to BaseError.ts

* fix: rename Base.ts file to BaseError.ts in postman

* chore: update readme for the postman

* fix: rename maxFeePerGas to maxFeePerGasCap

* fix: update DefaultGasProvider fees check

* fix: default gas provider test issue

* fix: update main ci filter

* fix: issue in default gas provider
2024-12-09 12:12:45 +01:00

32 lines
1.2 KiB
TypeScript

import { Direction } from "@consensys/linea-sdk";
import { Message } from "../entities/Message";
import { MessageStatus } from "../enums";
export interface IMessageDBService<TransactionResponse> {
insertMessage(message: Message): Promise<void>;
saveMessages(messages: Message[]): Promise<void>;
updateMessage(message: Message): Promise<void>;
deleteMessages(msBeforeNowToDelete: number): Promise<number>;
getFirstPendingMessage(direction: Direction): Promise<Message | null>;
getLatestMessageSent(direction: Direction, contractAddress: string): Promise<Message | null>;
getNFirstMessagesSent(limit: number, contractAddress: string): Promise<Message[]>;
getNFirstMessagesByStatus(
status: MessageStatus,
direction: Direction,
limit: number,
contractAddress: string,
): Promise<Message[]>;
getMessageToClaim(
contractAddress: string,
gasEstimationMargin: number,
maxRetry: number,
retryDelay: number,
): Promise<Message | null>;
getLastClaimTxNonce(direction: Direction): Promise<number | null>;
updateMessageWithClaimTxAtomic(
message: Message,
nonce: number,
claimTxResponsePromise: Promise<TransactionResponse>,
): Promise<void>;
}