Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecot committed Jan 30, 2025
1 parent d4c3990 commit 43e5132
Show file tree
Hide file tree
Showing 10 changed files with 992 additions and 233 deletions.
4 changes: 2 additions & 2 deletions PUBLICAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ This endpoint returns a list of all providers along with their APR, commission r
// [same as on the rewards website](https://rewards.lavanet.xyz/provider_rewards)
// but return spec to
{
"chain": "lava mainnet",
"chain": "Lava Mainnet",
"spec": "LAVA",
"tokens": [
{
Expand All @@ -196,7 +196,7 @@ This endpoint returns a list of all providers along with their APR, commission r
"delegateCommission": "50", // Delegation commission
"delegateTotal": "94912424429", // Total delegations
"moniker": "Protofire DAO" // Provider name for this spec
"icon": <easy>
"icon": "url" ...
},
{
"chain": "fvm mainnet",
Expand Down
112 changes: 112 additions & 0 deletions src/lib/chain-mapping/chains.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
const chainMapping: Record<string, string> = {
ETH1: "Ethereum Mainnet",
EVMOS: "Evmos Mainnet",
NEAR: "NEAR Mainnet",
NEART: "NEAR Testnet",
EVMOST: "Evmos Testnet",
ARB1: "Arbitrum Mainnet",
POLYGON: "Polygon Mainnet",
POLYGON1: "Polygon Mainnet",
CELO: "Celo Mainnet",
STRK: "Starknet Mainnet",
STRKS: "Starknet Sepolia Testnet",
LAVA: "Lava Mainnet",
AVAX: "Avalanche Mainnet",
AVAXT: "Avalanche Testnet",
OSMOSIS: "Osmosis Mainnet",
OSMOSIST: "Osmosis Testnet",
SUIT: "Sui Devnet",
FUELNETWORK: "Fuel Network GraphQL",
COSMOSSDK45DEP: "Cosmos SDK Deprecated APIs",
SOLANA: "Solana Mainnet",
SOLANAT: "Solana Testnet",
SCROLL: "Scroll Mainnet",
SCROLLS: "Scroll Sepolia Testnet",
TENDERMINT: "Tendermint",
CANTO: "Canto Mainnet",
COSMOSHUB: "Cosmos Hub Mainnet",
COSMOSHUBT: "Cosmos Hub Testnet",
COSMOSWASM: "CosmWasm",
FVM: "Filecoin Mainnet",
FTM250: "Fantom Mainnet",
FTM4002: "Fantom Testnet",
SQDSUBGRAPH: "Subsquid Powered Subgraph",
BERAT: "Berachain Testnet",
MOVEMENT: "Movement Mainnet",
MANTAPACIFIC: "Manta Pacific Mainnet",
MANTAPACIFICT: "Manta Pacific Testnet",
SEP1: "Ethereum Sepolia Testnet",
HOL1: "Ethereum Holesky Testnet",
JUN1: "Juno Mainnet",
JUNT1: "Juno Testnet",
BSC: "Binance Smart Chain Mainnet",
BSCT: "Binance Smart Chain Testnet",
COSMOSSDKFULL: "Cosmos SDK Full",
IBC: "Inter-Blockchain Communication",
SIDET: "Side Testnet",
MORALIS: "Moralis Advanced API",
CELESTIA: "Celestia Mainnet",
CELESTIATM: "Celestia Mocha Testnet",
CELESTIATA: "Celestia Arabica Testnet",
KOII: "Koii Mainnet",
KOIIT: "Koii Testnet",
MANTLE: "Mantle Testnet",
LAV1: "Lava Testnet",
AXELAR: "Axelar Mainnet",
AXELART: "Axelar Testnet",
AGR: "Agoric Mainnet",
AGRT: "Agoric Testnet",
ETHBEACON: "Ethereum Beacon Mainnet",
BASE: "Base Mainnet",
BASES: "Base Sepolia Testnet",
BASET: "Base Sepolia Testnet",
ZKSYNC: "zkSync Era Mainnet",
ZKSYNCSP: "zkSync Era Sepolia Testnet",
ETHERMINT: "Ethermint",
SECRET: "Secret Mainnet",
SECRETP: "Secret Testnet",
APT1: "Aptos Mainnet",
OPTM: "Optimism Mainnet",
OPTMS: "Optimism Sepolia Testnet",
ARBN: "Arbitrum Nova Testnet",
ARBS: "Arbitrum Sepolia Testnet",
KAKAROTT: "Kakarot Sepolia Testnet",
BLAST: "Blast Mainnet",
BLASTSP: "Blast Special",
ALFAJORES: "Celo Alfajores Testnet",
UNIONT: "Union Testnet",
STRGZ: "Stargaze Mainnet",
STRGZT: "Stargaze Testnet",
NAMTSE: "Namada SE Testnet",
COSMOSSDK: "Cosmos SDK",
POLYGON1A: "Polygon Amoy Testnet",
COS3: "Osmosis Mainnet",
COS4: "Osmosis Testnet",
COS5: "Cosmos Hub Mainnet",
COS5T: "Cosmos Hub Testnet",
COSHUB: "Cosmos Hub Mainnet",
COSHUBT: "Cosmos Hub Testnet",
GTH1: "Ethereum Goerli Testnet",
OPTMT: "Optimism Goerli Testnet",
OSMO: "Osmosis Mainnet",
OSMOT: "Osmosis Testnet",
POLYGON1T: "Polygon Testnet",
STRKT: "Starknet Testnet",
SUI: "Sui Devnet",
FUSET: "Fuse Testnet",
UNION: "Union Mainnet"
};

/**
* Converts a chain abbreviation to its full name
* @param abbreviation The chain abbreviation (e.g. "ETH1", "EVMOS")
* @returns The full chain name or empty string if not found
*/
export function ConvertToChainName(abbreviation: string): string {
if (typeof abbreviation !== 'string') {
return '';
}
return chainMapping[abbreviation.toUpperCase()] || '';
}

export default chainMapping;
171 changes: 171 additions & 0 deletions src/lib/icons/data/chain-icons.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// src/lib/chain-dictionary.tsx

export interface ChainInfo {
name: string;
icon: string;
}

export const chainDictionary: { [key: string]: ChainInfo } = {
near: { name: "Near", icon: "/icons/near.svg" },
neart: { name: "Near Testnet", icon: "/icons/near.svg" },
osmosis: { name: "Osmosis", icon: "/icons/osmosis.svg" },
osmosist: { name: "Osmosis Testnet", icon: "/icons/osmosis.svg" },
strk: { name: "Starknet", icon: "/icons/starknet.svg" },
strkt: { name: "Starknet Testnet", icon: "/icons/starknet.svg" },
strks: { name: "Starknet Sepolia", icon: "/icons/starknet.svg" },
polygon: { name: "Polygon", icon: "/icons/polygon-pos.svg" },
polygon1: { name: "Polygon", icon: "/icons/polygon-pos.svg" },
solana: { name: "Solana", icon: "/icons/solana.svg" },
solanat: { name: "Solana Testnet", icon: "/icons/solana.svg" },
eth1: { name: "Ethereum", icon: "/icons/ethereum.svg" },
eth: { name: "Ethereum", icon: "/icons/ethereum.svg" },
sep1: { name: "Sepolia", icon: "/icons/ethereum.svg" },
strgz: { name: "Stargaze", icon: "/icons/stargaze.webp" },
strgzt: { name: "Stargaze Testnet", icon: "/icons/stargaze.webp" },
optm: { name: "Optimism", icon: "/icons/optimism.svg" },
optms: { name: "Optimism", icon: "/icons/optimism.svg" },
lava: { name: "Lava Network", icon: "/icons/lava.svg" },
lav1: { name: "Lava Testnet", icon: "/icons/lava.svg" },
axelar: { name: "Axelar", icon: "/icons/axelar.svg" },
axelart: { name: "Axelar Testnet", icon: "/icons/axelar.svg" },
base: { name: "Base", icon: "/icons/base.svg" },
bases: { name: "Base Sepolia Testnet", icon: "/icons/base.svg" },
baset: { name: "Base Testnet", icon: "/icons/base.svg" },
evmos: { name: "Evmos", icon: "/icons/evmos.svg" },
evmost: { name: "Evmos Testnet", icon: "/icons/evmos.svg" },
arb1: { name: "Arbitrum", icon: "/icons/arbitrum-one.svg" },
arbitrum: { name: "Arbitrum", icon: "/icons/arbitrum-one.svg" },
arbitrumt: { name: "Arbitrum Testnet", icon: "/icons/arbitrum-one.svg" },
arbitrumn: { name: "Arbitrum Nova", icon: "/icons/arbitrum-nova.svg" },
arbitrums: { name: "Arbitrum Sepolia Testnet", icon: "/icons/arbitrum-nova.svg" },
arbn: { name: "Arbitrum Nova", icon: "/icons/arbitrum-nova.svg" },
ftm250: { name: "Fantom", icon: "/icons/fantom.svg" },
abstract: { name: "Abstract", icon: "/icons/abstract.svg" },
acala: { name: "Acala", icon: "/icons/acala.svg" },
apex: { name: "Apex Layer", icon: "/icons/apex-layer.svg" },
aptos: { name: "Aptos", icon: "/icons/aptos.svg" },
astar: { name: "Astar", icon: "/icons/astar.svg" },
aurora: { name: "Aurora", icon: "/icons/aurora.svg" },
avax: { name: "Avalanche", icon: "/icons/avalanche.svg" },
beam: { name: "Beam", icon: "/icons/beam.svg" },
bsc: { name: "Binance Smart Chain", icon: "/icons/binance-smart-chain.svg" },
bsct: { name: "Binance Smart Chain Testnet", icon: "/icons/binance-smart-chain.svg" },
btc: { name: "Bitcoin", icon: "/icons/bitcoin.svg" },
bitkub: { name: "Bitkub Chain", icon: "/icons/bitkub-chain.svg" },
blast: { name: "Blast", icon: "/icons/blast.svg" },
blastt: { name: "Blast Testnet", icon: "/icons/blast.svg" },
blastsp: { name: "Blast Sepolia Testnet", icon: "/icons/blast.svg" },
boba: { name: "Boba", icon: "/icons/boba.svg" },
bouncebit: { name: "BounceBit", icon: "/icons/bouncebit.svg" },
cardano: { name: "Cardano", icon: "/icons/cardano.svg" },
celo: { name: "Celo", icon: "/icons/celo.svg" },
alfajores: { name: "Celo Alfajores Testnet", icon: "/icons/celo.svg" },
chiliz: { name: "Chiliz", icon: "/icons/chiliz.svg" },
clover: { name: "Clover", icon: "/icons/clover.svg" },
csc: { name: "CoinEx Smart Chain", icon: "/icons/coinex-smart-chain.svg" },
conflux: { name: "Conflux", icon: "/icons/conflux.svg" },
cos5: { name: "Cosmos Hub", icon: "/icons/cosmos-hub.svg" },
cosmos: { name: "Cosmos Hub", icon: "/icons/cosmos-hub.svg" },
cosmoshub: { name: "Cosmos Hub", icon: "/icons/cosmos-hub.svg" },
cosmoshubt: { name: "Cosmos Hub", icon: "/icons/cosmos-hub.svg" },
cronos: { name: "Cronos", icon: "/icons/cronos.svg" },
cronosZkEvm: { name: "Cronos zkEVM", icon: "/icons/cronos-zkevm.svg" },
dogechain: { name: "Dogechain", icon: "/icons/dogechain.svg" },
elastos: { name: "Elastos", icon: "/icons/elastos.svg" },
energyWeb: { name: "Energy Web", icon: "/icons/energy-web.svg" },
enuls: { name: "ENULS", icon: "/icons/enuls.svg" },
etc: { name: "Ethereum Classic", icon: "/icons/ethereum-classic.svg" },
etherlink: { name: "Etherlink", icon: "/icons/etherlink.svg" },
filecoin: { name: "Filecoin", icon: "/icons/filecoin.svg" },
fio: { name: "FIO", icon: "/icons/fio.svg" },
flare: { name: "Flare", icon: "/icons/flare.svg" },
fraxtal: { name: "Fraxtal", icon: "/icons/fraxtal.svg" },
fuse: { name: "Fuse", icon: "/icons/fuse.svg" },
gnosis: { name: "Gnosis", icon: "/icons/gnosis.svg" },
gravity: { name: "Gravity", icon: "/icons/gravity.svg" },
hedera: { name: "Hedera Hashgraph", icon: "/icons/hedera-hashgraph.svg" },
hubble: { name: "Hubble Exchange", icon: "/icons/hubble-exchange.svg" },
immutable: { name: "Immutable", icon: "/icons/immutable.svg" },
injective: { name: "Injective", icon: "/icons/injective.svg" },
iotex: { name: "IoTeX", icon: "/icons/iotex.svg" },
juno: { name: "Juno", icon: "/icons/juno.svg" },
jun1: { name: "Juno", icon: "/icons/juno.svg" },
kardia: { name: "Kardia", icon: "/icons/kardia.svg" },
kava: { name: "Kava", icon: "/icons/kava.svg" },
kucoin: { name: "KuCoin", icon: "/icons/kucoin.svg" },
kujira: { name: "Kujira", icon: "/icons/kujira.svg" },
linea: { name: "Linea", icon: "/icons/linea.svg" },
litecoin: { name: "Litecoin", icon: "/icons/litecoin.svg" },
loopring: { name: "Loopring", icon: "/icons/loopring.svg" },
lukso: { name: "LUKSO", icon: "/icons/lukso.svg" },
lyra: { name: "Lyra", icon: "/icons/lyra.svg" },
manta: { name: "Manta Pacific", icon: "/icons/manta-pacific.svg" },
mantle: { name: "Mantle", icon: "/icons/mantle.svg" },
matic: { name: "Matic", icon: "/icons/matic.svg" },
meter: { name: "Meter", icon: "/icons/meter.svg" },
metis: { name: "Metis Andromeda", icon: "/icons/metis-andromeda.svg" },
milkomedaA1: { name: "Milkomeda A1", icon: "/icons/milkomeda-a1.svg" },
milkomedaC1: { name: "Milkomeda C1", icon: "/icons/milkomeda-c1.svg" },
mode: { name: "Mode", icon: "/icons/mode.svg" },
moonbeam: { name: "Moonbeam", icon: "/icons/moonbeam.svg" },
moonriver: { name: "Moonriver", icon: "/icons/moonriver.svg" },
multiversx: { name: "MultiversX", icon: "/icons/multiversx.svg" },
nahmii: { name: "Nahmii", icon: "/icons/nahmii.svg" },
neoX: { name: "Neo X", icon: "/icons/neo-x.svg" },
neonEvm: { name: "Neon EVM", icon: "/icons/neon-evm.svg" },
oasys: { name: "Oasys", icon: "/icons/oasys.svg" },
okex: { name: "OKEx", icon: "/icons/okex.svg" },
polkadot: { name: "Polkadot", icon: "/icons/polkadot.svg" },
polygonZkEvm: { name: "Polygon zkEVM", icon: "/icons/polygon-zkevm.svg" },
rari: { name: "Rari", icon: "/icons/rari.svg" },
reya: { name: "Reya", icon: "/icons/reya.svg" },
rollux: { name: "Rollux", icon: "/icons/rollux.svg" },
ronin: { name: "Ronin", icon: "/icons/ronin.svg" },
rootstock: { name: "Rootstock", icon: "/icons/rootstock.svg" },
scroll: { name: "Scroll", icon: "/icons/scroll.svg" },
sei: { name: "Sei Network", icon: "/icons/sei-network.svg" },
shiden: { name: "Shiden", icon: "/icons/shiden.svg" },
shimmer: { name: "Shimmer EVM", icon: "/icons/shimmer-evm.svg" },
songbird: { name: "Songbird", icon: "/icons/songbird.svg" },
stellar: { name: "Stellar", icon: "/icons/stellar.svg" },
step: { name: "Step", icon: "/icons/step.svg" },
sui: { name: "Sui", icon: "/icons/sui.svg" },
syscoin: { name: "Syscoin", icon: "/icons/sys.svg" },
telos: { name: "Telos", icon: "/icons/telos.svg" },
tenet: { name: "Tenet", icon: "/icons/tenet.svg" },
theta: { name: "Theta", icon: "/icons/theta.svg" },
thundercore: { name: "ThunderCore", icon: "/icons/thundercore.svg" },
tombchain: { name: "TombChain", icon: "/icons/tombchain.svg" },
tron: { name: "Tron", icon: "/icons/tron.svg" },
ubiq: { name: "Ubiq", icon: "/icons/ubiq.svg" },
ultron: { name: "Ultron", icon: "/icons/ultron.svg" },
velas: { name: "Velas", icon: "/icons/velas.svg" },
viction: { name: "Viction", icon: "/icons/viction.svg" },
wemix: { name: "WEMIX", icon: "/icons/wemix.svg" },
xLayer: { name: "X Layer", icon: "/icons/x-layer.svg" },
xai: { name: "Xai", icon: "/icons/xai.svg" },
xdc: { name: "XDC", icon: "/icons/xdc.svg" },
zetachain: { name: "ZetaChain", icon: "/icons/zeta-chain.svg" },
zilliqa: { name: "Zilliqa", icon: "/icons/zilliqa.svg" },
zksync: { name: "zkSync", icon: "/icons/zksync.svg" },
zora: { name: "Zora", icon: "/icons/zora.svg" },
zyx: { name: "ZYX", icon: "/icons/zyx.svg" },
berat2: { name: "Berachain", icon: "/icons/berachain-icon.webp" },
canto: { name: "Canto Network", icon: "/icons/canto-network.webp" },
agr: { name: "Agoric", icon: "/icons/agoric.png" },
agrt: { name: "Agoric Testnet", icon: "/icons/agoric.png" },
celestia: { name: "Celestia", icon: "/icons/celestia.webp" },
celestiat: { name: "Celestia Testnet", icon: "/icons/celestia.webp" },
celestiatm: { name: "Celestia Mocha Testnet", icon: "/icons/celestia.webp" },
arbs: { name: "Arbitrum Staging", icon: "/icons/arbitrum-icon.webp" },
fvm: { name: "Filecoin", icon: "/icons/filecoin.webp" },
fvmt: { name: "Filecoin", icon: "/icons/filecoin.webp" },
hol1: { name: "Holesky", icon: "/icons/ethereum-icon.webp" },
gth1: { name: "Goerli", icon: "/icons/ethereum-icon.webp" },
ethbeacon: { name: "Beacon", icon: "/icons/ethereum-icon.webp" },
apt1: { name: "Aptos", icon: "/icons/aptos-icon.webp" },
kakarot: { name: "Kakarot", icon: "/icons/kakarot.webp" },
kakarott: { name: "Kakarot Testnet", icon: "/icons/kakarot.webp" },
movement: { name: "Movement", icon: "/icons/movement3.webp" },
movementt: { name: "Movement Testnet", icon: "/icons/movement3.svg" },
};
Loading

0 comments on commit 43e5132

Please sign in to comment.