app-monorepo
app-monorepo copied to clipboard
feat: edit nonce & data OK-32337
trafficstars
Walkthrough
此次更改主要涉及多个文件的更新,增加了新的功能和属性。按钮组件现在支持文本对齐选项,服务历史类新增方法以获取账户的待处理交易nonce。通知服务进行了多项改进,包括事件监听和错误处理。发送服务更新了事务数据处理方式,增加了新的状态管理原子以支持高级事务设置。新的自定义nonce功能也被引入,增强了用户设置的灵活性。
Changes
| 文件路径 | 更改摘要 |
|---|---|
| packages/components/src/primitives/Button/index.tsx | 添加可选属性 textAlign 到 IButtonProps 接口,默认 variant 设置为 'secondary'。 |
| packages/kit-bg/src/services/ServiceHistory.ts | 新增方法 getAccountLocalPendingTxsNonceList,用于获取指定账户的待处理nonce列表。 |
| packages/kit-bg/src/services/ServiceNotification/ServiceNotification.ts | 更新构造函数以添加事件监听器,增强通知处理逻辑,改进错误处理和徽章管理。 |
| packages/kit-bg/src/services/ServiceSend.ts | 用 cloneDeep 替换 unset,更新方法以包含新的 nonceInfo 参数。 |
| packages/kit-bg/src/states/jotai/atoms/settings.ts | 添加布尔属性 isCustomNonceEnabled 到 ISettingsPersistAtom 类型,初始值为 false。 |
| packages/kit-bg/src/vaults/impls/evm/Vault.ts | 更新 updateUnsignedTx 方法,新增参数 dataInfo,添加 _attachDataInfoToEncodedTx 方法。 |
| packages/kit-bg/src/vaults/impls/evm/decoder/utils.ts | 新增工具函数 checkIsEmptyData,用于检查数据是否为空。 |
| packages/kit-bg/src/vaults/impls/evm/settings.ts | 添加属性 canEditNonce 设置为 true。 |
| packages/kit-bg/src/vaults/types.ts | 添加 canEditNonce 和 dataInfo 属性到相关类型。 |
| packages/kit/src/views/AssetDetails/pages/HistoryDetails/HistoryDetails.tsx | 在 renderHistoryDetails 函数中添加条件渲染以显示交易的十六进制数据。 |
| packages/kit/src/views/Home/components/BalanceDetailsDialog/index.tsx | 更新 onConfirmText 属性为 ETranslations.global_ok。 |
| packages/kit/src/views/Send/pages/SendConfirm/SendConfirmActionsContainer.tsx | 新增状态原子 useTxAdvancedSettingsAtom,更新事务提交逻辑。 |
| packages/kit/src/views/Send/pages/SendConfirm/SendConfirmContainer.tsx | 替换 TxExtraInfoContainer 为 TxAdvancedSettingsContainer。 |
| packages/kit/src/views/Send/pages/SendConfirm/TxAdvancedSettingsContainer.tsx | 新增组件 TxAdvancedSettingsContainer,管理高级事务设置。 |
| packages/kit/src/views/Send/pages/SendConfirm/TxFeeContainer.tsx | 将 txFeeInit 从 useRef 更改为 useState,增强状态管理。 |
| packages/kit/src/views/Setting/pages/CustomNonce/index.tsx | 新增组件 CustomNonce,用于管理自定义nonce设置。 |
| packages/kit/src/views/Setting/pages/List/AdvancedSection/index.tsx | 新增回调函数 onCustomNonce,用于导航到自定义nonce设置。 |
| packages/kit/src/views/Setting/router/index.tsx | 新增懒加载的 CustomNonceModal 组件。 |
| packages/shared/src/logger/scopes/setting/scenes/page.ts | 新增公共方法 enterCustomNonce 到 PageScene 类。 |
| packages/shared/src/routes/setting.ts | 在 EModalSettingRoutes 中新增 SettingCustomNonce 枚举值。 |
| packages/shared/src/utils/historyUtils.ts | 更新 getHistoryTxDetailInfo 函数以增强事务数据处理。 |
| packages/shared/types/history.ts | 在 IOnChainHistoryTx 类型中添加可选属性 data。 |
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryorSummaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.