# update\_token\_metadata

An entrypoint that updates LP token metadata. Also can add a new fields to an existing metadata.

### Call parameters

```pascaligo
type metadata_pair_t    is [@layout:comb] record [
  key                     : string;
  value                   : bytes;
]

type upd_tok_meta_t     is [@layout:comb] record [
  token_id                : token_id_t;
  token_info              : list(metadata_pair_t);
]
```

#### metadata\_pair\_t

<table><thead><tr><th>Field</th><th width="198.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>key</td><td>string</td><td>Metadata key</td></tr><tr><td>value</td><td>bytes</td><td>Metadata value</td></tr></tbody></table>

#### upd\_tok\_meta\_t

| Field       | Type                                        | Description         |
| ----------- | ------------------------------------------- | ------------------- |
| token\_id   | token\_id\_t (nat)                          | Token's (pool's) ID |
| token\_info | list([metadata\_pair\_t](#metadata_pair_t)) | Token's metadata    |

### Usage

{% tabs %}
{% tab title="🌮 Taquito" %}

```javascript
const dexCoreAddress = "KT1...";
const params = {
    token_id: 1,
    token_info: [
        {
           key: "name",
           value: Buffer.from("wWBTC/TEZ LP").toString("hex"),
        },
        {
           key: "new_field",
           value: Buffer.from("New value").toString("hex"),
        },
        ...
    ],
};
const dexCore = await tezos.contract.at(dexCoreAddress);
const operation = await dexCore.methodsObject.update_token_metadata(params).send();

await operation.confirmation();
```

{% endtab %}
{% endtabs %}

### Errors

* `108` - pair (pool) with the specified `token_id` not listed.
* `402` - `sender` of the transaction is not a manager.
* `412` - non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/entrypoints-overview/admin-entrypoints/update_token_metadata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
