@ape.swap/bonds-sdk 1.0.94 → 1.0.95

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.
@@ -141,15 +141,17 @@ var Bonds = function (_a) {
141
141
  // Modal
142
142
  var _e = useState(false), isModalOpen = _e[0], setIsModalOpen = _e[1];
143
143
  var _f = useState(null), selectedBond = _f[0], setSelectedBond = _f[1];
144
- var rowClickModal = function (bond) {
145
- setSelectedBond(bond);
146
- setIsModalOpen(true);
144
+ var rowClick = function (bond) {
145
+ var url = "".concat(window.location.origin, "?bondAddress=").concat(bond.billAddress, "&bondChain=").concat(bond.chainId);
146
+ window.location.href = url;
147
+ // setSelectedBond(bond);
148
+ // setIsModalOpen(true);
147
149
  };
148
150
  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" })] })), _jsx(BondModal, { isOpen: isModalOpen, onClose: function () { return setIsModalOpen(false); }, bond: selectedBond }), sortedBonds.map(function (bond) {
149
151
  var _a, _b, _c, _d;
150
152
  return (
151
153
  // <Flex className="container bondrow-container" onClick={() => handleRowClick(bond.billAddress)}>
152
- _jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClickModal(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount", sx: getColumnDiscountStyle((_a = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _a !== void 0 ? _a : 0) }, { children: "".concat((_b = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _b === void 0 ? void 0 : _b.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr", sx: styles.columnArr }, { children: "".concat("".concat(((((_c = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _c !== void 0 ? _c : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%")) })), _jsx(Flex, __assign({ className: "column column-term", sx: styles.columnTerm }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining", sx: styles.columnTokensRemaining }, { 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()) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] })));
154
+ _jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount", sx: getColumnDiscountStyle((_a = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _a !== void 0 ? _a : 0) }, { children: "".concat((_b = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _b === void 0 ? void 0 : _b.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr", sx: styles.columnArr }, { children: "".concat("".concat(((((_c = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _c !== void 0 ? _c : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%")) })), _jsx(Flex, __assign({ className: "column column-term", sx: styles.columnTerm }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining", sx: styles.columnTokensRemaining }, { 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()) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] })));
153
155
  })] }))] })));
154
156
  };
155
157
  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.94",
6
+ "version": "1.0.95",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",