@panoptic-eng/sdk 1.0.57 → 1.0.58
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/{chainDeployments-D_bvyWEm.js → chainDeployments-CmDzAmZ3.js} +12 -11
- package/dist/{cow-45nsAaEr.js → cow-CaVnyjiG.js} +1 -1
- package/dist/deployments.d.ts +2 -0
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +12 -11
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +24 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -1
- package/dist/{irm-DsM35dGO.js → irm-BGGqQprG.js} +1 -1
- package/dist/panoptic/v2/index.d.ts +1 -1
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +79 -46
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/panoptic/v2/react-public.d.ts +1 -1
- package/dist/panoptic/v2/react-public.d.ts.map +1 -1
- package/dist/panoptic/v2/react-public.js +79 -46
- package/dist/panoptic/v2/react-public.js.map +1 -1
- package/dist/{rates-CEJz8fjw.js → rates-B0uPUed1.js} +1 -1
- package/dist/{router-DUOHNdYZ.js → router-C5v6J0jv.js} +2 -2
- package/dist/{router-DOUAKfn6.js → router-CF7xBH_o.js} +2 -2
- package/dist/{transactionFees-qweht4Rd.js → transactionFees-CNbjAigT.js} +1 -1
- package/dist/{v2-B3MqHVHt.js → v2-BybBPXaj.js} +71 -39
- package/dist/vault-transaction-fees.js +12 -11
- package/dist/vault-transaction-fees.js.map +1 -1
- package/dist/{writes-CQrevcCu.js → writes-Da5PWxJ9.js} +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError, ContractFunctionExecutionError, ContractFunctionRevertedError, ExecutionRevertedError, decodeAbiParameters, decodeErrorResult, decodeEventLog, decodeFunctionData, decodeFunctionResult, encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, getAbiItem, getAddress, isAddressEqual, keccak256, maxUint256, parseAbi, stringToHex, toFunctionSelector, toHex, zeroAddress } from "viem";
|
|
1
|
+
import { BaseError, ContractFunctionExecutionError, ContractFunctionRevertedError, ExecutionRevertedError, decodeAbiParameters, decodeErrorResult, decodeEventLog, decodeFunctionData, decodeFunctionResult, encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, getAbiItem, getAddress, hexToString, isAddressEqual, keccak256, maxUint256, parseAbi, stringToHex, toFunctionSelector, toHex, trim, zeroAddress } from "viem";
|
|
2
2
|
import { call, multicall } from "viem/actions";
|
|
3
3
|
import Decimal from "decimal.js";
|
|
4
4
|
import { keepPreviousData, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -23647,6 +23647,44 @@ const erc20MetaAbi = [
|
|
|
23647
23647
|
stateMutability: "view"
|
|
23648
23648
|
}
|
|
23649
23649
|
];
|
|
23650
|
+
const erc20Bytes32MetaAbi = [{
|
|
23651
|
+
type: "function",
|
|
23652
|
+
name: "symbol",
|
|
23653
|
+
inputs: [],
|
|
23654
|
+
outputs: [{ type: "bytes32" }],
|
|
23655
|
+
stateMutability: "view"
|
|
23656
|
+
}, {
|
|
23657
|
+
type: "function",
|
|
23658
|
+
name: "name",
|
|
23659
|
+
inputs: [],
|
|
23660
|
+
outputs: [{ type: "bytes32" }],
|
|
23661
|
+
stateMutability: "view"
|
|
23662
|
+
}];
|
|
23663
|
+
async function readTokenText(client, blockNumber, calls) {
|
|
23664
|
+
const asString = await client.multicall({
|
|
23665
|
+
allowFailure: true,
|
|
23666
|
+
blockNumber,
|
|
23667
|
+
contracts: calls.map((call$1) => ({
|
|
23668
|
+
...call$1,
|
|
23669
|
+
abi: erc20MetaAbi
|
|
23670
|
+
}))
|
|
23671
|
+
});
|
|
23672
|
+
if (asString.every((result) => result.status === "success")) return asString.map((result) => result.result);
|
|
23673
|
+
const asBytes32 = await client.multicall({
|
|
23674
|
+
allowFailure: true,
|
|
23675
|
+
blockNumber,
|
|
23676
|
+
contracts: calls.map((call$1) => ({
|
|
23677
|
+
...call$1,
|
|
23678
|
+
abi: erc20Bytes32MetaAbi
|
|
23679
|
+
}))
|
|
23680
|
+
});
|
|
23681
|
+
return asString.map((result, index) => {
|
|
23682
|
+
if (result.status === "success") return result.result;
|
|
23683
|
+
const fallback = asBytes32[index];
|
|
23684
|
+
if (fallback.status !== "success") throw fallback.error;
|
|
23685
|
+
return hexToString(trim(fallback.result, { dir: "right" }));
|
|
23686
|
+
});
|
|
23687
|
+
}
|
|
23650
23688
|
/**
|
|
23651
23689
|
* Fetch core data for a Uniswap V3 pool directly from chain.
|
|
23652
23690
|
*
|
|
@@ -23691,42 +23729,36 @@ async function getUniswapV3PoolInfo(params) {
|
|
|
23691
23729
|
}
|
|
23692
23730
|
]
|
|
23693
23731
|
});
|
|
23694
|
-
const [t0Symbol, t0Name,
|
|
23732
|
+
const [[t0Symbol, t0Name, t1Symbol, t1Name], [t0Decimals, t1Decimals]] = await Promise.all([readTokenText(client, _meta.blockNumber, [
|
|
23733
|
+
{
|
|
23734
|
+
address: token0Addr,
|
|
23735
|
+
functionName: "symbol"
|
|
23736
|
+
},
|
|
23737
|
+
{
|
|
23738
|
+
address: token0Addr,
|
|
23739
|
+
functionName: "name"
|
|
23740
|
+
},
|
|
23741
|
+
{
|
|
23742
|
+
address: token1Addr,
|
|
23743
|
+
functionName: "symbol"
|
|
23744
|
+
},
|
|
23745
|
+
{
|
|
23746
|
+
address: token1Addr,
|
|
23747
|
+
functionName: "name"
|
|
23748
|
+
}
|
|
23749
|
+
]), client.multicall({
|
|
23695
23750
|
allowFailure: false,
|
|
23696
23751
|
blockNumber: _meta.blockNumber,
|
|
23697
|
-
contracts: [
|
|
23698
|
-
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
},
|
|
23708
|
-
{
|
|
23709
|
-
address: token0Addr,
|
|
23710
|
-
abi: erc20MetaAbi,
|
|
23711
|
-
functionName: "decimals"
|
|
23712
|
-
},
|
|
23713
|
-
{
|
|
23714
|
-
address: token1Addr,
|
|
23715
|
-
abi: erc20MetaAbi,
|
|
23716
|
-
functionName: "symbol"
|
|
23717
|
-
},
|
|
23718
|
-
{
|
|
23719
|
-
address: token1Addr,
|
|
23720
|
-
abi: erc20MetaAbi,
|
|
23721
|
-
functionName: "name"
|
|
23722
|
-
},
|
|
23723
|
-
{
|
|
23724
|
-
address: token1Addr,
|
|
23725
|
-
abi: erc20MetaAbi,
|
|
23726
|
-
functionName: "decimals"
|
|
23727
|
-
}
|
|
23728
|
-
]
|
|
23729
|
-
});
|
|
23752
|
+
contracts: [{
|
|
23753
|
+
address: token0Addr,
|
|
23754
|
+
abi: erc20MetaAbi,
|
|
23755
|
+
functionName: "decimals"
|
|
23756
|
+
}, {
|
|
23757
|
+
address: token1Addr,
|
|
23758
|
+
abi: erc20MetaAbi,
|
|
23759
|
+
functionName: "decimals"
|
|
23760
|
+
}]
|
|
23761
|
+
})]);
|
|
23730
23762
|
return {
|
|
23731
23763
|
poolAddress,
|
|
23732
23764
|
token0: {
|
|
@@ -31908,7 +31940,7 @@ var _1 = {
|
|
|
31908
31940
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
31909
31941
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
31910
31942
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
31911
|
-
"riskEngine": "
|
|
31943
|
+
"riskEngine": "0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31912
31944
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
31913
31945
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
31914
31946
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -31919,12 +31951,7 @@ var _1 = {
|
|
|
31919
31951
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
31920
31952
|
}
|
|
31921
31953
|
},
|
|
31922
|
-
"riskEngines": [
|
|
31923
|
-
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31924
|
-
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
31925
|
-
"0x0000000000000e673aECBDB5f5fE5DFAf4a8e9Ac",
|
|
31926
|
-
"0x0000000000000E65545005B26207D7edFd031260"
|
|
31927
|
-
],
|
|
31954
|
+
"riskEngines": ["0x000000000000075e29cdaa9cb640a69e148ca7da", "0x0000000000000fe1e261f66ce2f44def4f5ae0cb"],
|
|
31928
31955
|
"markets": { "ethUsdc30bps": {
|
|
31929
31956
|
"currency0": "0x0000000000000000000000000000000000000000",
|
|
31930
31957
|
"currency1": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -31943,7 +31970,8 @@ var _1 = {
|
|
|
31943
31970
|
"poolId": "2824133844976349",
|
|
31944
31971
|
"fee": 500,
|
|
31945
31972
|
"weth": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
|
31946
|
-
}
|
|
31973
|
+
},
|
|
31974
|
+
"deprecatedRiskEngines": ["0x0000000000000e673aECBDB5f5fE5DFAf4a8e9Ac", "0x0000000000000E65545005B26207D7edFd031260"]
|
|
31947
31975
|
};
|
|
31948
31976
|
var _4663 = {
|
|
31949
31977
|
"chainId": 4663,
|
|
@@ -31987,7 +32015,7 @@ var _4663 = {
|
|
|
31987
32015
|
"semiFungiblePositionManagerV4": "0x00000000000005C3287f136Ef5AF56c68Ea6849f",
|
|
31988
32016
|
"semiFungiblePositionManagerV3": "0x00000000000005E4693aDc8Ec0f12D686f728198",
|
|
31989
32017
|
"builderFactory": "0x0000000000000a3D22E158417AA639D7F71b0FF7",
|
|
31990
|
-
"riskEngine": "
|
|
32018
|
+
"riskEngine": "0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
31991
32019
|
"panopticPoolImplementation": "0x000000000000135429F0DaCaB61639Bf6a63EbbC",
|
|
31992
32020
|
"collateralTrackerImplementation": "0x0000000000001d9c38CA405A2e04420865A08A33",
|
|
31993
32021
|
"panopticFactoryV4": "0x0000000000000c51d0f8cf4bd9adE7191372a625",
|
|
@@ -31998,7 +32026,11 @@ var _4663 = {
|
|
|
31998
32026
|
"interactionHelper": "0x00000000000041fe14Ce3c2392337CE501aE8328"
|
|
31999
32027
|
}
|
|
32000
32028
|
},
|
|
32001
|
-
"riskEngines": [
|
|
32029
|
+
"riskEngines": [
|
|
32030
|
+
"0x000000000000075e29cdaa9cb640a69e148ca7da",
|
|
32031
|
+
"0x0000000000000fe1e261f66ce2f44def4f5ae0cb",
|
|
32032
|
+
"0x0000000000000f3fb82469581A74776178E76Ca4"
|
|
32033
|
+
],
|
|
32002
32034
|
"markets": { "spyUsdg": {
|
|
32003
32035
|
"currency0": "0x117cc2133c37B721F49dE2A7a74833232B3B4C0C",
|
|
32004
32036
|
"currency1": "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
|
|
@@ -32009,7 +32041,8 @@ var _4663 = {
|
|
|
32009
32041
|
"subgraphs": {
|
|
32010
32042
|
"hypovault": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/hypovault-subgraph-robinhood/prod/gn",
|
|
32011
32043
|
"panoptic": "https://api.goldsky.com/api/public/project_cl9gc21q105380hxuh8ks53k3/subgraphs/panoptic-subgraph-robinhood/v2_prod/gn"
|
|
32012
|
-
}
|
|
32044
|
+
},
|
|
32045
|
+
"deprecatedRiskEngines": ["0x0000000000000E65545005B26207D7edFd031260"]
|
|
32013
32046
|
};
|
|
32014
32047
|
var _8453 = {
|
|
32015
32048
|
"chainId": 8453,
|