Skip to content

Latest commit

 

History

History
93 lines (49 loc) · 1.67 KB

File metadata and controls

93 lines (49 loc) · 1.67 KB

iexec


iexec / IExecNetworkModule

Class: IExecNetworkModule

module exposing network methods

Extends

Constructors

Constructor

new IExecNetworkModule(configOrArgs, options?): IExecNetworkModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecNetworkModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

getNetwork()

getNetwork(): Promise<{ chainId: string; 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: string; isNative: boolean; }>


fromConfig()

static fromConfig(config): IExecNetworkModule

Create an IExecNetworkModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecNetworkModule

Overrides

IExecModule.fromConfig