> For the complete documentation index, see [llms.txt](https://docs.quipuswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/entrypoints-overview/permits-entrypoints/set_expiry.md).

# set\_expiry

An entrypoint that setups an expiry for a specific user's transfer permit or default expiry for all user's transfer permits. It fully implements [TZIP-017](https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-17/tzip-17.md).

### Call parameters

```pascaligo
type seconds_t          is nat

type blake2b_hash_t     is bytes

type set_expiry_t       is [@layout:comb] record [
  issuer                  : address;
  expiry                  : seconds_t;
  permit_hash             : option(blake2b_hash_t);
]
```

| Field        | Type                     | Description                  |
| ------------ | ------------------------ | ---------------------------- |
| issuer       | address                  | An issuer of a permit        |
| expiry       | seconds\_t (nat)         | Expiry for a permit to setup |
| permit\_hash | option(blake2b\_hash\_t) | Hash of a permit (optional)  |

### Usage

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

```javascript
const dexCoreAddress = "KT1...";
const dexCore = await tezos.contract.at(dexCoreAddress);
const hash = "...";
const params = {
    issuer: "tz1.../KT1...",
    expiry: 100, // in seconds
    permit_hash: hash, // or undefined, or null
};
const operation = await dexCore.methodsObject.set_expiry(params).send();

await operation.confirmation();
```

{% endtab %}
{% endtabs %}

### Errors

* `412` - non payable entrypoint (can't accept TEZ tokens during call of an entrypoint).
* `NOT_PERMIT_ISSUER` - a user is not an issuer of the permit.
* `EXPIRY_TOO_BIG` - expiry from parameters is bigger than maximum available expiry (`31 556 995 200` seconds or `1000` years).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.quipuswap.com/smart-contracts/dex-2.0/dexcore-contract/entrypoints-overview/permits-entrypoints/set_expiry.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
