@ape.swap/bonds-sdk 4.1.1-test.9 → 4.1.2-test.2

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.
package/dist/main.js CHANGED
@@ -63200,15 +63200,15 @@ const PUBLIC_RPC_URLS = {
63200
63200
  [types$1.ChainId.ARBITRUM]: ['https://arb1.arbitrum.io/rpc'],
63201
63201
  [types$1.ChainId.BSC_TESTNET]: ['https://data-seed-prebsc-2-s3.binance.org:8545/'],
63202
63202
  [types$1.ChainId.MATIC]: [
63203
+ 'https://polygon-rpc.com/',
63203
63204
  'https://polygon.drpc.org',
63204
63205
  'https://polygon-mainnet.public.blastapi.io/',
63205
- 'https://polygon-rpc.com/',
63206
63206
  'https://rpc-mainnet.matic.network',
63207
63207
  'https://matic-mainnet.chainstacklabs.com',
63208
63208
  ],
63209
63209
  [types$1.ChainId.MAINNET]: [
63210
- 'https://eth.drpc.org',
63211
63210
  'https://ethereum-rpc.publicnode.com',
63211
+ 'https://eth.drpc.org',
63212
63212
  'https://eth-mainnet.public.blastapi.io',
63213
63213
  'https://rpc.ankr.com/eth',
63214
63214
  ],
@@ -63236,7 +63236,7 @@ const PUBLIC_RPC_URLS = {
63236
63236
  [types$1.ChainId.SONIC]: ['https://rpc.soniclabs.com'],
63237
63237
  [types$1.ChainId.BERACHAIN]: ['https://rpc.berachain.com', 'https://berachain.drpc.org'],
63238
63238
  [types$1.ChainId.KATANA]: ['https://rpc-katana.t.conduit.xyz/NRcSLqEG4Hw55GzTSu6Sratq94kKtUGfH'],
63239
- [types$1.ChainId.UNICHAIN]: ['https://unichain.drpc.org'],
63239
+ [types$1.ChainId.UNICHAIN]: ['https://unichain-rpc.publicnode.com', 'https://unichain.drpc.org'],
63240
63240
  [types$1.ChainId.MEGAETH_TESTNET]: ['https://carrot.megaeth.com/rpc'],
63241
63241
  // SOL RPC is not public. Production URL (morning-autumn-dream) is domain-protected, development URL (ancient-cold-sailboat) is free, use with caution.
63242
63242
  [types$1.ChainId.SOL]: process.env.NODE_ENV === 'production'
@@ -65759,10 +65759,7 @@ function useUserBonds() {
65759
65759
  const solanaAccount = publicKey === null || publicKey === void 0 ? void 0 : publicKey.toBase58();
65760
65760
  const { data: tokenPrices } = useTokenPrices();
65761
65761
  const queryClient = useQueryClient();
65762
- // TODO: rollback this. dev only
65763
65762
  return useQuery({
65764
- // queryKey: [QUERY_KEYS.USER_BONDS],
65765
- // queryFn: () => dummyJson,
65766
65763
  queryKey: [QUERY_KEYS.USER_BONDS, address, publicKey, (_b = (_a = Object.keys(tokenPrices !== null && tokenPrices !== void 0 ? tokenPrices : {})) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : null],
65767
65764
  queryFn: () => getUserBonds(address, solanaAccount, bondList, queryClient),
65768
65765
  enabled: !!bondList && !!(address || solanaAccount) && !!tokenPrices,
@@ -76084,6 +76081,13 @@ const remove0xPrefix = (str) => {
76084
76081
  return str;
76085
76082
  };
76086
76083
 
76084
+ const CircularModal = () => {
76085
+ const handleClick = () => {
76086
+ window.location.href = 'https://ape.bond/tier-staking';
76087
+ };
76088
+ return (jsx$2(Modal, { title: "You've Claimed ABOND!", children: jsxs(Flex, { sx: { flexDirection: 'column' }, children: [jsx$2(Flex, { sx: { fontSize: '12px', lineHeight: '20px', color: 'primaryButton', mt: '10px' }, children: "Did You Know?" }), jsxs(Flex, { sx: { flexDirection: 'column', gap: '10px', cursor: 'pointer' }, onClick: handleClick, children: [jsx$2(Flex, { children: "You can stake ABOND to earn $BNB and extra discounts on Bonds:" }), jsx$2(Image$1, { src: 'https://ape.bond/images/circular-staking/real-yield.png' }), jsx$2(Image$1, { src: 'https://ape.bond/images/circular-staking/extra-discounts.png' }), jsx$2(Button, { sx: { width: '100%', mt: '10px' }, children: " Stake now" })] })] }) }));
76089
+ };
76090
+
76087
76091
  const Actions = ({ userBill }) => {
76088
76092
  var _a, _b, _c;
76089
76093
  // Hooks
@@ -76154,9 +76158,15 @@ const Actions = ({ userBill }) => {
76154
76158
  });
76155
76159
  }
76156
76160
  });
76161
+ // Modals
76162
+ const [openCircularModal] = useModal(jsx$2(CircularModal, {}), true, false, 'circularModal');
76157
76163
  useEffect(() => {
76164
+ var _a;
76158
76165
  if (isConfirmed) {
76159
76166
  refetchUserBonds();
76167
+ if (((_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.earnToken.symbol.toLowerCase()) === 'abond') {
76168
+ openCircularModal();
76169
+ }
76160
76170
  }
76161
76171
  /* eslint-disable react-hooks/exhaustive-deps */
76162
76172
  }, [isConfirmed]);
@@ -76581,18 +76591,18 @@ const UserBondRow = ({ bill }) => {
76581
76591
  const lastBlockTimestamp = parseInt((_e = bill === null || bill === void 0 ? void 0 : bill.lastBlockTimestamp) !== null && _e !== void 0 ? _e : '0');
76582
76592
  const isPendingCliff = vestingCliff ? currentTime - lastBlockTimestamp < vestingCliff : false;
76583
76593
  const cliffCountdown = getTimePeriods(lastBlockTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
76594
+ // Modals
76595
+ const [openCircularModal] = useModal(jsx$2(CircularModal, {}), true, false, 'circularModal');
76584
76596
  useEffect(() => {
76597
+ var _a;
76585
76598
  if (isConfirmed) {
76586
76599
  refetchUserBonds();
76600
+ if (((_a = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _a === void 0 ? void 0 : _a.earnToken.symbol.toLowerCase()) === 'abond') {
76601
+ openCircularModal();
76602
+ }
76587
76603
  }
76588
76604
  /* eslint-disable react-hooks/exhaustive-deps */
76589
76605
  }, [isConfirmed]);
76590
- // TODO: rollback this. dev only
76591
- // useEffect(() => {
76592
- // if (bill?.id === '265') {
76593
- // onOpenPurchasedBond()
76594
- // }
76595
- // }, [bill?.id])
76596
76606
  return (jsxs("div", { className: "your-bonds", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: (_g = (_f = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _f === void 0 ? void 0 : _f.earnToken) === null || _g === void 0 ? void 0 : _g.symbol, chain: (_h = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _h === void 0 ? void 0 : _h.chainId, tag: (_k = (_j = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _j === void 0 ? void 0 : _j.tags) === null || _k === void 0 ? void 0 : _k[0], vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: ((_l = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _l === void 0 ? void 0 : _l.earnToken.address[bill === null || bill === void 0 ? void 0 : bill.bond.chainId]) || '', earnTokenSymbol: ((_m = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _m === void 0 ? void 0 : _m.earnToken.symbol) || '', bondContract: (_o = bill === null || bill === void 0 ? void 0 : bill.address) !== null && _o !== void 0 ? _o : '', projectLink: (_p = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _p === void 0 ? void 0 : _p.projectLink, twitter: (_q = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _q === void 0 ? void 0 : _q.twitter, audit: (_r = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _r === void 0 ? void 0 : _r.audit, chain: (_s = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _s === void 0 ? void 0 : _s.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
76597
76607
  opacity: 0.8,
76598
76608
  }, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex$1, { sx: { width: '125px' }, children: jsx$2(ProfitCard, { userBond: bill }) }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimable(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(claimable(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pending(bill), 3), jsx$2("div", { className: "your-bonds-content-tokens-usd-amount", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: getPercentageVested(bill) }), style: {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CircularModal: () => React.JSX.Element;
3
+ export default CircularModal;
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.1.1-test.9",
6
+ "version": "4.1.2-test.2",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",