Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 14e6140 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Size Change: +185 B (0%) Total Size: 316 kB
ℹ️ View Unchanged
|
Codecov Report
@@ Coverage Diff @@
## main #1006 +/- ##
==========================================
- Coverage 99.81% 97.43% -2.38%
==========================================
Files 264 260 -4
Lines 25802 25622 -180
Branches 2080 1830 -250
==========================================
- Hits 25754 24966 -788
- Misses 45 653 +608
Partials 3 3
|
src/utils/chain.ts
Outdated
| config?: ChainConfig<formatters>, | ||
| ): Assign<chain, ChainConfig<formatters>> { | ||
| const { | ||
| fees = chain.fees, | ||
| formatters = chain.formatters, | ||
| serializers = chain.serializers, | ||
| } = config || {} |
There was a problem hiding this comment.
nitpick
| config?: ChainConfig<formatters>, | |
| ): Assign<chain, ChainConfig<formatters>> { | |
| const { | |
| fees = chain.fees, | |
| formatters = chain.formatters, | |
| serializers = chain.serializers, | |
| } = config || {} | |
| config: ChainConfig<formatters> = {}, | |
| ): Assign<chain, ChainConfig<formatters>> { | |
| const { | |
| fees = chain.fees, | |
| formatters = chain.formatters, | |
| serializers = chain.serializers, | |
| } = config |
src/types/chain.ts
Outdated
| getDefaultPriorityFee(args: { | ||
| block: Prettify<FormattedBlock<{ formatters: formatters }>> | ||
| request: PrepareRequestParameters< | ||
| Omit<Chain, 'formatters'> & { formatters: formatters } | ||
| > | ||
| }): Promise<bigint> | bigint |
There was a problem hiding this comment.
Probably not worth adding another type here, but think it's worthwhile if this could also just be a bigint in addition to async/sync function that returns bigint? In that world, maybe it makes sense to rename the key from getDefaultPriorityFee to defaultPriorityFee.
import type { ChainFees } from '../../types/chain.js'
export const feesOptimism = {
defaultPriorityFee: 1_000_000n, // 0.001 gwei
} as const satisfies ChainFees| block, | ||
| request: request as PrepareRequestParameters, | ||
| }) | ||
| } |
* feat: optimism transaction receipt formatter * refactor: restructure * feat: chain fees config * chore: changeset * chore: update test * chore: impl * refactor: cleanup formatters & serializers types * chore: fix * refactor * chore: snapshots * Update sweet-lemons-explain.md * Update sweet-lemons-explain.md * refactor * refactor * refactor
Added
feestochainconfig that includes agetDefaultPriorityFeefor setting a default priority fee for a chain.Also cleaned up the chain serializers & formatters types. Probably makes more sense to have them in
types/chain.tsrather than separate files since they aren't related to anything else apart from the chain. Will also help if we scale to more than justfees,serializers&formatterson the chain config (and also when we chose to move the chains into a separate package).PR-Codex overview
Focus of this PR:
This PR focuses on adding a
feesfield to thechainconfiguration, which includes adefaultPriorityFeefor setting a default priority fee (maxFeePerGas) for a chain.Detailed summary:
feesfield tochainconfigfeesfield includes adefaultPriorityFeefor setting a default priority fee (maxFeePerGas) for a chainfeesfield in thechainconfiguration