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
ThirdwebClientecosystemId
stringecosystemPartnerId
stringemail
stringphoneNumber
stringauthProvider
AuthProviderstorageDirectoryPath
stringsiweSigner
IThirdwebWallet
Returns
Disconnect()
Disconnects the wallet (if using InAppWallet, clears session)
public override Task Disconnect()
Returns
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
EthSign(string)
Signs a message using Ethereum's signing method.
public override Task<string> EthSign(string message)
Parameters
message
stringThe message to sign.
Returns
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
GetEmail()
public string GetEmail()
Returns
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
IsConnected()
Checks if the wallet is connected.
public override Task<bool> IsConnected()
Returns
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
IThirdwebWalletThe wallet to link.
otp
stringThe 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
stringThe redirect scheme if linking OAuth on mobile.
browser
IThirdwebBrowserThe browser to use if linking OAuth.
chainId
BigInteger?The chain ID if linking an external wallet (SIWE).
jwt
stringThe JWT token if linking custom JWT auth.
payload
stringThe 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
LoginWithGuest()
public Task<string> LoginWithGuest()
Returns
LoginWithJWT(string)
public Task<string> LoginWithJWT(string jwt)
Parameters
jwt
string
Returns
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
boolbrowserOpenAction
Action<string>mobileRedirectScheme
stringbrowser
IThirdwebBrowsercancellationToken
CancellationToken
Returns
LoginWithOtp(string)
public Task<string> LoginWithOtp(string otp)
Parameters
otp
string
Returns
LoginWithSiwe(BigInteger)
public Task<string> LoginWithSiwe(BigInteger chainId)
Parameters
chainId
BigInteger
Returns
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
PersonalSign(string)
Signs a message using personal signing.
public override Task<string> PersonalSign(string message)
Parameters
message
stringThe message to sign.
Returns
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
ThirdwebTransactionInputThe transaction to send.
Returns
SignTransaction(ThirdwebTransactionInput)
Signs a transaction.
public override Task<string> SignTransaction(ThirdwebTransactionInput transaction)
Parameters
transaction
ThirdwebTransactionInputThe transaction to sign.
Returns
SignTypedDataV4(string)
Signs typed data (version 4).
public override Task<string> SignTypedDataV4(string json)
Parameters
json
stringThe JSON representation of the typed data.
Returns
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
TThe data to sign.
typedData
TypedData<TDomain>The typed data.
Returns
Type Parameters
T
The type of the data.
TDomain
The type of the domain.