Skip to content

Commit

Permalink
Merge pull request #54 from pimlicolabs/pull-main-to-gas-est
Browse files Browse the repository at this point in the history
Pull main to feat/gas-estimation
  • Loading branch information
nikmel2803 authored Dec 1, 2023
2 parents 61ab3f5 + 16a9561 commit cad12e6
Showing 1 changed file with 122 additions and 101 deletions.
223 changes: 122 additions & 101 deletions packages/cli/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,123 +26,144 @@ const preFlightChecks = async (publicClient: PublicClient<Transport, Chain>, arg
}
}

const customTestnet: Chain = {
id: 36865,
name: "Custom Testnet",
network: "custom-testnet",
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18
},
rpcUrls: {
default: {
http: ["http://127.0.0.1:8545"]
const customChains: Chain[] = [
{
id: 36865,
name: "Custom Testnet",
network: "custom-testnet",
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18
},
public: {
http: ["http://127.0.0.1:8545"]
}
},
testnet: true
}

const dfkTestnet: Chain = {
id: 335,
name: "DFK Subnet Testnet",
network: "dfk-test-chain",
nativeCurrency: {
name: "JEWEL",
symbol: "JEWEL",
decimals: 18
rpcUrls: {
default: {
http: ["http://127.0.0.1:8545"]
},
public: {
http: ["http://127.0.0.1:8545"]
}
},
testnet: true
},
rpcUrls: {
default: {
http: ["https://subnets.avax.network/defi-kingdoms/dfk-chain-testnet/rpc"]
{
id: 335,
name: "DFK Subnet Testnet",
network: "dfk-test-chain",
nativeCurrency: {
name: "JEWEL",
symbol: "JEWEL",
decimals: 18
},
public: {
http: ["https://subnets.avax.network/defi-kingdoms/dfk-chain-testnet/rpc"]
}
rpcUrls: {
default: {
http: ["https://subnets.avax.network/defi-kingdoms/dfk-chain-testnet/rpc"]
},
public: {
http: ["https://subnets.avax.network/defi-kingdoms/dfk-chain-testnet/rpc"]
}
},
testnet: true
},
testnet: true
}

const xaiGoerliOrbit: Chain = {
id: 47279324479,
name: "Xai Goerli Orbit",
network: "xai-goerli-orbit",
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18
{
id: 59144,
name: "Linea Mainnet",
network: "linea",
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18
},
rpcUrls: {
default: {
http: []
},
public: {
http: []
}
},
testnet: false
},
rpcUrls: {
default: {
http: []
{
id: 47279324479,
name: "Xai Goerli Orbit",
network: "xai-goerli-orbit",
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18
},
public: {
http: []
}
rpcUrls: {
default: {
http: []
},
public: {
http: []
}
},
testnet: false
},
testnet: false
}

const nautilus: Chain = {
id: 22222,
name: "Nautilus",
network: "nautilus",
nativeCurrency: {
name: "ZBC",
symbol: "ZBC",
decimals: 18
{
id: 3163830386846714,
name: "Parallel testnet",
network: "parallel-l3-testnet",
nativeCurrency: {
name: "testnetETH",
symbol: "testnetETH",
decimals: 18,
},
rpcUrls: {
default: {
http: [],
},
public: {
http: [],
},
},
testnet: true,
},
rpcUrls: {
default: {
http: []
{
id: 901,
name: "Lyra",
network: "lyra",
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18
},
public: {
http: []
rpcUrls: {
default: {
http: []
},
public: {
http: []
}
}
}
}

const lyra: Chain = {
id: 901,
name: "Lyra",
network: "lyra",
nativeCurrency: {
name: "ETH",
symbol: "ETH",
decimals: 18
},
rpcUrls: {
default: {
http: []
{
id: 22222,
name: "Nautilus",
network: "nautilus",
nativeCurrency: {
name: "ZBC",
symbol: "ZBC",
decimals: 18
},
public: {
http: []
rpcUrls: {
default: {
http: []
},
public: {
http: []
}
}
}
}
]

function getChain(chainId: number): Chain {
if (chainId === 36865) {
return customTestnet
}

if (chainId === 335) {
return dfkTestnet
}

if (chainId === 47279324479) {
return xaiGoerliOrbit
}

if (chainId === 22222) {
return nautilus
}

if (chainId === 901) {
return lyra
const customChain = customChains.find((chain) => chain.id === chainId)
if (customChain) {
return customChain;
}

for (const chain of Object.values(chains)) {
Expand Down

0 comments on commit cad12e6

Please sign in to comment.