@ape.swap/bonds-sdk 1.0.327 → 1.0.328

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.
@@ -56,7 +56,8 @@ import getTimePeriods from '../../utils/getTimePeriods';
56
56
  import axios from 'axios';
57
57
  import { BigNumber } from 'bignumber.js';
58
58
  import { getFirstNonZeroDigits } from '../../utils/roundNumber';
59
- import { Button, Svg, ListTag } from '../uikit-sdk';
59
+ import { TooltipBubble, Button, Svg, ListTag } from '../uikit-sdk';
60
+ import { UserBillTooltipText } from '../../enum/tooltips';
60
61
  import billAbi from '../../config/abi/bond.json';
61
62
  import TokenImage from '../uikit-sdk/TokenImage';
62
63
  import { getBalanceNumber } from '../../utils/getBalanceNumber';
@@ -64,6 +65,8 @@ import multicall from '../../utils/multicall';
64
65
  import { BillVersion } from '../../enum/apeswaplists';
65
66
  import { ACF_TO_ABOND } from '../../config/constants/addresses';
66
67
  import { MAINNET_CHAINS } from '../../config/constants/chains';
68
+ import { getPendingVesting } from '../../hooks/usePendingVesting';
69
+ import { formatNumberSI } from '../../utils/formatNumber';
67
70
  var YourBondsModal = function (_a) {
68
71
  var isOpen = _a.isOpen, onClose = _a.onClose, bondAddress = _a.bondAddress;
69
72
  if (!isOpen)
@@ -232,11 +235,11 @@ var YourBondsModal = function (_a) {
232
235
  return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
233
236
  };
234
237
  return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: userOwnedBillsData.flat().map(function (data) {
235
- var _a, _b, _c, _d, _e, _f;
238
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
236
239
  var userBill = data.userOwnedBills.find(function (bill) { return bill.bond.billAddress.toLowerCase() === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()); });
237
240
  console.log("USER BILL LOG");
238
241
  console.log(userBill);
239
- return userBill ? (_jsx(React.Fragment, { children: _jsx(Flex, __assign({ className: "modal modal-backdrop" }, { children: _jsxs(Flex, __assign({ className: "modal modal-content" }, { children: [isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsx(Flex, __assign({ className: "modal modal-header" }, { children: _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) })) })), _jsxs(Flex, __assign({ className: "modal-container table-container" }, { children: [_jsx(Flex, __assign({ className: "modal-container bondimage" }, { children: "IMAGE" })), _jsxs(Flex, __assign({ className: "modal-container bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "modal-container title-container" }, { children: [_jsx(Flex, __assign({ className: "title-container bondicon" }, { children: _jsx(TokenImage, { symbol: (_a = userBill.bond.showcaseTokenName) !== null && _a !== void 0 ? _a : userBill.bond.payoutTokenName, size: 50 }) })), _jsx(Flex, __assign({ className: "title-container bondname" }, { children: (_b = userBill.bond) === null || _b === void 0 ? void 0 : _b.showcaseTokenName })), _jsx(Flex, __assign({ className: "title-container tokentags" }, { children: _jsx(ListTag, { text: (_d = (_c = userBill.bond) === null || _c === void 0 ? void 0 : _c.tags) === null || _d === void 0 ? void 0 : _d[0], variant: ((_f = (_e = userBill.bond) === null || _e === void 0 ? void 0 : _e.tags) === null || _f === void 0 ? void 0 : _f[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) }))] })), _jsxs(Flex, __assign({ className: "modal-container blocks-container" }, { children: [_jsx(Flex, __assign({ className: "modal-block column-discount" }, { children: _jsx(Flex, __assign({ className: "block-header header" }, { children: "Traits" })) })), _jsx(Flex, __assign({ className: "modal-block column-arr" }, { children: _jsx(Flex, __assign({ className: "block-header header" }, { children: "Fully Vested" })) })), _jsx(Flex, __assign({ className: "modal-block column-term" }, { children: _jsx(Flex, __assign({ className: "block-header header" }, { children: "Pending" })) })), _jsx(Flex, __assign({ className: "modal-block column-maxbuy" }, { children: _jsx(Flex, __assign({ className: "block-header header" }, { children: "Claimable" })) }))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container get" }, { children: _jsx(Button, { children: "CLAIM" }) })), _jsx(Flex, __assign({ className: "button-container buy" }, { children: _jsx(Button, { children: "TRANSFER" }) }))] }))] }))] }))] })) })) }, userBill.bond.billAddress)) : null;
242
+ return userBill ? (_jsx(React.Fragment, { children: _jsx(Flex, __assign({ className: "modal modal-backdrop" }, { children: _jsxs(Flex, __assign({ className: "modal modal-content" }, { children: [isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsx(Flex, __assign({ className: "modal modal-header" }, { children: _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) })) })), _jsxs(Flex, __assign({ className: "modal-container table-container" }, { children: [_jsx(Flex, __assign({ className: "modal-container bondimage" }, { children: "IMAGE" })), _jsxs(Flex, __assign({ className: "modal-container bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "modal-container title-container" }, { children: [_jsx(Flex, __assign({ className: "title-container bondicon" }, { children: _jsx(TokenImage, { symbol: (_a = userBill.bond.showcaseTokenName) !== null && _a !== void 0 ? _a : userBill.bond.payoutTokenName, size: 40 }) })), _jsx(Flex, __assign({ className: "title-container bondname" }, { children: (_b = userBill.bond) === null || _b === void 0 ? void 0 : _b.showcaseTokenName })), _jsx(Flex, __assign({ className: "title-container tokentags" }, { children: _jsx(ListTag, { text: (_d = (_c = userBill.bond) === null || _c === void 0 ? void 0 : _c.tags) === null || _d === void 0 ? void 0 : _d[0], variant: ((_f = (_e = userBill.bond) === null || _e === void 0 ? void 0 : _e.tags) === null || _f === void 0 ? void 0 : _f[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) }))] })), _jsxs(Flex, __assign({ className: "modal-container blocks-container" }, { children: [_jsx(Flex, __assign({ className: "modal-block row-traits" }, { children: _jsx(Flex, __assign({ className: "block-header header" }, { children: "Traits" })) })), _jsxs(Flex, __assign({ className: "modal-block row-vested" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Fully Vested", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), getPendingVesting(userBill.lastBlockTimestamp, userBill.vesting)] })), _jsxs(Flex, __assign({ className: "modal-block row-pending" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Pending", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(TokenImage, { symbol: (_g = userBill.bond.showcaseTokenName) !== null && _g !== void 0 ? _g : userBill.bond.payoutTokenName, size: 25 }), formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4), "($".concat((totalPending(userBill) * ((_h = parseFloat(earnTokenPrice(userBill.bond))) !== null && _h !== void 0 ? _h : 0)).toFixed(2), ")")] })), _jsxs(Flex, __assign({ className: "modal-block row-claimable" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Claimable", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.Claimable }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(TokenImage, { symbol: (_j = userBill.bond.showcaseTokenName) !== null && _j !== void 0 ? _j : userBill.bond.payoutTokenName, size: 25 }), formatNumberSI(parseFloat(claimable(userBill).toFixed(4)), 4), "($".concat((claimable(userBill) * ((_k = parseFloat(earnTokenPrice(userBill.bond))) !== null && _k !== void 0 ? _k : 0)).toFixed(2), ")")] }))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container claim" }, { children: _jsx(Button, { children: "CLAIM" }) })), _jsx(Flex, __assign({ className: "button-container transfer" }, { children: _jsx(Button, { children: "TRANSFER" }) }))] }))] }))] }))] })) })) }, userBill.bond.billAddress)) : null;
240
243
  }) })));
241
244
  };
242
245
  export default YourBondsModal;
@@ -6,3 +6,8 @@ export declare const TooltipText: {
6
6
  MaxBuy: (payoutToken: string) => string;
7
7
  Premium: string;
8
8
  };
9
+ export declare const UserBillTooltipText: {
10
+ FullyVested: string;
11
+ Pending: string;
12
+ Claimable: string;
13
+ };
@@ -6,3 +6,8 @@ export var TooltipText = {
6
6
  MaxBuy: function (payoutToken) { return "This is the maximum amount of ".concat(payoutToken, " you can currently purchase through this Bond."); },
7
7
  Premium: "This is the dollar value of the additional tokens you’ll receive at current market price.",
8
8
  };
9
+ export var UserBillTooltipText = {
10
+ FullyVested: "This is the time remaining until all tokens from the bond are available to claim.",
11
+ Pending: "This is the amount of unvested tokens that cannot be claimed yet.",
12
+ Claimable: "This is the amount of tokens that have vested and are available to claim."
13
+ };
@@ -108,7 +108,6 @@
108
108
  }
109
109
 
110
110
  .modal-block {
111
- min-width: 0px;
112
111
  display: flex;
113
112
  flex-direction: column;
114
113
  align-items: center;
@@ -134,24 +133,24 @@
134
133
  cursor: pointer;
135
134
  }
136
135
 
137
- .modal-block.column-discount {
138
- width: 100%;
139
- flex-direction: column;
136
+ .modal-block.row-traits {
137
+ width: 200px;
138
+ margin: 0px 0px 0px 10px;
140
139
  }
141
140
 
142
- .modal-block.column-arr {
143
- width: 100%;
144
- flex-direction: column;
141
+ .modal-block.row-vested {
142
+ width: 200px;
143
+ margin: 0px 0px 0px 10px;
145
144
  }
146
145
 
147
- .modal-block.column-term {
148
- width: 100%;
149
- flex-direction: column;
146
+ .modal-block.row-pending {
147
+ width: 200px;
148
+ margin: 0px 0px 0px 10px;
150
149
  }
151
150
 
152
- .modal-block.column-maxbuy {
153
- width: 100%;
154
- flex-direction: column;
151
+ .modal-block.row-claimable {
152
+ width: 200px;
153
+ margin: 0px 0px 0px 10px;
155
154
  }
156
155
 
157
156
  .modal-container.button-container {
@@ -162,21 +161,21 @@
162
161
  justify-content: space-between;
163
162
  }
164
163
 
165
- .button-container.get {
164
+ .button-container.claim {
166
165
  justify-content: center;
167
166
  align-items: center;
168
167
  cursor: pointer;
169
168
 
170
169
  Button {
171
- width: 275px;
170
+ width: 300px;
172
171
  }
173
172
  }
174
173
 
175
- .button-container.buy {
174
+ .button-container.transfer {
176
175
  justify-content: center;
177
176
  align-items: center;
178
177
 
179
178
  Button {
180
- width: 375px;
179
+ width: 100px;
181
180
  }
182
181
  }
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.327",
6
+ "version": "1.0.328",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",