@clonegod/ttd-bsc-common 3.0.22 → 3.0.23

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.
@@ -126,11 +126,16 @@ class AbstractDexTrade extends ttd_core_1.AbastrcatTrade {
126
126
  ttd_bsc_send_tx_1.BSC_EOA_ADDRESS._48CLUB,
127
127
  ttd_bsc_send_tx_1.BSC_EOA_ADDRESS.BLXR,
128
128
  ];
129
- const [signedMainTx, ...signedTips] = yield Promise.all([
129
+ const [rawMainTx, ...rawTips] = yield Promise.all([
130
130
  caller.signTransaction(mainTx),
131
131
  ...builderAddresses.map(addr => this.buildTipTransferTx(addr, transfer_amount_gwei, realGasPriceGwei, tipNonce, caller)),
132
132
  ]);
133
+ const ensure0x = (tx) => tx.startsWith('0x') ? tx : `0x${tx}`;
134
+ const signedMainTx = ensure0x(rawMainTx);
135
+ const signedTips = rawTips.map(ensure0x);
133
136
  txid = ethers_compat_1.ethersCompat.keccak256(signedMainTx);
137
+ (0, ttd_core_1.log_info)(`[debug] signedMainTx type=${typeof signedMainTx}, length=${signedMainTx.length}, prefix=${signedMainTx.substring(0, 10)}`);
138
+ (0, ttd_core_1.log_info)(`[debug] signedTips types=${signedTips.map(t => typeof t).join(',')}, lengths=${signedTips.map(t => t.length).join(',')}`);
134
139
  const tipTxMap = new Map();
135
140
  builderAddresses.forEach((addr, idx) => tipTxMap.set(addr, signedTips[idx]));
136
141
  (0, ttd_core_1.log_info)(`交易已签名`, { txid, nonce, caller: caller.address, gasPriceGwei: realGasPriceGwei }, order_trace_id);
@@ -198,12 +203,13 @@ class AbstractDexTrade extends ttd_core_1.AbastrcatTrade {
198
203
  from: wallet.address,
199
204
  to,
200
205
  value: ethers_compat_1.ethersCompat.parseUnits(real_transfer_amount_gwei, 'gwei'),
201
- gasLimit: 42000,
206
+ gasLimit: 21000,
202
207
  gasPrice: ethers_compat_1.ethersCompat.parseUnits(real_gas_price_gwei, 'gwei'),
203
208
  nonce,
204
209
  chainId: this.chainConfig.chainId
205
210
  };
206
- const signedTx = yield wallet.signTransaction(tx_data);
211
+ const rawSignedTx = yield wallet.signTransaction(tx_data);
212
+ const signedTx = rawSignedTx.startsWith('0x') ? rawSignedTx : `0x${rawSignedTx}`;
207
213
  (0, ttd_core_1.log_info)(`构建 tip 转账交易`, {
208
214
  to, nonce,
209
215
  tipGwei: real_transfer_amount_gwei,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-bsc-common",
3
- "version": "3.0.22",
3
+ "version": "3.0.23",
4
4
  "description": "BSC common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",