@xswap-link/sdk 0.0.13 → 0.1.0
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/.github/workflows/main.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierrc +7 -0
- package/CHANGELOG.md +12 -1
- package/README.md +23 -14
- package/dist/index.css +1012 -0
- package/dist/index.d.mts +209 -52
- package/dist/index.d.ts +209 -52
- package/dist/index.js +33963 -88
- package/dist/index.mjs +33949 -76
- package/package.json +8 -2
- package/postcss.config.js +3 -0
- package/src/components/Alert/index.tsx +9 -0
- package/src/components/Skeleton/index.tsx +10 -0
- package/src/components/TxConfigForm/Form.tsx +567 -0
- package/src/components/TxConfigForm/History.tsx +159 -0
- package/src/components/TxConfigForm/HistoryCard.tsx +209 -0
- package/src/components/TxConfigForm/TokenPicker.tsx +165 -0
- package/src/components/TxConfigForm/index.jsx +100 -0
- package/src/components/global.css +34 -0
- package/src/components/global.d.ts +6 -0
- package/src/components/icons/ArrowRightIcon.tsx +11 -0
- package/src/components/icons/ArrowUpRightIcon.tsx +11 -0
- package/src/components/icons/CheckIcon.tsx +11 -0
- package/src/components/icons/ChevronDownIcon.tsx +15 -0
- package/src/components/icons/ChevronUpIcon.tsx +15 -0
- package/src/components/icons/CircularProgressIcon.tsx +24 -0
- package/src/components/icons/CloseIcon.tsx +15 -0
- package/src/components/icons/CoinsIcon.tsx +15 -0
- package/src/components/icons/DownArrorIcon.tsx +17 -0
- package/src/components/icons/HistoryIcon.tsx +13 -0
- package/src/components/icons/HourGlassIcon.tsx +11 -0
- package/src/components/icons/PercentageIcon.tsx +29 -0
- package/src/components/icons/SearchIcon.tsx +15 -0
- package/src/components/icons/XMarkIcon.tsx +11 -0
- package/src/components/icons/index.ts +14 -0
- package/src/components/index.ts +3 -0
- package/src/constants/index.ts +6 -5
- package/src/contracts/abi/BatchQuery.json +52 -0
- package/src/contracts/abi/index.ts +2 -0
- package/src/contracts/addresses.ts +34 -0
- package/src/contracts/index.ts +1 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDebounce.tsx +21 -0
- package/src/index.ts +6 -0
- package/src/models/Addresses.ts +12 -0
- package/src/models/Route.ts +17 -5
- package/src/models/TokenData.ts +45 -0
- package/src/models/TransactionHistory.ts +48 -0
- package/src/models/XSwapConfig.ts +3 -0
- package/src/models/forms/TxConfigFormData.ts +8 -0
- package/src/models/forms/index.ts +1 -0
- package/src/models/index.ts +6 -6
- package/src/models/integrations/GenerateStakingCallsParams.ts +8 -0
- package/src/models/integrations/index.ts +1 -0
- package/src/models/payloads/GetPricesPayload.ts +4 -0
- package/src/models/payloads/GetRoutePayload.ts +1 -3
- package/src/models/payloads/GetSwapTxPayload.ts +8 -0
- package/src/models/payloads/index.ts +2 -0
- package/src/services/api.ts +46 -64
- package/src/services/index.ts +1 -0
- package/src/services/integrations/customCalls/index.ts +1 -0
- package/src/services/integrations/customCalls/staking.ts +83 -0
- package/src/services/integrations/index.ts +2 -0
- package/src/services/integrations/transactions.ts +30 -0
- package/src/utils/contracts.ts +153 -11
- package/src/utils/index.ts +49 -1
- package/src/utils/numbers.ts +47 -0
- package/src/utils/strings.ts +6 -0
- package/tailwind.config.js +14 -0
- package/test/api.test.ts +1 -1
- package/tsconfig.json +10 -1
- package/xswap.config.ts +18 -0
- package/index.ts +0 -5
- package/src/models/ApiOverrides.ts +0 -3
- package/src/models/Chain.ts +0 -20
- package/src/models/Prices.ts +0 -9
- package/src/models/Token.ts +0 -10
- package/src/models/XSwapFee.ts +0 -4
- package/src/models/XSwapFees.ts +0 -7
- package/src/utils/bigNumbers.ts +0 -7
package/.prettierrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
# @xswap-link/xswap-sdk
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 59c70ca: introducing Swap & Stake modal function component
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- a32a4d8: let disconnected users to use modal
|
|
12
|
+
- d93e3aa: let integrators to provide description
|
|
13
|
+
|
|
3
14
|
## 0.0.13
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
6
17
|
|
|
7
|
-
-
|
|
18
|
+
- cb5f79b: add swap & stake integration
|
|
8
19
|
|
|
9
20
|
## 0.0.12
|
|
10
21
|
|
package/README.md
CHANGED
|
@@ -48,10 +48,7 @@ To get the library follow these simple example steps.
|
|
|
48
48
|
|
|
49
49
|
### Prerequisites
|
|
50
50
|
|
|
51
|
-
- npm
|
|
52
|
-
```sh
|
|
53
|
-
npm i pnpm@latest -g
|
|
54
|
-
```
|
|
51
|
+
- npm / pnpm `npm i pnpm@latest -g`
|
|
55
52
|
|
|
56
53
|
### Installation
|
|
57
54
|
|
|
@@ -59,7 +56,7 @@ Below you will find a step-by-step installation guide.
|
|
|
59
56
|
|
|
60
57
|
1. Install the library in your project
|
|
61
58
|
```sh
|
|
62
|
-
npm i @xswap-link/
|
|
59
|
+
npm/pnpm i @xswap-link/sdk
|
|
63
60
|
```
|
|
64
61
|
|
|
65
62
|
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
@@ -70,6 +67,21 @@ Below you will find a step-by-step installation guide.
|
|
|
70
67
|
|
|
71
68
|
Simply import the stuff from the library.
|
|
72
69
|
|
|
70
|
+
### Optional configuration
|
|
71
|
+
|
|
72
|
+
You can create `xswap.config.local.ts` to override default configuration.
|
|
73
|
+
Local file should look like this:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
import { XSwapConfig } from "@src/models";
|
|
77
|
+
|
|
78
|
+
const xSwapConfig: XSwapConfig = {
|
|
79
|
+
apiUrl: "http://127.0.0.1:5001/api",
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default xSwapConfig;
|
|
83
|
+
```
|
|
84
|
+
|
|
73
85
|
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
|
74
86
|
|
|
75
87
|
## Contribution
|
|
@@ -96,21 +108,18 @@ pnpm i
|
|
|
96
108
|
#### 2. Create new branch based on the `develop` one
|
|
97
109
|
|
|
98
110
|
```sh
|
|
111
|
+
git checkout develop
|
|
99
112
|
git checkout -b feature/<your_feature_name>
|
|
100
113
|
```
|
|
101
114
|
|
|
102
|
-
#### 3.
|
|
115
|
+
#### 3. Create changeset
|
|
103
116
|
|
|
104
|
-
|
|
117
|
+
`pnpm changeset` and follow instructions to describe your changes
|
|
105
118
|
|
|
106
|
-
|
|
119
|
+
#### 4. Commit changes
|
|
107
120
|
|
|
108
|
-
|
|
121
|
+
including changeset: `git commit -m "feat: <your desc>>"`
|
|
109
122
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
```sh
|
|
113
|
-
pnpm changeset
|
|
114
|
-
```
|
|
123
|
+
#### 5. Create PR to `develop` branch
|
|
115
124
|
|
|
116
125
|
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|