@ape.swap/bonds-sdk 1.0.153 → 1.0.154
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.
|
@@ -58,6 +58,7 @@ import { defaultTheme } from '../../theme';
|
|
|
58
58
|
import Svg from '../uikit/Svg';
|
|
59
59
|
import '../../scss/Bonds.scss';
|
|
60
60
|
import { BigNumber } from 'bignumber.js';
|
|
61
|
+
import { ChainId } from '../../config/Chains';
|
|
61
62
|
var Bonds = function (_a) {
|
|
62
63
|
var connectionString = _a.connectionString;
|
|
63
64
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
@@ -111,7 +112,11 @@ var Bonds = function (_a) {
|
|
|
111
112
|
axios.get('https://realtime-api.ape.bond/bonds').then(function (response) {
|
|
112
113
|
var bonds = response.data.bonds;
|
|
113
114
|
setBondData(bonds);
|
|
115
|
+
console.log("BONDS");
|
|
116
|
+
console.log(bonds);
|
|
114
117
|
var bondsToRender = bondData.filter(function (bond) { return !isSoldOut(bond); });
|
|
118
|
+
console.log("BONDS TO RENDER");
|
|
119
|
+
console.log(bondsToRender);
|
|
115
120
|
setBondData(bondsToRender);
|
|
116
121
|
});
|
|
117
122
|
}, []);
|
|
@@ -128,9 +133,11 @@ var Bonds = function (_a) {
|
|
|
128
133
|
var thresholdToHide = new BigNumber(100).div((_a = bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : 0);
|
|
129
134
|
if (bond.soldOut)
|
|
130
135
|
return true;
|
|
136
|
+
if (bond.discount == null)
|
|
137
|
+
return true;
|
|
131
138
|
if (!bond.tokensRemaining)
|
|
132
139
|
return false;
|
|
133
|
-
if (bond.discount && bond.discount > 25 && bond.chainId ===
|
|
140
|
+
if (bond.discount && bond.discount > 25 && bond.chainId === ChainId.BASE /*BASE*/)
|
|
134
141
|
return true;
|
|
135
142
|
return ((_b = new BigNumber(bond.tokensRemaining)) === null || _b === void 0 ? void 0 : _b.lte(thresholdToHide)) || bond.discount === 100;
|
|
136
143
|
}, []);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum ChainId {
|
|
2
|
+
MAINNET = 1,
|
|
3
|
+
MATIC = 137,
|
|
4
|
+
MATIC_TESTNET = 80001,
|
|
5
|
+
BSC = 56,
|
|
6
|
+
BSC_TESTNET = 97,
|
|
7
|
+
TLOS = 40,
|
|
8
|
+
ARBITRUM = 42161,
|
|
9
|
+
INEVM_TESTNET = 2424,
|
|
10
|
+
INEVM = 2525,
|
|
11
|
+
SEPOLIA = 11155111,
|
|
12
|
+
LINEA = 59144,
|
|
13
|
+
LIGHTLINK = 1890,
|
|
14
|
+
IOTA_TESTNET = 1075,
|
|
15
|
+
IOTA = 8822,
|
|
16
|
+
BASE = 8453
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|