@aurigami/sdk 1.7.5 → 1.7.6
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/helpers/priceFetcher.d.ts +0 -1
- package/dist/sdk.cjs.development.js +67 -113
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +68 -113
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers/priceFetcher.ts +0 -14
package/package.json
CHANGED
|
@@ -158,19 +158,6 @@ export async function fetchUnderlyingTokensPrices(provider: providers.Provider):
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
export async function fetchStNEARPrice(): Promise<BigNumber> {
|
|
162
|
-
const ratioPromise = axios
|
|
163
|
-
.get('https://validators.narwallets.com/metrics_json')
|
|
164
|
-
.then((res) => res.data);
|
|
165
|
-
const nearPricePromise = fetchPriceFromCoingeckoAPI('near');
|
|
166
|
-
const [ratioRes, nearPrice]: [any, BigNumber] = await Promise.all([
|
|
167
|
-
ratioPromise,
|
|
168
|
-
nearPricePromise,
|
|
169
|
-
]);
|
|
170
|
-
const ratio = new BigNumber(ratioRes.st_near_price);
|
|
171
|
-
return ratio.multipliedBy(nearPrice);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
161
|
function shouldFetchFromCoingecko(address: string) {
|
|
175
162
|
address = address.toLowerCase();
|
|
176
163
|
return (
|
|
@@ -189,7 +176,6 @@ async function _fetchPrice(address: Address, provider: providers.Provider): Prom
|
|
|
189
176
|
`Address ${address} is not whitelisted for price fetching`
|
|
190
177
|
);
|
|
191
178
|
|
|
192
|
-
if (isSameAddress(address, networkAddresses.tokens.stNEAR)) return fetchStNEARPrice();
|
|
193
179
|
if (shouldFetchFromCoingecko(address)) return fetchPriceFromCoingecko(address);
|
|
194
180
|
|
|
195
181
|
const matchingAuToken = networkAddresses.auTokens.find((auToken) => {
|