Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Required variables
WALLET_PRIVATE_KEY=
TYPE_NETWORK=testnet
WALLET_PRIVATE_KEY=WALLET_PRIVATE_KEY
TYPE_NETWORK=mainnet
41 changes: 22 additions & 19 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -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_USDT-BTC_Testnet_Address>' // 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&#8203;:contentReference[oaicite:5]{index=5}
chainId: 1, // Arbitrum One chainId&#8203;: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;
}
};