public static void GetAbiJsonToBin() { string _code = "eosio.token", _action = "transfer", _memo = ""; TransferArgs _args = new TransferArgs() { from = "yatendra1", to = "yatendra1", quantity = "1.0000 EOS", memo = _memo }; var abiJsonToBin = chainAPI.GetAbiJsonToBin(_code, _action, _args); logger.Info("For code {0}, action {1}, args {2} and memo {3} recieved bin {4}", _code, _action, _args, _memo, abiJsonToBin.binargs); var abiBinToJson = chainAPI.GetAbiBinToJson(_code, _action, abiJsonToBin.binargs); logger.Info("Received args json {0}", JsonConvert.SerializeObject(abiBinToJson.args)); }
public Action GetActionObject(string actionName, string permissionActor, string permissionName, string code, object args) { //prepare action object Action action = new Action() { account = new AccountName(code), name = new ActionName(actionName), authorization = new[] { new EOSNewYork.EOSCore.Params.Authorization { actor = new AccountName(permissionActor), permission = new PermissionName(permissionName) } } }; //convert action arguments to binary and save it in action.datareturn await new EOS_Object<PushTransaction>(HOST).GetObjectsFromAPIAsync(new PushTransactionParam { packed_trx = Hex.ToString(packedTransaction), signatures = signatures, packed_context_free_data = string.Empty, compression = "none" }); var abiJsonToBin = chainAPI.GetAbiJsonToBin(code, actionName, args); action.data = new BinaryString(abiJsonToBin.binargs); return(action); }