@jetthai/cuora 1.1.466-dev.0 → 1.1.466

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,96 +6,9 @@
6
6
 
7
7
  ---
8
8
 
9
- ## Step 0 — 分析專案並更新 AI_PROMPT_SOURCE.md
10
-
11
- 在同步之前,先掃描專案的實際狀態,確保 `AI_PROMPT_SOURCE.md` 中的數據與程式碼一致。
12
-
13
- ### Part A — 數據校準
14
-
15
- 驗證並更新文件中的統計數據,確保與程式碼一致:
16
-
17
- 1. **版本號**:讀取 `package.json` 的 `version` 欄位,更新文件中的版本號
18
- 2. **檔案數量統計**:
19
- - `src/` 下的 `.js` 檔案總數
20
- - `src/api/` 檔案數
21
- - `src/machine/` 檔案總數(含子目錄),以及狀態機數量(= 總數 - index 檔案數)
22
- - `src/machine/activity/`、`src/machine/deposit/`、`src/machine/withdraw/` 各自檔案數
23
- - `src/util/` 檔案數
24
- 3. **API 函式數量**:對每個 `src/api/*.js` 模組,計算 `=>` 的出現次數以統計函式數
25
- 4. **行數驗證**:驗證以下檔案的實際行數:
26
- - `src/request/request.js`、`src/request/config.js`
27
- - 所有超過 300 行的狀態機檔案(用於「大型狀態機檔案」表格)
28
- 5. **supportVersion2List 端點數**:計算 `request.js` 中 `supportVersion2List` 陣列的實際項目數
29
- 6. **specifyingPath 映射數**:計算 `_convertUrlToKebabCase` 中 `specifyingPath` 的 key 數量
30
- 7. **關鍵行號參照**:驗證文件中引用的行號(如 `request.js:207`、`request.js:254` 等)是否仍然正確,若偏移則更新
31
- 8. **依賴套件版本**:讀取 `package.json` 的 `dependencies`,更新版本號
32
-
33
- ### Part B — Know-How 與架構驗證
34
-
35
- 檢查 `1.7 核心業務流程與關鍵 Know-How` 章節的內容是否仍然反映程式碼的實際行為:
36
-
37
- 1. **認證流程**:讀取 `src/machine/auth.js`,驗證:
38
-
39
- - Token TTL、輪詢間隔、延展機制是否有變
40
- - inline vs login 狀態判斷邏輯(`rank >= 0`)是否有變
41
- - 登入方式是否有新增或移除(檢查全域 `on:` 事件列表)
42
- - OTP 流程是否有調整
43
-
44
- 2. **存款流程**:抽樣讀取 2-3 個 deposit 狀態機,驗證:
45
-
46
- - canonical 流程(loading → promotion → loaded → debouncing → calculating → submitting → submitted)是否有變
47
- - Cash vs Non-Cash 變體的差異描述是否仍然正確
48
- - 是否有新增的存款類型或支付方式
49
-
50
- 3. **提款流程**:讀取 `src/machine/withdraw/withdraw_manual.js`,驗證:
51
-
52
- - 五步驟資格驗證鏈是否有調整
53
- - OTP 平行狀態是否有變
54
-
55
- 4. **WebSocket**:讀取 `src/machine/websocket.js`,驗證:
56
-
57
- - 連線參數、重連策略是否有變
58
- - 事件轉發映射表是否有新增事件
59
-
60
- 5. **Error Machine**:讀取 `src/machine/error.js`,驗證:
61
-
62
- - 錯誤代碼分類是否有新增
63
- - 路由邏輯是否有調整
64
-
65
- 6. **Common Machine**:讀取 `src/machine/common.js`,驗證:
66
-
67
- - 4 個平行子機器的結構是否有變
68
- - siteConfig 解碼方式是否有變
69
-
70
- 7. **API 請求生命週期**:讀取 `src/request/request.js`,驗證:
71
-
72
- - 攔截器邏輯、V2 轉換流程是否有變
73
- - isBlocked 維護模式機制是否有變
74
-
75
- 8. **新增狀態機**:比對 `src/machine/` 目錄與文件中的狀態機分類表,若有新增檔案:
76
- - 判斷歸類(核心/存款/提款/活動/遊戲/使用者/UI)
77
- - 更新分類表中的數量與代表檔案
78
-
79
- ### Part C — Clean Code 規範驗證
80
-
81
- 檢查「二、程式碼品質標準」中列出的問題是否已修正:
82
-
83
- 1. **已修正的問題**:若問題已被修正(如 HTTP 方法大小寫已統一),將該項標記為已修正或移除
84
- 2. **新增的問題**:若發現新的程式碼品質問題,添加到對應章節
85
-
86
- ### 執行方式
87
-
88
- - 使用 shell 指令(`wc -l`、`grep -c`、`find` 等)取得實際數據
89
- - 使用 Agent subagent 平行分析多個核心檔案
90
- - 將每項差異直接修正到 `AI_PROMPT_SOURCE.md` 中
91
- - 若無差異則跳過,不做無意義修改
92
- - 完成後簡短回報哪些項目有更新
93
-
94
- ---
95
-
96
9
  ## Step 1 — 讀取來源檔
97
10
 
98
- 讀取 `AI_PROMPT_SOURCE.md` 完整內容(此時已是 Step 0 更新後的最新版本)。
11
+ 讀取 `AI_PROMPT_SOURCE.md` 完整內容。
99
12
 
100
13
  ---
101
14
 
@@ -17,9 +17,7 @@
17
17
  "mcp__sentry__get_issue_details",
18
18
  "mcp__sentry__search_issues",
19
19
  "Bash(git add:*)",
20
- "Bash(git commit:*)",
21
- "Bash(git branch:*)",
22
- "Bash(git merge:*)"
20
+ "Bash(git commit:*)"
23
21
  ]
24
22
  }
25
23
  }
@@ -19,14 +19,14 @@ if [ "$match" = "1" ]; then
19
19
  # 檢查本地是否有尚未推送的 commit,有的話跳過自動拉取(避免覆蓋本地變更)
20
20
  LOCAL_AHEAD=$(git rev-list --count origin/"$CURRENT_BRANCH"..HEAD 2>/dev/null || echo 0)
21
21
  if [ "$LOCAL_AHEAD" -gt 0 ]; then
22
- echo "You have $LOCAL_AHEAD unpushed commit(s) on '$CURRENT_BRANCH'. Skipping auto-pull."
22
+ echo "分支 '$CURRENT_BRANCH' 有 $LOCAL_AHEAD 個尚未推送的 commit,略過自動拉取。"
23
23
  exit 0
24
24
  fi
25
25
 
26
26
  # 自動從遠端拉取最新程式碼(使用 rebase 保持線性歷史)
27
- echo "Auto pulling '$CURRENT_BRANCH' from remote..."
27
+ echo "正在從遠端自動拉取 '$CURRENT_BRANCH'..."
28
28
  git pull --rebase origin "$CURRENT_BRANCH" || {
29
- echo "Failed to pull '$CURRENT_BRANCH'. Please resolve manually."
29
+ echo "拉取 '$CURRENT_BRANCH' 失敗,請手動處理。"
30
30
  exit 1
31
31
  }
32
32
  fi
package/.husky/pre-push CHANGED
@@ -21,7 +21,7 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
21
21
 
22
22
  # 在 dev/qa 分支的 force push 跳過所有 pre-push hook(避免干擾強制推送)
23
23
  if [ "$IS_FORCE" = true ] && { [ "$BRANCH" = "dev" ] || [ "$BRANCH" = "qa" ]; }; then
24
- echo "Force push detected on $BRANCH, skipping pre-push hooks."
24
+ echo "偵測到在 $BRANCH 分支上強制推送,略過 pre-push hooks。"
25
25
  exit 0
26
26
  fi
27
27
 
package/.prettierignore CHANGED
@@ -1,2 +1 @@
1
- dist/
2
- CHANGELOG.md
1
+ dist/
package/CHANGELOG.md CHANGED
@@ -2,101 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.1.466-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.466-dev.0) (2026-09-06)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * **deposit:** 移除 crypto_way_cash 未使用的 sourceAddress 欄位 ([18a0247](https://github.com/jetthai/cuora-module/commit/18a024776ae315c7a2b2ba9018e8fdce1b660f1a))
11
-
12
- ### [1.1.465-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.465-dev.4) (2026-08-24)
13
-
14
-
15
- ### Features
16
-
17
- * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
18
- * **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
19
-
20
-
21
- ### Bug Fixes
22
-
23
- * **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
24
- * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
25
- * **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
26
- * **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
27
- * **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
28
- * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
29
-
30
5
  ### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
31
6
 
32
- ### [1.1.465-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.3...v1.1.465-dev.4) (2026-08-24)
33
-
34
-
35
- ### Bug Fixes
36
-
37
- * **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
38
-
39
- ### [1.1.465-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.2...v1.1.465-dev.3) (2026-08-19)
40
-
41
-
42
- ### Bug Fixes
43
-
44
- * **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
45
-
46
- ### [1.1.465-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.1...v1.1.465-dev.2) (2026-08-19)
47
-
48
- ### [1.1.465-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.0...v1.1.465-dev.1) (2026-08-19)
49
-
50
-
51
- ### Features
52
-
53
- * **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
54
-
55
7
  ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
56
8
 
57
9
  ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
58
10
 
59
- ### [1.1.465-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.3...v1.1.465-dev.0) (2026-08-17)
60
-
61
- ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
62
-
63
- ### [1.1.463-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.2...v1.1.463-dev.3) (2026-08-17)
64
-
65
- ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
66
-
67
-
68
11
  ### Bug Fixes
69
12
 
70
13
  - **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
71
14
  - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
72
15
 
73
- ### [1.1.463-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.1...v1.1.463-dev.2) (2026-08-16)
74
-
75
-
76
- ### Bug Fixes
77
-
78
- * **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
79
-
80
- ### [1.1.463-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.0...v1.1.463-dev.1) (2026-08-13)
81
-
82
- ### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
83
-
84
- ### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
85
-
86
-
87
- ### Features
88
-
89
- * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
90
-
91
-
92
- ### Bug Fixes
93
-
94
- * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
95
- * **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
96
- * **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
97
- * **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
98
- * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
99
-
100
16
  ### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
101
17
 
102
18
  ### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
@@ -113,44 +29,6 @@ All notable changes to this project will be documented in this file. See [standa
113
29
 
114
30
  ### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
115
31
 
116
- ### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.7...v1.1.455-dev.8) (2026-08-09)
117
-
118
- ### [1.1.455-dev.7](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.6...v1.1.455-dev.7) (2026-08-07)
119
-
120
- ### [1.1.455-dev.6](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.5...v1.1.455-dev.6) (2026-08-07)
121
-
122
- ### [1.1.455-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.4...v1.1.455-dev.5) (2026-08-07)
123
-
124
- ### [1.1.455-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.3...v1.1.455-dev.4) (2026-08-07)
125
-
126
- ### [1.1.455-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.2...v1.1.455-dev.3) (2026-08-07)
127
-
128
- ### [1.1.455-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.1...v1.1.455-dev.2) (2026-08-06)
129
-
130
- ### [1.1.455-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.0...v1.1.455-dev.1) (2026-08-04)
131
-
132
-
133
- ### Bug Fixes
134
-
135
- - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
136
-
137
- ### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
138
-
139
- ### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
140
-
141
-
142
- ### Features
143
-
144
- - **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
145
-
146
-
147
- ### Bug Fixes
148
-
149
- - **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
150
- - **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
151
- - **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
152
- - **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
153
-
154
32
  ### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
155
33
 
156
34
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.466-dev.0",
3
+ "version": "1.1.466",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // Copyright 2024 The Terasology Foundation
3
2
 
4
3
  // dev/qa 分支自動計算下一個 prerelease 版號
5
4
  // 版號格式:{master 版號}-{分支名}.{遞增編號}
@@ -14,15 +14,8 @@ const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
14
14
  console.log(`Branch: ${branch}`)
15
15
  console.log(`Version: ${version}`)
16
16
 
17
- // 推送 commit 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
18
- execSync(`git push --no-verify ${remote} ${branch}`, { stdio: 'inherit' })
19
-
20
- // 單獨推送 tag;tag 已存在於 remote 時視為成功(不中斷 npm publish)
21
- try {
22
- execSync(`git push --no-verify ${remote} refs/tags/v${version}`, { stdio: 'inherit' })
23
- } catch {
24
- console.warn(`⚠ tag v${version} push 失敗(可能已存在),繼續 npm publish`)
25
- }
17
+ // 推送 commit 與 tag 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
18
+ execSync(`git push --no-verify --follow-tags ${remote} ${branch}`, { stdio: 'inherit' })
26
19
 
27
20
  // 發布到 npm,使用分支名稱作為 dist-tag(例如 npm install @jetthai/cuora@dev)
28
21
  try {
@@ -259,5 +259,4 @@ export default {
259
259
  params: { requestId },
260
260
  isPublic: true,
261
261
  }),
262
- getPaymentPromotions: () => ({ url: 'payment/v2/promotions', method: 'get' }),
263
262
  }
@@ -15,13 +15,6 @@ export default function (request) {
15
15
  const accountPhoneKey = 'account_phone'
16
16
  const accountEmailKey = 'account_email'
17
17
  const accountUsernameKey = 'account_username'
18
- // loginMethods 的鍵 → setAccount 寫入的 storage key。
19
- // LOGIN_ID 與 LOGIN_LOCAL 都寫 accountUsernameKey,兩者在 loginMethods 都算 'local',此對照無法由 key 名反推。
20
- const rememberedAccountKeys = [
21
- ['local', accountUsernameKey],
22
- ['phone', accountPhoneKey],
23
- ['email', accountEmailKey],
24
- ]
25
18
 
26
19
  return createMachine(
27
20
  {
@@ -54,7 +47,7 @@ export default function (request) {
54
47
  src: 'fetchSiteConfig',
55
48
  onDone: {
56
49
  target: 'idle',
57
- actions: ['setSiteConfig', 'pruneRememberedAccounts'],
50
+ actions: 'setSiteConfig',
58
51
  },
59
52
  onError: {
60
53
  target: 'idle',
@@ -348,19 +341,6 @@ export default function (request) {
348
341
  siteConfig: { ...event.data, loginMethods: pickBy(loginMethods), registerMethods: pickBy(registerMethods) },
349
342
  }
350
343
  }),
351
- // setAccount 寫入的帳號 TTL 是 31 天,且只互斥清除另外兩支 key,
352
- // 後台關掉某種登入方式後殘值仍在,下游會把它回填進已改型別的輸入框(例如把 email 填進 phone-only 站台)。
353
- // 非 assign action,故取得的是 setSiteConfig 套用後的 context。
354
- pruneRememberedAccounts: (context) => {
355
- // fetchSiteConfig 失敗會走 onError 不進到這裡;此處防的是回傳成功但 loginMethods 整包缺失,避免誤清全部記住的帳號。
356
- const enabledMethods = context.siteConfig?.loginMethods
357
- if (!enabledMethods || !Object.keys(enabledMethods).length) return
358
- rememberedAccountKeys.forEach(([method, key]) => {
359
- if (enabledMethods[method]) return
360
- storage.remove(key)
361
- if (method === 'phone') storage.remove(phoneCountryCode)
362
- })
363
- },
364
344
  setReCaptchaToken: assign((context, event) => {
365
345
  const { reCaptchaToken } = event.data
366
346
  return {
@@ -514,6 +494,8 @@ export default function (request) {
514
494
  nickname,
515
495
  }
516
496
 
497
+ sentry?.captureMessage(`[Auth] RedirectTo3Party Data: ${JSON.stringify(messages)}`, { level: 'info' })
498
+
517
499
  // 空值一律不進 query。dt 與 fc 原本裸展開進 URLSearchParams,兩者為 undefined 時會被
518
500
  // 序列化成字面字串 dt=undefined / fc=undefined,後端收到的是 "undefined" 而非缺省
519
501
  const query = pickBy(
@@ -13,6 +13,7 @@ export default function (request, context) {
13
13
  selectedAmount,
14
14
 
15
15
  cryptos: [],
16
+ sourceAddress: '',
16
17
  options: [],
17
18
 
18
19
  selectedCrypto: null,
@@ -109,6 +110,10 @@ export default function (request, context) {
109
110
  actions: 'setCrypto',
110
111
  internal: false,
111
112
  },
113
+ SET_ADDRESS: {
114
+ actions: 'setAddress',
115
+ internal: false,
116
+ },
112
117
  SET_AMOUNT: {
113
118
  target: '.debouncing',
114
119
  actions: 'setAmount',
@@ -174,6 +179,11 @@ export default function (request, context) {
174
179
  inputAmount: assign((context, event) => {
175
180
  return { selectedAmount: event.data }
176
181
  }),
182
+ setAddress: assign((context, event) => {
183
+ return {
184
+ sourceAddress: event.data,
185
+ }
186
+ }),
177
187
  setCalculation: assign((context, event) => {
178
188
  // V2接口轉換中回傳的資料結構不同
179
189
  const { data } = event.data
@@ -250,7 +260,7 @@ export default function (request, context) {
250
260
  )
251
261
  },
252
262
  submitDeposit: async (context, event) => {
253
- const { selectedCrypto, selectedAmount, promotion } = context
263
+ const { selectedCrypto, selectedAmount, sourceAddress, promotion } = context
254
264
  // 防禦性檢查:將 amount 轉為數字型別,並驗證範圍合法性,避免非法金額送出 API
255
265
  const amount = +selectedAmount
256
266
  if (!amount || amount <= 0 || amount < selectedCrypto.minimum || amount > selectedCrypto.maximum) {
@@ -262,6 +272,7 @@ export default function (request, context) {
262
272
  amount: amount,
263
273
  cryptoCurrency: selectedCrypto.channel,
264
274
  cryptoNetwork: selectedCrypto.networkCode,
275
+ sourceAddress: sourceAddress,
265
276
  promotionsNo: promotion?.promotionsNo,
266
277
  })
267
278
  )
@@ -106,7 +106,6 @@ export default function (request) {
106
106
  return {
107
107
  signUpData: {
108
108
  provider: 'local',
109
- birthday,
110
109
  ...pickBindData(event.data),
111
110
  birthday,
112
111
  email,
@@ -130,7 +129,6 @@ export default function (request) {
130
129
  return {
131
130
  signUpData: {
132
131
  provider: 'phone',
133
- birthday,
134
132
  ...pickBindData(event.data),
135
133
  birthday,
136
134
  email,
@@ -153,7 +151,6 @@ export default function (request) {
153
151
  return {
154
152
  signUpData: {
155
153
  provider: 'email',
156
- birthday,
157
154
  ...pickBindData(event.data),
158
155
  birthday,
159
156
  email,
@@ -208,6 +205,10 @@ export default function (request) {
208
205
  acSource: hasExplicitAc ? 'signUpData' : acRead.from,
209
206
  }
210
207
 
208
+ // 因 client-pwa-cash PR #805 的問題,暫時註解此 Sentry 上報
209
+ // https://github.com/jetthai/client-pwa-cash/pull/805
210
+ // sentry?.captureMessage(`[SignUp] Authenticate Data: ${JSON.stringify(messages)}`, { level: 'info' })
211
+
211
212
  const referralObj = {}
212
213
  if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
213
214
  referralObj.ac = affiliateCode