@ape.swap/bonds-sdk 1.0.440 → 1.0.442

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.
@@ -0,0 +1,10 @@
1
+ /** @jsxImportSource theme-ui */
2
+ import React from 'react';
3
+ import './BondRowsHeader.scss';
4
+ interface BondRowsHeaderProps {
5
+ inputValue: string;
6
+ onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
7
+ onSort: (key: 'discount' | 'arr' | 'terms' | 'tokensRemaining') => void;
8
+ }
9
+ declare const BondRowsHeader: React.FC<BondRowsHeaderProps>;
10
+ export default BondRowsHeader;
@@ -0,0 +1,22 @@
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 'theme-ui';
14
+ import { Input } from '../../uikit-sdk/Input';
15
+ import { Svg, TooltipBubble } from '../../uikit-sdk';
16
+ import { TooltipText } from '../../../enum/tooltips';
17
+ import './BondRowsHeader.scss';
18
+ var BondRowsHeader = function (_a) {
19
+ var inputValue = _a.inputValue, onInputChange = _a.onInputChange, onSort = _a.onSort;
20
+ return (_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: onInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px' }, width: '100%', placeholder: 'Search...' }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return onSort('discount'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-arr" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return onSort('arr'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-terms" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return onSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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, __assign({ className: "column header-icon", onClick: function () { return onSort('tokensRemaining'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsx(Flex, { className: "column column-hotbond" })] }))] })));
21
+ };
22
+ export default BondRowsHeader;
@@ -24,6 +24,6 @@ var ChainTitle = function (_a) {
24
24
  textTransform: 'uppercase',
25
25
  display: 'flex',
26
26
  width: '200px',
27
- } }, { children: [NETWORK_LABEL[chain], " Bonds", _jsx(Flex, __assign({ sx: { ml: '7px' } }, { children: _jsx(Svg, { icon: "caret", direction: isOpen ? 'up' : 'down', width: 8, color: "textDisabledButton" }) }))] })));
27
+ } }, { children: [NETWORK_LABEL[chain], " Bonds", _jsx(Flex, __assign({ sx: { ml: '7px' } }, { children: _jsx(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }))] })));
28
28
  };
29
29
  export default ChainTitle;
@@ -64,15 +64,13 @@ import { useWeb3React } from '@web3-react/core';
64
64
  import { useSearchParams, useNavigate } from 'react-router-dom';
65
65
  import getTimePeriods from '../../utils/getTimePeriods';
66
66
  import { defaultTheme } from '../../theme';
67
- import '../../scss/Bonds.scss';
68
67
  import { BigNumber } from 'bignumber.js';
69
68
  import { ChainId } from '../../enum/apeswaplists';
70
69
  import { formatValue } from '../../utils/formatNumbers';
71
- import { TooltipText } from '../../enum/tooltips';
72
- import { TooltipBubble, Svg } from '../uikit-sdk';
73
70
  import { BLOCK_EXPLORER } from '../../config/constants/chains';
74
- import { Input } from '../uikit-sdk/Input';
75
71
  import BondRowsByChain from './BondRows/BondRowsByChain';
72
+ import '../../scss/Bonds.scss';
73
+ import BondRowsHeader from './BondRows/BondRowsHeader';
76
74
  var Bonds = function (_a) {
77
75
  var connectionString = _a.connectionString;
78
76
  var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
@@ -269,6 +267,6 @@ var Bonds = function (_a) {
269
267
  setBondsRendered(true);
270
268
  }
271
269
  }, [filteredBonds]);
272
- return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_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-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' }, width: '100%', placeholder: 'Search...' }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return handleSort('discount'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-arr" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return handleSort('arr'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-terms" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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 header-icon", onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { 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, __assign({ className: "column header-icon", onClick: function () { return handleSort('tokensRemaining'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsx(Flex, { className: "column column-hotbond" })] }))] })), _jsx(BondRowsByChain, { bonds: filteredBonds, hotBonds: hotBonds, rowClick: rowClick })] })))] })));
270
+ return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsx(BondRowsHeader, { inputValue: inputValue, onInputChange: handleInputChange, onSort: handleSort }), _jsx(BondRowsByChain, { bonds: filteredBonds, hotBonds: hotBonds, rowClick: rowClick })] })))] })));
273
271
  };
274
272
  export default Bonds;
@@ -0,0 +1,140 @@
1
+
2
+ .container.table-container {
3
+ width: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ padding-top: 50px;
7
+ padding-left: 100px;
8
+ padding-right: 100px;
9
+ padding-bottom: 50px;
10
+ }
11
+
12
+ .container.header-container {
13
+ display: flex;
14
+ justify-content: space-around;
15
+ align-items: center;
16
+ width: 100%;
17
+ padding-top: 5px;
18
+ padding-left: 15px;
19
+ padding-right: 15px;
20
+ padding-bottom: 5px;
21
+ font-size: 12px;
22
+ color: #78787D;
23
+ }
24
+
25
+ .container.bondrow-container {
26
+ display: flex;
27
+ flex-direction: row;
28
+ width: 100%;
29
+ height: 70px;
30
+ justify-content: space-around;
31
+ background-color: var(--theme-ui-colors-white2);
32
+ margin-bottom: 5px;
33
+ border-radius: 10px;
34
+ cursor: pointer;
35
+
36
+ &:hover {
37
+ background-color: var(--theme-ui-colors-white3);
38
+ }
39
+ }
40
+
41
+ .column.column-tokens {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: start;
45
+ width: 40%;
46
+ }
47
+
48
+ .column.column-search {
49
+ padding-bottom: 15px;
50
+ }
51
+
52
+ .column.column-tokeninfoname {
53
+ width: 100%;
54
+ height: 100%;
55
+ flex-direction: row;
56
+ justify-content: start;
57
+ align-items: center;
58
+ padding-left: 20px;
59
+ }
60
+
61
+ .column.column-tokenname {
62
+ width: 100%;
63
+ flex-direction: row;
64
+ justify-content: start;
65
+ align-items: center;
66
+ padding-left: 20px;
67
+ }
68
+
69
+ .column.column-tokenicons {
70
+ width: 20%;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ justify-content: start;
74
+ }
75
+
76
+ .column.column-bondinfo {
77
+ flex-direction: row;
78
+ align-items: center;
79
+ justify-content: end;
80
+ width: 70%;
81
+ }
82
+
83
+ .column.column-discount {
84
+ flex-direction: row;
85
+ justify-content: center;
86
+ align-items: center;
87
+ width: 20%;
88
+ }
89
+
90
+ .discount-positive {
91
+ color: #38A611;
92
+ width: 20%;
93
+ }
94
+
95
+ .discount-negative {
96
+ color: #DF4141;
97
+ width: 20%;
98
+ }
99
+
100
+ .column.column-arr {
101
+ flex-direction: row;
102
+ justify-content: center;
103
+ align-items: center;
104
+ width: 20%;
105
+ }
106
+
107
+ .column.column-terms {
108
+ flex-direction: row;
109
+ justify-content: center;
110
+ align-items: center;
111
+ width: 20%;
112
+ }
113
+
114
+ .column.column-tokensremaining {
115
+ flex-direction: row;
116
+ justify-content: center;
117
+ align-items: center;
118
+ width: 30%;
119
+ }
120
+
121
+ .column.column-hotbond {
122
+ flex-direction: row;
123
+ justify-content: center;
124
+ align-items: center;
125
+ width: 10%;
126
+ }
127
+
128
+ .column.tooltip {
129
+ flex-direction: row;
130
+ align-items: center;
131
+ justify-content: space-around;
132
+ }
133
+
134
+ .column.header-icon {
135
+ padding-left: 5px;
136
+ align-items: start;
137
+ justify-content: space-around;
138
+ cursor: pointer;
139
+ opacity: 0.6;
140
+ }
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.440",
6
+ "version": "1.0.442",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",