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

[demo] SOL/solanatestnet-sonicsvmtestnet #365

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@headlessui/react": "^2.2.0",
"@hyperlane-xyz/registry": "6.1.0",
"@hyperlane-xyz/sdk": "7.1.0",
"@hyperlane-xyz/utils": "7.1.0",
"@hyperlane-xyz/widgets": "7.1.0",
"@hyperlane-xyz/registry": "6.10.0",
"@hyperlane-xyz/sdk": "8.0.0-beta.0",
"@hyperlane-xyz/utils": "8.0.0-beta.0",
"@hyperlane-xyz/widgets": "8.0.0-beta.0",
"@interchain-ui/react": "^1.23.28",
"@metamask/post-message-stream": "6.1.2",
"@metamask/providers": "10.2.1",
Expand Down
1 change: 1 addition & 0 deletions public/sonicsvmtestnet-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 46 additions & 1 deletion src/consts/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {
eclipsemainnetAddresses,
solanamainnet,
solanamainnetAddresses,
solanatestnet,
} from '@hyperlane-xyz/registry';
import { ChainMap, ChainMetadata } from '@hyperlane-xyz/sdk';
import { ChainMap, ChainMetadata, ExplorerFamily } from '@hyperlane-xyz/sdk';
import { ProtocolType } from '@hyperlane-xyz/utils';

// A map of chain names to ChainMetadata
// Chains can be defined here, in chains.json, or in chains.yaml
Expand All @@ -24,6 +26,49 @@ export const chains: ChainMap<ChainMetadata & { mailbox?: Address }> = {
...eclipsemainnet,
mailbox: eclipsemainnetAddresses.mailbox,
},
solanatestnet: {
...solanatestnet,
displayNameShort: 'Solana Testnet',
mailbox: '75HBBLae3ddeneJVrZeyrDfv6vb7SMC3aCpBucSXS5aR',
},
sonicsvmtestnet: {
blockExplorers: [
{
apiUrl: 'https://explorer.sonic.game/?cluster=testnet.v1',
family: ExplorerFamily.Other,
name: 'Sonic Explorer',
url: 'https://explorer.sonic.game/?cluster=testnet.v1',
},
],
blocks: {
confirmations: 1,
estimateBlockTime: 0.4,
reorgPeriod: 0,
},
chainId: 15153042,
deployer: {
name: 'Abacus Works',
url: 'https://www.hyperlane.xyz',
},
displayName: 'Sonic SVM Testnet',
displayNameShort: 'Sonic SVM Testnet',
domainId: 15153042,
isTestnet: true,
name: 'sonicsvmtestnet',
nativeToken: {
decimals: 9,
name: 'Solana',
symbol: 'SOL',
},
protocol: ProtocolType.Sealevel,
rpcUrls: [
{
http: 'https://api.testnet.sonic.game',
},
],
logoURI: '/sonicsvmtestnet-logo.svg',
mailbox: '6BaTtWPMpWdA6tHqdT2VbogC4XZ9QV5cNCYpBrx6WP7B',
},
// mycustomchain: {
// protocol: ProtocolType.Ethereum,
// chainId: 123123,
Expand Down
2 changes: 1 addition & 1 deletion src/consts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const config: Config = Object.freeze({
registryBranch,
registryProxyUrl,
showDisabledTokens: false,
showTipBox: true,
showTipBox: false,
version,
transferBlacklist,
walletConnectProjectId,
Expand Down
2 changes: 1 addition & 1 deletion src/consts/warpRouteWhitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Warp Route IDs use format `SYMBOL/chainname1-chainname2...` where chains are ordered alphabetically
// If left null, all warp routes in the configured registry will be included
// If set to a list (including an empty list), only the specified routes will be included
export const warpRouteWhitelist: Array<string> | null = null;
export const warpRouteWhitelist: Array<string> | null = ['SOL/solanatestnet-sonicsvmtestnet'];
// Example:
// [
// // 'ETH/ethereum-viction'
Expand Down
21 changes: 20 additions & 1 deletion src/consts/warpRoutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,24 @@
# These configs will be merged with the warp routes in the configured registry
# The input here is typically the output of the Hyperlane CLI warp deploy command
---
tokens: []
tokens:
- addressOrDenom: EQDvULvwhZwK349y6Qt2ouAyDhBbHZoaUG8guWcqYdxZ
chainName: sonicsvmtestnet
connections:
- token: sealevel|solanatestnet|J2gbyytzDqQozPh1xgm38NchdDPNnvGKrSff47rnVsFh
decimals: 9
logoURI: /deployments/warp_routes/SOL/logo.svg
name: Solana
standard: SealevelHypNative
symbol: SOL
- addressOrDenom: J2gbyytzDqQozPh1xgm38NchdDPNnvGKrSff47rnVsFh
chainName: solanatestnet
coinGeckoId: solana
connections:
- token: sealevel|sonicsvmtestnet|EQDvULvwhZwK349y6Qt2ouAyDhBbHZoaUG8guWcqYdxZ
decimals: 9
logoURI: /deployments/warp_routes/SOL/logo.svg
name: Solana
standard: SealevelHypNative
symbol: SOL
options: {}
9 changes: 7 additions & 2 deletions src/features/wallet/context/EvmWalletContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MultiProtocolProvider } from '@hyperlane-xyz/sdk';
import { ethereum } from '@hyperlane-xyz/registry';
import { MultiProtocolProvider, chainMetadataToViemChain } from '@hyperlane-xyz/sdk';
import { ProtocolType } from '@hyperlane-xyz/utils';
import { getWagmiChainConfigs } from '@hyperlane-xyz/widgets';
import { RainbowKitProvider, connectorsForWallets, lightTheme } from '@rainbow-me/rainbowkit';
Expand All @@ -23,7 +24,11 @@ import { useMultiProvider } from '../../chains/hooks';
import { useWarpCore } from '../../tokens/hooks';

function initWagmi(multiProvider: MultiProtocolProvider) {
const chains = getWagmiChainConfigs(multiProvider);
let chains = getWagmiChainConfigs(multiProvider);

if (!chains.length) {
chains = [chainMetadataToViemChain(ethereum)];
}

const connectors = connectorsForWallets(
[
Expand Down
Loading
Loading