|
1 | | -import { Interface, isAddress, TransactionReceipt, ZeroAddress } from 'ethers' |
| 1 | +import { Interface, isAddress, toBeHex, TransactionReceipt, ZeroAddress } from 'ethers' |
2 | 2 |
|
3 | 3 | import { BUNDLER } from '../../consts/bundlers' |
4 | 4 | import { Hex } from '../../interfaces/hex' |
@@ -55,6 +55,8 @@ export interface SubmittedAccountOp extends AccountOp { |
55 | 55 | isSingletonDeploy?: boolean |
56 | 56 | identifiedBy: AccountOpIdentifiedBy |
57 | 57 | blockNumber?: number |
| 58 | + blockHash?: string |
| 59 | + gasUsed?: string |
58 | 60 | } |
59 | 61 |
|
60 | 62 | export function isIdentifiedByTxn(identifiedBy: AccountOpIdentifiedBy): boolean { |
@@ -150,7 +152,7 @@ export async function fetchTxnId( |
150 | 152 | const txnIds = identifiedBy.identifier.split('-') |
151 | 153 | return { |
152 | 154 | status: 'success', |
153 | | - txnId: txnIds[txnIds.length - 1] |
| 155 | + txnId: txnIds[txnIds.length - 1]! |
154 | 156 | } |
155 | 157 | } |
156 | 158 |
|
@@ -282,15 +284,27 @@ export function updateOpStatus( |
282 | 284 | if (opReference.identifiedBy.type === 'MultipleTxns') { |
283 | 285 | const callIndex = getMultipleBroadcastUnconfirmedCallOrLast(opReference).callIndex |
284 | 286 | // eslint-disable-next-line no-param-reassign |
285 | | - opReference.calls[callIndex].status = status |
| 287 | + opReference.calls[callIndex]!.status = status |
286 | 288 |
|
287 | 289 | // if there's a receipt, add the fee |
288 | 290 | if (receipt) { |
289 | 291 | // eslint-disable-next-line no-param-reassign |
290 | | - opReference.calls[callIndex].fee = { |
| 292 | + opReference.calls[callIndex]!.fee = { |
291 | 293 | inToken: ZeroAddress, |
292 | 294 | amount: receipt.fee |
293 | 295 | } |
| 296 | + |
| 297 | + // eslint-disable-next-line no-param-reassign |
| 298 | + opReference.calls[callIndex]!.blockHash = receipt.blockHash |
| 299 | + |
| 300 | + // eslint-disable-next-line no-param-reassign |
| 301 | + opReference.calls[callIndex]!.blockNumber = receipt.blockNumber |
| 302 | + |
| 303 | + // eslint-disable-next-line no-param-reassign |
| 304 | + opReference.calls[callIndex]!.blockHash = receipt.blockHash |
| 305 | + |
| 306 | + // eslint-disable-next-line no-param-reassign |
| 307 | + opReference.calls[callIndex]!.gasUsed = toBeHex(receipt.gasUsed) |
294 | 308 | } |
295 | 309 |
|
296 | 310 | if (callIndex === opReference.calls.length - 1) { |
|
0 commit comments