批量处理上链交易时, 等待上一次交易确认再往下走

This commit is contained in:
CounterFire2023 2024-06-24 17:31:41 +08:00
parent ccfa3b599e
commit 18b07df824

View File

@ -123,7 +123,9 @@ class LPassportWallet {
if (action.type === orderbook.ActionType.TRANSACTION) {
const builtTx = await action.buildTransaction()
console.log(`Submitting ${action.purpose} transaction`)
await this.signer.sendTransaction(builtTx);
const res = await this.signer.sendTransaction(builtTx);
// console.log(res)
await this.web3Provider.waitForTransaction(res.hash)
}
// For an order to be created (and subsequently filled), Immutable needs a valid signature for the order data.
@ -197,7 +199,8 @@ class LPassportWallet {
if (action.type === orderbook.ActionType.TRANSACTION) {
const builtTx = await action.buildTransaction();
console.log(`Submitting ${action.purpose} transaction`);
await this.signer.sendTransaction(builtTx);
const res = await this.signer.sendTransaction(builtTx);
await this.web3Provider.waitForTransaction(res.hash)
}
}
}
@ -231,7 +234,8 @@ class LPassportWallet {
if (action.type === orderbook.ActionType.TRANSACTION) {
const builtTx = await action.buildTransaction();
console.log(`Submitting ${action.purpose} transaction`);
await this.signer.sendTransaction(builtTx);
const res = await this.signer.sendTransaction(builtTx);
await this.web3Provider.waitForTransaction(res.hash)
}
}
console.log(