async function openAccount (tokenCreator ) {
try{
const result = await api.transact({
actions: [{
account: tokenCreator, //'eosio.token',
name: 'open', //'transfer',
authorization: [{
actor: tokenCreator, //'useraaaaaaaa',
permission: 'active',
}],
data: {
owner: newaccount,
symbol: 'DAN',
ram_payer: tokenCreator, //must be same as issuer
},
}]
}, {
broadcast: true,
blocksBehind: 3,
expireSeconds: 30,
});
console.dir(result);
}catch (e) {
console.log('\nCaught exception: ' + e);
if (e instanceof RpcError)
console.log(JSON.stringify(e.json, null, 2));}};
The above code is throwing error: Caught exception: Error: Invalid symbol
What is the valid symbol format? Already created token symbol (e.g. EOS) or some new token to be created. I tried both but it throws the same error. I even tried '1.0000 DAN'.
What to write in owner field of data, already existing account or a new account to be created?
Open : Allows ram_payer to create an account owner with zero balance for token symbol at the expense of ram_payer.
- At the expense of ram_payer means the EOS tokens of the ram_payer will be staked, right?
Please, guide me I'm a newbie. Thanks in advance.