@xswap-link/sdk 0.0.13 → 0.1.1

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.
Files changed (98) hide show
  1. package/.github/workflows/main.yml +2 -1
  2. package/.github/workflows/publish.yml +2 -1
  3. package/.prettierrc +7 -0
  4. package/CHANGELOG.md +27 -1
  5. package/README.md +23 -14
  6. package/dist/index.css +1108 -0
  7. package/dist/index.d.mts +212 -52
  8. package/dist/index.d.ts +212 -52
  9. package/dist/index.js +2184 -85
  10. package/dist/index.mjs +2148 -76
  11. package/nodemon.json +5 -0
  12. package/package.json +20 -3
  13. package/postcss.config.js +3 -0
  14. package/src/components/Alert/index.tsx +9 -0
  15. package/src/components/Skeleton/index.tsx +10 -0
  16. package/src/components/TxConfigForm/BalanceComponent.tsx +51 -0
  17. package/src/components/TxConfigForm/ChainListElement.tsx +36 -0
  18. package/src/components/TxConfigForm/Description.tsx +15 -0
  19. package/src/components/TxConfigForm/ErrorField.tsx +17 -0
  20. package/src/components/TxConfigForm/FeesDetails.tsx +105 -0
  21. package/src/components/TxConfigForm/Form.tsx +250 -0
  22. package/src/components/TxConfigForm/History.tsx +155 -0
  23. package/src/components/TxConfigForm/HistoryCard.tsx +209 -0
  24. package/src/components/TxConfigForm/Settings.tsx +137 -0
  25. package/src/components/TxConfigForm/Summary.tsx +57 -0
  26. package/src/components/TxConfigForm/SwapPanel.tsx +191 -0
  27. package/src/components/TxConfigForm/TokenPicker.tsx +171 -0
  28. package/src/components/TxConfigForm/TopBar.tsx +53 -0
  29. package/src/components/TxConfigForm/index.tsx +121 -0
  30. package/src/components/global.css +34 -0
  31. package/src/components/icons/ArrowDownIcon.tsx +16 -0
  32. package/src/components/icons/ArrowRightIcon.tsx +11 -0
  33. package/src/components/icons/ArrowUpRightIcon.tsx +11 -0
  34. package/src/components/icons/ChainlinkCCIPIcon.tsx +23 -0
  35. package/src/components/icons/CheckIcon.tsx +11 -0
  36. package/src/components/icons/ChevronDownIcon.tsx +15 -0
  37. package/src/components/icons/ChevronUpIcon.tsx +15 -0
  38. package/src/components/icons/CircularProgressIcon.tsx +24 -0
  39. package/src/components/icons/CloseIcon.tsx +15 -0
  40. package/src/components/icons/CoinsIcon.tsx +17 -0
  41. package/src/components/icons/DownArrorIcon.tsx +17 -0
  42. package/src/components/icons/HistoryIcon.tsx +16 -0
  43. package/src/components/icons/HourGlassIcon.tsx +11 -0
  44. package/src/components/icons/InfoIcon.tsx +13 -0
  45. package/src/components/icons/PercentageIcon.tsx +29 -0
  46. package/src/components/icons/SearchIcon.tsx +15 -0
  47. package/src/components/icons/SettingsIcon.tsx +16 -0
  48. package/src/components/icons/TimerIcon.tsx +15 -0
  49. package/src/components/icons/XMarkIcon.tsx +11 -0
  50. package/src/components/icons/XSwapBadgeIcon.tsx +23 -0
  51. package/src/components/icons/index.ts +20 -0
  52. package/src/components/index.ts +3 -0
  53. package/src/config/index.ts +1 -0
  54. package/src/config/wagmiConfig.ts +45 -0
  55. package/src/constants/index.ts +9 -5
  56. package/src/contracts/abi/BatchQuery.json +52 -0
  57. package/src/contracts/abi/index.ts +2 -0
  58. package/src/contracts/addresses.ts +34 -0
  59. package/src/contracts/index.ts +1 -0
  60. package/src/hooks/index.ts +1 -0
  61. package/src/hooks/useDebounce.tsx +21 -0
  62. package/src/index.ts +6 -0
  63. package/src/models/Addresses.ts +12 -0
  64. package/src/models/Route.ts +17 -5
  65. package/src/models/TokenData.ts +45 -0
  66. package/src/models/TransactionHistory.ts +48 -0
  67. package/src/models/XSwapConfig.ts +3 -0
  68. package/src/models/forms/TxConfigFormData.ts +8 -0
  69. package/src/models/forms/index.ts +1 -0
  70. package/src/models/index.ts +6 -6
  71. package/src/models/integrations/GenerateStakingCallsParams.ts +8 -0
  72. package/src/models/integrations/index.ts +1 -0
  73. package/src/models/payloads/GetPricesPayload.ts +4 -0
  74. package/src/models/payloads/GetRoutePayload.ts +1 -3
  75. package/src/models/payloads/GetSwapTxPayload.ts +8 -0
  76. package/src/models/payloads/index.ts +2 -0
  77. package/src/services/api.ts +46 -64
  78. package/src/services/index.ts +1 -0
  79. package/src/services/integrations/customCalls/index.ts +1 -0
  80. package/src/services/integrations/customCalls/staking.ts +83 -0
  81. package/src/services/integrations/index.ts +2 -0
  82. package/src/services/integrations/transactions.ts +30 -0
  83. package/src/utils/contracts.ts +153 -11
  84. package/src/utils/index.ts +49 -1
  85. package/src/utils/numbers.ts +47 -0
  86. package/src/utils/strings.ts +6 -0
  87. package/tailwind.config.js +19 -0
  88. package/test/api.test.ts +1 -1
  89. package/tsconfig.json +10 -1
  90. package/xswap.config.ts +18 -0
  91. package/index.ts +0 -5
  92. package/src/models/ApiOverrides.ts +0 -3
  93. package/src/models/Chain.ts +0 -20
  94. package/src/models/Prices.ts +0 -9
  95. package/src/models/Token.ts +0 -10
  96. package/src/models/XSwapFee.ts +0 -4
  97. package/src/models/XSwapFees.ts +0 -7
  98. package/src/utils/bigNumbers.ts +0 -7
@@ -17,5 +17,6 @@ jobs:
17
17
  node-version: 16.x
18
18
  cache: "pnpm"
19
19
 
20
- - run: pnpm install --frozen-lockfile
20
+ - run: pnpm install
21
+ - run: pnpm install react@18.2.0 react-dom@18.2.0 @types/react@18.2.0 @types/react-dom@18.2.0
21
22
  - run: pnpm run lint && pnpm run build
@@ -25,7 +25,8 @@ jobs:
25
25
  node-version: 16.x
26
26
  cache: "pnpm"
27
27
 
28
- - run: pnpm install --frozen-lockfile
28
+ - run: pnpm install
29
+ - run: pnpm install react@18.2.0 react-dom@18.2.0 @types/react@18.2.0 @types/react-dom@18.2.0
29
30
  - name: Create Release Pull Request or Publish
30
31
  id: changesets
31
32
  uses: changesets/action@v1
package/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false,
4
+ "trailingComma": "all",
5
+ "singleQuote": false,
6
+ "semi": true
7
+ }
package/CHANGELOG.md CHANGED
@@ -1,10 +1,36 @@
1
1
  # @xswap-link/xswap-sdk
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f2f2fa7: refactor: move settings to separate tab
8
+ - 6c34220: add error display field
9
+ - 1f9c975: refactor: split form into smaller components
10
+ - bc37d57: add express delivery indicator
11
+ - 03de728: request chain change on tx form submit
12
+ - af15c81: refactor: apply changes from figma design
13
+ - f9b5d80: add powered by xswap and ccip badge
14
+ - 4ecbb88: fix small balance display
15
+ - 6742608: fix: close chain list on click outside
16
+ - a06be7d: fix token amount clearing on token change and add Max balance button
17
+
18
+ ## 0.1.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 59c70ca: introducing Swap & Stake modal function component
23
+
24
+ ### Patch Changes
25
+
26
+ - a32a4d8: let disconnected users to use modal
27
+ - d93e3aa: let integrators to provide description
28
+
3
29
  ## 0.0.13
4
30
 
5
31
  ### Patch Changes
6
32
 
7
- - f5225bc: make Route.transactions.approve optional
33
+ - cb5f79b: add swap & stake integration
8
34
 
9
35
  ## 0.0.12
10
36
 
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/xswap-sdk
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. Commit changes
115
+ #### 3. Create changeset
103
116
 
104
- #### 4. Create PR to `develop` branch
117
+ `pnpm changeset` and follow instructions to describe your changes
105
118
 
106
- ### Publishing changes
119
+ #### 4. Commit changes
107
120
 
108
- #### Create changeset file and include into PR to `main`
121
+ including changeset: `git commit -m "feat: <your desc>>"`
109
122
 
110
- Github workflow will fail to publish if you skip it
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>