> For the complete documentation index, see [llms.txt](https://docs.protocolink.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.protocolink.com/protocolink-sdk/api-sdk-interfaces/permit2.md).

# Permit2

In this section, we will introduce the Permit2 SDK interface, which provides developers with a convenient and efficient way to interact with the Permit2 protocol. These interfaces are related to pull token and are designed to be used easily and flexibly.

The following section will introduce the interfaces related to the Permit2 protocol, which can be accessed through the `api.protocols.permit2.` prefix.

## PullToken

The following code defines interfaces and functions related to the Permit2 pull token logic:

### Types

* **PullTokenFields**: A type that represents the fields required for the Permit2 pull token logic.

```typescript
interface PullTokenFields {
  input: {
    token: {
      chainId: number;
      address: string;
      decimals: number;
      symbol: string;
      name: string;
    };
    amount: string;
  };
}
```

* **PullTokenLogic**: An interface that extends the `Logic` interface and represents the Permit2 pull token logic. It includes the `rid`, and `fields` properties.

```typescript
interface PullTokenLogic {
  rid: string;
  fields: PullTokenFields;
}
```

### Functions

* **getPullTokenTokenList(chainId: number)**: An asynchronous function that retrieves the list of tokens supported by the Permit2 pull token logic on the specified `chainId`.
* **newPullTokenLogic(fields: PullTokenFields)**: A function that creates the Permit2 pull token logic data with the given `fields` object.

### Example Code

```typescript
import * as api from '@protocolink/api';
import * as logics from '@protocolink/logics';

const chainId = 1;

const tokenList = await api.protocols.permit2.getPullTokenTokenList(chainId);
const asset = tokenList[0];

const pullTokenLogic = await api.protocols.permit2.newPullTokenLogic({
  input: {
    token: asset,
    amount: '10',
  },
});
```


---

# 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:

```
GET https://docs.protocolink.com/protocolink-sdk/api-sdk-interfaces/permit2.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.
