@@ -30,12 +30,12 @@ public class ThirdwebTransaction
3030{
3131 public ThirdwebTransactionInput Input { get ; }
3232
33- private readonly IThirdwebWallet _wallet ;
33+ internal readonly IThirdwebWallet Wallet ;
3434
3535 private ThirdwebTransaction ( IThirdwebWallet wallet , ThirdwebTransactionInput txInput )
3636 {
3737 this . Input = txInput ;
38- this . _wallet = wallet ;
38+ this . Wallet = wallet ;
3939 }
4040
4141 /// <summary>
@@ -215,7 +215,7 @@ public static async Task<TotalCosts> EstimateTotalCosts(ThirdwebTransaction tran
215215 /// <returns>The estimated gas price.</returns>
216216 public static async Task < BigInteger > EstimateGasPrice ( ThirdwebTransaction transaction , bool withBump = true )
217217 {
218- return await Utils . FetchGasPrice ( transaction . _wallet . Client , transaction . Input . ChainId . Value , withBump ) . ConfigureAwait ( false ) ;
218+ return await Utils . FetchGasPrice ( transaction . Wallet . Client , transaction . Input . ChainId . Value , withBump ) . ConfigureAwait ( false ) ;
219219 }
220220
221221 /// <summary>
@@ -226,10 +226,10 @@ public static async Task<BigInteger> EstimateGasPrice(ThirdwebTransaction transa
226226 /// <returns>The estimated maximum fee per gas and maximum priority fee per gas.</returns>
227227 public static async Task < ( BigInteger maxFeePerGas , BigInteger maxPriorityFeePerGas ) > EstimateGasFees ( ThirdwebTransaction transaction , bool withBump = true )
228228 {
229- var rpc = ThirdwebRPC . GetRpcInstance ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) ;
229+ var rpc = ThirdwebRPC . GetRpcInstance ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) ;
230230 var chainId = transaction . Input . ChainId . Value ;
231231
232- if ( await Utils . IsZkSync ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) )
232+ if ( await Utils . IsZkSync ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) )
233233 {
234234 var fees = await rpc . SendRequestAsync < JToken > ( "zks_estimateFee" , transaction . Input ) . ConfigureAwait ( false ) ;
235235 var maxFee = fees [ "max_fee_per_gas" ] . ToObject < HexBigInteger > ( ) . Value ;
@@ -238,7 +238,7 @@ public static async Task<BigInteger> EstimateGasPrice(ThirdwebTransaction transa
238238 }
239239 else
240240 {
241- return await Utils . FetchGasFees ( transaction . _wallet . Client , chainId , withBump ) . ConfigureAwait ( false ) ;
241+ return await Utils . FetchGasFees ( transaction . Wallet . Client , chainId , withBump ) . ConfigureAwait ( false ) ;
242242 }
243243 }
244244
@@ -249,7 +249,7 @@ public static async Task<BigInteger> EstimateGasPrice(ThirdwebTransaction transa
249249 /// <returns>The result of the simulation.</returns>
250250 public static async Task < string > Simulate ( ThirdwebTransaction transaction )
251251 {
252- var rpc = ThirdwebRPC . GetRpcInstance ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) ;
252+ var rpc = ThirdwebRPC . GetRpcInstance ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) ;
253253 return await rpc . SendRequestAsync < string > ( "eth_call" , transaction . Input , "latest" ) ;
254254 }
255255
@@ -260,8 +260,8 @@ public static async Task<string> Simulate(ThirdwebTransaction transaction)
260260 /// <returns>The estimated gas limit.</returns>
261261 public static async Task < BigInteger > EstimateGasLimit ( ThirdwebTransaction transaction )
262262 {
263- var rpc = ThirdwebRPC . GetRpcInstance ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) ;
264- var isZkSync = await Utils . IsZkSync ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) ;
263+ var rpc = ThirdwebRPC . GetRpcInstance ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) ;
264+ var isZkSync = await Utils . IsZkSync ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) ;
265265 BigInteger divider = isZkSync
266266 ? 7
267267 : transaction . Input . AuthorizationList == null
@@ -288,12 +288,12 @@ public static async Task<BigInteger> EstimateGasLimit(ThirdwebTransaction transa
288288 /// <returns>The nonce.</returns>
289289 public static async Task < BigInteger > GetNonce ( ThirdwebTransaction transaction )
290290 {
291- return await transaction . _wallet . GetTransactionCount ( chainId : transaction . Input . ChainId , blocktag : "pending" ) . ConfigureAwait ( false ) ;
291+ return await transaction . Wallet . GetTransactionCount ( chainId : transaction . Input . ChainId , blocktag : "pending" ) . ConfigureAwait ( false ) ;
292292 }
293293
294294 private static async Task < BigInteger > GetGasPerPubData ( ThirdwebTransaction transaction )
295295 {
296- var rpc = ThirdwebRPC . GetRpcInstance ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) ;
296+ var rpc = ThirdwebRPC . GetRpcInstance ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) ;
297297 var hex = ( await rpc . SendRequestAsync < JToken > ( "zks_estimateFee" , transaction . Input ) . ConfigureAwait ( false ) ) [ "gas_per_pubdata_limit" ] . ToString ( ) ;
298298 var finalGasPerPubData = new HexBigInteger ( hex ) . Value * 10 / 5 ;
299299 return finalGasPerPubData < 10000 ? 10000 : finalGasPerPubData ;
@@ -306,7 +306,7 @@ private static async Task<BigInteger> GetGasPerPubData(ThirdwebTransaction trans
306306 /// <returns>The signed transaction.</returns>
307307 public static async Task < string > Sign ( ThirdwebTransaction transaction )
308308 {
309- return await transaction . _wallet . SignTransaction ( transaction . Input ) . ConfigureAwait ( false ) ;
309+ return await transaction . Wallet . SignTransaction ( transaction . Input ) . ConfigureAwait ( false ) ;
310310 }
311311
312312 /// <summary>
@@ -362,31 +362,32 @@ public static async Task<string> Send(ThirdwebTransaction transaction)
362362 {
363363 transaction = await Prepare ( transaction ) . ConfigureAwait ( false ) ;
364364
365- var rpc = ThirdwebRPC . GetRpcInstance ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) ;
365+ var rpc = ThirdwebRPC . GetRpcInstance ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) ;
366366 string hash ;
367367
368- if ( await Utils . IsZkSync ( transaction . _wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) && transaction . Input . ZkSync . HasValue )
368+ if ( await Utils . IsZkSync ( transaction . Wallet . Client , transaction . Input . ChainId . Value ) . ConfigureAwait ( false ) && transaction . Input . ZkSync . HasValue )
369369 {
370370 var zkTx = await ConvertToZkSyncTransaction ( transaction ) . ConfigureAwait ( false ) ;
371- var zkTxSigned = await EIP712 . GenerateSignature_ZkSyncTransaction ( "zkSync" , "2" , transaction . Input . ChainId . Value , zkTx , transaction . _wallet ) . ConfigureAwait ( false ) ;
371+ var zkTxSigned = await EIP712 . GenerateSignature_ZkSyncTransaction ( "zkSync" , "2" , transaction . Input . ChainId . Value , zkTx , transaction . Wallet ) . ConfigureAwait ( false ) ;
372372 hash = await rpc . SendRequestAsync < string > ( "eth_sendRawTransaction" , zkTxSigned ) . ConfigureAwait ( false ) ;
373373 }
374374 else
375375 {
376- switch ( transaction . _wallet . AccountType )
376+ switch ( transaction . Wallet . AccountType )
377377 {
378378 case ThirdwebAccountType . PrivateKeyAccount :
379379 var signedTx = await Sign ( transaction ) ;
380380 hash = await rpc . SendRequestAsync < string > ( "eth_sendRawTransaction" , signedTx ) . ConfigureAwait ( false ) ;
381381 break ;
382382 case ThirdwebAccountType . SmartAccount :
383383 case ThirdwebAccountType . ExternalAccount :
384- hash = await transaction . _wallet . SendTransaction ( transaction . Input ) . ConfigureAwait ( false ) ;
384+ hash = await transaction . Wallet . SendTransaction ( transaction . Input ) . ConfigureAwait ( false ) ;
385385 break ;
386386 default :
387387 throw new NotImplementedException ( "Account type not supported" ) ;
388388 }
389389 }
390+ Utils . TrackTransaction ( transaction , hash ) ;
390391 return hash ;
391392 }
392393
@@ -398,7 +399,7 @@ public static async Task<string> Send(ThirdwebTransaction transaction)
398399 public static async Task < ThirdwebTransactionReceipt > SendAndWaitForTransactionReceipt ( ThirdwebTransaction transaction )
399400 {
400401 var txHash = await Send ( transaction ) . ConfigureAwait ( false ) ;
401- return await WaitForTransactionReceipt ( transaction . _wallet . Client , transaction . Input . ChainId . Value , txHash ) . ConfigureAwait ( false ) ;
402+ return await WaitForTransactionReceipt ( transaction . Wallet . Client , transaction . Input . ChainId . Value , txHash ) . ConfigureAwait ( false ) ;
402403 }
403404
404405 /// <summary>
0 commit comments