# Utils

#### func isTokenAmountPackable

```javascript
/**
* @param {string} amount
* @returns {boolean}
*/
isTokenAmountPackable(amount: string)
```

Checks whether the token amount can be packed (and thus used in the transaction)

#### func isFeeAmountPackable

```javascript
/**
* @param {string} fee
* @returns {boolean}
*/
isFeeAmountPackable(fee: string)
```

Checks whether the fee amount can be packed (and thus used in the transaction)

#### func closestPackableTransactionAmount

```javascript
/**
* @param {string} amount
* @returns {string}
*/
closestPackableTransactionAmount(amount: string)
```

Returns the closest possible packable token amount. Returned amount is always less or equal to the provided amount.

#### func closestPackableTransactionFee

```javascript
/**
* @param {string} fee
* @returns {string}
*/
closestPackableTransactionFee(fee: string)
```

Returns the closest possible packable fee amount. Returned amount is always less or equal to the provided amount.

#### Example

```javascript
let amount = "1234567899808787";
console.log("Original amount: " + amount);
console.assert(isTokenAmountPackable(amount) == false);
amount = wasm.closestPackableTransactionAmount(amount);
console.assert(isTokenAmountPackable(amount));
console.log("Converted amount: " + amount);
let fee = "10000567777";
console.log("Original fee: " + fee);
console.assert(isFeeAmountPackable(fee) == false);
fee = wasm.closestPackableTransactionFee(fee)
console.assert(isFeeAmountPackable(fee));
console.log("Converted fee: " + fee);
```


---

# 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.zk.link/developer/sdk/changelog-1/utils.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.
