-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: aa-core smart account provider fee options to handle more syste…
…matic fee options for userops (#276) * feat: aa-core smart account provider fee options to handle more systematic fee options for userops * feat: remove fee options middleware and expose fee options to middleware functions * feat: aa-alchemy ergonomic support for handling gas estimation (#243) * feat: support updated overrides for alchemy request gas and paymaster and data * feat: rebase parent where account middle func def is updated * Update site/packages/aa-alchemy/middleware/withAlchemyGasManager.md Co-authored-by: Ajay Vasisht <[email protected]> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <[email protected]> * Update packages/core/src/utils/index.ts Co-authored-by: Ajay Vasisht <[email protected]> * Update packages/core/src/provider/base.ts Co-authored-by: Michael Moldoveanu <[email protected]> * fix: alchemy gas manager 0x check for user op overrides --------- Co-authored-by: Ajay Vasisht <[email protected]> Co-authored-by: Michael Moldoveanu <[email protected]>
- Loading branch information
1 parent
c2c1637
commit 33b8312
Showing
23 changed files
with
775 additions
and
348 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,34 @@ | ||
import type { UserOperationFeeOptions } from "@alchemy/aa-core"; | ||
import type { Chain } from "viem"; | ||
import { | ||
arbitrum, | ||
arbitrumGoerli, | ||
arbitrumSepolia, | ||
optimism, | ||
optimismGoerli, | ||
optimismSepolia, | ||
} from "viem/chains"; | ||
|
||
export const getDefaultUserOperationFeeOptions = ( | ||
chain: Chain | ||
): UserOperationFeeOptions => { | ||
const feeOptions: UserOperationFeeOptions = { | ||
maxFeePerGas: { percentage: 50 }, | ||
maxPriorityFeePerGas: { percentage: 5 }, | ||
}; | ||
|
||
if ( | ||
new Set<number>([ | ||
arbitrum.id, | ||
arbitrumGoerli.id, | ||
arbitrumSepolia.id, | ||
optimism.id, | ||
optimismGoerli.id, | ||
optimismSepolia.id, | ||
]).has(chain.id) | ||
) { | ||
feeOptions.preVerificationGas = { percentage: 5 }; | ||
} | ||
|
||
return feeOptions; | ||
}; |
Oops, something went wrong.