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

Injective #125

Open
wants to merge 85 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
101a4ae
Update cosmjs injective patch to avoid sdk dep
jmrossy Jan 22, 2024
0fe0ffd
Fixes for patch and logging
jmrossy Jan 23, 2024
b3ea1cb
Merge branch 'main' into injective-testnet
jmrossy Jan 23, 2024
f9736f1
Finish minor refactoring for injective support
jmrossy Jan 24, 2024
cf94b87
Use mainnet configs
jmrossy Jan 25, 2024
70ccaa5
Injective rebrand
jmrossy Jan 26, 2024
28f7008
Set correct app url
jmrossy Jan 26, 2024
269a4f5
Run prettier
jmrossy Jan 26, 2024
f08ea9e
Fixes for footer and title
jmrossy Jan 26, 2024
eeac7c7
Add icons to footer text
jmrossy Jan 26, 2024
5d0446e
Decrease header image size
jmrossy Jan 26, 2024
080ecfd
Define WarpCore spec
jmrossy Jan 28, 2024
a5dfe3e
Handle remote router decimal fetching failures in route traversal
jmrossy Jan 29, 2024
fdfad6f
Minor spec tweaks
jmrossy Jan 29, 2024
fc9f176
Merge branch 'main' into main-to-injective
jmrossy Jan 29, 2024
fe780a6
Merge pull request #128 from hyperlane-xyz/main-to-injective
jmrossy Jan 29, 2024
b588ebe
Remove dead code in footer
jmrossy Jan 29, 2024
d0209ec
Merge branch 'injective' of github.com:hyperlane-xyz/hyperlane-warp-u…
jmrossy Jan 29, 2024
84beee5
Define token config for inEVM
jmrossy Jan 30, 2024
6b67d71
Replace favicon.ico file
jmrossy Feb 1, 2024
bbbc645
Collapse route info into Token class
jmrossy Feb 5, 2024
98621b2
Add USDC and USDT route
jmrossy Feb 7, 2024
b62866d
Update inEVM logo
jmrossy Feb 8, 2024
d2e8ae9
Merge branch 'injective' into injective-usdc
jmrossy Feb 8, 2024
89ec2da
Update injective RPC urls
jmrossy Feb 8, 2024
f580679
Merge branch 'main' into warp-core
jmrossy Feb 9, 2024
0db8a6d
Implement Token and TokenAmount classes
jmrossy Feb 9, 2024
19462b2
Start WarpCore implementation
jmrossy Feb 10, 2024
fde8be7
Switching back to official injective RPCs
jmrossy Feb 12, 2024
ed1ea06
Merge pull request #132 from hyperlane-xyz/injective-usdc
jmrossy Feb 13, 2024
c650553
Implement remaining WarpCore methods
jmrossy Feb 13, 2024
2842a8d
Start replacing internals with WarpCore
jmrossy Feb 20, 2024
b7e6ea3
More progress on WarpCore migration
jmrossy Feb 22, 2024
69a8a03
Finish WarpCore migration
jmrossy Feb 22, 2024
f8220cd
Fixes for balance checking and token selection
jmrossy Feb 22, 2024
90d885e
Use tokenIndex in form values due to circular ref
jmrossy Feb 22, 2024
ac151fd
Updates for new Token connection shape
jmrossy Feb 26, 2024
15a7361
Form bug fixes
jmrossy Feb 26, 2024
7ee046b
Update to 3.8.0-beta0
jmrossy Feb 27, 2024
b686a19
Run prettier
jmrossy Feb 27, 2024
720bc6c
Fix jest CI failure
jmrossy Feb 27, 2024
cba660a
Merge branch 'warp-core' into injective-warp-core
jmrossy Feb 29, 2024
112ecfd
Update configs for injective routes
jmrossy Feb 29, 2024
b378ef5
Merge branch 'injective' into injective-warp-core
jmrossy Feb 29, 2024
6c94f11
Merge branch 'main' into injective-remove-snap
jmrossy Mar 8, 2024
f43aca6
Merge pull request #142 from hyperlane-xyz/injective-remove-snap
jmrossy Mar 8, 2024
c92c547
Tweak sentry filters
jmrossy Mar 9, 2024
20cf8f7
Merge branch 'main' into injective-warp-core
jmrossy Mar 13, 2024
da40e09
Set const local fee
jmrossy Mar 13, 2024
2db7bcb
Merge branch 'injective' into injective-warp-core
jmrossy Mar 13, 2024
6d0bfe7
Merge pull request #138 from hyperlane-xyz/injective-warp-core
jmrossy Mar 13, 2024
64759cb
Merge branch 'main' into injective-msg-id
jmrossy Mar 15, 2024
38c8d56
Merge pull request #145 from hyperlane-xyz/injective-msg-id
jmrossy Mar 15, 2024
e4b4bdc
Merge branch 'main' into injective
jmrossy Mar 26, 2024
98c794a
Merge branch 'main' into injective
jmrossy Apr 1, 2024
73d0792
Reduce sentry sampling rate
jmrossy May 2, 2024
f0b4c55
twitter link from hyperlane_xyz to hyperlane
avious00 May 29, 2024
38e62f4
Merge branch 'main' into main-to-injective
jmrossy Jun 8, 2024
536037d
Configure route whitelist
jmrossy Jun 8, 2024
838fc53
Fix route whitelist IDs
jmrossy Jun 8, 2024
33b5314
Disable ledger like we do for nexus
jmrossy Jun 8, 2024
61f780d
Merge branch 'main' into main-to-injective
jmrossy Jun 12, 2024
b538de8
Lockdown image and style sources (#198)
jmrossy Jul 23, 2024
3df0d8f
fix: Firefox Metamask connection issue (#165)
jmrossy Jun 8, 2024
f4daa73
Resolve yarn.lock conflicts
jmrossy Jul 23, 2024
9e97da8
Merge pull request #200 from hyperlane-xyz/injective-image-patch
jmrossy Jul 23, 2024
76945d4
Merge remote-tracking branch 'origin/rossy/cosmjs-upgrade' into main-…
jmrossy Aug 2, 2024
61858bc
Create new Injective patch for CosmJs 0.32.4
jmrossy Aug 2, 2024
2840b29
Merge branch 'main' into main-to-injective
jmrossy Aug 2, 2024
a3c0ea8
Merge branch 'main' into main-to-injective
jmrossy Aug 4, 2024
6ef9db6
Merge branch 'injective' into main-to-injective
jmrossy Aug 4, 2024
d94baba
Run prettier
jmrossy Aug 4, 2024
ef7ed68
Merge pull request #166 from hyperlane-xyz/main-to-injective
jmrossy Aug 5, 2024
ec68592
Merge branch 'main' of https://github.com/hyperlane-xyz/hyperlane-war…
ltyu Aug 22, 2024
246a171
Merge pull request #219 from hyperlane-xyz/ltyu/main-to-injective
ltyu Aug 23, 2024
cf85685
Merge branch 'main' into main-to-injective
jmrossy Sep 18, 2024
fb44aff
Merge branch 'main' into main-to-injective
jmrossy Sep 18, 2024
0f121fa
Merge branch 'main' into main-to-injective
jmrossy Sep 18, 2024
99afc8f
Merge branch 'main' into main-to-injective
jmrossy Sep 18, 2024
d6d632b
Merge pull request #243 from hyperlane-xyz/main-to-injective
cmcewen Sep 18, 2024
4a6d710
Merge branch 'main' into main-to-injective
jmrossy Sep 20, 2024
5b985e5
Merge pull request #263 from hyperlane-xyz/main-to-injective
jmrossy Sep 20, 2024
848f1ee
Merge branch 'main' into main-to-injective
jmrossy Sep 26, 2024
2e3d467
Merge branch 'main' into main-to-injective
jmrossy Sep 27, 2024
728c485
Merge pull request #272 from hyperlane-xyz/main-to-injective
jmrossy Sep 27, 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
180 changes: 180 additions & 0 deletions .yarn/patches/@cosmjs-cosmwasm-stargate-npm-0.32.4-f9dd51429c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
diff --git a/build/cosmwasmclient.js b/build/cosmwasmclient.js
index af8341db5333963a258b3476eb60690afca3473f..1fdb3081b454e5a69db7137f870f0f446f2cccf2 100644
--- a/build/cosmwasmclient.js
+++ b/build/cosmwasmclient.js
@@ -10,6 +10,112 @@ const utils_1 = require("@cosmjs/utils");
const abci_1 = require("cosmjs-types/cosmos/base/abci/v1beta1/abci");
const types_1 = require("cosmjs-types/cosmwasm/wasm/v1/types");
const modules_1 = require("./modules");
+
+/* Code copied in from injective SDK to avoid importing all 9Mb of the library */
+// node_modules/@injectivelabs/core-proto-ts/cjs/google/protobuf/any.js
+const minimal_1 = require("protobufjs/minimal");
+const Any = {
+ decode(input, length) {
+ const reader = input instanceof minimal_1.Reader ? input : minimal_1.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = { typeUrl: "", value: new Uint8Array(0) };
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+ message.typeUrl = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+ message.value = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+ };
+ // node_modules/@injectivelabs/core-proto-ts/cjs/cosmos/auth/v1beta1/auth.js
+const BaseAccount = {
+ decode(input, length) {
+ const reader = input instanceof minimal_1.Reader ? input : minimal_1.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = { address: "", pubKey: undefined, accountNumber: "0", sequence: "0" };
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+ message.address = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+ message.pubKey = Any.decode(reader, reader.uint32());
+ continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+ message.accountNumber = reader.uint64().toString();
+ continue;
+ case 4:
+ if (tag !== 32) {
+ break;
+ }
+ message.sequence = reader.uint64().toString();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+};
+// node_modules/@injectivelabs/core-proto-ts/cjs/injective/types/v1beta1/account.js
+const EthAccount = {
+ decode(input, length) {
+ const reader = input instanceof minimal_1.Reader ? input : minimal_1.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = { baseAccount: undefined, codeHash: new Uint8Array(0) };
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+ message.baseAccount = BaseAccount.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+ message.codeHash = reader.bytes();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+};
+
class CosmWasmClient {
/**
* 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){
+ const account = EthAccount.decode(injAccount.value);
+ const baseAccount = account.baseAccount;
+ const pubKey = baseAccount.pubKey;
+ return {
+ address: baseAccount.address,
+ pubkey: pubKey
+ ? {
+ type: '/injective.crypto.v1beta1.ethsecp256k1.PubKey',
+ value: Buffer.from(pubKey.value).toString('base64'),
+ }
+ : null,
+ accountNumber: parseInt(baseAccount.accountNumber, 10),
+ sequence: parseInt(baseAccount.sequence, 10),
+ };
+ }
async getAccount(searchAddress) {
try {
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 6eb95bb672698df8feba51dc5a06d33bbed616c5..5a9d32f6af5ad44435ac15534501efdc344609d8 100644
--- a/build/signingcosmwasmclient.js
+++ b/build/signingcosmwasmclient.js
@@ -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);
+ if (signerAddress.startsWith('inj')) {
+ pubkey['typeUrl'] = '/injective.crypto.v1beta1.ethsecp256k1.PubKey';
+ }
const { sequence } = await this.getSequence(signerAddress);
const { gasInfo } = await this.forceGetQueryClient().tx.simulate(anyMsgs, memo, pubkey, sequence);
(0, utils_1.assertDefined)(gasInfo);
@@ -116,7 +119,8 @@ class SigningCosmWasmClient extends cosmwasmclient_1.CosmWasmClient {
if ((0, stargate_1.isDeliverTxFailure)(result)) {
throw new Error(createDeliverTxResponseErrorMessage(result));
}
- 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,
@@ -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, timeoutHeight);
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@chakra-ui/next-js": "^2.2.0",
"@chakra-ui/react": "^2.8.2",
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@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",
Expand Down Expand Up @@ -101,6 +101,8 @@
"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 modified public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bg-home.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logos/caldera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/inevm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/injective.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/usdc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/logos/usdt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-310x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 42 additions & 13 deletions public/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/components/buttons/ConnectAwareSubmitButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function ConnectAwareSubmitButton<FormValues = any>({ chainName, text, cl
const hasError = Object.keys(touched).length > 0 && Object.keys(errors).length > 0;
const firstError = `${Object.values(errors)[0]}` || 'Unknown error';

const color = hasError ? 'red' : 'accent';
const color = hasError ? 'red' : 'primary';
const content = hasError ? firstError : isAccountReady ? text : 'Connect wallet';
const type = isAccountReady ? 'submit' : 'button';
const onClick = isAccountReady ? undefined : connectFn;
Expand Down
Loading
Loading