@ape.swap/bonds-sdk 3.0.57 → 3.0.59
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/components/FavIcons/AddFavToken.d.ts +1 -2
- package/dist/components/TokenInfoAndName/index.d.ts +5 -5
- package/dist/components/TokenSelectorModal/TokenRow.d.ts +2 -1
- package/dist/components/TokenSelectorModal/index.d.ts +0 -1
- package/dist/components/TokenSelectorPanel/index.d.ts +1 -3
- package/dist/config/constants/queryKeys.d.ts +3 -0
- package/dist/hooks/useSortedZapList.d.ts +9 -0
- package/dist/main.js +3650 -634
- package/dist/state/bonds/useUserTokensBalance.d.ts +10 -0
- package/dist/state/preTGEBonds/usePreTGEBondsData.d.ts +19 -0
- package/dist/state/preTGEBonds/usePreTGEList.d.ts +4 -0
- package/dist/state/preTGEBonds/usePreTGEUserBonds.d.ts +33 -0
- package/dist/state/useSDKConfig.d.ts +2 -0
- package/dist/types/bonds.d.ts +12 -12
- package/dist/types/yourbonds.d.ts +1 -1
- package/dist/utils/displayHelpers.d.ts +0 -1
- package/dist/views/Bonds/components/BondRows/BondRow.d.ts +14 -5
- package/dist/views/Bonds/components/BondRows/BondRowsWithTitle.d.ts +0 -1
- package/dist/views/Bonds/components/BonusComponents/BonusComponent.d.ts +6 -3
- package/dist/views/Bonds/components/BonusComponents/BonusContainer.d.ts +6 -4
- package/dist/views/Bonds/components/BonusComponents/BonusTable.d.ts +5 -3
- package/dist/views/BuyBond/findHighestTrueBondPrice.d.ts +1 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/BondCards.d.ts +6 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/BuyAction.d.ts +10 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/BuyComponent.d.ts +7 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/ParticipationSuccessful.d.ts +8 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/PreTGEModalHandler.d.ts +7 -0
- package/dist/views/PreTGEBonds/components/BuyComponent/styles.d.ts +22 -0
- package/dist/views/PreTGEBonds/components/PreTGERows/BonusTable.d.ts +6 -0
- package/dist/views/PreTGEBonds/components/PreTGERows/PreTGERows.d.ts +3 -0
- package/dist/views/PreTGEBonds/components/PreTGEUserRows/PreTGEActions.d.ts +6 -0
- package/dist/views/PreTGEBonds/components/PreTGEUserRows/PreTGEUserRow.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { Token } from '@ape.swap/apeswap-lists';
|
|
3
|
+
export default function useUserTokensBalance(tokens: ('NATIVE' | Token)[], chainId: number): UseQueryResult<{
|
|
4
|
+
address: string;
|
|
5
|
+
balance: string;
|
|
6
|
+
}[]>;
|
|
7
|
+
export declare const getTokensBalance: (account: string, tokens: ("NATIVE" | Token)[], chainId: number) => Promise<{
|
|
8
|
+
address: string;
|
|
9
|
+
balance: string;
|
|
10
|
+
}[]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { PreTGEBond } from '@ape.swap/apeswap-lists';
|
|
3
|
+
import { UserBill, UserBillNftData } from '../../types/yourbonds';
|
|
4
|
+
export interface PreTGEBondData extends PreTGEBond {
|
|
5
|
+
trueBillPrice?: string;
|
|
6
|
+
principalTokenPrice?: number;
|
|
7
|
+
earnTokenPrice?: number;
|
|
8
|
+
finalized?: boolean;
|
|
9
|
+
userOwnedBillsData?: UserBill;
|
|
10
|
+
userOwnedBillsNftData?: UserBillNftData;
|
|
11
|
+
totalRaise?: string;
|
|
12
|
+
totalPrincipalBilled?: string;
|
|
13
|
+
maxTotalPayout?: string;
|
|
14
|
+
minPoints?: string;
|
|
15
|
+
maxPoints?: string;
|
|
16
|
+
vestingTerm: string;
|
|
17
|
+
}
|
|
18
|
+
export default function usePreTGEBondsData(): UseQueryResult<PreTGEBondData[]>;
|
|
19
|
+
export declare const getLaunchBondsPublicData: (preTGEBonds: PreTGEBond[], chains?: number[]) => Promise<PreTGEBondData[]>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { PreTGEBond } from '@ape.swap/apeswap-lists';
|
|
3
|
+
import { UserBill, UserBillNftData } from '../../types/yourbonds';
|
|
4
|
+
import { PreTGEBondData } from './usePreTGEBondsData';
|
|
5
|
+
export interface AccountInfo {
|
|
6
|
+
hasRedeemed: boolean;
|
|
7
|
+
hasRefunded?: boolean;
|
|
8
|
+
payout: string;
|
|
9
|
+
depositAmount: string;
|
|
10
|
+
payoutClaimed: string;
|
|
11
|
+
vesting: string;
|
|
12
|
+
vestingTerm: string;
|
|
13
|
+
vestingStartTimestamp: string;
|
|
14
|
+
lastClaimTimestamp: string;
|
|
15
|
+
truePricePaid: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PreTGEUserBonds extends PreTGEBond {
|
|
18
|
+
trueBillPrice?: string;
|
|
19
|
+
principalTokenPrice?: number;
|
|
20
|
+
earnTokenPrice?: number;
|
|
21
|
+
finalized?: boolean;
|
|
22
|
+
accountInfo?: AccountInfo;
|
|
23
|
+
userOwnedBillsData?: UserBill;
|
|
24
|
+
userOwnedBillsNftData?: UserBillNftData;
|
|
25
|
+
totalRaise?: string;
|
|
26
|
+
totalPrincipalBilled?: string;
|
|
27
|
+
maxTotalPayout?: string;
|
|
28
|
+
minPoints?: string;
|
|
29
|
+
maxPoints?: string;
|
|
30
|
+
vestingTerm: string;
|
|
31
|
+
}
|
|
32
|
+
export default function usePreTGEUserBonds(): UseQueryResult<PreTGEUserBonds[]>;
|
|
33
|
+
export declare const fetchPreTGEUserBonds: (preTGEBonds: PreTGEBondData[], account: string) => Promise<PreTGEUserBonds[]>;
|
|
@@ -4,6 +4,7 @@ export interface SDKProps {
|
|
|
4
4
|
useRainbowKit: boolean;
|
|
5
5
|
useHotBonds?: boolean;
|
|
6
6
|
useTiers?: boolean;
|
|
7
|
+
useTGEBonds?: boolean;
|
|
7
8
|
urls?: Partial<Record<URLKeys, string>>;
|
|
8
9
|
theme?: any;
|
|
9
10
|
}
|
|
@@ -20,6 +21,7 @@ export declare const useSDKConfig: (config?: SDKProps) => {
|
|
|
20
21
|
useRainbowKit: boolean;
|
|
21
22
|
useHotBonds: boolean;
|
|
22
23
|
useTiers: boolean;
|
|
24
|
+
useTGEBonds: boolean;
|
|
23
25
|
theme?: any;
|
|
24
26
|
};
|
|
25
27
|
export type URLKeys = 'apiV2' | 'realTimeApi' | 'apeswapLists' | 'mainUrl';
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -10,23 +10,23 @@ export interface BondsData {
|
|
|
10
10
|
index?: number;
|
|
11
11
|
cmcId?: number;
|
|
12
12
|
chainId: ChainId;
|
|
13
|
-
type
|
|
14
|
-
trueBondPrices
|
|
13
|
+
type?: string;
|
|
14
|
+
trueBondPrices?: TrueBondPrices[];
|
|
15
15
|
version: string;
|
|
16
16
|
feeInPayout?: number;
|
|
17
17
|
billAddress?: string;
|
|
18
|
-
billNftAddress
|
|
18
|
+
billNftAddress?: string;
|
|
19
19
|
soldOut?: boolean;
|
|
20
20
|
inactive?: boolean;
|
|
21
|
-
maxTotalPayout
|
|
22
|
-
totalPayoutGiven
|
|
23
|
-
maxPayout
|
|
24
|
-
tokensRemaining
|
|
25
|
-
showcaseTokenName
|
|
26
|
-
vestingTerm
|
|
21
|
+
maxTotalPayout?: string;
|
|
22
|
+
totalPayoutGiven?: string;
|
|
23
|
+
maxPayout?: string;
|
|
24
|
+
tokensRemaining?: string;
|
|
25
|
+
showcaseTokenName?: string;
|
|
26
|
+
vestingTerm?: number;
|
|
27
27
|
vestingCliff?: number;
|
|
28
|
-
principalTokenPrice
|
|
29
|
-
payoutTokenPrice
|
|
28
|
+
principalTokenPrice?: string;
|
|
29
|
+
payoutTokenPrice?: string;
|
|
30
30
|
tags?: string[];
|
|
31
31
|
shortDescription?: string;
|
|
32
32
|
fullDescription?: string;
|
|
@@ -37,7 +37,7 @@ export interface BondsData {
|
|
|
37
37
|
lpToken: Token;
|
|
38
38
|
minTier?: LaunchBondTiers;
|
|
39
39
|
billVersion?: BillVersion;
|
|
40
|
-
billArt
|
|
40
|
+
billArt?: {
|
|
41
41
|
collection: string;
|
|
42
42
|
};
|
|
43
43
|
warningCard?: string;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export declare const NETWORK_COLORS: Partial<Record<number, string>>;
|
|
2
|
+
import { TrueBondPrices } from '../../../../types/bonds';
|
|
3
|
+
import { ChainId, LaunchBondTiers, Token } from '@ape.swap/apeswap-lists';
|
|
5
4
|
interface BondRowProps {
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
bondAddress: string;
|
|
6
|
+
bondChain: ChainId;
|
|
7
|
+
payoutToken: Token;
|
|
8
|
+
tag?: string;
|
|
9
|
+
bondSoldOut: boolean;
|
|
10
|
+
trueBondPrices?: TrueBondPrices[];
|
|
11
|
+
minTier?: LaunchBondTiers;
|
|
12
|
+
bonus?: string;
|
|
13
|
+
vestingTermString: string;
|
|
14
|
+
vestingCliffString?: string;
|
|
15
|
+
percentageAvailable: number;
|
|
16
|
+
remainingTokensString: string;
|
|
8
17
|
}
|
|
9
18
|
declare const BondRow: React.FC<BondRowProps>;
|
|
10
19
|
export default BondRow;
|
|
@@ -4,7 +4,6 @@ import { BillsConfig } from '@ape.swap/apeswap-lists';
|
|
|
4
4
|
export interface BondRowsWithTitleProps {
|
|
5
5
|
chain: number;
|
|
6
6
|
bonds: (BondsData | BillsConfig)[];
|
|
7
|
-
hideTitles: boolean;
|
|
8
7
|
showHotBonds: boolean;
|
|
9
8
|
}
|
|
10
9
|
declare const BondRowsWithTitle: React.FC<BondRowsWithTitleProps>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { TrueBondPrices } from '../../../../types/bonds';
|
|
3
|
+
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
4
|
+
declare const BonusComponent: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
|
|
5
|
+
trueBondPrices?: TrueBondPrices[];
|
|
6
|
+
minTier?: LaunchBondTiers;
|
|
7
|
+
bonus?: string;
|
|
5
8
|
tooltipPosition: "bottomRight" | "bottomLeft";
|
|
6
9
|
}) => React.JSX.Element;
|
|
7
10
|
export default BonusComponent;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
declare const BonusContainer: ({
|
|
5
|
-
|
|
2
|
+
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
3
|
+
import { TrueBondPrices } from '../../../../types/bonds';
|
|
4
|
+
declare const BonusContainer: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
|
|
5
|
+
trueBondPrices?: TrueBondPrices[];
|
|
6
|
+
minTier?: LaunchBondTiers;
|
|
7
|
+
bonus?: string;
|
|
6
8
|
tooltipPosition?: "bottomRight" | "bottomLeft";
|
|
7
9
|
}) => React.JSX.Element;
|
|
8
10
|
export default BonusContainer;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { TrueBondPrices } from '../../../../types/bonds';
|
|
3
|
+
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
4
|
+
declare const BonusTable: ({ trueBondPrices, minTier, hideTitle, }: {
|
|
5
|
+
trueBondPrices: TrueBondPrices[];
|
|
6
|
+
minTier?: LaunchBondTiers;
|
|
5
7
|
hideTitle?: boolean;
|
|
6
8
|
}) => React.JSX.Element;
|
|
7
9
|
export default BonusTable;
|
|
@@ -6,6 +6,7 @@ import { BondsData, TrueBondPrices } from '../../types/bonds';
|
|
|
6
6
|
* @returns The highest TrueBondPrices element where userPoints is higher than the item's points, or `undefined` if none matches.
|
|
7
7
|
*/
|
|
8
8
|
export declare const findHighestTrueBondPrice: (userPoints?: string | null, bondData?: BondsData) => TrueBondPrices;
|
|
9
|
+
export declare const findHighestTrueBondPrices: (userPoints?: string | null, trueBondPrices?: TrueBondPrices[]) => TrueBondPrices;
|
|
9
10
|
/**
|
|
10
11
|
* Finds the TrueBondPrices element with the highest points in the array, regardless of user points.
|
|
11
12
|
* @param bondData - Bond Data containing an array of TrueBondPrices to analyze.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Token } from '@ape.swap/apeswap-lists';
|
|
3
|
+
import { PreTGEBondData } from '../../../../state/preTGEBonds/usePreTGEBondsData';
|
|
4
|
+
declare const BuyAction: ({ launchBond, inputValue, selectedCurrency, soldout, }: {
|
|
5
|
+
selectedCurrency: Token;
|
|
6
|
+
inputValue: string;
|
|
7
|
+
launchBond: PreTGEBondData;
|
|
8
|
+
soldout: boolean;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default BuyAction;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PreTGEBondData } from '../../../../state/preTGEBonds/usePreTGEBondsData';
|
|
3
|
+
declare const ParticipationSuccessful: ({ onDismiss, launchBond, inputAmount, }: {
|
|
4
|
+
onDismiss?: () => void;
|
|
5
|
+
launchBond: PreTGEBondData;
|
|
6
|
+
inputAmount?: string;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
export default ParticipationSuccessful;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ThemeUIStyleObject } from 'theme-ui';
|
|
2
|
+
export declare const styles: Record<'buyContainer' | 'cardContainer' | 'infoRowsContainer' | 'infoRow' | 'infoTitle' | 'infoData', ThemeUIStyleObject>;
|
|
3
|
+
export declare const colorMap: {
|
|
4
|
+
0: string;
|
|
5
|
+
1: string;
|
|
6
|
+
2: string;
|
|
7
|
+
3: string;
|
|
8
|
+
4: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const colorMap2: {
|
|
11
|
+
bronze: string;
|
|
12
|
+
silver: string;
|
|
13
|
+
gold: string;
|
|
14
|
+
diamond: string;
|
|
15
|
+
legend: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const textColorMap: {
|
|
18
|
+
silver: string;
|
|
19
|
+
gold: string;
|
|
20
|
+
diamond: string;
|
|
21
|
+
legend: string;
|
|
22
|
+
};
|
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.
|
|
6
|
+
"version": "3.0.59",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"yalc": "^1.0.0-pre.53"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@ape.swap/apeswap-lists": "4.3.
|
|
60
|
+
"@ape.swap/apeswap-lists": "4.3.12",
|
|
61
61
|
"@emotion/react": "11.11.4",
|
|
62
62
|
"bignumber.js": "^9.1.2",
|
|
63
63
|
"chart.js": "4.2.0",
|