Table of Contents

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 ThirdwebClient

The Thirdweb client.

chainId BigInteger

The 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

method string

The RPC method name.

parameters object[]

The parameters for the RPC request.

Returns

Task<TResponse>

The RPC response.

Type Parameters

TResponse

The type of the response.

Exceptions

InvalidOperationException

Thrown if the response cannot be deserialized.