@clonegod/ttd-bsc-common 3.0.22 → 3.0.24
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,10 +126,13 @@ 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 [
|
|
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);
|
|
134
137
|
const tipTxMap = new Map();
|
|
135
138
|
builderAddresses.forEach((addr, idx) => tipTxMap.set(addr, signedTips[idx]));
|
|
@@ -198,12 +201,13 @@ class AbstractDexTrade extends ttd_core_1.AbastrcatTrade {
|
|
|
198
201
|
from: wallet.address,
|
|
199
202
|
to,
|
|
200
203
|
value: ethers_compat_1.ethersCompat.parseUnits(real_transfer_amount_gwei, 'gwei'),
|
|
201
|
-
gasLimit:
|
|
204
|
+
gasLimit: 21000,
|
|
202
205
|
gasPrice: ethers_compat_1.ethersCompat.parseUnits(real_gas_price_gwei, 'gwei'),
|
|
203
206
|
nonce,
|
|
204
207
|
chainId: this.chainConfig.chainId
|
|
205
208
|
};
|
|
206
|
-
const
|
|
209
|
+
const rawSignedTx = yield wallet.signTransaction(tx_data);
|
|
210
|
+
const signedTx = rawSignedTx.startsWith('0x') ? rawSignedTx : `0x${rawSignedTx}`;
|
|
207
211
|
(0, ttd_core_1.log_info)(`构建 tip 转账交易`, {
|
|
208
212
|
to, nonce,
|
|
209
213
|
tipGwei: real_transfer_amount_gwei,
|