WAX Unity Web3 Suite
AuthenticatorLibrary
AuthenticatorLibrary
  • Getting Started
  • Installation
    • WebGL Insatallation
  • Examples
    • Getting Started
      • Canvas Example
      • UIToolkit Example
    • User Data
    • Token Transfer
    • Transact
  • API Docs
    • Canvas
      • UnityCanvasUAL
    • UiToolkit
      • UnityUiToolkitUAL
      • AuthenticatorButtonItem
      • AuthenticatorsPanel
      • BasicControl
      • ScreenBase
      • Utils
    • Authenticators
      • Anchor
        • AnchorAuthenticator
        • AnchorUser
        • AnchorWalletConfig
      • WaxCloudWallet
        • WaxCloudWalletAuthenticator
        • WaxCloudWalletConfig
        • WaxCloudWalletUser
    • Authenticator
    • User
    • AuthenticatorResponse
    • ButtonStyle
    • Chain
    • Utils
    • RpcEndpoint
    • SignTransactionResponse
    • UALOptions
    • UalConstants
    • UalError
    • UnityUAL
Powered by GitBook
On this page
Edit on GitHub
  1. Examples

Token Transfer

PreviousUser DataNextTransact

Last updated 2 years ago

To perform a transfer action, do the following (ensure that you have a User member assigned as shown :

public async Task Transfer(string frmAcc, string toAcc, string qnty, string memo)
{
    var action = new EosSharp.Core.Api.v1.Action
    {
        account = "eosio.token",
        name = "transfer",
        authorization = new List<PermissionLevel>
        {
            new PermissionLevel()
            {
                actor =
                    "............1", // ............1 will be resolved to the signing accounts permission
                permission =
                    "............2" // ............2 will be resolved to the signing accounts authority
            }
        },

        data = new Dictionary<string, object>
        {
            {"from", frmAcc},
            {"to", toAcc},
            {"quantity", qnty},
            {"memo", memo}
        }
    };
    try
    {
        await user.SignTransaction(new[] {action});
    }
    catch (Exception e)
    {
        Debug.Log(e);
        throw;
    }
}
here
Page cover image