Last active
November 11, 2019 16:19
-
-
Save gimre-xymcity/7bf980e0d8bc0d67b95e03ce8c30179d to your computer and use it in GitHub Desktop.
work in progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local utils = require('utils') | |
local c = catapult | |
local function generateRandomAccounts(num) | |
local accounts = {} | |
local generator = c.rng.HighEntropySource:new() | |
for i = 1, num do | |
table.insert(accounts, c.crypto.KeyPair.fromGenerator(generator)) | |
end | |
return accounts | |
end | |
local networkId = 0x90 | |
local accounts = generateRandomAccounts(10) | |
local seedKeyPair = c.crypto.KeyPair.fromString(seedAccountKey) | |
local seedPublicKey = seedKeyPair:publicKey() | |
local xemId = c.MosaicId.fromAlias('cat.currency'); | |
local transactions = {} | |
for _, account in pairs(accounts) do | |
local builder = c.sdk.TransferBuilder:new(networkId, seedPublicKey) | |
local pub = account:publicKey() | |
local address = c.publicKeyToAddress(pub, networkId); | |
io.write('alias.lua, address: ') | |
utils.dumpTbl(address) | |
local stringAddress = c.addressToString(address) | |
builder:setRecipient(address) | |
--builder:setMessage('hello ' .. stringAddress) | |
local msg = { 42, 84, 168, 80, 160, 64 } | |
builder:setMessage(msg) | |
builder:addMosaic(xemId, 1234000); | |
local tx = createSignedTransaction(builder, seedKeyPair) | |
table.insert(transactions, tx) | |
end | |
sendTransactions(transactions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment