@@ -335,6 +335,42 @@ Get the current gas price in wei.
335
335
BigInteger gasPrice = await AppKit .EVM .GetGasPriceAsync ();
336
336
```
337
337
338
+ ### Get Transaction Receipt
339
+
340
+ Get the receipt for a transaction by its hash. This method polls the blockchain until the transaction is confirmed or times out.
341
+
342
+ ``` csharp
343
+ // Basic usage - get receipt for a transaction
344
+ TransactionReceipt receipt = await AppKit .EVM .GetTransactionReceiptAsync (" 0x123..." );
345
+
346
+ Debug .Log ($" Transaction Hash: {receipt .TransactionHash }" );
347
+ Debug .Log ($" Block Hash: {receipt .BlockHash }" );
348
+ Debug .Log ($" Status: {(receipt .StatusSuccessful ? " Success" : " Failed" )}" );
349
+ Debug .Log ($" Gas Used: {receipt .GasUsed }" );
350
+
351
+ // With custom timeout (default is 3 minutes)
352
+ TransactionReceipt receipt = await AppKit .EVM .GetTransactionReceiptAsync (
353
+ " 0x123..." , // transaction hash
354
+ TimeSpan .FromSeconds (120 ) // custom timeout
355
+ );
356
+
357
+ // With custom timeout and polling interval (default polling is 12 seconds)
358
+ TransactionReceipt receipt = await AppKit .EVM .GetTransactionReceiptAsync (
359
+ " 0x123..." , // transaction hash
360
+ TimeSpan .FromSeconds (120 ), // custom timeout
361
+ TimeSpan .FromMilliseconds (500 ) // poll every 500ms
362
+ );
363
+
364
+ // With cancellation token for manual cancellation
365
+ using var cts = new CancellationTokenSource ();
366
+ TransactionReceipt receipt = await AppKit .EVM .GetTransactionReceiptAsync (
367
+ " 0x123..." , // transaction hash
368
+ TimeSpan .FromMinutes (3 ), // timeout
369
+ TimeSpan .FromSeconds (12 ), // polling interval
370
+ cts .Token // cancellation token
371
+ );
372
+ ```
373
+
338
374
### RPC Request
339
375
340
376
Make a direct RPC request to the blockchain node.
0 commit comments