@wormhole-foundation/wormhole-connect 0.0.1-beta.6 → 0.0.1-beta.7
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 +11 -12
- package/dist/main.js +2 -2
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Integration does not get easier than this. Wormhole Connect is an easy seamless
|
|
|
4
4
|
|
|
5
5
|
## Integrate with script/link tags
|
|
6
6
|
|
|
7
|
-
### 1. (
|
|
7
|
+
### 1. (Optional) Create a JSON config with customized values:
|
|
8
8
|
|
|
9
9
|
```ts
|
|
10
10
|
{
|
|
@@ -80,25 +80,24 @@ See [theme.ts](https://github.com/wormhole-foundation/wormhole-connect/blob/deve
|
|
|
80
80
|
|
|
81
81
|
### 2. Add your config
|
|
82
82
|
|
|
83
|
-
Add a div with the id `wormhole-connect`. This is where the bridge will be rendered.
|
|
83
|
+
Add a container div with the id `wormhole-connect`. This is where the bridge will be rendered.
|
|
84
84
|
|
|
85
85
|
```html
|
|
86
86
|
<div id="wormhole-connect" />
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
If you created a config from step 1,
|
|
89
|
+
If you created a config from step 1, [stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) it and assign to the `config` attribute on the container element.
|
|
90
90
|
|
|
91
91
|
```html
|
|
92
|
-
<div id="wormhole-connect" config='
|
|
93
|
-
<div id="wormhole-connect" config={JSON.stringify(jsonConfig)} />
|
|
92
|
+
<div id="wormhole-connect" config='{"env":"mainnet","tokens":["ETH","WETH","WBTC","USDCeth"]}' />
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
### 2. Add a script and link tag
|
|
97
96
|
|
|
98
97
|
```html
|
|
99
98
|
<!-- paste below into index.html body -->
|
|
100
|
-
<script src="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.
|
|
101
|
-
<link href="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.
|
|
99
|
+
<script src="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.7/dist/main.js"></script>
|
|
100
|
+
<link href="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.7/dist/main.css" />
|
|
102
101
|
```
|
|
103
102
|
|
|
104
103
|
Note that the `wormhole-connect` div with your config has to be present _before_ the scripts are loaded. If your application loads it after, you may need to add the scripts like this:
|
|
@@ -106,11 +105,11 @@ Note that the `wormhole-connect` div with your config has to be present _before_
|
|
|
106
105
|
```js
|
|
107
106
|
function mount () {
|
|
108
107
|
const script = document.createElement("script");
|
|
109
|
-
script.src = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.
|
|
108
|
+
script.src = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.7/dist/main.js";
|
|
110
109
|
script.async = true;
|
|
111
110
|
|
|
112
111
|
const link = document.createElement("link");
|
|
113
|
-
link.href = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.
|
|
112
|
+
link.href = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.7/dist/main.css";
|
|
114
113
|
|
|
115
114
|
document.body.appendChild(script);
|
|
116
115
|
document.body.appendChild(link);
|
|
@@ -128,7 +127,7 @@ function App() {
|
|
|
128
127
|
}
|
|
129
128
|
```
|
|
130
129
|
|
|
131
|
-
Specify networks/tokens and
|
|
130
|
+
(Optional) Specify supported networks/tokens and custom RPC endpoints. Your users may encounter rate limits using public RPC endpoints if you do not provide your own
|
|
132
131
|
```jsx
|
|
133
132
|
import WormholeBridge, { WormholeConnectConfig } from '@wormhole-foundation/wormhole-connect';
|
|
134
133
|
const config: WormholeConnectConfig = {
|
|
@@ -148,7 +147,7 @@ function App() {
|
|
|
148
147
|
}
|
|
149
148
|
```
|
|
150
149
|
|
|
151
|
-
Customize theme
|
|
150
|
+
(Optional) Customize theme
|
|
152
151
|
```jsx
|
|
153
152
|
import WormholeBridge, { light, Theme, WormholeConnectConfig } from '@wormhole-foundation/wormhole-connect';
|
|
154
153
|
import lightblue from '@mui/material/colors/lightBlue';
|
|
@@ -172,7 +171,7 @@ function App() {
|
|
|
172
171
|
}
|
|
173
172
|
```
|
|
174
173
|
|
|
175
|
-
Create fully customized theme
|
|
174
|
+
(Optional) Create fully customized theme
|
|
176
175
|
```jsx
|
|
177
176
|
import WormholeBridge, { Theme, OPACITY, WormholeConnectConfig } from '@wormhole-foundation/wormhole-connect';
|
|
178
177
|
import lightblue from '@mui/material/colors/lightBlue';
|