Closed Nick-1979 closed 1 day ago
The pull request includes extensive modifications across multiple components, primarily focusing on the integration of the useEstimatedFee
hook to streamline the estimated fee calculation process. This change replaces various state management approaches with direct hook usage, enhancing type safety and simplifying the code structure. The updates affect components related to governance, staking, and account management, ensuring consistent handling of transaction fees and improving overall clarity in the codebase.
File Path | Change Summary |
---|---|
packages/extension-polkagate/src/fullscreen/accountDetails/unlock/Review.tsx |
Adjusted imports; replaced estimatedFee state with useEstimatedFee hook for fee calculation. |
packages/extension-polkagate/src/fullscreen/governance/delegate/index.tsx |
Updated fee handling to wrap partialFee in api.createType('Balance', ...) for type consistency. |
packages/extension-polkagate/src/fullscreen/governance/delegate/modify/ModifyDelegate.tsx | Enhanced type safety with new type imports; updated fee calculation logic to use api.createTypefor estimatedFee`. |
|
packages/extension-polkagate/src/fullscreen/governance/delegate/remove/RemoveDelegate.tsx | Updated partialFeehandling to ensure it is typed as Balance`. |
|
packages/extension-polkagate/src/fullscreen/governance/post/castVote/Cast.tsx | Modified fee calculation to wrap partialFeein api.createType('Balance', ...)`. |
|
packages/extension-polkagate/src/fullscreen/governance/post/castVote/index.tsx | Removed estimatedFeestate; replaced with useEstimatedFee` hook for fee calculation. |
|
packages/extension-polkagate/src/fullscreen/governance/post/decisionDeposit/index.tsx | Replaced estimatedFeestate with useEstimatedFeehook; adjusted SignArea2component's address` prop. |
|
packages/extension-polkagate/src/fullscreen/manageProxies/Review.tsx | Removed @ts-nocheck; replaced estimatedFeestate with useEstimatedFee` hook; updated API method access with optional chaining. |
|
packages/extension-polkagate/src/fullscreen/socialRecovery/Review.tsx | Removed useEffect; replaced estimatedFeewith useEstimatedFee` hook; updated transaction handling logic. |
|
packages/extension-polkagate/src/fullscreen/stake/pool/commonTasks/SetState.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/fullscreen/stake/pool/commonTasks/manageValidators/Review.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/fullscreen/stake/solo/commonTasks/manageValidators/Review.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/fullscreen/stake/solo/fastUnstake/index.tsx | Removed Balanceimport; replaced estimatedFeestate with useEstimatedFee` hook. |
|
packages/extension-polkagate/src/fullscreen/stake/solo/pending/index.tsx | Changed ExpandedRewardsfrom interface to tuple type; updated eraIndextype from numberto string`. |
|
packages/extension-polkagate/src/fullscreen/stake/solo/restake/index.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/hooks/useIdentity.ts |
Updated formatted parameter type to include null . |
packages/extension-polkagate/src/popup/account/unlock/Review.tsx | Removed Chainand Balanceimports; replaced estimatedFeestate with useEstimatedFee` hook. |
|
packages/extension-polkagate/src/popup/manageProxies/Review.tsx | Removed @ts-nocheck; replaced estimatedFeestate with useEstimatedFee` hook. |
|
packages/extension-polkagate/src/popup/send/Review.tsx | Removed Reviewcomponent entirely; simplified To` component. |
|
`packages/extension-polkagate/src/popup/send/partial/SendTxDetail.tsx | Component removed. |
packages/extension-polkagate/src/popup/staking/partial/SelectValidatorsReview.tsx | Removed Balanceand BN_ONEimports; replaced estimatedFeestate with useEstimatedFee` hook. |
|
packages/extension-polkagate/src/popup/staking/pool/myPool/SetState.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/nominations/remove/index.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/redeem/index.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/rewards/Stake.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/rewards/Withdraw.tsx | Replaced estimatedFeestate with useEstimatedFee` hook; removed previous fee calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/stake/bondExtra/Review.tsx | Added new type imports; refined totalStaked` calculation logic. |
|
packages/extension-polkagate/src/popup/staking/pool/stake/createPool/index.tsx | Enhanced type safety for estimatedFeeand estimatedMaxFee`. |
|
packages/extension-polkagate/src/popup/staking/pool/unstake/Review.tsx | Added BNtype; updated Propsinterface with stakedand total` properties. |
|
packages/extension-polkagate/src/popup/staking/pool/unstake/index.tsx | Updated estimatedFee` handling and type assertions; refined alert handling logic. |
Review
component changes in fee handling.useEstimatedFee
hook.Review
.Convictions
component.change requested
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
useEstimatedFee
hook across various components.Bug Fixes
Documentation
Refactor
Style