Skip to content

Commit

Permalink
Merging v1 into feature to allow automatic rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpoyatt authored and Inkvi committed Mar 28, 2024
1 parent 8089f1a commit 9facfeb
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
29 changes: 19 additions & 10 deletions app/utils/chains/configs.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { Chain } from 'utils/types/chain';
import { OptimismIcon, BaseIcon } from './icons';
import { OptimismIcon, BaseIcon, MoltenIcon } from './icons';

export type CHAIN = 'optimism' | 'base';
export type CHAIN = 'optimism' | 'base' | 'molten';

let opDispatcher = process.env.DISPATCHER_ADDRESS_OPTIMISM!;
let baseDispatcher = process.env.DISPATCHER_ADDRESS_BASE!;
let opDispatcherSimClient = process.env.DISPATCHER_ADDRESS_OPTIMISM_SIMCLIENT!;
let baseDispatcher = process.env.DISPATCHER_ADDRESS_BASE!;
let baseDispatcherSimClient = process.env.DISPATCHER_ADDRESS_BASE_SIMCLIENT!;

let moltenDispatcher = process.env.DISPATCHER_ADDRESS_MOLTEN!;
let moltenDispatcherSimClient = process.env.DISPATCHER_ADDRESS_MOLTEN_SIMCLIENT!;

let opClientName = process.env.OPTIMISM_CLIENT_NAME!;
let baseClientName = process.env.BASE_CLIENT_NAME!;
let moltenClientName = process.env.MOLTEN_CLIENT_NAME!;
let opClientSimClientName = process.env.OPTIMISM_CLIENT_SIMCLIENT_NAME!;
let baseClientSimClientName = process.env.BASE_CLIENT_SIMCLIENT_NAME!;
let moltenClientSimClientName = process.env.MOLTEN_CLIENT_SIMCLIENT_NAME!;

let optimismRPC =
process.env.OPTIMISM_RPC ||
'https://opt-sepolia.g.alchemy.com/v2/iMhzwCPw18v9Byeh59cedtUKbul_jFF3'; // "https://opt-sepolia.g.alchemy.com/v2/jKvLhhXvtnWdNeZrKst0demxnwJcYH1o"
let baseRPC =
process.env.BASE_RPC ||
'https://base-sepolia.g.alchemy.com/v2/ivsMbH2_FVzYzYrDY5-eaWenWl2Bo_QK'; // "https://base-sepolia.g.alchemy.com/v2/776dC6qT-NTtupdnxlUJuXGbUIKWWhLe"
let optimismRPC = process.env.OPTIMISM_RPC || 'https://opt-sepolia.g.alchemy.com/v2/jKvLhhXvtnWdNeZrKst0demxnwJcYH1o';
let baseRPC = process.env.BASE_RPC || 'https://base-sepolia.g.alchemy.com/v2/776dC6qT-NTtupdnxlUJuXGbUIKWWhLe';
let moltenRPC = process.env.MOLTEN_RPC || 'https://unidex-sepolia.rpc.caldera.xyz/http';

export const CHAIN_CONFIGS: {
[key in CHAIN]: Chain;
Expand All @@ -42,4 +42,13 @@ export const CHAIN_CONFIGS: {
blockTime: 2,
icon: BaseIcon,
},
molten: {
id: 49483,
display: 'Molten',
rpc: moltenRPC,
dispatchers: [moltenDispatcher, moltenDispatcherSimClient],
clients: [moltenClientName, moltenClientSimClientName],
blockTime: 2,
icon: MoltenIcon,
},
};
21 changes: 17 additions & 4 deletions app/utils/chains/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
import React from 'react';
import Image from 'next/image';
import molten from './pngs/molten-logo.png';

export const OptimismIcon = (size: number): JSX.Element => {
export const OptimismIcon = (size?: number): JSX.Element => {
return (
<svg className="mr-1.5" width={size} height={size} viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg className="mr-1.5" width={size || 32} height={size || 32} viewBox="0 0 50 50" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M17.814 32.19C17.016 32.19 16.275 32.0823 15.591 31.867C14.907 31.6517 14.3307 31.3287 13.862 30.898C13.3933 30.4673 13.0577 29.929 12.855 29.283C12.665 28.637 12.6397 27.8833 12.779 27.022C12.8803 26.4773 12.988 25.9327 13.102 25.388C13.2287 24.8433 13.3553 24.2923 13.482 23.735C13.9 22.025 14.6537 20.7267 15.743 19.84C16.8323 18.9533 18.3017 18.51 20.151 18.51C20.949 18.51 21.6837 18.624 22.355 18.852C23.039 19.0673 23.6153 19.3967 24.084 19.84C24.5653 20.2833 24.901 20.828 25.091 21.474C25.2937 22.12 25.319 22.8737 25.167 23.735C25.0783 24.2923 24.9707 24.8433 24.844 25.388C24.73 25.9327 24.6097 26.4773 24.483 27.022C24.0523 28.7573 23.2923 30.0557 22.203 30.917C21.1137 31.7657 19.6507 32.19 17.814 32.19ZM18.061 29.454C18.745 29.454 19.3467 29.2513 19.866 28.846C20.3853 28.4407 20.7527 27.7947 20.968 26.908C21.1073 26.3507 21.2277 25.825 21.329 25.331C21.443 24.837 21.5443 24.324 21.633 23.792C21.7977 22.9053 21.7217 22.2593 21.405 21.854C21.0883 21.4487 20.588 21.246 19.904 21.246C19.22 21.246 18.6183 21.4487 18.099 21.854C17.5923 22.2593 17.2313 22.9053 17.016 23.792C16.8767 24.324 16.75 24.837 16.636 25.331C16.5347 25.825 16.4333 26.3507 16.332 26.908C16.18 27.7947 16.256 28.4407 16.56 28.846C16.864 29.2513 17.3643 29.454 18.061 29.454ZM25.9444 32C25.8177 32 25.7164 31.9557 25.6404 31.867C25.5644 31.7783 25.539 31.6643 25.5644 31.525L28.1864 19.175C28.2117 19.0357 28.2814 18.9217 28.3954 18.833C28.5094 18.7443 28.6297 18.7 28.7564 18.7H33.8104C34.583 18.7 35.2797 18.7887 35.9004 18.966C36.5337 19.1433 37.0594 19.4157 37.4774 19.783C37.8954 20.1503 38.1867 20.6127 38.3514 21.17C38.516 21.7147 38.5224 22.3543 38.3704 23.089C38.0537 24.5457 37.4077 25.6223 36.4324 26.319C35.4697 27.0157 34.1714 27.364 32.5374 27.364H29.9724L29.0984 31.525C29.073 31.6643 29.0034 31.7783 28.8894 31.867C28.788 31.9557 28.6677 32 28.5284 32H25.9444ZM30.4664 24.742H32.6514C33.1707 24.742 33.633 24.6027 34.0384 24.324C34.4564 24.0453 34.7287 23.621 34.8554 23.051C34.9187 22.7217 34.9314 22.4303 34.8934 22.177C34.8554 21.9237 34.7224 21.721 34.4944 21.569C34.279 21.417 33.9434 21.341 33.4874 21.341H31.2074L30.4664 24.742Z" fill="#FF0420"/>
<path fillRule="evenodd" clipRule="evenodd" d="M25 50C38.8071 50 50 38.8071 50 25C50 11.1929 38.8071 0 25 0C11.1929 0 0 11.1929 0 25C0 38.8071 11.1929 50 25 50ZM15.591 31.867C16.275 32.0823 17.016 32.19 17.814 32.19C19.6507 32.19 21.1137 31.7657 22.203 30.917C23.2923 30.0557 24.0523 28.7573 24.483 27.022C24.6097 26.4773 24.73 25.9327 24.844 25.388C24.9707 24.8433 25.0783 24.2923 25.167 23.735C25.319 22.8737 25.2937 22.12 25.091 21.474C24.901 20.828 24.5653 20.2833 24.084 19.84C23.6153 19.3967 23.039 19.0673 22.355 18.852C21.6837 18.624 20.949 18.51 20.151 18.51C18.3017 18.51 16.8323 18.9533 15.743 19.84C14.6537 20.7267 13.9 22.025 13.482 23.735C13.3553 24.2923 13.2287 24.8433 13.102 25.388C12.988 25.9327 12.8803 26.4773 12.779 27.022C12.6397 27.8833 12.665 28.637 12.855 29.283C13.0577 29.929 13.3933 30.4673 13.862 30.898C14.3307 31.3287 14.907 31.6517 15.591 31.867ZM19.866 28.846C19.3467 29.2513 18.745 29.454 18.061 29.454C17.3643 29.454 16.864 29.2513 16.56 28.846C16.256 28.4407 16.18 27.7947 16.332 26.908C16.4333 26.3507 16.5347 25.825 16.636 25.331C16.75 24.837 16.8767 24.324 17.016 23.792C17.2313 22.9053 17.5923 22.2593 18.099 21.854C18.6183 21.4487 19.22 21.246 19.904 21.246C20.588 21.246 21.0883 21.4487 21.405 21.854C21.7217 22.2593 21.7977 22.9053 21.633 23.792C21.5443 24.324 21.443 24.837 21.329 25.331C21.2277 25.825 21.1073 26.3507 20.968 26.908C20.7527 27.7947 20.3853 28.4407 19.866 28.846ZM25.6404 31.867C25.7164 31.9557 25.8177 32 25.9444 32H28.5284C28.6677 32 28.788 31.9557 28.8894 31.867C29.0034 31.7783 29.073 31.6643 29.0984 31.525L29.9724 27.364H32.5374C34.1714 27.364 35.4697 27.0157 36.4324 26.319C37.4077 25.6223 38.0537 24.5457 38.3704 23.089C38.5224 22.3543 38.516 21.7147 38.3514 21.17C38.1867 20.6127 37.8954 20.1503 37.4774 19.783C37.0594 19.4157 36.5337 19.1433 35.9004 18.966C35.2797 18.7887 34.583 18.7 33.8104 18.7H28.7564C28.6297 18.7 28.5094 18.7443 28.3954 18.833C28.2814 18.9217 28.2117 19.0357 28.1864 19.175L25.5644 31.525C25.539 31.6643 25.5644 31.7783 25.6404 31.867ZM32.6514 24.742H30.4664L31.2074 21.341H33.4874C33.9434 21.341 34.279 21.417 34.4944 21.569C34.7224 21.721 34.8554 21.9237 34.8934 22.177C34.9314 22.4303 34.9187 22.7217 34.8554 23.051C34.7287 23.621 34.4564 24.0453 34.0384 24.324C33.633 24.6027 33.1707 24.742 32.6514 24.742Z" fill="white"/>
</svg>
);
};

export const BaseIcon = (size: number): JSX.Element => {
export const BaseIcon = (size?: number): JSX.Element => {
return (
<svg className="mr-1.5" width={size} height={size} viewBox="0 0 111 111" fill="none" xmlns="http://www.w3.org/2000/svg">
<svg className="mr-1.5" width={size || 32} height={size || 32} viewBox="0 0 111 111" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M54.921 110.034C85.359 110.034 110.034 85.402 110.034 55.017C110.034 24.6319 85.359 0 54.921 0C26.0432 0 2.35281 22.1714 0 50.3923H72.8467V59.6416H3.9565e-07C2.35281 87.8625 26.0432 110.034 54.921 110.034Z"
fill="#0052FF"/>
</svg>
);
};

export const MoltenIcon = (size?: number): JSX.Element => {
size = size || 32;
return (
<Image
src={molten}
style={{width: `${size}px`, height: `${size}px`}}
alt='Molten Icon'
/>
);
};
Binary file added app/utils/chains/pngs/molten-logo.png
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 app/utils/types/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export interface Chain {
dispatchers: string[];
clients: string[];
blockTime: number;
icon: () => JSX.Element;
icon: (size?: number) => JSX.Element;
}

0 comments on commit 9facfeb

Please sign in to comment.