eulith-web3js-core
Version:
Eulith core web3js SDK (code to access Eulith services via web3js)
56 lines (55 loc) • 1.92 kB
TypeScript
export declare module Networks {
/**
* Eulith.Networks.Network
*
* The Ethereum system is composed of a collection of 'networks' - uniqiely identified by their network 'id'.
* 'mainnet' - network #1 - is the principle backbone of Ethereum.
*
* But frequently, other secondary networks are of use.
*
* When you send transactions, or do opeprations, its always with respect to some network, which is associated with
* your provider (Eulith.Provider).
*
* @todo Probably add 'features' property to networks, like support EthereumJSTX.Capability.EIP155ReplayProtection
*/
class Network {
/**
*/
constructor({ chainId, name, eulithURL }: {
chainId: number;
name: string;
eulithURL: string;
});
/**
* Return a new Network, with the provided values updated/replaced
*/
with({ chainId, name, eulithURL }: {
chainId?: number;
name?: string;
eulithURL?: string;
}): Network;
readonly chainId: number;
readonly name: string;
readonly eulithURL: string;
}
class Predefined {
static get all(): Network[];
/**
* Lookup the network, either by chainId, or eulithURL, or name. Throws if none found.
* @returns
*/
static get({ chainId, eulithURL, name }: {
chainId?: number;
eulithURL?: string;
name?: string;
}): Network;
static readonly mainnet: Network;
static readonly goerli: Network;
static readonly polygon: Network;
static readonly polygonMumbai: Network;
static readonly arbitrum: Network;
static readonly arbitrumGoerli: Network;
static readonly optimism: Network;
static readonly optimismGoerli: Network;
}
}