-
Notifications
You must be signed in to change notification settings - Fork 1
/
updateAccount.js
42 lines (39 loc) · 1.06 KB
/
updateAccount.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';
const eosInstance = require('./eos-instance');
const myAccount = require('./myaccount');
const creator = myAccount.accountName;
const owner_pubkey = 'EOS8WWEv86zWADVyF66ibiwUW6zEN6D9Ao87rXj1LRwuZPKH35NSR'
const active_pubkey = 'EOS7yRrYEGvQ7cx7jUMwRSjR8YX5aqcgbHiYdcHJcXTHLWfWSh6NY'
eosInstance.transact({
actions: [{
account: 'eosio',
name: 'updateauth',
authorization: [{
actor: creator,
permission: 'active',
}],
data: {
account: creator,
permission: 'active',
parent: 'owner',
auth: {
"threshold": 1,
"keys": [{
"key": myAccount.publicKey.active,
"weight": 1
},{
"key": active_pubkey,
"weight": 1
}],
accounts: [],
waits:[]
}
}
}]
}, {
blocksBehind: 3,
expireSeconds: 30,
}).then(console.log)
.catch(e => {
console.error(e);
})