@ape.swap/bonds-sdk 1.0.89 → 1.0.90

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.
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
12
+ import { jsxs as _jsxs, jsx as _jsx } from "theme-ui/jsx-runtime";
13
13
  import { Flex, ThemeUIProvider } from "theme-ui";
14
14
  import { useWeb3React } from "@web3-react/core";
15
15
  import { getColumnDiscountStyle } from '../Bonds/styles';
@@ -27,6 +27,6 @@ var BondModal = function (_a) {
27
27
  var vestingTime = function (vestingTerm) {
28
28
  return getTimePeriods(vestingTerm !== null && vestingTerm !== void 0 ? vestingTerm : 0, true);
29
29
  };
30
- return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: _jsx(Flex, __assign({ className: "modal-backdrop" }, { children: _jsxs(Flex, __assign({ className: "modal-content" }, { children: [_jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close", width: "20px" }) })), "Bond Modal", _jsxs("p", { children: ["Bond Address: ", bond === null || bond === void 0 ? void 0 : bond.billAddress] }), isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-header" }, { children: "Token" })), _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" }))] })), _jsxs(Flex, __assign({ className: "container bondrow-container" }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount", sx: getColumnDiscountStyle((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) }, { children: "".concat((_c = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _c === void 0 ? void 0 : _c.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat("".concat(((((_d = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _d !== void 0 ? _d : 0) * 365) / vestingTime((_e = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _e !== void 0 ? _e : 0).days).toFixed(2), "%")) })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime((_f = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _f !== void 0 ? _f : 0).days ? "".concat(vestingTime((_g = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _g !== void 0 ? _g : 0).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: bond === null || bond === void 0 ? void 0 : bond.tokensRemaining.split('.')[0] }))] }))] })), _jsxs(Flex, __assign({ className: "container button-container" }, { children: [_jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }), _jsxs(Button, { children: ["Buy ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] })] }))] })) })) })));
30
+ return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: _jsx(Flex, __assign({ className: "modal modal-backdrop" }, { children: _jsxs(Flex, __assign({ className: "modal modal-content" }, { children: [isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsxs(Flex, __assign({ className: "modal modal-header" }, { children: [_jsx(Flex, __assign({ className: "new" }, { children: "NEW" })), _jsxs(Flex, __assign({ className: "project-info" }, { children: ["Project Info", _jsx(Flex, __assign({ className: "project-info icon" }, { children: _jsx(Svg, { icon: "expand" }) }))] })), _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) }))] })), _jsxs(Flex, __assign({ className: "modal-container table-container" }, { children: [_jsx(Flex, __assign({ className: "modal-container title-container" }, { children: _jsx("h2", { children: bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName }) })), _jsx(Flex, __assign({ className: "modal-container description-container" }, { children: _jsx("p", { children: bond === null || bond === void 0 ? void 0 : bond.shortDescription }) })), _jsxs(Flex, __assign({ className: "modal-container blocks-container" }, { children: [_jsxs(Flex, __assign({ className: "modal-block column-discount", sx: getColumnDiscountStyle((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Discount", _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionFill" }) }))] })), "".concat((_c = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _c === void 0 ? void 0 : _c.toFixed(2), "%")] })), _jsxs(Flex, __assign({ className: "modal-block column-arr" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["ARR", _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionFill" }) }))] })), "".concat("".concat(((((_d = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _d !== void 0 ? _d : 0) * 365) / vestingTime((_e = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _e !== void 0 ? _e : 0).days).toFixed(2), "%"))] })), _jsxs(Flex, __assign({ className: "modal-block column-term" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Terms", _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionFill" }) }))] })), vestingTime((_f = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _f !== void 0 ? _f : 0).days ? "".concat(vestingTime((_g = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _g !== void 0 ? _g : 0).days, " D") : '-'] })), _jsxs(Flex, __assign({ className: "modal-block column-maxbuy" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Max Buy", _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionFill" }) }))] })), "1,000,000"] }))] }))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }), _jsxs(Button, { children: ["Buy ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] })] }))] })) })) })));
31
31
  };
32
32
  export default BondModal;
@@ -149,7 +149,7 @@ var Bonds = function (_a) {
149
149
  var _a, _b, _c, _d;
150
150
  return (
151
151
  // <Flex className="container bondrow-container" onClick={() => handleRowClick(bond.billAddress)}>
152
- _jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClickModal(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount", sx: getColumnDiscountStyle((_a = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _a !== void 0 ? _a : 0) }, { children: "".concat((_b = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _b === void 0 ? void 0 : _b.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr", sx: styles.columnArr }, { children: "".concat("".concat(((((_c = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _c !== void 0 ? _c : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%")) })), _jsx(Flex, __assign({ className: "column column-term", sx: styles.columnTerm }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining", sx: styles.columnTokensRemaining }, { children: bond.tokensRemaining.split('.')[0] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "icon icon-tooltip" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] })));
152
+ _jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClickModal(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token", sx: styles.columnToken }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount", sx: getColumnDiscountStyle((_a = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _a !== void 0 ? _a : 0) }, { children: "".concat((_b = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _b === void 0 ? void 0 : _b.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr", sx: styles.columnArr }, { children: "".concat("".concat(((((_c = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _c !== void 0 ? _c : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%")) })), _jsx(Flex, __assign({ className: "column column-term", sx: styles.columnTerm }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining", sx: styles.columnTokensRemaining }, { 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()) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] })));
153
153
  })] }))] })));
154
154
  };
155
155
  export default Bonds;
@@ -1,4 +1,4 @@
1
- .modal-backdrop {
1
+ .modal.modal-backdrop {
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -11,87 +11,141 @@
11
11
  z-index: 1000; /* Ensure it's on top */
12
12
  }
13
13
 
14
- .modal-content {
14
+ .modal.modal-content {
15
15
  display: flex;
16
16
  flex-direction: column;
17
17
  border-radius: 10px;
18
18
  background-color: #0E0D16;
19
19
  padding: 20px;
20
- border-radius: 5px;
20
+ border-radius: 10px;
21
21
  z-index: 1001;
22
+ max-width: 700px;
23
+ min-width: 700px;
22
24
  }
23
25
 
24
- .container.table-container {
26
+ .modal.modal-header{
27
+ display: flex;
28
+ justify-content: end;
29
+ align-items: center;
30
+
31
+ .svg-close {
32
+ height: 12px;
33
+ width: 12px;
34
+ cursor: pointer;
35
+ }
36
+
37
+ .project-info {
38
+ align-items: center;
39
+ box-sizing: border-box;
40
+ margin: 0px 10px 0px 0px;
41
+ min-width: 0px;
42
+ display: flex;
43
+ font-size: 12px;
44
+ font-weight: bold;
45
+ background: var(--theme-ui-colors-primaryButton);
46
+ padding-left: 10px;
47
+ padding-top: 2px;
48
+ padding-bottom: 2px;
49
+ border-radius: 10px;
50
+ align-items: center;
51
+ position: relative;
52
+ cursor: pointer;
53
+
54
+ .icon {
55
+ padding-left: 5px;
56
+ padding-right: 0px;
57
+ }
58
+ }
59
+
60
+ .new {
61
+ color: white;
62
+ display: flex;
63
+ background: rgba(223, 65, 65, 0.4);
64
+ border-radius: 6px;
65
+ padding: 1px 5px;
66
+ font-size: 12px;
67
+ font-weight: bold;
68
+ line-height: 17px;
69
+ margin-right: 10px;
70
+ cursor: pointer;
71
+ }
72
+ }
73
+
74
+ .modal-container.table-container {
25
75
  width: 100%;
26
76
  display: flex;
27
77
  flex-direction: column;
28
- padding: 50px;
78
+ padding: 10px;
29
79
  }
30
80
 
31
- .container.header-container {
81
+ .modal-container.title-container {
32
82
  display: flex;
33
- justify-content: space-around;
34
- padding: 5px;
35
- font-size: 12px;
36
- color: #78787D;
83
+ align-items: start;
37
84
  }
38
85
 
39
- .container.bondrow-container {
86
+ .modal-container.description-container {
87
+ display: flex;
88
+ align-items: start;
89
+ }
90
+
91
+ .modal-container.blocks-container {
40
92
  display: flex;
41
93
  flex-direction: row;
94
+ align-items: center;
42
95
  width: 100%;
43
96
  justify-content: space-around;
44
- background-color:#151320;
45
- margin-bottom: 10px;
46
- padding: 20px;
47
- border-radius: 10px;
48
- border: 1px solid #4B4B53;
49
- cursor: pointer;
97
+ margin-bottom: 20px;
98
+ margin-top: 20px;
50
99
  }
51
100
 
52
- .column.column-token {
53
- width: 100px;
101
+ .modal-block {
102
+ min-width: 0px;
103
+ display: flex;
54
104
  flex-direction: column;
55
- justify-content: center;
56
105
  align-items: center;
106
+ background: var(--theme-ui-colors-white3);
107
+ font-weight: 900;
108
+ font-size: 16px;
109
+ border-radius: 10px;
110
+ height: 90%;
111
+ padding-top: 10px;
112
+ padding-bottom: 10px;
57
113
  }
58
114
 
59
- .column.column-discount {
60
- width: 50px;
61
- flex-direction: column;
62
- justify-content: center;
63
- align-items: center;
115
+ .block-header.header {
116
+ color: white;
117
+ font-weight: normal;
118
+ font-size: 12px;
119
+ padding-bottom: 10px;
64
120
  }
65
121
 
66
- .column.column-arr {
67
- width: 50px;
68
- flex-direction: column;
69
- justify-content: center;
70
- align-items: center;
122
+ .block-header.icon {
123
+ padding-left: 5px;
124
+ align-items: start;
125
+ width: 18px;
126
+ cursor: pointer;
71
127
  }
72
128
 
73
- .column.column-term {
74
- width: 50px;
75
- flex-direction: column;
76
- justify-content: center;
77
- align-items: center;
129
+ .modal-block.column-discount {
130
+ margin: 0px 10px 0px 0px;
131
+ width: 350px;
78
132
  }
79
133
 
80
- .column.column-tokensremaining {
81
- width: 50px;
82
- flex-direction: column;
83
- justify-content: center;
84
- align-items: center;
134
+ .modal-block.column-arr {
135
+ margin: 0px 10px 0px 0px;
136
+ width: 350px;
85
137
  }
86
138
 
87
- .column.column-hotbond {
88
- width: 50px;
89
- flex-direction: column;
90
- justify-content: center;
91
- align-items: center;
139
+ .modal-block.column-term {
140
+ margin: 0px 10px 0px 0px;
141
+ width: 350px;
142
+ }
143
+
144
+ .modal-block.column-maxbuy {
145
+ width: 350px;
92
146
  }
93
147
 
94
- .container.button-container {
148
+ .modal-container.button-container {
95
149
  width: 100%;
96
150
 
97
151
  Button {
@@ -100,5 +154,6 @@
100
154
  flex: 1;
101
155
  margin-left: 10px;
102
156
  margin-right: 10px;
157
+ cursor: pointer;
103
158
  }
104
159
  }
@@ -30,4 +30,5 @@ export interface BondsDataResponse {
30
30
  priceUsd: string;
31
31
  tags?: string[];
32
32
  arr: string;
33
+ shortDescription?: string;
33
34
  }
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.89",
6
+ "version": "1.0.90",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",
@@ -52,6 +52,7 @@
52
52
  "@emotion/react": "^11.11.4",
53
53
  "@emotion/styled": "^11.11.5",
54
54
  "@types/node": "^20.14.10",
55
+ "bignumber.js": "^9.1.2",
55
56
  "framer-motion": "^11.3.2",
56
57
  "lodash": "^4.17.21",
57
58
  "lottie-react": "^2.4.0",