otomato-sdk 2.0.401 → 2.0.402
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.
|
@@ -149,6 +149,26 @@ export const getTokenPrice = async (chainId, contractAddress) => {
|
|
|
149
149
|
const tokenPriceJson = await tokenPrice.json();
|
|
150
150
|
return tokenPriceJson?.price;
|
|
151
151
|
};
|
|
152
|
+
export const getTokenPrices = async (chainId, contractAddresses) => {
|
|
153
|
+
if (chainId === 999) {
|
|
154
|
+
const tokenPriceList = await fetch(`https://li.quest/v1/tokens?chains=999`, {
|
|
155
|
+
headers: {
|
|
156
|
+
'x-lifi-api-key': process.env.LIFI_API_KEY ?? ''
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
const tokenPriceListJson = await tokenPriceList.json();
|
|
160
|
+
const tokenPrices = tokenPriceListJson.tokens?.[999]?.filter((token) => contractAddresses.includes(token.address));
|
|
161
|
+
return tokenPrices.map((token) => {
|
|
162
|
+
return {
|
|
163
|
+
contractAddress: token.address,
|
|
164
|
+
symbol: token.symbol,
|
|
165
|
+
decimals: token.decimals,
|
|
166
|
+
priceUSD: token.priceUSD
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return [];
|
|
171
|
+
};
|
|
152
172
|
export const getETHAlternativeTokensSymbols = () => {
|
|
153
173
|
return {
|
|
154
174
|
1: "ETH",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.402";
|
|
2
2
|
export declare function compareVersions(v1: string, v2: string): number;
|
|
@@ -36,6 +36,12 @@ export declare function getComputeERC20Variable(amount: string, chainId: any, co
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function formatNonZeroDecimals(value: number, nonZeroDecimals?: number, maxLeadingZeros?: number): string;
|
|
38
38
|
export declare const getTokenPrice: (chainId: number, contractAddress: string) => Promise<number>;
|
|
39
|
+
export declare const getTokenPrices: (chainId: number, contractAddresses: string[]) => Promise<{
|
|
40
|
+
contractAddress: string;
|
|
41
|
+
symbol: string;
|
|
42
|
+
decimals: number;
|
|
43
|
+
priceUSD: number;
|
|
44
|
+
}[]>;
|
|
39
45
|
export declare const getETHAlternativeTokensSymbols: () => {
|
|
40
46
|
1: string;
|
|
41
47
|
130: string;
|