Skip to content

Commit 9ef0d3d

Browse files
committed
Add extension methods for sending transactions
Introduced Send and SendAndWaitForTransactionReceipt extension methods to ThirdwebTransaction, allowing transactions to be sent and awaited directly from the transaction object.
1 parent 098c1a6 commit 9ef0d3d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Thirdweb/Thirdweb.Extensions/ThirdwebExtensions.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,26 @@ public static string CreateCallData(this ThirdwebContract contract, string metho
3939
return data;
4040
}
4141

42+
/// <summary>
43+
/// Sends the transaction.
44+
/// </summary>
45+
/// <param name="transaction">The transaction.</param>
46+
/// <returns>The transaction hash.</returns>
47+
public static async Task<string> Send(this ThirdwebTransaction transaction)
48+
{
49+
return await ThirdwebTransaction.Send(transaction);
50+
}
51+
52+
/// <summary>
53+
/// Sends the transaction and waits for the transaction receipt.
54+
/// </summary>
55+
/// <param name="transaction">The transaction.</param>
56+
/// <returns>The transaction receipt.</returns>
57+
public static async Task<ThirdwebTransactionReceipt> SendAndWaitForTransactionReceipt(this ThirdwebTransaction transaction)
58+
{
59+
return await ThirdwebTransaction.SendAndWaitForTransactionReceipt(transaction);
60+
}
61+
4262
/// <summary>
4363
/// Reads data from the contract using the specified method.
4464
/// </summary>

0 commit comments

Comments
 (0)