fix: starknet deploy account fee estimation#11592
Conversation
📝 WalkthroughWalkthroughAdded StarknetChainAdapter.getDeployAccountFeeData to compute Starknet account deployment fees (RPC estimate + static fallbacks) using wallet-derived public keys; updated Send and Trade UI flows to call this deployment-specific method via accountNumber from account metadata. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI (Send/Trade)
participant Adapter as StarknetChainAdapter
participant Wallet as HDWallet
participant RPC as Starknet Node RPC
participant Chain as ChainState (Balance)
UI->>Adapter: getDeployAccountFeeData({ accountNumber, wallet })
Adapter->>Wallet: getPublicKey(accountNumber)
Wallet-->>Adapter: publicKey
Adapter->>Adapter: build DEPLOY_ACCOUNT tx (calldata, salt using publicKey)
Adapter->>RPC: starknet_estimateFee(DEPLOY_ACCOUNT tx)
alt RPC returns estimate
RPC-->>Adapter: estimate (l1_gas, l2_gas, l1_data_gas, gas_price)
Adapter->>Adapter: calculateFeeTiers(estimate) -> slow/avg/fast
else RPC fails / no estimate
Adapter-->>Adapter: use STATIC_FEE_ESTIMATES -> calculateFeeTiers
end
Adapter->>Chain: query balance(for target address)
Chain-->>Adapter: balance
Adapter-->>UI: FeeDataEstimate { slow/avg/fast tiers, chainSpecific.maxFee, txFee }
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
Files:
🧠 Learnings (24)📓 Common learnings📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:04.979ZApplied to files:
📚 Learning: 2025-12-09T21:07:22.474ZApplied to files:
📚 Learning: 2025-11-24T21:20:30.085ZApplied to files:
📚 Learning: 2025-11-12T12:49:17.895ZApplied to files:
📚 Learning: 2025-12-04T22:57:50.850ZApplied to files:
📚 Learning: 2026-01-05T23:24:54.841ZApplied to files:
📚 Learning: 2025-08-07T11:20:44.614ZApplied to files:
📚 Learning: 2025-09-12T10:35:51.632ZApplied to files:
📚 Learning: 2025-09-10T15:35:46.223ZApplied to files:
📚 Learning: 2025-09-13T16:45:17.166ZApplied to files:
📚 Learning: 2025-09-17T22:40:30.149ZApplied to files:
📚 Learning: 2025-09-11T22:53:19.837ZApplied to files:
📚 Learning: 2025-09-12T13:43:50.695ZApplied to files:
📚 Learning: 2025-09-12T11:56:19.437ZApplied to files:
📚 Learning: 2025-09-12T10:44:46.723ZApplied to files:
📚 Learning: 2025-08-14T12:42:48.263ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-09-12T12:04:59.556ZApplied to files:
📚 Learning: 2025-08-05T16:39:58.598ZApplied to files:
📚 Learning: 2025-12-17T14:50:01.629ZApplied to files:
📚 Learning: 2025-09-12T12:04:59.556ZApplied to files:
🧬 Code graph analysis (2)packages/chain-adapters/src/starknet/StarknetChainAdapter.ts (3)
packages/chain-adapters/src/starknet/utils.ts (1)
🪛 Gitleaks (8.30.0)packages/chain-adapters/src/starknet/utils.ts[high] 7-8: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts (1)
604-693: Critical:resourceBoundsmay be undefined.The
resourceBoundsvariable is declared at line 604 but not initialized. If the try-catch block at lines 629-693 completes without settingresourceBounds(e.g., all paths fail), the variable will be undefined when accessed at line 695+, causing a runtime error.🐛 Proposed fix
Initialize
resourceBoundswith default values or ensure it's always set:- let resourceBounds: { - l1_gas: { max_amount: bigint; max_price_per_unit: bigint } - l2_gas: { max_amount: bigint; max_price_per_unit: bigint } - l1_data_gas: { max_amount: bigint; max_price_per_unit: bigint } - } + let resourceBounds: { + l1_gas: { max_amount: bigint; max_price_per_unit: bigint } + l2_gas: { max_amount: bigint; max_price_per_unit: bigint } + l1_data_gas: { max_amount: bigint; max_price_per_unit: bigint } + } | undefined // ... estimation code ... + if (!resourceBounds) { + throw new Error('Failed to estimate resource bounds for account deployment') + } + const totalMaxFee =Or ensure resourceBounds is always assigned in the catch block by moving the static fallback inside:
} catch (error) { console.log( '[StarknetChainAdapter.deployAccount] RPC estimation failed, using static estimates:', error, ) - } - const { - l1GasConsumed, - l1GasPrice, - l2GasConsumed, - l2GasPrice, - l1DataGasConsumed, - l1DataGasPrice, - } = STATIC_FEE_ESTIMATES - resourceBounds = { - l1_gas: { - max_amount: BigInt(bnOrZero(l1GasConsumed).times(1.5).toFixed(0)), - max_price_per_unit: BigInt(bnOrZero(l1GasPrice).times(1.5).toFixed(0)), - }, - l2_gas: { - max_amount: BigInt(bnOrZero(l2GasConsumed).times(1.5).toFixed(0)), - max_price_per_unit: BigInt(bnOrZero(l2GasPrice).times(1.5).toFixed(0)), - }, - l1_data_gas: { - max_amount: BigInt(bnOrZero(l1DataGasConsumed).times(1.5).toFixed(0)), - max_price_per_unit: BigInt(bnOrZero(l1DataGasPrice).times(1.5).toFixed(0)), - }, - } + + const { + l1GasConsumed, + l1GasPrice, + l2GasConsumed, + l2GasPrice, + l1DataGasConsumed, + l1DataGasPrice, + } = STATIC_FEE_ESTIMATES + + resourceBounds = { + l1_gas: { + max_amount: BigInt(bnOrZero(l1GasConsumed).times(1.5).toFixed(0)), + max_price_per_unit: BigInt(bnOrZero(l1GasPrice).times(1.5).toFixed(0)), + }, + l2_gas: { + max_amount: BigInt(bnOrZero(l2GasConsumed).times(1.5).toFixed(0)), + max_price_per_unit: BigInt(bnOrZero(l2GasPrice).times(1.5).toFixed(0)), + }, + l1_data_gas: { + max_amount: BigInt(bnOrZero(l1DataGasConsumed).times(1.5).toFixed(0)), + max_price_per_unit: BigInt(bnOrZero(l1DataGasPrice).times(1.5).toFixed(0)), + }, + } + }
🤖 Fix all issues with AI agents
In @packages/chain-adapters/src/starknet/StarknetChainAdapter.ts:
- Around line 441-458: The estimateTx object is duplicated in both the
undeployed and deployed code paths; extract its construction into a single
helper (e.g., createEstimateTx or buildEstimateTx) that accepts the varying
inputs (formattedSalt, formattedCalldata, nonce, version, and any constants like
OPENZEPPELIN_ACCOUNT_CLASS_HASH) and returns the common object (including
resource_bounds, tip, paymaster_data, nonce_data_availability_mode,
fee_data_availability_mode). Replace the two inline estimateTx definitions with
calls to that helper to eliminate duplication and keep the identical fields
centralized for easier maintenance.
🧹 Nitpick comments (1)
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts (1)
440-495: Consider consistent error handling for deployed and undeployed accounts.The undeployed account path (lines 440-495) gracefully falls back to static estimates when RPC estimation fails, but the deployed account path (lines 497-540) throws an error. This inconsistency could lead to unexpected failures for users with deployed accounts when the RPC is temporarily unavailable.
Consider applying the same fallback strategy to both paths for consistent user experience.
♻️ Suggested approach for consistency
Wrap the deployed account RPC estimation (lines 516-540) in a try-catch block similar to the undeployed path:
- const estimateResponse = await this.provider.fetch('starknet_estimateFee', [ - [estimateTx], - ['SKIP_VALIDATE'], - 'latest', - ]) - const estimateResult: RpcJsonResponse<StarknetFeeEstimate[]> = await estimateResponse.json() - - if (estimateResult.error) { - const errorMessage = estimateResult.error.message || JSON.stringify(estimateResult.error) - throw new Error(`Fee estimation failed: ${errorMessage}`) - } - - const feeEstimate = estimateResult.result?.[0] - if (!feeEstimate) { - throw new Error('Fee estimation failed: no estimate returned') - } - - return calculateFeeTiers({ - l1GasConsumed: feeEstimate.l1_gas_consumed ?? '0x186a0', - l1GasPrice: feeEstimate.l1_gas_price ?? '0x5f5e100', - l2GasConsumed: feeEstimate.l2_gas_consumed ?? '0x0', - l2GasPrice: feeEstimate.l2_gas_price ?? '0x0', - l1DataGasConsumed: feeEstimate.l1_data_gas_consumed ?? '0x186a0', - l1DataGasPrice: feeEstimate.l1_data_gas_price ?? '0x1', - }) + try { + const estimateResponse = await this.provider.fetch('starknet_estimateFee', [ + [estimateTx], + ['SKIP_VALIDATE'], + 'latest', + ]) + const estimateResult: RpcJsonResponse<StarknetFeeEstimate[]> = await estimateResponse.json() + + if (!estimateResult.error && estimateResult.result?.[0]) { + const feeEstimate = estimateResult.result[0] + return calculateFeeTiers({ + l1GasConsumed: feeEstimate.l1_gas_consumed ?? '0x186a0', + l1GasPrice: feeEstimate.l1_gas_price ?? '0x5f5e100', + l2GasConsumed: feeEstimate.l2_gas_consumed ?? '0x0', + l2GasPrice: feeEstimate.l2_gas_price ?? '0x0', + l1DataGasConsumed: feeEstimate.l1_data_gas_consumed ?? '0x186a0', + l1DataGasPrice: feeEstimate.l1_data_gas_price ?? '0x1', + }) + } + } catch (error) { + console.log( + '[StarknetChainAdapter.getDeployAccountFeeData] RPC estimation failed for deployed account, using static estimates:', + error, + ) + } + + console.log( + '[StarknetChainAdapter.getDeployAccountFeeData] Using static estimates for deployed account', + ) + return calculateFeeTiers(STATIC_FEE_ESTIMATES)
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Never assume a library is available - always check imports/package.json first
Prefer composition over inheritance
Write self-documenting code with clear variable and function names
Keep functions small and focused on a single responsibility
Avoid deep nesting - use early returns instead
Prefer procedural and easy to understand code
Never expose, log, or commit secrets, API keys, or credentials
Validate all inputs, especially user inputs
Handle errors gracefully with meaningful messages
Don't silently catch and ignore exceptions
Log errors appropriately for debugging
Provide fallback behavior when possible
Use appropriate data structures for the task
Never add code comments unless explicitly requested
When modifying code, do not add comments that reference previous implementations or explain what changed. Comments should only describe the current logic and functionality.
Use meaningful names for branches, variables, and functions
Always runyarn lint --fixandyarn type-checkafter making changes
Avoidletvariable assignments - preferconstwith inline IIFE switch statements or extract to functions for conditional logic
Files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Avoid useEffect where practical - use it only when necessary and following best practices
Avoid 'any' types - use specific type annotations instead
For default values with user overrides, use computed values (useMemo) instead of useEffect - pattern:userSelected ?? smartDefault ?? fallback
When function parameters are unused due to interface requirements, refactor the interface or implementation to remove them rather than prefixing with underscore
Sanitize data before displaying to prevent XSS
Memoize aggressively - wrap component variables inuseMemoand callbacks inuseCallbackwhere possible
For static JSX icon elements (e.g.,<TbCopy />) that don't depend on state/props, define them as constants outside the component to avoid re-renders instead of using useMemo
Account for light/dark mode usinguseColorModeValuehook
Account for responsive mobile designs in all UI components
When applying styles, use the existing standards and conventions of the codebase
Use Chakra UI components and conventions
All copy/text must use translation keys - never hardcode strings
Use the translation hook:useTranslate()fromreact-polyglot
UseuseFeatureFlag('FlagName')hook to access feature flag values in components
Prefertypeoverinterfacefor type definitions
Use strict typing - avoidany
UseNominaltypes for domain identifiers (e.g.,WalletId,AccountId)
Import types from@shapeshiftoss/caipfor chain/account/asset IDs
UseuseAppSelectorfor Redux state
UseuseAppDispatchfor Redux actions
Memoize expensive computations withuseMemo
Memoize callbacks withuseCallback
**/*.{ts,tsx}: UseResult<T, E>pattern for error handling in swappers and APIs; ALWAYS useOk()andErr()from@sniptt/monads; AVOID throwing within swapper API implementations
ALWAYS use custom error classes from@shapeshiftoss/errorswith meaningful error codes for internationalization and relevant details in error objects
ALWAYS wrap async op...
Files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
**/*.{js,jsx,ts,tsx}: Use camelCase for variables, functions, and methods with descriptive names that explain the purpose
Use verb prefixes for functions that perform actions (e.g., fetch, validate, execute, update, calculate)
Use UPPER_SNAKE_CASE for constants and configuration values with descriptive names
Usehandleprefix for event handlers with descriptive names in camelCase
Use descriptive boolean variable names withis,has,can,shouldprefixes
Use named exports for components, functions, and utilities instead of default exports
Use descriptive import names and avoid renaming imports unless necessary
Avoid non-descriptive variable names likedata,item,obj, and single-letter variable names except in loops
Avoid abbreviations in names unless they are widely understood
Avoid generic function names likefn,func, orcallback
Files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10323
File: src/pages/RFOX/components/Stake/components/StakeSummary.tsx:112-114
Timestamp: 2025-08-22T13:00:44.879Z
Learning: NeOMakinG prefers to keep PR changes minimal and focused on the core objectives, avoiding cosmetic or defensive code improvements that aren't directly related to the PR scope, even when they would improve robustness.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10128
File: .cursor/rules/error-handling.mdc:266-274
Timestamp: 2025-07-29T10:35:22.059Z
Learning: NeOMakinG prefers less nitpicky suggestions on documentation and best practices files, finding overly detailed suggestions on minor implementation details (like console.error vs logger.error) too granular for cursor rules documentation.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/pages/Dashboard/components/AccountList/AccountTable.tsx:60-0
Timestamp: 2025-09-02T08:34:08.157Z
Learning: NeOMakinG prefers code review comments to focus only on actual PR changes, not pre-existing code issues, unless there are critical security or correctness concerns directly related to the new functionality.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10234
File: src/components/MultiHopTrade/hooks/useGetTradeQuotes/hooks/useTrackTradeQuotes.ts:42-86
Timestamp: 2025-08-08T11:41:22.794Z
Learning: NeOMakinG prefers not to include refactors in move-only PRs; such suggestions should be deferred to follow-up issues instead of being applied within the same PR.
Learnt from: NeOMakinG
Repo: shapeshift/web PR: 10380
File: src/components/Table/Table.theme.ts:177-180
Timestamp: 2025-09-02T12:38:46.940Z
Learning: NeOMakinG prefers to defer technical debt and CSS correctness issues (like improper hover selectors) to follow-up PRs when the current PR is already large and focused on major feature implementation, even when the issues are valid from a usability/technical perspective.
📚 Learning: 2025-11-24T21:20:04.979Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T21:20:04.979Z
Learning: Applies to **/*.{ts,tsx} : Import types from `shapeshiftoss/caip` for chain/account/asset IDs
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/src/swappers/*/utils/constants.ts : Define supported chain IDs for each swapper in utils/constants.ts with both 'sell' and 'buy' properties following the pattern: SupportedChainIds type
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-09-12T12:04:59.556Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/WalletConnectSigningModal/content/SendTransactionContent.tsx:0-0
Timestamp: 2025-09-12T12:04:59.556Z
Learning: The ShapeShift codebase's fromBaseUnit function correctly handles hex strings (like WalletConnect transaction.value) without manual conversion because bnOrZero -> bn -> new BigNumber() automatically detects and parses hex strings starting with "0x". gomesalexandre confirmed this with concrete evidence showing hex value 0x176d1c49189db correctly converts to 0.000412118294825435 ETH.
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-08-05T16:39:58.598Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10191
File: src/pages/Explore/Explore.tsx:56-56
Timestamp: 2025-08-05T16:39:58.598Z
Learning: In the ShapeShift web codebase, the established pattern for handling floating point numbers is to use BigNumber operations (bnOrZero, bn) for calculations and convert to strings using .toString() before passing to UI components like Amount.Fiat, Amount.Crypto, and Amount.Percent. This prevents JavaScript floating point precision issues and maintains consistency across the application.
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-11-24T21:20:57.909Z
Learnt from: CR
Repo: shapeshift/web PR: 0
File: .cursor/rules/swapper.mdc:0-0
Timestamp: 2025-11-24T21:20:57.909Z
Learning: Applies to packages/swapper/**/*.ts : Use TypeScript with explicit types (e.g., SupportedChainIds) for all code in the Swapper system
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-09-12T12:04:59.556Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 10461
File: src/plugins/walletConnectToDapps/components/WalletConnectSigningModal/content/SendTransactionContent.tsx:0-0
Timestamp: 2025-09-12T12:04:59.556Z
Learning: gomesalexandre confirmed that fromBaseUnit in the ShapeShift codebase correctly handles hex strings (like transaction.value from WalletConnect) without requiring manual hex-to-decimal conversion, as bnOrZero handles this automatically via BigNumber.js.
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
📚 Learning: 2025-12-17T14:50:01.629Z
Learnt from: gomesalexandre
Repo: shapeshift/web PR: 11449
File: packages/chain-adapters/src/tron/TronChainAdapter.ts:570-596
Timestamp: 2025-12-17T14:50:01.629Z
Learning: In packages/chain-adapters/src/tron/TronChainAdapter.ts, the parseTx method uses `unknown` type for the txHashOrTx parameter intentionally. TRON is a "second-class chain" that works differently from other chains - it accepts either a string hash (to fetch TronTx via unchained client) or a TronTx object directly. The base chain-adapter interface is strongly typed and doesn't accommodate this flexible signature, so `unknown` is used as an appropriate escape hatch rather than a type safety issue.
Applied to files:
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts
🔇 Additional comments (7)
packages/chain-adapters/src/starknet/StarknetChainAdapter.ts (7)
8-8: LGTM! Well-chosen fallback values for deployment estimation.The static fee estimates provide reasonable defaults when RPC estimation fails, and the
bnOrZeroimport enables safe BigNumber operations throughout the fee calculation logic.Also applies to: 57-67
695-721: LGTM! Proper balance validation before deployment.The balance check correctly calculates the total max fee across all resource types and provides clear error messaging when insufficient funds are detected. The detailed logging will help with debugging deployment issues.
343-356: LGTM! CorrectValidAddressResultformat.The method now properly returns the expected
ValidAddressResulttype with bothvalidboolean andresultenum value in all cases.
1345-1349: Verify the early return behavior for undeployed accounts ingetFeeData.The
getFeeDatamethod now returns static deployment estimates for undeployed accounts (lines 1345-1349). However,getFeeDatais typically called for regular INVOKE transactions (transfers), not DEPLOY_ACCOUNT transactions.This could lead to:
- Displaying deployment-level fees to users attempting a transfer on an undeployed account
- Confusion when the actual transfer operation requires deployment first
Consider whether:
- This early return should throw an error indicating the account must be deployed first
- Or if there should be a separate parameter indicating whether deployment fees are needed
- Or if this is intentional because the UI should trigger deployment before allowing transfers
Please verify this matches the intended user flow for undeployed accounts attempting transfers.
1122-1140: LGTM! Correct optionalpubKeymerging.The conditional spread operator correctly preserves the
pubKeywhen provided in the input without affecting the default behavior when it's absent.
963-974: LGTM! Defensive nonce fetching with appropriate fallback.The try-catch wrapper correctly handles cases where nonce fetching fails (e.g., account not deployed) by falling back to '0x0', which is the expected nonce for new accounts.
69-126: Use dynamic, configurable fee multipliers aligned with Starknet best practices.The fee multiplier strategy uses aggressive fixed values (3x for average, 5x for fast) that exceed Starknet's recommended defaults (1.5x for routine flows). Starknet best practices recommend:
- Dynamic multipliers adjusted based on network congestion and recent block prices
- Separate, per-resource configuration (tuning multipliers per L1 gas, L2 gas, and L1 data gas separately)
- Conservative defaults (1.5x) for routine user flows, with higher values (~2.0+) only when high inclusion certainty is required
- Caps and validation to prevent overflow or runaway costs
- Considering tips as an alternative to massive multiplier inflation for priority tuning
Refactor this to use configurable multipliers rather than hardcoded values, and consider exposing tuneable parameters per resource type and speed tier.
⛔ Skipped due to learnings
Learnt from: gomesalexandre Repo: shapeshift/web PR: 10810 File: src/plugins/walletConnectToDapps/utils/tenderly/index.ts:212-0 Timestamp: 2025-10-15T15:57:39.956Z Learning: gomesalexandre uses discriminated union patterns (e.g., `isEIP1559 ? { max_fee_per_gas, max_priority_fee_per_gas } : { gas_price }`) in WalletConnect flows without additional validation guards, trusting that the runtime data structure ensures mutual exclusivity between EIP-1559 and legacy gas pricing fields.
gomesalexandre
left a comment
There was a problem hiding this comment.
Functionally does the thing https://jam.dev/c/634372f5-cb56-4a28-a033-1c6d53b041bb
Could probably do with moving the heavy duty away to utils and tackle coderabbit comment at your convenience
|
Addressed the review feedback:
Both |
|
Also moved the heavy duty helpers out to
This keeps the adapter file focused on the core adapter logic. |
Description
Fee estimation on starknet for the deploy account were using an INVOKE estimation instead of a deploy account one, which was failing
Issue (if applicable)
nothing
Risk
Low
Testing
Engineering
Operations
Screenshots (if applicable)
https://jam.dev/c/e0e3fe4a-fbe9-4026-a345-f772d7e7a4fd
Summary by CodeRabbit
New Features
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.