Repository navigation
feat: adopt Amount type across types, services, and pages (#65, #66, #67, #68) - #74
Merged
Merged
Conversation
- Update AssetInfo.amount to use Amount - Update TransactionRecord to use Amount for amount and fee - Update StakingTransaction, StakingOverviewItem to use Amount - Update chain-adapter types (Balance, Fee, Transaction, GasPrice) to use Amount - Update bioforest services to use Amount factory methods - Update hooks (use-assets, use-send, use-transaction-history) to use Amount - Update pages (send, history, staking forms, token detail) to use Amount - Update transaction service (mock, web) to use Amount - Add Amount.fromFormatted() for user input conversion - Add Amount.toNumber() and toFormatted() for display Production code is now fully migrated to Amount type. Test files will be updated in a follow-up commit. Part of Epic #63
- Update transaction-item, transaction-list tests to use Amount - Update use-send, use-transaction-history tests to use Amount - Update bioforest-adapter tests to use Amount - Update asset and staking tests for Amount compatibility - Remove references to deprecated formatAssetAmount All tests now use Amount factory methods for mock data.
- Fix staking/index.test.tsx to use Amount factory methods - Fix history/detail.test.tsx and index.test.tsx mock data - Fix use-transaction-history.ts to not double-convert Amount objects - Fix use-send.test.ts feeAmount assertion to use Amount.toFormatted() All 122 test files pass (1425 tests)
- Create new chapter: 03-架构篇/08-Amount类型系统/ - Complete API reference for Amount class - Usage examples and best practices - Migration guide from string/bigint - Serialization and Zod schema support - Update 05-组件篇/02-通用组件/AmountDisplay.md - Add Amount type integration section - Update props to support Amount objects - Update 04-服务篇/02-链服务/ITransactionService.md - Change amount/fee types from bigint to Amount - Add link to Amount type documentation - Update 03-架构篇/index.md - Add Amount type system chapter link
- Add e2e/send-transaction.spec.ts: - Amount input validation tests - Balance validation (insufficient funds) - Confirm flow tests - Screenshot tests for send page states - Add e2e/transaction-history.spec.ts: - Transaction list amount display tests - Transaction detail tests - Filter functionality tests - Empty state tests These tests verify that Amount type is correctly displayed in user-facing UI (formatted values, not raw wei/satoshi).
- Make confirm flow tests more robust - Add logging for debugging in CI - Update screenshots baselines
This was referenced Dec 22, 2025
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full project-wide adoption of the Amount type for type-safe monetary operations.
Changes
Type Definitions Updated:
AssetInfo.amount:string→AmountTransactionRecord.amount/fee:string→AmountStakingTransaction,StakingOverviewItemamounts:string→AmountBalance,Fee,Transaction,GasPrice):bigint→AmountServices Updated:
Hooks Updated:
use-assets.ts- Mock data usesAmount.fromRaw()use-send.ts- UsesAmountfor fee handlinguse-transaction-history.ts- Converts API data to AmountPages/Components Updated:
send/index.tsx- Uses Amount for balance and feeshistory/detail.tsx- Uses Amount.toNumber() for displayTests Updated:
formatAssetAmountBreaking Changes
AssetInfo.amountmust now use Amount methodsTransactionRecord.amountandfeeare now Amount objectsraw,formatted,decimals- useamount.toRawString(),amount.toFormatted(),amount.decimalsRelated Issues
Closes #65 (AmountInput V2 component)
Part of Epic #63
Testing