Skip to content

Commit

Permalink
Merge pull request #32 from xendfinance/mainnet
Browse files Browse the repository at this point in the history
frontend and backend implementation of mainnet
  • Loading branch information
theiceeman authored Oct 11, 2024
2 parents b0a2b74 + bcf93dd commit e46c747
Show file tree
Hide file tree
Showing 82 changed files with 451,988 additions and 18,525 deletions.
51,134 changes: 51,120 additions & 14 deletions backend-ausdce/src/contracts/contracts.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion backend-ausdce/src/gotbit-tools/node/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const ankrRpc = (): RpcFunction => {
if (chainTag === 'pulse_testnet') return 'https://rpc.v4.testnet.pulsechain.com'
if (chainTag === 'base_mainnet') return 'https://base-rpc.publicnode.com'
if (chainTag === 'arbitrum_sepolia') return 'https://public.stackup.sh/api/v1/node/arbitrum-sepolia'
if (chainTag === 'xend_testnet') return 'https://rpctestnet.xendrwachain.com'
if (chainTag === 'xend_testnet') return 'https://enugu-rpc.assetchain.org'
if (chainTag === 'eth_sepolia') return 'https://ethereum-sepolia-rpc.publicnode.com'
if (chainTag === 'polygon_amoy') return 'https://rpc-amoy.polygon.technology'
if (chainTag === 'base_sepolia') return 'https://rpc.notadegen.com/base/sepolia'
Expand Down Expand Up @@ -68,6 +68,8 @@ export const universalRpc = (): RpcFunction => {
polygon_mainnet: ankr(chainTag),
celo_mainnet: ankr(chainTag),
base_mainnet: ankr(chainTag),
bitlayer_mainnet: extraRpcs.bitlayer_mainnet[0],
xend_mainnet: extraRpcs.xend_mainnet[0],

avax_testnet: 'https://avalanche-fuji-c-chain.publicnode.com',
polygon_testnet: 'https://rpc-mumbai.maticvigil.com',
Expand Down Expand Up @@ -99,6 +101,7 @@ export const universalRpc = (): RpcFunction => {
base_sepolia: extraRpcs.base_sepolia[0],
eth_sepolia: extraRpcs.eth_sepolia[0],
polygon_amoy: extraRpcs.polygon_amoy[0],
bitlayer_testnet: extraRpcs.bitlayer_testnet[0],
} as any
return a[chainTag]
}
Expand Down
5 changes: 4 additions & 1 deletion backend-ausdce/src/gotbit-tools/node/utils/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const realChainIds = {
cmp_mainnet: 256256,
pulse_mainnet: 369,
base_mainnet: 8453,
bitlayer_mainnet: 200901,
xend_mainnet: 42420,

rinkeby: 4,
ropsten: 3,
Expand All @@ -34,7 +36,8 @@ export const realChainIds = {
arbitrum_sepolia: 421614,
base_sepolia: 84532,
polygon_amoy: 80002,
eth_sepolia: 11155111
eth_sepolia: 11155111,
bitlayer_testnet: 200810
}

export const REMOTE_DEV_PREFIX = '10000'
Expand Down
25 changes: 20 additions & 5 deletions backend-ausdce/src/gotbit-tools/node/utils/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const realTypes: Record<RealChainTag, Types> = {
cmp_mainnet: 'mainnet',
pulse_mainnet: 'mainnet',
base_mainnet: 'mainnet',
bitlayer_mainnet: 'mainnet',
xend_mainnet: 'mainnet',

rinkeby: 'testnet',
ropsten: 'testnet',
Expand All @@ -64,7 +66,8 @@ export const realTypes: Record<RealChainTag, Types> = {
arbitrum_sepolia: 'testnet',
base_sepolia: 'testnet',
eth_sepolia: 'testnet',
polygon_amoy: 'testnet'
polygon_amoy: 'testnet',
bitlayer_testnet: 'testnet',
}
export const realNames: Record<RealChainTag, string> = {
localhost: 'Localhost',
Expand All @@ -82,6 +85,8 @@ export const realNames: Record<RealChainTag, string> = {
cmp_mainnet: 'CMP Mainnet',
pulse_mainnet: 'PulseChain Mainnet',
base_mainnet: 'Base',
bitlayer_mainnet: 'BitLayer Mainnet',
xend_mainnet: 'Asset Chain Mainnet',

rinkeby: 'Rinkeby',
ropsten: 'Ropsten',
Expand All @@ -101,7 +106,8 @@ export const realNames: Record<RealChainTag, string> = {
arbitrum_sepolia: 'Arbitrum Sepolia Testnet',
base_sepolia: 'Base Sepolia Testnet',
eth_sepolia: 'Sepolia',
polygon_amoy: 'Amoy'
polygon_amoy: 'Amoy',
bitlayer_testnet: 'BitLayer Testnet',
}
export const realSymbols: Record<RealChainTag, string> = {
localhost: 'LOC',
Expand All @@ -119,6 +125,8 @@ export const realSymbols: Record<RealChainTag, string> = {
cmp_mainnet: 'CMP',
pulse_mainnet: 'PLS',
base_mainnet: 'ETH',
bitlayer_mainnet: 'BTC',
xend_mainnet: 'RWA',

rinkeby: 'ETH',
ropsten: 'ETH',
Expand All @@ -138,7 +146,8 @@ export const realSymbols: Record<RealChainTag, string> = {
arbitrum_sepolia: 'ETH',
base_sepolia: 'ETH',
eth_sepolia: 'ETH',
polygon_amoy: 'MATIC'
polygon_amoy: 'MATIC',
bitlayer_testnet: 'BTC'
}

export const types: Record<ChainTag, Types> = {
Expand Down Expand Up @@ -177,6 +186,8 @@ export const scanners: Record<RealChainTag, string> = {
cmp_mainnet: 'https://mainnet.scan.caduceus.foundation/',
pulse_mainnet: 'https://scan.mypinata.cloud/ipfs/bafybeih3olry3is4e4lzm7rus5l3h6zrphcal5a7ayfkhzm5oivjro2cp4/#/',
base_mainnet: 'https://basescan.org/',
bitlayer_mainnet: 'https://www.btrscan.com/',
xend_mainnet: 'https://scan.assetchain.org/',

rinkeby: 'https://rinkeby.etherscan.io/',
ropsten: 'https://ropsten.etherscan.io/',
Expand All @@ -196,7 +207,8 @@ export const scanners: Record<RealChainTag, string> = {
arbitrum_sepolia: 'https://sepolia.arbiscan.io/',
base_sepolia: 'https://public.stackup.sh/api/v1/node/base-sepolia',
eth_sepolia: 'https://ethereum-sepolia-rpc.publicnode.com',
polygon_amoy: 'https://polygon-amoy-bor-rpc.publicnode.com'
polygon_amoy: 'https://polygon-amoy-bor-rpc.publicnode.com',
bitlayer_testnet: 'https://testnet-scan.bitlayer.org/'
}

export function node(name: ChainTag): Node {
Expand Down Expand Up @@ -271,6 +283,8 @@ export const extraRpcs: Record<RealChainTag, string[]> = {
cmp_mainnet: ['https://mainnet.block.caduceus.foundation'],
pulse_mainnet: ['https://pulsechain.publicnode.com'],
base_mainnet: ['https://base-rpc.publicnode.com'],
bitlayer_mainnet: ['https://rpc-bitlayer.rockx.com'],
xend_mainnet: ['https://mainnet-rpc.assetchain.org'],

rinkeby: ['https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'],
ropsten: ['https://ropsten.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161'],
Expand Down Expand Up @@ -322,5 +336,6 @@ export const extraRpcs: Record<RealChainTag, string[]> = {
base_sepolia: [
'https://base-sepolia-rpc.publicnode.com',
'https://sepolia.base.org'
]
],
bitlayer_testnet: ['https://testnet-rpc.bitlayer.org']
}
8 changes: 7 additions & 1 deletion backend-ausdce/src/gotbit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { universalRpc } from '@/gotbit-tools/node/rpc'
export const IS_PROD = process.env.PROD === 'true'

export const config = defineConfig({
chainIds: ['97', '42421', '421614', '84532'],
chainIds: ['97', '42421', '421614', '200810', '200901', '42420', '42161', '56', '8453', '84532'],
// DEFAULT_CHAINID: IS_PROD ? '56' : '97',
DEFAULT_CHAINID: '97',
rpc: universalRpc(),
Expand All @@ -19,5 +19,11 @@ export const contracts = defineContracts({
'97': {},
'42421': {},
'421614': {},
'200810': {},
'200901': {},
'42420': {},
'42161': {},
'56': {},
'8453': {},
'84532': {}
})
Loading

0 comments on commit e46c747

Please sign in to comment.