Open gamalielhere opened 1 week ago
The changes in the pull request focus on enhancing the send-transaction
component within a Vue.js application across multiple blockchain implementations. A new utility function isNumericPositive
has been introduced to validate that the input amount is a positive numeric value. This function is integrated into various computed properties and methods to ensure that only valid numeric values are processed for transactions. Additionally, error handling has been improved to prevent non-numeric values from interfering with transaction processing.
File Path | Change Summary |
---|---|
packages/extension/src/providers/ethereum/ui/send-transaction/index.vue | - Added isNumericPositive(value: string) method for positive numeric validation. - Updated hasEnoughBalance to use isNumericPositive for validating sendAmount.value . - Modified nativeBalanceAfterTransaction to use a local variable locAmount for numeric checks. - Enhanced error handling related to non-numeric inputs. |
packages/extension/src/libs/utils/number-formatter.ts | - Introduced isNumericPositive function to check if a string represents a positive numeric value. - Updated export statement to include the new function. |
packages/extension/src/providers/bitcoin/ui/send-transaction/index.vue | - Imported isNumericPositive for input validation. - Updated nativeBalanceAfterTransaction to return zero for invalid amounts. - Modified sendAction to handle token and NFT transactions correctly. - Adjusted sendButtonTitle to format the send amount consistently. |
packages/extension/src/providers/kadena/ui/send-transaction/index.vue | - Imported isNumericPositive for validating input amounts in validateFields . - Refined error handling in validateFields to prevent non-positive submissions. |
packages/extension/src/providers/polkadot/ui/send-transaction/index.vue | - Imported isNumericPositive to enhance validation logic. - Updated edWarn and validateFields to use this function for checking amounts. - Modified destinationBalanceCheck and isDisabled to incorporate positivity checks. - Updated numerous functions and properties to include checks for positive numeric amounts. |
sequenceDiagram
participant User
participant SendTransactionComponent
participant TransactionService
User->>SendTransactionComponent: Input transaction amount
SendTransactionComponent->>SendTransactionComponent: Call isNumericPositive(amount)
alt Valid amount
SendTransactionComponent->>TransactionService: Process transaction
else Invalid amount
SendTransactionComponent->>User: Show error message
end
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?
:briefcase: Build Files chrome: enkrypt-chrome-299aae22.zip firefox: enkrypt-firefox-299aae22.zip
:syringe: Virus total analysis chrome: 299aae22 firefox: 299aae22
Added value check on input to avoid white page issue.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes