Class ThirdwebRPC
- Namespace
- Thirdweb
- Assembly
- Thirdweb.dll
Represents the Thirdweb RPC client for sending requests and handling responses.
public class ThirdwebRPC : IDisposable
- Inheritance
-
ThirdwebRPC
- Implements
- Inherited Members
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetRpcInstance(ThirdwebClient, BigInteger)
Gets an instance of the ThirdwebRPC client for the specified ThirdwebClient and chain ID.
public static ThirdwebRPC GetRpcInstance(ThirdwebClient client, BigInteger chainId)
Parameters
client
ThirdwebClientThe Thirdweb client.
chainId
BigIntegerThe chain ID.
Returns
- ThirdwebRPC
An instance of the ThirdwebRPC client.
Exceptions
- ArgumentNullException
Thrown if the client is null.
- ArgumentException
Thrown if the chain ID is invalid.
SendRequestAsync<TResponse>(string, params object[])
Sends an RPC request asynchronously and returns the response.
public Task<TResponse> SendRequestAsync<TResponse>(string method, params object[] parameters)
Parameters
Returns
- Task<TResponse>
The RPC response.
Type Parameters
TResponse
The type of the response.
Exceptions
- InvalidOperationException
Thrown if the response cannot be deserialized.