@tokemak/queries 0.2.0 → 0.3.0
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/functions/getAutopoolUser.d.ts +14 -0
- package/dist/functions/getAutopoolUser.d.ts.map +1 -1
- package/dist/functions/getAutopoolUserHistory.d.ts +0 -1
- package/dist/functions/getAutopoolUserHistory.d.ts.map +1 -1
- package/dist/functions/getAutopools.d.ts +25 -15
- package/dist/functions/getAutopools.d.ts.map +1 -1
- package/dist/functions/getChainAutopools.d.ts +26 -16
- package/dist/functions/getChainAutopools.d.ts.map +1 -1
- package/dist/functions/getChainUserActivity.d.ts +0 -1
- package/dist/functions/getChainUserActivity.d.ts.map +1 -1
- package/dist/functions/getMerklCreatorApr.d.ts +1 -1
- package/dist/functions/getMerklCreatorApr.d.ts.map +1 -1
- package/dist/functions/getTokenPrices.d.ts +107 -71
- package/dist/functions/getTokenPrices.d.ts.map +1 -1
- package/dist/functions/getUserAutopool.d.ts +3 -3
- package/dist/functions/getUserAutopoolBalanceChanges.d.ts.map +1 -1
- package/dist/functions/getUserAutopools.d.ts +27 -9
- package/dist/functions/getUserAutopools.d.ts.map +1 -1
- package/dist/functions/getUserMerklRewards.d.ts.map +1 -1
- package/dist/functions/getUserTokenBalances.d.ts +1 -2
- package/dist/functions/getUserTokenBalances.d.ts.map +1 -1
- package/dist/functions/index.d.ts +0 -1
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/index.js +62 -93
- package/dist/index.mjs +59 -87
- package/dist/utils/convertBaseAssetToTokenPricesAndDenom.d.ts +2 -0
- package/dist/utils/convertBaseAssetToTokenPricesAndDenom.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/functions/getBaseChainUserActivity.d.ts +0 -10
- package/dist/functions/getBaseChainUserActivity.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -776,9 +776,15 @@ var getChainAutopools = async (wagmiConfig, {
|
|
|
776
776
|
exchange: getProtocol(destination.exchangeName)
|
|
777
777
|
};
|
|
778
778
|
});
|
|
779
|
+
const HIDDEN_DESTINATION_SYMBOLS = ["USR", "WSTUSR"];
|
|
780
|
+
const filteredDestinations = destinations.filter(
|
|
781
|
+
(d) => !d.underlyingTokens.some(
|
|
782
|
+
(t) => HIDDEN_DESTINATION_SYMBOLS.includes(t.symbol?.toUpperCase())
|
|
783
|
+
)
|
|
784
|
+
);
|
|
779
785
|
const uniqueExchanges = Array.from(
|
|
780
786
|
new Set(
|
|
781
|
-
|
|
787
|
+
filteredDestinations.map((d) => getProtocol(d.exchangeName)).filter(Boolean)
|
|
782
788
|
)
|
|
783
789
|
);
|
|
784
790
|
const uniqueExchangesWithValueHeld = uniqueExchanges.map((exchange) => {
|
|
@@ -814,7 +820,7 @@ var getChainAutopools = async (wagmiConfig, {
|
|
|
814
820
|
},
|
|
815
821
|
[]
|
|
816
822
|
);
|
|
817
|
-
const uniqueTokensWithValueHeldMap =
|
|
823
|
+
const uniqueTokensWithValueHeldMap = filteredDestinations.flatMap((d) => d.underlyingTokens).reduce((acc, token) => {
|
|
818
824
|
if (acc[token.address]) {
|
|
819
825
|
acc[token.address].valueUsd += token.valueUsd;
|
|
820
826
|
acc[token.address].value += token.value;
|
|
@@ -823,19 +829,20 @@ var getChainAutopools = async (wagmiConfig, {
|
|
|
823
829
|
}
|
|
824
830
|
return acc;
|
|
825
831
|
}, {});
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
832
|
+
const HIDDEN_TOKEN_SYMBOLS = ["USR", "WSTUSR"];
|
|
833
|
+
const uniqueTokens = Object.values(uniqueTokensWithValueHeldMap).filter(
|
|
834
|
+
(token) => !HIDDEN_TOKEN_SYMBOLS.includes(token.symbol?.toUpperCase())
|
|
835
|
+
).map((token) => {
|
|
836
|
+
let valueUsd = token.valueUsd;
|
|
837
|
+
let value = token.value;
|
|
838
|
+
const allocation = value / totalAssets;
|
|
839
|
+
return {
|
|
840
|
+
...token,
|
|
841
|
+
valueUsd,
|
|
842
|
+
value,
|
|
843
|
+
allocation
|
|
844
|
+
};
|
|
845
|
+
});
|
|
839
846
|
let UIBaseAsset = baseAsset;
|
|
840
847
|
if (baseAsset.symbol?.toLowerCase() === WETH_TOKEN.symbol.toLowerCase()) {
|
|
841
848
|
UIBaseAsset = ETH_TOKEN;
|
|
@@ -876,6 +883,9 @@ var getChainAutopools = async (wagmiConfig, {
|
|
|
876
883
|
}
|
|
877
884
|
extraApr = extraRewards.reduce((acc, reward) => acc + reward.apr, 0);
|
|
878
885
|
if (baseApr === void 0) baseApr = 0;
|
|
886
|
+
if (autopool.symbol === "autoETH") {
|
|
887
|
+
baseApr = 0.024;
|
|
888
|
+
}
|
|
879
889
|
const combinedApr = baseApr + extraApr;
|
|
880
890
|
let denominatedToken = ETH_TOKEN;
|
|
881
891
|
let useDenominatedValues = false;
|
|
@@ -1017,7 +1027,7 @@ var getChainAutopools = async (wagmiConfig, {
|
|
|
1017
1027
|
...autopool,
|
|
1018
1028
|
tvl,
|
|
1019
1029
|
totalAssets: assets,
|
|
1020
|
-
destinations,
|
|
1030
|
+
destinations: filteredDestinations,
|
|
1021
1031
|
exchanges: groupedExchanges,
|
|
1022
1032
|
timestamp,
|
|
1023
1033
|
isNew,
|
|
@@ -3040,7 +3050,9 @@ import {
|
|
|
3040
3050
|
USDT_TOKEN,
|
|
3041
3051
|
XPL_TOKEN as XPL_TOKEN2,
|
|
3042
3052
|
USDT0_TOKEN,
|
|
3043
|
-
AUTO_TOKEN as AUTO_TOKEN3
|
|
3053
|
+
AUTO_TOKEN as AUTO_TOKEN3,
|
|
3054
|
+
MON_TOKEN,
|
|
3055
|
+
WMON_TOKEN
|
|
3044
3056
|
} from "@tokemak/tokenlist";
|
|
3045
3057
|
import { TOKEMAK_PRICES_STAGING_URL } from "@tokemak/constants";
|
|
3046
3058
|
|
|
@@ -3075,12 +3087,14 @@ var PRICED_TOKENS = [
|
|
|
3075
3087
|
{ ...AUTO_TOKEN3, symbol: "AUTO" },
|
|
3076
3088
|
{ ...SILO_TOKEN, symbol: "SILO" },
|
|
3077
3089
|
{ ...XPL_TOKEN2, address: WXPL_TOKEN2.address, symbol: "XPL" },
|
|
3090
|
+
{ ...MON_TOKEN, address: WMON_TOKEN.address, symbol: "MON" },
|
|
3078
3091
|
{ ...USDT0_TOKEN, symbol: "USDT0" }
|
|
3079
3092
|
];
|
|
3080
3093
|
var WRAPPED_TOKENS = [
|
|
3081
3094
|
{ ...WETH_TOKEN2, symbol: "WETH" },
|
|
3082
3095
|
{ ...WS_TOKEN2, symbol: "WS" },
|
|
3083
|
-
{ ...WXPL_TOKEN2, symbol: "WXPL" }
|
|
3096
|
+
{ ...WXPL_TOKEN2, symbol: "WXPL" },
|
|
3097
|
+
{ ...WMON_TOKEN, symbol: "WMON" }
|
|
3084
3098
|
];
|
|
3085
3099
|
var isStale = (timestamp) => {
|
|
3086
3100
|
return timestamp - Math.floor(Date.now() / 1e3) > 5 * 60;
|
|
@@ -4172,27 +4186,15 @@ var getUserAutopools = async ({
|
|
|
4172
4186
|
|
|
4173
4187
|
// functions/getUserTokenBalances.ts
|
|
4174
4188
|
import { hexToBigInt } from "viem";
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
switch (chainId) {
|
|
4178
|
-
case mainnet8.id:
|
|
4179
|
-
return `https://eth-mainnet.g.alchemy.com/v2/${apiKey}`;
|
|
4180
|
-
case base2.id:
|
|
4181
|
-
return `https://base-mainnet.g.alchemy.com/v2/${apiKey}`;
|
|
4182
|
-
case sonic2.id:
|
|
4183
|
-
return `https://sonic-mainnet.g.alchemy.com/v2/${apiKey}`;
|
|
4184
|
-
default:
|
|
4185
|
-
throw new Error("Unsupported network");
|
|
4186
|
-
}
|
|
4189
|
+
var networkToAlchemyUrl = (chainId) => {
|
|
4190
|
+
return `https://rpc.autopool-services.com/${chainId}/ui`;
|
|
4187
4191
|
};
|
|
4188
4192
|
var getUserTokenBalances = async ({
|
|
4189
4193
|
address,
|
|
4190
|
-
apiKey,
|
|
4191
4194
|
chainId
|
|
4192
4195
|
}) => {
|
|
4193
4196
|
if (!address) throw new Error("Address is not defined");
|
|
4194
|
-
|
|
4195
|
-
const url = networkToAlchemyUrl(chainId, apiKey);
|
|
4197
|
+
const url = networkToAlchemyUrl(chainId);
|
|
4196
4198
|
const body = {
|
|
4197
4199
|
jsonrpc: "2.0",
|
|
4198
4200
|
method: "alchemy_getTokenBalances",
|
|
@@ -4303,35 +4305,6 @@ var getUserActivity = async ({
|
|
|
4303
4305
|
return mergedActivity;
|
|
4304
4306
|
};
|
|
4305
4307
|
|
|
4306
|
-
// functions/getBaseChainUserActivity.ts
|
|
4307
|
-
import { getSdkByChainId as getSdkByChainId14 } from "@tokemak/graph-cli";
|
|
4308
|
-
var BASE_CHAIN_ID = 8453;
|
|
4309
|
-
var getBaseChainUserActivity = async (address) => {
|
|
4310
|
-
const { GetUserActivity } = getSdkByChainId14(BASE_CHAIN_ID);
|
|
4311
|
-
try {
|
|
4312
|
-
const result = await GetUserActivity({ address });
|
|
4313
|
-
return (result.userActivities ?? []).map((activity) => {
|
|
4314
|
-
const eventType = activity.type === "VaultDeposit" ? "Deposit" : activity.type === "VaultWithdraw" ? "Withdrawal" : activity.type === "Stake" ? "Stake" : activity.type === "Unstake" ? "Unstake" : "Unknown";
|
|
4315
|
-
return {
|
|
4316
|
-
id: activity.id,
|
|
4317
|
-
timestamp: Number(activity.timestamp),
|
|
4318
|
-
eventType,
|
|
4319
|
-
assets: (() => {
|
|
4320
|
-
try {
|
|
4321
|
-
return JSON.parse(activity.data)?.assets ?? null;
|
|
4322
|
-
} catch {
|
|
4323
|
-
return null;
|
|
4324
|
-
}
|
|
4325
|
-
})(),
|
|
4326
|
-
transactionHash: activity.transactionHash ?? void 0
|
|
4327
|
-
};
|
|
4328
|
-
});
|
|
4329
|
-
} catch (e) {
|
|
4330
|
-
console.log(e);
|
|
4331
|
-
return [];
|
|
4332
|
-
}
|
|
4333
|
-
};
|
|
4334
|
-
|
|
4335
4308
|
// functions/getUserAutopoolsRewards.ts
|
|
4336
4309
|
import { getAddress as getAddress4 } from "viem";
|
|
4337
4310
|
|
|
@@ -4560,7 +4533,7 @@ var getAutopilotRouter = async (wagmiConfig, { chainId }) => await getAddressFro
|
|
|
4560
4533
|
// functions/getSwapQuote.ts
|
|
4561
4534
|
import { getCoreConfig as getCoreConfig4 } from "@tokemak/config";
|
|
4562
4535
|
import { ETH_TOKEN as ETH_TOKEN7, WS_TOKEN as WS_TOKEN3, WXPL_TOKEN as WXPL_TOKEN3 } from "@tokemak/tokenlist";
|
|
4563
|
-
import { plasma as plasma2, sonic as
|
|
4536
|
+
import { plasma as plasma2, sonic as sonic2 } from "viem/chains";
|
|
4564
4537
|
var getSwapQuote = async (config, { chainId, ...params }) => {
|
|
4565
4538
|
try {
|
|
4566
4539
|
if (!params.sellToken || !params.buyToken) {
|
|
@@ -4568,7 +4541,7 @@ var getSwapQuote = async (config, { chainId, ...params }) => {
|
|
|
4568
4541
|
}
|
|
4569
4542
|
if (params.sellToken === ETH_TOKEN7.address) {
|
|
4570
4543
|
params.sellToken = getCoreConfig4(chainId).weth;
|
|
4571
|
-
if (chainId ===
|
|
4544
|
+
if (chainId === sonic2.id) {
|
|
4572
4545
|
params.sellToken = WS_TOKEN3.address;
|
|
4573
4546
|
}
|
|
4574
4547
|
if (chainId === plasma2.id) {
|
|
@@ -4974,7 +4947,7 @@ var getCurrentCycleId = async (wagmiConfig, {
|
|
|
4974
4947
|
};
|
|
4975
4948
|
|
|
4976
4949
|
// functions/getChainUserSToke.ts
|
|
4977
|
-
import { getSdkByChainId as
|
|
4950
|
+
import { getSdkByChainId as getSdkByChainId14 } from "@tokemak/graph-cli";
|
|
4978
4951
|
var getChainUserSToke = async (wagmiConfig, {
|
|
4979
4952
|
address,
|
|
4980
4953
|
tokePrice,
|
|
@@ -4984,7 +4957,7 @@ var getChainUserSToke = async (wagmiConfig, {
|
|
|
4984
4957
|
const { stoke } = getCoreConfig7(chainId);
|
|
4985
4958
|
const cycleIndex = await getCurrentCycleId(wagmiConfig, { chainId, stoke });
|
|
4986
4959
|
if (address && cycleIndex && stoke && tokePrice) {
|
|
4987
|
-
const { GetUserSTokeBalance } =
|
|
4960
|
+
const { GetUserSTokeBalance } = getSdkByChainId14(
|
|
4988
4961
|
chainId
|
|
4989
4962
|
);
|
|
4990
4963
|
const { accountBalanceV1S } = await GetUserSTokeBalance({
|
|
@@ -5306,12 +5279,12 @@ var getChainCycleRolloverBlockNumber = async (wagmiConfig, {
|
|
|
5306
5279
|
import { AUTOPOOLS_WHITELIST_PROD as AUTOPOOLS_WHITELIST_PROD2 } from "@tokemak/config";
|
|
5307
5280
|
import { formatUnits as formatUnits8 } from "viem";
|
|
5308
5281
|
import { formatEtherNum as formatEtherNum12 } from "@tokemak/utils";
|
|
5309
|
-
import { getSdkByChainId as
|
|
5282
|
+
import { getSdkByChainId as getSdkByChainId15 } from "@tokemak/graph-cli";
|
|
5310
5283
|
var getChainSTokeRewards = async ({
|
|
5311
5284
|
chainId
|
|
5312
5285
|
}) => {
|
|
5313
5286
|
try {
|
|
5314
|
-
const { GetSTokeRewards } =
|
|
5287
|
+
const { GetSTokeRewards } = getSdkByChainId15(chainId);
|
|
5315
5288
|
const { poolRewardsBalances } = await GetSTokeRewards();
|
|
5316
5289
|
const allPoolRewardsBalanceDayDatas = await paginateQuery(
|
|
5317
5290
|
GetSTokeRewards,
|
|
@@ -5483,11 +5456,11 @@ var getChainUserSTokeRewards = async (wagmiConfig, {
|
|
|
5483
5456
|
};
|
|
5484
5457
|
|
|
5485
5458
|
// functions/getChainSubgraphStatus.ts
|
|
5486
|
-
import { getSdkByChainId as
|
|
5459
|
+
import { getSdkByChainId as getSdkByChainId16 } from "@tokemak/graph-cli";
|
|
5487
5460
|
var getChainSubgraphStatus = async (chain) => {
|
|
5488
5461
|
const currentTimestamp = Math.floor(Date.now() / 1e3);
|
|
5489
5462
|
try {
|
|
5490
|
-
const { GetLatestSubgraphTimestamp } =
|
|
5463
|
+
const { GetLatestSubgraphTimestamp } = getSdkByChainId16(
|
|
5491
5464
|
chain.chainId
|
|
5492
5465
|
);
|
|
5493
5466
|
const { _meta } = await GetLatestSubgraphTimestamp();
|
|
@@ -5547,9 +5520,9 @@ import {
|
|
|
5547
5520
|
convertSecondsToRemainingTime as convertSecondsToRemainingTime3
|
|
5548
5521
|
} from "@tokemak/utils";
|
|
5549
5522
|
import { getMainnetConfig as getMainnetConfig7 } from "@tokemak/config";
|
|
5550
|
-
import { mainnet as
|
|
5523
|
+
import { mainnet as mainnet8 } from "viem/chains";
|
|
5551
5524
|
var publicClient = createPublicClient({
|
|
5552
|
-
chain:
|
|
5525
|
+
chain: mainnet8,
|
|
5553
5526
|
transport: http("https://mainnet.infura.io/v3/2BtQ5D1QEPHvwgZwKwnZC7WQVhr")
|
|
5554
5527
|
});
|
|
5555
5528
|
var getCycleV1 = async (wagmiConfig, {
|
|
@@ -5679,7 +5652,7 @@ var getProtocolStats = async (autopools, stoke, sushiLP, sauto, EthAutoLP) => {
|
|
|
5679
5652
|
};
|
|
5680
5653
|
|
|
5681
5654
|
// functions/getRebalanceStats.ts
|
|
5682
|
-
import { getSdkByChainId as
|
|
5655
|
+
import { getSdkByChainId as getSdkByChainId17 } from "@tokemak/graph-cli";
|
|
5683
5656
|
|
|
5684
5657
|
// functions/getEthPriceAtBlock.ts
|
|
5685
5658
|
import { getCoreConfig as getCoreConfig10 } from "@tokemak/config";
|
|
@@ -5705,10 +5678,10 @@ var getEthPriceAtBlock = async (wagmiConfig, blockNumber, chainId) => {
|
|
|
5705
5678
|
// functions/getRebalanceStats.ts
|
|
5706
5679
|
import { formatEtherNum as formatEtherNum15, formatUnitsNum as formatUnitsNum8 } from "@tokemak/utils";
|
|
5707
5680
|
import { USDC_TOKEN as USDC_TOKEN3 } from "@tokemak/tokenlist";
|
|
5708
|
-
import { sonic as
|
|
5681
|
+
import { sonic as sonic3 } from "viem/chains";
|
|
5709
5682
|
var BATCH_SIZE = 500;
|
|
5710
5683
|
var fetchChainRebalances = async (chainId) => {
|
|
5711
|
-
const { GetAllAutopoolRebalances } =
|
|
5684
|
+
const { GetAllAutopoolRebalances } = getSdkByChainId17(chainId);
|
|
5712
5685
|
const allRebalances = await paginateQuery(
|
|
5713
5686
|
GetAllAutopoolRebalances,
|
|
5714
5687
|
"autopoolRebalances"
|
|
@@ -5722,7 +5695,7 @@ function inferBaseAssetDecimals(rebalance, chainId) {
|
|
|
5722
5695
|
if (BigInt(rebalance.tokenOutValueBaseAsset) === BigInt(rebalance.tokenOutValueInEth)) {
|
|
5723
5696
|
return 18;
|
|
5724
5697
|
}
|
|
5725
|
-
if (chainId ===
|
|
5698
|
+
if (chainId === sonic3.id) {
|
|
5726
5699
|
return rebalance.tokenOut.decimals;
|
|
5727
5700
|
}
|
|
5728
5701
|
return USDC_TOKEN3.decimals;
|
|
@@ -5866,7 +5839,7 @@ import {
|
|
|
5866
5839
|
} from "@tokemak/utils";
|
|
5867
5840
|
import { readContracts as readContracts11 } from "@wagmi/core";
|
|
5868
5841
|
import { formatEther as formatEther5 } from "viem";
|
|
5869
|
-
import { mainnet as
|
|
5842
|
+
import { mainnet as mainnet9 } from "viem/chains";
|
|
5870
5843
|
var getUserSAuto = async (wagmiConfig, {
|
|
5871
5844
|
address,
|
|
5872
5845
|
autoPrice
|
|
@@ -5879,7 +5852,7 @@ var getUserSAuto = async (wagmiConfig, {
|
|
|
5879
5852
|
throw new Error("Auto price not found");
|
|
5880
5853
|
}
|
|
5881
5854
|
const { sAuto } = getMainnetConfig8();
|
|
5882
|
-
const chainId =
|
|
5855
|
+
const chainId = mainnet9.id;
|
|
5883
5856
|
const sAutoContract = {
|
|
5884
5857
|
address: sAuto,
|
|
5885
5858
|
abi: sAutoAbi
|
|
@@ -6014,13 +5987,13 @@ import {
|
|
|
6014
5987
|
formatTVL as formatTVL4
|
|
6015
5988
|
} from "@tokemak/utils";
|
|
6016
5989
|
import { getMainnetConfig as getMainnetConfig9 } from "@tokemak/config";
|
|
6017
|
-
import { mainnet as
|
|
5990
|
+
import { mainnet as mainnet10 } from "viem/chains";
|
|
6018
5991
|
var getSAuto = async (wagmiConfig, {
|
|
6019
5992
|
autoPrice
|
|
6020
5993
|
}) => {
|
|
6021
5994
|
try {
|
|
6022
5995
|
const { sAuto } = getMainnetConfig9();
|
|
6023
|
-
const chainId =
|
|
5996
|
+
const chainId = mainnet10.id;
|
|
6024
5997
|
const baseConfig = {
|
|
6025
5998
|
address: sAuto,
|
|
6026
5999
|
abi: sAutoAbi2,
|
|
@@ -6064,11 +6037,11 @@ import {
|
|
|
6064
6037
|
formatDateToReadable as formatDateToReadable3,
|
|
6065
6038
|
formatEtherNum as formatEtherNum17
|
|
6066
6039
|
} from "@tokemak/utils";
|
|
6067
|
-
import { getSdkByChainId as
|
|
6068
|
-
import { mainnet as
|
|
6040
|
+
import { getSdkByChainId as getSdkByChainId18 } from "@tokemak/graph-cli";
|
|
6041
|
+
import { mainnet as mainnet11 } from "viem/chains";
|
|
6069
6042
|
var getSAutoRewards = async () => {
|
|
6070
6043
|
try {
|
|
6071
|
-
const { GetSAutoRewards } =
|
|
6044
|
+
const { GetSAutoRewards } = getSdkByChainId18(mainnet11.id);
|
|
6072
6045
|
const { globalRewardsBalances } = await GetSAutoRewards();
|
|
6073
6046
|
const allGlobalRewardsBalanceDayDatas = await paginateQuery(
|
|
6074
6047
|
GetSAutoRewards,
|
|
@@ -6265,12 +6238,12 @@ async function getMerklPoolApr({
|
|
|
6265
6238
|
}
|
|
6266
6239
|
|
|
6267
6240
|
// functions/getSAutoApr.ts
|
|
6268
|
-
import { getSdkByChainId as
|
|
6269
|
-
import { mainnet as
|
|
6241
|
+
import { getSdkByChainId as getSdkByChainId19 } from "@tokemak/graph-cli";
|
|
6242
|
+
import { mainnet as mainnet12 } from "viem/chains";
|
|
6270
6243
|
import { formatEtherNum as formatEtherNum19, formatPercent } from "@tokemak/utils";
|
|
6271
6244
|
var getSAutoApr = async () => {
|
|
6272
6245
|
try {
|
|
6273
|
-
const { GetSAutoApr } =
|
|
6246
|
+
const { GetSAutoApr } = getSdkByChainId19(mainnet12.id);
|
|
6274
6247
|
const { globalRewardsBalances } = await GetSAutoApr();
|
|
6275
6248
|
if (!globalRewardsBalances || globalRewardsBalances.length === 0) {
|
|
6276
6249
|
return {
|
|
@@ -6395,7 +6368,6 @@ export {
|
|
|
6395
6368
|
getAutopools,
|
|
6396
6369
|
getAutopoolsHistory,
|
|
6397
6370
|
getAutopoolsRebalances,
|
|
6398
|
-
getBaseChainUserActivity,
|
|
6399
6371
|
getBlobData,
|
|
6400
6372
|
getBlobHistoricalTokenPrices,
|
|
6401
6373
|
getBridgeFee,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertBaseAssetToTokenPricesAndDenom.d.ts","sourceRoot":"","sources":["../../utils/convertBaseAssetToTokenPricesAndDenom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,eAAO,MAAM,qCAAqC,GAChD,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,YAAY,MAAM,EAClB,QAAQ,WAAW
|
|
1
|
+
{"version":3,"file":"convertBaseAssetToTokenPricesAndDenom.d.ts","sourceRoot":"","sources":["../../utils/convertBaseAssetToTokenPricesAndDenom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,eAAO,MAAM,qCAAqC,GAChD,WAAW,MAAM,EACjB,gBAAgB,MAAM,EACtB,YAAY,MAAM,EAClB,QAAQ,WAAW;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokemak/queries",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"vitest": "
|
|
28
|
+
"vitest": "2.1.9"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@layerzerolabs/lz-v2-utilities": "3.0.4",
|
|
32
|
-
"@merkl/api": "
|
|
32
|
+
"@merkl/api": "1.17.4",
|
|
33
33
|
"graphql-request": "6.1.0",
|
|
34
|
-
"@tokemak/
|
|
34
|
+
"@tokemak/config": "0.2.0",
|
|
35
|
+
"@tokemak/graph-cli": "0.2.1",
|
|
35
36
|
"@tokemak/abis": "0.1.1",
|
|
36
|
-
"@tokemak/config": "0.1.1",
|
|
37
|
-
"@tokemak/utils": "0.1.3",
|
|
38
37
|
"@tokemak/constants": "0.1.2",
|
|
38
|
+
"@tokemak/utils": "0.1.3",
|
|
39
39
|
"@tokemak/tokenlist": "0.1.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Address } from "viem";
|
|
2
|
-
import { EventType } from "./getChainUserActivity";
|
|
3
|
-
export declare const getBaseChainUserActivity: (address: Address) => Promise<{
|
|
4
|
-
id: string;
|
|
5
|
-
timestamp: number;
|
|
6
|
-
eventType: EventType;
|
|
7
|
-
assets: any;
|
|
8
|
-
transactionHash: any;
|
|
9
|
-
}[]>;
|
|
10
|
-
//# sourceMappingURL=getBaseChainUserActivity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBaseChainUserActivity.d.ts","sourceRoot":"","sources":["../../functions/getBaseChainUserActivity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,eAAO,MAAM,wBAAwB,GAAU,SAAS,OAAO;;;;;;IA6B9D,CAAC"}
|