Files
proxmox/multi-chain-execution/src/chain-adapters/config.ts
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

91 lines
2.5 KiB
TypeScript

/**
* Chain config for CA-138, CA-651940, and public mainnets.
* Single source of truth for chainId, RPC, confirmations, reorg window.
*/
import type { ChainAdapterConfig } from './types.js';
const CHAIN_138_RPC =
process.env.CHAIN_138_RPC_URL ?? process.env.CHAIN138_RPC_URL ?? 'https://rpc-http-pub.d-bis.org';
const CHAIN_651940_RPC =
process.env.CHAIN_651940_RPC_URL ?? 'https://mainnet-rpc.alltra.global';
const ETHEREUM_RPC = process.env.ETHEREUM_RPC_URL ?? 'https://eth.llamarpc.com';
const ARBITRUM_RPC = process.env.ARBITRUM_RPC_URL ?? 'https://arb1.arbitrum.io/rpc';
const BASE_RPC = process.env.BASE_RPC_URL ?? 'https://mainnet.base.org';
const POLYGON_RPC = process.env.POLYGON_RPC_URL ?? 'https://polygon-rpc.com';
const BSC_RPC = process.env.BSC_RPC_URL ?? 'https://bsc-dataseed.binance.org';
/** Tezos mainnet - chainId 1729 (Tezos founding year). Uses TzKT API for read operations. */
const TEZOS_RPC =
process.env.TEZOS_RPC_URL ?? process.env.TEZOS_TZKT_URL ?? 'https://api.tzkt.io';
/** Chain ID for Tezos mainnet (non-EVM) */
export const TEZOS_CHAIN_ID = 1729;
export const CHAIN_ADAPTER_CONFIGS: Record<number, ChainAdapterConfig> = {
138: {
chainId: 138,
rpcUrls: [CHAIN_138_RPC],
confirmations: 20,
chainKey: 'chainid-138',
reorgWindowBlocks: 20,
},
651940: {
chainId: 651940,
rpcUrls: [CHAIN_651940_RPC],
confirmations: 20,
chainKey: 'all-mainnet',
reorgWindowBlocks: 20,
},
1: {
chainId: 1,
rpcUrls: [ETHEREUM_RPC],
confirmations: 32,
chainKey: 'ethereum-mainnet',
reorgWindowBlocks: 64,
},
42161: {
chainId: 42161,
rpcUrls: [ARBITRUM_RPC],
confirmations: 20,
chainKey: 'arbitrum-one',
reorgWindowBlocks: 40,
},
8453: {
chainId: 8453,
rpcUrls: [BASE_RPC],
confirmations: 10,
chainKey: 'base',
reorgWindowBlocks: 20,
},
137: {
chainId: 137,
rpcUrls: [POLYGON_RPC],
confirmations: 128,
chainKey: 'polygon',
reorgWindowBlocks: 128,
},
56: {
chainId: 56,
rpcUrls: [BSC_RPC],
confirmations: 15,
chainKey: 'bsc',
reorgWindowBlocks: 30,
},
[TEZOS_CHAIN_ID]: {
chainId: TEZOS_CHAIN_ID,
rpcUrls: [TEZOS_RPC],
confirmations: 2,
chainKey: 'tezos-mainnet',
reorgWindowBlocks: 2,
},
};
export function getChainConfig(chainId: number): ChainAdapterConfig | undefined {
return CHAIN_ADAPTER_CONFIGS[chainId];
}
export function getSupportedChainIds(): number[] {
return Object.keys(CHAIN_ADAPTER_CONFIGS).map(Number);
}