ThirdwebSDK
The ThirdwebSDK
is the entry point to all functionality of the Unity SDK.
You initialize the SDK on your desired chain and use the instance to access the different methods and properties of the SDK.
Usage
Provide the name of a default chain, or your own custom RPC URL of any EVM-compatible blockchain to instantiate the SDK.
View default chains
- Ethereum:
"ethereum"
- Goerli:
"goerli"
- Polygon:
"polygon"
- Mumbai:
"mumbai"
- Arbitrum One:
"arbitrum"
- Arbitrum Goerli:
"arbitrum-goerli"
- Optimism:
"optimism"
- Optimism Goerli Testnet:
"optimism-goerli"
- Binance SmartChain:
"binance"
- Binance SmartChain Testnet:
"binance-testnet"
- Fantom Opera:
"fantom"
- Fantom Testnet:
"fantom-testnet"
- Avalanche C Chain:
"avalanche-fuji"
- Avalanche Fuji Testnet:
"avalanche-fuji-testnet"
- Localhost:
"localhost"
ThirdwebSDK sdk = new ThirdwebSDK("ethereum");
Configuration
chainOrRPC
The blockchain/network you want to instantiate the SDK on.
Provide the name of a default chain (see above), or your own custom RPC URL of any EVM-compatible blockchain.
ThirdwebSDK sdk = new ThirdwebSDK("my-rpc-url");
gaslessOptions
Use gasless transactions to forward all transactions to a relayer.
Currently supports either OpenZeppelin Defender or Biconomy relayers.
ThirdwebSDK sdk = new ThirdwebSDK("goerli", -1, new ThirdwebSDK.Options()
{
gasless = new ThirdwebSDK.GaslessOptions()
{
biconomy = new ThirdwebSDK.BiconomyOptions() {
apiId = "biconomy-api-id", // your Biconomy API Id
apiKey = "biconomy-api-key" // your Biconomy API Key
},
openzeppelin = new ThirdwebSDK.OZDefenderOptions()
{
relayerForwarderAddress = "0x...", // the OZ defender relayer address (defaults to the standard one)
relayerUrl ="open-zeppelin-forwarder-address" // your OZ Defender relayer URL
},
}
});
storageOptions
Override the default IPFS gateway URL to use your own.
ThirdwebSDK sdk = new ThirdwebSDK("goerli", -1, new ThirdwebSDK.Options()
{
storage = new ThirdwebSDK.StorageOptions()
{
ipfsGatewayUrl= "https://my-ipfs-gateway.com/ipfs/"
}
});
walletOptions
Add extra data to pass to the wallet provider.
ThirdwebSDK sdk = new ThirdwebSDK("goerli", -1, new ThirdwebSDK.Options()
{
wallet = new ThirdwebSDK.WalletOptions()
{
appName= "My App", // the app name that will show in different wallet providers
extras= new Dictionary<string, object>() // extra data to pass to the wallet provider
{
{ "foo", "bar" }
}
}
});