Skip to content

Commit

Permalink
Wormhole Connect 0.0.1-beta.3
Browse files Browse the repository at this point in the history
fix: weird README collision

add: execute near transactions

add: Wallet contexts

fix: build issue

lint

add: parse sequences from logs

add: get emitter address

lint

lint

fix: implement function correctly

update: parseSequenceMethods

add: signedVAA methods

add: light/dark theme capabilities

style: add makeStyle templates

lint

add: some bridge view components

add: network tiles

lint

add: pass in network props

add: token modal and opacity util

lint

add: advanced dropdown

add: tooltip component

add: network select functionality

add: wallet modal and AppRouter component

add: tokens modal open/close

add: set token

refactor: split up Bridge view into a few components

add: destination gas payment options

add: native gas slider

add: transfer summary

add: send button and redeem base component

add: info box component

add: some initial milestone page content

lint

add: stepper

refactor: organize icons

add: more stepper content

refactor: themes

refactor: better class combining syntax

add: icon components

refactor: networks cards

add: better modal

add: menu dropdown

add: wallet dropdown

update: token/amount

fix: icons

refactor: configure to support testnet

update: fill in mainnet configs

lint

add: wallet connect modal

add: basic send function

refactor: connecting wallet

add: props for redeem page

style: options

style: bridge options

update: testnet config, add amount input focus

add: TokenBridgeRelayer typechain

add: sendWithRelay method

add: action indicator to connect wallet tag

add: balance field

lint

add: basic vaa store/data

refactor: vaa stuff

update: milestones stepper components

fix: sendWithRelay, pass in values from store

add: PageHeader component

refactor: move sdk to its own package

refactor: network and token configs

fix: type errors

fix: sdk package import

refactor: tokens config

refactor: send transaction codes

fix: network modal open/close functionality

fix: skip unwrapWeth flag, set in configs

fix: build script and fix approve method

add: tx hash to transfer state

add: redeem logic

refactor: prepare entry point for widget

add: sample-app integration

refactor: yarn workspace and rename packages

build

fix: move docs folder to root

remove: config stuff from App root

try: remove customization logic for the time being

add: embedded widget

fix: image tags, remove dark/light theme toggle

fix: try moving image to public folder

add: TokenIcon component

add: TokenIcon component

add: walletIcons component

update: readme

fix: figure out how to place in React app

style: gas options and fill token symbols

add: fill in more token inputs

refactor: tokenId

try: rename build command for netlify debugging

add: sample-app to yarn workspace

fix: netlify build command

add: search box functionality

refactor: rename packages, update readme

add: getBalance for ERC-20 tokens

fix: fantom rpc

clean: remove modal console logs

refactor: progress on wallet connection handling

fix: better wallet handling

fix: wallet handling on send page

refactor: wallet connection and in progress transaction handling

add: get native token balance

fix: show wrapped asset

fix: register signer and switch network

fix: vaa byte conversion

fix: switch network

Native gas slider (#31)

* add: calculate max swap amount

* add: slider functionality

* fix: make slider fully functional

* lint

docs: add disclaimer to README (#30)

Update issue templates (#37)

update: Readme instructions with build command

Development (#40)

* add: check user's native balance on the destination and update text

* style: full-screen modals, balance loading

* style: full-screen menu

* fix: disable selecting the same from/to networks

Development (#43)

* add: fetch token balances

* style: wallet connect button and animation

* lint

add: start Wormhole theme

fix: slider, more theme styling

style: wormhole styling and fix bnb icon

lint

fix: background image

fix: align text

Feature: tx lookup (#52)

* add: parseMessageFromTx

* add: initial Tx Search page

* refactor: use values from tx receipt

* fix: show actual amounts and fees in redeem page

* fix: decimals and sendWithRelay method

* lint

fix: remove animation on wallet connect button

style: remove color fill on static elements

fix: modal search functionality

fix: trigger search on entter or clicking the icon

style: change cursor

Relayer fee (#55)

* add: getRelayerFee, handle token repr that don't exist

* update: testnet relayer contracts

* refactor: balance methods

* fix: gas slider issues, getForeignAsset bug

* add: fill in relayer fee

* try: clear transfer

fix: approve function

fix: get token address on sending chain for approve/send

Transfer complete (#61)

* add: isTransferComplete, start updating from ui

* fix: redeem page for manual transfers

* add: check if transfer is complete and handle

fix: use unicode arrow

Development (#185)

* update: build script

* fix: mainnet configs

* update: build script for integrations

* update: build script again

* Integration (#86)

* add: generic dark theme, fix mainnet config

* add: allow to pass in custom theme

* add: custom theme support to builder

* add: custom theme support to builder

* fix: imports

* fix: add MuiCollapse style to theme overrides

* document: builder readme

* revert: show wh theme again

* fix: config value

* clean: change name to just main.css

* Solana refactor 2 (#130)

* refactor: clean up contexts

* update: make BridgeAbstract and RelayerAbstract

* update: add solana to configs

* lint and build sdk

* clean: remove unused icons

* add: WalletContextProvider

* refactor: progress on wallet handling

* add: set wallet type

* fix: disable networks that are not available with the connected wallet

* add: get solana token balances

* lint

* refactor: add ChainManager, update Contracts classes

* lint: clean up wormhole context

* fix: getForeignAsset functions

* add: check if automatic relay is available

* fix: send from ETH to any context

* fix: solana send error

* refactor: remove ChainsManager and combine with WormholeContext

* fix: handle different decimals for Solana

* fix: get tx details from solana tx id

* fix: display solana addresses correctly

* fix: solana transaction details

* add: isTransferCompleted and vaa utils

* add: get gas fee for source tx, refine method for getting sender address

* fix: allow selecting a disabled network but clear the wallet

* refactor: wallet modals, add redeem on solana

* fix: move env variables out of sdk

* lint

* Update unicode right arrow (#132)

Update from ⟶ to →

* fix: horizontal scrollbar

* update: enhance search filter

* Routing (#135)

* fix: make tx search its own route, clear store values on route change

* lint

* Progress bar (#136)

* add: confirmations progress bar

* fix: use txData for wormhole explorer link

* fix: solana block height/confirmations logic

* fix: add height and width to svgs so they show up on safari (#139)

* fix: add height and width to svgs so they show up on safari

* clean: delete validations file

* Transfer validations (#140)

* add: begin writing validation functions

* refactor: transfer validations

* add: very rough validation error states

* fix: functioning validation

* add: error borders

* lint

* add: more amount validations

* lint

* Show send tx link immediately (#158)

* update: show link to send tx immediately

* add: throw error if user is somehow not connected to wallet when claim function is called

* style: tweak styling, make Redeem and Search pages mobile friendly (#159)

* style: make network tile thinner on small screens to make room for amount/balance

* Bridge style edits (#160)

* style: add font configuration

* style: tweak preview and gas options styling

* style: rename token input title to Asset

* Min amount validation (#161)

* fix: minimum amount validation, show gas options always

* add: warning banner for manual transfers

* Modal styles (#162)

* style: networks modal

* style: token modal

* style: tokens modal, standardize modal header styling

* lint

* Terms and FAQ pages (#173)

* add: faq

* lint

* refactor: use npm instead of yarn

* Pre-commit hook (#174)

* add: pre-commit hook

* add: pre-commit hook

* refactor: pre-commit script

* Network logic (#175)

* refactor: network modal, clean up unused components/icons

* refactor: from/to sections

* fix: balance

* fix: return checksummed address (#182)

* fix: clear balance if wallet becomes disconnected, clear token if not supported (#183)

* add: config tests, create Icon enum to help prevent against typos/error (#184)

---------

Co-authored-by: Tony Jin <[email protected]>

fix: delete extra step in GH Action (#187)

fix: set working directory (#188) (#189)

* test GH Action

* refactor: add working directory to GH Actions

* revert

fix: remove working directory entirely (#191)

Inputs (#193)

* refactor: clean up to/from inputs layout

* style: inputs for small screen sizes

* style: clean up and style top inputs

* fix: no network icon issues

style: gray out unavailable wallets (#194)

WIP: claim (#198)

* fix: isTransferComplete for EVM chains

* add: show error if claim fails

* add: send error banner

* fix: solana claim

Tx search (#199)

* clean: remove comment

* copy: replace token with asset

* fix: tx search checks and add error messages

* clean: remove comment

fix: input display with many decimals (#203)

Disconnect error (#205)

* style: placeholder on small screens

* add: disconnect error banner

WIP: Gas estimates (#204)

* fix: loader keeps spinning after transfer complete

* add: calculate sending gas estimate

* add: 'Not available' copy

* refactor: gas estimate calculations

* fix: gas fee estimations

* fix: gas payment options bug

* add: solana gas estimations

lint: remove unused imports

add: bundle build files into one

fix: remove root div and rename to bundle.html

fix: BSC rpc and display wrapped asset in 'to' section

fix: approve before sending ERC-20s

fix: increase gas limit for relay transfers

fix: pass in wallet address to redeemOnSolana

fix: token approval

build: bundle into 1 js and 1 css file

Background (#221)

* style: background

* add: background to widget

* fix: bug with adding custom config

* fix: keep old background on wormhole-connect for now

build

fix: wormhole background (#230)

update: build

fix: type errors

fix: remove mui/styles package

fix: classes bug

[#225] Bugfix disable controls on tx approval (#247)

* bugfix: disable gas controls when a transaction is approved and in progress

* lint

---------

Co-authored-by: anondev2323 <[email protected]>

add: moonbeam (#245)

* refactor: move config, add moonbeam

* fix: rename nativeToken to gasToken

* copy: rename to just moonbase

[#216] Catch NotSupported error when the wallet doesn't support switching chains (#244)

* Bump @xlabs-libs/wallet-aggregator-evm package

* bugfix: catch error when trying to switch chains and the wallet does not support it (e.g. some wallets with walletconnect)

bugfix: clear wallet state when disconnected from outside app (#253)

Add parameters to fix evaluation order when resolving the chain in the WalletModal (#268)

copy: update resume transfer to resume transaction (#273)

copy: update gas slider copy (#274)

Add warning message for non registered tokens. Closes #272

fix: collapse transition on alert

Solana sdk refactor (#233)

Add disclaimer above approve button linking to the terms of service

Address review comments

enhancement: show validations once all inputs are filled (#288)

Add from address override when simulating the transferToken call simulations in order to avoid errors when trying to transfer from that address (the provider would set it to null since it's a static provider) (#292)

Add 'add to wallet' link on the final CTA step

Address edge cases when watching a token

Address review comments

Extract add token to wallet code to a new AddToWallet component. Address edge case where the user would try to add the token after resuming a completed transfer operation.

Add small component to AddToWallet to make the solana token mint address available for the user to copy

Extract ExplorerLink component. Use it to link to the Solana explorer after the redeem process is done and the target network is solana

bugfix: gas estimation fallbacks (#293)

* fix: create gas estimates config

* refactor: split out gas estimates logic into separate file

* fix: await promise

* fix: solana gas units

fix: undefined token value (#297)

Move token clear logic to setFromNetwork store action (#302)

Value memoization and reduce of dispatch actions to prevent a bug where the token list would not properly load after changing networks

Clear balances before refetching them

Add loader shown when loading token balances

Create associated token account (#304)

* refactor: getForeignAsset returns null if it does not exist

* add: check for existing associated token account

* refactor: go back to creating solana token account at beginning of transfer

* fix: createAssociatedTokenAccount

* nits

* fix: delete imports

* fix: display warning bug

* fix: poll to check for account

Add types to config object retrieved from root tag and allow for rpc endpoints overriding (#328)

Fix error due to undefined/null config (#336)

[#163] Native gas slider toggle (#327)

* Add the option to alternate between a switch and an arrow as collapse toggle controls. Reset the native gas dropoff to zero when the user switches off/collapses the gas slider

* Create custom styled switch

* Trigger collapse change event after the animation finishes

Remove debug logs (#337)

bugfix: accurately calculate and display fees on redeem page (#330)

* fix: calculate gas fees/estimates

* add: calculate gas fees on redeem page

* fix: toNativeToken receive amount

* fix: convert normalized amount

* fix: normalized decimals conversions

* update: create constants

* fix: apply maxBlockSearch value

* fix: toChainName call

* fix: pass in maxBlockSearch

update: build files

Bump aggregator sdk solana package

Parse amount to number before storing it to keep it consistent with the field type

release/0.0.1 beta.0 (#358)

Use text input by default and check whether it satisfies a numeric expression to remove unwanted characters

Filter out tokens only when the wallet is connected and the network is selected

Substract the native gas token converted from the transferred amount

Avoid calculating swap information when the payment method is manual. As an additional precausion, render the native gas slider only when it is to be shown.

add: cta to WormholeConnectConfig (#377)

Remove useEffect hook from Bridge which would replace the token balance with that of the destination chain

Readd useEffect hook but store the balance in a new receiverNativeBalance field from the store

fix: add .d.ts files to list (#385)

[348] check if token is accepted (#389)

* fix: check if token is accepted

* fix: handle 'Swap rate not set' errors

* fix: accidentally deleted getConversion block

* refactor: enable/disable automatic transfers

Disconnect wallet when the user changes to another account

Show gas estimate for automatic payment option even when there is no relayer fee (i.e. relay is free)

Readd relayer fee check

Readme update

readme update

fix: change moonbeam rpc (#392)

release/0.0.1-beta.3 (#393)

Update/create README, LICENSE, CONTRIBUTING (#396)

* Update/create README, LICENSE, CONTRIBUTING

closes #395

* Incorporate #393 CONTRIBUTING.md changes

* Updated after convo with Dan

* Update README.md

* fix: spacing on readme after rebase

---------

Co-authored-by: aakashthumaty <[email protected]>
Co-authored-by: anondev2323 <[email protected]>

Trigger amount verification on balances change (#416)

Trigger wrapped token verification when changing network. Clear foreign asset address if it does not exist for the target chain

Trigger checks when the token is changed

Feature/trm screening (#419)

* feature: add TRM screening check to transfer validations

* fix: add cache to help with rate limiting

triage: claim (#420)

* fix: bsc default rpc url

* fix: clear timeout before setting new value

* update: refine claim UX

* enhance: click area on search input

* fix: poll more frequently upon initialization

* clean: use onExited to clear text

* clean: use ref instead of id
  • Loading branch information
anondev2323 committed Apr 25, 2023
1 parent c31fb27 commit aaa9de0
Show file tree
Hide file tree
Showing 307 changed files with 191,671 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/qa-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: QA Template
about: Record issues, bugs or give feedback for those doing QA
title: "[QA]"
labels: ''
assignees: ''

---

## Before you proceed

- Check if this is already reported in another issue
- Leave a comment on the issue if there is information missing or you have a question

## Describe the current behavior in detail

## What is the expected/desired behavior
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/visual-qa-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Visual QA Template
about: Report UI elements that do not match the design
title: ''
labels: design
assignees: ''

---

## Before you proceed

- Check if this is already reported in another issue
- Leave a comment on the issue if there is information missing or you have a question

## Describe the current behavior in detail

## What is the expected/desired behavior
18 changes: 18 additions & 0 deletions .github/workflows/wormhole-connect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Run tests

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Lint
run: npm run lint

test:
runs-on: ubuntu-latest

steps:
- name: Test
run: npm run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
# Local Netlify folder
.netlify
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Overview

This repository has 3 important, protected branches: `development` (default), `staging` and `production`.

- Day-to-day development happens targeting the default `development` branch.
- Periodically, a release is cut from the development branch by merging it into `staging`. At that point, the staging branch may be deployed in a test environment for testing on testnets. We aim to keep the staging branch stable.
- Once the new development(s) have been tested in the test environment, the `staging` branch is merged into the `production` branch. After a period of testing on mainnet, the NPM package will be updated from the `production` branch.
- Release notes for the `staging` branch will be marked as "pre-release". Release notes for the `production` branch will be marked as regular releases.

We aim to use GitHub Issues as the task management system to track work.

- If you'd like to contribute but unsure what, refer to the list of open tasks in the issue list.
- We always welcome pull requests that improve Wormhole Connect. In case you would like to work on a specific task, please let us know by commenting in the issue. Be sure to reference the original task in the PR(s) that you submit.
- Discussion threads are an excellent place to discuss future improvement plans or ask the maintainers any questions. If you have a cool idea for Wormhole Connect, open a discussion thread about it.
- If you notice a problem but you're unsure how to fix it, please open a new issue if the problem hasn't been reported yet.

## Publish to NPM

1. Create a PR against `production`
2. In `/sdk`, run `npm i && npm run lint && npm run build`
3. In `/wormhole-connect`, run `npm i && npm run lint && npm run build`
4. Copy `/wormhole-connect/build/static/js/main.xxxxx.js` and `/wormhole-connect/build/static/css/main.xxxxx.css` into `wormhole-connect-loader/dist`. Rename to `main.js` and `main.css` respectively.
5. Bump the version in `/wormhole-connect-loader` package.json
6. Update the script/link tag links to match the version that will be published (e.g. "https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.js")
7. In `/wormhole-connect-loader`, run `npm i && npm run build`
8. Wait for PR approval
9. Create a tag (e.g. `[email protected]`)
10. Release package from `/wormhole-connect-loader`

## Setup

### Pre-commit hooks

Set up your pre-commit hook:

```bash
echo "./pre-commit.sh" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
chmod +x ./pre-commit.sh
```
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2023 Wormhole Project Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
75 changes: 74 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,74 @@
# wormhole-widget
# Wormhole Connect

Wormhole Connect is a project to facilitate integration with the Wormhole protocol. It is thus far comprised of 3 components: wormhole-connect, sdk and builder. Below is a brief introduction on each, see the corresponding READMEs for more information.

### wormhole-connect

An app that brings all the functionality and utility of the Wormhole token bridge right into your application and removes all of the complexity. It is is built to be embedded within any application, simply copy a script tag or (future) install the npm package. Optionally, configure a number of parameters such as supported chains/tokens and theme.

### sdk

The beginning of a refactor of the existing sdk. It is written in Typescript and is built with ease-of-use in mind. It is organized into different `context` classes (i.e. evm, solana, terra, etc) which each implement the same methods with standardized parameters.

### builder

Initially this serves as a way to test integrating wormhole-connect. In the future, this will become a playground where developers can come to customize their integration by selecting the chain and tokens they would like to support as well as edit theme variables to make it blend seamlessly within their application.

## Setup

1) Link the sdk

```bash
cd ./sdk
npm i
npm run build
npm link
cd ../wormhole-connect
npm link @wormhole-foundation/wormhole-connect-sdk
```

2) Install

Run `npm i` at the root of the repo

3) Start

Start wormhole-connect UI and view in browser at localhost:3000
```bash
# in /wormhole-connect
npm run start # testnet
```

Start builder UI and view in browser at localhost:3000
```bash
# in /builder
npm run start
```

Render Connect with the following code

```html
<!-- include in <head> -->
<script src="https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.js" defer></script>
<link rel="https://www.unpkg.com/@wormhole-foundation/[email protected]/dist/main.css" />

<!-- include in <body> -->
<div id="wormhole-connect"></div>
```

OR

```javascript
import WormholeBridge from '@wormhole-foundation/wormhole-connect';
function App() {
return (
<WormholeBridge />
);
}
```

## Disclaimer

This SDK is an open source software SDK that leverages the Wormhole protocol, a cross chain messaging protocol. The SDK does not process payments. THIS SDK AND THE WORMHOLE PROTOCOL ARE PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. By using or accessing this SDK or Wormhole, you agree that no developer or entity involved in creating, deploying, maintaining, operating this SDK or Wormhole, or causing or supporting any of the foregoing, will be liable in any manner for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of, this SDK or Wormhole, or this SDK or Wormhole themselves, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. By using or accessing this SDK, you represent that you are not subject to sanctions or otherwise designated on any list of prohibited or restricted parties or excluded or denied persons, including but not limited to the lists maintained by the United States' Department of Treasury's Office of Foreign Assets Control, the United Nations Security Council, the European Union or its Member States, or any other government authority.

Wormhole Connect is an NPM package that interacts with the Wormhole protocol. You assume all risks associated with using the SDK, the Wormhole Connect NPM package, the Wormhole protocol, and digital assets and decentralized systems generally, including but not limited to, that: (a) digital assets are highly volatile; (b) using digital assets is inherently risky due to both features of such assets and the potential unauthorized acts of third parties; (c) you may not have ready access to assets; and (d) you may lose some or all of your tokens or other assets. You agree that you will have no recourse against anyone else for any losses due to the use of the SDK or Wormhole. For example, these losses may arise from or relate to: (i) incorrect information; (ii) software or network failures; (iii) corrupted cryptocurrency wallet files; (iv) unauthorized access; (v) errors, mistakes, or inaccuracies; or (vi) third-party activities.
23 changes: 23 additions & 0 deletions builder/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
83 changes: 83 additions & 0 deletions builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Wormhole Connect Example Integration

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.

## Integration instructions

1. Customize by editing `src/wormhole-config.json`

```ts
{
// accepted values: "goerli", "mumbai", "bsc", "fuji", "fantom", "alfajores"
"networks": ["goerli", "mumbai"],
// accepted values: "ETH", "WETH", "USDC", "MATIC", "WMATIC", "BNB", "WBNB", "AVAX", "WAVAX", "FTM", "WFTM", "CELO
"tokens": ["ETH", "WETH", "MATIC", "WMATIC"],
// accepted values: "light", "dark" or custom (future)
"mode": "light"
}
```

2. Add a script and link tag

```html
<!-- paste below into index.html body -->
<script src="https://wormhole-foundation.github.io/wormhole-connect/main.js"></script>
<link src="https://wormhole-foundation.github.io/wormhole-connect/main.css"/>
```

3. Embed it in your application

This is where your widget will appear. Specify an id of `wormhole-connect` and pass it the stringified json config to customize.

```jsx
// root element with id
<div id="wormhole-connect"></div>
// with customization from JSON config
<div id="wormhole-connect" config={JSON.stringify(jsonConfig)} />
```

### React Applications

For React applications, you must add the script tags after the dom has been rendered:

```ts
class WormholeConnect extends React.Component {
componentDidMount() {
const script = document.createElement("script");
script.src = "https://wormhole-foundation.github.io/wormhole-connect/main.js";
script.async = true;

const link = document.createElement("link");
link.src = "https://wormhole-foundation.github.io/wormhole-connect/main.css";
link.async = true;

document.body.appendChild(script);
document.body.appendChild(link);
}

render() {
return <div id="wormhole-connect"></div>
}
}
```

### Customize theme

See `src/theme.js` for example theme configurations. Edit the values, then import into your configuration:

```ts
import React from 'react';
import config from './wormhole-config.json';
import * as theme from './theme';

class App extends React.Component {
componentDidMount() {...}

render() {
config.customTheme = theme.dark;
return (
<div id="wormhole-connect" config={JSON.stringify(config)}></div>
);
}
}
```
Loading

0 comments on commit aaa9de0

Please sign in to comment.