pinknetworkx / atomicassets-js

NPM module to interact with the AtomicAssets NFT standard
MIT License
18 stars 21 forks source link

Typos in README.md examples missing authorized_minter parameter #13

Closed sbrendtro closed 2 years ago

sbrendtro commented 3 years ago

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.

src/Actions/Explorer.ts:41

    async mintasset( authorization: EosioAuthorizationObject[], authorized_minter: string, collection_name: string, schema_name: string, template_id: string, new_owner: string, immutable_data: object, mutable_data: object, tokens_to_back: string[] ): Promise<EosioActionObject[]> {

A proper "working" example might be:

// 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, });
fabian-emilius commented 2 years ago

fixed in new release