@curvefi/llamalend-api 1.0.17 → 1.0.18

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/lib/utils.js CHANGED
@@ -194,7 +194,7 @@ export const getAllowance = (coins, address, spender) => __awaiter(void 0, void
194
194
  // coins can be either addresses or symbols
195
195
  export const hasAllowance = (coins, amounts, address, spender) => __awaiter(void 0, void 0, void 0, function* () {
196
196
  const coinAddresses = _getCoinAddresses(coins);
197
- const decimals = _getCoinDecimals(coinAddresses);
197
+ const decimals = _getCoinDecimals(coinAddresses).map((item) => Number(item));
198
198
  const _allowance = yield _getAllowance(coinAddresses, address, spender);
199
199
  const _amounts = amounts.map((a, i) => parseUnits(a, decimals[i]));
200
200
  return _allowance.map((a, i) => a >= _amounts[i]).reduce((a, b) => a && b);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/llamalend-api",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "JavaScript library for Curve Lending",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",
package/src/utils.ts CHANGED
@@ -226,7 +226,7 @@ export const getAllowance = async (coins: string[], address: string, spender: st
226
226
  // coins can be either addresses or symbols
227
227
  export const hasAllowance = async (coins: string[], amounts: (number | string)[], address: string, spender: string): Promise<boolean> => {
228
228
  const coinAddresses = _getCoinAddresses(coins);
229
- const decimals = _getCoinDecimals(coinAddresses);
229
+ const decimals = _getCoinDecimals(coinAddresses).map((item) => Number(item));
230
230
  const _allowance = await _getAllowance(coinAddresses, address, spender);
231
231
  const _amounts = amounts.map((a, i) => parseUnits(a, decimals[i]));
232
232