@cowprotocol/widget-lib 0.0.2 → 0.0.4

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 (2) hide show
  1. package/package.json +2 -2
  2. package/README.md +0 -63
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/widget-lib",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "commonjs",
5
5
  "description": "CoW Swap Widget Library. Allows you to easily embed a CoW Swap widget on your website.",
6
6
  "main": "index.js",
@@ -21,4 +21,4 @@
21
21
  "widget-lib"
22
22
  ],
23
23
  "dependencies": {}
24
- }
24
+ }
package/README.md DELETED
@@ -1,63 +0,0 @@
1
- # CoW Swap widget-lib
2
-
3
- ## Use it
4
-
5
- Install dependency
6
-
7
- ```bash
8
- # Install the dependency using NPM
9
- npm install @cowprotocol/widget-lib --save
10
-
11
- # ...or alternativelly use YARN
12
- yarn add @cowprotocol/widget-lib
13
- ```
14
-
15
- Create an empty div somewhere in your website:
16
-
17
- ```html
18
- <div id="cowswap-widget"></div>
19
- ```
20
-
21
- Import the widget and initialise it:
22
-
23
- ```js
24
- import { cowSwapWidget } from '@cowprotocol/widget-lib'
25
-
26
- // Initialise the widget
27
- const widgetContainer = document.getElementById('cowswap-widget')
28
- cowSwapWidget({
29
- container: widgetContainer
30
- })
31
-
32
-
33
- // Additionally, you can pass some additional params to customise your widget
34
- provider = /* instantiate your own web3 provider */
35
- cowSwapWidget({
36
- container: widgetContainer,
37
- width: 600
38
- height: 640
39
- urlParams: {
40
- sell: { asset: 'DAI' },
41
- buy: { asset: 'USDC', amount: '0.1' }
42
- },
43
- provider
44
- })
45
- ```
46
-
47
- ## Developers
48
-
49
- ```bash
50
- # Test
51
- nx test widget-lib
52
-
53
- # Build the library
54
- nx build widget-lib
55
- cp src/libs/widget-lib/README.md dist/libs/widget-lib # automate
56
-
57
- # Publish to NPM
58
- npm publish --access=public ./dist/libs/widget-lib
59
- ```
60
-
61
- ## Running unit tests
62
-
63
- Run `nx test widget-lib` to execute the unit tests via [Jest](https://jestjs.io).