@@ -2,6 +2,7 @@ import { Static } from "@sinclair/typebox";
2
2
import {
3
3
StaticJsonRpcBatchProvider ,
4
4
getDefaultGasOverrides ,
5
+ toEther ,
5
6
} from "@thirdweb-dev/sdk" ;
6
7
import { ERC4337EthersSigner } from "@thirdweb-dev/wallets/dist/declarations/src/evm/connectors/smart-wallet/lib/erc4337-signer" ;
7
8
import { ethers } from "ethers" ;
@@ -64,7 +65,7 @@ export const processTx = async () => {
64
65
service : "worker" ,
65
66
level : "info" ,
66
67
queueId : tx . queueId ,
67
- message : `Cancelled by user ` ,
68
+ message : `Cancelled` ,
68
69
} ) ;
69
70
continue ;
70
71
}
@@ -73,7 +74,7 @@ export const processTx = async () => {
73
74
service : "worker" ,
74
75
level : "info" ,
75
76
queueId : tx . queueId ,
76
- message : `Picked up by worker ` ,
77
+ message : `Processing ` ,
77
78
} ) ;
78
79
79
80
await updateTx ( {
@@ -163,7 +164,7 @@ export const processTx = async () => {
163
164
logger ( {
164
165
service : "worker" ,
165
166
level : "warn" ,
166
- message : `[Low Wallet Balance] [ ${ walletAddress } ] ${ message } ` ,
167
+ message : `[${ walletAddress } ] ${ message } ` ,
167
168
} ) ;
168
169
}
169
170
@@ -224,7 +225,25 @@ export const processTx = async () => {
224
225
...gasOverrides ,
225
226
} ) ;
226
227
227
- // TODO: Add debug/trace level info on transaction info
228
+ logger ( {
229
+ service : "worker" ,
230
+ level : "debug" ,
231
+ queueId : tx . queueId ,
232
+ message : `Populated` ,
233
+ data : {
234
+ nonce : txRequest . nonce ?. toString ( ) ,
235
+ gasLimit : txRequest . gasLimit ?. toString ( ) ,
236
+ gasPrice : txRequest . gasPrice
237
+ ? toEther ( txRequest . gasPrice )
238
+ : undefined ,
239
+ maxFeePerGas : txRequest . maxFeePerGas
240
+ ? toEther ( txRequest . maxFeePerGas )
241
+ : undefined ,
242
+ maxPriorityFeePerGas : txRequest . maxPriorityFeePerGas
243
+ ? toEther ( txRequest . maxPriorityFeePerGas )
244
+ : undefined ,
245
+ } ,
246
+ } ) ;
228
247
229
248
// TODO: We need to target specific cases
230
249
// Bump gas limit to avoid occasional out of gas errors
@@ -233,12 +252,19 @@ export const processTx = async () => {
233
252
: undefined ;
234
253
235
254
const signature = await signer . signTransaction ( txRequest ) ;
255
+ const rpcRequest = {
256
+ id : 0 ,
257
+ jsonrpc : "2.0" ,
258
+ method : "eth_sendRawTransaction" ,
259
+ params : [ signature ] ,
260
+ } ;
236
261
237
262
logger ( {
238
263
service : "worker" ,
239
264
level : "debug" ,
240
265
queueId : tx . queueId ,
241
- message : `Sending transaction to ${ provider . connection . url } ` ,
266
+ message : `Sending to ${ provider . connection . url } ` ,
267
+ data : rpcRequest ,
242
268
} ) ;
243
269
244
270
const res = await fetch ( provider . connection . url , {
@@ -251,14 +277,18 @@ export const processTx = async () => {
251
277
}
252
278
: { } ) ,
253
279
} ,
254
- body : JSON . stringify ( {
255
- id : 0 ,
256
- jsonrpc : "2.0" ,
257
- method : "eth_sendRawTransaction" ,
258
- params : [ signature ] ,
259
- } ) ,
280
+ body : JSON . stringify ( rpcRequest ) ,
260
281
} ) ;
261
282
const rpcResponse = ( await res . json ( ) ) as RpcResponse ;
283
+
284
+ logger ( {
285
+ service : "worker" ,
286
+ level : "debug" ,
287
+ queueId : tx . queueId ,
288
+ message : `Received response` ,
289
+ data : rpcResponse ,
290
+ } ) ;
291
+
262
292
rpcResponses . push ( {
263
293
queueId : tx . queueId ! ,
264
294
tx : txRequest ,
@@ -332,7 +362,7 @@ export const processTx = async () => {
332
362
service : "worker" ,
333
363
level : "warn" ,
334
364
queueId,
335
- message : `Failed to send ` ,
365
+ message : `Received error from RPC ` ,
336
366
error : res . error ,
337
367
} ) ;
338
368
0 commit comments