-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ecosystem): Bio 小程序生态系统架构 #133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gaubee
wants to merge
19
commits into
main
Choose a base branch
from
feat/ecosystem
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- Add pnpm-workspace.yaml for monorepo structure - Create @aspect-aspect/bio-sdk package with EIP-1193 style API - Create miniapps/teleport (一键传送) demo app - Create miniapps/forge (锻造) demo app - Add ecosystem.json subscription manifest - Add whitebook documentation (10-生态篇) - Configure build scripts for SDK and miniapps
Phase 2: Host Provider - Add PostMessage bridge for iframe communication - Implement wallet handlers (requestAccounts, selectAccount, pickWallet) - Implement signing handlers (signMessage, signTypedData) - Implement transfer handlers (sendTransaction) - Add miniapp registry for subscription management Phase 3: UI Integration - Add EcosystemTab with app grid - Add MiniappActivity and MiniappPage for running miniapps - Update TabBar with ecosystem tab (3 tabs: wallet, ecosystem, settings) - Register MiniappActivity route Testing - Add unit tests for types, bridge, and registry - All 1622 tests passing Documentation - Add implementation status document - Update whitebook index with ecosystem chapter
- AccountPickerJob: wallet account selector for miniapps - SigningConfirmJob: message signing confirmation dialog - PermissionRequestJob: permission request dialog - MiniappPage: register handler callbacks for UI integration Phase 4: Complete UI integration for bio_selectAccount, bio_signMessage
23db0bb to
dda5cad
Compare
Phase 5: Permission & Architecture - Add EcosystemStore for permission and source storage - Add permissions.ts for permission checking - Integrate permission checking into bridge.ts - Add HandlerContext for multi-instance callback management - Refactor handlers to use context-based callbacks - Update PermissionRequestJob to handle JSON permissions All 1623 tests passing.
Phase 6: Feature Completion - Add MiniappTransferConfirmJob for miniapp transfer requests - Add SettingsSourcesActivity for managing trusted sources - Add sources management entry in settings page - Update miniapp.tsx to use new transfer confirm dialog All 1623 tests passing.
- bio-sdk: vitest config + 18 unit tests (events, types, provider) - teleport: vitest config + 6 component tests - forge: vitest config + 7 component tests - Add window.bio type declarations - Add turbo.json test:storybook task config - Update whitebook: Storybook v10 + Vitest integration rationale All subprojects now have proper test infrastructure: - vitest.config.ts for test runner - test-setup.ts for jest-dom matchers - Unit tests for core logic - Component tests for React apps
- SigningConfirmJob: use SignatureAuthService.handleMessageSign - MiniappTransferConfirmJob: use SignatureAuthService.handleTransferSign - Both dialogs now trigger WalletLockConfirmJob for password verification - miniapp.tsx: extract chainName from wallet address for signing The signing flow now: 1. User confirms → WalletLockConfirmJob opens 2. User inputs pattern → Password verified 3. Real Ed25519/mock signature generated based on chain type 4. Signature returned to miniapp via CustomEvent
- Test ecosystem tab visibility - Test account picker job - Test signing confirm job - Test transfer confirm job - Test trusted sources management Uses mock configuration for consistent test data.
Screenshots added: - 01-home-with-ecosystem-tab: Home page with ecosystem tab - 02-ecosystem-tab-content: Miniapp list (Teleport, Forge) - 03-account-picker: Single wallet account picker - 04-signing-confirm: Signing request dialog - 05-signing-wallet-lock: Pattern lock for signing - 06-transfer-confirm: Transfer confirmation dialog - 07-trusted-sources: Trusted sources management - 08-multi-wallet-picker: Multiple wallets account picker - 09-ethereum-only-picker: Chain-filtered account picker - 10-long-message-signing: Long message signing dialog - 11-large-amount-transfer: Large amount transfer - 12-small-amount-transfer: Small decimal amount transfer Bug fix: - AccountPickerJob: Hide wallets without matching chain address instead of showing them as disabled. This prevents confusion when filtering by chain.
Port rule: default port + 6000 to avoid vite default port conflicts - e2e: 11173 (dev) - e2e:mock: 11174 (mock) This prevents port conflicts when vite dev server is already running on default ports 5173/5174.
- AccountPickerJob: use AddressDisplay for wallet addresses - SigningConfirmJob: use AddressDisplay for signing address - MiniappTransferConfirmJob: use AddressDisplay for from/to addresses, AmountDisplay for transfer amount with proper formatting Benefits: - Consistent address truncation across components - Proper number formatting with thousand separators - Responsive address display based on container width - Accessibility improvements (aria labels, copy functionality)
Changed From-To section from horizontal to vertical layout: - Addresses now have full width for proper truncation - Single ellipsis in middle (e.g., c7R6wVdP...7CpPn5Mk5Xz3) - Added copy buttons for both addresses - Down arrow between from/to for better visual flow
New screenshot tests:
- 13: Permission request dialog (bio_signMessage, bio_sendTransaction)
- 14: Empty wallet state in account picker
- 15: Hex data warning in signing dialog
New interaction tests:
- Cancel signing triggers event with { confirmed: false }
- Cancel transfer triggers event with { confirmed: false }
- Cancel account picker triggers cancel event
- Select account triggers event with address/chain/name
- Transfer confirm page has copyable addresses
Total: 20 tests (12 screenshots + 8 functional)
- Expand MiniappManifest with category, tags, screenshots, publishedAt, updatedAt, verified, beta, longDescription, website fields - Add MiniappCategory type and KNOWN_PERMISSIONS definitions - Create MiniappDetailActivity for full app metadata display - App header with icon, name, verified badge, author, category - Long description with Markdown support - Screenshots horizontal scroll gallery - Permission list with risk level indicators - Supported chains display - Tags display - Developer info section - Update EcosystemTab with card-based layout - Rich app cards with icon, name, description, badges - Click card for details, direct open button - Update ecosystem.json with enhanced sample data - Add E2E tests for detail page (17 screenshots total)
- Add MiniappInfo interface with name and icon - Update SigningParams to use app object instead of appName - Update HandlerCallbacks interfaces to include app info - Pass appIcon from MiniappPage to all Sheet components: - SigningConfirmJob - MiniappTransferConfirmJob - AccountPickerJob - PermissionRequestJob - Update Sheet headers to display app icon with fallback - Update E2E tests with appIcon parameter
- Redesign teleport icon: purple portal with arrow and sparkles - Redesign forge icon: orange flame with anvil - Add SVG screenshots showing app interfaces: - teleport: transfer form and success screens - forge: exchange interface - Update ecosystem.json to use SVG screenshots - Update E2E screenshots showing app icons in dialogs
- Split globals.css into theme.css (shareable) and globals.css - Create @keyapp/sdk package with context API (theme, locale, env, a11y) - Configure miniapps to use tsconfig paths for component sharing - Add Tailwind CSS 4 support to miniapps with vite-tsconfig-paths - Pass context params to iframe URL and sync via PostMessage - Add React hooks for context consumption in miniapps
- Rewrite Teleport and Forge apps using shared @/components/ui - Add Tailwind CSS styling with theme support - Add E2E tests for miniapp UI with 16 screenshot tests - Verify theme sync (light/dark mode, custom primary hue) - Fix emptyOutDir to preserve icon and screenshots
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.
概述
搭建 Bio 小程序生态系统的完整架构,包含真实签名服务集成:
window.bio接口SignatureAuthService执行真实 Ed25519 签名用户故事流程
完成的 Phases
签名流程
测试覆盖
CI 状态
待后续 PR