diff --git a/.env.sample b/.env.sample index 8bc021b..df46b60 100644 --- a/.env.sample +++ b/.env.sample @@ -1,3 +1,3 @@ # Required variables -WALLET_PRIVATE_KEY= -TYPE_NETWORK=testnet \ No newline at end of file +WALLET_PRIVATE_KEY=WALLET_PRIVATE_KEY +TYPE_NETWORK=mainnet diff --git a/src/config.ts b/src/config.ts index e7f34e0..1aa13be 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,28 +1,31 @@ -import 'dotenv/config'; + +// Define the Config type (fields must match exactly these types) type Config = { - rpcUrl: string; - chainId: number; - address: string; -} + rpcUrl: string; + chainId: number; + address: string; +}; +// Example configuration for Arbitrum (replace with Base values if needed) const testnetConfig: Config = { - rpcUrl: 'https://1rpc.io/base-goerli', - chainId: , // add testnet - address: '' // add testnet -} + // Arbitrum Goerli testnet + rpcUrl: 'https://goerli-rollup.arbitrum.io/rpc', // Arbitrum testnet public RPC URL​:contentReference[oaicite:3]{index=3} + chainId: 421613, // Arbitrum Goerli chainId​:contentReference[oaicite:4]{index=4} + address: '0x' // Deperp contract address on Arbitrum testnet (USDT-BTC market) +}; const mainnetConfig: Config = { - rpcUrl: 'https://1rpc.io/base', //Rate limited and not for production systems. - chainId: 8453, - address: '0x5Dc939df0cf253873cf77B786A24d51BaA72cF75' // Taurus GA -} + // Arbitrum One mainnet + rpcUrl: 'https://eth.llamarpc.com', // Arbitrum One mainnet RPC URL​:contentReference[oaicite:5]{index=5} + chainId: 1, // Arbitrum One chainId​:contentReference[oaicite:6]{index=6} + address: '0x4e68Ccd3E89f51C3074ca5072bbAC773960dFa36' // Deperp contract address on Arbitrum mainnet (USDT-BTC market) +}; -export const getConfig = () => { - if (process.env.TYPE_NETWORK === 'mainnet') { - return mainnetConfig; - } +// Export a function to get the correct config based on environment +export const getConfig = (): Config => { + return process.env.TYPE_NETWORK === 'mainnet' ? mainnetConfig : testnetConfig; +}; - return testnetConfig; -} +};