setmeta.b - set token factory metadata uri and hash v1 ​
Allows a token manager to set metadata uri and hash for an existing token factory, see more details metadata
Technical Behavior ​
The required authorization is the token_factory_manager as the manager is responsible for updating the data.
token_factory_idis required and must exist.memovalue has a 256 byte limitationfactory_uriis required to have non-zero length
If factory has lock_hash set to true:
- Can change the
factory_uri, butfactory_hashmust remain unchanged
RAM usage ​
Adding meta_uris and meta_hash will consume certain bytes depend on how many data are added.
RAM usage is covered by eosio.nftram. But this action will fail if the unused RAM of eosio.nftram is less than or equal to 200MB.
If the RAM usage is exceed factory maximum pack size of 1920 bytes, action will fail.
Updating or remove meta data which result in no bytes is added, there will be no restriction.
Action Parameters ​
| Property Name | C++ Type | Javascript Type | Example |
|---|---|---|---|
| token_factory_id | uint64_t | number | 1 |
| memo | string | string | "hi" |
| factory_uri | string | string | "uri1" |
| factory_hash | checksum256 | string | "fbbf2217571b6dbe2fca75b0fd3aebb5b4e247bc89e235d4d09d014bb855d1c9" |
CLI - cleos ​
cleos push action eosio.nft.ft setmeta.b '[1, "updating", "uri1", "fbbf2217571b6dbe2fca75b0fd3aebb5b4e247bc89e235d4d09d014bb855d1c9"]' -p manager.acc@activeJavaScript - eosjs ​
await api.transact({
actions: [
{
account: 'eosio.nft.ft',
name: 'setmeta.b',
authorization: [{ actor: 'manager.acc', permission: 'active' }],
data: {
token_factory_id: 1,
memo: 'set meta',
factory_uri: 'uri1',
factory_hash: 'fbbf2217571b6dbe2fca75b0fd3aebb5b4e247bc89e235d4d09d014bb855d1c9',
},
},
],
});