@ape.swap/bonds-sdk 3.0.19 → 3.0.20

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.
Files changed (2) hide show
  1. package/dist/main.js +11 -1
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -71944,11 +71944,21 @@ const useTopTags = (initialBondList) => {
71944
71944
  };
71945
71945
 
71946
71946
  const isBondSoldOut = (bill) => {
71947
+ var _a;
71947
71948
  if (bill.soldOut)
71948
71949
  return true;
71949
71950
  if (bill.inactive)
71950
71951
  return true;
71951
- return false; //TODO: rollback this
71952
+ const { tokensRemaining, payoutTokenPrice } = bill;
71953
+ if (!tokensRemaining)
71954
+ return false;
71955
+ const thresholdToHide = new BigNumber$1(100).div(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : 0);
71956
+ if ((_a = new BigNumber$1(tokensRemaining)) === null || _a === void 0 ? void 0 : _a.lte(thresholdToHide)) {
71957
+ // If there's less than 100 usd bond will be hidden
71958
+ return true;
71959
+ }
71960
+ else
71961
+ return false;
71952
71962
  };
71953
71963
  const sortBonds = (sortConfig, bonds) => {
71954
71964
  const bondsToSort = bonds !== null && bonds !== void 0 ? 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": "3.0.19",
6
+ "version": "3.0.20",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",