Page cover image

Manage CPU/NET

  1. The following example shows how to stake CPU/NET Action and pass the created action to the Sign-Method of the previously initialized CloudWalletPlugin-Object.

// Stake CPU/NET using a session
async Task Stake(string amountToStakeCPU, string amountToStakeNET  )
{
    //Create an action object
    var action = new EosSharp.Core.Api.v1.Action()
    {
      account = "eosio",
      name = "delegatebw",
      authorization = new List<PermissionLevel>() { UiToolkitExample.LinkSession.Auth  },
      data = new Dictionary<string, object>
      {
              { "from", "............1" },
              { "receiver", "............1" },
    		      { "stake_cpu_quantity", amountToStakeCPU },
    		      { "stake_net_quantity", amountToStakeNET },
      }
    };
		
    // Sign with the action created
    _cloudWalletPlugin.Sign(new[] { action });
}

Last updated