diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fb03cf3..49f5716 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,6 +3,9 @@ on: push: branches: - main + workflow_dispatch: +permissions: + contents: write jobs: build-and-deploy: runs-on: ubuntu-latest diff --git a/src/components/ShowTx.tsx b/src/components/ShowTx.tsx index 6154613..63ac0ee 100644 --- a/src/components/ShowTx.tsx +++ b/src/components/ShowTx.tsx @@ -20,9 +20,12 @@ import { CHAIN_ID_XPLA, CHAIN_ID_APTOS, CHAIN_ID_ARBITRUM, + CHAIN_ID_ARBITRUM_SEPOLIA, CHAIN_ID_INJECTIVE, CHAIN_ID_BASE, + CHAIN_ID_BASE_SEPOLIA, CHAIN_ID_OPTIMISM, + CHAIN_ID_OPTIMISM_SEPOLIA, CHAIN_ID_SEPOLIA, CHAIN_ID_SUI, } from "@certusone/wormhole-sdk"; @@ -133,10 +136,18 @@ export default function ShowTx({ ? `https://${CLUSTER === "testnet" ? "goerli." : ""}basescan.org/tx/${ tx?.id }` + : chainId === CHAIN_ID_BASE_SEPOLIA + ? `https://${CLUSTER === "testnet" ? "sepolia." : ""}basescan.org/tx/${ + tx?.id + }` : chainId === CHAIN_ID_OPTIMISM ? `https://${ CLUSTER === "testnet" ? "goerli-" : "" }optimism.etherscan.io/tx/${tx?.id}` + : chainId === CHAIN_ID_OPTIMISM_SEPOLIA + ? `https://${ + CLUSTER === "testnet" ? "sepolia-" : "" + }optimism.etherscan.io/tx/${tx?.id}` : chainId === CHAIN_ID_XPLA ? `https://explorer.xpla.io/${ CLUSTER === "testnet" ? "testnet/" : "" @@ -145,6 +156,10 @@ export default function ShowTx({ ? `https://${CLUSTER === "testnet" ? "goerli." : ""}arbiscan.io/tx/${ tx?.id }` + : chainId === CHAIN_ID_ARBITRUM_SEPOLIA + ? `https://${CLUSTER === "testnet" ? "sepolia." : ""}arbiscan.io/tx/${ + tx?.id + }` : chainId === CHAIN_ID_APTOS ? `https://explorer.aptoslabs.com/txn/${tx?.id}${ CLUSTER === "testnet" diff --git a/src/components/SmartAddress.tsx b/src/components/SmartAddress.tsx index d28afd6..eeca7e5 100644 --- a/src/components/SmartAddress.tsx +++ b/src/components/SmartAddress.tsx @@ -21,11 +21,14 @@ import { CHAIN_ID_APTOS, isValidAptosType, CHAIN_ID_ARBITRUM, + CHAIN_ID_ARBITRUM_SEPOLIA, CHAIN_ID_INJECTIVE, terra, CHAIN_ID_NEAR, CHAIN_ID_BASE, + CHAIN_ID_BASE_SEPOLIA, CHAIN_ID_OPTIMISM, + CHAIN_ID_OPTIMISM_SEPOLIA, CHAIN_ID_SEPOLIA, CHAIN_ID_SUI, } from "@certusone/wormhole-sdk"; @@ -167,10 +170,18 @@ export default function SmartAddress({ ? `https://${CLUSTER === "testnet" ? "goerli." : ""}basescan.org/${ isAsset ? "token" : "address" }/${useableAddress}` + : chainId === CHAIN_ID_BASE_SEPOLIA + ? `https://${CLUSTER === "testnet" ? "sepolia." : ""}basescan.org/${ + isAsset ? "token" : "address" + }/${useableAddress}` : chainId === CHAIN_ID_OPTIMISM ? `https://${CLUSTER === "testnet" ? "goerli-" : ""}optimism.etherscan.io/${ isAsset ? "token" : "address" }/${useableAddress}` + : chainId === CHAIN_ID_OPTIMISM_SEPOLIA + ? `https://${CLUSTER === "testnet" ? "sepolia-" : ""}optimism.etherscan.io/${ + isAsset ? "token" : "address" + }/${useableAddress}` : chainId === CHAIN_ID_KARURA ? `https://${ CLUSTER === "testnet" @@ -211,6 +222,10 @@ export default function SmartAddress({ ? `https://${CLUSTER === "testnet" ? "goerli." : ""}arbiscan.io/${ isAsset ? "token" : "address" }/${useableAddress}` + : chainId === CHAIN_ID_ARBITRUM_SEPOLIA + ? `https://${CLUSTER === "testnet" ? "sepolia." : ""}arbiscan.io/${ + isAsset ? "token" : "address" + }/${useableAddress}` : chainId === CHAIN_ID_APTOS ? `https://explorer.aptoslabs.com/account/${ isValidAptosType(useableAddress) diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 0d8995d..cc3cf70 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -4,9 +4,11 @@ import { CHAIN_ID_ALGORAND, CHAIN_ID_APTOS, CHAIN_ID_ARBITRUM, + CHAIN_ID_ARBITRUM_SEPOLIA, CHAIN_ID_AURORA, CHAIN_ID_AVAX, CHAIN_ID_BASE, + CHAIN_ID_BASE_SEPOLIA, CHAIN_ID_BSC, CHAIN_ID_CELO, CHAIN_ID_ETH, @@ -19,6 +21,7 @@ import { CHAIN_ID_NEON, CHAIN_ID_OASIS, CHAIN_ID_OPTIMISM, + CHAIN_ID_OPTIMISM_SEPOLIA, CHAIN_ID_POLYGON, CHAIN_ID_SEPOLIA, CHAIN_ID_SOLANA, @@ -99,7 +102,12 @@ export const CHAINS: ChainInfo[] = }, { id: CHAIN_ID_ARBITRUM, - name: "Arbitrum", + name: "Arbitrum Goerli", + logo: arbitrumIcon, + }, + { + id: CHAIN_ID_ARBITRUM_SEPOLIA, + name: "Arbitrum Sepolia", logo: arbitrumIcon, }, { @@ -117,6 +125,11 @@ export const CHAINS: ChainInfo[] = name: "Base Goerli", logo: baseIcon, }, + { + id: CHAIN_ID_BASE_SEPOLIA, + name: "Base Sepolia", + logo: baseIcon, + }, { id: CHAIN_ID_BSC, name: "Binance Smart Chain", @@ -179,12 +192,17 @@ export const CHAINS: ChainInfo[] = }, { id: CHAIN_ID_OPTIMISM, - name: "Optimism (Goerli)", + name: "Optimism Goerli", + logo: optimismIcon, + }, + { + id: CHAIN_ID_OPTIMISM_SEPOLIA, + name: "Optimism Sepolia", logo: optimismIcon, }, { id: CHAIN_ID_POLYGON, - name: "Polygon", + name: "Polygon Mumbai", logo: polygonIcon, }, { @@ -282,9 +300,12 @@ export const CHAINS_WITH_NFT_SUPPORT = CHAINS.filter( id === CHAIN_ID_CELO || id === CHAIN_ID_NEON || id === CHAIN_ID_ARBITRUM || + id === CHAIN_ID_ARBITRUM_SEPOLIA || id === CHAIN_ID_MOONBEAM || id === CHAIN_ID_BASE || - id === CHAIN_ID_OPTIMISM + id === CHAIN_ID_BASE_SEPOLIA || + id === CHAIN_ID_OPTIMISM || + id === CHAIN_ID_OPTIMISM_SEPOLIA ); export type ChainsById = { [key in ChainId]: ChainInfo }; export const CHAINS_BY_ID: ChainsById = CHAINS.reduce((obj, chain) => { @@ -330,13 +351,13 @@ export const getDefaultNativeCurrencySymbol = (chainId: ChainId) => ? "XPLA" : chainId === CHAIN_ID_APTOS ? "APTOS" - : chainId === CHAIN_ID_ARBITRUM + : chainId === CHAIN_ID_ARBITRUM || chainId === CHAIN_ID_ARBITRUM_SEPOLIA ? "ETH" : chainId === CHAIN_ID_MOONBEAM ? "GLMR" - : chainId === CHAIN_ID_BASE + : chainId === CHAIN_ID_BASE || chainId === CHAIN_ID_BASE_SEPOLIA ? "ETH" - : chainId === CHAIN_ID_OPTIMISM + : chainId === CHAIN_ID_OPTIMISM || chainId === CHAIN_ID_OPTIMISM_SEPOLIA ? "ETH" : chainId === CHAIN_ID_SUI ? "SUI" @@ -425,9 +446,12 @@ export const KLAYTN_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 1001 : 1381; export const CELO_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 44787 : 1381; export const NEON_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 245022926 : 1381; export const ARBITRUM_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 421613 : 1381; +export const ARBITRUM_SEPOLIA_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 421614 : 1381; export const MOONBEAM_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 1287 : 1381; export const BASE_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 84531 : 1381; +export const BASE_SEPOLIA_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 84532 : 1381; export const OPTIMISM_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 420 : 1381; +export const OPTIMISM_SEPOLIA_NETWORK_CHAIN_ID = CLUSTER === "testnet" ? 11155420 : 1381; export const getEvmChainId = (chainId: ChainId) => chainId === CHAIN_ID_ETH ? ETH_NETWORK_CHAIN_ID @@ -457,12 +481,18 @@ export const getEvmChainId = (chainId: ChainId) => ? NEON_NETWORK_CHAIN_ID : chainId === CHAIN_ID_ARBITRUM ? ARBITRUM_NETWORK_CHAIN_ID + : chainId === CHAIN_ID_ARBITRUM_SEPOLIA + ? ARBITRUM_SEPOLIA_NETWORK_CHAIN_ID : chainId === CHAIN_ID_MOONBEAM ? MOONBEAM_NETWORK_CHAIN_ID : chainId === CHAIN_ID_BASE ? BASE_NETWORK_CHAIN_ID + : chainId === CHAIN_ID_BASE_SEPOLIA + ? BASE_SEPOLIA_NETWORK_CHAIN_ID : chainId === CHAIN_ID_OPTIMISM ? OPTIMISM_NETWORK_CHAIN_ID + : chainId === CHAIN_ID_OPTIMISM_SEPOLIA + ? OPTIMISM_SEPOLIA_NETWORK_CHAIN_ID : undefined; export const SOLANA_HOST = process.env.REACT_APP_SOLANA_API_URL ? process.env.REACT_APP_SOLANA_API_URL