@ape.swap/bonds-sdk 1.0.158 → 1.0.160

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.
@@ -59,8 +59,6 @@ import Svg from '../uikit/Svg';
59
59
  import '../../scss/Bonds.scss';
60
60
  import { BigNumber } from 'bignumber.js';
61
61
  import { ChainId } from '../../config/chains';
62
- import ProgressBarWrapper from '../ProgressBar/ProgressBarWrapper';
63
- import ProgressBar from '../ProgressBar/ProgressBar';
64
62
  var Bonds = function (_a) {
65
63
  var connectionString = _a.connectionString;
66
64
  var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
@@ -165,13 +163,7 @@ var Bonds = function (_a) {
165
163
  };
166
164
  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: [_jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Discount" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "ARR" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens Remaining" })), _jsx(Flex, { className: "column column-header" })] })), sortedBonds.map(function (bond) {
167
165
  var _a, _b, _c;
168
- return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 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") : '-' })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: new BigNumber(bond.tokensRemaining).div(bond.maxTotalPayout).times(100).toNumber() }), style: {
169
- width: '127px',
170
- height: '25px',
171
- flexDirection: 'column',
172
- justifyContent: 'center',
173
- display: ['none', 'none', 'none', 'flex'],
174
- }, showTooltip: true }), bond.tokensRemaining.split('.')[0]] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
166
+ return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 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: bond.tokensRemaining.split('.')[0] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
175
167
  })] }))] })));
176
168
  };
177
169
  export default Bonds;
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.158",
6
+ "version": "1.0.160",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface ProgressBarProps {
3
- value: number;
4
- color?: string;
5
- }
6
- declare const ProgressBar: React.FC<ProgressBarProps>;
7
- export default ProgressBar;
@@ -1,30 +0,0 @@
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 } from "theme-ui/jsx-runtime";
13
- import { Box } from 'theme-ui';
14
- import { Flex } from '../uikit';
15
- var ProgressBar = function (_a) {
16
- var value = _a.value, _b = _a.color, color = _b === void 0 ? 'text' : _b;
17
- return (_jsx(Flex, __assign({ sx: { width: ['100px', '100px', '100px', '100%'], alignItems: 'center', flexDirection: 'row', mt: '5px' } }, { children: _jsx(Box, __assign({ sx: {
18
- width: '100%',
19
- height: '5px',
20
- backgroundColor: 'white4',
21
- borderRadius: '10px',
22
- overflow: 'hidden',
23
- } }, { children: _jsx(Box, { sx: {
24
- width: "".concat(value <= 3 ? 3 : value, "%"),
25
- background: color,
26
- borderRadius: '10px',
27
- height: '100%',
28
- } }) })) })));
29
- };
30
- export default ProgressBar;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { ThemeUIStyleObject } from 'theme-ui';
3
- export interface ProgressBarWrapperProps {
4
- title?: string;
5
- value?: React.ReactNode;
6
- value2Direction?: 'column' | 'row';
7
- toolTip?: string;
8
- toolTipPlacement?: 'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft';
9
- toolTipTransform?: string;
10
- style?: ThemeUIStyleObject;
11
- showTooltip?: boolean;
12
- }
13
- declare const _default: React.NamedExoticComponent<ProgressBarWrapperProps>;
14
- export default _default;
@@ -1,22 +0,0 @@
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 React from 'react';
14
- import { useTranslation } from '../../contexts/Localization';
15
- import { styles } from './styles';
16
- import { Flex, Skeleton, Text } from '../uikit';
17
- var ProgressBarWrapper = function (_a) {
18
- var title = _a.title, value = _a.value, style = _a.style, showTooltip = _a.showTooltip, toolTipPlacement = _a.toolTipPlacement, toolTipTransform = _a.toolTipTransform, toolTip = _a.toolTip;
19
- var t = useTranslation().t;
20
- return (_jsxs(Flex, __assign({ sx: style }, { children: [_jsx(Flex, __assign({ sx: { alignItems: 'center' } }, { children: _jsx(Text, __assign({ sx: styles.titleText }, { children: t("".concat(title)) })) })), showTooltip ? (_jsx(Flex, { sx: { alignItems: 'center', width: '100%' } })) : (_jsx(Flex, __assign({ sx: { justifyContent: 'center', alignItems: 'center' } }, { children: value ? value : _jsx(Skeleton, { sx: styles.skeleton }) })))] })));
21
- };
22
- export default React.memo(ProgressBarWrapper);
@@ -1,2 +0,0 @@
1
- import { ThemeUIStyleObject } from 'theme-ui';
2
- export declare const styles: Record<'listCardContainer' | 'listViewContainer' | 'titleContainer' | 'infoContentMobile' | 'tokensContainer' | 'titleText' | 'skeleton' | 'valueText' | 'secondaryText' | 'cardContentContainer' | 'animationDiv' | 'expandedWrapper', ThemeUIStyleObject>;
@@ -1,82 +0,0 @@
1
- export var styles = {
2
- listCardContainer: {
3
- borderRadius: 0,
4
- flexDirection: ['column', 'column', 'column', 'row'],
5
- alignItems: 'center',
6
- justifyContent: 'space-between',
7
- background: 'white2',
8
- borderBottom: '1px solid rgba(226, 226, 226, .2)',
9
- padding: ['10px 20px 10px 20px', '10px 20px 10px 20px', '10px 20px 10px 20px', '0 30px 0 30px'],
10
- margin: '0 10px 0 10px',
11
- maxWidth: ['500px', '500px', '500px', '100%'],
12
- minWidth: '300px',
13
- width: '100%',
14
- height: ['unset', 'unset', 'unset', '86px'],
15
- },
16
- listViewContainer: {
17
- display: 'flex',
18
- flexDirection: 'column',
19
- alignItems: 'center',
20
- width: '100%',
21
- },
22
- titleContainer: {
23
- width: '100%',
24
- justifyContent: 'space-between',
25
- my: '5px',
26
- },
27
- infoContentMobile: {
28
- display: ['flex', 'flex', 'flex', 'none'],
29
- alignItems: 'center',
30
- },
31
- tokensContainer: {
32
- alignItems: 'center',
33
- height: '100%',
34
- width: '100%',
35
- },
36
- titleText: {
37
- opacity: 0.6,
38
- fontSize: '12px',
39
- lineHeight: ['16px', '16px', '16px', '24px'],
40
- fontWeight: 400,
41
- },
42
- skeleton: {
43
- width: ['45px', '45px', '60px'],
44
- maxHeight: '18px',
45
- minHeight: '18px',
46
- },
47
- valueText: {
48
- fontSize: ['12px', '12px', '12px', '14px'],
49
- color: 'primaryBright',
50
- lineHeight: '16px',
51
- fontWeight: 700,
52
- mr: '5px',
53
- display: 'flex',
54
- alignItems: 'center',
55
- },
56
- secondaryText: {
57
- fontSize: '12px',
58
- color: 'gray',
59
- lineHeight: '16px',
60
- fontWeight: 400,
61
- },
62
- cardContentContainer: {
63
- width: '100%',
64
- height: '100%',
65
- alignItems: 'center',
66
- justifyContent: 'flex-end',
67
- },
68
- animationDiv: {
69
- position: 'relative',
70
- width: '100%',
71
- maxWidth: ['500px', '500px', '500px', '100%'],
72
- minWidth: '300px',
73
- },
74
- expandedWrapper: {
75
- background: 'white3',
76
- flexDirection: 'column',
77
- justifyContent: 'space-between',
78
- padding: '15px 10px',
79
- flexWrap: 'wrap',
80
- alignItems: 'center',
81
- },
82
- };