@ape.swap/bonds-sdk 1.0.545 → 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.
@@ -85,7 +85,7 @@ var YourBonds = function (_a) {
85
85
  // });
86
86
  // setPendingTrx(false);
87
87
  // };
88
- var handleClaim = function (billId) { return __awaiter(void 0, void 0, void 0, function () {
88
+ var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
89
89
  var tokenAddress, tx, error_1;
90
90
  return __generator(this, function (_a) {
91
91
  switch (_a.label) {
@@ -94,8 +94,11 @@ var YourBonds = function (_a) {
94
94
  _a.label = 1;
95
95
  case 1:
96
96
  _a.trys.push([1, 3, , 4]);
97
+ console.log('claimClicked');
98
+ console.log('billId:', billId);
99
+ console.log('billAddress:', billAddress);
97
100
  return [4 /*yield*/, writeContract({
98
- address: tokenAddress,
101
+ address: billAddress,
99
102
  abi: BOND_ABI,
100
103
  functionName: 'redeem',
101
104
  args: [billId],
@@ -273,7 +276,7 @@ var YourBonds = function (_a) {
273
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) {
274
277
  event.stopPropagation();
275
278
  // Add your claim logic here
276
- handleClaim(bill.id);
279
+ handleClaim(bill.id, bill.address);
277
280
  }, sx: {
278
281
  height: ['36px', '36px', '36px', '26px'],
279
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.545",
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",