diff --git a/backend/mpc-system/services/service-party-app/src/pages/CoSignSession.tsx b/backend/mpc-system/services/service-party-app/src/pages/CoSignSession.tsx index f1ae52d7..db54abcf 100644 --- a/backend/mpc-system/services/service-party-app/src/pages/CoSignSession.tsx +++ b/backend/mpc-system/services/service-party-app/src/pages/CoSignSession.tsx @@ -130,11 +130,10 @@ export default function CoSignSession() { if (storedTxInfo) { try { const parsed = JSON.parse(storedTxInfo); - // 恢复 bigint 类型 + // 恢复 bigint 类型 (Legacy 交易使用 gasPrice) if (parsed.preparedTx) { parsed.preparedTx.gasLimit = BigInt(parsed.preparedTx.gasLimit); - parsed.preparedTx.maxFeePerGas = BigInt(parsed.preparedTx.maxFeePerGas); - parsed.preparedTx.maxPriorityFeePerGas = BigInt(parsed.preparedTx.maxPriorityFeePerGas); + parsed.preparedTx.gasPrice = BigInt(parsed.preparedTx.gasPrice); parsed.preparedTx.value = BigInt(parsed.preparedTx.value); } setTxInfo(parsed); diff --git a/backend/mpc-system/services/service-party-app/src/pages/Home.tsx b/backend/mpc-system/services/service-party-app/src/pages/Home.tsx index 24f0c8d3..ed72ee0a 100644 --- a/backend/mpc-system/services/service-party-app/src/pages/Home.tsx +++ b/backend/mpc-system/services/service-party-app/src/pages/Home.tsx @@ -293,8 +293,7 @@ export default function Home() { preparedTx: { ...preparedTx, gasLimit: preparedTx.gasLimit.toString(), - maxFeePerGas: preparedTx.maxFeePerGas.toString(), - maxPriorityFeePerGas: preparedTx.maxPriorityFeePerGas.toString(), + gasPrice: preparedTx.gasPrice.toString(), value: preparedTx.value.toString(), }, to: transferTo, diff --git a/backend/mpc-system/services/service-party-app/src/utils/transaction.ts b/backend/mpc-system/services/service-party-app/src/utils/transaction.ts index 714b99ca..d11483e9 100644 --- a/backend/mpc-system/services/service-party-app/src/utils/transaction.ts +++ b/backend/mpc-system/services/service-party-app/src/utils/transaction.ts @@ -50,21 +50,24 @@ export interface TransactionParams { /** * 准备好的交易 (包含所有必要字段) + * 使用 Legacy 交易格式 (Type 0),因为 KAVA 不支持 EIP-1559 */ export interface PreparedTransaction { chainId: number; nonce: number; - maxPriorityFeePerGas: bigint; - maxFeePerGas: bigint; + gasPrice: bigint; // Legacy 使用 gasPrice 而不是 maxFeePerGas gasLimit: bigint; to: string; value: bigint; data: string; - accessList: unknown[]; // 用于签名的哈希 signHash: string; // 原始交易数据 (用于签名后广播) rawTxForSigning: string; + // 为了兼容性保留这些字段 + maxPriorityFeePerGas?: bigint; + maxFeePerGas?: bigint; + accessList?: unknown[]; } /** @@ -392,7 +395,8 @@ export async function estimateGas(params: { from: string; to: string; value: str } /** - * 准备 EIP-1559 交易 + * 准备 Legacy 交易 (Type 0) + * KAVA 不支持 EIP-1559,所以使用 Legacy 格式 * 返回交易数据和待签名的哈希 */ export async function prepareTransaction(params: TransactionParams): Promise { @@ -400,9 +404,8 @@ export async function prepareTransaction(params: TransactionParams): Promise