@ape.swap/bonds-sdk 1.0.341 → 1.0.343

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,5 +1,5 @@
1
- import { ChainId } from '@ape.swap/apeswap-lists';
2
1
  import { Bills, CleanedBondsState, UserBill } from '../../types/bonds';
2
+ import { ChainId } from '../../enum/apeswaplists';
3
3
  /**
4
4
  * Fetches user-owned bill NFT data for a given set of owned bills data, chain ID, and bills.
5
5
  * @param ownedBillsData An array of objects containing the ID, bill NFT address, and contract address of the owned bills.
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  import billAbi from '../../config/abi/bond.json';
38
38
  import BigNumber from 'bignumber.js';
39
39
  import { getBillNftBatchData } from './getBillNftData';
40
- import { BillVersion } from '@ape.swap/apeswap-lists';
41
40
  import multicall from '../../utils/multicall';
41
+ import { BillVersion } from '../../enum/apeswaplists';
42
42
  /**
43
43
  * Fetches user-owned bill NFT data for a given set of owned bills data, chain ID, and bills.
44
44
  * @param ownedBillsData An array of objects containing the ID, bill NFT address, and contract address of the owned bills.
@@ -1,5 +1,4 @@
1
- import { ChainId } from '@ape.swap/apeswap-lists';
2
- import { Token as Token_ApeSwapLists } from '../../enum/apeswaplists';
1
+ import { ChainId, Token as Token_ApeSwapLists } from '../../enum/apeswaplists';
3
2
  type TokenRecord = {
4
3
  [k: string]: Token_ApeSwapLists;
5
4
  };
@@ -36,12 +36,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  };
37
37
  import { ZERO_ADDRESS } from '../../config/constants/misc';
38
38
  import { useMemo } from 'react';
39
- import { ChainId } from '@ape.swap/apeswap-lists';
40
39
  import multicall from '../../utils/multicall';
41
40
  import { PRICE_GETTER_ADDRESSES } from '../../config/constants/addresses';
42
41
  import PRICE_GETTER_ABI from '../../config/abi/price-getter.json';
43
42
  import PRICE_GETTER_ABI_LINEA from '../../config/abi/price-getter-linea.json';
44
- import { Protocols } from '../../enum/apeswaplists';
43
+ import { ChainId, Protocols } from '../../enum/apeswaplists';
45
44
  import { defaultDexFactories, dexFactories } from '../../types/dexFactories';
46
45
  export function getTokenPricesV2FromPriceGetter(tokensToCall, chain, lpTokens) {
47
46
  if (lpTokens === void 0) { lpTokens = false; }
@@ -1,4 +1,4 @@
1
- import { BillVersion } from '@ape.swap/apeswap-lists';
1
+ import { BillVersion } from '../../enum/apeswaplists';
2
2
  var fetchBillsCalls = function (bill) {
3
3
  var standardCalls = [
4
4
  // Get bill price with LP fees
@@ -1,4 +1,4 @@
1
- import { ChainId } from '@ape.swap/apeswap-lists';
1
+ import { ChainId } from '../../enum/apeswaplists';
2
2
  export declare const usePollBills: () => void;
3
3
  export declare const usePollSingleBill: (chainId?: ChainId, capturedBillAddress?: string) => void;
4
4
  export declare const usePollUserBills: () => any[];
@@ -33,7 +33,16 @@ export declare const setBillsList: import("@reduxjs/toolkit").ActionCreatorWithP
33
33
  }, "Bills/setBillsPublicData">, setUserOwnedBillsData: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "Bills/setUserOwnedBillsData">, setUserOwnedBillsNftData: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "Bills/setUserOwnedBillsNftData">;
34
34
  export declare const fetchBondsStats: (tokenPrices: TokenPrices[]) => (dispatch: Dispatch, getState: any) => Promise<void>;
35
35
  export declare const fetchSingleBillPublicData: (chainId: ChainId, tokenPrices: TokenPrices[], bondAddress: string) => (dispatch: Dispatch, getState: any) => Promise<void>;
36
- export declare const fetchUserOwnedBillsDataAsync: (chainId: ChainId, account: string) => (dispatch: Dispatch, getState: any) => Promise<void>;
36
+ export declare const fetchUserOwnedBillsDataAsync: (chainId: ChainId, account: string) => (dispatch: Dispatch, getState: any) => Promise<{
37
+ userOwnedBillsData: {
38
+ index: number;
39
+ userOwnedBills: import("../../types/bonds").UserBill[];
40
+ }[];
41
+ ownedBillsWithNftData: {
42
+ index: number;
43
+ userOwnedBillsNfts: any[];
44
+ }[];
45
+ }>;
37
46
  declare const _default: import("redux").Reducer<BillsState, import("redux").UnknownAction, BillsState>;
38
47
  export default _default;
39
48
  export declare const parseBondApiData: (billApiData: BondsDataResponse) => CleanedBondsState;
@@ -249,11 +249,12 @@ export var fetchUserOwnedBillsDataAsync = function (chainId, account) {
249
249
  };
250
250
  });
251
251
  dispatch(setUserOwnedBillsNftData({ value: ownedBillsWithNftData }));
252
- return [3 /*break*/, 4];
252
+ // Return the data
253
+ return [2 /*return*/, { userOwnedBillsData: userOwnedBillsData, ownedBillsWithNftData: ownedBillsWithNftData }];
253
254
  case 3:
254
255
  error_3 = _a.sent();
255
256
  console.warn(error_3);
256
- return [3 /*break*/, 4];
257
+ return [2 /*return*/, { userOwnedBillsData: [], ownedBillsWithNftData: [] }];
257
258
  case 4: return [2 /*return*/];
258
259
  }
259
260
  });
@@ -1,5 +1,4 @@
1
- import { BillsConfig, BillVersion, Token } from '@ape.swap/apeswap-lists';
2
- import { ChainId } from '@ape.swap/apeswap-lists';
1
+ import { BillsConfig, BillVersion, ChainId, Token } from "../../enum/apeswaplists";
3
2
  export interface UserBillNft {
4
3
  image: string;
5
4
  tokenId: string;
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": "1.0.341",
6
+ "version": "1.0.343",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",