private async Task <AuthorizationAPIResult> OpenStandardAccountWithReceiveBlock(NewTransferAPIResult new_transfer_info) { var svcBlockResult = await _rpcClient.GetLastServiceBlockAsync(); if (svcBlockResult.ResultCode != APIResultCodes.Success) { throw new Exception("Unable to get latest service block."); } var openReceiveBlock = new OpenWithReceiveTransferBlock { AccountType = AccountTypes.Standard, AccountID = _accountId, ServiceHash = svcBlockResult.GetBlock().Hash, SourceHash = new_transfer_info.SourceHash, Balances = new Dictionary <string, long>(), Fee = 0, FeeType = AuthorizationFeeTypes.NoFee, FeeCode = LyraGlobal.OFFICIALTICKERCODE, NonFungibleToken = new_transfer_info.NonFungibleToken, VoteFor = null }; openReceiveBlock.Balances.Add(new_transfer_info.Transfer.TokenCode, new_transfer_info.Transfer.Amount.ToBalanceLong()); openReceiveBlock.InitializeBlock(null, _signer); //openReceiveBlock.Signature = Signatures.GetSignature(PrivateKey, openReceiveBlock.Hash); var result = await _rpcClient.ReceiveTransferAndOpenAccountAsync(openReceiveBlock); //PrintCon(string.Format("{0}> ", AccountName)); return(result); }
OpenWithReceiveTransferBlock CreateReceiveDiscountBlockOnAcc2(NonFungibleToken discount_token) { _OpenAccount2Block = new OpenWithReceiveTransferBlock { AccountID = AccountId2, AccountType = AccountTypes.Standard, ServiceHash = string.Empty, SourceHash = _SendTransferBlock.Hash, Fee = 0, FeeType = AuthorizationFeeTypes.NoFee, Balances = new Dictionary <string, decimal>() }; _OpenAccount2Block.Balances.Add("Custom.DISC", 50); if (discount_token != null) { _OpenAccount2Block.NonFungibleToken = discount_token; } _OpenAccount2Block.InitializeBlock(null, PrivateKey2, AccountId2); // _OpenAccountBlock.Signature = Signatures.GetSignature(PrivateKey2, _OpenAccountBlock.Hash); return(_OpenAccount2Block); }