node.d.ts
1 import { StaticNetworkIds } from './network'; 2 3 interface CustomNodeConfig { 4 id: string; 5 isCustom: true; 6 isAuto?: undefined; 7 name: string; 8 service: 'your custom node'; 9 url: string; 10 network: string; 11 auth?: { 12 username: string; 13 password: string; 14 }; 15 } 16 17 interface StaticNodeConfig { 18 id: string; 19 isCustom: false; 20 isAuto?: boolean; 21 network: StaticNetworkIds; 22 service: string; 23 hidden?: boolean; 24 } 25 26 interface RawNodeConfig { 27 name: string; 28 type: 'rpc' | 'etherscan' | 'infura' | 'web3' | 'myccustom'; 29 service: string; 30 url: string; 31 } 32 33 type StaticNodeId = string; 34 35 type StaticNodeConfigs = { [id: string]: StaticNodeConfig } & { web3?: StaticNodeConfig }; 36 37 type NodeConfig = StaticNodeConfig | CustomNodeConfig;