@ape.swap/bonds-sdk 1.0.113 → 1.0.114

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.
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
49
49
  /** @jsxImportSource theme-ui */
50
- import { useCallback, useEffect, useState } from 'react';
50
+ import { useEffect, useState } from 'react';
51
51
  import { Flex, ThemeUIProvider } from 'theme-ui';
52
52
  import axios from 'axios';
53
53
  import { ethers } from 'ethers';
@@ -57,8 +57,6 @@ import getTimePeriods from '../../utils/getTimePeriods';
57
57
  import { defaultTheme } from '../../theme';
58
58
  import Svg from '../uikit/Svg';
59
59
  import '../../scss/bonds.scss';
60
- import { BigNumber } from 'bignumber.js';
61
- import { ChainId } from '@ape.swap/apeswap-lists';
62
60
  var Bonds = function (_a) {
63
61
  var connectionString = _a.connectionString;
64
62
  var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
@@ -136,18 +134,14 @@ var Bonds = function (_a) {
136
134
  return b.discount - a.discount;
137
135
  }
138
136
  });
139
- var isSoldOut = useCallback(function (bond) {
140
- var _a;
141
- var tokensRemaining = bond.tokensRemaining, discount = bond.discount, payoutTokenPrice = bond.payoutTokenPrice;
142
- if (bond.soldOut)
143
- return true;
144
- if (!tokensRemaining)
145
- return false;
146
- var thresholdToHide = new BigNumber(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
147
- if (discount && discount > 25 && bond.chainId === ChainId.BASE)
148
- return true;
149
- return ((_a = new BigNumber(tokensRemaining)) === null || _a === void 0 ? void 0 : _a.lte(thresholdToHide)) || discount === 100;
150
- }, []);
137
+ // const isSoldOut = useCallback((bond: BondsDataResponse) => {
138
+ // const { tokensRemaining, discount, payoutTokenPrice } = bond
139
+ // if (bond.soldOut) return true
140
+ // if (!tokensRemaining) return false
141
+ // const thresholdToHide = new BigNumber(100).div(payoutTokenPrice ?? 0)
142
+ // if (discount && discount > 25 && bond.chainId === ChainId.BASE) return true
143
+ // return new BigNumber(tokensRemaining)?.lte(thresholdToHide) || discount === 100
144
+ // }, []);
151
145
  var _f = useState(false), isModalOpen = _f[0], setIsModalOpen = _f[1];
152
146
  var _g = useState(null), selectedBond = _g[0], setSelectedBond = _g[1];
153
147
  var rowClick = function (bond) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.113",
6
+ "version": "1.0.114",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",