updateMetadata

parrams of updateMetadataParams -> storage with metadata, token_metadata upd

Entrypoint to update yToken token metadata info.

Types

type newMetadataParams is map(string, bytes)

type updateMetadataParams is [@layout:comb] record [
  tokenId               : nat;
  token_metadata        : newMetadataParams;
]

Usage

const tokenId = 0; // or new BigNumber(0) or "0"
const tokenMetadata = MichelsonMap.fromLiteral({
  symbol: Buffer.from("TST2").toString("hex"),
  name: Buffer.from("TEST2").toString("hex"),
  decimals: Buffer.from("6").toString("hex"),
  icon: Buffer.from("").toString("hex"),
});
const yupana = await tezos.contract.at(yTokenAddress);
const operation = await yupana.methods.updateMetadata(
    tokenId, 
    tokenMetadata
).send();
await operation.confirmation();

Errors

  • yToken/not-admin - sender is not contract admin.

Last updated