@ape.swap/bonds-sdk 3.0.8 → 3.0.9
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 +134 -26
- package/dist/components/uikit-sdk/index.d.ts +1 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +8627 -9072
- package/dist/providers/index.d.ts +2 -1
- package/dist/state/useSDKConfig.d.ts +8 -8
- package/dist/styles.css +0 -14
- package/dist/theme/components.d.ts +3 -3
- package/package.json +2 -1
- package/dist/views/BondModal/basepadHelper.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,46 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ape.swap/bonds-sdk
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@ape.swap/bonds-sdk)
|
|
4
|
+
|
|
5
|
+
The `@ape.swap/bonds-sdk` package provides an embeddable set of tools and UI components to integrate and manage bond-related functionalities for multi-chain environments. This SDK simplifies the process of displaying, interacting with, and customizing bond-related user interfaces in your projects.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- Fully customizable bond views powered by the following components: `<FullBondsView />`, `<Bonds/>` & `<YourBonds />`.
|
|
10
|
+
- Multi-chain support for a ever-growing array of Blockchains that currently include BNB Chain, Ethereum, Base, Polygon, Arbitrum, Lightlink, Linea, Graphlinq, IOTA and Crossfi.
|
|
11
|
+
- Prebuilt styles and layouts optimized for embedding.
|
|
12
|
+
- Compatibility with the most popular web3 development library: Wagmi.
|
|
13
|
+
- Plug-and-play configuration to fit various project requirements.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
To install the package via npm or yarn, run the following command:
|
|
20
|
+
|
|
21
|
+
```textmate
|
|
22
|
+
# With npm
|
|
23
|
+
npm install @ape.swap/bonds-sdk
|
|
24
|
+
|
|
25
|
+
# With yarn
|
|
26
|
+
yarn add @ape.swap/bonds-sdk
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
2
30
|
|
|
3
|
-
|
|
31
|
+
## Basic Usage
|
|
4
32
|
|
|
5
|
-
|
|
33
|
+
Here's an example of how to integrate the `@ape.swap/bonds-sdk` package into your project:
|
|
6
34
|
|
|
7
|
-
|
|
35
|
+
```textmate
|
|
36
|
+
import React from 'react'
|
|
37
|
+
import { FullBondsView, ChainId } from '@ape.swap/bonds-sdk'
|
|
38
|
+
import '@ape.swap/bonds-sdk/dist/styles.css'
|
|
39
|
+
import 'swiper/swiper.min.css'
|
|
8
40
|
|
|
9
|
-
|
|
41
|
+
const MyBondsComponent = () => {
|
|
42
|
+
return (
|
|
43
|
+
<FullBondsView
|
|
44
|
+
config={{
|
|
45
|
+
referenceId: 'yourProjectId',
|
|
46
|
+
chains: [
|
|
47
|
+
ChainId.BSC,
|
|
48
|
+
ChainId.BASE,
|
|
49
|
+
ChainId.MATIC,
|
|
50
|
+
ChainId.MAINNET,
|
|
51
|
+
ChainId.ARBITRUM,
|
|
52
|
+
ChainId.LIGHTLINK,
|
|
53
|
+
ChainId.LINEA,
|
|
54
|
+
ChainId.GRAPHLINQ,
|
|
55
|
+
ChainId.IOTA,
|
|
56
|
+
ChainId.CROSSFI,
|
|
57
|
+
],
|
|
58
|
+
useRainbowKit: true,
|
|
59
|
+
useHotBonds: true,
|
|
60
|
+
theme: {{
|
|
61
|
+
"radii": "10px",
|
|
62
|
+
"colors": {
|
|
63
|
+
"primaryButton": "#6560C5",
|
|
64
|
+
"white1": "#0E0D16",
|
|
65
|
+
"white2": "#161420",
|
|
66
|
+
"white3": "#1F1D29",
|
|
67
|
+
"white4": "#282632",
|
|
68
|
+
"white5": "#312F3A",
|
|
69
|
+
"text": "#FAFAFA",
|
|
70
|
+
"primaryBright": "#FFF"
|
|
71
|
+
}
|
|
72
|
+
}}
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
10
77
|
|
|
11
|
-
|
|
12
|
-
|
|
78
|
+
export default MyBondsComponent
|
|
79
|
+
```
|
|
13
80
|
|
|
14
|
-
|
|
15
|
-
You will also see any lint errors in the console.
|
|
81
|
+
---
|
|
16
82
|
|
|
17
|
-
|
|
83
|
+
## Configuration
|
|
18
84
|
|
|
19
|
-
|
|
20
|
-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
|
85
|
+
The core of the SDK lies in its `config` object, passed as a prop to the `<FullBondsView />` component. Below is a breakdown of key options:
|
|
21
86
|
|
|
22
|
-
|
|
87
|
+
| Property | Type | Description |
|
|
88
|
+
|-----------------|---------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
|
89
|
+
| `referenceId` | `string` | A unique identifier for the bonds, shall be provided by ApeBond team. |
|
|
90
|
+
| `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. |
|
|
91
|
+
| `useRainbowKit` | `boolean` | Whether to enable RainbowKit for wallet connections. Might be replaced for an enum in the near future. |
|
|
92
|
+
| `useHotBonds` | `boolean` | Whether to show the "hot bonds" component. |
|
|
93
|
+
| `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.|
|
|
23
94
|
|
|
24
|
-
|
|
25
|
-
It correctly bundles React in production mode and optimizes the build for the best performance.
|
|
95
|
+
### Chain Support
|
|
26
96
|
|
|
27
|
-
The
|
|
28
|
-
Your app is ready to be deployed!
|
|
97
|
+
The SDK currently supports the following chains:
|
|
29
98
|
|
|
30
|
-
|
|
99
|
+
- Binance Smart Chain (BSC)
|
|
100
|
+
- Ethereum (MAINNET)
|
|
101
|
+
- Polygon (MATIC)
|
|
102
|
+
- Arbitrum
|
|
103
|
+
- Base
|
|
104
|
+
- Lightlink
|
|
105
|
+
- Linea
|
|
106
|
+
- Graphlinq
|
|
107
|
+
- IOTA
|
|
108
|
+
- CrossFi
|
|
31
109
|
|
|
32
|
-
|
|
110
|
+
The list get updated constantly, so make sure to use latest version of the SDK.
|
|
33
111
|
|
|
34
|
-
|
|
112
|
+
---
|
|
35
113
|
|
|
36
|
-
|
|
114
|
+
## Customizing Styles
|
|
37
115
|
|
|
38
|
-
|
|
116
|
+
The package comes with prebuilt styles that you must import in your project. Make sure to include the following CSS files:
|
|
39
117
|
|
|
40
|
-
|
|
118
|
+
```javascript
|
|
119
|
+
import '@ape.swap/bonds-sdk/dist/styles.css'
|
|
120
|
+
import 'swiper/swiper.min.css'
|
|
121
|
+
```
|
|
41
122
|
|
|
42
|
-
|
|
123
|
+
These styles ensure that the components render correctly and include all necessary design details. You can customize or override styles using your own branding.
|
|
43
124
|
|
|
44
|
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
|
45
125
|
|
|
46
|
-
|
|
126
|
+
You can test and visualize the different customization options on the SDK styling playground (beta):
|
|
127
|
+
|
|
128
|
+
https://sdk.ape.bond/
|
|
129
|
+
|
|
130
|
+
Once you are happy with the styles, make sure to copy the output styles object and paste it under the `theme` param on the SDK component you will be using.
|
|
131
|
+
|
|
132
|
+
Bear in mind, that the components of the SDK will use the width and height provided by the parent component.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Dependencies
|
|
137
|
+
|
|
138
|
+
The following are some key dependencies you must have for the SDK to work properly:
|
|
139
|
+
|
|
140
|
+
- **React**: Required to build the UI. Ensure your project uses React v18 or later.
|
|
141
|
+
- **Wagmi**: Used for handling wallet connections and blockchain interactions.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## 🦍 Built and Maintained by ApeSwap | ApeBond
|
|
147
|
+
|
|
148
|
+
For questions, issues, or contributions, reach out to [ApeBond](https://ape.bond/) or contact us on [Telegram](https://t.me/ape_bond) .
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
This package is licensed under the MIT License.
|
|
@@ -9,6 +9,7 @@ export { default as Toggle } from './Toggle';
|
|
|
9
9
|
export { default as SwiperDots } from './SwiperDots';
|
|
10
10
|
export { default as LoadingDots } from './LoadingDots';
|
|
11
11
|
export { default as Checkbox } from './Checkbox';
|
|
12
|
+
export { default as Input } from './Input/Input';
|
|
12
13
|
export { Button, IconButton } from './Button';
|
|
13
14
|
export { Select, SelectItem } from './Select';
|
|
14
15
|
export { ListTag } from './Tag';
|
package/dist/main.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import BondModal from './views/BondModal';
|
|
|
4
4
|
import FullBondsView from './views/FullBondsView';
|
|
5
5
|
import ProjectView from './views/ProjectView';
|
|
6
6
|
import { generateImageFromTemplate } from './views/YourBondsModal/components/LinkShare/utils';
|
|
7
|
-
|
|
7
|
+
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
8
|
+
export { Bonds, BondModal, YourBonds, FullBondsView, ProjectView, generateImageFromTemplate, ChainId };
|