> For the complete documentation index, see [llms.txt](https://docs.zkbob.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zkbob.com/implementation/client-library-sdk/account-less-mode-operations/transaction-constraints.md).

# Transaction Constraints

## <mark style="background-color:green;">Getting Pool Limits</mark>

Different privacy pools have different limits for deposit and withdraw operations. Limits can also depend on the user's `0x`-address (address can be whitelisted).

```typescript
async getLimits(address?: string, directRequest: boolean = false): Promise<PoolLimits>
```

### Parameters

* `address`:  An address to be used for evaluating limits. Zero-address is used if undefined.
* `directRequest`: Request limits from the pool contract when `true` (otherwise, request from the relayer node).

### Returns

`Promise` returns [PoolLimits](/implementation/client-library-sdk/common-types.md#pool-limits)

### Example

```typescript
const limits = await zkClient.getLimits('0x0ECD9494F9C1F98C07E5319273C75BEF6232E86D');
console.log(`You can deposit up to ${limits.deposit.total} BOB right now`);
```

## <mark style="background-color:green;">Minimum Transaction Amount</mark>

The transaction amount cannot be less than the return value. This is applicable for each transaction type (for multi-transfer tx each note is must meet this minimum value).

```typescript
async minTxAmount(): Promise<bigint>
```

### Returns

`Promise` returns minimum transaction amount in the pool dimension.

### Example

```typescript
const minTx = await zkClient.minTxAmount();
if (requestedAmount < minTx) {
    console.log(`Requested too small amount to transact!`);
}
```

## <mark style="background-color:green;">Maximum Supported Token Swap During Withdraw</mark>

Privacy pools have the optional ability to swap an amount of tokens to native coins during a withdraw transaction (typically to seed a wallet with native tokens for operations). The following method returns the maximum number of tokens that can be swapped to native coins.

```typescript
async maxSupportedTokenSwap(): Promise<bigint>
```

{% hint style="info" %}
The swap is unavailable if `maxSupportedTokenSwap` returns 0
{% endhint %}

### Returns

`Promise` returns maximum number of tokens available to swap to native coins (in the pool dimension).

### Example

```typescript
const maxSwap = await zkClient.maxSupportedTokenSwap();
if (maxSwap > 0n) {
    console.log(`Congrats! You can swap tokens to the native coins!`);
}
```


---

# 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.zkbob.com/implementation/client-library-sdk/account-less-mode-operations/transaction-constraints.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.
