Created
January 17, 2019 16:01
-
-
Save ezirmusitua/1a034cbb5104874e8c44dce1aaa75331 to your computer and use it in GitHub Desktop.
[Create EOS account] create EOS account with eosjs #javascript #node #blockchain #eos
This file contains hidden or 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
const config = { | |
chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906', | |
keyProvider: ['MY PRIVATE KEY'], | |
httpEndpoint: 'https://api.eosnewyork.io:443', | |
verbose: false, // API activity | |
broadcast: true, | |
sign: true, | |
expireInSeconds: 60 | |
} | |
// Create a client | |
const eos = Eos(config) | |
// Make a transaction to create a new account | |
eos.transaction(tr => { | |
tr.newaccount({ | |
creator: 'myaccount', | |
name: 'coworker's account', | |
owner: pubkey, | |
active: pubkey | |
}) | |
tr.buyrambytes({ | |
payer: 'myaccount', | |
receiver: 'coworker's account', | |
bytes: 8192 | |
}) | |
tr.delegatebw({ | |
from: 'myaccount', | |
receiver: 'coworker's account', | |
stake_net_quantity: '0.1000 EOS', | |
stake_cpu_quantity: '0.1000 EOS', | |
transfer: 0 | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment