@panoptic-eng/sdk 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cow/index.js +3 -3
- package/dist/{cow-Cqw3sako.js → cow-C_SGXoWr.js} +2 -2
- package/dist/{cow-Cqw3sako.js.map → cow-C_SGXoWr.js.map} +1 -1
- package/dist/index.d.ts +696 -5907
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1393 -579
- package/dist/index.js.map +1 -1
- package/dist/irm-C7OUVANR.d.ts +5641 -0
- package/dist/irm-C7OUVANR.d.ts.map +1 -0
- package/dist/{irm-DF4NwYIY.js → irm-DNK3N7qk.js} +301 -3
- package/dist/irm-DNK3N7qk.js.map +1 -0
- package/dist/panoptic/v2/index.d.ts +12 -4
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +25 -10
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/{position-zqvENVuf.js → position-BK4a-Yyu.js} +2 -2
- package/dist/{position-zqvENVuf.js.map → position-BK4a-Yyu.js.map} +1 -1
- package/dist/{router-d09dxd-F.js → router-BZvOeloX.js} +90 -40
- package/dist/router-BZvOeloX.js.map +1 -0
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/uniswap/index.d.ts +118 -1
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +228 -4
- package/dist/uniswap/index.js.map +1 -0
- package/dist/{writes-CRjVFjMt.js → writes-DymnVbiE.js} +2 -2
- package/dist/{writes-CRjVFjMt.js.map → writes-DymnVbiE.js.map} +1 -1
- package/dist/zodiac/index.d.ts +444 -0
- package/dist/zodiac/index.d.ts.map +1 -0
- package/dist/zodiac/index.js +949 -0
- package/dist/zodiac/index.js.map +1 -0
- package/package.json +6 -1
- package/dist/irm-DF4NwYIY.js.map +0 -1
- package/dist/irm-zWjtffWA.d.ts +0 -85
- package/dist/irm-zWjtffWA.d.ts.map +0 -1
- package/dist/router-d09dxd-F.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PanopticError$1 as PanopticError, getBlockMeta, getPool$1 as getPool, submitWrite } from "./position-
|
|
2
|
-
import { encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, isAddressEqual, maxUint256, zeroAddress } from "viem";
|
|
1
|
+
import { PanopticError$1 as PanopticError, getBlockMeta, getPool$1 as getPool, submitWrite } from "./position-BK4a-Yyu.js";
|
|
2
|
+
import { BaseError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, isAddressEqual, maxUint256, zeroAddress } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/uniswap/v4/router/errors.ts
|
|
5
5
|
/**
|
|
@@ -56,6 +56,33 @@ var QuoterUnavailableError = class extends PanopticError {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/uniswap/v4/abis/universalRouter.ts
|
|
61
|
+
/**
|
|
62
|
+
* Minimal Universal Router ABI (only the `execute` overload we use).
|
|
63
|
+
* @module uniswap/v4/abis/universalRouter
|
|
64
|
+
*/
|
|
65
|
+
const universalRouterAbi = [{
|
|
66
|
+
type: "function",
|
|
67
|
+
name: "execute",
|
|
68
|
+
stateMutability: "payable",
|
|
69
|
+
inputs: [
|
|
70
|
+
{
|
|
71
|
+
name: "commands",
|
|
72
|
+
type: "bytes"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "inputs",
|
|
76
|
+
type: "bytes[]"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "deadline",
|
|
80
|
+
type: "uint256"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
outputs: []
|
|
84
|
+
}];
|
|
85
|
+
|
|
59
86
|
//#endregion
|
|
60
87
|
//#region src/uniswap/v4/addresses.ts
|
|
61
88
|
/**
|
|
@@ -95,33 +122,6 @@ function getUniswapV4Addresses(chainId, overrides) {
|
|
|
95
122
|
return merged;
|
|
96
123
|
}
|
|
97
124
|
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/uniswap/v4/abis/universalRouter.ts
|
|
100
|
-
/**
|
|
101
|
-
* Minimal Universal Router ABI (only the `execute` overload we use).
|
|
102
|
-
* @module uniswap/v4/abis/universalRouter
|
|
103
|
-
*/
|
|
104
|
-
const universalRouterAbi = [{
|
|
105
|
-
type: "function",
|
|
106
|
-
name: "execute",
|
|
107
|
-
stateMutability: "payable",
|
|
108
|
-
inputs: [
|
|
109
|
-
{
|
|
110
|
-
name: "commands",
|
|
111
|
-
type: "bytes"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: "inputs",
|
|
115
|
-
type: "bytes[]"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "deadline",
|
|
119
|
-
type: "uint256"
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
outputs: []
|
|
123
|
-
}];
|
|
124
|
-
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/uniswap/v4/router/encodeSwap.ts
|
|
127
127
|
/** Universal Router command byte for a v4 swap. */
|
|
@@ -140,7 +140,7 @@ const SWAP_EXACT_OUT_SINGLE = 8;
|
|
|
140
140
|
const SWEEP = 4;
|
|
141
141
|
/** v4 sentinel: take the full positive currency delta (used with TAKE). */
|
|
142
142
|
const OPEN_DELTA = 0n;
|
|
143
|
-
const UINT128_MAX$
|
|
143
|
+
const UINT128_MAX$2 = (1n << 128n) - 1n;
|
|
144
144
|
const poolKeyComponents = [
|
|
145
145
|
{
|
|
146
146
|
name: "currency0",
|
|
@@ -251,7 +251,7 @@ const sweepParamsAbi = [
|
|
|
251
251
|
}
|
|
252
252
|
];
|
|
253
253
|
function assertUint128(amount) {
|
|
254
|
-
if (amount < 0n || amount > UINT128_MAX$
|
|
254
|
+
if (amount < 0n || amount > UINT128_MAX$2) throw new AmountExceedsUint128Error(amount);
|
|
255
255
|
}
|
|
256
256
|
/**
|
|
257
257
|
* Encode the input for a Universal Router `SWEEP` command that forwards the
|
|
@@ -737,11 +737,11 @@ async function resolveSwapRoute(params) {
|
|
|
737
737
|
|
|
738
738
|
//#endregion
|
|
739
739
|
//#region src/uniswap/v4/router/quote.ts
|
|
740
|
-
const BPS_DENOMINATOR = 10000n;
|
|
741
|
-
const UINT128_MAX = (1n << 128n) - 1n;
|
|
740
|
+
const BPS_DENOMINATOR$1 = 10000n;
|
|
741
|
+
const UINT128_MAX$1 = (1n << 128n) - 1n;
|
|
742
742
|
/** Reject out-of-range slippage so the min/max amount math can't underflow/overflow. */
|
|
743
743
|
function assertSlippageBps(slippageBps) {
|
|
744
|
-
if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`);
|
|
744
|
+
if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR$1) throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`);
|
|
745
745
|
}
|
|
746
746
|
const FALLBACK_META = {
|
|
747
747
|
blockNumber: 0n,
|
|
@@ -758,7 +758,7 @@ const FALLBACK_META = {
|
|
|
758
758
|
async function quoteSwapExactInViaRouter(params) {
|
|
759
759
|
const { client, poolAddress, chainId, tokenIn, amountIn, slippageBps, blockNumber, addresses } = params;
|
|
760
760
|
try {
|
|
761
|
-
if (amountIn < 0n || amountIn > UINT128_MAX) throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`);
|
|
761
|
+
if (amountIn < 0n || amountIn > UINT128_MAX$1) throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`);
|
|
762
762
|
assertSlippageBps(slippageBps);
|
|
763
763
|
const targetBlockNumber = blockNumber ?? await client.getBlockNumber();
|
|
764
764
|
const metaPromise = getBlockMeta({
|
|
@@ -793,7 +793,7 @@ async function quoteSwapExactInViaRouter(params) {
|
|
|
793
793
|
}]
|
|
794
794
|
});
|
|
795
795
|
const [amountOut, gasEstimate] = result;
|
|
796
|
-
const amountOutMinimum = amountOut * (BPS_DENOMINATOR - slippageBps) / BPS_DENOMINATOR;
|
|
796
|
+
const amountOutMinimum = amountOut * (BPS_DENOMINATOR$1 - slippageBps) / BPS_DENOMINATOR$1;
|
|
797
797
|
const _meta = await metaPromise;
|
|
798
798
|
return {
|
|
799
799
|
success: true,
|
|
@@ -826,7 +826,7 @@ async function quoteSwapExactInViaRouter(params) {
|
|
|
826
826
|
async function quoteSwapExactOutViaRouter(params) {
|
|
827
827
|
const { client, poolAddress, chainId, tokenIn, amountOut, slippageBps, blockNumber, addresses } = params;
|
|
828
828
|
try {
|
|
829
|
-
if (amountOut < 0n || amountOut > UINT128_MAX) throw new PanopticError(`amountOut ${amountOut} exceeds uint128 maximum`);
|
|
829
|
+
if (amountOut < 0n || amountOut > UINT128_MAX$1) throw new PanopticError(`amountOut ${amountOut} exceeds uint128 maximum`);
|
|
830
830
|
assertSlippageBps(slippageBps);
|
|
831
831
|
const targetBlockNumber = blockNumber ?? await client.getBlockNumber();
|
|
832
832
|
const metaPromise = getBlockMeta({
|
|
@@ -861,7 +861,7 @@ async function quoteSwapExactOutViaRouter(params) {
|
|
|
861
861
|
}]
|
|
862
862
|
});
|
|
863
863
|
const [amountIn, gasEstimate] = result;
|
|
864
|
-
const amountInMaximum = (amountIn * (BPS_DENOMINATOR + slippageBps) + BPS_DENOMINATOR - 1n) / BPS_DENOMINATOR;
|
|
864
|
+
const amountInMaximum = (amountIn * (BPS_DENOMINATOR$1 + slippageBps) + BPS_DENOMINATOR$1 - 1n) / BPS_DENOMINATOR$1;
|
|
865
865
|
const _meta = await metaPromise;
|
|
866
866
|
return {
|
|
867
867
|
success: true,
|
|
@@ -885,6 +885,56 @@ async function quoteSwapExactOutViaRouter(params) {
|
|
|
885
885
|
}
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
+
//#endregion
|
|
889
|
+
//#region src/uniswap/v4/router/quoteByPoolKey.ts
|
|
890
|
+
const BPS_DENOMINATOR = 10000n;
|
|
891
|
+
const UINT128_MAX = (1n << 128n) - 1n;
|
|
892
|
+
/**
|
|
893
|
+
* Quote an exact-in v4 swap for a specific PoolKey. Returns `null` when the
|
|
894
|
+
* quote reverts (pool missing / no liquidity) so callers can skip that pool when
|
|
895
|
+
* ranking venues rather than aborting the cycle.
|
|
896
|
+
*/
|
|
897
|
+
async function quoteV4ExactInByPoolKey(params) {
|
|
898
|
+
const { client, chainId, poolKey, zeroForOne, amountIn, slippageBps, blockNumber } = params;
|
|
899
|
+
if (amountIn < 0n || amountIn > UINT128_MAX) throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`);
|
|
900
|
+
if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`);
|
|
901
|
+
const { v4Quoter } = getUniswapV4Addresses(chainId, params.addresses);
|
|
902
|
+
try {
|
|
903
|
+
const { result } = await client.simulateContract({
|
|
904
|
+
address: v4Quoter,
|
|
905
|
+
abi: v4QuoterAbi,
|
|
906
|
+
functionName: "quoteExactInputSingle",
|
|
907
|
+
blockNumber,
|
|
908
|
+
args: [{
|
|
909
|
+
poolKey: {
|
|
910
|
+
currency0: poolKey.currency0,
|
|
911
|
+
currency1: poolKey.currency1,
|
|
912
|
+
fee: Number(poolKey.fee),
|
|
913
|
+
tickSpacing: Number(poolKey.tickSpacing),
|
|
914
|
+
hooks: poolKey.hooks
|
|
915
|
+
},
|
|
916
|
+
zeroForOne,
|
|
917
|
+
exactAmount: amountIn,
|
|
918
|
+
hookData: "0x"
|
|
919
|
+
}]
|
|
920
|
+
});
|
|
921
|
+
const [amountOut, gasEstimate] = result;
|
|
922
|
+
const amountOutMinimum = amountOut * (BPS_DENOMINATOR - slippageBps) / BPS_DENOMINATOR;
|
|
923
|
+
return {
|
|
924
|
+
amountOut,
|
|
925
|
+
amountOutMinimum,
|
|
926
|
+
gasEstimate
|
|
927
|
+
};
|
|
928
|
+
} catch (err) {
|
|
929
|
+
if (isRevert(err)) return null;
|
|
930
|
+
throw err;
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
/** True only for genuine contract reverts (missing pool / no liquidity). */
|
|
934
|
+
function isRevert(err) {
|
|
935
|
+
return err instanceof BaseError && err.walk((e) => e instanceof ContractFunctionRevertedError) instanceof ContractFunctionRevertedError;
|
|
936
|
+
}
|
|
937
|
+
|
|
888
938
|
//#endregion
|
|
889
939
|
//#region src/uniswap/v4/router/swap.ts
|
|
890
940
|
/** Default swap deadline window (30 minutes) when no deadline is provided. */
|
|
@@ -1008,5 +1058,5 @@ async function swapExactOutViaRouterAndWait(params) {
|
|
|
1008
1058
|
}
|
|
1009
1059
|
|
|
1010
1060
|
//#endregion
|
|
1011
|
-
export { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, PERMIT2_ADDRESS, QuoterUnavailableError, SETTLE_ALL, SWAP_EXACT_IN_SINGLE, SWAP_EXACT_OUT_SINGLE, SWEEP, TAKE_ALL, UNISWAP_V4_ADDRESSES, UnsupportedChainError, V4_SWAP, approveErc20ForPermit2, approveErc20ForPermit2AndWait, approveRouterViaPermit2, approveRouterViaPermit2AndWait, buildV4ExactOutSwapExecuteArgs, buildV4ExactOutSwapExecuteCalldata, buildV4SwapExecuteArgs, buildV4SwapExecuteCalldata, checkRouterApproval, getUniswapV4Addresses, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, resolveSwapRoute, swapExactInViaRouter, swapExactInViaRouterAndWait, swapExactOutViaRouter, swapExactOutViaRouterAndWait };
|
|
1012
|
-
//# sourceMappingURL=router-
|
|
1061
|
+
export { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, PERMIT2_ADDRESS, QuoterUnavailableError, SETTLE_ALL, SWAP_EXACT_IN_SINGLE, SWAP_EXACT_OUT_SINGLE, SWEEP, TAKE_ALL, UNISWAP_V4_ADDRESSES, UnsupportedChainError, V4_SWAP, approveErc20ForPermit2, approveErc20ForPermit2AndWait, approveRouterViaPermit2, approveRouterViaPermit2AndWait, buildV4ExactOutSwapExecuteArgs, buildV4ExactOutSwapExecuteCalldata, buildV4SwapExecuteArgs, buildV4SwapExecuteCalldata, checkRouterApproval, getUniswapV4Addresses, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, quoteV4ExactInByPoolKey, resolveSwapRoute, swapExactInViaRouter, swapExactInViaRouterAndWait, swapExactOutViaRouter, swapExactOutViaRouterAndWait, universalRouterAbi };
|
|
1062
|
+
//# sourceMappingURL=router-BZvOeloX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-BZvOeloX.js","names":["chainId: bigint","cause?: Error","token: Address","currency0: Address","currency1: Address","amount: bigint","PERMIT2_ADDRESS: Address","UNISWAP_V4_ADDRESSES: Record<number, UniswapV4Addresses>","chainId: bigint","overrides?: Partial<UniswapV4Addresses>","merged: Partial<UniswapV4Addresses>","UINT128_MAX","amount: bigint","recipient: Address","tokenOut: Address","recipient: Address | undefined","nativeAmount: bigint","erc20Amount: bigint","args: BuildV4SwapCalldataArgs","args: BuildV4ExactOutSwapCalldataArgs","commandList: number[]","inputs: Hex[]","params: CheckRouterApprovalParams","params: ApproveErc20ForPermit2Params","params: ApproveRouterViaPermit2Params","params: ResolveSwapRouteParams","BPS_DENOMINATOR","UINT128_MAX","slippageBps: bigint","params: QuoteSwapExactInViaRouterParams","params: QuoteSwapExactOutViaRouterParams","params: QuoteV4ExactInByPoolKeyParams","err: unknown","params: SwapExactInViaRouterParams","params: SwapExactOutViaRouterParams"],"sources":["../src/uniswap/v4/router/errors.ts","../src/uniswap/v4/abis/universalRouter.ts","../src/uniswap/v4/addresses.ts","../src/uniswap/v4/router/encodeSwap.ts","../src/uniswap/v4/abis/permit2.ts","../src/uniswap/v4/router/permit2.ts","../src/uniswap/v4/abis/v4Quoter.ts","../src/uniswap/v4/router/resolvePoolKey.ts","../src/uniswap/v4/router/quote.ts","../src/uniswap/v4/router/quoteByPoolKey.ts","../src/uniswap/v4/router/swap.ts"],"sourcesContent":["/**\n * Errors for the Uniswap v4 Universal Router swap module.\n *\n * All extend {@link PanopticError} so callers can keep a single\n * `instanceof PanopticError` check and so they satisfy `SimulationResult`'s\n * error type.\n *\n * @module uniswap/v4/router/errors\n */\n\nimport type { Address } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\n\n/**\n * The chain has no configured Uniswap v4 addresses and none were supplied via\n * overrides.\n */\nexport class UnsupportedChainError extends PanopticError {\n override readonly name = 'UnsupportedChainError'\n\n constructor(\n public readonly chainId: bigint,\n cause?: Error,\n ) {\n super(`Uniswap v4 router not configured for chain ${chainId}`, cause)\n }\n}\n\n/**\n * `tokenIn` is neither `currency0` nor `currency1` of the resolved pool.\n */\nexport class InvalidSwapTokenError extends PanopticError {\n override readonly name = 'InvalidSwapTokenError'\n\n constructor(\n public readonly token: Address,\n public readonly currency0: Address,\n public readonly currency1: Address,\n cause?: Error,\n ) {\n super(\n `Token ${token} is not part of the pool (currency0=${currency0}, currency1=${currency1})`,\n cause,\n )\n }\n}\n\n/**\n * An amount exceeds the uint128 range required by the v4 swap encoding.\n */\nexport class AmountExceedsUint128Error extends PanopticError {\n override readonly name = 'AmountExceedsUint128Error'\n\n constructor(\n public readonly amount: bigint,\n cause?: Error,\n ) {\n super(`Amount ${amount} exceeds uint128 maximum`, cause)\n }\n}\n\n/**\n * A native-ETH swap needs a trailing Universal Router SWEEP to deliver the ETH\n * output (or refund the input overpay), but no `recipient` was supplied.\n */\nexport class MissingSweepRecipientError extends PanopticError {\n override readonly name = 'MissingSweepRecipientError'\n\n constructor(cause?: Error) {\n super('A recipient is required to sweep native ETH back to the user', cause)\n }\n}\n\n/**\n * The V4Quoter is not available for the chain (no fallback in v1).\n */\nexport class QuoterUnavailableError extends PanopticError {\n override readonly name = 'QuoterUnavailableError'\n\n constructor(\n public readonly chainId: bigint,\n cause?: Error,\n ) {\n super(`V4Quoter unavailable for chain ${chainId}`, cause)\n }\n}\n","/**\n * Minimal Universal Router ABI (only the `execute` overload we use).\n * @module uniswap/v4/abis/universalRouter\n */\n\nexport const universalRouterAbi = [\n {\n type: 'function',\n name: 'execute',\n stateMutability: 'payable',\n inputs: [\n { name: 'commands', type: 'bytes' },\n { name: 'inputs', type: 'bytes[]' },\n { name: 'deadline', type: 'uint256' },\n ],\n outputs: [],\n },\n] as const\n","/**\n * Per-chain Uniswap v4 infrastructure addresses (Universal Router, V4Quoter,\n * PoolManager, Permit2).\n *\n * v1 supports mainnet only; other chains throw {@link UnsupportedChainError}\n * unless every address is supplied via the `overrides` argument (e.g. anvil\n * fork tests, or bots targeting a not-yet-listed chain).\n *\n * @module uniswap/v4/addresses\n */\n\nimport type { Address } from 'viem'\n\nimport { UnsupportedChainError } from './router/errors'\n\n/**\n * Uniswap v4 contract addresses required for a Universal Router spot swap.\n */\nexport interface UniswapV4Addresses {\n /** Universal Router (v4-capable build) — entrypoint for `execute(...)`. */\n universalRouter: Address\n /** V4Quoter — `quoteExactInputSingle` (revert/staticcall-based). */\n v4Quoter: Address\n /** Uniswap v4 PoolManager (singleton). */\n poolManager: Address\n /** Canonical Permit2 (same address on every chain). */\n permit2: Address\n}\n\n/**\n * Canonical Permit2, identical across all chains.\n */\nexport const PERMIT2_ADDRESS: Address = '0x000000000022D473030F116dDEE9F6B43aC78BA3'\n\n/**\n * Verified Uniswap v4 deployment addresses keyed by chainId.\n *\n * Sourced from the official Uniswap v4 deployments. Add a chain here only after\n * verifying each address against the canonical Uniswap deployment listing —\n * Universal Router in particular is NOT the same address across chains.\n */\nexport const UNISWAP_V4_ADDRESSES: Record<number, UniswapV4Addresses> = {\n // Ethereum mainnet\n 1: {\n universalRouter: '0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af',\n v4Quoter: '0x52F0E24D1c21C8A0cB1e5a5dD6198556BD9E1203',\n poolManager: '0x000000000004444c5dc75cB358380D2e3dE08A90',\n permit2: PERMIT2_ADDRESS,\n },\n}\n\n/**\n * Resolve the Uniswap v4 addresses for a chain, applying optional overrides.\n *\n * @param chainId - Target chain ID.\n * @param overrides - Partial override of any address (e.g. for fork tests).\n * @returns Fully-resolved {@link UniswapV4Addresses}.\n * @throws {UnsupportedChainError} when the chain is not listed and the\n * overrides do not supply every required address.\n */\nexport function getUniswapV4Addresses(\n chainId: bigint,\n overrides?: Partial<UniswapV4Addresses>,\n): UniswapV4Addresses {\n const base = UNISWAP_V4_ADDRESSES[Number(chainId)]\n\n const merged: Partial<UniswapV4Addresses> = {\n ...base,\n ...overrides,\n permit2: overrides?.permit2 ?? base?.permit2 ?? PERMIT2_ADDRESS,\n }\n\n if (\n merged.universalRouter === undefined ||\n merged.v4Quoter === undefined ||\n merged.poolManager === undefined ||\n merged.permit2 === undefined\n ) {\n throw new UnsupportedChainError(chainId)\n }\n\n return merged as UniswapV4Addresses\n}\n","/**\n * Pure calldata builders for exact-in and exact-out single-hop swaps via the\n * Uniswap v4 Universal Router.\n *\n * Opcodes verified against `@uniswap/universal-router` `Commands.sol` and\n * `@uniswap/v4-periphery` `Actions.sol`:\n * - Universal Router commands `V4_SWAP = 0x10`, `SWEEP = 0x04`.\n * - v4 actions `SWAP_EXACT_IN_SINGLE = 0x06`, `SWAP_EXACT_OUT_SINGLE = 0x08`,\n * `SETTLE_ALL = 0x0c`, `TAKE = 0x0e`, `TAKE_ALL = 0x0f`.\n *\n * Native ETH is `address(0)` in the PoolKey and needs special handling per side:\n * - Native-ETH OUTPUT: the implicit-recipient `TAKE_ALL` leaves the bought ETH\n * held by the Universal Router, so output is taken with the explicit-recipient\n * `TAKE` action instead, delivering ETH straight to the recipient. No trailing\n * SWEEP is appended for native output.\n * - Native-ETH INPUT on exact-out: the router is funded with the full\n * `amountInMaximum` overpay, so a trailing Universal-Router-level `SWEEP`\n * command (NOT the v4 SWEEP action, which this router does not support) refunds\n * the unused ETH to the recipient.\n * Native-ETH input on exact-in needs neither (msg.value equals the exact input;\n * ERC20 output is delivered by `TAKE_ALL`).\n *\n * @module uniswap/v4/router/encodeSwap\n */\n\nimport type { Address, Hex } from 'viem'\nimport { encodeAbiParameters, encodeFunctionData, encodePacked, zeroAddress } from 'viem'\n\nimport type { PoolKey } from '../../../panoptic/v2/types'\nimport { universalRouterAbi } from '../abis/universalRouter'\nimport { AmountExceedsUint128Error, MissingSweepRecipientError } from './errors'\n\n/** Universal Router command byte for a v4 swap. */\nexport const V4_SWAP = 0x10\n/** v4 action: exact-in single-hop swap. */\nexport const SWAP_EXACT_IN_SINGLE = 0x06\n/** v4 action: pay all of the input currency owed. */\nexport const SETTLE_ALL = 0x0c\n/** v4 action: take all of the output currency owed. */\nexport const TAKE_ALL = 0x0f\n/** v4 action: take an output currency to an explicit recipient. */\nexport const TAKE = 0x0e\n/** v4 action: exact-out single-hop swap. */\nexport const SWAP_EXACT_OUT_SINGLE = 0x08\n/** Universal Router command: sweep the router's token balance to a recipient. */\nexport const SWEEP = 0x04\n\n/** v4 sentinel: take the full positive currency delta (used with TAKE). */\nconst OPEN_DELTA = 0n\n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nconst poolKeyComponents = [\n { name: 'currency0', type: 'address' },\n { name: 'currency1', type: 'address' },\n { name: 'fee', type: 'uint24' },\n { name: 'tickSpacing', type: 'int24' },\n { name: 'hooks', type: 'address' },\n] as const\n\nconst exactInputSingleParamsAbi = [\n {\n type: 'tuple',\n components: [\n { name: 'poolKey', type: 'tuple', components: poolKeyComponents },\n { name: 'zeroForOne', type: 'bool' },\n { name: 'amountIn', type: 'uint128' },\n { name: 'amountOutMinimum', type: 'uint128' },\n { name: 'hookData', type: 'bytes' },\n ],\n },\n] as const\n\nconst exactOutputSingleParamsAbi = [\n {\n type: 'tuple',\n components: [\n { name: 'poolKey', type: 'tuple', components: poolKeyComponents },\n { name: 'zeroForOne', type: 'bool' },\n { name: 'amountOut', type: 'uint128' },\n { name: 'amountInMaximum', type: 'uint128' },\n { name: 'hookData', type: 'bytes' },\n ],\n },\n] as const\n\nconst currencyAmountAbi = [\n { name: 'currency', type: 'address' },\n { name: 'amount', type: 'uint256' },\n] as const\n\n// v4 TAKE action params: take `amount` of `currency` to an explicit recipient.\nconst takeToRecipientAbi = [\n { name: 'currency', type: 'address' },\n { name: 'recipient', type: 'address' },\n { name: 'amount', type: 'uint256' },\n] as const\n\n// Universal Router SWEEP command params: forward `token` above `amountMin` to\n// `recipient`.\nconst sweepParamsAbi = [\n { name: 'token', type: 'address' },\n { name: 'recipient', type: 'address' },\n { name: 'amountMin', type: 'uint256' },\n] as const\n\nfunction assertUint128(amount: bigint): void {\n if (amount < 0n || amount > UINT128_MAX) {\n throw new AmountExceedsUint128Error(amount)\n }\n}\n\n/**\n * Encode the input for a Universal Router `SWEEP` command that forwards the\n * router's full native-ETH balance (above `amountMin = 0`) to `recipient`.\n */\nfunction encodeEthSweepInput(recipient: Address): Hex {\n return encodeAbiParameters(sweepParamsAbi, [zeroAddress, recipient, 0n])\n}\n\n/**\n * Build the output-take v4 action byte + param.\n *\n * Native-ETH output is taken with the explicit-recipient `TAKE` action so the\n * router forwards the ETH straight to `recipient` (the implicit-`msgSender`\n * `TAKE_ALL` leaves native ETH held by the router). ERC20 output uses\n * `TAKE_ALL`, which already credits the caller.\n *\n * @param nativeAmount - TAKE amount for native-ETH output: `OPEN_DELTA` (0) to\n * take the full credit (exact-in, protected by the swap's min) or the exact\n * output (exact-out).\n * @param erc20Amount - TAKE_ALL min/amount for ERC20 output: `amountOutMinimum`\n * (exact-in) or the exact output (exact-out).\n */\nfunction buildOutputTake(\n tokenOut: Address,\n recipient: Address | undefined,\n nativeAmount: bigint,\n erc20Amount: bigint,\n): { action: number; param: Hex } {\n if (tokenOut === zeroAddress) {\n if (recipient === undefined) {\n throw new MissingSweepRecipientError()\n }\n return {\n action: TAKE,\n param: encodeAbiParameters(takeToRecipientAbi, [zeroAddress, recipient, nativeAmount]),\n }\n }\n return {\n action: TAKE_ALL,\n param: encodeAbiParameters(currencyAmountAbi, [tokenOut, erc20Amount]),\n }\n}\n\n/**\n * Arguments for {@link buildV4SwapExecuteCalldata}.\n */\nexport interface BuildV4SwapCalldataArgs {\n /** The v4 PoolKey (currency0, currency1, fee, tickSpacing, hooks). */\n poolKey: PoolKey\n /** Whether the swap goes currency0 → currency1. */\n zeroForOne: boolean\n /** Exact input amount (uint128). */\n amountIn: bigint\n /** Minimum acceptable output (uint128). */\n amountOutMinimum: bigint\n /** Input token address (`address(0)` for native ETH). */\n tokenIn: Address\n /** Output token address (`address(0)` for native ETH). */\n tokenOut: Address\n /** Absolute deadline (unix seconds). */\n deadline: bigint\n /**\n * Recipient of native-ETH output. Required when `tokenOut` is `address(0)`,\n * since the explicit-recipient `TAKE` action forwards the bought ETH there\n * (the implicit-recipient `TAKE_ALL` would leave it held by the router).\n */\n recipient?: Address\n /** Hook data; defaults to `0x` (hook-less pools). */\n hookData?: Hex\n}\n\n/**\n * Build the typed `execute(...)` args + msg.value for an exact-in single-hop v4\n * swap. Use this when submitting via viem (`writeContract` / `submitWrite`).\n *\n * When `tokenOut` is native ETH the explicit-recipient `TAKE` action forwards\n * the bought ETH to `recipient` (no trailing SWEEP is needed for exact-in).\n *\n * @returns `args` ready to spread into `execute` and the ETH `value` to send\n * (= `amountIn` for native-ETH input, otherwise `0n`).\n */\nexport function buildV4SwapExecuteArgs(args: BuildV4SwapCalldataArgs): {\n args: readonly [Hex, readonly Hex[], bigint]\n value: bigint\n} {\n const {\n poolKey,\n zeroForOne,\n amountIn,\n amountOutMinimum,\n tokenIn,\n tokenOut,\n deadline,\n recipient,\n hookData = '0x',\n } = args\n\n assertUint128(amountIn)\n assertUint128(amountOutMinimum)\n\n const swapParam = encodeAbiParameters(exactInputSingleParamsAbi, [\n {\n poolKey: {\n currency0: poolKey.currency0,\n currency1: poolKey.currency1,\n fee: Number(poolKey.fee),\n tickSpacing: Number(poolKey.tickSpacing),\n hooks: poolKey.hooks,\n },\n zeroForOne,\n amountIn,\n amountOutMinimum,\n hookData,\n },\n ])\n\n // SETTLE_ALL pays the input; the output take credits the recipient. Native-ETH\n // output uses the explicit-recipient TAKE so the router forwards the ETH (with\n // OPEN_DELTA to take the full, slippage-protected swap output).\n const settleParam = encodeAbiParameters(currencyAmountAbi, [tokenIn, amountIn])\n const take = buildOutputTake(tokenOut, recipient, OPEN_DELTA, amountOutMinimum)\n\n const actions = encodePacked(\n ['uint8', 'uint8', 'uint8'],\n [SWAP_EXACT_IN_SINGLE, SETTLE_ALL, take.action],\n )\n\n const v4Input = encodeAbiParameters(\n [\n { name: 'actions', type: 'bytes' },\n { name: 'params', type: 'bytes[]' },\n ],\n [actions, [swapParam, settleParam, take.param]],\n )\n\n // Native-ETH input on exact-in needs no SWEEP (msg.value equals the exact input).\n const commands = encodePacked(['uint8'], [V4_SWAP])\n const value = tokenIn === zeroAddress ? amountIn : 0n\n\n return { args: [commands, [v4Input], deadline] as const, value }\n}\n\n/**\n * Build the `execute(commands, inputs, deadline)` calldata + msg.value for an\n * exact-in single-hop v4 swap.\n *\n * @returns The encoded calldata and the ETH `value` to send.\n */\nexport function buildV4SwapExecuteCalldata(args: BuildV4SwapCalldataArgs): {\n data: Hex\n value: bigint\n} {\n const { args: executeArgs, value } = buildV4SwapExecuteArgs(args)\n const data = encodeFunctionData({\n abi: universalRouterAbi,\n functionName: 'execute',\n args: executeArgs,\n })\n return { data, value }\n}\n\n/**\n * Arguments for {@link buildV4ExactOutSwapExecuteCalldata}.\n */\nexport interface BuildV4ExactOutSwapCalldataArgs {\n /** The v4 PoolKey (currency0, currency1, fee, tickSpacing, hooks). */\n poolKey: PoolKey\n /** Whether the swap goes currency0 → currency1. */\n zeroForOne: boolean\n /** Exact output amount to receive (uint128). */\n amountOut: bigint\n /** Maximum acceptable input to spend (uint128). */\n amountInMaximum: bigint\n /** Input token address (`address(0)` for native ETH). */\n tokenIn: Address\n /** Output token address (`address(0)` for native ETH). */\n tokenOut: Address\n /** Absolute deadline (unix seconds). */\n deadline: bigint\n /**\n * Recipient of any swept native-ETH refund (only used for native-ETH input).\n * Must be the payer; the leftover `amountInMaximum - actualInput` is returned\n * here.\n */\n recipient: Address\n /** Hook data; defaults to `0x` (hook-less pools). */\n hookData?: Hex\n}\n\n/**\n * Build the typed `execute(...)` args + msg.value for an exact-out single-hop v4\n * swap. Use this when submitting via viem (`writeContract` / `submitWrite`).\n *\n * For native-ETH input, `value` is `amountInMaximum` (an overpay) and a trailing\n * `SWEEP` action refunds the unused ETH to `recipient`. For ERC20 input, Permit2\n * pulls only the settled amount, so no SWEEP is appended and `value` is `0n`.\n *\n * @returns `args` ready to spread into `execute` and the ETH `value` to send.\n */\nexport function buildV4ExactOutSwapExecuteArgs(args: BuildV4ExactOutSwapCalldataArgs): {\n args: readonly [Hex, readonly Hex[], bigint]\n value: bigint\n} {\n const {\n poolKey,\n zeroForOne,\n amountOut,\n amountInMaximum,\n tokenIn,\n tokenOut,\n deadline,\n recipient,\n hookData = '0x',\n } = args\n\n assertUint128(amountOut)\n assertUint128(amountInMaximum)\n\n const swapParam = encodeAbiParameters(exactOutputSingleParamsAbi, [\n {\n poolKey: {\n currency0: poolKey.currency0,\n currency1: poolKey.currency1,\n fee: Number(poolKey.fee),\n tickSpacing: Number(poolKey.tickSpacing),\n hooks: poolKey.hooks,\n },\n zeroForOne,\n amountOut,\n amountInMaximum,\n hookData,\n },\n ])\n\n // SETTLE_ALL caps the input at amountInMaximum; the output take delivers the\n // exact output. Native-ETH output uses the explicit-recipient TAKE so the\n // router forwards the ETH straight to `recipient`.\n const settleParam = encodeAbiParameters(currencyAmountAbi, [tokenIn, amountInMaximum])\n const take = buildOutputTake(tokenOut, recipient, amountOut, amountOut)\n\n const actions = encodePacked(\n ['uint8', 'uint8', 'uint8'],\n [SWAP_EXACT_OUT_SINGLE, SETTLE_ALL, take.action],\n )\n\n const v4Input = encodeAbiParameters(\n [\n { name: 'actions', type: 'bytes' },\n { name: 'params', type: 'bytes[]' },\n ],\n [actions, [swapParam, settleParam, take.param]],\n )\n\n const isNativeIn = tokenIn === zeroAddress\n\n // Native-ETH input funds the router with the full overpay cap; a trailing\n // Universal Router SWEEP command (the v4 SWEEP *action* is unsupported here)\n // refunds the unused ETH to the recipient.\n const commandList: number[] = [V4_SWAP]\n const inputs: Hex[] = [v4Input]\n if (isNativeIn) {\n commandList.push(SWEEP)\n inputs.push(encodeEthSweepInput(recipient))\n }\n\n const commands = encodePacked(\n commandList.map(() => 'uint8'),\n commandList,\n )\n const value = isNativeIn ? amountInMaximum : 0n\n\n return { args: [commands, inputs, deadline] as const, value }\n}\n\n/**\n * Build the `execute(commands, inputs, deadline)` calldata + msg.value for an\n * exact-out single-hop v4 swap.\n *\n * @returns The encoded calldata and the ETH `value` to send.\n */\nexport function buildV4ExactOutSwapExecuteCalldata(args: BuildV4ExactOutSwapCalldataArgs): {\n data: Hex\n value: bigint\n} {\n const { args: executeArgs, value } = buildV4ExactOutSwapExecuteArgs(args)\n const data = encodeFunctionData({\n abi: universalRouterAbi,\n functionName: 'execute',\n args: executeArgs,\n })\n return { data, value }\n}\n","/**\n * Minimal Permit2 ABI (`IAllowanceTransfer` subset: `approve` + `allowance`).\n * @module uniswap/v4/abis/permit2\n */\n\nexport const permit2Abi = [\n {\n type: 'function',\n name: 'approve',\n stateMutability: 'nonpayable',\n inputs: [\n { name: 'token', type: 'address' },\n { name: 'spender', type: 'address' },\n { name: 'amount', type: 'uint160' },\n { name: 'expiration', type: 'uint48' },\n ],\n outputs: [],\n },\n {\n type: 'function',\n name: 'allowance',\n stateMutability: 'view',\n inputs: [\n { name: 'user', type: 'address' },\n { name: 'token', type: 'address' },\n { name: 'spender', type: 'address' },\n ],\n outputs: [\n { name: 'amount', type: 'uint160' },\n { name: 'expiration', type: 'uint48' },\n { name: 'nonce', type: 'uint48' },\n ],\n },\n] as const\n","/**\n * Permit2 approval helpers for the Universal Router ERC20 input side.\n *\n * Two-step on-chain flow (only when `tokenIn` is an ERC20):\n * 1. ERC20 `approve(Permit2, amount)` — lets Permit2 pull the token.\n * 2. `Permit2.approve(token, universalRouter, amount, expiration)` — lets the\n * router spend via Permit2.\n *\n * Native ETH skips both steps.\n *\n * @module uniswap/v4/router/permit2\n */\n\nimport { erc20Abi, maxUint256 } from 'viem'\n\nimport { getBlockMeta } from '../../../panoptic/v2/clients'\nimport type { TxReceipt, TxResult } from '../../../panoptic/v2/types'\nimport { submitWrite } from '../../../panoptic/v2/writes'\nimport { permit2Abi } from '../abis/permit2'\nimport { getUniswapV4Addresses } from '../addresses'\nimport type {\n ApproveErc20ForPermit2Params,\n ApproveRouterViaPermit2Params,\n CheckRouterApprovalParams,\n RouterApprovalStatus,\n} from './types'\n\n/** uint160 max — the largest Permit2 allowance amount. */\nconst UINT160_MAX = (1n << 160n) - 1n\n/** Default Permit2 allowance expiration window (30 days). */\nconst DEFAULT_EXPIRATION_SECONDS = 2_592_000n\n/** uint48 max — the largest Permit2 expiration. */\nconst UINT48_MAX = (1n << 48n) - 1n\n\n/**\n * Check whether the ERC20 → Permit2 → Universal Router allowance chain is\n * sufficient for an exact-in swap of `amount`.\n */\nexport async function checkRouterApproval(\n params: CheckRouterApprovalParams,\n): Promise<RouterApprovalStatus> {\n const { client, chainId, tokenIn, owner, amount, addresses } = params\n const { permit2, universalRouter } = getUniswapV4Addresses(chainId, addresses)\n\n const [erc20Allowance, permit2Allowance, blockMeta] = await Promise.all([\n client.readContract({\n address: tokenIn,\n abi: erc20Abi,\n functionName: 'allowance',\n args: [owner, permit2],\n }),\n client.readContract({\n address: permit2,\n abi: permit2Abi,\n functionName: 'allowance',\n args: [owner, tokenIn, universalRouter],\n }),\n getBlockMeta({ client }),\n ])\n\n const [permit2Amount, permit2Expiration] = permit2Allowance\n\n const needsErc20Approval = erc20Allowance < amount\n const needsPermit2Approval =\n permit2Amount < amount || BigInt(permit2Expiration) <= blockMeta.blockTimestamp\n\n return {\n needsErc20Approval,\n needsPermit2Approval,\n erc20Allowance,\n permit2Amount,\n permit2Expiration: BigInt(permit2Expiration),\n }\n}\n\n/**\n * Step 1: approve the ERC20 token to Permit2 (defaults to unlimited).\n */\nexport async function approveErc20ForPermit2(\n params: ApproveErc20ForPermit2Params,\n): Promise<TxResult> {\n const {\n client,\n walletClient,\n account,\n chainId,\n tokenIn,\n amount = maxUint256,\n txOverrides,\n addresses,\n } = params\n const { permit2 } = getUniswapV4Addresses(chainId, addresses)\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: tokenIn,\n abi: erc20Abi,\n functionName: 'approve',\n args: [permit2, amount],\n txOverrides,\n })\n}\n\n/**\n * Step 1 (and wait): approve the ERC20 token to Permit2.\n */\nexport async function approveErc20ForPermit2AndWait(\n params: ApproveErc20ForPermit2Params,\n): Promise<TxReceipt> {\n const result = await approveErc20ForPermit2(params)\n return result.wait()\n}\n\n/**\n * Step 2: approve the Universal Router as a Permit2 spender for the token.\n */\nexport async function approveRouterViaPermit2(\n params: ApproveRouterViaPermit2Params,\n): Promise<TxResult> {\n const {\n client,\n walletClient,\n account,\n chainId,\n tokenIn,\n amount = UINT160_MAX,\n expiration,\n txOverrides,\n addresses,\n } = params\n const { permit2, universalRouter } = getUniswapV4Addresses(chainId, addresses)\n\n const resolvedExpiration =\n expiration ?? (await getBlockMeta({ client })).blockTimestamp + DEFAULT_EXPIRATION_SECONDS\n const cappedExpiration = resolvedExpiration > UINT48_MAX ? UINT48_MAX : resolvedExpiration\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: permit2,\n abi: permit2Abi,\n functionName: 'approve',\n args: [tokenIn, universalRouter, amount, cappedExpiration],\n txOverrides,\n })\n}\n\n/**\n * Step 2 (and wait): approve the Universal Router via Permit2.\n */\nexport async function approveRouterViaPermit2AndWait(\n params: ApproveRouterViaPermit2Params,\n): Promise<TxReceipt> {\n const result = await approveRouterViaPermit2(params)\n return result.wait()\n}\n","/**\n * Minimal V4Quoter ABI (`quoteExactInputSingle`, `quoteExactOutputSingle`).\n *\n * Note: neither function is `view` — they mutate state internally and are\n * intended to be called via `eth_call` / viem `simulateContract`, never\n * `readContract`.\n *\n * @module uniswap/v4/abis/v4Quoter\n */\n\nconst quoteExactSingleParams = {\n name: 'params',\n type: 'tuple',\n components: [\n {\n name: 'poolKey',\n type: 'tuple',\n components: [\n { name: 'currency0', type: 'address' },\n { name: 'currency1', type: 'address' },\n { name: 'fee', type: 'uint24' },\n { name: 'tickSpacing', type: 'int24' },\n { name: 'hooks', type: 'address' },\n ],\n },\n { name: 'zeroForOne', type: 'bool' },\n { name: 'exactAmount', type: 'uint128' },\n { name: 'hookData', type: 'bytes' },\n ],\n} as const\n\nexport const v4QuoterAbi = [\n {\n type: 'function',\n name: 'quoteExactInputSingle',\n stateMutability: 'nonpayable',\n inputs: [quoteExactSingleParams],\n outputs: [\n { name: 'amountOut', type: 'uint256' },\n { name: 'gasEstimate', type: 'uint256' },\n ],\n },\n {\n type: 'function',\n name: 'quoteExactOutputSingle',\n stateMutability: 'nonpayable',\n inputs: [quoteExactSingleParams],\n outputs: [\n { name: 'amountIn', type: 'uint256' },\n { name: 'gasEstimate', type: 'uint256' },\n ],\n },\n] as const\n","/**\n * Resolve the Uniswap v4 PoolKey + swap direction from a PanopticPool address.\n * @module uniswap/v4/router/resolvePoolKey\n */\n\nimport type { Address, PublicClient } from 'viem'\nimport { isAddressEqual } from 'viem'\n\nimport { getPool } from '../../../panoptic/v2/reads/pool'\nimport type { PoolKey } from '../../../panoptic/v2/types'\nimport { InvalidSwapTokenError } from './errors'\n\n/**\n * Resolved swap routing info for a given `tokenIn`.\n */\nexport interface ResolvedSwapRoute {\n /** Underlying v4 PoolKey. */\n poolKey: PoolKey\n /** Whether the swap goes currency0 → currency1. */\n zeroForOne: boolean\n /** Output token address. */\n tokenOut: Address\n /** Decimals of the output token. */\n tokenOutDecimals: bigint\n /** Symbol of the output token. */\n tokenOutSymbol: string\n}\n\n/**\n * Parameters for {@link resolveSwapRoute}.\n */\nexport interface ResolveSwapRouteParams {\n client: PublicClient\n poolAddress: Address\n chainId: bigint\n tokenIn: Address\n blockNumber?: bigint\n}\n\n/**\n * Resolve the PoolKey, swap direction, and output token metadata for a swap.\n *\n * @throws {InvalidSwapTokenError} when `tokenIn` is not part of the pool.\n */\nexport async function resolveSwapRoute(params: ResolveSwapRouteParams): Promise<ResolvedSwapRoute> {\n const { client, poolAddress, chainId, tokenIn, blockNumber } = params\n\n const pool = await getPool({ client, poolAddress, chainId, blockNumber })\n const { poolKey } = pool\n\n const isCurrency0 = isAddressEqual(tokenIn, poolKey.currency0)\n const isCurrency1 = isAddressEqual(tokenIn, poolKey.currency1)\n if (!isCurrency0 && !isCurrency1) {\n throw new InvalidSwapTokenError(tokenIn, poolKey.currency0, poolKey.currency1)\n }\n\n const zeroForOne = isCurrency0\n const tokenOut = zeroForOne ? poolKey.currency1 : poolKey.currency0\n const outTracker = zeroForOne ? pool.collateralTracker1 : pool.collateralTracker0\n\n return {\n poolKey,\n zeroForOne,\n tokenOut,\n tokenOutDecimals: outTracker.decimals,\n tokenOutSymbol: outTracker.symbol,\n }\n}\n","/**\n * Quote exact-in and exact-out swaps via the Uniswap v4 V4Quoter.\n * @module uniswap/v4/router/quote\n */\n\nimport { zeroAddress } from 'viem'\n\nimport { getBlockMeta } from '../../../panoptic/v2/clients'\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport type { SimulationResult } from '../../../panoptic/v2/types'\nimport { v4QuoterAbi } from '../abis/v4Quoter'\nimport { getUniswapV4Addresses } from '../addresses'\nimport { QuoterUnavailableError } from './errors'\nimport { resolveSwapRoute } from './resolvePoolKey'\nimport type {\n QuoteSwapExactInViaRouterParams,\n QuoteSwapExactOutViaRouterParams,\n SwapExactInQuote,\n SwapExactOutQuote,\n} from './types'\n\nconst BPS_DENOMINATOR = 10_000n\nconst UINT128_MAX = (1n << 128n) - 1n\n\n/** Reject out-of-range slippage so the min/max amount math can't underflow/overflow. */\nfunction assertSlippageBps(slippageBps: bigint): void {\n if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`)\n }\n}\n\nconst FALLBACK_META = {\n blockNumber: 0n,\n blockTimestamp: 0n,\n blockHash: '0x0' as `0x${string}`,\n}\n\n/**\n * Quote an exact-in spot swap against the underlying Uniswap v4 pool.\n *\n * Uses the V4Quoter `quoteExactInputSingle` via `eth_call` (the quoter is\n * state-mutating / revert-based, so it must be simulated, not read). Returns a\n * `SimulationResult` so failures carry a structured error rather than throwing.\n */\nexport async function quoteSwapExactInViaRouter(\n params: QuoteSwapExactInViaRouterParams,\n): Promise<SimulationResult<SwapExactInQuote>> {\n const { client, poolAddress, chainId, tokenIn, amountIn, slippageBps, blockNumber, addresses } =\n params\n\n try {\n if (amountIn < 0n || amountIn > UINT128_MAX) {\n throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`)\n }\n assertSlippageBps(slippageBps)\n\n const targetBlockNumber = blockNumber ?? (await client.getBlockNumber())\n const metaPromise = getBlockMeta({ client, blockNumber: targetBlockNumber })\n\n const { v4Quoter } = getUniswapV4Addresses(chainId, addresses)\n if (v4Quoter === zeroAddress) {\n throw new QuoterUnavailableError(chainId)\n }\n\n const route = await resolveSwapRoute({\n client,\n poolAddress,\n chainId,\n tokenIn,\n blockNumber: targetBlockNumber,\n })\n\n const { result } = await client.simulateContract({\n address: v4Quoter,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n blockNumber: targetBlockNumber,\n args: [\n {\n poolKey: {\n currency0: route.poolKey.currency0,\n currency1: route.poolKey.currency1,\n fee: Number(route.poolKey.fee),\n tickSpacing: Number(route.poolKey.tickSpacing),\n hooks: route.poolKey.hooks,\n },\n zeroForOne: route.zeroForOne,\n exactAmount: amountIn,\n hookData: '0x',\n },\n ],\n })\n\n const [amountOut, gasEstimate] = result\n const amountOutMinimum = (amountOut * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR\n\n const _meta = await metaPromise\n\n return {\n success: true,\n data: {\n amountOut,\n amountOutMinimum,\n zeroForOne: route.zeroForOne,\n tokenOut: route.tokenOut,\n poolKey: route.poolKey,\n gasEstimate,\n },\n gasEstimate,\n _meta,\n }\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof PanopticError\n ? error\n : new PanopticError(\n error instanceof Error ? error.message : 'Quote failed',\n error instanceof Error ? error : undefined,\n ),\n _meta: FALLBACK_META,\n }\n }\n}\n\n/**\n * Quote an exact-out spot swap against the underlying Uniswap v4 pool.\n *\n * Uses the V4Quoter `quoteExactOutputSingle` via `eth_call` (the quoter is\n * state-mutating / revert-based, so it must be simulated, not read). Returns a\n * `SimulationResult` so failures carry a structured error rather than throwing.\n */\nexport async function quoteSwapExactOutViaRouter(\n params: QuoteSwapExactOutViaRouterParams,\n): Promise<SimulationResult<SwapExactOutQuote>> {\n const { client, poolAddress, chainId, tokenIn, amountOut, slippageBps, blockNumber, addresses } =\n params\n\n try {\n if (amountOut < 0n || amountOut > UINT128_MAX) {\n throw new PanopticError(`amountOut ${amountOut} exceeds uint128 maximum`)\n }\n assertSlippageBps(slippageBps)\n\n const targetBlockNumber = blockNumber ?? (await client.getBlockNumber())\n const metaPromise = getBlockMeta({ client, blockNumber: targetBlockNumber })\n\n const { v4Quoter } = getUniswapV4Addresses(chainId, addresses)\n if (v4Quoter === zeroAddress) {\n throw new QuoterUnavailableError(chainId)\n }\n\n const route = await resolveSwapRoute({\n client,\n poolAddress,\n chainId,\n tokenIn,\n blockNumber: targetBlockNumber,\n })\n\n const { result } = await client.simulateContract({\n address: v4Quoter,\n abi: v4QuoterAbi,\n functionName: 'quoteExactOutputSingle',\n blockNumber: targetBlockNumber,\n args: [\n {\n poolKey: {\n currency0: route.poolKey.currency0,\n currency1: route.poolKey.currency1,\n fee: Number(route.poolKey.fee),\n tickSpacing: Number(route.poolKey.tickSpacing),\n hooks: route.poolKey.hooks,\n },\n zeroForOne: route.zeroForOne,\n exactAmount: amountOut,\n hookData: '0x',\n },\n ],\n })\n\n const [amountIn, gasEstimate] = result\n // Ceiling division: never round the input cap down (would tighten the buffer).\n const amountInMaximum =\n (amountIn * (BPS_DENOMINATOR + slippageBps) + BPS_DENOMINATOR - 1n) / BPS_DENOMINATOR\n\n const _meta = await metaPromise\n\n return {\n success: true,\n data: {\n amountIn,\n amountInMaximum,\n zeroForOne: route.zeroForOne,\n tokenOut: route.tokenOut,\n poolKey: route.poolKey,\n gasEstimate,\n },\n gasEstimate,\n _meta,\n }\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof PanopticError\n ? error\n : new PanopticError(\n error instanceof Error ? error.message : 'Quote failed',\n error instanceof Error ? error : undefined,\n ),\n _meta: FALLBACK_META,\n }\n }\n}\n","/**\n * Quote an exact-in single-hop v4 swap for an EXPLICIT PoolKey (as opposed to\n * `quoteSwapExactInViaRouter`, which resolves the pool from a PanopticPool\n * address). Used to rank an arbitrary whitelist of hedge pools.\n * @module uniswap/v4/router/quoteByPoolKey\n */\n\nimport type { PublicClient } from 'viem'\nimport { BaseError, ContractFunctionRevertedError } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport type { PoolKey } from '../../../panoptic/v2/types'\nimport { v4QuoterAbi } from '../abis/v4Quoter'\nimport { type UniswapV4Addresses, getUniswapV4Addresses } from '../addresses'\n\nconst BPS_DENOMINATOR = 10_000n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nexport interface QuoteV4ExactInByPoolKeyParams {\n client: PublicClient\n chainId: bigint\n poolKey: PoolKey\n zeroForOne: boolean\n amountIn: bigint\n slippageBps: bigint\n blockNumber?: bigint\n addresses?: Partial<UniswapV4Addresses>\n}\n\nexport interface V4ExactInQuote {\n amountOut: bigint\n amountOutMinimum: bigint\n gasEstimate: bigint\n}\n\n/**\n * Quote an exact-in v4 swap for a specific PoolKey. Returns `null` when the\n * quote reverts (pool missing / no liquidity) so callers can skip that pool when\n * ranking venues rather than aborting the cycle.\n */\nexport async function quoteV4ExactInByPoolKey(\n params: QuoteV4ExactInByPoolKeyParams,\n): Promise<V4ExactInQuote | null> {\n const { client, chainId, poolKey, zeroForOne, amountIn, slippageBps, blockNumber } = params\n if (amountIn < 0n || amountIn > UINT128_MAX) {\n throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`)\n }\n if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`)\n }\n\n const { v4Quoter } = getUniswapV4Addresses(chainId, params.addresses)\n\n try {\n const { result } = await client.simulateContract({\n address: v4Quoter,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n blockNumber,\n args: [\n {\n poolKey: {\n currency0: poolKey.currency0,\n currency1: poolKey.currency1,\n fee: Number(poolKey.fee),\n tickSpacing: Number(poolKey.tickSpacing),\n hooks: poolKey.hooks,\n },\n zeroForOne,\n exactAmount: amountIn,\n hookData: '0x',\n },\n ],\n })\n const [amountOut, gasEstimate] = result\n const amountOutMinimum = (amountOut * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR\n return { amountOut, amountOutMinimum, gasEstimate }\n } catch (err) {\n if (isRevert(err)) return null\n // Transport/RPC/timeout errors are NOT \"no liquidity\" — rethrow so routing\n // doesn't silently treat an unreachable node as an empty pool.\n throw err\n }\n}\n\n/** True only for genuine contract reverts (missing pool / no liquidity). */\nfunction isRevert(err: unknown): boolean {\n return (\n err instanceof BaseError &&\n err.walk((e) => e instanceof ContractFunctionRevertedError) instanceof\n ContractFunctionRevertedError\n )\n}\n","/**\n * Exact-in and exact-out spot swaps via the Uniswap v4 Universal Router.\n *\n * Swaps directly on the underlying Uniswap v4 pool, bypassing Panoptic (no SFPM,\n * no Panoptic LP fees, no pool collateral required). Native ETH (`address(0)`)\n * is supported via `msg.value` with no Permit2 approval.\n *\n * @module uniswap/v4/router/swap\n */\n\nimport { isAddressEqual } from 'viem'\n\nimport { getBlockMeta } from '../../../panoptic/v2/clients'\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport type { TxReceipt, TxResult } from '../../../panoptic/v2/types'\nimport { submitWrite } from '../../../panoptic/v2/writes'\nimport { universalRouterAbi } from '../abis/universalRouter'\nimport { getUniswapV4Addresses } from '../addresses'\nimport { buildV4ExactOutSwapExecuteArgs, buildV4SwapExecuteArgs } from './encodeSwap'\nimport { quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter } from './quote'\nimport type { SwapExactInViaRouterParams, SwapExactOutViaRouterParams } from './types'\n\n/** Default swap deadline window (30 minutes) when no deadline is provided. */\nconst DEFAULT_DEADLINE_SECONDS = 1800n\n\n/**\n * Execute an exact-in spot swap via the Universal Router.\n *\n * @param params - Swap parameters.\n * @returns TxResult with hash + wait().\n *\n * @example\n * ```typescript\n * const result = await swapExactInViaRouter({\n * client, walletClient, account, poolAddress,\n * chainId: 1n,\n * tokenIn: ZERO_ADDRESS, // native ETH\n * amountIn: 10n ** 17n, // 0.1 ETH\n * slippageBps: 50n, // 0.5%\n * })\n * await result.wait()\n * ```\n */\nexport async function swapExactInViaRouter(params: SwapExactInViaRouterParams): Promise<TxResult> {\n const {\n client,\n walletClient,\n account,\n poolAddress,\n chainId,\n tokenIn,\n amountIn,\n slippageBps,\n deadline,\n recipient,\n txOverrides,\n addresses,\n } = params\n\n if (recipient !== undefined && !isAddressEqual(recipient, account)) {\n // The Universal Router pays the configured router recipient; routing output\n // to an arbitrary recipient requires an extra action not wired in v1.\n throw new PanopticError('Custom recipient is not supported yet; output goes to the sender')\n }\n\n const resolved = getUniswapV4Addresses(chainId, addresses)\n\n const quote = await quoteSwapExactInViaRouter({\n client,\n poolAddress,\n chainId,\n tokenIn,\n amountIn,\n slippageBps,\n addresses,\n })\n\n if (!quote.success) {\n throw quote.error\n }\n\n const resolvedDeadline =\n deadline ?? (await getBlockMeta({ client })).blockTimestamp + DEFAULT_DEADLINE_SECONDS\n\n const { args, value } = buildV4SwapExecuteArgs({\n poolKey: quote.data.poolKey,\n zeroForOne: quote.data.zeroForOne,\n amountIn,\n amountOutMinimum: quote.data.amountOutMinimum,\n tokenIn,\n tokenOut: quote.data.tokenOut,\n deadline: resolvedDeadline,\n recipient: account,\n })\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: resolved.universalRouter,\n abi: universalRouterAbi,\n functionName: 'execute',\n args,\n value,\n txOverrides,\n })\n}\n\n/**\n * Execute an exact-in swap via the Universal Router and wait for confirmation.\n */\nexport async function swapExactInViaRouterAndWait(\n params: SwapExactInViaRouterParams,\n): Promise<TxReceipt> {\n const result = await swapExactInViaRouter(params)\n return result.wait()\n}\n\n/**\n * Execute an exact-out spot swap via the Universal Router.\n *\n * The caller specifies the exact `amountOut` to receive; the input (pay) amount\n * is quoted and capped at `amountInMaximum`. For native-ETH input the router is\n * funded with `amountInMaximum` and the unused surplus is swept back to the\n * sender.\n *\n * @param params - Swap parameters.\n * @returns TxResult with hash + wait().\n */\nexport async function swapExactOutViaRouter(\n params: SwapExactOutViaRouterParams,\n): Promise<TxResult> {\n const {\n client,\n walletClient,\n account,\n poolAddress,\n chainId,\n tokenIn,\n amountOut,\n slippageBps,\n deadline,\n recipient,\n txOverrides,\n addresses,\n } = params\n\n if (recipient !== undefined && !isAddressEqual(recipient, account)) {\n // The Universal Router pays the configured router recipient; routing output\n // to an arbitrary recipient requires an extra action not wired in v1.\n throw new PanopticError('Custom recipient is not supported yet; output goes to the sender')\n }\n\n const resolved = getUniswapV4Addresses(chainId, addresses)\n\n const quote = await quoteSwapExactOutViaRouter({\n client,\n poolAddress,\n chainId,\n tokenIn,\n amountOut,\n slippageBps,\n addresses,\n })\n\n if (!quote.success) {\n throw quote.error\n }\n\n const resolvedDeadline =\n deadline ?? (await getBlockMeta({ client })).blockTimestamp + DEFAULT_DEADLINE_SECONDS\n\n const { args, value } = buildV4ExactOutSwapExecuteArgs({\n poolKey: quote.data.poolKey,\n zeroForOne: quote.data.zeroForOne,\n amountOut,\n amountInMaximum: quote.data.amountInMaximum,\n tokenIn,\n tokenOut: quote.data.tokenOut,\n deadline: resolvedDeadline,\n recipient: account,\n })\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: resolved.universalRouter,\n abi: universalRouterAbi,\n functionName: 'execute',\n args,\n value,\n txOverrides,\n })\n}\n\n/**\n * Execute an exact-out swap via the Universal Router and wait for confirmation.\n */\nexport async function swapExactOutViaRouterAndWait(\n params: SwapExactOutViaRouterParams,\n): Promise<TxReceipt> {\n const result = await swapExactOutViaRouter(params)\n return result.wait()\n}\n"],"mappings":";;;;;;;;AAkBA,IAAa,wBAAb,cAA2C,cAAc;CACvD,AAAkB,OAAO;CAEzB,YACkBA,SAChBC,OACA;AACA,SAAO,6CAA6C,QAAQ,GAAG,MAAM;EA8DxE,KAjEmB;CAIjB;AACF;;;;AAKD,IAAa,wBAAb,cAA2C,cAAc;CACvD,AAAkB,OAAO;CAEzB,YACkBC,OACAC,WACAC,WAChBH,OACA;AACA,SACG,QAAQ,MAAM,sCAAsC,UAAU,cAAc,UAAU,IACvF,MACD;EA2CH,KAnDkB;EAmDjB,KAlDiB;EAkDhB,KAjDgB;CAOjB;AACF;;;;AAKD,IAAa,4BAAb,cAA+C,cAAc;CAC3D,AAAkB,OAAO;CAEzB,YACkBI,QAChBJ,OACA;AACA,SAAO,SAAS,OAAO,2BAA2B,MAAM;EA6BvD,KAhCe;CAIjB;AACF;;;;;AAMD,IAAa,6BAAb,cAAgD,cAAc;CAC5D,AAAkB,OAAO;CAEzB,YAAYA,OAAe;AACzB,QAAM,gEAAgE,MAAM;CAC7E;AACF;;;;AAKD,IAAa,yBAAb,cAA4C,cAAc;CACxD,AAAkB,OAAO;CAEzB,YACkBD,SAChBC,OACA;AACA,SAAO,iCAAiC,QAAQ,GAAG,MAAM;EAGvD,KANc;CAIjB;AACF;;;;;;;;ACjFD,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,MAAM;CACN,iBAAiB;CACjB,QAAQ;EACN;GAAE,MAAM;GAAY,MAAM;EAAS;EACnC;GAAE,MAAM;GAAU,MAAM;EAAW;EACnC;GAAE,MAAM;GAAY,MAAM;EAAW;CACtC;CACD,SAAS,CAAE;AACZ,CACF;;;;;;;ACeD,MAAaK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AW;CACZ,EAAC;AAEF,QAAO,YAAY;EACjB;EACA;EACA;EACA,SAAS,SAAS;EAClB,KAAK;EACL,cAAc;EACd;EACA;EACA;CACD,EAAC;AACH;;;;AAKD,eAAsB,4BACpBA,QACoB;CACpB,MAAM,SAAS,MAAM,qBAAqB,OAAO;AACjD,QAAO,OAAO,MAAM;AACrB;;;;;;;;;;;;AAaD,eAAsB,sBACpBC,QACmB;CACnB,MAAM,EACJ,QACA,cACA,SACA,aACA,SACA,SACA,WACA,aACA,UACA,WACA,aACA,WACD,GAAG;AAEJ,KAAI,yBAA4B,eAAe,WAAW,QAAQ,CAGhE,OAAM,IAAI,cAAc;CAG1B,MAAM,WAAW,sBAAsB,SAAS,UAAU;CAE1D,MAAM,QAAQ,MAAM,2BAA2B;EAC7C;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC;AAEF,MAAK,MAAM,QACT,OAAM,MAAM;CAGd,MAAM,mBACJ,aAAa,MAAM,aAAa,EAAE,OAAQ,EAAC,EAAE,iBAAiB;CAEhE,MAAM,EAAE,MAAM,OAAO,GAAG,+BAA+B;EACrD,SAAS,MAAM,KAAK;EACpB,YAAY,MAAM,KAAK;EACvB;EACA,iBAAiB,MAAM,KAAK;EAC5B;EACA,UAAU,MAAM,KAAK;EACrB,UAAU;EACV,WAAW;CACZ,EAAC;AAEF,QAAO,YAAY;EACjB;EACA;EACA;EACA,SAAS,SAAS;EAClB,KAAK;EACL,cAAc;EACd;EACA;EACA;CACD,EAAC;AACH;;;;AAKD,eAAsB,6BACpBA,QACoB;CACpB,MAAM,SAAS,MAAM,sBAAsB,OAAO;AAClD,QAAO,OAAO,MAAM;AACrB"}
|
package/dist/test/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { Config } from "wagmi";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime16 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/test/test-utils.d.ts
|
|
7
7
|
declare const spawnAnvil: (args?: AnvilArgs) => Promise<void>;
|
|
@@ -236,7 +236,7 @@ declare const ReactTestWrapper: ({
|
|
|
236
236
|
}: {
|
|
237
237
|
children?: ReactNode;
|
|
238
238
|
wagmiConfig: Config;
|
|
239
|
-
}) =>
|
|
239
|
+
}) => react_jsx_runtime16.JSX.Element;
|
|
240
240
|
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/test/test-accounts.d.ts
|
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["spawnAnvil","AnvilArgs","Promise","killAnvilProcess","killAllAnvilProcesses","Record","ReactNode","Config","ReactTestWrapper","children","wagmiConfig","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["spawnAnvil","AnvilArgs","Promise","killAnvilProcess","killAllAnvilProcesses","Record","ReactNode","Config","ReactTestWrapper","children","wagmiConfig","react_jsx_runtime16","JSX","Element","Address","alice","bob","charlie"],"sources":["../../src/test/test-utils.d.ts","../../src/test/react-test-utils.d.ts","../../src/test/test-accounts.d.ts"],"sourcesContent":null,"mappings":";;;;;;cAAqBA,oBAAoBC,cAAcC;cAClCC,oCAAoCD;cACpCE,6BAA6BF;KAC7CD,SAAAA;;;AAHL;;;EAAkD,QAAKC,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAO;AAC9D;AACA;AAAgE;;;;ACAhE;;EAG6C,eAHHO,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EAAQ;;;;AAGL;;;;ACJ7C;EACqBO,kBAAKF,CAAAA,EAAAA,MAAO,GAAA,MAAA,GAAA,SAAA;EACZG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eFkGJZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCnGIG;;;;aACNF;eACEC;MACiBI,mBAAAA,CAAAC,GAAAA,CAAIC;;;;cCJjBE,OAAOD;cACPE,KAAKF;cACLG,SAASH"}
|
package/dist/uniswap/index.d.ts
CHANGED
|
@@ -210,6 +210,30 @@ declare function quoteSwapExactInViaRouter(params: QuoteSwapExactInViaRouterPara
|
|
|
210
210
|
*/
|
|
211
211
|
declare function quoteSwapExactOutViaRouter(params: QuoteSwapExactOutViaRouterParams): Promise<SimulationResult<SwapExactOutQuote>>;
|
|
212
212
|
|
|
213
|
+
//#endregion
|
|
214
|
+
//#region src/uniswap/v4/router/quoteByPoolKey.d.ts
|
|
215
|
+
interface QuoteV4ExactInByPoolKeyParams {
|
|
216
|
+
client: PublicClient;
|
|
217
|
+
chainId: bigint;
|
|
218
|
+
poolKey: PoolKey;
|
|
219
|
+
zeroForOne: boolean;
|
|
220
|
+
amountIn: bigint;
|
|
221
|
+
slippageBps: bigint;
|
|
222
|
+
blockNumber?: bigint;
|
|
223
|
+
addresses?: Partial<UniswapV4Addresses>;
|
|
224
|
+
}
|
|
225
|
+
interface V4ExactInQuote {
|
|
226
|
+
amountOut: bigint;
|
|
227
|
+
amountOutMinimum: bigint;
|
|
228
|
+
gasEstimate: bigint;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Quote an exact-in v4 swap for a specific PoolKey. Returns `null` when the
|
|
232
|
+
* quote reverts (pool missing / no liquidity) so callers can skip that pool when
|
|
233
|
+
* ranking venues rather than aborting the cycle.
|
|
234
|
+
*/
|
|
235
|
+
declare function quoteV4ExactInByPoolKey(params: QuoteV4ExactInByPoolKeyParams): Promise<V4ExactInQuote | null>;
|
|
236
|
+
|
|
213
237
|
//#endregion
|
|
214
238
|
//#region src/uniswap/v4/router/resolvePoolKey.d.ts
|
|
215
239
|
/**
|
|
@@ -287,5 +311,98 @@ declare function swapExactOutViaRouter(params: SwapExactOutViaRouterParams): Pro
|
|
|
287
311
|
declare function swapExactOutViaRouterAndWait(params: SwapExactOutViaRouterParams): Promise<TxReceipt>;
|
|
288
312
|
|
|
289
313
|
//#endregion
|
|
290
|
-
|
|
314
|
+
//#region src/uniswap/v3/addresses.d.ts
|
|
315
|
+
interface UniswapV3Addresses {
|
|
316
|
+
/** Uniswap v3 QuoterV2 — `quoteExactInputSingle` (revert/staticcall-based). */
|
|
317
|
+
quoterV2: Address;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Verified Uniswap v3 QuoterV2 addresses keyed by chainId. Add a chain only
|
|
321
|
+
* after verifying against the canonical Uniswap v3 deployment listing.
|
|
322
|
+
*/
|
|
323
|
+
declare const UNISWAP_V3_ADDRESSES: Record<number, UniswapV3Addresses>;
|
|
324
|
+
/**
|
|
325
|
+
* Resolve Uniswap v3 addresses for a chain, applying optional overrides.
|
|
326
|
+
*
|
|
327
|
+
* @throws {UnsupportedChainError} when the chain is not listed and overrides do
|
|
328
|
+
* not supply every required address.
|
|
329
|
+
*/
|
|
330
|
+
declare function getUniswapV3Addresses(chainId: number | bigint, overrides?: Partial<UniswapV3Addresses>): UniswapV3Addresses;
|
|
331
|
+
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/uniswap/v3/router/encodeSwap.d.ts
|
|
334
|
+
/** Universal Router command byte for a v3 exact-in swap. */
|
|
335
|
+
declare const V3_SWAP_EXACT_IN = 0;
|
|
336
|
+
/**
|
|
337
|
+
* Universal Router recipient sentinel: the router maps `address(1)` to
|
|
338
|
+
* `msg.sender` (the `execute` caller). Uniswap `Constants.MSG_SENDER`.
|
|
339
|
+
*/
|
|
340
|
+
declare const MSG_SENDER: Address;
|
|
341
|
+
/** Arguments for {@link buildV3SwapExecuteCalldata}. */
|
|
342
|
+
interface BuildV3SwapCalldataArgs {
|
|
343
|
+
/** Input token (funds pulled from the caller via Permit2). */
|
|
344
|
+
tokenIn: Address;
|
|
345
|
+
/** Output token. */
|
|
346
|
+
tokenOut: Address;
|
|
347
|
+
/** v3 pool fee tier (e.g. 500, 3000). */
|
|
348
|
+
fee: bigint;
|
|
349
|
+
/** Exact input amount (uint128). */
|
|
350
|
+
amountIn: bigint;
|
|
351
|
+
/** Minimum acceptable output (uint128). */
|
|
352
|
+
amountOutMinimum: bigint;
|
|
353
|
+
/**
|
|
354
|
+
* Absolute deadline (unix seconds) — the `execute(commands, inputs, deadline)`
|
|
355
|
+
* argument, enforced by the Universal Router.
|
|
356
|
+
*/
|
|
357
|
+
deadline: bigint;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Encode the packed v3 single-hop path `tokenIn ++ fee(uint24) ++ tokenOut`.
|
|
361
|
+
*/
|
|
362
|
+
declare function encodeV3Path(tokenIn: Address, fee: bigint, tokenOut: Address): Hex;
|
|
363
|
+
/**
|
|
364
|
+
* Build the typed `execute(...)` args for an exact-in single-hop v3 swap whose
|
|
365
|
+
* output is delivered to the `execute` caller (recipient = MSG_SENDER).
|
|
366
|
+
*/
|
|
367
|
+
declare function buildV3SwapExecuteArgs(args: BuildV3SwapCalldataArgs): {
|
|
368
|
+
args: readonly [Hex, readonly Hex[], bigint];
|
|
369
|
+
value: bigint;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Build the `execute(commands, inputs, deadline)` calldata for an exact-in
|
|
373
|
+
* single-hop v3 swap.
|
|
374
|
+
*/
|
|
375
|
+
declare function buildV3SwapExecuteCalldata(args: BuildV3SwapCalldataArgs): {
|
|
376
|
+
data: Hex;
|
|
377
|
+
value: bigint;
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/uniswap/v3/router/quote.d.ts
|
|
382
|
+
interface QuoteV3ExactInParams {
|
|
383
|
+
client: PublicClient;
|
|
384
|
+
chainId: bigint;
|
|
385
|
+
tokenIn: Address;
|
|
386
|
+
tokenOut: Address;
|
|
387
|
+
fee: bigint;
|
|
388
|
+
amountIn: bigint;
|
|
389
|
+
/** Slippage tolerance in bps, used to compute `amountOutMinimum`. */
|
|
390
|
+
slippageBps: bigint;
|
|
391
|
+
blockNumber?: bigint;
|
|
392
|
+
addresses?: Partial<UniswapV3Addresses>;
|
|
393
|
+
}
|
|
394
|
+
interface V3ExactInQuote {
|
|
395
|
+
amountOut: bigint;
|
|
396
|
+
amountOutMinimum: bigint;
|
|
397
|
+
gasEstimate: bigint;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Quote an exact-in v3 swap. Returns `null` when the quote reverts (e.g. the
|
|
401
|
+
* pool does not exist / has no liquidity) so callers can skip that pool when
|
|
402
|
+
* ranking venues, rather than aborting the whole cycle.
|
|
403
|
+
*/
|
|
404
|
+
declare function quoteV3ExactIn(params: QuoteV3ExactInParams): Promise<V3ExactInQuote | null>;
|
|
405
|
+
|
|
406
|
+
//#endregion
|
|
407
|
+
export { AmountExceedsUint128Error, ApproveErc20ForPermit2Params, ApproveRouterViaPermit2Params, BuildV3SwapCalldataArgs, BuildV4ExactOutSwapCalldataArgs, BuildV4SwapCalldataArgs, CheckRouterApprovalParams, InvalidSwapTokenError, MSG_SENDER, MissingSweepRecipientError, PERMIT2_ADDRESS, QuoteSwapExactInViaRouterParams, QuoteSwapExactOutViaRouterParams, QuoteV3ExactInParams, QuoteV4ExactInByPoolKeyParams, QuoterUnavailableError, ResolveSwapRouteParams, ResolvedSwapRoute, RouterApprovalStatus, SETTLE_ALL, SWAP_EXACT_IN_SINGLE, SWAP_EXACT_OUT_SINGLE, SWEEP, SwapExactInQuote, SwapExactInViaRouterParams, SwapExactOutQuote, SwapExactOutViaRouterParams, TAKE_ALL, UNISWAP_V3_ADDRESSES, UNISWAP_V4_ADDRESSES, UniswapV3Addresses, UniswapV4Addresses, UnsupportedChainError, V3ExactInQuote, V3_SWAP_EXACT_IN, V4ExactInQuote, V4_SWAP, approveErc20ForPermit2, approveErc20ForPermit2AndWait, approveRouterViaPermit2, approveRouterViaPermit2AndWait, buildV3SwapExecuteArgs, buildV3SwapExecuteCalldata, buildV4ExactOutSwapExecuteArgs, buildV4ExactOutSwapExecuteCalldata, buildV4SwapExecuteArgs, buildV4SwapExecuteCalldata, checkRouterApproval, encodeV3Path, getUniswapV3Addresses, getUniswapV4Addresses, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, quoteV3ExactIn, quoteV4ExactInByPoolKey, resolveSwapRoute, swapExactInViaRouter, swapExactInViaRouterAndWait, swapExactOutViaRouter, swapExactOutViaRouterAndWait };
|
|
291
408
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Address","Hex","PoolKey","V4_SWAP","SWAP_EXACT_IN_SINGLE","SETTLE_ALL","TAKE_ALL","TAKE","SWAP_EXACT_OUT_SINGLE","SWEEP","BuildV4SwapCalldataArgs","buildV4SwapExecuteArgs","buildV4SwapExecuteCalldata","BuildV4ExactOutSwapCalldataArgs","buildV4ExactOutSwapExecuteArgs","buildV4ExactOutSwapExecuteCalldata","Address","PanopticError","UnsupportedChainError","Error","InvalidSwapTokenError","AmountExceedsUint128Error","MissingSweepRecipientError","QuoterUnavailableError","TxReceipt","TxResult","ApproveErc20ForPermit2Params","ApproveRouterViaPermit2Params","CheckRouterApprovalParams","RouterApprovalStatus","checkRouterApproval","Promise","approveErc20ForPermit2","approveErc20ForPermit2AndWait","approveRouterViaPermit2","approveRouterViaPermit2AndWait","SimulationResult","QuoteSwapExactInViaRouterParams","QuoteSwapExactOutViaRouterParams","SwapExactInQuote","SwapExactOutQuote","quoteSwapExactInViaRouter","Promise","quoteSwapExactOutViaRouter","Address","PublicClient","PoolKey","ResolvedSwapRoute","ResolveSwapRouteParams","resolveSwapRoute","Promise","TxReceipt","TxResult","SwapExactInViaRouterParams","SwapExactOutViaRouterParams","swapExactInViaRouter","Promise","swapExactInViaRouterAndWait","swapExactOutViaRouter","swapExactOutViaRouterAndWait"],"sources":["../../src/uniswap/v4/router/encodeSwap.d.ts","../../src/uniswap/v4/router/errors.d.ts","../../src/uniswap/v4/router/permit2.d.ts","../../src/uniswap/v4/router/quote.d.ts","../../src/uniswap/v4/router/resolvePoolKey.d.ts","../../src/uniswap/v4/router/swap.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Address","Hex","PoolKey","V4_SWAP","SWAP_EXACT_IN_SINGLE","SETTLE_ALL","TAKE_ALL","TAKE","SWAP_EXACT_OUT_SINGLE","SWEEP","BuildV4SwapCalldataArgs","buildV4SwapExecuteArgs","buildV4SwapExecuteCalldata","BuildV4ExactOutSwapCalldataArgs","buildV4ExactOutSwapExecuteArgs","buildV4ExactOutSwapExecuteCalldata","Address","PanopticError","UnsupportedChainError","Error","InvalidSwapTokenError","AmountExceedsUint128Error","MissingSweepRecipientError","QuoterUnavailableError","TxReceipt","TxResult","ApproveErc20ForPermit2Params","ApproveRouterViaPermit2Params","CheckRouterApprovalParams","RouterApprovalStatus","checkRouterApproval","Promise","approveErc20ForPermit2","approveErc20ForPermit2AndWait","approveRouterViaPermit2","approveRouterViaPermit2AndWait","SimulationResult","QuoteSwapExactInViaRouterParams","QuoteSwapExactOutViaRouterParams","SwapExactInQuote","SwapExactOutQuote","quoteSwapExactInViaRouter","Promise","quoteSwapExactOutViaRouter","PublicClient","PoolKey","UniswapV4Addresses","QuoteV4ExactInByPoolKeyParams","Partial","V4ExactInQuote","quoteV4ExactInByPoolKey","Promise","Address","PublicClient","PoolKey","ResolvedSwapRoute","ResolveSwapRouteParams","resolveSwapRoute","Promise","TxReceipt","TxResult","SwapExactInViaRouterParams","SwapExactOutViaRouterParams","swapExactInViaRouter","Promise","swapExactInViaRouterAndWait","swapExactOutViaRouter","swapExactOutViaRouterAndWait","Address","UniswapV3Addresses","UNISWAP_V3_ADDRESSES","Record","getUniswapV3Addresses","Partial","Address","Hex","V3_SWAP_EXACT_IN","MSG_SENDER","BuildV3SwapCalldataArgs","encodeV3Path","buildV3SwapExecuteArgs","buildV3SwapExecuteCalldata","Address","PublicClient","UniswapV3Addresses","QuoteV3ExactInParams","Partial","V3ExactInQuote","quoteV3ExactIn","Promise"],"sources":["../../src/uniswap/v4/router/encodeSwap.d.ts","../../src/uniswap/v4/router/errors.d.ts","../../src/uniswap/v4/router/permit2.d.ts","../../src/uniswap/v4/router/quote.d.ts","../../src/uniswap/v4/router/quoteByPoolKey.d.ts","../../src/uniswap/v4/router/resolvePoolKey.d.ts","../../src/uniswap/v4/router/swap.d.ts","../../src/uniswap/v3/addresses.d.ts","../../src/uniswap/v3/router/encodeSwap.d.ts","../../src/uniswap/v3/router/quote.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;AAiEe2E,cAtCMxE,OAAAA,GAsCNwE,EAAAA;AAAG;cApCGvE,oBAAAA;;cAEAC,UAAAA;;cAEAC,QAAAA;;;;cAIAE,qBAAAA;;AAwCGG,cAtCHF,KAAAA,GAsCyB,CAAA;;;;AACZkE,UAnCjBjE,uBAAAA,CAmCiBiE;EAAG;WAjCxBrB;;;;;;EA0CW1C,gBAAAA,EAAAA,MAAAA;EAA0B;EAAA,OAAOF,EAlC5CwE,OAkC4CxE;EAAuB;EACnE,QAAA,EAjCCwE,OAiCD;;;;AAMb;;;;EAUoB,SAENA,CAAAA,EA3CEA,OA2CFA;EAAO;EAQC,QAEPP,CAAAA,EAnDAA,GAmDAA;AAAG;;;;;;;;;;;AAYM7D,iBAnDAH,sBAAAA,CAmD8B,IAAA,EAnDDD,uBAmDC,CAAA,EAAA;EAAA,IAAA,EAAA,SAAA,CAlDlCiE,GAkDkC,EAAA,SAlDpBA,GAkDoB,EAAA,EAAA,MAAA,CAAA;EAAA,KAAO9D,EAAAA,MAAAA;CAA+B;;AACvD;;;;;iBA1CbD,0BAAAA,OAAiCF;QAC/CiE;EAkDc5D,KAAAA,EAAAA,MAAAA;CAAkC;;;AAC7C;UA7CIF,+BAAAA;;WAEJyC;;;;;ECjFQpC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