fix(service-party-app): serialize BigInt to string for sessionStorage
BigInt cannot be serialized by JSON.stringify. Convert gasLimit, maxFeePerGas, maxPriorityFeePerGas, and value to strings before storing in sessionStorage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
879fc3a816
commit
b688b0176e
|
|
@ -288,13 +288,21 @@ export default function Home() {
|
|||
|
||||
if (result.success && result.sessionId) {
|
||||
// 保存交易信息到 sessionStorage,以便签名完成后使用
|
||||
sessionStorage.setItem(`tx_${result.sessionId}`, JSON.stringify({
|
||||
preparedTx,
|
||||
// 注意: BigInt 无法直接 JSON 序列化,需要转换为字符串
|
||||
const txToStore = {
|
||||
preparedTx: {
|
||||
...preparedTx,
|
||||
gasLimit: preparedTx.gasLimit.toString(),
|
||||
maxFeePerGas: preparedTx.maxFeePerGas.toString(),
|
||||
maxPriorityFeePerGas: preparedTx.maxPriorityFeePerGas.toString(),
|
||||
value: preparedTx.value.toString(),
|
||||
},
|
||||
to: transferTo,
|
||||
amount: transferAmount,
|
||||
from: transferShare.evmAddress,
|
||||
walletName: transferShare.walletName,
|
||||
}));
|
||||
};
|
||||
sessionStorage.setItem(`tx_${result.sessionId}`, JSON.stringify(txToStore));
|
||||
|
||||
// 关闭模态框并跳转到签名会话页面
|
||||
handleCloseTransfer();
|
||||
|
|
|
|||
Loading…
Reference in New Issue