@aurigami/sdk 1.9.0 → 1.9.1

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.9.0",
2
+ "version": "1.9.1",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -70,4 +70,4 @@
70
70
  "jest": {
71
71
  "testURL": "https://app.aurigami.finance"
72
72
  }
73
- }
73
+ }
@@ -157,6 +157,6 @@ export async function getBlockBeforeTimestamp(provider: Provider, timestamp: num
157
157
 
158
158
  export function devLog(message?: any, ...optionalParams: any[]): void {
159
159
  if ('production' !== process.env.NODE_ENV) {
160
- console.log(message, ...optionalParams);
160
+ console.log('[DEV LOG]', message, ...optionalParams);
161
161
  }
162
162
  }
@@ -102,10 +102,14 @@ export async function fetchLPPrice(
102
102
 
103
103
  try {
104
104
  // MUST await here
105
- return await fetchLPPriceBy({
105
+ const lpPrice = await fetchLPPriceBy({
106
106
  address: LPInfo.token0,
107
107
  reserve: LPInfo.reserve0,
108
108
  });
109
+ if (lpPrice.isZero()) {
110
+ throw Error(`Price is zero`);
111
+ }
112
+ return lpPrice;
109
113
  } catch (e) {
110
114
  devLog(`fetchLPPriceBy ${LPInfo.token0} failed`, e);
111
115
  try {