CloudWalletPlugin
Main-class wrapping CloudWallet functionallity in a Unity MonoBehaviour
Summary
Members | Descriptions |
---|---|
| Boolean signaling if the plugin was initialized |
| Boolean signaling if a User is logged in |
| String containing the AccountName of the logged-in User if a user is logged in |
| Event invoked when WaxJs was initialized |
| Event invoked when a User successfully logged in |
| Event invoked when a transaction was signed |
| Event invoked when a User logged out |
| Event invoked when an Error occured |
| Event invoked when CreateInfo was called successfully |
Members
public bool IsInitialized
Boolean signaling if the plugin was initialized
public bool IsLoggedIn
Boolean signaling if a User is logged in
public string Account
String containing the AccountName of the logged-in User if a user is logged in
Events
public Action<CloudWalletInitEvent> OnInit
Event invoked when WaxJs was initialized
Example:
public Action<CloudWalletLoginEvent> OnLoggedIn
Event invoked when a User successfully logged in
Example:
public Action<CloudWalletSignEvent> OnTransactionSigned
Event invoked when a transaction was signed
Example:
public Action<CloudWalletLogoutEvent> OnLoggedIn
Event invoked when a User logged out
Example:
public Action<CloudWalletErrorEvent> OnError
Event invoked when an Error occured
Example:
public Action<CloudWalletCreateInfoEvent> OnInfoCreated
Event invoked when CreateInfo was called successfully
Example:
Methods
public void InitializeWebGl(string rpcAddress, bool tryAutoLogin = true, string userAccount = null, string pubKeys = null, string apiSigner = null, string eosApiArgs = null, bool freeBandwidth = true, bool feeFallback = true, string verifyTx = null, string metricsUrl = null, bool returnTempAccounts = false)
Initialize the Cloud Wallet Plugin for WebGL, see WaxJs on Github
for more information
Has no Effect on other Build-Targets.
RECOMMENDED Way to use this Plugin
Example:
Parameters
rpcAddress
The WAX public node API endpoint URL you wish to connect to. RequiredtryAutoLogin
Always attempt to autologin when your dapp starts up. Default trueuserAccount
User account to start up with. OptionalpubKeys
Public keys for the userAccount manually specified above. Optional.apiSigner
Custom signing logic. Note that free bandwidth will not be provided to custom signers. Default OptionaleosApiArgs
Custom eosjs constructor arguments to use when instantiating eosjs. OptionalfreeBandwidth
Request bandwidth management from WAX. Default truefeeFallback
Add wax fee action if user exhausted their own bandwidth, the free boost. Default trueverifyTx
IGNOREDmetricsUrl
used by WAXIO to gather metrics about failed transaction, times it takes to load a transaction. Default OptionalreturnTempAccounts
using this flag will return temporary accounts or accounts that have signed up for a cloud wallet but not paid the introduction fee to get a blockchain account created. When this is set to true, using the doLogin function will return blockchain account name that may not exist in the blockchain but it will also return an extra boolean flag called isTemp. If this flag is true it is a temporary account, it does not exist in the blockchain yet. If this constructor option is false then only accounts which have been activated and have a blockchain account will be returned.
public void InitializeDesktop(uint localPort, string wcwSigningWebsiteUrl, bool hostLocalWebsite = true, string indexHtmlDataPath = null, string waxJsDataPath = null)
Initialize the Cloud Wallet Plugin for use on Desktops (Windows, MAC, Linux)
Has no Effect on other Build-Targets. Useful for local debugging.
USAGE NOT RECOMMENDED in Production as it uses a local HttpListener and works with Localhost instead of a real domain while usage of a real domain is supported but comes with security risks
Example:
Parameters
localPort
The Port to be used in the HttpListenerwcwSigningWebsiteUrl
NOT RECOMMENDED. Allows the Usage of a website/domain instead of localhost, website needs to contain the custom methods from the custom index.html to make Callbacks to the UnityClient. Choosing this options comes with great security risks. Optional.hostLocalWebsite
Default true - set to false if a website/domain should be used instead. Optional.indexHtmlDataPath
Allows to provide a custom path to the index.html to be hosted via the HttpListener on the local device. Optional.waxJsDataPath
Allows to provide a custom path to the waxjs.js-file to be hosted via the HttpListener on the local device. Optional.
public void InitializeMobile(uint localPort, string wcwSigningWebsiteUrl, bool hostLocalWebsite = true, string indexHtmlString = null, string waxJsString = null)
Initialize the Cloud Wallet Plugin for Mobile (Android, iOS)
Has no Effect on other Build-Targets. Useful for local debugging and as temporary Solution until Wax Cloud Wallet updates for a better and more secure integration are implemented.
USAGE NOT RECOMMENDED in Production as it uses a local HttpListener and works with Localhost instead of a real domain while usage of a real domain is supported but comes with security risks
Uses Android Chrome Custom Tabs and iOS SFSafariViewController to visualize the Interaction with the WAX Cloud Wallet.
UniversalSDK (Github-Link
Github-AssetStore-Link
) needs to be installed for Mobile support
Example:
Parameters
localPort
The Port to be used in the HttpListenerwcwSigningWebsiteUrl
NOT RECOMMENDED. Allows the Usage of a website/domain instead of localhost, website needs to contain the custom methods from the custom index.html to make Callbacks to the UnityClient. Choosing this options comes with great security risks. Optional.hostLocalWebsite
Default true - set to false if a website/domain should be used instead. Optional.indexHtmlString
Allows to provide a custom index.html-file as string to be hosted via the HttpListener on the local device. Needs to be provided as string due to encryption and compression on Mobile Devices. Optional.waxJsString
Allows to provide a custom waxjs.js-file as string to be hosted via the HttpListener on the local device. Needs to be provided as string due to encryption and compression on Mobile Devices. Optional.
Last updated