Skip to main content

Open Modal

// Open default view
AppKit.OpenModal();

// Open network selection view
AppKit.OpenModal(ViewType.NetworkSearch);

// Open account view
AppKit.OpenModal(ViewType.Account);

Close Modal

AppKit.CloseModal();

Chain Actions

Set active chain

Note: The chain must be added to the list of supported chains in the AppKit configuration.
Chain newChain = ChainConstants.Chains.Ethereum;
await AppKit.NetworkController.ChangeActiveChainAsync(newChain);

Get active chain

Chain activeChain = AppKit.NetworkController.ActiveChain;

Account Actions

Get active account

// Get active account in CAIP-10 format
Account account = AppKit.Account;

// e.g. '0x12345...' on EVM chains or 'H3Q...' on Solana
Debug.Log(account.Address);

// e.g. 'eip155:1' or 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp'
Debug.Log(account.ChainId);

// e.g. 'eip155:1:0x12345...' or 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:H3Q...'
Debug.Log(account.AccountId);

Direct Wallet Connection

Connect directly to a specific wallet, bypassing the modal UI on native platforms.
// Connect directly to MetaMask, bypassing the modal UI
// On desktop, this opens a QR code with the MetaMask logo; some wallets will have a web wallet option too.
// Wallet ID from https://walletguide.walletconnect.network
await AppKit.ConnectAsync("c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96");

// Also works with unlisted wallets
await AppKit.ConnectAsync(new Wallet
{
    Name = "React Native Wallet",
    ImageUrl = "https://github.com/reown-com/reown-dotnet/blob/develop/media/wallet-rn.png?raw=true",
    MobileLink = "rn-web3wallet://"
});

Direct Social Login Connection

Connect directly to a social login provider (e.g. Google, Apple, X) without requiring the user to pick a provider in the modal UI.
// Connect directly to Google and await the connection
await SocialLogin.Google.ConnectAsync();

// Or simply open the provider without awaiting the connection
SocialLogin.Google.Open();

Disconnect

await AppKit.DisconnectAsync();

EVM Actions

Get Balance

Get the native token balance for an address.
BigInteger balance = await AppKit.Evm.GetBalanceAsync("0x123...");

Sign Message

Sign a message with the active account’s private key.
// Sign a string message
string signature = await AppKit.Evm.SignMessageAsync("Hello World");

// Sign raw bytes
byte[] rawMessage = System.Text.Encoding.UTF8.GetBytes("Hello World");
string signature = await AppKit.Evm.SignMessageAsync(rawMessage);

// Sign with specific address (optional)
string signature = await AppKit.Evm.SignMessageAsync("Hello World", "0x123...");

Sign Typed Data

Sign typed data following EIP-712 standard.
string typedData = "{ /* Your EIP-712 typed data structure */ }";
string signature = await AppKit.Evm.SignTypedDataAsync(typedData);

Verify Message Signature

Verify if a message was signed by a specific address.
// Basic verification
bool isValid = await AppKit.Evm.VerifyMessageSignatureAsync(
    "0x123...", // address
    "Hello World", // original message
    "0xabc..." // signature
);

// Using parameters object
var verifyMessageParams = new VerifyMessageSignatureParams
{
    Address = "0x123...",
    Message = "Hello World",
    Signature = "0xabc..."
};
bool isValid = await AppKit.Evm.VerifyMessageSignatureAsync(verifyMessageParams);

Verify Typed Data Signature

Verify if typed data was signed by a specific address.
// Basic verification
bool isValid = await AppKit.Evm.VerifyTypedDataSignatureAsync(
    "0x123...", // address
    "{ /* Your typed data */ }", // original typed data
    "0xabc..." // signature
);

// Using parameters object
var verifyTypedDataParams = new VerifyTypedDataSignatureParams
{
    Address = "0x123...",
    Data = "{ /* Your typed data */ }",
    Signature = "0xabc..."
};
bool isValid = await AppKit.Evm.VerifyTypedDataSignatureAsync(verifyTypedDataParams);

Read Contract

Read data from a smart contract (no gas required).
Note: Both JSON and human-readable ABI formats are supported. Human-readable ABI is more concise but JSON ABI may offer better performance.
// Using JSON ABI
string jsonAbi = "[ /* Your contract ABI */ ]";
string tokenSymbol = await AppKit.Evm.ReadContractAsync<string>(
    "0x123...", // contract address
    jsonAbi,
    "symbol" // method name
);

// Using human-readable ABI
string humanReadableAbi = "function symbol() view returns (string)";
string tokenSymbol = await AppKit.Evm.ReadContractAsync<string>(
    "0x123...", // contract address
    humanReadableAbi,
    "symbol" // method name
);

// With arguments
string balance = await AppKit.Evm.ReadContractAsync<string>(
    "0x123...", // contract address
    jsonAbi,
    "balanceOf", // method name
    new object[] { "0x456..." } // arguments
);

// Using parameters object
var readContractParams = new ReadContractParams
{
    ContractAddress = "0x123...",
    ContractAbi = jsonAbi,
    MethodName = "balanceOf",
    Arguments = new object[] { "0x456..." }
};
string balance = await AppKit.Evm.ReadContractAsync<string>(readContractParams);

Write Contract

Write data to a smart contract (requires gas).
Note: Both JSON and human-readable ABI formats are supported.
string contractAbi = "[ /* Your contract ABI */ ]";
// Or use human-readable ABI: "function transfer(address to, uint256 amount) returns (bool)"

// Basic write
string txHash = await AppKit.Evm.WriteContractAsync(
    "0x123...", // contract address
    contractAbi,
    "transfer", // method name
    "0x456...", // recipient
    1000 // amount
);

// Write with custom gas
string txHash = await AppKit.Evm.WriteContractAsync(
    "0x123...", // contract address
    contractAbi,
    "transfer", // method name
    gas: 100000, // custom gas limit
    "0x456...", // recipient
    1000 // amount
);

// Write with value and gas
string txHash = await AppKit.Evm.WriteContractAsync(
    "0x123...", // contract address
    contractAbi,
    "stake", // method name
    value: 1000000000000000000, // 1 ETH in wei
    gas: 100000,
    true // other arguments
);

// Using parameters object
var writeContractParams = new WriteContractParams
{
    ContractAddress = "0x123...",
    ContractAbi = contractAbi,
    MethodName = "transfer",
    Value = 0, // optional value in wei
    Gas = 100000, // optional gas limit
    Arguments = new object[] { "0x456...", 1000 }
};
string txHash = await AppKit.Evm.WriteContractAsync(writeContractParams);

Send Transaction

Send a native token transaction.
// Basic transaction
string txHash = await AppKit.Evm.SendTransactionAsync(
    "0x123...", // recipient address
    1000000000000000000, // 1 ETH in wei
    "0x" // optional data
);

// Using parameters object
var transactionParams = new SendTransactionParams
{
    AddressTo = "0x123...",
    Value = 1000000000000000000, // 1 ETH in wei
    Data = "0x" // optional data
};
string txHash = await AppKit.Evm.SendTransactionAsync(transactionParams);

Send Raw Transaction

Send a pre-signed transaction.
string txHash = await AppKit.Evm.SendRawTransactionAsync(
    "0x123..." // signed transaction data
);

Estimate Gas

Estimate gas required for a transaction.
// Estimate for native token transfer
BigInteger gasLimit = await AppKit.Evm.EstimateGasAsync(
    "0x123...", // recipient address
    1000000000000000000 // 1 ETH in wei
);

// Using parameters object for native transfer
var transferParams = new SendTransactionParams
{
    AddressTo = "0x123...",
    Value = 1000000000000000000, // 1 ETH in wei
    Data = "0x" // optional data
};
BigInteger gasLimit = await AppKit.Evm.EstimateGasAsync(transferParams);

// Estimate for contract interaction
string contractAbi = "[ /* Your contract ABI */ ]";
BigInteger gasLimit = await AppKit.Evm.EstimateGasAsync(
    "0x123...", // contract address
    contractAbi,
    "transfer", // method name
    0, // value in wei
    "0x456...", // method arguments
    1000
);

// Using parameters object for contract interaction
var contractGasParams = new WriteContractParams
{
    ContractAddress = "0x123...",
    ContractAbi = contractAbi,
    MethodName = "transfer",
    Value = 0, // optional value in wei
    Arguments = new object[] { "0x456...", 1000 }
};
BigInteger gasLimit = await AppKit.Evm.EstimateGasAsync(contractGasParams);

Get Gas Price

Get the current gas price in wei.
BigInteger gasPrice = await AppKit.Evm.GetGasPriceAsync();

Get Transaction Receipt

Get the receipt for a transaction by its hash. This method polls the blockchain until the transaction is confirmed or times out.
// Basic usage - get receipt for a transaction
TransactionReceipt receipt = await AppKit.Evm.GetTransactionReceiptAsync("0x123...");

Debug.Log($"Transaction Hash: {receipt.TransactionHash}");
Debug.Log($"Block Hash: {receipt.BlockHash}");
Debug.Log($"Status: {(receipt.StatusSuccessful ? "Success" : "Failed")}");
Debug.Log($"Gas Used: {receipt.GasUsed}");

// With custom timeout (default is 3 minutes)
TransactionReceipt receipt = await AppKit.Evm.GetTransactionReceiptAsync(
    "0x123...", // transaction hash
    TimeSpan.FromSeconds(120) // custom timeout
);

// With custom timeout and polling interval (default polling is 12 seconds)
TransactionReceipt receipt = await AppKit.Evm.GetTransactionReceiptAsync(
    "0x123...", // transaction hash
    TimeSpan.FromSeconds(120), // custom timeout
    TimeSpan.FromMilliseconds(500) // poll every 500ms
);

// With cancellation token for manual cancellation
using var cts = new CancellationTokenSource();
TransactionReceipt receipt = await AppKit.Evm.GetTransactionReceiptAsync(
    "0x123...", // transaction hash
    TimeSpan.FromMinutes(3), // timeout
    TimeSpan.FromSeconds(12), // polling interval
    cts.Token // cancellation token
);

RPC Request

Make a direct RPC request to the blockchain node.
// Get the latest block number
BigInteger blockNumber = await AppKit.Evm.RpcRequestAsync<BigInteger>("eth_blockNumber");

// Get transaction by hash
var transaction = await AppKit.Evm.RpcRequestAsync<object>("eth_getTransactionByHash", "0x123...");

// Call a custom method with multiple parameters
var result = await AppKit.Evm.RpcRequestAsync<object>("custom_method", param1, param2);

Solana Actions

Get Balance

Get the native token balance (in lamports) for a public key.
// Get balance for specific public key
BigInteger lamports = await AppKit.Solana.GetBalanceAsync("H3Q...");

// Or omit to use the active account's public key
BigInteger lamportsActive = await AppKit.Solana.GetBalanceAsync();

Sign Message

Sign a message with the active Solana account’s private key. Returns the signature as a base58 string.
// Sign a UTF-8 string
string signatureBase58 = await AppKit.Solana.SignMessageAsync("Hello Solana");

// Sign raw bytes
byte[] rawMessage = System.Text.Encoding.UTF8.GetBytes("Hello Solana");
string signatureBase58 = await AppKit.Solana.SignMessageAsync(rawMessage);

// Sign with a specific public key (optional)
string signatureBase58 = await AppKit.Solana.SignMessageAsync("Hello Solana", "H3Q...");

Verify Message Signature

Verify if a message was signed by a specific Solana public key.
bool isValid = await AppKit.Solana.VerifyMessageSignatureAsync(
    "Hello Solana", // original message
    signatureBase58, // base58 signature
    "H3Q...pubkey..." // public key (optional, defaults to active)
);

Sign Transaction

Sign a serialized transaction. Input should be the transaction encoded as base64. Returns the signature and the optional (re)serialized transaction.
// base64-encoded serialized transaction
string txBase64 = "AQAB...==";

SignTransactionResponse res = await AppKit.Solana.SignTransactionAsync(txBase64);

// Use results
UnityEngine.Debug.Log(res.Signature); // base58 signature
UnityEngine.Debug.Log(res.TransactionBase64); // signed tx (base64)

Sign All Transactions

Sign multiple serialized transactions at once. Inputs should be base64-encoded serialized transactions.
string[] txsBase64 = new[] { "AQAB...==", "BQAC...==" };
SignAllTransactionsResponse res = await AppKit.Solana.SignAllTransactionsAsync(txsBase64);

// Access signed transactions
foreach (var signed in res.TransactionsBase58)
{
    UnityEngine.Debug.Log(signed); // signed transaction (base58)
}

RPC Request

Make a direct Solana JSON-RPC request.
// Get current slot
long slot = await AppKit.Solana.RpcRequestAsync<long>("getSlot");

// Get balance via RPC (raw response object)
var balanceResponse = await AppKit.Solana.RpcRequestAsync<GetBalanceResponse>("getBalance", "H3Q...");

// Call a method with multiple parameters
var accountInfo = await AppKit.Solana.RpcRequestAsync<object>(
    "getAccountInfo",
    "H3Q...pubkey...",
    new { encoding = "jsonParsed" }
);
I