Skip to content

Commit

Permalink
README and minor theme type updates (#1811)
Browse files Browse the repository at this point in the history
* better type names

* update examples in README

* default to mainnet

* more work on readme, link to docs.wormhole.com

* revert change

* run testnet in local env by default
  • Loading branch information
artursapek committed Mar 22, 2024
1 parent 9294247 commit e912542
Show file tree
Hide file tree
Showing 11 changed files with 513 additions and 454 deletions.
45 changes: 15 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,33 @@
## Contributing

Contributions are welcome! To work on wormhole-connect locally you'll want to use `npm link` to make the changes to the SDK immediately available.
Bug fixes and enhancements are welcome!

*Please don't open pull requests to add tokens to Connect.* Instead, use the `tokensConfig` parameter in `config` to add tokens into your deployment of Connect.

### Setup

1) Install

Run `npm i` at the root of the repo

2) Build

Run `npm run build` at the root fo the repo

3) Start

Start wormhole-connect UI:
```bash
# in /wormhole-connect
npm run start # testnet
```

Start builder UI:
```bash
# in /builder
npm run start
npm i
```

## Add a token

### Fill out token config
2) Build SDK

1. Create an entry for the token in `wormhole-connect/config/<mainnet/testnet>.ts`.
2. Ensure the `key` value is equal to the object key for easy lookup.
3. Add decimal values for default, Ethereum, Solana and Sui if applicable (i.e. if they vary from the default value)
4. If it's a native gas token, ensure that the wrapped version is also present and linked under `wrappedAsset`
```
cd sdk
npm run build
```

### Add a token icon
3) Start demo app with Vite

1. Create a file under `icons/Tokens` labeled `<symbol>.tsx`.
2. Create a React component and paste the svg in the return.
3. Modify the svg to comply with react (mostly this is renaming attribute names with hyphens e.g. `view-box` to `viewBox`)
4. Ensure the width and height attributes are present on the root `<svg>` element and max height and width are set (`style={{ maxHeight: '100%', maxWidth: '100%' }}`)
```
cd ../wormhole-connect
npm run start
```

## Setup
This should start a local server at localhost:5173.

### Pre-commit hooks

Expand Down
Loading

0 comments on commit e912542

Please sign in to comment.