Skip to content

Commit 697d466

Browse files
committed
feat: modify UI to work on testnets
1 parent caf8d23 commit 697d466

File tree

9 files changed

+274
-316
lines changed

9 files changed

+274
-316
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/dist/warp/WarpCore.js b/dist/warp/WarpCore.js
2+
index 7f56a2585b6611771bd803c06d33d5cafcf13d5d..c7634354265aaf47db494e0748bbe9259d57d798 100644
3+
--- a/dist/warp/WarpCore.js
4+
+++ b/dist/warp/WarpCore.js
5+
@@ -59,14 +59,15 @@ export class WarpCore {
6+
* Queries the token router for an interchain gas quote (i.e. IGP fee)
7+
*/
8+
async getInterchainTransferFee({ originToken, destination, }) {
9+
+ const NETWORK_SEPARATOR = '101010';
10+
this.logger.debug(`Fetching interchain transfer quote to ${destination}`);
11+
const { chainName: originName } = originToken;
12+
const destinationName = this.multiProvider.getChainName(destination);
13+
let gasAmount;
14+
let gasAddressOrDenom;
15+
// Check constant quotes first
16+
- const defaultQuote = this.interchainFeeConstants.find((q) => q.origin.split('101010').includes(originName) &&
17+
- q.destination.split('101010').includes(destinationName));
18+
+ const defaultQuote = this.interchainFeeConstants.find((q) => q.origin.split(NETWORK_SEPARATOR).includes(originName) &&
19+
+ q.destination.split(NETWORK_SEPARATOR).includes(destinationName) && q.addressOrDenom === originToken.addressOrDenom);
20+
if (defaultQuote) {
21+
gasAmount = BigInt(defaultQuote.amount.toString());
22+
gasAddressOrDenom = defaultQuote.addressOrDenom;

typescript/ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@ethersproject/providers": "^5.7.2",
2222
"@headlessui/react": "^2.2.0",
2323
"@hyperlane-xyz/registry": "9.7.0",
24-
"@hyperlane-xyz/sdk": "patch:@hyperlane-xyz/sdk@patch%3A@hyperlane-xyz/sdk@patch%253A@hyperlane-xyz/sdk@patch%25253A@hyperlane-xyz/sdk@patch%2525253A@hyperlane-xyz/sdk@patch%252525253A@hyperlane-xyz/sdk@patch%25252525253A@hyperlane-xyz/sdk@patch%2525252525253A@hyperlane-xyz/sdk@patch%252525252525253A@hyperlane-xyz/sdk@npm%25252525252525253A7.2.0%2525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-npm-7.2.0-84fab5b120.patch%252525252525253A%252525252525253Aversion=7.2.0&hash=2c784f%25252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5a90f5762a.patch%2525252525253A%2525252525253Aversion=7.2.0&hash=bf6807%252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-ae53d49afa.patch%25252525253A%25252525253Aversion=7.2.0&hash=eacfdd%2525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-8a403e0bf4.patch%252525253A%252525253Aversion=7.2.0&hash=bfd92e%25252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-0b3fa7b5c8.patch%2525253A%2525253Aversion=7.2.0&hash=7b0eb8%252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-a33395c3b4.patch%25253A%25253Aversion=7.2.0&hash=6593bd%2523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5eff7628e4.patch%253A%253Aversion=7.2.0&hash=a9caab%23~/.yarn/patches/@hyperlane-xyz-sdk-patch-3eff8f1d74.patch%3A%3Aversion=7.2.0&hash=649164#~/.yarn/patches/@hyperlane-xyz-sdk-patch-39ba8bbd9c.patch",
24+
"@hyperlane-xyz/sdk": "patch:@hyperlane-xyz/sdk@patch%3A@hyperlane-xyz/sdk@patch%253A@hyperlane-xyz/sdk@patch%25253A@hyperlane-xyz/sdk@patch%2525253A@hyperlane-xyz/sdk@patch%252525253A@hyperlane-xyz/sdk@patch%25252525253A@hyperlane-xyz/sdk@patch%2525252525253A@hyperlane-xyz/sdk@patch%252525252525253A@hyperlane-xyz/sdk@patch%25252525252525253A@hyperlane-xyz/sdk@npm%2525252525252525253A7.2.0%252525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-npm-7.2.0-84fab5b120.patch%25252525252525253A%25252525252525253Aversion=7.2.0&hash=2c784f%2525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5a90f5762a.patch%252525252525253A%252525252525253Aversion=7.2.0&hash=bf6807%25252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-ae53d49afa.patch%2525252525253A%2525252525253Aversion=7.2.0&hash=eacfdd%252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-8a403e0bf4.patch%25252525253A%25252525253Aversion=7.2.0&hash=bfd92e%2525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-0b3fa7b5c8.patch%252525253A%252525253Aversion=7.2.0&hash=7b0eb8%25252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-a33395c3b4.patch%2525253A%2525253Aversion=7.2.0&hash=6593bd%252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5eff7628e4.patch%25253A%25253Aversion=7.2.0&hash=a9caab%2523~/.yarn/patches/@hyperlane-xyz-sdk-patch-3eff8f1d74.patch%253A%253Aversion=7.2.0&hash=649164%23~/.yarn/patches/@hyperlane-xyz-sdk-patch-39ba8bbd9c.patch%3A%3Aversion=7.2.0&hash=5dc455#~/.yarn/patches/@hyperlane-xyz-sdk-patch-9686ab9901.patch",
2525
"@hyperlane-xyz/utils": "7.2.0",
2626
"@hyperlane-xyz/widgets": "7.2.0",
2727
"@interchain-ui/react": "^1.23.28",
@@ -107,6 +107,6 @@
107107
"react-fast-compare": "^3.2",
108108
"viem": "^2.21.41",
109109
"zustand": "^4.4",
110-
"@hyperlane-xyz/sdk@npm:7.2.0": "patch:@hyperlane-xyz/sdk@patch%3A@hyperlane-xyz/sdk@patch%253A@hyperlane-xyz/sdk@patch%25253A@hyperlane-xyz/sdk@patch%2525253A@hyperlane-xyz/sdk@patch%252525253A@hyperlane-xyz/sdk@patch%25252525253A@hyperlane-xyz/sdk@patch%2525252525253A@hyperlane-xyz/sdk@patch%252525252525253A@hyperlane-xyz/sdk@npm%25252525252525253A7.2.0%2525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-npm-7.2.0-84fab5b120.patch%252525252525253A%252525252525253Aversion=7.2.0&hash=2c784f%25252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5a90f5762a.patch%2525252525253A%2525252525253Aversion=7.2.0&hash=bf6807%252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-ae53d49afa.patch%25252525253A%25252525253Aversion=7.2.0&hash=eacfdd%2525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-8a403e0bf4.patch%252525253A%252525253Aversion=7.2.0&hash=bfd92e%25252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-0b3fa7b5c8.patch%2525253A%2525253Aversion=7.2.0&hash=7b0eb8%252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-a33395c3b4.patch%25253A%25253Aversion=7.2.0&hash=6593bd%2523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5eff7628e4.patch%253A%253Aversion=7.2.0&hash=a9caab%23~/.yarn/patches/@hyperlane-xyz-sdk-patch-3eff8f1d74.patch%3A%3Aversion=7.2.0&hash=649164#~/.yarn/patches/@hyperlane-xyz-sdk-patch-39ba8bbd9c.patch"
110+
"@hyperlane-xyz/sdk@npm:7.2.0": "patch:@hyperlane-xyz/sdk@patch%3A@hyperlane-xyz/sdk@patch%253A@hyperlane-xyz/sdk@patch%25253A@hyperlane-xyz/sdk@patch%2525253A@hyperlane-xyz/sdk@patch%252525253A@hyperlane-xyz/sdk@patch%25252525253A@hyperlane-xyz/sdk@patch%2525252525253A@hyperlane-xyz/sdk@patch%252525252525253A@hyperlane-xyz/sdk@patch%25252525252525253A@hyperlane-xyz/sdk@npm%2525252525252525253A7.2.0%252525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-npm-7.2.0-84fab5b120.patch%25252525252525253A%25252525252525253Aversion=7.2.0&hash=2c784f%2525252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5a90f5762a.patch%252525252525253A%252525252525253Aversion=7.2.0&hash=bf6807%25252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-ae53d49afa.patch%2525252525253A%2525252525253Aversion=7.2.0&hash=eacfdd%252525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-8a403e0bf4.patch%25252525253A%25252525253Aversion=7.2.0&hash=bfd92e%2525252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-0b3fa7b5c8.patch%252525253A%252525253Aversion=7.2.0&hash=7b0eb8%25252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-a33395c3b4.patch%2525253A%2525253Aversion=7.2.0&hash=6593bd%252523~/.yarn/patches/@hyperlane-xyz-sdk-patch-5eff7628e4.patch%25253A%25253Aversion=7.2.0&hash=a9caab%2523~/.yarn/patches/@hyperlane-xyz-sdk-patch-3eff8f1d74.patch%253A%253Aversion=7.2.0&hash=649164%23~/.yarn/patches/@hyperlane-xyz-sdk-patch-39ba8bbd9c.patch%3A%3Aversion=7.2.0&hash=5dc455#~/.yarn/patches/@hyperlane-xyz-sdk-patch-9686ab9901.patch"
111111
}
112112
}

typescript/ui/src/components/tip/TipCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { IconButton, XCircleIcon } from '@hyperlane-xyz/widgets';
22
import { useState } from 'react';
33
import { config } from '../../consts/config';
4-
import { TOP_MAX } from '../../features/transfer/maxAmount';
54
import { WarningBanner } from '../banner/WarningBanner';
65

76
export function TipCard() {
@@ -14,7 +13,7 @@ export function TipCard() {
1413
<h2 className="text-primary-500">Bridge Tokens with Open Intents Framework!</h2>
1514
<div className="flex items-end justify-between">
1615
<p className="mt-1 max-w-[75%] text-xs">
17-
Max supported amount: <strong>{TOP_MAX * 10 ** -6} USDC</strong>.
16+
{/* Max supported amount: <strong>{TOP_MAX * 10 ** -6} USDC</strong>. */}
1817
</p>
1918
{/* <a
2019
href={links.github}

typescript/ui/src/consts/chains.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
import { ChainMap, ChainMetadata } from '@hyperlane-xyz/sdk';
2-
import { ProtocolType } from '@hyperlane-xyz/utils';
32

43
// A map of chain names to ChainMetadata
54
// Chains can be defined here, in chains.json, or in chains.yaml
65
// Chains already in the SDK need not be included here unless you want to override some fields
76
// Schema here: https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts
87
export const chains: ChainMap<ChainMetadata & { mailbox?: Address }> = {
9-
arbitrum: {
10-
name: 'arbitrum',
11-
protocol: ProtocolType.Ethereum,
12-
chainId: 42161,
13-
domainId: 42161,
14-
rpcUrls: [{ http: 'https://arbitrum.drpc.org' }],
15-
},
16-
base: {
17-
name: 'base',
18-
protocol: ProtocolType.Ethereum,
19-
chainId: 8453,
20-
domainId: 8453,
21-
rpcUrls: [{ http: 'https://base.drpc.org' }],
22-
}
238
// solanamainnet: {
249
// ...solanamainnet,
2510
// // SVM chains require mailbox addresses for the token adapters

typescript/ui/src/consts/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const config: Config = Object.freeze({
3434
registryBranch,
3535
registryProxyUrl,
3636
showDisabledTokens: false,
37-
showTipBox: true,
37+
showTipBox: false,
3838
version,
3939
transferBlacklist,
4040
walletConnectProjectId,

0 commit comments

Comments
 (0)