Skip to main content

Encode Utilities

toHex#

Converts a big int to a hex string

toHex(
value: BigInt!
): String!

encodeRouteToPath#

Converts a route to a hex encoded path

encodeRouteToPath(
route: Route! # The v3 path to convert to an encoded path
exactOutput: Boolean! # Whether the route should be encoded in reverse, for making exact output swaps
): String!

encodePermit#

Encodes arguments and returns transaction calldata to call selfPermit or selfPermitAllowed on an instance of Uniswap's NonfungiblePositionManager contract: https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol

encodePermit(
token: Token!
options: PermitOptions!
): String!

encodeUnwrapWETH9#

Encodes arguments and returns transaction calldata to call unwrapWETH9 or unwrapWETH9WithFee on an instance of Uniswap's NonfungiblePositionManager contract: https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol

encodeUnwrapWETH9(
amountMinimum: BigInt!
recipient: String!
feeOptions: FeeOptions
): String!

encodeSweepToken#

Encodes arguments and returns transaction calldata to call sweepToken or sweepTokenWithFee on an instance of Uniswap's NonfungiblePositionManager contract: https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol

encodeSweepToken(
token: Token!
amountMinimum: BigInt!
recipient: String!
feeOptions: FeeOptions
): String!

encodeRefundETH#

Encodes arguments and returns transaction calldata to call refundEth on an instance of Uniswap's NonfungiblePositionManager contract: https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol

encodeRefundETH(
): String!

encodeMulticall#

Encodes multiple calldatas into a single calldata for making multiple calls in one transaction using a contract implementing the necessary interface, such as an instance of Uniswap's NonfungiblePositionManager contract: https://github.com/Uniswap/v3-periphery/blob/main/contracts/NonfungiblePositionManager.sol

encodeMulticall(
calldatas: String[]!
): String!