@ape.swap/bonds-sdk 1.0.253 → 1.0.255

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,6 +65,7 @@ import { TooltipText } from '../../enum/tooltips';
65
65
  import { TooltipBubble, Svg, ListTag } from '../uikit-sdk';
66
66
  import Tooltip from '../Tooltip/Tooltip';
67
67
  import { BLOCK_EXPLORER } from '../../config/constants/chains';
68
+ import TokenInfoAndName from '../TokenInfoAndName';
68
69
  var Bonds = function (_a) {
69
70
  var connectionString = _a.connectionString;
70
71
  var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
@@ -188,7 +189,7 @@ var Bonds = function (_a) {
188
189
  };
189
190
  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: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokenname" }, { children: "Tokens" })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-discount" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)" }, { children: ["Discount", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)" }, { children: ["ARR", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-term" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)" }, { children: ["Terms", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)" }, { children: ["Tokens Remaining", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }))] })) })), _jsx(Flex, { className: "column column-hotbond" })] }))] })), sortedBonds.map(function (bond) {
190
191
  var _a, _b, _c, _d, _e, _f, _g;
191
- return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokenname" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-tokenicons" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Tooltip, { tokenContract: (bond === null || bond === void 0 ? void 0 : bond.payoutToken) || '', secondURL: getBillContractURL(bond), secondURLTitle: 'View Bond Contract', thirdURL: "https://dashboard.ape.bond/bond/".concat((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()), thirdURLTitle: 'View Insights', twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: (_b = bond.chainId) !== null && _b !== void 0 ? _b : ChainId.BSC }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)" }, { children: _jsx(Svg, { icon: "more", width: "20px" }) })) })), _jsx(Flex, __assign({ className: "column column-tokentags" }, { children: _jsx(ListTag, { text: (_c = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _c === void 0 ? void 0 : _c[0].toLocaleUpperCase(), variant: ((_d = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _d === void 0 ? void 0 : _d[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) }))] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_e = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _e === void 0 ? void 0 : _e.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_f = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _f !== void 0 ? _f : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bond) }), style: {
192
+ return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokenimage" }, { children: _jsx(TokenInfoAndName, { bond: bond }) })), _jsx(Flex, __assign({ className: "column column-tokenname" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-tokenicons" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Tooltip, { tokenContract: (bond === null || bond === void 0 ? void 0 : bond.payoutToken) || '', secondURL: getBillContractURL(bond), secondURLTitle: 'View Bond Contract', thirdURL: "https://dashboard.ape.bond/bond/".concat((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()), thirdURLTitle: 'View Insights', twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: (_b = bond.chainId) !== null && _b !== void 0 ? _b : ChainId.BSC }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)" }, { children: _jsx(Svg, { icon: "more", width: "20px" }) })) })), _jsx(Flex, __assign({ className: "column column-tokentags" }, { children: _jsx(ListTag, { text: (_c = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _c === void 0 ? void 0 : _c[0].toLocaleUpperCase(), variant: ((_d = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _d === void 0 ? void 0 : _d[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) }))] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_e = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _e === void 0 ? void 0 : _e.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_f = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _f !== void 0 ? _f : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bond) }), style: {
192
193
  width: '127px',
193
194
  height: '25px',
194
195
  flexDirection: 'column',
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { BondsDataResponse } from '../../types/bonds';
3
+ export declare const NETWORK_COLORS: Partial<Record<number, string>>;
4
+ declare const TokenInfoAndName: ({ bond }: {
5
+ bond: BondsDataResponse;
6
+ }) => React.JSX.Element;
7
+ export default TokenInfoAndName;
@@ -0,0 +1,64 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var _a;
13
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
14
+ import { Flex, ListTag, Svg } from '../../components/uikit-sdk';
15
+ import { NETWORK_ICONS } from '../../config/constants/chains';
16
+ import { ChainId } from '@ape.swap/apeswap-lists';
17
+ import BondTokenImage from '../../components/uikit-sdk/BondTokenImage';
18
+ // import { CleanedBondsState } from 'state/bills/types'
19
+ // import FavComponent from '../../../components/FavComponent'
20
+ export var NETWORK_COLORS = (_a = {},
21
+ _a[ChainId.BSC] = '#F3BA2F',
22
+ _a[ChainId.MAINNET] = '#627eea',
23
+ _a[ChainId.MATIC] = '#8247e5',
24
+ _a[ChainId.LIGHTLINK] = '#6087ff',
25
+ _a[ChainId.BASE] = '#0052ff',
26
+ _a[ChainId.ARBITRUM] = '#289fef',
27
+ _a[ChainId.LINEA] = '#fff',
28
+ _a[ChainId.IOTA] = '#fff',
29
+ _a);
30
+ var TokenInfoAndName = function (_a) {
31
+ var _b, _c, _d, _e, _f, _g, _h;
32
+ var bond = _a.bond;
33
+ return (_jsxs(Flex, __assign({ sx: {
34
+ width: '100%',
35
+ position: 'relative',
36
+ overflow: 'hidden',
37
+ height: '100%',
38
+ alignItems: 'center',
39
+ pl: '20px',
40
+ borderRadius: 'normal',
41
+ ml: '-20px',
42
+ } }, { children: [_jsx(Flex, __assign({ sx: {
43
+ position: 'absolute',
44
+ left: '0px',
45
+ top: '0px',
46
+ overflow: 'hidden',
47
+ borderRadius: '10px 0px 8px 0px',
48
+ zIndex: 5,
49
+ } }, { children: _jsx(Svg, { width: 22, height: 22, icon: (_b = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _b !== void 0 ? _b : 'question' }) })), _jsx(Flex, { sx: {
50
+ position: 'absolute',
51
+ zIndex: 0,
52
+ left: '0px',
53
+ width: '30px',
54
+ height: '100%',
55
+ background: NETWORK_COLORS[bond.chainId],
56
+ filter: 'blur(35px)',
57
+ } }), _jsxs(Flex, __assign({ sx: { pl: '6px', width: '100%', maxWidth: '150px' } }, { children: [_jsx(BondTokenImage, { symbol: (_c = bond.showcaseTokenName) !== null && _c !== void 0 ? _c : bond.payoutTokenName, size: 33 }), _jsx(Flex, __assign({ sx: { ml: '10px', fontSize: '16px', fontWeight: 700, alignItems: 'center', width: 'calc(100% - 30px)' } }, { children: (_d = bond.showcaseTokenName) !== null && _d !== void 0 ? _d : bond.payoutTokenName }))] })), _jsx(Flex, __assign({ sx: {
58
+ ml: '10px',
59
+ display: ['none', 'none', 'none', 'flex'],
60
+ minWidth: '70px',
61
+ alignItems: 'center',
62
+ } }, { children: ((_e = bond.tags) === null || _e === void 0 ? void 0 : _e[0]) && (_jsx(Flex, __assign({ sx: { marginRight: '10px' } }, { children: _jsx(ListTag, { variant: ((_f = bond.tags) === null || _f === void 0 ? void 0 : _f[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity', text: (_h = (_g = bond.tags) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.toUpperCase() }) }))) }))] })));
63
+ };
64
+ export default TokenInfoAndName;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const BondTokenImage: ({ symbol, size, chain }: {
3
+ symbol: string;
4
+ size: number;
5
+ chain?: number | undefined;
6
+ }) => React.JSX.Element;
7
+ export default BondTokenImage;
@@ -0,0 +1,29 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
+ import Flex from './Flex';
14
+ import { APESWAP_LIST_REPO } from '../../config/constants/lists';
15
+ import { NETWORK_ICONS } from '../../config/constants/chains';
16
+ import { Svg } from './index';
17
+ var BondTokenImage = function (_a) {
18
+ var _b;
19
+ var symbol = _a.symbol, size = _a.size, chain = _a.chain;
20
+ return (_jsxs(Flex, __assign({ sx: {
21
+ width: size - 2,
22
+ height: size - 2,
23
+ justifyContent: 'center',
24
+ alignItems: 'center',
25
+ borderRadius: '55px',
26
+ position: 'relative',
27
+ } }, { children: [_jsx("img", { src: "".concat(APESWAP_LIST_REPO, "/assets/").concat(symbol.toUpperCase(), ".png"), alt: "tokenImgFor:".concat(symbol), width: size, height: symbol === 'BNB-ICHI' ? 19 : size }), chain && (_jsx(Flex, __assign({ sx: { zIndex: 5, position: 'absolute', top: '-2px', right: '-4px', overflow: 'hidden', borderRadius: '50px' } }, { children: _jsx(Svg, { width: size / 2.5, height: size / 2.5, icon: (_b = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[chain]) !== null && _b !== void 0 ? _b : 'question' }) })))] })));
28
+ };
29
+ export default BondTokenImage;
@@ -49,8 +49,16 @@
49
49
  width: 40%;
50
50
  }
51
51
 
52
+ .column.column-image {
53
+ width: 25%;
54
+ flex-direction: row;
55
+ justify-content: start;
56
+ align-items: center;
57
+ padding-left: 20px;
58
+ }
59
+
52
60
  .column.column-tokenname {
53
- width: 33%;
61
+ width: 25%;
54
62
  flex-direction: row;
55
63
  justify-content: start;
56
64
  align-items: center;
@@ -58,14 +66,14 @@
58
66
  }
59
67
 
60
68
  .column.column-tokenicons {
61
- width: 20%;
69
+ width: 10%;
62
70
  flex-direction: row;
63
71
  align-items: center;
64
72
  justify-content: space-evenly;
65
73
  }
66
74
 
67
75
  .column.column-tokentags {
68
- width: 33%;
76
+ width: 25%;
69
77
  flex-direction: row;
70
78
  align-items: center;
71
79
  }
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.253",
6
+ "version": "1.0.255",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",