The API and RPC examples for mintasset() in the main README.md are non-working as they don't match the API specs found in build/Actions/Explorer.js:19. Specifically, they are missing the authorized_minter parameter (second parameter in the list), and the final tokens_to_back parameter. Adding authorized_minter as the second parameter, and tokens_to_back as the final parameter in the examples fixes this. Also, it might be clarified that the call to mintasset only generates the action 'code' which then needs to be sent via eosjs or cleos.
// Use the generator to produce the actions
const actions = await (await api.action).mintasset(
[{actor: authorized_account, permission: permission}], authorized_account,
collection_name, schema_name, template, owner, immutableData, mutableData, []
);
// Then pass the actions to eosjs (or other library) to create the transaction:
let result = await eosjs.transact({actions: actions}, { blocksBehind: 3, expireSeconds: 30, });
The API and RPC examples for
mintasset()
in the mainREADME.md
are non-working as they don't match the API specs found in build/Actions/Explorer.js:19. Specifically, they are missing theauthorized_minter
parameter (second parameter in the list), and the finaltokens_to_back
parameter. Addingauthorized_minter
as the second parameter, andtokens_to_back
as the final parameter in the examples fixes this. Also, it might be clarified that the call tomintasset
only generates the action 'code' which then needs to be sent via eosjs or cleos.src/Actions/Explorer.ts:41
A proper "working" example might be: