Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 40 additions & 18 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,28 @@ jobs:
echo "Deployed to gh-pages branch"

# 直接在 build job 中创建 release,避免跨 job 传递 artifact(self-hosted 下载很慢)
# 使用重试逻辑处理网络不稳定问题
- name: Create or Update Release
uses: softprops/action-gh-release@v2
uses: nick-fields/retry@v3
with:
tag_name: ${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'beta' }}
name: ${{ steps.channel.outputs.channel == 'stable' && format('BFM Pay v{0}', steps.version.outputs.version) || 'BFM Pay Beta' }}
body: |
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
retry_on: error
command: |
gh release create "$TAG_NAME" \
--title "$RELEASE_TITLE" \
--notes "$RELEASE_NOTES" \
${{ steps.channel.outputs.channel == 'beta' && '--prerelease' || '' }} \
--target ${{ github.sha }} \
release/* \
2>/dev/null || \
gh release upload "$TAG_NAME" release/* --clobber
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'beta' }}
RELEASE_TITLE: ${{ steps.channel.outputs.channel == 'stable' && format('BFM Pay v{0}', steps.version.outputs.version) || 'BFM Pay Beta' }}
RELEASE_NOTES: |
## BFM Pay ${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'Beta' }}

### 下载
Expand All @@ -220,11 +236,6 @@ jobs:
```
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ steps.channel.outputs.channel == 'stable' && format('v{0}', steps.version.outputs.version) || 'beta' }}/bfmpay-dweb${{ steps.channel.outputs.channel == 'beta' && '-beta' || '' }}.zip
```
files: |
release/*
draft: false
prerelease: ${{ steps.channel.outputs.channel == 'beta' }}
generate_release_notes: ${{ steps.channel.outputs.channel == 'stable' }}

# ==================== GitHub-hosted 标准构建 ====================
build-standard:
Expand Down Expand Up @@ -483,12 +494,28 @@ jobs:
name: release-${{ needs.build-standard.outputs.channel }}-${{ needs.build-standard.outputs.version }}
path: release/

# 使用重试逻辑处理网络不稳定问题
- name: Create or Update Release
uses: softprops/action-gh-release@v2
uses: nick-fields/retry@v3
with:
tag_name: ${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'beta' }}
name: ${{ needs.build-standard.outputs.channel == 'stable' && format('BFM Pay v{0}', needs.build-standard.outputs.version) || 'BFM Pay Beta' }}
body: |
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
retry_on: error
command: |
gh release create "$TAG_NAME" \
--title "$RELEASE_TITLE" \
--notes "$RELEASE_NOTES" \
${{ needs.build-standard.outputs.channel == 'beta' && '--prerelease' || '' }} \
--target ${{ github.sha }} \
release/* \
2>/dev/null || \
gh release upload "$TAG_NAME" release/* --clobber
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'beta' }}
RELEASE_TITLE: ${{ needs.build-standard.outputs.channel == 'stable' && format('BFM Pay v{0}', needs.build-standard.outputs.version) || 'BFM Pay Beta' }}
RELEASE_NOTES: |
## BFM Pay ${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'Beta' }}

### 下载
Expand All @@ -505,8 +532,3 @@ jobs:
```
dweb://install?url=https://github.com/${{ github.repository }}/releases/download/${{ needs.build-standard.outputs.channel == 'stable' && format('v{0}', needs.build-standard.outputs.version) || 'beta' }}/bfmpay-dweb${{ needs.build-standard.outputs.channel == 'beta' && '-beta' || '' }}.zip
```
files: |
release/*
draft: false
prerelease: ${{ needs.build-standard.outputs.channel == 'beta' }}
generate_release_notes: ${{ needs.build-standard.outputs.channel == 'stable' }}
11 changes: 9 additions & 2 deletions CHAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -1252,8 +1252,15 @@ walletapi相关的接口:

---


升级我们的地址输入框,需要分成两种状态:聚焦输入状态,与非聚焦输入状态。
非聚焦状态下,专注于展示地址(使用我们专门的地址显示组件)。同时视觉上给人一种点击可以进行编辑的感觉。
非聚焦状态下,专注于展示地址(使用我们专门的地址显示组件:可以完整的展示头尾,中间自动省略或者显示)。同时视觉上给人一种点击可以进行编辑的感觉。

需要配套完整的 storybook+vitest 测试,storybook-e2e+截图

----

昨天有一个任务是关于支付面板的时候确认手续费,我自己测试了一下,发现用了一个 0.00001 作为默认手续费,这是错误的,我们 bioChain 是有专门的接口来获取最低手续费的。请你检查,并修复这个问题。
看一下白皮书有没有,如果没有,你调查完成后,顺便更新白皮书。
参考代码: `/Users/kzf/Dev/bioforestChain/legacy-apps/libs/wallet-base/services/wallet/chain-base/bioforest-chain.base.ts:378 #getTransferTransactionMinFee`
核心的逻辑就是用 SDK 试着创建一笔交易,SDK 会根据交易体自动提供一个最低手续费。
这个功能应该被封装到我们的 chain-provider 内核中。
4 changes: 2 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default defineConfig({
description: '多链钱包移动应用',
base,

// 忽略死链接检查(white-book 中有许多指向未完成文档的链接)
ignoreDeadLinks: true,
// webapp/storybook 目录由 CI 动态生成,忽略死链接检查
ignoreDeadLinks: [/\.\/webapp/, /\.\/webapp-dev/, /\.\/storybook/],

// 将 README.md 重写为 index.md (VitePress 默认入口)
rewrites: {
Expand Down
14 changes: 7 additions & 7 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ features:

| 篇章 | 内容 | 推荐读者 |
|------|------|---------|
| [产品篇](./white-book/01-产品篇/) | 产品愿景、用户画像、用户故事 | 产品经理 |
| [设计篇](./white-book/02-设计篇/) | 交互设计、视觉设计、设计原则 | 设计师 |
| [架构篇](./white-book/03-架构篇/) | 技术选型、系统架构、导航、状态管理 | 前端开发 |
| [服务篇](./white-book/04-服务篇/) | 服务架构、链服务接口、平台服务 | 后端开发 |
| [组件篇](./white-book/05-组件篇/) | 组件体系、表单系统、开发规范 | 前端开发 |
| [安全篇](./white-book/06-安全篇/) | 密钥管理、身份认证、DWEB授权 | 安全工程师 |
| [测试篇](./white-book/08-测试篇/) | 测试策略、Vitest、Playwright | 测试工程师 |
| [概述](./white-book/00-Manifesto/) | 产品愿景、架构概览、技术栈 | 所有人 |
| [内核参考](./white-book/01-Kernel-Ref/) | 核心进程、窗口管理、沙箱 | 架构师 |
| [驱动参考](./white-book/02-Driver-Ref/) | 链协议、Provider 实现 | 后端开发 |
| [界面参考](./white-book/03-UI-Ref/) | 组件体系、设计规范 | 前端开发 |
| [状态参考](./white-book/05-State-Ref/) | Store、Query 系统 | 前端开发 |
| [服务参考](./white-book/06-Service-Ref/) | 服务架构、链服务接口 | 后端开发 |
| [安全参考](./white-book/08-Security-Ref/) | 密钥管理、身份认证 | 安全工程师 |
24 changes: 12 additions & 12 deletions docs/white-book/00-Manifesto/03-Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,24 @@ Mapping source directories to documentation books.

| Architecture Layer | Code Path | Documentation Book |
| :--- | :--- | :--- |
| **Kernel** | `src/services/miniapp-runtime` | [`01-Kernel-Ref`](../01-Kernel-Ref) |
| **Drivers** | `src/services/chain-adapter` | [`02-Driver-Ref`](../02-Driver-Ref) |
| **UI System** | `src/components/ui`, `src/styles` | [`03-UI-Ref`](../03-UI-Ref) |
| **Platform** | `src/services/{biometric,camera,...}` | [`04-Platform-Ref`](../04-Platform-Ref) |
| **State** | `src/stores`, `src/queries` | [`05-State-Ref`](../05-State-Ref) |
| **Services** | `src/services/{chain-config,ecosystem,...}` | [`06-Service-Ref`](../06-Service-Ref) |
| **Wallet Logic** | `src/services/wallet`, `src/services/transaction` | [`10-Wallet-Guide`](../10-Wallet-Guide) |
| **DApps** | `src/components/ecosystem` | [`11-DApp-Guide`](../11-DApp-Guide) |
| **Shell** | `src/stackflow` | [`12-Shell-Guide`](../12-Shell-Guide) |
| **DevOps** | `vite.config.ts`, `.github` | [`90-DevOps`](../90-DevOps) |
| **Kernel** | `src/services/miniapp-runtime` | [`01-Kernel-Ref`](../01-Kernel-Ref/README.md) |
| **Drivers** | `src/services/chain-adapter` | [`02-Driver-Ref`](../02-Driver-Ref/README.md) |
| **UI System** | `src/components/ui`, `src/styles` | [`03-UI-Ref`](../03-UI-Ref/README.md) |
| **Platform** | `src/services/{biometric,camera,...}` | [`04-Platform-Ref`](../04-Platform-Ref/README.md) |
| **State** | `src/stores`, `src/queries` | [`05-State-Ref`](../05-State-Ref/README.md) |
| **Services** | `src/services/{chain-config,ecosystem,...}` | [`06-Service-Ref`](../06-Service-Ref/README.md) |
| **Wallet Logic** | `src/services/wallet`, `src/services/transaction` | [`10-Wallet-Guide`](../10-Wallet-Guide/README.md) |
| **DApps** | `src/components/ecosystem` | [`11-DApp-Guide`](../11-DApp-Guide/README.md) |
| **Shell** | `src/stackflow` | [`12-Shell-Guide`](../12-Shell-Guide/README.md) |
| **DevOps** | `vite.config.ts`, `.github` | [`90-DevOps`](../90-DevOps/README.md) |

### 2. By User Flow (Logical View)
Tracing a feature across multiple layers.

* **Transaction Flow**:
* Lifecycle: [`10-Wallet-Guide/03-Transaction-Flow`](../10-Wallet-Guide/03-Transaction-Flow)
* Lifecycle: [`10-Wallet-Guide/03-Transaction-Flow`](../10-Wallet-Guide/03-Transaction-Flow/README.md)
* State: [`05-State-Ref/02-Stores/01-Wallet-Store`](../05-State-Ref/02-Stores/01-Wallet-Store.md)
* Driver: [`02-Driver-Ref`](../02-Driver-Ref)
* Driver: [`02-Driver-Ref`](../02-Driver-Ref/README.md)
* **Balance Refresh**:
* Query: [`05-State-Ref/03-Queries/01-Balance-Query`](../05-State-Ref/03-Queries/01-Balance-Query.md)
* Store: [`05-State-Ref/02-Stores/01-Wallet-Store`](../05-State-Ref/02-Stores/01-Wallet-Store.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/white-book/00-Manifesto/05-Product-Vision.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,5 @@ BFM Pay 是 mpay 的 **技术重构版本**,而非简单的 UI 改版。
## 相关文档

- [技术栈](./02-Tech-Stack.md)
- [开发工作流](./03-Workflow.md)
- [开发工作流](./05-Workflows.md)
- [设计原则](../03-UI-Ref/01-Foundation/02-Design-Principles.md)
2 changes: 1 addition & 1 deletion docs/white-book/02-Driver-Ref/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
* [01-RPC-Provider.md](./02-EVM/01-RPC-Provider.md) - JSON-RPC 实现
* [02-Etherscan-Provider.md](./02-EVM/02-Etherscan-Provider.md) - Etherscan 实现
* **03-UTXO (比特币生态)**
* [01-Mempool-Provider.md](./03-UTXO/01-Mempool-Provider.md) - Mempool.space 实现
* [01-BTC-Provider.md](./03-UTXO/01-BTC-Provider.md) - Mempool.space 实现
* **04-TVM (波场生态)**
* [01-Tron-Provider.md](./04-TVM/01-Tron-Provider.md) - TronGrid 实现
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,5 @@ idle → validating → previewing → confirming → broadcasting → success
## Related Documentation

- [Transaction Lifecycle](../../10-Wallet-Guide/03-Transaction-Flow/01-Lifecycle.md)
- [Chain Adapter](../../02-Driver-Ref/01-Overview.md)
- [Chain Adapter](../../02-Driver-Ref/00-Overview.md)
- [Biometric Service](../../04-Platform-Ref/02-Biometric.md)
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,4 @@ Migration success with summary.
- [Key Derivation](../../10-Wallet-Guide/01-Account-System/01-Key-Derivation.md)
- [Biometric Service](../../04-Platform-Ref/02-Biometric.md)
- [Migration Service](../../06-Service-Ref/03-Migration/01-Mpay-Migration.md)
- [MiniApp Runtime](../../01-Kernel-Ref/01-Overview.md)
- [MiniApp Runtime](../../01-Kernel-Ref/00-Overview.md)
2 changes: 1 addition & 1 deletion docs/white-book/03-UI-Ref/04-Domain/04-Ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,6 @@ Bottom sheet header for miniapp modals.

## Related Documentation

- [MiniApp Runtime](../../01-Kernel-Ref/01-Overview.md)
- [MiniApp Runtime](../../01-Kernel-Ref/00-Overview.md)
- [PostMessage Bridge](../../06-Service-Ref/02-Ecosystem/01-PostMessage-Bridge.md)
- [Shell Navigation](../../12-Shell-Guide/01-Navigation/Router-Config.md)
16 changes: 8 additions & 8 deletions docs/white-book/05-State-Ref/00-Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
| [addressBookStore](./02-Stores/04-AddressBook-Store.md) | `address-book.ts` | ~150 | 地址簿 |
| [notificationStore](./02-Stores/05-Notification-Store.md) | `notification.ts` | ~80 | 通知 |
| [ecosystemStore](./02-Stores/06-Ecosystem-Store.md) | `ecosystem.ts` | ~100 | 小程序生态 |
| [securityPasswordStore](./02-Stores/07-Security-Store.md) | `security-password.ts` | ~60 | 安全密码 |
| [securityPasswordStore](./02-Stores/07-SecurityPassword-Store.md) | `security-password.ts` | ~60 | 安全密码 |

---

Expand All @@ -36,13 +36,13 @@
| Query | 文件 | 职责 |
|-------|------|------|
| [useBalanceQuery](./03-Queries/01-Balance-Query.md) | `use-balance-query.ts` | 余额查询 |
| [usePriceQuery](./03-Queries/02-Price-Query.md) | `use-price-query.ts` | 价格查询 |
| [useExchangeRateQuery](./03-Queries/03-ExchangeRate-Query.md) | `use-exchange-rate-query.ts` | 汇率查询 |
| [useTransactionHistoryQuery](./03-Queries/04-TransactionHistory-Query.md) | `use-transaction-history-query.ts` | 交易历史 |
| [useAddressTransactionsQuery](./03-Queries/05-AddressTransactions-Query.md) | `use-address-transactions-query.ts` | 地址交易 |
| [useAddressBalanceQuery](./03-Queries/06-AddressBalance-Query.md) | `use-address-balance-query.ts` | 地址余额 |
| [useChainConfigQuery](./03-Queries/07-ChainConfig-Query.md) | `use-chain-config-query.ts` | 链配置 |
| [useStakingQuery](./03-Queries/08-Staking-Query.md) | `use-staking-query.ts` | 质押信息 |
| [useTransactionHistoryQuery](./03-Queries/02-TransactionHistory-Query.md) | `use-transaction-history-query.ts` | 交易历史 |
| [usePriceQuery](./03-Queries/03-Price-Query.md) | `use-price-query.ts` | 价格查询 |
| [useExchangeRateQuery](./03-Queries/04-ExchangeRate-Query.md) | `use-exchange-rate-query.ts` | 汇率查询 |
| [useStakingQuery](./03-Queries/05-Staking-Query.md) | `use-staking-query.ts` | 质押信息 |
| [useAddressTransactionsQuery](./03-Queries/06-AddressTransactions-Query.md) | `use-address-transactions-query.ts` | 地址交易 |
| [useAddressBalanceQuery](./03-Queries/07-AddressBalance-Query.md) | `use-address-balance-query.ts` | 地址余额 |
| [useChainConfigQuery](./03-Queries/08-ChainConfig-Query.md) | `use-chain-config-query.ts` | 链配置 |
| [useSecurityPasswordQuery](./03-Queries/09-SecurityPassword-Query.md) | `use-security-password-query.ts` | 安全密码 |

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,6 @@ function ChainToggle({ chainId }: Props) {

## 相关文档

- [Chain Config Service](../../06-Service-Ref/03-Chain/07-Config.md)
- [Chain Adapter](../../06-Service-Ref/03-Chain/01-Adapter.md)
- [Chain Adapter](../../06-Service-Ref/03-Chain/01-Adapter.md)
- [Wallet Store](./01-Wallet-Store.md)
2 changes: 1 addition & 1 deletion docs/white-book/06-Service-Ref/02-Wallet/01-Storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@ const privateKey = await walletStorageService.decryptPrivateKey(chainAddress, en

- [Key Derivation](../../10-Wallet-Guide/01-Account-System/01-Key-Derivation.md)
- [Wallet Store](../../05-State-Ref/02-Stores/01-Wallet-Store.md)
- [Crypto Utils](../../01-Kernel-Ref/03-Crypto.md)
- [Kernel Overview](../../01-Kernel-Ref/00-Overview.md)
4 changes: 2 additions & 2 deletions docs/white-book/06-Service-Ref/03-Chain/05-BioForest.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,5 @@ if (error.code === 'PAYSECRET') {
## 相关文档

- [Chain Adapter 架构](./01-Adapter.md)
- [BioForest SDK](../07-Infra/01-SDK.md)
- [BioForest API](../07-Infra/02-API.md)
- [BioForest SDK](../09-BioForest/01-SDK.md)
- [BioForest API](../09-BioForest/02-API.md)
2 changes: 1 addition & 1 deletion docs/white-book/06-Service-Ref/04-MiniApp/01-Runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ const miniappRuntimeSelectors = {

- [Ecosystem Components](../../03-UI-Ref/04-Domain/04-Ecosystem.md)
- [PostMessage Bridge](./02-Ecosystem.md)
- [Authorize Service](./03-Authorize.md)
- [Authorize Service](../08-Authorize/01-PlaocAdapter.md)
2 changes: 1 addition & 1 deletion docs/white-book/06-Service-Ref/04-MiniApp/02-Ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,5 +350,5 @@ class AppRegistry {
## 相关文档

- [MiniApp Runtime](./01-Runtime.md)
- [Authorize Service](./03-Authorize.md)
- [Authorize Service](../08-Authorize/01-PlaocAdapter.md)
- [Ecosystem Components](../../03-UI-Ref/04-Domain/04-Ecosystem.md)
3 changes: 1 addition & 2 deletions docs/white-book/11-DApp-Guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

* [00-Overview.md](./00-Overview.md) - 生态架构
* **01-Runtime-Env (运行环境)**
* [01-Browser-Container.md](./01-Runtime-Env/01-Browser-Container.md) - 容器特性
* [02-Miniapp-Manifest.md](./01-Runtime-Env/02-Miniapp-Manifest.md) - 清单文件规范
* **02-Connectivity (连接性)**
* [01-Injected-Provider.md](./02-Connectivity/01-Injected-Provider.md) - 注入对象
* [README.md](./02-Connectivity/README.md) - 连接性概述
1 change: 0 additions & 1 deletion docs/white-book/12-Shell-Guide/01-Activities/00-Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,3 @@ export { MyActivity };

- [Navigation Map](../00-Navigation-Map.md)
- [Sheets/Jobs](../02-Sheets/00-Index.md)
- [Tabs](../03-Tabs/00-Index.md)
4 changes: 2 additions & 2 deletions docs/white-book/12-Shell-Guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
* **01-Navigation (导航系统)**
* [01-Router-Config.md](./01-Navigation/01-Router-Config.md) - 路由配置
* **01-Activities (页面活动)**
* [Activities](./01-Activities/) - 页面活动列表
* [Activities](./01-Activities/00-Index.md) - 页面活动列表
* **02-Sheets (底部弹窗)**
* [Sheets](./02-Sheets/) - 底部弹窗列表
* [Sheets](./02-Sheets/00-Index.md) - 底部弹窗列表
4 changes: 2 additions & 2 deletions docs/white-book/90-DevOps/02-Testing/01-Strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,6 @@ jobs:

## 相关文档

- [构建配置](../01-Build/01-Vite-Config.md)
- [CI 工作流](../03-Release/01-CI-Workflows.md)
- [构建配置](../01-Build/README.md)
- [部署机制](../03-Release/02-Deployment.md)
- [安全审计](../../08-Security-Ref/04-Security-Audit.md)
4 changes: 1 addition & 3 deletions docs/white-book/90-DevOps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

## 📖 目录

* [00-Overview.md](./00-Overview.md) - 工程化概览
* **01-Build (构建)**
* [01-Vite-Config.md](./01-Build/01-Vite-Config.md) - 构建配置
* [README.md](./01-Build/README.md) - 构建配置
* **02-Testing (测试)**
* [01-Strategy.md](./02-Testing/01-Strategy.md) - 测试策略
* **03-Release (发布)**
* [01-CI-Workflows.md](./03-Release/01-CI-Workflows.md) - CI 工作流
* [02-Deployment.md](./03-Release/02-Deployment.md) - 部署机制