Class NetworkService

Hierarchy

Index

Constructors

constructor

Properties

Readonly chainId$

chainId$: Observable<number>

Readonly defaultNetwork

defaultNetwork: Network

Readonly externalContractAddresses

externalContractAddresses: Map<string, {}> = new Map<string, { [key: number]: string }>()

Readonly network$

network$: ObjectSubject<Network, "name" | "chainId"> = new ObjectSubject<Network>(null)

Readonly supportedNetworks

supportedNetworks: Network[]

Accessors

chainId

  • get chainId(): number
  • Returns number

network

Methods

destroy

  • destroy(): void

getExternalContractAddress

  • getExternalContractAddress(contractName: string): string
  • Parameters

    • contractName: string

    Returns string

getInternalContractAddress

  • getInternalContractAddress(contractName: ContractNames): string
  • Parameters

    • contractName: ContractNames

    Returns string

init

isNetworkNameSupported

  • isNetworkNameSupported(networkName: string): boolean
  • Parameters

    • networkName: string

    Returns boolean

setExternalContractAddresses

  • setExternalContractAddresses(contractName: string, addresses: ContractAddresses): void

switchNetwork

useDefaultNetwork

  • useDefaultNetwork(): void
  • Returns void