@ape.swap/bonds-sdk 3.0.51 → 3.0.52

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
@@ -18985,7 +18985,7 @@ const AddFavToken = ({ tokenSymbol, hotBond, isGoldBond, }) => {
18985
18985
 
18986
18986
  const defaultUrls = {
18987
18987
  apiV2: 'https://api.ape.bond',
18988
- realTimeApi: 'https://realtime-api.ape.bond/bonds',
18988
+ realTimeApi: 'https://realtime-api.ape.bond',
18989
18989
  apeswapLists: 'https://raw.githubusercontent.com/ApeSwapFinance/apeswap-lists/refs/heads/main',
18990
18990
  mainUrl: 'https://ape.bond',
18991
18991
  };
@@ -69874,20 +69874,20 @@ var PRICE_GETTER_V3_ABI = [
69874
69874
  ];
69875
69875
 
69876
69876
  function useTokenPrices() {
69877
- const apeswapListsURL = useURLByEnvironment('apeswapLists');
69877
+ const realTime = useURLByEnvironment('realTimeApi');
69878
69878
  const SDKConfig = useSDKConfig();
69879
69879
  return useQuery({
69880
69880
  queryKey: [QUERY_KEYS.TOKEN_PRICES],
69881
- queryFn: () => getTokenPrices(apeswapListsURL, SDKConfig.chains),
69881
+ queryFn: () => getTokenPrices(realTime, SDKConfig.chains),
69882
69882
  refetchInterval: 60000, // 60 sec
69883
69883
  refetchOnMount: false,
69884
69884
  refetchOnWindowFocus: false,
69885
69885
  enabled: !!SDKConfig.chains && SDKConfig.chains.length > 0,
69886
69886
  });
69887
69887
  }
69888
- const getTokenPrices = (apeswapListsURL, chains) => __awaiter$9(void 0, void 0, void 0, function* () {
69888
+ const getTokenPrices = (apiURL, chains) => __awaiter$9(void 0, void 0, void 0, function* () {
69889
69889
  try {
69890
- const response = yield axios.get(`${apeswapListsURL}/config/tokens.json`);
69890
+ const response = yield axios.get(`${apiURL}/utils/tokens`);
69891
69891
  const tokenList = response.data;
69892
69892
  const promises = chains.map((chain) => __awaiter$9(void 0, void 0, void 0, function* () {
69893
69893
  try {
@@ -71336,17 +71336,17 @@ const UserBondRow = ({ bill }) => {
71336
71336
  };
71337
71337
 
71338
71338
  function useBondsList() {
71339
- const apeswapListsURL = useURLByEnvironment('apeswapLists');
71339
+ const realTime = useURLByEnvironment('realTimeApi');
71340
71340
  return useQuery({
71341
71341
  queryKey: [QUERY_KEYS.BONDS_LIST],
71342
- queryFn: () => getBondsList(apeswapListsURL),
71342
+ queryFn: () => getBondsList(realTime),
71343
71343
  staleTime: Infinity,
71344
71344
  refetchOnWindowFocus: false,
71345
71345
  });
71346
71346
  }
71347
- const getBondsList = (apeswapListsURL) => __awaiter$9(void 0, void 0, void 0, function* () {
71347
+ const getBondsList = (apiURL) => __awaiter$9(void 0, void 0, void 0, function* () {
71348
71348
  try {
71349
- const response = yield axios.get(`${apeswapListsURL}/config/bills.json`);
71349
+ const response = yield axios.get(`${apiURL}/utils/bonds`);
71350
71350
  return response.data;
71351
71351
  }
71352
71352
  catch (_a) {
@@ -74473,7 +74473,7 @@ function useBondsData() {
74473
74473
  }
74474
74474
  const getBondsData = (chains, realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
74475
74475
  try {
74476
- const response = yield axios.get(realTimeApiURL);
74476
+ const response = yield axios.get(`${realTimeApiURL}/bonds`);
74477
74477
  return response.data.bonds;
74478
74478
  }
74479
74479
  catch (_a) {
@@ -1,4 +1,4 @@
1
1
  import { UseQueryResult } from '@tanstack/react-query';
2
2
  import { BillsConfig } from '@ape.swap/apeswap-lists';
3
3
  export default function useBondsList(): UseQueryResult<BillsConfig[]>;
4
- export declare const getBondsList: (apeswapListsURL: string) => Promise<BillsConfig[][]>;
4
+ export declare const getBondsList: (apiURL: string) => Promise<BillsConfig[][]>;
@@ -7,5 +7,5 @@ export interface TokenPrices {
7
7
  chainId: ChainId | undefined;
8
8
  }
9
9
  export default function useTokenPrices(): UseQueryResult<TokenPrices[]>;
10
- export declare const getTokenPrices: (apeswapListsURL: string, chains: number[]) => Promise<TokenPrices[]>;
10
+ export declare const getTokenPrices: (apiURL: string, chains: number[]) => Promise<TokenPrices[]>;
11
11
  export declare function getTokenPricesV3FromPriceGetter(tokensToCall: Record<string, Token>, chain: ChainId): Promise<any>;
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.51",
6
+ "version": "3.0.52",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",