Skip to content

Commit

Permalink
feat: Add NEXT_PUBLIC_REGISTRY_BRANCH (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
frank0528 authored Nov 29, 2024
1 parent 11af60a commit 4868292
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/consts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ADDRESS_BLACKLIST } from './blacklist';
const isDevMode = process?.env?.NODE_ENV === 'development';
const version = process?.env?.NEXT_PUBLIC_VERSION || '0.0.0';
const registryUrl = process?.env?.NEXT_PUBLIC_REGISTRY_URL || undefined;
const registryBranch = process?.env?.NEXT_PUBLIC_REGISTRY_BRANCH || undefined;
const registryProxyUrl = process?.env?.NEXT_PUBLIC_GITHUB_PROXY || 'https://proxy.hyperlane.xyz';
const explorerApiKeys = JSON.parse(process?.env?.EXPLORER_API_KEYS || '{}');
const walletConnectProjectId = process?.env?.NEXT_PUBLIC_WALLET_CONNECT_ID || '';
Expand All @@ -18,6 +19,7 @@ interface Config {
explorerApiKeys: Record<string, string>; // Optional map of API keys for block explorer
isDevMode: boolean; // Enables some debug features in the app
registryUrl: string | undefined; // Optional URL to use a custom registry instead of the published canonical version
registryBranch?: string | undefined; // Optional customization of the registry branch instead of main
registryProxyUrl?: string; // Optional URL to use a custom proxy for the GithubRegistry
showDisabledTokens: boolean; // Show/Hide invalid token options in the selection modal
showTipBox: boolean; // Show/Hide the blue tip box above the transfer form
Expand All @@ -34,6 +36,7 @@ export const config: Config = Object.freeze({
explorerApiKeys,
isDevMode,
registryUrl,
registryBranch,
registryProxyUrl,
showDisabledTokens: false,
showTipBox: true,
Expand Down
6 changes: 5 additions & 1 deletion src/features/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export const useStore = create<AppState>()(
set({ chainMetadataOverrides: filtered, multiProvider });
},
multiProvider: new MultiProtocolProvider({}),
registry: new GithubRegistry({ uri: config.registryUrl, proxyUrl: config.registryProxyUrl }),
registry: new GithubRegistry({
uri: config.registryUrl,
branch: config.registryBranch,
proxyUrl: config.registryProxyUrl,
}),
warpCore: new WarpCore(new MultiProtocolProvider({}), []),
setWarpContext: ({ registry, chainMetadata, multiProvider, warpCore }) => {
logger.debug('Setting warp context in store');
Expand Down

0 comments on commit 4868292

Please sign in to comment.