@wormhole-foundation/wormhole-connect 0.0.1-beta.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/README.md +196 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +41 -0
- package/lib/theme.d.ts +220 -0
- package/lib/theme.js +239 -0
- package/lib/types.d.ts +37 -0
- package/lib/types.js +20 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Wormhole Connect
|
|
2
|
+
|
|
3
|
+
Integration does not get easier than this. Wormhole Connect is an easy seamless experience that will help to bring all the functionality of the Wormhole Token Bridge right into your application.
|
|
4
|
+
|
|
5
|
+
## Integrate with script/link tags
|
|
6
|
+
|
|
7
|
+
### 1. (optional) Create a JSON config with customized values:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
{
|
|
11
|
+
"environment": "testnet",
|
|
12
|
+
"networks": ["goerli", "mumbai"],
|
|
13
|
+
"tokens": ["ETH", "WETH", "MATIC", "WMATIC"],
|
|
14
|
+
"mode": "light"
|
|
15
|
+
"customTheme": {} // see src/theme.ts
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### Accepted values
|
|
20
|
+
|
|
21
|
+
Environment:
|
|
22
|
+
| Mainnet | Testnet |
|
|
23
|
+
| ---------- | --------- |
|
|
24
|
+
| mainnet | testnet |
|
|
25
|
+
|
|
26
|
+
Chains:
|
|
27
|
+
| Mainnet | Testnet |
|
|
28
|
+
| ---------- | --------- |
|
|
29
|
+
| ethereum | goerli |
|
|
30
|
+
| polygon | mumbai |
|
|
31
|
+
| bsc | bsc |
|
|
32
|
+
| avalanche | fuji |
|
|
33
|
+
| celo | avalanche |
|
|
34
|
+
| moonbeam | moonbase |
|
|
35
|
+
| solana | solana |
|
|
36
|
+
|
|
37
|
+
Tokens:
|
|
38
|
+
| Mainnet | Testnet |
|
|
39
|
+
| ------- | ------- |
|
|
40
|
+
| ETH | ETH |
|
|
41
|
+
| WETH | WETH |
|
|
42
|
+
| USDC | USDC |
|
|
43
|
+
| MATIC | MATIC |
|
|
44
|
+
| WMATIC | WMATIC |
|
|
45
|
+
| BNB | BNB |
|
|
46
|
+
| WBNB | WBNB |
|
|
47
|
+
| AVAX | AVAX |
|
|
48
|
+
| WAVAX | WAVAX |
|
|
49
|
+
| FTM | FTM |
|
|
50
|
+
| WFTM | WFTM |
|
|
51
|
+
| CELO | CELO |
|
|
52
|
+
| GLMR | GLMR |
|
|
53
|
+
| WGLMR | WGLMR |
|
|
54
|
+
| SOL | WSOL |
|
|
55
|
+
|
|
56
|
+
Mode:
|
|
57
|
+
| | |
|
|
58
|
+
| ---- | ----- |
|
|
59
|
+
| dark | light |
|
|
60
|
+
|
|
61
|
+
Custom theme:
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
import { dark, light, Theme } from '@wormhole-foundation/wormhole-connect';
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2. Add a script and link tag
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<!-- paste below into index.html body -->
|
|
71
|
+
<script src="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.0/dist/main.js"></script>
|
|
72
|
+
<link rel="https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.0/dist/main.css" />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. Embed it in your application
|
|
76
|
+
|
|
77
|
+
This is where your widget will appear. Specify an id of `wormhole-connect` and pass it the stringified json config to customize.
|
|
78
|
+
|
|
79
|
+
```jsx
|
|
80
|
+
// root element with id
|
|
81
|
+
<div id="wormhole-connect"></div>
|
|
82
|
+
// with customization
|
|
83
|
+
<div id="wormhole-connect" config='{"networks": ["goerli", "mumbai"], "tokens": ["ETH", "WETH", "MATIC", "WMATIC"], "mode": "light"}'></div>
|
|
84
|
+
// stringify JSON config
|
|
85
|
+
<div id="wormhole-connect" config={JSON.stringify(jsonConfig)} />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Integrate with React
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
import WormholeBridge from '@wormhole-foundation/wormhole-connect';
|
|
92
|
+
function App() {
|
|
93
|
+
return (
|
|
94
|
+
<WormholeBridge />
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Specify networks/tokens (optional)
|
|
100
|
+
```jsx
|
|
101
|
+
import WormholeBridge from '@wormhole-foundation/wormhole-connect';
|
|
102
|
+
const config = {
|
|
103
|
+
environment: "mainnet",
|
|
104
|
+
networks: ["ethereum", "polygon", "solana"],
|
|
105
|
+
tokens: ["ETH", "WETH", "MATIC", "WMATIC"],
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function App() {
|
|
109
|
+
return (
|
|
110
|
+
<WormholeBridge config={config} />
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Customize theme (optional)
|
|
116
|
+
```jsx
|
|
117
|
+
import WormholeBridge, { light, Theme } from '@wormhole-foundation/wormhole-connect';
|
|
118
|
+
import lightblue from '@mui/material/colors/lightBlue';
|
|
119
|
+
|
|
120
|
+
// alters the `light` theme
|
|
121
|
+
const customized: Theme = light;
|
|
122
|
+
customized.success = lightblue;
|
|
123
|
+
customized.background.default = 'transparent';
|
|
124
|
+
const config = {
|
|
125
|
+
mode: 'light',
|
|
126
|
+
customTheme: customized,
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function App() {
|
|
130
|
+
return (
|
|
131
|
+
<WormholeBridge config={config} />
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Create fully customized theme (optional)
|
|
137
|
+
```jsx
|
|
138
|
+
import WormholeBridge, { Theme, OPACITY } from '@wormhole-foundation/wormhole-connect';
|
|
139
|
+
import lightblue from '@mui/material/colors/lightBlue';
|
|
140
|
+
import grey from '@mui/material/colors/grey';
|
|
141
|
+
import green from '@mui/material/colors/green';
|
|
142
|
+
import orange from '@mui/material/colors/orange';
|
|
143
|
+
|
|
144
|
+
const customized: Theme = {
|
|
145
|
+
primary: grey,
|
|
146
|
+
secondary: grey,
|
|
147
|
+
divider: '#ffffff' + OPACITY[20],
|
|
148
|
+
background: {
|
|
149
|
+
default: '#232323',
|
|
150
|
+
},
|
|
151
|
+
text: {
|
|
152
|
+
primary: '#ffffff',
|
|
153
|
+
secondary: grey[500],
|
|
154
|
+
},
|
|
155
|
+
error: red,
|
|
156
|
+
info: lightblue,
|
|
157
|
+
success: green,
|
|
158
|
+
warning: orange,
|
|
159
|
+
button: {
|
|
160
|
+
primary: '#ffffff' + OPACITY[20],
|
|
161
|
+
primaryText: '#ffffff',
|
|
162
|
+
disabled: '#ffffff' + OPACITY[10],
|
|
163
|
+
disabledText: '#ffffff' + OPACITY[40],
|
|
164
|
+
action: orange[300],
|
|
165
|
+
actionText: '#000000',
|
|
166
|
+
hover: '#ffffff' + OPACITY[7],
|
|
167
|
+
},
|
|
168
|
+
options: {
|
|
169
|
+
hover: '#474747',
|
|
170
|
+
select: '#5b5b5b',
|
|
171
|
+
},
|
|
172
|
+
card: {
|
|
173
|
+
background: '#333333',
|
|
174
|
+
secondary: '#474747',
|
|
175
|
+
elevation: 'none',
|
|
176
|
+
},
|
|
177
|
+
popover: {
|
|
178
|
+
background: '#1b2033',
|
|
179
|
+
secondary: '#ffffff' + OPACITY[5],
|
|
180
|
+
elevation: 'none',
|
|
181
|
+
},
|
|
182
|
+
modal: {
|
|
183
|
+
background: '#474747',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
const config = {
|
|
187
|
+
mode: 'dark',
|
|
188
|
+
customTheme: customized,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function App() {
|
|
192
|
+
return (
|
|
193
|
+
<WormholeBridge config={config} />
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
```
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WormholeConnectConfig } from './types';
|
|
3
|
+
declare class WormholeBridge extends React.Component<{
|
|
4
|
+
config?: WormholeConnectConfig;
|
|
5
|
+
}> {
|
|
6
|
+
componentDidMount(): void;
|
|
7
|
+
render(): JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
export * from './theme';
|
|
10
|
+
export * from './types';
|
|
11
|
+
export default WormholeBridge;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import React from 'react';
|
|
18
|
+
var WormholeBridge = /** @class */ (function (_super) {
|
|
19
|
+
__extends(WormholeBridge, _super);
|
|
20
|
+
function WormholeBridge() {
|
|
21
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
}
|
|
23
|
+
WormholeBridge.prototype.componentDidMount = function () {
|
|
24
|
+
var script = document.createElement("script");
|
|
25
|
+
script.src = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.0/dist/main.js";
|
|
26
|
+
script.async = true;
|
|
27
|
+
var link = document.createElement("link");
|
|
28
|
+
link.href = "https://www.unpkg.com/@wormhole-foundation/wormhole-connect@0.0.1-beta.0/dist/main.css";
|
|
29
|
+
document.body.appendChild(script);
|
|
30
|
+
document.body.appendChild(link);
|
|
31
|
+
};
|
|
32
|
+
WormholeBridge.prototype.render = function () {
|
|
33
|
+
return (
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
_jsx("div", { id: "wormhole-connect", config: this.props.config ? JSON.stringify(this.props.config) : null }));
|
|
36
|
+
};
|
|
37
|
+
return WormholeBridge;
|
|
38
|
+
}(React.Component));
|
|
39
|
+
export * from './theme';
|
|
40
|
+
export * from './types';
|
|
41
|
+
export default WormholeBridge;
|
package/lib/theme.d.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export type PaletteColor = {
|
|
2
|
+
50: string;
|
|
3
|
+
100: string;
|
|
4
|
+
200: string;
|
|
5
|
+
300: string;
|
|
6
|
+
400: string;
|
|
7
|
+
500: string;
|
|
8
|
+
600: string;
|
|
9
|
+
700: string;
|
|
10
|
+
800: string;
|
|
11
|
+
900: string;
|
|
12
|
+
A100: string;
|
|
13
|
+
A200: string;
|
|
14
|
+
A400: string;
|
|
15
|
+
A700: string;
|
|
16
|
+
};
|
|
17
|
+
export type Theme = {
|
|
18
|
+
primary: PaletteColor;
|
|
19
|
+
secondary: PaletteColor;
|
|
20
|
+
divider: string;
|
|
21
|
+
background: {
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
text: {
|
|
25
|
+
primary: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
};
|
|
28
|
+
error: PaletteColor;
|
|
29
|
+
info: PaletteColor;
|
|
30
|
+
success: PaletteColor;
|
|
31
|
+
warning: PaletteColor;
|
|
32
|
+
button: {
|
|
33
|
+
primary: string;
|
|
34
|
+
primaryText: string;
|
|
35
|
+
disabled: string;
|
|
36
|
+
disabledText: string;
|
|
37
|
+
action: string;
|
|
38
|
+
actionText: string;
|
|
39
|
+
hover: string;
|
|
40
|
+
};
|
|
41
|
+
options: {
|
|
42
|
+
hover: string;
|
|
43
|
+
select: string;
|
|
44
|
+
};
|
|
45
|
+
card: {
|
|
46
|
+
background: string;
|
|
47
|
+
elevation: string;
|
|
48
|
+
secondary: string;
|
|
49
|
+
};
|
|
50
|
+
popover: {
|
|
51
|
+
background: string;
|
|
52
|
+
elevation: string;
|
|
53
|
+
secondary: string;
|
|
54
|
+
};
|
|
55
|
+
modal: {
|
|
56
|
+
background: string;
|
|
57
|
+
};
|
|
58
|
+
font: {
|
|
59
|
+
primary: string;
|
|
60
|
+
header: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const OPACITY: {
|
|
64
|
+
0: string;
|
|
65
|
+
5: string;
|
|
66
|
+
7: string;
|
|
67
|
+
10: string;
|
|
68
|
+
15: string;
|
|
69
|
+
20: string;
|
|
70
|
+
25: string;
|
|
71
|
+
30: string;
|
|
72
|
+
35: string;
|
|
73
|
+
40: string;
|
|
74
|
+
45: string;
|
|
75
|
+
50: string;
|
|
76
|
+
55: string;
|
|
77
|
+
60: string;
|
|
78
|
+
65: string;
|
|
79
|
+
70: string;
|
|
80
|
+
75: string;
|
|
81
|
+
80: string;
|
|
82
|
+
85: string;
|
|
83
|
+
90: string;
|
|
84
|
+
95: string;
|
|
85
|
+
100: string;
|
|
86
|
+
};
|
|
87
|
+
export declare const light: Theme;
|
|
88
|
+
export declare const dark: {
|
|
89
|
+
primary: {
|
|
90
|
+
50: "#fafafa";
|
|
91
|
+
100: "#f5f5f5";
|
|
92
|
+
200: "#eeeeee";
|
|
93
|
+
300: "#e0e0e0";
|
|
94
|
+
400: "#bdbdbd";
|
|
95
|
+
500: "#9e9e9e";
|
|
96
|
+
600: "#757575";
|
|
97
|
+
700: "#616161";
|
|
98
|
+
800: "#424242";
|
|
99
|
+
900: "#212121";
|
|
100
|
+
A100: "#f5f5f5";
|
|
101
|
+
A200: "#eeeeee";
|
|
102
|
+
A400: "#bdbdbd";
|
|
103
|
+
A700: "#616161";
|
|
104
|
+
};
|
|
105
|
+
secondary: {
|
|
106
|
+
50: "#fafafa";
|
|
107
|
+
100: "#f5f5f5";
|
|
108
|
+
200: "#eeeeee";
|
|
109
|
+
300: "#e0e0e0";
|
|
110
|
+
400: "#bdbdbd";
|
|
111
|
+
500: "#9e9e9e";
|
|
112
|
+
600: "#757575";
|
|
113
|
+
700: "#616161";
|
|
114
|
+
800: "#424242";
|
|
115
|
+
900: "#212121";
|
|
116
|
+
A100: "#f5f5f5";
|
|
117
|
+
A200: "#eeeeee";
|
|
118
|
+
A400: "#bdbdbd";
|
|
119
|
+
A700: "#616161";
|
|
120
|
+
};
|
|
121
|
+
divider: string;
|
|
122
|
+
background: {
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
text: {
|
|
126
|
+
primary: string;
|
|
127
|
+
secondary: "#9e9e9e";
|
|
128
|
+
};
|
|
129
|
+
error: {
|
|
130
|
+
50: "#ffebee";
|
|
131
|
+
100: "#ffcdd2";
|
|
132
|
+
200: "#ef9a9a";
|
|
133
|
+
300: "#e57373";
|
|
134
|
+
400: "#ef5350";
|
|
135
|
+
500: "#f44336";
|
|
136
|
+
600: "#e53935";
|
|
137
|
+
700: "#d32f2f";
|
|
138
|
+
800: "#c62828";
|
|
139
|
+
900: "#b71c1c";
|
|
140
|
+
A100: "#ff8a80";
|
|
141
|
+
A200: "#ff5252";
|
|
142
|
+
A400: "#ff1744";
|
|
143
|
+
A700: "#d50000";
|
|
144
|
+
};
|
|
145
|
+
info: {
|
|
146
|
+
50: "#e1f5fe";
|
|
147
|
+
100: "#b3e5fc";
|
|
148
|
+
200: "#81d4fa";
|
|
149
|
+
300: "#4fc3f7";
|
|
150
|
+
400: "#29b6f6";
|
|
151
|
+
500: "#03a9f4";
|
|
152
|
+
600: "#039be5";
|
|
153
|
+
700: "#0288d1";
|
|
154
|
+
800: "#0277bd";
|
|
155
|
+
900: "#01579b";
|
|
156
|
+
A100: "#80d8ff";
|
|
157
|
+
A200: "#40c4ff";
|
|
158
|
+
A400: "#00b0ff";
|
|
159
|
+
A700: "#0091ea";
|
|
160
|
+
};
|
|
161
|
+
success: {
|
|
162
|
+
50: "#e8f5e9";
|
|
163
|
+
100: "#c8e6c9";
|
|
164
|
+
200: "#a5d6a7";
|
|
165
|
+
300: "#81c784";
|
|
166
|
+
400: "#66bb6a";
|
|
167
|
+
500: "#4caf50";
|
|
168
|
+
600: "#43a047";
|
|
169
|
+
700: "#388e3c";
|
|
170
|
+
800: "#2e7d32";
|
|
171
|
+
900: "#1b5e20";
|
|
172
|
+
A100: "#b9f6ca";
|
|
173
|
+
A200: "#69f0ae";
|
|
174
|
+
A400: "#00e676";
|
|
175
|
+
A700: "#00c853";
|
|
176
|
+
};
|
|
177
|
+
warning: {
|
|
178
|
+
50: "#fff3e0";
|
|
179
|
+
100: "#ffe0b2";
|
|
180
|
+
200: "#ffcc80";
|
|
181
|
+
300: "#ffb74d";
|
|
182
|
+
400: "#ffa726";
|
|
183
|
+
500: "#ff9800";
|
|
184
|
+
600: "#fb8c00";
|
|
185
|
+
700: "#f57c00";
|
|
186
|
+
800: "#ef6c00";
|
|
187
|
+
900: "#e65100";
|
|
188
|
+
A100: "#ffd180";
|
|
189
|
+
A200: "#ffab40";
|
|
190
|
+
A400: "#ff9100";
|
|
191
|
+
A700: "#ff6d00";
|
|
192
|
+
};
|
|
193
|
+
button: {
|
|
194
|
+
primary: string;
|
|
195
|
+
primaryText: string;
|
|
196
|
+
disabled: string;
|
|
197
|
+
disabledText: string;
|
|
198
|
+
action: "#ffb74d";
|
|
199
|
+
actionText: string;
|
|
200
|
+
hover: string;
|
|
201
|
+
};
|
|
202
|
+
options: {
|
|
203
|
+
hover: string;
|
|
204
|
+
select: string;
|
|
205
|
+
};
|
|
206
|
+
card: {
|
|
207
|
+
background: string;
|
|
208
|
+
secondary: string;
|
|
209
|
+
elevation: string;
|
|
210
|
+
};
|
|
211
|
+
popover: {
|
|
212
|
+
background: string;
|
|
213
|
+
secondary: string;
|
|
214
|
+
elevation: string;
|
|
215
|
+
};
|
|
216
|
+
modal: {
|
|
217
|
+
background: string;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
export declare const defaultTheme: Theme;
|
package/lib/theme.js
ADDED
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import grey from '@mui/material/colors/grey';
|
|
2
|
+
import green from '@mui/material/colors/green';
|
|
3
|
+
import orange from '@mui/material/colors/orange';
|
|
4
|
+
import red from '@mui/material/colors/red';
|
|
5
|
+
import lightblue from '@mui/material/colors/lightBlue';
|
|
6
|
+
export var OPACITY = {
|
|
7
|
+
0: '00',
|
|
8
|
+
5: '0C',
|
|
9
|
+
7: '0F',
|
|
10
|
+
10: '19',
|
|
11
|
+
15: '26',
|
|
12
|
+
20: '33',
|
|
13
|
+
25: '3F',
|
|
14
|
+
30: '4C',
|
|
15
|
+
35: '59',
|
|
16
|
+
40: '66',
|
|
17
|
+
45: '72',
|
|
18
|
+
50: '7F',
|
|
19
|
+
55: '8C',
|
|
20
|
+
60: '99',
|
|
21
|
+
65: 'A5',
|
|
22
|
+
70: 'B2',
|
|
23
|
+
75: 'BF',
|
|
24
|
+
80: 'CC',
|
|
25
|
+
85: 'D8',
|
|
26
|
+
90: 'E5',
|
|
27
|
+
95: 'F2',
|
|
28
|
+
100: 'FF',
|
|
29
|
+
};
|
|
30
|
+
export var light = {
|
|
31
|
+
primary: {
|
|
32
|
+
50: '#161718',
|
|
33
|
+
100: '#2d2e30',
|
|
34
|
+
200: '#444548',
|
|
35
|
+
300: '#5b5c60',
|
|
36
|
+
400: '#727479',
|
|
37
|
+
500: '#898b91',
|
|
38
|
+
600: '#a0a2a9',
|
|
39
|
+
700: '#b7b9c1',
|
|
40
|
+
800: '#ced0d9',
|
|
41
|
+
900: '#E5E8F2',
|
|
42
|
+
A100: '#ceced1',
|
|
43
|
+
A200: '#9d9ea4',
|
|
44
|
+
A400: '#535660',
|
|
45
|
+
A700: '#0a0e1c',
|
|
46
|
+
},
|
|
47
|
+
secondary: grey,
|
|
48
|
+
divider: '#a0a2a9',
|
|
49
|
+
background: {
|
|
50
|
+
default: '#E5E8F2',
|
|
51
|
+
},
|
|
52
|
+
text: {
|
|
53
|
+
primary: grey[900],
|
|
54
|
+
secondary: grey[800],
|
|
55
|
+
},
|
|
56
|
+
error: red,
|
|
57
|
+
info: {
|
|
58
|
+
50: '#d1e3f9',
|
|
59
|
+
100: '#c8def7',
|
|
60
|
+
200: '#bfd8f6',
|
|
61
|
+
300: '#b6d3f5',
|
|
62
|
+
400: '#adcdf4',
|
|
63
|
+
500: '#A4C8F3',
|
|
64
|
+
600: '#93b4da',
|
|
65
|
+
700: '#83a0c2',
|
|
66
|
+
800: '#728caa',
|
|
67
|
+
900: '#627891',
|
|
68
|
+
A100: '#A4C8F3',
|
|
69
|
+
A200: '#A4C8F3',
|
|
70
|
+
A400: '#A4C8F3',
|
|
71
|
+
A700: '#A4C8F3',
|
|
72
|
+
},
|
|
73
|
+
success: green,
|
|
74
|
+
warning: orange,
|
|
75
|
+
button: {
|
|
76
|
+
primary: '#ffffff',
|
|
77
|
+
primaryText: grey[900],
|
|
78
|
+
disabled: '#c8cad1',
|
|
79
|
+
disabledText: grey[800],
|
|
80
|
+
action: '#F3A01E',
|
|
81
|
+
actionText: '#000000',
|
|
82
|
+
hover: '#b7b9c1',
|
|
83
|
+
},
|
|
84
|
+
options: {
|
|
85
|
+
hover: '#f9f9fb',
|
|
86
|
+
select: '#F0F0F5',
|
|
87
|
+
},
|
|
88
|
+
card: {
|
|
89
|
+
background: '#ffffff',
|
|
90
|
+
elevation: '10px 10px 30px 15px #CCD2E7',
|
|
91
|
+
secondary: '#F0F0F5',
|
|
92
|
+
},
|
|
93
|
+
popover: {
|
|
94
|
+
background: '#ffffff',
|
|
95
|
+
elevation: '10px 10px 30px 15px #CCD2E7',
|
|
96
|
+
secondary: '#F0F0F5',
|
|
97
|
+
},
|
|
98
|
+
modal: {
|
|
99
|
+
background: '#ffffff',
|
|
100
|
+
},
|
|
101
|
+
font: {
|
|
102
|
+
primary: '"Inter", sans-serif',
|
|
103
|
+
header: '"IBM Plex Mono", monospace',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export var dark = {
|
|
107
|
+
primary: grey,
|
|
108
|
+
secondary: grey,
|
|
109
|
+
divider: '#ffffff' + OPACITY[20],
|
|
110
|
+
background: {
|
|
111
|
+
default: '#232323',
|
|
112
|
+
},
|
|
113
|
+
text: {
|
|
114
|
+
primary: '#ffffff',
|
|
115
|
+
secondary: grey[500],
|
|
116
|
+
},
|
|
117
|
+
error: red,
|
|
118
|
+
info: lightblue,
|
|
119
|
+
success: green,
|
|
120
|
+
warning: orange,
|
|
121
|
+
button: {
|
|
122
|
+
primary: '#ffffff' + OPACITY[20],
|
|
123
|
+
primaryText: '#ffffff',
|
|
124
|
+
disabled: '#ffffff' + OPACITY[10],
|
|
125
|
+
disabledText: '#ffffff' + OPACITY[40],
|
|
126
|
+
action: orange[300],
|
|
127
|
+
actionText: '#000000',
|
|
128
|
+
hover: '#ffffff' + OPACITY[7],
|
|
129
|
+
},
|
|
130
|
+
options: {
|
|
131
|
+
hover: '#474747',
|
|
132
|
+
select: '#5b5b5b',
|
|
133
|
+
},
|
|
134
|
+
card: {
|
|
135
|
+
background: '#333333',
|
|
136
|
+
secondary: '#474747',
|
|
137
|
+
elevation: 'none',
|
|
138
|
+
},
|
|
139
|
+
popover: {
|
|
140
|
+
background: '#1b2033',
|
|
141
|
+
secondary: '#ffffff' + OPACITY[5],
|
|
142
|
+
elevation: 'none',
|
|
143
|
+
},
|
|
144
|
+
modal: {
|
|
145
|
+
background: '#474747',
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
export var defaultTheme = {
|
|
149
|
+
primary: grey,
|
|
150
|
+
secondary: grey,
|
|
151
|
+
divider: '#ffffff' + OPACITY[20],
|
|
152
|
+
background: {
|
|
153
|
+
default: 'wormhole',
|
|
154
|
+
},
|
|
155
|
+
text: {
|
|
156
|
+
primary: '#ffffff',
|
|
157
|
+
secondary: grey[500],
|
|
158
|
+
},
|
|
159
|
+
error: red,
|
|
160
|
+
info: {
|
|
161
|
+
50: '#97a5b7',
|
|
162
|
+
100: '#8293a9',
|
|
163
|
+
200: '#6e819a',
|
|
164
|
+
300: '#596f8c',
|
|
165
|
+
400: '#445d7e',
|
|
166
|
+
500: '#304C70',
|
|
167
|
+
600: '#2b4464',
|
|
168
|
+
700: '#263c59',
|
|
169
|
+
800: '#21354e',
|
|
170
|
+
900: '#1c2d43',
|
|
171
|
+
A100: '#304C70',
|
|
172
|
+
A200: '#304C70',
|
|
173
|
+
A400: '#304C70',
|
|
174
|
+
A700: '#304C70',
|
|
175
|
+
},
|
|
176
|
+
// success: green,
|
|
177
|
+
success: {
|
|
178
|
+
50: '#66d6cd',
|
|
179
|
+
100: '#4dcfc4',
|
|
180
|
+
200: '#33c8bc',
|
|
181
|
+
300: '#1ac1b4',
|
|
182
|
+
400: '#01BBAC',
|
|
183
|
+
500: '#00a89a',
|
|
184
|
+
600: '#009589',
|
|
185
|
+
700: '#008278',
|
|
186
|
+
800: '#007067',
|
|
187
|
+
900: '#005d56',
|
|
188
|
+
A100: '#00a89a',
|
|
189
|
+
A200: '#00a89a',
|
|
190
|
+
A400: '#00a89a',
|
|
191
|
+
A700: '#00a89a',
|
|
192
|
+
},
|
|
193
|
+
warning: {
|
|
194
|
+
50: '#ffe3a4',
|
|
195
|
+
100: '#ffdd91',
|
|
196
|
+
200: '#ffd77f',
|
|
197
|
+
300: '#ffd26d',
|
|
198
|
+
400: '#ffcc5b',
|
|
199
|
+
500: '#FFC749',
|
|
200
|
+
600: '#e5b341',
|
|
201
|
+
700: '#cc9f3a',
|
|
202
|
+
800: '#b28b33',
|
|
203
|
+
900: '#99772b',
|
|
204
|
+
A100: '#FFC749',
|
|
205
|
+
A200: '#FFC749',
|
|
206
|
+
A400: '#FFC749',
|
|
207
|
+
A700: '#FFC749',
|
|
208
|
+
},
|
|
209
|
+
button: {
|
|
210
|
+
primary: '#ffffff' + OPACITY[10],
|
|
211
|
+
primaryText: '#ffffff',
|
|
212
|
+
disabled: '#ffffff' + OPACITY[7],
|
|
213
|
+
disabledText: '#ffffff' + OPACITY[40],
|
|
214
|
+
action: '#ffffff' + OPACITY[20],
|
|
215
|
+
actionText: '#ffffff',
|
|
216
|
+
hover: '#ffffff' + OPACITY[7],
|
|
217
|
+
},
|
|
218
|
+
options: {
|
|
219
|
+
hover: '#ffffff' + OPACITY[7],
|
|
220
|
+
select: '#ffffff' + OPACITY[10],
|
|
221
|
+
},
|
|
222
|
+
card: {
|
|
223
|
+
background: '#ffffff' + OPACITY[5],
|
|
224
|
+
secondary: '#ffffff' + OPACITY[5],
|
|
225
|
+
elevation: 'none',
|
|
226
|
+
},
|
|
227
|
+
popover: {
|
|
228
|
+
background: '#1b2033',
|
|
229
|
+
secondary: '#ffffff' + OPACITY[5],
|
|
230
|
+
elevation: 'none',
|
|
231
|
+
},
|
|
232
|
+
modal: {
|
|
233
|
+
background: '#0F1024',
|
|
234
|
+
},
|
|
235
|
+
font: {
|
|
236
|
+
primary: '"Inter", sans-serif',
|
|
237
|
+
header: '"IBM Plex Mono", monospace',
|
|
238
|
+
},
|
|
239
|
+
};
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const MAINNET_CHAINS: {
|
|
2
|
+
readonly solana: 1;
|
|
3
|
+
readonly ethereum: 2;
|
|
4
|
+
readonly bsc: 4;
|
|
5
|
+
readonly polygon: 5;
|
|
6
|
+
readonly avalanche: 6;
|
|
7
|
+
readonly fantom: 10;
|
|
8
|
+
readonly celo: 14;
|
|
9
|
+
readonly moonbeam: 16;
|
|
10
|
+
};
|
|
11
|
+
export type MainnetChainName = keyof typeof MAINNET_CHAINS;
|
|
12
|
+
export type MainnetChainId = (typeof MAINNET_CHAINS)[MainnetChainName];
|
|
13
|
+
export declare const TESTNET_CHAINS: {
|
|
14
|
+
readonly solana: 1;
|
|
15
|
+
readonly goerli: 2;
|
|
16
|
+
readonly bsc: 4;
|
|
17
|
+
readonly mumbai: 5;
|
|
18
|
+
readonly fuji: 6;
|
|
19
|
+
readonly fantom: 10;
|
|
20
|
+
readonly alfajores: 14;
|
|
21
|
+
readonly moonbasealpha: 16;
|
|
22
|
+
};
|
|
23
|
+
export type TestnetChainName = keyof typeof TESTNET_CHAINS;
|
|
24
|
+
export type TestnetChainId = (typeof TESTNET_CHAINS)[TestnetChainName];
|
|
25
|
+
export type ChainName = MainnetChainName | TestnetChainName;
|
|
26
|
+
export type ChainId = MainnetChainId | TestnetChainId;
|
|
27
|
+
export type Rpcs = {
|
|
28
|
+
[chain in ChainName]?: string;
|
|
29
|
+
};
|
|
30
|
+
export interface WormholeConnectConfig {
|
|
31
|
+
env?: 'mainnet' | 'testnet';
|
|
32
|
+
rpcs?: Rpcs;
|
|
33
|
+
networks?: ChainName[];
|
|
34
|
+
tokens?: string[];
|
|
35
|
+
mode?: 'dark' | 'light';
|
|
36
|
+
customTheme?: any;
|
|
37
|
+
}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export var MAINNET_CHAINS = {
|
|
2
|
+
solana: 1,
|
|
3
|
+
ethereum: 2,
|
|
4
|
+
bsc: 4,
|
|
5
|
+
polygon: 5,
|
|
6
|
+
avalanche: 6,
|
|
7
|
+
fantom: 10,
|
|
8
|
+
celo: 14,
|
|
9
|
+
moonbeam: 16,
|
|
10
|
+
};
|
|
11
|
+
export var TESTNET_CHAINS = {
|
|
12
|
+
solana: 1,
|
|
13
|
+
goerli: 2,
|
|
14
|
+
bsc: 4,
|
|
15
|
+
mumbai: 5,
|
|
16
|
+
fuji: 6,
|
|
17
|
+
fantom: 10,
|
|
18
|
+
alfajores: 14,
|
|
19
|
+
moonbasealpha: 16,
|
|
20
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wormhole-foundation/wormhole-connect",
|
|
3
|
+
"version": "0.0.1-beta.0",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@mui/material": "^5.12.1"
|
|
6
|
+
},
|
|
7
|
+
"devDependencies": {
|
|
8
|
+
"react": "^18.2.0",
|
|
9
|
+
"react-dom": "^18.2.0",
|
|
10
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
11
|
+
"@testing-library/react": "^13.4.0",
|
|
12
|
+
"@testing-library/user-event": "^13.5.0",
|
|
13
|
+
"@types/jest": "^27.5.2",
|
|
14
|
+
"@types/node": "^16.18.23",
|
|
15
|
+
"@types/react": "^18.0.37",
|
|
16
|
+
"@types/react-dom": "^18.0.11",
|
|
17
|
+
"babel-loader": "^9.1.2",
|
|
18
|
+
"ts-loader": "^9.4.2",
|
|
19
|
+
"typescript": "^4.9.5",
|
|
20
|
+
"webpack": "^5.79.0",
|
|
21
|
+
"webpack-cli": "^5.0.1"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-dom": "^18.2.0"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc"
|
|
29
|
+
},
|
|
30
|
+
"eslintConfig": {
|
|
31
|
+
"extends": [
|
|
32
|
+
"react-app",
|
|
33
|
+
"react-app/jest"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"browserslist": {
|
|
37
|
+
"production": [
|
|
38
|
+
">0.2%",
|
|
39
|
+
"not dead",
|
|
40
|
+
"not op_mini all"
|
|
41
|
+
],
|
|
42
|
+
"development": [
|
|
43
|
+
"last 1 chrome version",
|
|
44
|
+
"last 1 firefox version",
|
|
45
|
+
"last 1 safari version"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"description": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).",
|
|
49
|
+
"main": "lib/index.js",
|
|
50
|
+
"types": "lib/index.d.ts",
|
|
51
|
+
"files": [ "lib" ],
|
|
52
|
+
"repository": {
|
|
53
|
+
"type": "git",
|
|
54
|
+
"url": "git+https://github.com/wormhole-foundation/wormhole-connect.git"
|
|
55
|
+
},
|
|
56
|
+
"author": "",
|
|
57
|
+
"license": "ISC",
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/wormhole-foundation/wormhole-connect/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/wormhole-foundation/wormhole-connect#readme"
|
|
62
|
+
}
|