Skip to content

Latest commit

 

History

History
99 lines (55 loc) · 2.05 KB

IExecNetworkModule.md

File metadata and controls

99 lines (55 loc) · 2.05 KB

iexec / Exports / IExecNetworkModule

Class: IExecNetworkModule

module exposing network methods

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new IExecNetworkModule(configOrArgs, options?)

Create an IExecModule instance using an IExecConfig like

Parameters

Name Type
configOrArgs IExecConfigArgs | IExecConfig
options? IExecConfigOptions

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

getNetwork

getNetwork(): Promise<{ chainId: number ; isNative: boolean }>

get info about the current iExec network

NB: isNative is true when the iExec instance use the chain's native token for payment (otherwise the payment token is an ERC20)

example:

const { chainId, isNative } = await getNetwork();
console.log(`working on chain ${chainId}, using native token: ${isNative}`);

Returns

Promise<{ chainId: number ; isNative: boolean }>


fromConfig

Static fromConfig(config): IExecNetworkModule

Create an IExecNetworkModule instance using an IExecConfig instance

Parameters

Name Type
config IExecConfig

Returns

IExecNetworkModule

Overrides

IExecModule.fromConfig