From e1275383aa411472067fe4919f30f7d92bf6e839 Mon Sep 17 00:00:00 2001 From: Gaubee Date: Sun, 4 Jan 2026 16:29:52 +0800 Subject: [PATCH 1/4] fix(forge): add disclaimer and sort chains BSC -> TRON -> ETH - Add BFM Ecosystem Foundation disclaimer with 1:1 ratio info - Sort external chains: BSC -> TRON -> ETH --- miniapps/forge/src/App.tsx | 6 ++++++ miniapps/forge/src/hooks/useRechargeConfig.ts | 6 ++++++ miniapps/forge/src/i18n/locales/en.json | 5 +++++ miniapps/forge/src/i18n/locales/zh-CN.json | 5 +++++ miniapps/forge/src/i18n/locales/zh-TW.json | 5 +++++ miniapps/forge/src/i18n/locales/zh.json | 5 +++++ 6 files changed, 32 insertions(+) diff --git a/miniapps/forge/src/App.tsx b/miniapps/forge/src/App.tsx index 0a4d7db6d..448d0f5c0 100644 --- a/miniapps/forge/src/App.tsx +++ b/miniapps/forge/src/App.tsx @@ -249,6 +249,12 @@ export default function App() { {loading && } {loading ? t('connect.loading') : t('connect.button')} + + {/* Disclaimer */} +
+

{t('disclaimer.title')}

+

{t('disclaimer.ratio')}

+
)} diff --git a/miniapps/forge/src/hooks/useRechargeConfig.ts b/miniapps/forge/src/hooks/useRechargeConfig.ts index 0015b0bf4..5a732b3fb 100644 --- a/miniapps/forge/src/hooks/useRechargeConfig.ts +++ b/miniapps/forge/src/hooks/useRechargeConfig.ts @@ -27,6 +27,9 @@ export interface ForgeOption { logo?: string } +/** Chain display order: BSC -> TRON -> ETH */ +const CHAIN_ORDER: Record = { BSC: 1, TRON: 2, ETH: 3 } + /** * Parse recharge config to forge options */ @@ -52,6 +55,9 @@ function parseForgeOptions(config: RechargeConfig): ForgeOption[] { } } + // Sort by chain order: BSC -> TRON -> ETH + options.sort((a, b) => (CHAIN_ORDER[a.externalChain] ?? 99) - (CHAIN_ORDER[b.externalChain] ?? 99)) + return options } diff --git a/miniapps/forge/src/i18n/locales/en.json b/miniapps/forge/src/i18n/locales/en.json index 02ef96141..127001094 100644 --- a/miniapps/forge/src/i18n/locales/en.json +++ b/miniapps/forge/src/i18n/locales/en.json @@ -4,6 +4,11 @@ "subtitle": "Multi-Chain Furnace", "description": "Forge external chain assets into Bio ecosystem tokens" }, + "disclaimer": { + "title": "Community token exchange initiated by BFM Ecosystem Foundation", + "ratio": "Exchange ratio 1:1", + "supported": "Supported tokens" + }, "connect": { "button": "Connect Wallet", "loading": "Connecting..." diff --git a/miniapps/forge/src/i18n/locales/zh-CN.json b/miniapps/forge/src/i18n/locales/zh-CN.json index 932d8dc50..97a68a7c5 100644 --- a/miniapps/forge/src/i18n/locales/zh-CN.json +++ b/miniapps/forge/src/i18n/locales/zh-CN.json @@ -4,6 +4,11 @@ "subtitle": "多链熔炉", "description": "将其他链资产锻造为 Bio 生态代币" }, + "disclaimer": { + "title": "由 BFM 生态基金会发起的社区代币兑换", + "ratio": "兑换比例 1:1", + "supported": "支持币种" + }, "connect": { "button": "连接钱包", "loading": "连接中..." diff --git a/miniapps/forge/src/i18n/locales/zh-TW.json b/miniapps/forge/src/i18n/locales/zh-TW.json index c35137643..829bf9a4d 100644 --- a/miniapps/forge/src/i18n/locales/zh-TW.json +++ b/miniapps/forge/src/i18n/locales/zh-TW.json @@ -4,6 +4,11 @@ "subtitle": "多鏈熔爐", "description": "將其他鏈資產鍛造為 Bio 生態代幣" }, + "disclaimer": { + "title": "由 BFM 生態基金會發起的社區代幣兌換", + "ratio": "兌換比例 1:1", + "supported": "支持幣種" + }, "connect": { "button": "連接錢包", "loading": "連接中..." diff --git a/miniapps/forge/src/i18n/locales/zh.json b/miniapps/forge/src/i18n/locales/zh.json index 932d8dc50..97a68a7c5 100644 --- a/miniapps/forge/src/i18n/locales/zh.json +++ b/miniapps/forge/src/i18n/locales/zh.json @@ -4,6 +4,11 @@ "subtitle": "多链熔炉", "description": "将其他链资产锻造为 Bio 生态代币" }, + "disclaimer": { + "title": "由 BFM 生态基金会发起的社区代币兑换", + "ratio": "兑换比例 1:1", + "supported": "支持币种" + }, "connect": { "button": "连接钱包", "loading": "连接中..." From ac7edfe7a03e2a6b23f6479b715f025b0e14e5ff Mon Sep 17 00:00:00 2001 From: Gaubee Date: Sun, 4 Jan 2026 16:58:14 +0800 Subject: [PATCH 2/4] fix(forge): remove incorrect disclaimer copy --- miniapps/forge/src/App.tsx | 6 ------ miniapps/forge/src/i18n/locales/en.json | 5 ----- miniapps/forge/src/i18n/locales/zh-CN.json | 5 ----- miniapps/forge/src/i18n/locales/zh-TW.json | 5 ----- miniapps/forge/src/i18n/locales/zh.json | 5 ----- 5 files changed, 26 deletions(-) diff --git a/miniapps/forge/src/App.tsx b/miniapps/forge/src/App.tsx index 448d0f5c0..0a4d7db6d 100644 --- a/miniapps/forge/src/App.tsx +++ b/miniapps/forge/src/App.tsx @@ -249,12 +249,6 @@ export default function App() { {loading && } {loading ? t('connect.loading') : t('connect.button')} - - {/* Disclaimer */} -
-

{t('disclaimer.title')}

-

{t('disclaimer.ratio')}

-
)} diff --git a/miniapps/forge/src/i18n/locales/en.json b/miniapps/forge/src/i18n/locales/en.json index 127001094..02ef96141 100644 --- a/miniapps/forge/src/i18n/locales/en.json +++ b/miniapps/forge/src/i18n/locales/en.json @@ -4,11 +4,6 @@ "subtitle": "Multi-Chain Furnace", "description": "Forge external chain assets into Bio ecosystem tokens" }, - "disclaimer": { - "title": "Community token exchange initiated by BFM Ecosystem Foundation", - "ratio": "Exchange ratio 1:1", - "supported": "Supported tokens" - }, "connect": { "button": "Connect Wallet", "loading": "Connecting..." diff --git a/miniapps/forge/src/i18n/locales/zh-CN.json b/miniapps/forge/src/i18n/locales/zh-CN.json index 97a68a7c5..932d8dc50 100644 --- a/miniapps/forge/src/i18n/locales/zh-CN.json +++ b/miniapps/forge/src/i18n/locales/zh-CN.json @@ -4,11 +4,6 @@ "subtitle": "多链熔炉", "description": "将其他链资产锻造为 Bio 生态代币" }, - "disclaimer": { - "title": "由 BFM 生态基金会发起的社区代币兑换", - "ratio": "兑换比例 1:1", - "supported": "支持币种" - }, "connect": { "button": "连接钱包", "loading": "连接中..." diff --git a/miniapps/forge/src/i18n/locales/zh-TW.json b/miniapps/forge/src/i18n/locales/zh-TW.json index 829bf9a4d..c35137643 100644 --- a/miniapps/forge/src/i18n/locales/zh-TW.json +++ b/miniapps/forge/src/i18n/locales/zh-TW.json @@ -4,11 +4,6 @@ "subtitle": "多鏈熔爐", "description": "將其他鏈資產鍛造為 Bio 生態代幣" }, - "disclaimer": { - "title": "由 BFM 生態基金會發起的社區代幣兌換", - "ratio": "兌換比例 1:1", - "supported": "支持幣種" - }, "connect": { "button": "連接錢包", "loading": "連接中..." diff --git a/miniapps/forge/src/i18n/locales/zh.json b/miniapps/forge/src/i18n/locales/zh.json index 97a68a7c5..932d8dc50 100644 --- a/miniapps/forge/src/i18n/locales/zh.json +++ b/miniapps/forge/src/i18n/locales/zh.json @@ -4,11 +4,6 @@ "subtitle": "多链熔炉", "description": "将其他链资产锻造为 Bio 生态代币" }, - "disclaimer": { - "title": "由 BFM 生态基金会发起的社区代币兑换", - "ratio": "兑换比例 1:1", - "supported": "支持币种" - }, "connect": { "button": "连接钱包", "loading": "连接中..." From 91202850a677e811f0a99e75554b4fe196b8662c Mon Sep 17 00:00:00 2001 From: Gaubee Date: Sun, 4 Jan 2026 17:05:36 +0800 Subject: [PATCH 3/4] test(forge): update chain order expectations in tests --- miniapps/forge/src/hooks/useRechargeConfig.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/miniapps/forge/src/hooks/useRechargeConfig.test.ts b/miniapps/forge/src/hooks/useRechargeConfig.test.ts index 515a70a91..7d66e27fd 100644 --- a/miniapps/forge/src/hooks/useRechargeConfig.test.ts +++ b/miniapps/forge/src/hooks/useRechargeConfig.test.ts @@ -88,16 +88,17 @@ describe('useRechargeConfig', () => { const options = result.current.forgeOptions expect(options).toHaveLength(2) // ETH and BSC enabled, TRON disabled + // Chain order: BSC -> TRON -> ETH expect(options[0]).toMatchObject({ - externalChain: 'ETH', - externalAsset: 'ETH', + externalChain: 'BSC', + externalAsset: 'BNB', internalChain: 'bfmeta', internalAsset: 'BFM', }) expect(options[1]).toMatchObject({ - externalChain: 'BSC', - externalAsset: 'BNB', + externalChain: 'ETH', + externalAsset: 'ETH', internalChain: 'bfmeta', internalAsset: 'BFM', }) From 6a951a00821159395b0de405e6c13e619a7003c3 Mon Sep 17 00:00:00 2001 From: Gaubee Date: Sun, 4 Jan 2026 17:09:08 +0800 Subject: [PATCH 4/4] test(forge): update storybook test for BNB-first chain ordering --- miniapps/forge/src/App.stories.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/miniapps/forge/src/App.stories.tsx b/miniapps/forge/src/App.stories.tsx index 4466cfafc..384c3c9a0 100644 --- a/miniapps/forge/src/App.stories.tsx +++ b/miniapps/forge/src/App.stories.tsx @@ -258,16 +258,16 @@ export const TokenPicker: Story = { await userEvent.click(canvas.getByRole('button', { name: /连接钱包/i })) - // Wait for token selector button + // Wait for token selector button (BSC/BNB is now first due to chain ordering) await waitFor( () => { - expect(canvas.getByText('ETH')).toBeInTheDocument() + expect(canvas.getByText('BNB')).toBeInTheDocument() }, { timeout: 5000 } ) // Click token selector to open picker - const tokenButton = canvas.getAllByRole('button').find((btn) => btn.textContent?.includes('ETH')) + const tokenButton = canvas.getAllByRole('button').find((btn) => btn.textContent?.includes('BNB')) if (tokenButton) { await userEvent.click(tokenButton) }