Getting Started

To get started with the Thirdweb .NET SDK, ensure you have .NET SDK installed on your machine.

We recommend using the latest stable version of .NET.

Integration Steps

  • .NET Package Installation

    Install the Thirdweb .NET SDK via NuGet package manager:

    dotnet add package Thirdweb

    This command adds the Thirdweb SDK to your project, allowing you to interact with the blockchain in your .NET applications.

  • Initialize Thirdweb Client

    Create a new instance of the Thirdweb client in your application:

    // For Frontend Applications
    var client = ThirdwebClient.Create(clientId: "yourClientId", bundleId: "yourBundleId");
    // For Backend Applications
    var client = ThirdwebClient.Create(secretKey: "yourSecretKey");

    Replace "yourClientId" and "yourBundleId" with your actual client ID and bundle ID. Note that a bundle ID is only required if you are not using the SDK from a web application.

  • Interact with Smart Contracts

    Now, you can start interacting with smart contracts. For example, to read from a contract:

    var contract = await ThirdwebContract.Create(client: client, address: "contractAddress", chain: chainId);
    var readResult = await ThirdwebContract.Read<string>(contract, "methodName");
    Console.WriteLine($"Contract read result: {readResult}");

    Replace "contractAddress", chainId, and "methodName" with your contract's address, the chain ID, and the method name you wish to call.

  • Explore Advanced Features

    Check the SDK documentation for more advanced features like interacting with smart wallets, signing messages, and performing transactions.

Usage in GoDot

If you would like to use the Thirdweb .NET SDK in a GoDot project, please refer to the link below.

GoDot Integration