# Permits

### Sign a Permit and use in a query

```csharp
var permit = await secretClient.Permit.Sign(
    owner: wallet.Address,
    chainId: secretClient.ChainId,
    permitName: "test",
    allowedContracts: new string[] { contractAddress },
    permissions: new PermissionType[] {
        PermissionType.Owner,
        PermissionType.Balance
    });

var snip20Client = new SecretNET.Token.Snip20Client(secretClient); // SecretNET.Token 
var query = await snip20Client.Query.GetBalance(contractAddress, permit: permit, codeHash: permitContractCodeHash);
```

### Verify a Permit

```csharp
var permit = await secretClient.Permit.Sign(
    owner: wallet.Address,
    chainId: secretClient.ChainId,
    permitName: "test",
    allowedTokens: new string[] { "abcdef" },
    permissions: new PermissionType[] {
        PermissionType.Owner
    });

var result = secretClient.Permit.Verify(
  permit,
  wallet.Address,
  "abcdef",
  new PermissionType[] { PermissionType.Owner }
);
```


---

# 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.scrt.network/secret-network-documentation/development/example-contracts/tools-and-libraries/network-interaction-sdks/secret-net/snippets/permits.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.
