Skip to content

FUZD / @fuzd/executor / ExecutorStorage

Interface: ExecutorStorage<TransactionDataType> ​

Type Parameters ​

• TransactionDataType

Methods ​

claimPendingExecutions() ​

claimPendingExecutions(params): Promise<PendingExecutionStored<TransactionDataType>[]>

Claim the unfinalized executions of a chain due for a check (nextCheckTime <= upToNextCheckTime, earliest first) that no other run holds, in one atomic step. They stay the claimant's until written (createOrUpdatePendingExecution, postponePendingExecution), released, or the claim expires. See docs/adr/0004-claim-due-items-with-a-lease.md.

Parameters ​

params ​
chainId ​

string

claim ​

{ by: string; expiresAt: number; now: number; }

claim.by ​

string

claim.expiresAt ​

number

claim.now ​

number

limit ​

number

upToNextCheckTime ​

number

Returns ​

Promise<PendingExecutionStored<TransactionDataType>[]>

Defined in ​

types/executor-storage.ts:93


clear() ​

clear(): Promise<void>

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:126


createBroadcaster() ​

createBroadcaster(broadcaster): Promise<void>

Parameters ​

broadcaster ​

BroadcasterData

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:125


createOrUpdatePendingExecution() ​

createOrUpdatePendingExecution(executionToStore, options, asPaymentFor?): Promise<PendingExecutionStored<TransactionDataType>>

Parameters ​

executionToStore ​

PendingExecutionStored<TransactionDataType>

options ​
debtOffset ​

bigint

updateNonceIfNeeded ​

{ broadcaster: `0x${string}`; lock: string; }

updateNonceIfNeeded.broadcaster ​

`0x${string}`

updateNonceIfNeeded.lock ​

string

asPaymentFor? ​
account ​

`0x${string}`

batchIndex ​

number

chainId ​

string

helpedForUpToGasPrice ​

{ upToGasPrice: bigint; valueSent: bigint; }

helpedForUpToGasPrice.upToGasPrice ​

bigint

helpedForUpToGasPrice.valueSent ​

bigint

slot ​

string

Returns ​

Promise<PendingExecutionStored<TransactionDataType>>

Defined in ​

types/executor-storage.ts:67


deleteFinalizedPendingExecutions() ​

deleteFinalizedPendingExecutions(params): Promise<void>

Parameters ​

params ​
chainId ​

string

upTo ​

number

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:57


deletePendingExecution() ​

deletePendingExecution(params): Promise<void>

Parameters ​

params ​
account ​

`0x${string}`

batchIndex ​

number

chainId ​

string

slot ​

string

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:50


getAllExecutions() ​

getAllExecutions(params): Promise<PendingExecutionStored<TransactionDataType>[]>

Parameters ​

params ​
limit ​

number

order ​

"ASC" | "DESC"

Returns ​

Promise<PendingExecutionStored<TransactionDataType>[]>

Defined in ​

types/executor-storage.ts:118


getBroadcaster() ​

getBroadcaster(params): Promise<undefined | BroadcasterData>

Parameters ​

params ​
address ​

string

chainId ​

string

Returns ​

Promise<undefined | BroadcasterData>

Defined in ​

types/executor-storage.ts:124


getChainConfiguration() ​

getChainConfiguration(chainId): Promise<ChainConfiguration>

Parameters ​

chainId ​

string

Returns ​

Promise<ChainConfiguration>

Defined in ​

types/executor-storage.ts:128


getPendingExecution() ​

getPendingExecution(params): Promise<undefined | PendingExecutionStored<TransactionDataType>>

Parameters ​

params ​
account ​

`0x${string}`

batchIndex ​

number

chainId ​

string

slot ​

string

Returns ​

Promise<undefined | PendingExecutionStored<TransactionDataType>>

Defined in ​

types/executor-storage.ts:37


getPendingExecutionBatch() ​

getPendingExecutionBatch(params): Promise<undefined | PendingExecutionStored<TransactionDataType>[]>

Parameters ​

params ​
account ​

`0x${string}`

chainId ​

string

slot ​

string

Returns ​

Promise<undefined | PendingExecutionStored<TransactionDataType>[]>

Defined in ​

types/executor-storage.ts:44


getPendingExecutions() ​

getPendingExecutions(params): Promise<PendingExecutionStored<TransactionDataType>[]>

The unfinalized executions with the earliest next check first. chainId restricts them to one chain, upToNextCheckTime to those due at that time.

Parameters ​

params ​
chainId ​

string

limit ​

number

upToNextCheckTime ​

number

Returns ​

Promise<PendingExecutionStored<TransactionDataType>[]>

Defined in ​

types/executor-storage.ts:82


getPendingExecutionsPerBroadcaster() ​

getPendingExecutionsPerBroadcaster(broadcasterData, params): Promise<PendingExecutionStored<TransactionDataType>[]>

Parameters ​

broadcasterData ​
broadcaster ​

`0x${string}`

chainId ​

string

params ​
limit ​

number

Returns ​

Promise<PendingExecutionStored<TransactionDataType>[]>

Defined in ​

types/executor-storage.ts:110


lockBroadcaster() ​

lockBroadcaster(params): Promise<undefined | BroadcasterDataWithLock>

Parameters ​

params ​
address ​

string

chainId ​

string

nonceFromNetwork ​

number

Returns ​

Promise<undefined | BroadcasterDataWithLock>

Defined in ​

types/executor-storage.ts:59


postponePendingExecution() ​

postponePendingExecution(execution, nextCheckTime, lastError?): Promise<void>

Move the next check of an unfinalized execution, unless it changed since it was read: only the row still carrying hash is updated, so a concurrent resubmission is never overwritten.

Parameters ​

execution ​
account ​

`0x${string}`

batchIndex ​

number

chainId ​

string

hash ​

`0x${string}`

slot ​

string

nextCheckTime ​

number

lastError? ​

string

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:105


releasePendingExecutionClaims() ​

releasePendingExecutionClaims(claimant): Promise<void>

Release whatever claimant still holds (its run is over).

Parameters ​

claimant ​

string

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:100


setup() ​

setup(): Promise<void>

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:127


unlockBroadcaster() ​

unlockBroadcaster(params): Promise<void>

Parameters ​

params ​
address ​

string

chainId ​

string

Returns ​

Promise<void>

Defined in ​

types/executor-storage.ts:65


updateExpectedWorstCaseGasPrice() ​

updateExpectedWorstCaseGasPrice(chainId, timestamp, newGasPrice): Promise<ChainConfiguration>

Parameters ​

chainId ​

string

timestamp ​

number

newGasPrice ​

bigint

Returns ​

Promise<ChainConfiguration>

Defined in ​

types/executor-storage.ts:129


updateFees() ​

updateFees(chainId, timestamp, newFees): Promise<ChainConfiguration>

Parameters ​

chainId ​

string

timestamp ​

number

newFees ​

Fees

Returns ​

Promise<ChainConfiguration>

Defined in ​

types/executor-storage.ts:134