@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 CHANGED
@@ -1,46 +1,154 @@
1
- # Getting Started with Create React App
1
+ # @ape.swap/bonds-sdk
2
+
3
+ [![npm](https://img.shields.io/npm/v/@ape.swap/bonds-sdk.svg)](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
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
31
+ ## Basic Usage
4
32
 
5
- ## Available Scripts
33
+ Here's an example of how to integrate the `@ape.swap/bonds-sdk` package into your project:
6
34
 
7
- In the project directory, you can run:
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
- ### `npm start`
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
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
78
+ export default MyBondsComponent
79
+ ```
13
80
 
14
- The page will reload if you make edits.\
15
- You will also see any lint errors in the console.
81
+ ---
16
82
 
17
- ### `npm test`
83
+ ## Configuration
18
84
 
19
- Launches the test runner in the interactive watch mode.\
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
- ### `npm run build`
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
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
95
+ ### Chain Support
26
96
 
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
97
+ The SDK currently supports the following chains:
29
98
 
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
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
- ### `npm run eject`
110
+ The list get updated constantly, so make sure to use latest version of the SDK.
33
111
 
34
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
112
+ ---
35
113
 
36
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
114
+ ## Customizing Styles
37
115
 
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
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
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
118
+ ```javascript
119
+ import '@ape.swap/bonds-sdk/dist/styles.css'
120
+ import 'swiper/swiper.min.css'
121
+ ```
41
122
 
42
- ## Learn More
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
- To learn React, check out the [React documentation](https://reactjs.org/).
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
- export { Bonds, BondModal, YourBonds, FullBondsView, ProjectView, generateImageFromTemplate };
7
+ import { ChainId } from '@ape.swap/apeswap-lists';
8
+ export { Bonds, BondModal, YourBonds, FullBondsView, ProjectView, generateImageFromTemplate, ChainId };