@ape.swap/bonds-sdk 1.0.153 → 1.0.155

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 === 8453 /*BASE*/)
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,18 @@
1
+ export var ChainId;
2
+ (function (ChainId) {
3
+ ChainId[ChainId["MAINNET"] = 1] = "MAINNET";
4
+ ChainId[ChainId["MATIC"] = 137] = "MATIC";
5
+ ChainId[ChainId["MATIC_TESTNET"] = 80001] = "MATIC_TESTNET";
6
+ ChainId[ChainId["BSC"] = 56] = "BSC";
7
+ ChainId[ChainId["BSC_TESTNET"] = 97] = "BSC_TESTNET";
8
+ ChainId[ChainId["TLOS"] = 40] = "TLOS";
9
+ ChainId[ChainId["ARBITRUM"] = 42161] = "ARBITRUM";
10
+ ChainId[ChainId["INEVM_TESTNET"] = 2424] = "INEVM_TESTNET";
11
+ ChainId[ChainId["INEVM"] = 2525] = "INEVM";
12
+ ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
13
+ ChainId[ChainId["LINEA"] = 59144] = "LINEA";
14
+ ChainId[ChainId["LIGHTLINK"] = 1890] = "LIGHTLINK";
15
+ ChainId[ChainId["IOTA_TESTNET"] = 1075] = "IOTA_TESTNET";
16
+ ChainId[ChainId["IOTA"] = 8822] = "IOTA";
17
+ ChainId[ChainId["BASE"] = 8453] = "BASE";
18
+ })(ChainId || (ChainId = {}));
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.153",
6
+ "version": "1.0.155",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",