Skip to content

feat(destroy): add asset destroy feature for BioForest chains - #198

Merged
Gaubee merged 11 commits into
mainfrom
feat/destroy-asset-feature
Jan 9, 2026
Merged

Gaubee merged 11 commits into
mainfrom
feat/destroy-asset-feature

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Add complete asset destroy (销毁) functionality for BioForest chains, along with enhanced asset selection for transfers.

Features

1. Asset Selector Component

  • New AssetSelector component with Sheet-based UI
  • Supports exclude patterns (e.g., exclude main asset from destroy list)
  • Full test coverage (11 tests)

2. Destroy Page (/destroy)

  • Complete destroy flow with amount input and confirmation
  • Only available for BioForest chains
  • Main asset cannot be destroyed
  • Warning messages for irreversible action

3. SendPage Enhancement

  • Added AssetSelector for non-native token transfers
  • Supports assetType and assetLocked route params

4. WalletTab Token Menu

  • Added dropdown menu on token items
  • Transfer and Destroy options
  • Destroy only shown for non-main assets on BioForest chains

5. Miniapp Ecosystem Support

  • bio_destroyAsset permission and handler
  • MiniappDestroyConfirmJob confirmation sheet

6. SDK Extensions

  • createDestroyTransaction()
  • getDestroyTransactionMinFee()
  • getAssetDetail() for applyAddress lookup

Testing

  • 25 new unit tests added (all passed)
  • Total: 1787 tests passed

Files Changed

  • 32 files changed
  • ~2700 lines added

Gaubee added 11 commits January 9, 2026 14:17
BioForest chain timestamps are relative to the genesis block's
beginEpochTime, not absolute Unix timestamps. This fix adds the
epoch time offset to correctly display transaction times.

Before: timestamps showed 1970 (only relative seconds * 1000)
After: timestamps show correct dates (relative seconds * 1000 + epochTime)

Changes:
- Add getBeginEpochTime() to fetch and cache epoch time from SDK
- Add toAbsoluteTimestamp() helper for timestamp conversion
- Fix getTransaction() to use absolute timestamps
- Fix getTransactionHistory() to use absolute timestamps
- Add top-level await to load labels from GitHub at startup
- Add getLabels() to list all available labels with colors
- Add createLabel() and ensureLabels() for label management
- Add --create-labels flag to auto-create missing labels
- Add --list-labels flag to display available labels grouped by prefix
- Update createIssue/createPr to validate labels before creation

Usage:
  pnpm agent task start --list-labels
  pnpm agent task start --type service --title 'Feature' --create-labels
Add [skip ci] to initial commit message to avoid triggering CI runners
for draft PRs. CI will run normally when task submit is called.
- Document workflow stages (start → develop → submit)
- Explain CI skip behavior for draft PRs
- Document label management features
- Add color inference rules for new labels
Rename the MCP tool from 'workflow' to 'use' for cleaner API:
- workflow___workflow -> workflow___use
- Update examples in dynamic description
- Add RuntimeContext to detect MCP vs CLI mode
- Support async description: string | () => string | () => Promise<string>
- Add formatScenarios() and formatDataSection() mode-aware formatters
- MCP mode set automatically in buildToolDescription and executeWorkflow

Usage example:
  description: async () => {
    const labels = await getLabels();
    return `Task management\n\n${formatScenarios('task', scenarios)}\n\n${formatDataSection('Labels', labels)}`;
  }
- Add AssetSelector component for selecting transfer/destroy assets
- Add TokenItem renderActions slot for custom action menus
- Create useBurn hook with bioforest-specific destroy logic
- Add DestroyPage with confirmation flow
- Enhance SendPage with AssetSelector for non-native assets
- Add WalletTab token menu (transfer/destroy options)
- Add bio_destroyAsset miniapp ecosystem handler
- Add MiniappDestroyConfirmJob sheet
- Add i18n translations (zh-CN, en)
- Add unit tests (25 new tests passed)
- str`...` returns () => Promise<string>
- str.scenarios(args) returns () => string
- str.data(title, items) returns () => string
- Remove StrPlaceholder wrapper, just use functions
…s, and more button

- Add onContextMenu prop to TokenItem with (event, token, context) signature
- Add long-press support (500ms) for touch devices
- Add more button (IconDotsVertical) when onContextMenu is provided
- Refactor WalletTab to use Sheet-based action menu instead of DropdownMenu
- Add token-item-actions.test.tsx with 9 tests for the feature
- str`` tagged template returns () => Promise<string>
- str.scenarios(args) formats commands based on runtime mode (CLI vs MCP)
- str.data(title, items) formats data sections by mode
- Resolve async descriptions in meta.mcp.ts with WorkflowNameContext
- Update task.workflow.ts to use str template for start workflow
- Add WithContextMenu and ContextMenuList stories to token-item.stories.tsx
- Fix DestroyPage story to remove non-existent imports
- Create token-item-context-menu.spec.ts with 3 tests for context menu feature
- Add baseline screenshots for visual regression testing
@Gaubee
Gaubee merged commit 50363c6 into main Jan 9, 2026
8 of 10 checks passed
@Gaubee
Gaubee deleted the feat/destroy-asset-feature branch January 9, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant