@panoptic-eng/sdk 1.0.49 → 1.0.51
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.map +1 -1
- package/dist/{cow-DMX9ebPk.js → cow-CSSKPknb.js} +1 -1
- package/dist/deployments.d.ts +12 -4
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +78 -10
- package/dist/deployments.js.map +1 -1
- package/dist/{greeks-9aTE-DwO.js → greeks-CNi1-cnp.js} +39 -16
- package/dist/index.d.ts +518 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +724 -91
- package/dist/index.js.map +1 -1
- package/dist/{irm-mySi_YMF.js → irm-BJaJSUjF.js} +80 -12
- package/dist/panoptic/v2/greeks/index.d.ts +12 -1
- package/dist/panoptic/v2/greeks/index.d.ts.map +1 -1
- package/dist/panoptic/v2/greeks/index.js +39 -16
- package/dist/panoptic/v2/greeks/index.js.map +1 -1
- package/dist/panoptic/v2/index.d.ts +1336 -74
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +20322 -18660
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +1518 -240
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +11518 -9319
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{rates-CDLIUGDz.js → rates-COAJpKRd.js} +612 -73
- package/dist/{router-45ulPnWe.js → router-B-I1eACz.js} +5 -43
- package/dist/router-BSS7HKd2.js +837 -0
- package/dist/{transactionFees-DUm6ilXB.js → transactionFees-DE-Whxab.js} +24 -8
- package/dist/uniswap/index.d.ts +465 -215
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +1799 -1076
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{v2-DshssxX4.js → v2-zF6b01PI.js} +2488 -1596
- package/dist/vault-transaction-fees.d.ts +9 -4
- package/dist/vault-transaction-fees.d.ts.map +1 -1
- package/dist/vault-transaction-fees.js +24 -8
- package/dist/vault-transaction-fees.js.map +1 -1
- package/dist/{writes-2reV_omF.js → writes-D1zN0v9x.js} +4 -3
- package/dist/zodiac/index.d.ts +51 -7
- package/dist/zodiac/index.d.ts.map +1 -1
- package/dist/zodiac/index.js +154 -2
- package/dist/zodiac/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/router-B2jY9Nyb.js +0 -312
|
@@ -1,47 +1,7 @@
|
|
|
1
|
-
import { PanopticError, getBlockMeta, getPool, submitWrite } from "./rates-
|
|
2
|
-
import { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, QuoterUnavailableError,
|
|
1
|
+
import { PanopticError, getBlockMeta, getPool, submitWrite } from "./rates-COAJpKRd.js";
|
|
2
|
+
import { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, QuoterUnavailableError, getUniswapV4Addresses, universalRouterAbi } from "./router-BSS7HKd2.js";
|
|
3
3
|
import { BaseError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, isAddressEqual, maxUint256, zeroAddress } from "viem";
|
|
4
4
|
|
|
5
|
-
//#region src/uniswap/v4/addresses.ts
|
|
6
|
-
/**
|
|
7
|
-
* Canonical Permit2, identical across all chains.
|
|
8
|
-
*/
|
|
9
|
-
const PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
|
|
10
|
-
/**
|
|
11
|
-
* Verified Uniswap v4 deployment addresses keyed by chainId.
|
|
12
|
-
*
|
|
13
|
-
* Sourced from the official Uniswap v4 deployments. Add a chain here only after
|
|
14
|
-
* verifying each address against the canonical Uniswap deployment listing —
|
|
15
|
-
* Universal Router in particular is NOT the same address across chains.
|
|
16
|
-
*/
|
|
17
|
-
const UNISWAP_V4_ADDRESSES = { 1: {
|
|
18
|
-
universalRouter: "0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af",
|
|
19
|
-
v4Quoter: "0x52F0E24D1c21C8A0cB1e5a5dD6198556BD9E1203",
|
|
20
|
-
poolManager: "0x000000000004444c5dc75cB358380D2e3dE08A90",
|
|
21
|
-
positionManager: "0xbD216513d74C8cf14cf4747E6AaA6420FF64ee9e",
|
|
22
|
-
permit2: PERMIT2_ADDRESS
|
|
23
|
-
} };
|
|
24
|
-
/**
|
|
25
|
-
* Resolve the Uniswap v4 addresses for a chain, applying optional overrides.
|
|
26
|
-
*
|
|
27
|
-
* @param chainId - Target chain ID.
|
|
28
|
-
* @param overrides - Partial override of any address (e.g. for fork tests).
|
|
29
|
-
* @returns Fully-resolved {@link UniswapV4Addresses}.
|
|
30
|
-
* @throws {UnsupportedChainError} when the chain is not listed and the
|
|
31
|
-
* overrides do not supply every required address.
|
|
32
|
-
*/
|
|
33
|
-
function getUniswapV4Addresses(chainId, overrides) {
|
|
34
|
-
const base = UNISWAP_V4_ADDRESSES[Number(chainId)];
|
|
35
|
-
const merged = {
|
|
36
|
-
...base,
|
|
37
|
-
...overrides,
|
|
38
|
-
permit2: overrides?.permit2 ?? base?.permit2 ?? PERMIT2_ADDRESS
|
|
39
|
-
};
|
|
40
|
-
if (merged.universalRouter === void 0 || merged.v4Quoter === void 0 || merged.poolManager === void 0 || merged.positionManager === void 0 || merged.permit2 === void 0) throw new UnsupportedChainError(chainId);
|
|
41
|
-
return merged;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
5
|
//#region src/uniswap/v4/router/encodeSwap.ts
|
|
46
6
|
/** Universal Router command byte for a v4 swap. */
|
|
47
7
|
const V4_SWAP = 16;
|
|
@@ -891,6 +851,7 @@ async function swapExactInViaRouter(params) {
|
|
|
891
851
|
});
|
|
892
852
|
if (!quote.success) throw quote.error;
|
|
893
853
|
const resolvedDeadline = deadline ?? (await getBlockMeta({ client })).blockTimestamp + DEFAULT_DEADLINE_SECONDS;
|
|
854
|
+
if (!quote.data.poolKey) throw new PanopticError("v4 swap requires a poolKey from the quote");
|
|
894
855
|
const { args, value } = buildV4SwapExecuteArgs({
|
|
895
856
|
poolKey: quote.data.poolKey,
|
|
896
857
|
zeroForOne: quote.data.zeroForOne,
|
|
@@ -946,6 +907,7 @@ async function swapExactOutViaRouter(params) {
|
|
|
946
907
|
});
|
|
947
908
|
if (!quote.success) throw quote.error;
|
|
948
909
|
const resolvedDeadline = deadline ?? (await getBlockMeta({ client })).blockTimestamp + DEFAULT_DEADLINE_SECONDS;
|
|
910
|
+
if (!quote.data.poolKey) throw new PanopticError("v4 swap requires a poolKey from the quote");
|
|
949
911
|
const { args, value } = buildV4ExactOutSwapExecuteArgs({
|
|
950
912
|
poolKey: quote.data.poolKey,
|
|
951
913
|
zeroForOne: quote.data.zeroForOne,
|
|
@@ -977,4 +939,4 @@ async function swapExactOutViaRouterAndWait(params) {
|
|
|
977
939
|
}
|
|
978
940
|
|
|
979
941
|
//#endregion
|
|
980
|
-
export {
|
|
942
|
+
export { SETTLE_ALL, SWAP_EXACT_IN_SINGLE, SWAP_EXACT_OUT_SINGLE, SWEEP, TAKE_ALL, V4_SWAP, approveErc20ForPermit2, approveErc20ForPermit2AndWait, approveRouterViaPermit2, approveRouterViaPermit2AndWait, buildV4ExactOutSwapExecuteArgs, buildV4ExactOutSwapExecuteCalldata, buildV4SwapExecuteArgs, buildV4SwapExecuteCalldata, checkRouterApproval, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, quoteV4ExactInByPoolKey, resolveSwapRoute, swapExactInViaRouter, swapExactInViaRouterAndWait, swapExactOutViaRouter, swapExactOutViaRouterAndWait };
|