@ape.swap/bonds-sdk 1.0.544 → 1.0.546

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.
@@ -65,7 +65,6 @@ import axios from 'axios';
65
65
  import { fetchUserOwnedBillsDataAsync } from './fetchBillsUser';
66
66
  import { Input } from '../../components/uikit-sdk/Input';
67
67
  import { YourBondsModal } from "../../index";
68
- import { adjustDecimals } from '../../utils/convertToTokenValue';
69
68
  import BOND_ABI from '../../config/abi/bond.json';
70
69
  var YourBonds = function (_a) {
71
70
  //const toastError = useToastError()
@@ -86,7 +85,7 @@ var YourBonds = function (_a) {
86
85
  // });
87
86
  // setPendingTrx(false);
88
87
  // };
89
- var handleClaim = function () { return __awaiter(void 0, void 0, void 0, function () {
88
+ var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
90
89
  var tokenAddress, tx, error_1;
91
90
  return __generator(this, function (_a) {
92
91
  switch (_a.label) {
@@ -95,11 +94,14 @@ var YourBonds = function (_a) {
95
94
  _a.label = 1;
96
95
  case 1:
97
96
  _a.trys.push([1, 3, , 4]);
97
+ console.log('claimClicked');
98
+ console.log('billId:', billId);
99
+ console.log('billAddress:', billAddress);
98
100
  return [4 /*yield*/, writeContract({
99
- address: tokenAddress,
101
+ address: billAddress,
100
102
  abi: BOND_ABI,
101
103
  functionName: 'redeem',
102
- args: [account, adjustDecimals(inputValue)],
104
+ args: [billId],
103
105
  })];
104
106
  case 2:
105
107
  tx = _a.sent();
@@ -274,7 +276,7 @@ var YourBonds = function (_a) {
274
276
  return (_jsxs(Flex, { className: "container bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "column column-tokens", children: _jsx(Flex, { className: "column column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "column column-bondinfo", children: [_jsxs(Flex, { className: "column column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") })] }), _jsxs(Flex, { className: "column column-pending", children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") })] }), _jsx(Flex, { className: "column column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "column column-claimall", children: _jsx(Button, { disabled: !account && (claimableNumber(bill) === 0), onClick: function (event) {
275
277
  event.stopPropagation();
276
278
  // Add your claim logic here
277
- handleClaim;
279
+ handleClaim(bill.id, bill.address);
278
280
  }, sx: {
279
281
  height: ['36px', '36px', '36px', '26px'],
280
282
  lineHeight: '12px',
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.544",
6
+ "version": "1.0.546",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",