@ape.swap/bonds-sdk 1.0.155 → 1.0.157

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.
@@ -59,6 +59,8 @@ import Svg from '../uikit/Svg';
59
59
  import '../../scss/Bonds.scss';
60
60
  import { BigNumber } from 'bignumber.js';
61
61
  import { ChainId } from '../../config/chains';
62
+ import ProgressBarWrapper from '../ProgressBar/ProgressBarWrapper';
63
+ import ProgressBar from '../ProgressBar/ProgressBar';
62
64
  var Bonds = function (_a) {
63
65
  var connectionString = _a.connectionString;
64
66
  var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
@@ -110,14 +112,10 @@ var Bonds = function (_a) {
110
112
  };
111
113
  useEffect(function () {
112
114
  axios.get('https://realtime-api.ape.bond/bonds').then(function (response) {
113
- var bonds = response.data.bonds;
115
+ var bonds = response.data.bonds.filter(function (bond) { return !isSoldOut(bond); });
114
116
  setBondData(bonds);
115
117
  console.log("BONDS");
116
118
  console.log(bonds);
117
- var bondsToRender = bondData.filter(function (bond) { return !isSoldOut(bond); });
118
- console.log("BONDS TO RENDER");
119
- console.log(bondsToRender);
120
- setBondData(bondsToRender);
121
119
  });
122
120
  }, []);
123
121
  useEffect(function () {
@@ -167,7 +165,13 @@ var Bonds = function (_a) {
167
165
  };
168
166
  return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Discount" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "ARR" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens Remaining" })), _jsx(Flex, { className: "column column-header" })] })), sortedBonds.map(function (bond) {
169
167
  var _a, _b, _c;
170
- return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: bond.tokensRemaining.split('.')[0] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
168
+ return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: new BigNumber(bond.tokensRemaining).div(bond.maxTotalPayout).times(100).toNumber() }), style: {
169
+ width: '127px',
170
+ height: '25px',
171
+ flexDirection: 'column',
172
+ justifyContent: 'center',
173
+ display: ['none', 'none', 'none', 'flex'],
174
+ }, showTooltip: true }), bond.tokensRemaining.split('.')[0]] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
171
175
  })] }))] })));
172
176
  };
173
177
  export default Bonds;
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.155",
6
+ "version": "1.0.157",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",