@ape.swap/bonds-sdk 1.0.727 → 1.0.728

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.
@@ -43,7 +43,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
43
43
  }
44
44
  return to.concat(ar || Array.prototype.slice.call(from));
45
45
  };
46
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "theme-ui/jsx-runtime";
46
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
47
47
  /** @jsxImportSource theme-ui */
48
48
  import { useEffect, useState } from 'react';
49
49
  import { Flex, Spinner, ThemeUIProvider } from 'theme-ui';
@@ -256,20 +256,21 @@ var YourBonds = function (_a) {
256
256
  setIsModalOpen(false);
257
257
  };
258
258
  return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isModalOpen &&
259
- _jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), !bondsRendered ? (_jsxs(_Fragment, { children: [" ", _jsx(Spinner, { size: 20 }), " "] })) : (_jsxs(Flex, { className: "yourbonds table-container", children: [_jsxs(Flex, { className: "yourbonds header-container", children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds header-claimable", children: ["CLAIMABLE", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('claimable'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-pending", children: ["PENDING", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('pending'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-terms", children: ["TERMS", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "yourbonds header-claimall" })] })] }), filteredBonds.map(function (bill) {
260
- var _a, _b;
261
- return (_jsxs(Flex, { className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), _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: "yourbonds 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: "yourbonds column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "yourbonds column-claimall", children: chainId !== bill.bond.chainId ?
262
- _jsxs(Button, { className: "switch-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
263
- event.stopPropagation();
264
- // Add your claim logic here
265
- switchChain({ chainId: bill.bond.chainId });
266
- }, children: ["Switch to ", NETWORK_LABEL[bill.bond.chainId]] })
267
- :
268
- _jsx(Button, { className: "claim-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
259
+ _jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), !bondsRendered ? (_jsxs(Flex, { className: "yourbonds-spinner", children: [" ", _jsx(Spinner, { size: 100 }), " "] }))
260
+ : (_jsxs(Flex, { className: "yourbonds table-container", children: [_jsxs(Flex, { className: "yourbonds header-container", children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds header-claimable", children: ["CLAIMABLE", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('claimable'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-pending", children: ["PENDING", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('pending'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-terms", children: ["TERMS", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "yourbonds header-claimall" })] })] }), filteredBonds.map(function (bill) {
261
+ var _a, _b;
262
+ return (_jsxs(Flex, { className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), _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: "yourbonds 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: "yourbonds column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "yourbonds column-claimall", children: chainId !== bill.bond.chainId ?
263
+ _jsxs(Button, { className: "switch-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
269
264
  event.stopPropagation();
270
265
  // Add your claim logic here
271
- handleClaim(bill.id, bill.address);
272
- }, children: "Claim" }) })] })] }, bill.id));
273
- })] }))] }));
266
+ switchChain({ chainId: bill.bond.chainId });
267
+ }, children: ["Switch to ", NETWORK_LABEL[bill.bond.chainId]] })
268
+ :
269
+ _jsx(Button, { className: "claim-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
270
+ event.stopPropagation();
271
+ // Add your claim logic here
272
+ handleClaim(bill.id, bill.address);
273
+ }, children: "Claim" }) })] })] }, bill.id));
274
+ })] }))] }));
274
275
  };
275
276
  export default YourBonds;
@@ -1,4 +1,10 @@
1
1
 
2
+ .yourbonds-spinner {
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ }
7
+
2
8
  .yourbonds.table-container {
3
9
  width: 100%;
4
10
  display: flex;
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.727",
6
+ "version": "1.0.728",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",