Conflux-Chain/js-conflux-sdk

Add const Network to let user to choice easily

Closed this issue · 3 comments

missing NETWORKS const to easily integrate with remix plugin. we also need hardcode the network in remix-plugin. this is not ideal design for current sdk. please embedded the NETWORKS string to js-conflux-sdk

interface Network {
	url: string; //conflux rpc url
	networkId?: number;  //conflux network id
}

export const NETWORKS: { [key: string]: Network } = {
	Mainnet: {
		url: 'https://test.confluxrpc.org/v2',
		networkId: 1,
	},
	Testnet: {
		url: 'https://test.confluxrpc.org/v2',
		networkId: 1,
	},
};

Pana commented

The networks is not a production service, and will change sometimes. I think it should be import manually

bad idea.