@ape.swap/bonds-sdk 4.0.0-test.2 → 4.0.0-test.20
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/README.md +30 -21
- package/dist/components/ConnectButton/AppKitButton.d.ts +3 -0
- package/dist/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/components/uikit-sdk/Svg/tokens/KATANA.d.ts +4 -0
- package/dist/components/uikit-sdk/Svg/tokens/UNICHAIN.d.ts +4 -0
- package/dist/components/uikit-sdk/Svg/tokens/index.d.ts +2 -0
- package/dist/components/uikit-sdk/Svg/types.d.ts +2 -0
- package/dist/config/constants/networks.d.ts +2 -0
- package/dist/config/constants/queryKeys.d.ts +1 -0
- package/dist/main.js +60189 -59852
- package/dist/state/allowance/useAllowance.d.ts +1 -1
- package/dist/state/balance/useCurrencyBalance.d.ts +1 -1
- package/dist/state/balance/useCurrencyBalanceSolana.d.ts +1 -1
- package/dist/state/bonds/useBondNFTData.d.ts +1 -1
- package/dist/state/bonds/useBondsData.d.ts +3 -4
- package/dist/state/bonds/useBondsList.d.ts +1 -1
- package/dist/state/bonds/useTierProofSignature.d.ts +1 -1
- package/dist/state/tokenList/useTokenList.d.ts +4 -2
- package/dist/state/tokenPrices/useSOLPrices.d.ts +3 -0
- package/dist/state/tokenPrices/useTokenPrices.d.ts +1 -1
- package/dist/state/useSDKConfig.d.ts +7 -3
- package/dist/styles.css +2 -1
- package/dist/types/bonds.d.ts +3 -1
- package/dist/types/yourbonds.d.ts +0 -1
- package/dist/utils/calculateSolanaTrueBillPrice.d.ts +5 -4
- package/dist/utils/displayHelpers.d.ts +2 -9
- package/dist/utils/formatNumber.d.ts +1 -1
- package/dist/utils/formatNumbers.d.ts +2 -1
- package/dist/utils/getSolanaAccount.d.ts +4 -4
- package/dist/utils/getTimePeriods.d.ts +11 -4
- package/dist/views/Bonds/components/BondRows/BondRowsWithTitle.d.ts +1 -0
- package/dist/views/Bonds/components/ChainBanner/ChainBanner.d.ts +6 -0
- package/dist/views/Bonds/utils.d.ts +1 -8
- package/dist/views/BuyBond/BuyBondModal.d.ts +8 -1
- package/dist/views/BuyBond/BuyBondSolana.d.ts +1 -0
- package/dist/views/YourBonds/components/UserBondRow/UserBondRow.d.ts +6 -0
- package/dist/views/{PreTGEBonds/components/PreTGEUserRows/PreTGEUserRow.d.ts → YourBonds/components/UserBondRow/UserBondRowPreTGE.d.ts} +2 -2
- package/dist/views/YourBonds/components/UserBondRow/index.d.ts +3 -6
- package/dist/views/YourBondsModal/YourSolanaBondsModal.d.ts +2 -2
- package/package.json +10 -8
- package/dist/views/Bonds/components/BannerTestnet/BannerTestnet.d.ts +0 -6
- /package/dist/views/{PreTGEBonds/components/PreTGEUserRows → YourBonds/components/UserBondRow}/PreTGEActions.d.ts +0 -0
- /package/dist/views/YourBonds/components/{UserBondRowSolana/index.d.ts → UserBondRow/UserBondRowSolana.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@ The `@ape.swap/bonds-sdk` package provides an embeddable set of tools and UI com
|
|
|
6
6
|
|
|
7
7
|
## Key Features
|
|
8
8
|
|
|
9
|
-
- Fully customizable bond views powered by the following components: `<FullBondsView />`, `<Bonds
|
|
10
|
-
- Multi-chain support for a ever-growing array of
|
|
9
|
+
- Fully customizable bond views powered by the following components: `<FullBondsView />`, `<Bonds/>`, `<YourBonds /> & <SingleBond />`.
|
|
10
|
+
- Multi-chain support for a ever-growing array of EVM and Non EVM Blockchains.
|
|
11
11
|
- Prebuilt styles and layouts optimized for embedding.
|
|
12
12
|
- Compatibility with the most popular web3 development library: Wagmi.
|
|
13
13
|
- Plug-and-play configuration to fit various project requirements.
|
|
@@ -28,6 +28,15 @@ yarn add @ape.swap/bonds-sdk
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
+
## Required Dependencies
|
|
32
|
+
|
|
33
|
+
The following are some key dependencies you must have for the SDK to work properly:
|
|
34
|
+
|
|
35
|
+
- **React**: Required to build the UI. Ensure your project uses React v18 or later.
|
|
36
|
+
- **Wagmi**: Used for handling wallet connections and blockchain interactions.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
31
40
|
## Basic Usage
|
|
32
41
|
|
|
33
42
|
Here's an example of how to integrate the `@ape.swap/bonds-sdk` package into your project:
|
|
@@ -54,7 +63,7 @@ const MyBondsComponent = () => {
|
|
|
54
63
|
ChainId.IOTA,
|
|
55
64
|
ChainId.CROSSFI,
|
|
56
65
|
]}
|
|
57
|
-
|
|
66
|
+
connector={'rainbowkit'}
|
|
58
67
|
useHotBonds={true}
|
|
59
68
|
theme={{
|
|
60
69
|
"radii": "10px",
|
|
@@ -83,19 +92,20 @@ export default MyBondsComponent
|
|
|
83
92
|
|
|
84
93
|
The core of the SDK lies in its config object params, passed as a prop to its components. Below is a breakdown of key options:
|
|
85
94
|
|
|
86
|
-
| Property
|
|
87
|
-
|
|
88
|
-
| `referenceId`
|
|
89
|
-
| `chains`
|
|
90
|
-
| `
|
|
91
|
-
| `useHotBonds`
|
|
92
|
-
| `theme`
|
|
93
|
-
| `tokenSymbol`
|
|
95
|
+
| Property | Type | Description |
|
|
96
|
+
|---------------|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
97
|
+
| `referenceId` | `string` | A unique identifier for the bonds, shall be provided by ApeBond team. |
|
|
98
|
+
| `chains` | `Array` | An array of supported chain IDs (e.g., `56`, `1`, `137`, etc). It also determines the order of the chains on the bond list. |
|
|
99
|
+
| `connector` | `'rainbowkit' or 'appkit'` | Determines your preferred wallet-connector. If your connector is not listed here get in contact with the dev team to request the integration. |
|
|
100
|
+
| `useHotBonds` | `boolean` | Whether to show the "hot bonds" component. |
|
|
101
|
+
| `theme` | `Object (optional)` | This is how you can customize the styles of the SDK. Override styles like colors, typography, and layout settings to match your project's branding. |
|
|
102
|
+
| `tokenSymbol` | `string[]` | This parameter is specific to the `<SingleBond />` component. It defines the token(s) to display in the UI. Currently, only a single token (one element in the array) is supported. |
|
|
94
103
|
|
|
95
104
|
### Chain Support
|
|
96
105
|
|
|
97
106
|
The SDK currently supports the following chains:
|
|
98
107
|
|
|
108
|
+
EVM:
|
|
99
109
|
- Binance Smart Chain (BSC)
|
|
100
110
|
- Ethereum (MAINNET)
|
|
101
111
|
- Polygon (MATIC)
|
|
@@ -106,6 +116,14 @@ The SDK currently supports the following chains:
|
|
|
106
116
|
- Graphlinq
|
|
107
117
|
- IOTA
|
|
108
118
|
- CrossFi
|
|
119
|
+
- Unichain
|
|
120
|
+
- Berachain
|
|
121
|
+
- Sonic
|
|
122
|
+
- Katana
|
|
123
|
+
- Monad Testnet
|
|
124
|
+
|
|
125
|
+
Non-EVM:
|
|
126
|
+
- SOLANA
|
|
109
127
|
|
|
110
128
|
The list get updated constantly, so make sure to use latest version of the SDK.
|
|
111
129
|
|
|
@@ -131,16 +149,7 @@ Once you are happy with the styles, make sure to copy the output styles object a
|
|
|
131
149
|
|
|
132
150
|
To use a custom font in the theme, include the `customFont` property with the name of your desired font family. Please note that you will need to manually download the font and embed it in your project using a `<script>` or `<link>` tag in your HTML file.
|
|
133
151
|
|
|
134
|
-
Bear in mind, that the components of the SDK will use the width and height provided by the parent component.
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Dependencies
|
|
139
|
-
|
|
140
|
-
The following are some key dependencies you must have for the SDK to work properly:
|
|
141
|
-
|
|
142
|
-
- **React**: Required to build the UI. Ensure your project uses React v18 or later.
|
|
143
|
-
- **Wagmi**: Used for handling wallet connections and blockchain interactions.
|
|
152
|
+
Bear in mind, that the components of the SDK will use the width and height provided by the parent component, therefore, we recommend wrapping ApeBond SDK components with a div with the desired size.
|
|
144
153
|
|
|
145
154
|
---
|
|
146
155
|
|
|
@@ -26,3 +26,5 @@ export { default as MONAD } from './MONAD';
|
|
|
26
26
|
export { default as SONIC } from './SONIC';
|
|
27
27
|
export { default as BERA } from './BERA';
|
|
28
28
|
export { default as SOLANA } from './SOL';
|
|
29
|
+
export { default as KATANA } from './KATANA';
|
|
30
|
+
export { default as UNICHAIN } from './UNICHAIN';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
2
2
|
export declare const PUBLIC_RPC_URLS: Partial<Record<ChainId, string[]>>;
|
|
3
|
+
export declare const HELIUS_SOL_RPC = "https://mainnet.helius-rpc.com/?api-key=d80b11e0-692f-4da0-91d6-830799c8c385";
|
|
4
|
+
export declare const getRPC: (chain: ChainId) => string;
|