-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mantle calculations * refactor * rename to TimedQueue * cleanup gasPriceManager * split into different files * cleanup --------- Co-authored-by: mouseless <[email protected]>
- Loading branch information
1 parent
1900e42
commit da149ac
Showing
11 changed files
with
613 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { maxUint128 } from "viem" | ||
import { TimedQueue } from "../utils/timedQueue" | ||
|
||
export class ArbitrumManager { | ||
private l1BaseFeeQueue: TimedQueue | ||
private l2BaseFeeQueue: TimedQueue | ||
|
||
constructor(maxQueueSize: number) { | ||
const queueValidity = 15_000 | ||
this.l1BaseFeeQueue = new TimedQueue(maxQueueSize, queueValidity) | ||
this.l2BaseFeeQueue = new TimedQueue(maxQueueSize, queueValidity) | ||
} | ||
|
||
public saveL1BaseFee(baseFee: bigint) { | ||
this.l1BaseFeeQueue.saveValue(baseFee) | ||
} | ||
|
||
public saveL2BaseFee(baseFee: bigint) { | ||
this.l2BaseFeeQueue.saveValue(baseFee) | ||
} | ||
|
||
public getMinL1BaseFee() { | ||
let minL1BaseFee = this.l1BaseFeeQueue.getMinValue() || 1n | ||
return minL1BaseFee | ||
} | ||
|
||
public getMaxL1BaseFee() { | ||
let maxL1BaseFee = this.l1BaseFeeQueue.getMaxValue() || maxUint128 | ||
return maxL1BaseFee | ||
} | ||
|
||
public getMaxL2BaseFee() { | ||
let maxL2BaseFee = this.l2BaseFeeQueue.getMaxValue() || maxUint128 | ||
return maxL2BaseFee | ||
} | ||
} |
Oops, something went wrong.