You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In depth tutorial for the Unity SDK on how to set up Metamask, how to get the results of your requests in a easy to follow structure and interactions with UI elements based on this (ex. Buttons become inactive when sending a transaction request, and display "Success" or "Fail" depending on how the transaction went)
Why it is needed
It's nearly impossible for a developer to reliably build features around this SDK without looking through a lot of code and trying to understand everything about how this SDK works. I know because I'm building an app that heavily relies on this SDK and it's been very difficult not having any official documentation that illustrates anything about how this SDK works and how to use it.
Possible implementation
Simple clear code examples of common use cases which include:
Setting up the metamask connection
Changing user's chain
Adding a new chain to metamask
Getting responses from sent transactions
Handling UI when sending multiple responses
Reliably restarting the connection in cases where the MM app becomes unresponsive
Handling exceptions and preventing crashes
Explaining how to prevent performance issues (memory leaks etc.)
Code sample
// Switch the user's chainboolSwitchChain(stringchainIdHex){varparameters=new{
chainId = chainIdHex
}varrequest=new{// standard json rpc method. do not change
method ="wallet_switchEthereumChain"params=new[]{parameters}}// make sure user has the chain in their walletvaraddChainRes=await AddChain(chainIdHex);// (example code, i know it doesnt work like this. I don't know how it actually works tho...)if(res.response.status =="rejected)
{return}
var res=await MetamaskUnity.Instance.Wallet.Request(request);return res.response.status !="rejected"}
The text was updated successfully, but these errors were encountered:
Feature Request
In depth tutorial for the Unity SDK on how to set up Metamask, how to get the results of your requests in a easy to follow structure and interactions with UI elements based on this (ex. Buttons become inactive when sending a transaction request, and display "Success" or "Fail" depending on how the transaction went)
Why it is needed
It's nearly impossible for a developer to reliably build features around this SDK without looking through a lot of code and trying to understand everything about how this SDK works. I know because I'm building an app that heavily relies on this SDK and it's been very difficult not having any official documentation that illustrates anything about how this SDK works and how to use it.
Possible implementation
Simple clear code examples of common use cases which include:
Code sample
The text was updated successfully, but these errors were encountered: