@ape.swap/bonds-sdk 4.4.1-test.4 → 4.4.1-test.6

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 +8 -5
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -63549,7 +63549,10 @@ const getVestingTermsTooltipString = (bond) => {
63549
63549
  return undefined;
63550
63550
  const vestingTime = getTimePeriods(vestingTerm - vestingCliff, true);
63551
63551
  const vestingCliffString = getTimePeriods(vestingCliff, true);
63552
- return `${vestingCliffString.days} days cliff + ${vestingTime.days} days linear vesting.`;
63552
+ if (vestingTerm - vestingCliff === 0) {
63553
+ return `${vestingCliffString.days}-day cliff, then instant release of all tokens.`;
63554
+ }
63555
+ return `${vestingCliffString.days}-day cliff + ${vestingTime.days}-day linear vesting.`;
63553
63556
  };
63554
63557
  const discountEarnTokenPrice = (bond, useTiers) => {
63555
63558
  var _a, _b, _c;
@@ -64801,7 +64804,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl)
64801
64804
  let payoutTokenPrice = (_d = (_c = tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices[bond.chainId]) === null || _c === void 0 ? void 0 : _c.find((tokenPrice) => { var _a, _b, _c, _d; return ((_a = tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.tokenAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bond.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()); })) === null || _d === void 0 ? void 0 : _d.price;
64802
64805
  if (principalTokenPrice === undefined) {
64803
64806
  try {
64804
- const res = yield axios.get(`${priceApiUrl}/price?token=${(_f = (_e = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]}&chain=${bond === null || bond === void 0 ? void 0 : bond.chainId}`);
64807
+ const res = yield axios.get(`${priceApiUrl}/realtime/price?token=${(_f = (_e = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]}&chain=${bond === null || bond === void 0 ? void 0 : bond.chainId}`);
64805
64808
  console.log('Individual call for: ', bond.lpToken.symbol, '. Price: ', res.data.price);
64806
64809
  principalTokenPrice = parseFloat((_g = res.data.price) !== null && _g !== void 0 ? _g : '0');
64807
64810
  }
@@ -64811,7 +64814,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl)
64811
64814
  }
64812
64815
  if (payoutTokenPrice === undefined) {
64813
64816
  try {
64814
- const res = yield axios.get(`${priceApiUrl}/price?token=${(_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.address) === null || _j === void 0 ? void 0 : _j[bond === null || bond === void 0 ? void 0 : bond.chainId]}&chain=${bond === null || bond === void 0 ? void 0 : bond.chainId}`);
64817
+ const res = yield axios.get(`${priceApiUrl}/realtime/price?token=${(_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.address) === null || _j === void 0 ? void 0 : _j[bond === null || bond === void 0 ? void 0 : bond.chainId]}&chain=${bond === null || bond === void 0 ? void 0 : bond.chainId}`);
64815
64818
  console.log('Individual call for: ', bond.earnToken.symbol, '. Price: ', res.data.price);
64816
64819
  payoutTokenPrice = parseFloat((_k = res.data.price) !== null && _k !== void 0 ? _k : '0');
64817
64820
  }
@@ -75483,7 +75486,7 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices, pric
75483
75486
  if (lpPrice === undefined) {
75484
75487
  try {
75485
75488
  // Missing token price, therefor make a single call to api to fetch it
75486
- const res = yield axios.get(`${priceApiUrl}/price?token=${(_c = (_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bill === null || bill === void 0 ? void 0 : bill.chainId]}&chain=${bill === null || bill === void 0 ? void 0 : bill.chainId}`);
75489
+ const res = yield axios.get(`${priceApiUrl}/realtime/price?token=${(_c = (_b = bill === null || bill === void 0 ? void 0 : bill.lpToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bill === null || bill === void 0 ? void 0 : bill.chainId]}&chain=${bill === null || bill === void 0 ? void 0 : bill.chainId}`);
75487
75490
  console.log('Individual call for: ', bill.lpToken.symbol, '. Price: ', res.data.price);
75488
75491
  lpPrice = parseFloat((_d = res.data.price) !== null && _d !== void 0 ? _d : '0');
75489
75492
  }
@@ -75499,7 +75502,7 @@ const cleanBillsData = (billIds, chunkedBills, chainId, bills, tokenPrices, pric
75499
75502
  if (earnTokenPrice === undefined) {
75500
75503
  try {
75501
75504
  // Missing token price, therefor make a single call to api to fetch it
75502
- const res = yield axios.get(`${priceApiUrl}/price?token=${(_g = (_f = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g[bill === null || bill === void 0 ? void 0 : bill.chainId]}&chain=${bill === null || bill === void 0 ? void 0 : bill.chainId}`);
75505
+ const res = yield axios.get(`${priceApiUrl}/realtime/price?token=${(_g = (_f = bill === null || bill === void 0 ? void 0 : bill.earnToken) === null || _f === void 0 ? void 0 : _f.address) === null || _g === void 0 ? void 0 : _g[bill === null || bill === void 0 ? void 0 : bill.chainId]}&chain=${bill === null || bill === void 0 ? void 0 : bill.chainId}`);
75503
75506
  console.log('Individual call for: ', bill.earnToken.symbol, '. Price: ', res.data.price);
75504
75507
  earnTokenPrice = parseFloat((_h = res.data.price) !== null && _h !== void 0 ? _h : '0');
75505
75508
  }
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": "4.4.1-test.4",
6
+ "version": "4.4.1-test.6",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",