// here is a simple example, and we support more parametersvar config =newParticleConfig();config.ProjectId="7fa3e77f-9d07-4417-8e45-01560fef0eab";config.ClientKey="cRX26iCgKipWu6scQi6R8qWaP903EF3YsL3bxIym";config.AppId="4ca94b0e-74b9-4a5b-aad3-72ee1ed84793";var theme =newParticleTheme();theme.UiMode="dark";theme.DisplayWallet=true;theme.DisplayCloseButton=true;string language ="en";string chainName ="Ethereum";long chainId =5;/// Init method request 5 parameters/// config: Json string, required project id, client key and appId, could have more parameters, for more details, click here
ParticleSystem.Instance.Init(config.ToString(),theme.ToString(), language, chainName, chainId);
Login
// preferredAuthType: support email, phone and jwt.// account: required when jwt.var loginResult =awaitParticleSystem.Instance.Login(PreferredAuthType.email,"");Debug.Log($"Login result {loginResult}");
SignMessage
// In evm, request plain text, like "hello world", in solana, request base58 string.var signMessageResult =awaitParticleSystem.Instance.SignMessage("hello world");Debug.Log($"SignMessage result {signMessageResult}");
SignAndSendTransaction
// make a test transaction,// you need to update it parameters before trying.var transaction = ParticleSystem.Instance.MakeEvmTransaction("0x16380a03f21e5a5e339c15ba8ebe581d194e0db3", "0xA719d8C4C94C1a877289083150f8AB96AD0C6aa1", "0x",
"0x123123");var signMessageResult =awaitParticleSystem.Instance.SignAndSendTransaction(transaction);Debug.Log($"SignAndSendTransaction result {signMessageResult}");
SignTypedData
// only support evm// pass your typedDataV4 here.string typedDataV4 ="";var signMessageResult =awaitParticleSystem.Instance.SignTypedData(typedDataV4,SignTypedDataVersion.Default);Debug.Log($"SignTypedData result {signMessageResult}");
SignTransaction
// only support solana// pass your solana transaction here, request base58 string.string transaction ="";var signMessageResult =awaitParticleSystem.Instance.SignTransaction(transaction);Debug.Log($"SignTransaction result {signMessageResult}");
SignAllTransactions
// only support solana// pass your solana transactions here, request base58 string list.List<string> transactions =newList<string> { "" };var signMessageResult =awaitParticleSystem.Instance.SignAllTransactions(transactions);Debug.Log($"SignAllTransactions result {signMessageResult}");