Skip to main content

class Wallet

class Wallet
: public Thirdweb.Routable

Connect and Interact with a Wallet.

Summary

MembersTypeDescriptions
Walletfunction
ConnectfunctionConnect a user's wallet via a given wallet provider
DisconnectfunctionDisconnect the user's wallet
AuthenticatefunctionAuthenticate the user by signing a payload that can be used to securely identify users. See https://portal.thirdweb.com/auth
GetBalancefunctionGet the balance of the connected wallet
GetAddressfunctionGet the connected wallet address
IsConnectedfunctionCheck if a wallet is connected
GetChainIdfunctionGet the connected chainId
SwitchNetworkfunctionPrompt the connected wallet to switch to the giiven chainId
TransferfunctionTransfer currency to a given address
SignfunctionPrompt the connected wallet to sign the given message
RecoverAddressfunctionRecover the original wallet address that signed a message
SendRawTransactionfunctionSend a raw transaction from the connected wallet
FundWalletfunctionPrompt the user to fund their wallet using one of the thirdweb pay providers (defaults to Coinbase Pay).

Members

public inline Wallet()


public inline Task< string > Connect(WalletConnection? walletConnection)

Connect a user's wallet via a given wallet provider

Parameters

  • walletConnection The wallet provider and chainId to connect to. Defaults to the injected browser extension.

public inline Task Disconnect()

Disconnect the user's wallet


public inline async Task< LoginPayload>Authenticate(string domain)

Authenticate the user by signing a payload that can be used to securely identify users. See https://portal.thirdweb.com/auth

Parameters

  • domain The domain to authenticate to

public inline async Task< CurrencyValue>GetBalance(string currencyAddress)

Get the balance of the connected wallet

Parameters

  • currencyAddress Optional address of the currency to check balance of

public inline async Task< string > GetAddress()

Get the connected wallet address


public inline async Task< bool > IsConnected()

Check if a wallet is connected


public inline async Task< int > GetChainId()

Get the connected chainId


public inline async Task SwitchNetwork(int chainId)

Prompt the connected wallet to switch to the giiven chainId


public inline async Task< TransactionResult>Transfer(string to,string amount,string currencyAddress)

Transfer currency to a given address


public inline async Task< string > Sign(string message)

Prompt the connected wallet to sign the given message


public inline async Task< string > RecoverAddress(string message,string signature)

Recover the original wallet address that signed a message


public inline async Task< TransactionResult>SendRawTransaction(TransactionRequest transactionRequest)

Send a raw transaction from the connected wallet


public inline async Task FundWallet(FundWalletOptions options)

Prompt the user to fund their wallet using one of the thirdweb pay providers (defaults to Coinbase Pay).

Parameters

  • options The options like wallet address to fund, on which chain, etc