Skip to content

Commit

Permalink
Merge pull request #168 from hyperlane-xyz/main-to-nexus
Browse files Browse the repository at this point in the history
Main to nexus
  • Loading branch information
jmrossy authored Aug 5, 2024
2 parents 2067fda + cd537bb commit 5c1b4a0
Show file tree
Hide file tree
Showing 60 changed files with 7,290 additions and 1,702 deletions.
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

0 comments on commit 5c1b4a0

Please sign in to comment.