@ape.swap/bonds-sdk 3.0.50 → 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.
@@ -1,6 +1,5 @@
1
1
  import { ChainId } from '@ape.swap/apeswap-lists';
2
2
  export declare const supportedByLIFI: ChainId[];
3
- export declare const APESWAP_LIST_REPO = "https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging";
4
3
  export declare const STRAPI_URL = "https://strapi-api.ape.bond";
5
4
  export declare const SOUL_ZAP_API = "https://zap-api.ape.bond/zap?batch=1";
6
5
  export declare const APEBOND = "https://ape.bond";
package/dist/main.js CHANGED
@@ -18820,8 +18820,6 @@ const supportedByLIFI = [
18820
18820
  types.ChainId.SONIC,
18821
18821
  types.ChainId.BERACHAIN,
18822
18822
  ];
18823
- // we should be good just by using staging on this, as it is only used for token images
18824
- const APESWAP_LIST_REPO = `https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging`;
18825
18823
  const STRAPI_URL = `https://strapi-api.ape.bond`;
18826
18824
  const SOUL_ZAP_API = `https://zap-api.ape.bond/zap?batch=1`;
18827
18825
  const APEBOND = `https://ape.bond`;
@@ -18987,8 +18985,8 @@ const AddFavToken = ({ tokenSymbol, hotBond, isGoldBond, }) => {
18987
18985
 
18988
18986
  const defaultUrls = {
18989
18987
  apiV2: 'https://api.ape.bond',
18990
- realTimeApi: 'https://realtime-api.ape.bond/bonds',
18991
- apeswapLists: 'https://raw.githubusercontent.com/ApeSwapFinance/apeswap-lists/main',
18988
+ realTimeApi: 'https://realtime-api.ape.bond',
18989
+ apeswapLists: 'https://raw.githubusercontent.com/ApeSwapFinance/apeswap-lists/refs/heads/main',
18992
18990
  mainUrl: 'https://ape.bond',
18993
18991
  };
18994
18992
  const useSDKConfig = (config) => {
@@ -69876,20 +69874,20 @@ var PRICE_GETTER_V3_ABI = [
69876
69874
  ];
69877
69875
 
69878
69876
  function useTokenPrices() {
69879
- const apeswapListsURL = useURLByEnvironment('apeswapLists');
69877
+ const realTime = useURLByEnvironment('realTimeApi');
69880
69878
  const SDKConfig = useSDKConfig();
69881
69879
  return useQuery({
69882
69880
  queryKey: [QUERY_KEYS.TOKEN_PRICES],
69883
- queryFn: () => getTokenPrices(apeswapListsURL, SDKConfig.chains),
69881
+ queryFn: () => getTokenPrices(realTime, SDKConfig.chains),
69884
69882
  refetchInterval: 60000, // 60 sec
69885
69883
  refetchOnMount: false,
69886
69884
  refetchOnWindowFocus: false,
69887
69885
  enabled: !!SDKConfig.chains && SDKConfig.chains.length > 0,
69888
69886
  });
69889
69887
  }
69890
- 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* () {
69891
69889
  try {
69892
- const response = yield axios.get(`${apeswapListsURL}/config/tokens.json`);
69890
+ const response = yield axios.get(`${apiURL}/utils/tokens`);
69893
69891
  const tokenList = response.data;
69894
69892
  const promises = chains.map((chain) => __awaiter$9(void 0, void 0, void 0, function* () {
69895
69893
  try {
@@ -70871,7 +70869,7 @@ function getTemplateHTML(data) {
70871
70869
  var _a, _b, _c;
70872
70870
  const isProfit = data.data.payout * +data.data.payoutTokenPrice - data.data.dollarValue > 0;
70873
70871
  const getTokenImage = (symbol) => {
70874
- return `${APESWAP_LIST_REPO}/assets/${symbol.toUpperCase()}.png`;
70872
+ return `${APEBOND}/assets/${symbol.toUpperCase()}.png`;
70875
70873
  };
70876
70874
  const getPrincipalToken = () => {
70877
70875
  var _a, _b, _c, _d;
@@ -71338,17 +71336,17 @@ const UserBondRow = ({ bill }) => {
71338
71336
  };
71339
71337
 
71340
71338
  function useBondsList() {
71341
- const apeswapListsURL = useURLByEnvironment('apeswapLists');
71339
+ const realTime = useURLByEnvironment('realTimeApi');
71342
71340
  return useQuery({
71343
71341
  queryKey: [QUERY_KEYS.BONDS_LIST],
71344
- queryFn: () => getBondsList(apeswapListsURL),
71342
+ queryFn: () => getBondsList(realTime),
71345
71343
  staleTime: Infinity,
71346
71344
  refetchOnWindowFocus: false,
71347
71345
  });
71348
71346
  }
71349
- 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* () {
71350
71348
  try {
71351
- const response = yield axios.get(`${apeswapListsURL}/config/bills.json`);
71349
+ const response = yield axios.get(`${apiURL}/utils/bonds`);
71352
71350
  return response.data;
71353
71351
  }
71354
71352
  catch (_a) {
@@ -74475,7 +74473,7 @@ function useBondsData() {
74475
74473
  }
74476
74474
  const getBondsData = (chains, realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
74477
74475
  try {
74478
- const response = yield axios.get(realTimeApiURL);
74476
+ const response = yield axios.get(`${realTimeApiURL}/bonds`);
74479
74477
  return response.data.bonds;
74480
74478
  }
74481
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.50",
6
+ "version": "3.0.52",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",