Table of Contents

Class EcosystemWallet

Namespace
Thirdweb
Assembly
Thirdweb.dll

Enclave based secure cross ecosystem wallet.

public class EcosystemWallet : PrivateKeyWallet, IThirdwebWallet
Inheritance
EcosystemWallet
Implements
Inherited Members
Extension Methods

Methods

Create(ThirdwebClient, string, string, string, string, AuthProvider, string, IThirdwebWallet)

public static Task<EcosystemWallet> Create(ThirdwebClient client, string ecosystemId, string ecosystemPartnerId = null, string email = null, string phoneNumber = null, AuthProvider authProvider = AuthProvider.Default, string storageDirectoryPath = null, IThirdwebWallet siweSigner = null)

Parameters

client ThirdwebClient
ecosystemId string
ecosystemPartnerId string
email string
phoneNumber string
authProvider AuthProvider
storageDirectoryPath string
siweSigner IThirdwebWallet

Returns

Task<EcosystemWallet>

Disconnect()

Disconnects the wallet (if using InAppWallet, clears session)

public override Task Disconnect()

Returns

Task

EthSign(byte[])

Signs a raw message using Ethereum's signing method.

public override Task<string> EthSign(byte[] rawMessage)

Parameters

rawMessage byte[]

The raw message to sign.

Returns

Task<string>

The signed message.

EthSign(string)

Signs a message using Ethereum's signing method.

public override Task<string> EthSign(string message)

Parameters

message string

The message to sign.

Returns

Task<string>

The signed message.

ExecuteTransaction(ThirdwebTransactionInput)

Sends a transaction and waits for its receipt.

public override Task<ThirdwebTransactionReceipt> ExecuteTransaction(ThirdwebTransactionInput transactionInput)

Parameters

transactionInput ThirdwebTransactionInput

Returns

Task<ThirdwebTransactionReceipt>

The transaction receipt.

GetAddress()

Gets the address of the wallet.

public override Task<string> GetAddress()

Returns

Task<string>

The wallet address.

GetEmail()

public string GetEmail()

Returns

string

GetLinkedAccounts()

Returns a list of linked accounts to the current wallet.

public override Task<List<LinkedAccount>> GetLinkedAccounts()

Returns

Task<List<LinkedAccount>>

A list of LinkedAccount objects.

GetPhoneNumber()

public string GetPhoneNumber()

Returns

string

IsConnected()

Checks if the wallet is connected.

public override Task<bool> IsConnected()

Returns

Task<bool>

True if connected, otherwise false.

LinkAccount(IThirdwebWallet, string, bool?, Action<string>, string, IThirdwebBrowser, BigInteger?, string, string)

Links a new account (auth method) to the current wallet. The current wallet must be connected and the wallet being linked must not be fully connected ie created.

public override Task<List<LinkedAccount>> LinkAccount(IThirdwebWallet walletToLink, string otp = null, bool? isMobile = null, Action<string> browserOpenAction = null, string mobileRedirectScheme = "thirdweb://", IThirdwebBrowser browser = null, BigInteger? chainId = null, string jwt = null, string payload = null)

Parameters

walletToLink IThirdwebWallet

The wallet to link.

otp string

The OTP code if the wallet to link is an email or phone wallet.

isMobile bool?

Set to true if linking OAuth on mobile.

browserOpenAction Action<string>

The action to open the browser if linking OAuth.

mobileRedirectScheme string

The redirect scheme if linking OAuth on mobile.

browser IThirdwebBrowser

The browser to use if linking OAuth.

chainId BigInteger?

The chain ID if linking an external wallet (SIWE).

jwt string

The JWT token if linking custom JWT auth.

payload string

The login payload if linking custom AuthEndpoint auth.

Returns

Task<List<LinkedAccount>>

A list of LinkedAccount objects.

LoginWithAuthEndpoint(string)

public Task<string> LoginWithAuthEndpoint(string payload)

Parameters

payload string

Returns

Task<string>

LoginWithGuest()

public Task<string> LoginWithGuest()

Returns

Task<string>

LoginWithJWT(string)

public Task<string> LoginWithJWT(string jwt)

Parameters

jwt string

Returns

Task<string>

LoginWithOauth(bool, Action<string>, string, IThirdwebBrowser, CancellationToken)

public Task<string> LoginWithOauth(bool isMobile, Action<string> browserOpenAction, string mobileRedirectScheme = "thirdweb://", IThirdwebBrowser browser = null, CancellationToken cancellationToken = default)

Parameters

isMobile bool
browserOpenAction Action<string>
mobileRedirectScheme string
browser IThirdwebBrowser
cancellationToken CancellationToken

Returns

Task<string>

LoginWithOtp(string)

public Task<string> LoginWithOtp(string otp)

Parameters

otp string

Returns

Task<string>

LoginWithSiwe(BigInteger)

public Task<string> LoginWithSiwe(BigInteger chainId)

Parameters

chainId BigInteger

Returns

Task<string>

PersonalSign(byte[])

Signs a raw message using personal signing.

public override Task<string> PersonalSign(byte[] rawMessage)

Parameters

rawMessage byte[]

The raw message to sign.

Returns

Task<string>

The signed message.

PersonalSign(string)

Signs a message using personal signing.

public override Task<string> PersonalSign(string message)

Parameters

message string

The message to sign.

Returns

Task<string>

The signed message.

SendOTP()

public Task<(bool isNewUser, bool isNewDevice)> SendOTP()

Returns

Task<(bool isNewUser, bool isNewDevice)>

SendTransaction(ThirdwebTransactionInput)

Sends a transaction.

public override Task<string> SendTransaction(ThirdwebTransactionInput transaction)

Parameters

transaction ThirdwebTransactionInput

The transaction to send.

Returns

Task<string>

The transaction hash.

SignTransaction(ThirdwebTransactionInput)

Signs a transaction.

public override Task<string> SignTransaction(ThirdwebTransactionInput transaction)

Parameters

transaction ThirdwebTransactionInput

The transaction to sign.

Returns

Task<string>

The signed transaction.

SignTypedDataV4(string)

Signs typed data (version 4).

public override Task<string> SignTypedDataV4(string json)

Parameters

json string

The JSON representation of the typed data.

Returns

Task<string>

The signed data.

SignTypedDataV4<T, TDomain>(T, TypedData<TDomain>)

Signs typed data (version 4).

public override Task<string> SignTypedDataV4<T, TDomain>(T data, TypedData<TDomain> typedData) where TDomain : IDomain

Parameters

data T

The data to sign.

typedData TypedData<TDomain>

The typed data.

Returns

Task<string>

The signed data.

Type Parameters

T

The type of the data.

TDomain

The type of the domain.