Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main to nexus #168

Merged
merged 35 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
aa19f7d
Reduce sentry sampling rate
jmrossy May 2, 2024
732de64
Reduce sentry sampling rate
jmrossy May 2, 2024
aa688f5
twitter link from hyperlane_xyz to hyperlane
avious00 May 29, 2024
4916ec6
Warp UI Registry Support (#161)
jmrossy Jun 8, 2024
b2e4d31
fix: Firefox Metamask connection issue (#165)
jmrossy Jun 8, 2024
033f9b3
Fix comment in warp route whitelist example
jmrossy Jun 8, 2024
d16f8a3
Merge branch 'main' into nexus
jmrossy Jun 8, 2024
f742536
Define route whitelist
jmrossy Jun 8, 2024
966becb
Remove unneeded logo images
jmrossy Jun 8, 2024
83da5f9
Fixes for logo images
jmrossy Jun 12, 2024
2528086
Upgrade registry and widgets libs
jmrossy Jun 12, 2024
634659b
Merge branch 'main' into main-to-nexus
jmrossy Jun 12, 2024
25a5158
Support empty warp route whitelists (#175)
jmrossy Jun 13, 2024
ff6d378
Bump braces from 3.0.2 to 3.0.3 (#184)
dependabot[bot] Jun 18, 2024
d68696a
Bump json5 from 1.0.1 to 1.0.2 (#185)
dependabot[bot] Jun 18, 2024
7dddfd1
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#186)
dependabot[bot] Jun 18, 2024
0c529f7
Bump get-func-name from 2.0.0 to 2.0.2 (#187)
dependabot[bot] Jun 18, 2024
59c04d1
Run CI on PRs to ezeth branch (#183)
jmrossy Jun 18, 2024
c04400d
feat: New sidebar wallet button design (#181)
jmrossy Jun 18, 2024
a6d6ed6
Sanctions (#177)
AlexBHarley Jun 19, 2024
f0a87e1
Geoblocking (#176)
AlexBHarley Jun 19, 2024
b8471ae
Fix geoblock middleware (#195)
AlexBHarley Jun 21, 2024
1e1b704
Lockdown image and style sources (#198)
jmrossy Jul 23, 2024
052d2e0
Upgrade Cosmos and Hyperlane libs to latest
jmrossy Aug 2, 2024
2b14afb
Run prettier
jmrossy Aug 2, 2024
e466af8
Merge pull request #205 from hyperlane-xyz/rossy/cosmjs-upgrade
jmrossy Aug 2, 2024
c1f87e0
Merge branch 'main' into main-to-nexus
jmrossy Aug 2, 2024
d61e37f
Create new Injective patch for CosmJs 0.32.4
jmrossy Aug 2, 2024
48bc71e
Fix missing const in celestia 2-hop route config and increase cosmos …
jmrossy Aug 2, 2024
f1d33eb
fix: Balance checking stale values (#206)
jmrossy Aug 4, 2024
c9637f9
Upgrade hyperlane packages to 5.0.0-beta.2 (#207)
jmrossy Aug 4, 2024
b9050ff
Merge branch 'main' into main-to-nexus
jmrossy Aug 4, 2024
b09355a
Merge branch 'nexus' into main-to-nexus
jmrossy Aug 4, 2024
fdd2d00
Run prettier
jmrossy Aug 4, 2024
cd537bb
Increase cosmos gas prices
jmrossy Aug 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: ci
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main, nautilus, nexus, injective]
branches: [main, nautilus, nexus, injective, ezeth]
pull_request:
branches: [main, nautilus, nexus, injective]
branches: [main, nautilus, nexus, injective, ezeth]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/build/cosmwasmclient.js b/build/cosmwasmclient.js
index 8f6305b0263886c5c31fab661c9235723ba1e6e9..a3c7f20135babd6dd7774e4f2ac7e79cb0462db1 100644
index af8341db5333963a258b3476eb60690afca3473f..1fdb3081b454e5a69db7137f870f0f446f2cccf2 100644
--- a/build/cosmwasmclient.js
+++ b/build/cosmwasmclient.js
@@ -10,6 +10,112 @@ const utils_1 = require("@cosmjs/utils");
Expand Down Expand Up @@ -114,9 +114,9 @@ index 8f6305b0263886c5c31fab661c9235723ba1e6e9..a3c7f20135babd6dd7774e4f2ac7e79c
+
class CosmWasmClient {
/**
* Creates an instance by connecting to the given Tendermint RPC endpoint.
@@ -78,9 +184,28 @@ class CosmWasmClient {
const status = await this.forceGetTmClient().status();
* Creates an instance by connecting to the given CometBFT RPC endpoint.
@@ -67,9 +173,28 @@ class CosmWasmClient {
const status = await this.forceGetCometClient().status();
return status.syncInfo.latestBlockHeight;
}
+ decodeInjectiveAccount(injAccount){
Expand All @@ -140,15 +140,15 @@ index 8f6305b0263886c5c31fab661c9235723ba1e6e9..a3c7f20135babd6dd7774e4f2ac7e79c
const account = await this.forceGetQueryClient().auth.account(searchAddress);
+ if (searchAddress.startsWith('inj')) {
+ return this.decodeInjectiveAccount(account);
+ }
+ }
return account ? (0, stargate_1.accountFromAny)(account) : null;
}
catch (error) {
diff --git a/build/signingcosmwasmclient.js b/build/signingcosmwasmclient.js
index 646bbe7e74343ec2584666ead1ae43fd4f0b3852..b9f86948eae6479d85b58e15205f570dda004afc 100644
index 6eb95bb672698df8feba51dc5a06d33bbed616c5..5a9d32f6af5ad44435ac15534501efdc344609d8 100644
--- a/build/signingcosmwasmclient.js
+++ b/build/signingcosmwasmclient.js
@@ -86,6 +86,9 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
@@ -93,6 +93,9 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
throw new Error("Failed to retrieve account from signer");
}
const pubkey = (0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey);
Expand All @@ -158,23 +158,23 @@ index 646bbe7e74343ec2584666ead1ae43fd4f0b3852..b9f86948eae6479d85b58e15205f570d
const { sequence } = await this.getSequence(signerAddress);
const { gasInfo } = await this.forceGetQueryClient().tx.simulate(anyMsgs, memo, pubkey, sequence);
(0, utils_1.assertDefined)(gasInfo);
@@ -110,7 +113,8 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
@@ -116,7 +119,8 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
if ((0, stargate_1.isDeliverTxFailure)(result)) {
throw new Error(createDeliverTxResponseErrorMessage(result));
}
const parsedLogs = stargate_1.logs.parseRawLog(result.rawLog);
- const codeIdAttr = stargate_1.logs.findAttribute(parsedLogs, "store_code", "code_id");
+ const escapedCodeIdAttr = stargate_1.logs.findAttribute(parsedLogs, "cosmwasm.wasm.v1.EventCodeStored", "code_id");
+ const codeIdAttr = { value: escapedCodeIdAttr.value.replace(/\"/g, "") };
- const codeIdAttr = findAttribute(result.events, "store_code", "code_id");
+ const rawCodeIdAttr = findAttribute(result.events, "cosmwasm.wasm.v1.EventCodeStored", "store_code", "code_id");
+ const codeIdAttr = { value: rawCodeIdAttr.value.replace(/\"/g, "") };
return {
checksum: (0, encoding_1.toHex)((0, crypto_1.sha256)(wasmCode)),
originalSize: wasmCode.length,
@@ -393,6 +397,9 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
@@ -397,6 +401,9 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
throw new Error("Failed to retrieve account from signer");
}
const pubkey = (0, proto_signing_1.encodePubkey)((0, amino_1.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
+ if (signerAddress.startsWith('inj')) {
+ pubkey['typeUrl'] = '/injective.crypto.v1beta1.ethsecp256k1.PubKey';
+ }
+ }
const signMode = signing_1.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
const msgs = messages.map((msg) => this.aminoTypes.toAmino(msg));
const signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence);
const signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence, timeoutHeight);
18 changes: 13 additions & 5 deletions CUSTOMIZE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

Find below instructions for customizing the token list and branding assets of this app.

## Token Configs
## Registry

This app requires a token config list to function. The token list is located in `./src/consts/`. Tokens can be configured using any of the token files there (`.ts`, `.json`, `.yaml`). The output token artifacts of a warp route deployment using the [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) can be used here.
By default, the app will use the canonical Hyperlane registry published on NPM. See `package.json` for the precise version.

## Chain Configs
To use custom chains or custom warp routes, you can either configure a different registry using the `NEXT_PUBLIC_REGISTRY_URL` environment variable or define them manually (see the next two sections).

By default, the app will use only the chains that are included in the Hyperlane SDK and connected to the tokens you specify in the token list (see above).
## Custom Warp Route Configs

To add support for additional chains, or to modify the default properties of the SDK's chains (such as RPC URLs), add the required chain metadata to any of the chains files in `./src/consts/` (`.ts`, `.json`, `.yaml`). The same chain configs used in the [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) will work here. You may also add an optional `logoURI` field to a chain config to show a custom logo image in the app.
This app requires a set of warp route configs to function. The configs are located in `./src/consts/warpRoutes.yaml` and `./src/consts/warpRoutes.ts`. The output artifacts of a warp route deployment using the [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) can be used here.

In addition to defining your warp route configs, you can control which routes display in the UI via the `warpRouteWhitelist.ts` file.

## Custom Chain Configs

By default, the app will use only the chains that are included in the configured registry and included in your warp routes.

To add support for additional chains, or to override a chain's properties (such as RPC URLs), add chain metadata to either `./src/consts/chains.ts` or `./src/consts/chains.yaml`. The same chain configs used in the [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) will work here. You may also add an optional `logoURI` field to a chain config to show a custom logo image in the app.

## Tip Card

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repo contains an example web interface for interchain tokens built with [Hy

## Architecture

This app is built with Next+React, Wagmi, RainbowKit, and the Hyperlane SDK.
This app is built with Next & React, Wagmi, RainbowKit, and the Hyperlane SDK.

- Constants that you may want to change are in `./src/consts/`, see the following Customization section for details.
- The index page is located at `./src/pages/index.tsx`
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const isDev = process.env.NODE_ENV !== 'production'
const ENABLE_CSP_HEADER = true;
const FRAME_SRC_HOSTS = ['https://*.walletconnect.com', 'https://*.walletconnect.org','https://*.solflare.com'];
const STYLE_SRC_HOSTS = []
const IMG_SRC_HOSTS = ['https://*.walletconnect.com'];
const IMG_SRC_HOSTS = ['https://*.walletconnect.com', 'https://*.githubusercontent.com'];
const cspHeader = `
default-src 'self';
script-src 'self'${isDev ? " 'unsafe-eval'" : ''};
Expand Down
37 changes: 20 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"name": "@hyperlane-xyz/warp-ui-template",
"description": "A web app template for building Hyperlane Warp Route UIs",
"version": "3.8.1",
"version": "5.0.0",
"author": "J M Rossy",
"dependencies": {
"@chakra-ui/next-js": "^2.1.5",
"@chakra-ui/react": "^2.8.1",
"@cosmjs/cosmwasm-stargate": "patch:@cosmjs/cosmwasm-stargate@npm%3A0.31.3#~/.yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.31.3-4b3bafffd4.patch",
"@cosmjs/stargate": "^0.31.3",
"@cosmos-kit/core": "^2.7.2",
"@cosmos-kit/cosmostation": "^2.4.4",
"@cosmos-kit/keplr": "^2.4.4",
"@cosmos-kit/leap": "^2.4.3",
"@cosmos-kit/react": "^2.5.3",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@chakra-ui/next-js": "^2.2.0",
"@chakra-ui/react": "^2.8.2",
"@cosmjs/cosmwasm-stargate": "patch:@cosmjs/cosmwasm-stargate@npm%3A0.32.4#~/.yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.32.4-f9dd51429c.patch",
"@cosmjs/stargate": "^0.32.4",
"@cosmos-kit/core": "^2.13.1",
"@cosmos-kit/cosmostation": "^2.11.2",
"@cosmos-kit/keplr": "^2.12.2",
"@cosmos-kit/leap": "^2.12.2",
"@cosmos-kit/react": "^2.18.0",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@headlessui/react": "^1.7.14",
"@hyperlane-xyz/sdk": "^3.8.1",
"@hyperlane-xyz/utils": "^3.8.1",
"@hyperlane-xyz/widgets": "^3.8.0",
"@hyperlane-xyz/registry": "2.4.0",
"@hyperlane-xyz/sdk": "5.0.0-beta.2",
"@hyperlane-xyz/utils": "5.0.0-beta.2",
"@hyperlane-xyz/widgets": "5.0.0-beta.2",
"@interchain-ui/react": "^1.23.28",
"@metamask/jazzicon": "https://github.com/jmrossy/jazzicon#7a8df28974b4e81129bfbe3cab76308b889032a6",
"@metamask/post-message-stream": "6.1.2",
"@metamask/providers": "10.2.1",
Expand Down Expand Up @@ -90,14 +92,15 @@
},
"types": "dist/src/index.d.ts",
"resolutions": {
"@cosmjs/cosmwasm-stargate@npm:^0.31.3": "patch:@cosmjs/cosmwasm-stargate@npm%3A0.31.3#~/.yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.31.3-4b3bafffd4.patch",
"axios": "0.27.2",
"bn.js": "^5.2",
"cosmjs-types": "0.9",
"ethers": "^5.7",
"lit-html": "2.8.0",
"react-fast-compare": "^3.2",
"viem": "1.20.0",
"zustand": "^4.4"
"zustand": "^4.4",
"@cosmjs/cosmwasm-stargate@npm:^0.32.3": "patch:@cosmjs/cosmwasm-stargate@npm%3A0.32.4#~/.yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.32.4-f9dd51429c.patch",
"@cosmjs/cosmwasm-stargate@npm:^0.32.4": "patch:@cosmjs/cosmwasm-stargate@npm%3A0.32.4#~/.yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.32.4-f9dd51429c.patch"
}
}
Binary file removed public/logos/ECLIP.png
Binary file not shown.
3 changes: 0 additions & 3 deletions public/logos/ancient8.svg

This file was deleted.

Binary file removed public/logos/celestia.png
Binary file not shown.
Loading
Loading