Ejemplo n.º 1
0
        private async Task <OperationResult <PushTransactionResults> > BulkTransfer(AccountDump[] accounts, CancellationToken token)
        {
            var actions = new BaseAction[accounts.Length];

            for (int i = 0; i < accounts.Length; i++)
            {
                var account = accounts[i];
                actions[i] = new TransferAction
                {
                    Account = TransferAction.ContractName,
                    Args    = new Transfer
                    {
                        From     = _login,
                        To       = account.AccountName,
                        Quantity = account.Airdrop,
                        Memo     = string.Empty
                    },
                    Authorization = new[]
                    {
                        new PermissionLevel
                        {
                            Actor      = _login,
                            Permission = "active"
                        }
                    }
                };
            }
            return(await Api.BroadcastActions(actions, _privateKeys, token));
        }