(name: ConstantKeys, web3OrNetwork: Web3 | string)
| 112 | export async function getConstant(name: ConstantKeys, network: string): Promise<string>; |
| 113 | export async function getConstant(name: ConstantKeys, web3: Web3): Promise<string>; |
| 114 | export async function getConstant(name: ConstantKeys, web3OrNetwork: Web3 | string): Promise<string> { |
| 115 | let network: string; |
| 116 | if (typeof web3OrNetwork === 'string') { |
| 117 | network = web3OrNetwork; |
| 118 | } else { |
| 119 | network = await networkName(web3OrNetwork); |
| 120 | } |
| 121 | |
| 122 | let value = constants[network][name]; |
| 123 | if (!value) { |
| 124 | throw new Error(`Don't know about the constant '${name}' for network ${network}`); |
| 125 | } |
| 126 | return value; |
| 127 | } |
| 128 | |
| 129 | export default constants; |
no test coverage detected