iexec / Exports / IExecNetworkModule
module exposing network methods
-
↳
IExecNetworkModule
• new IExecNetworkModule(configOrArgs
, options?
)
Create an IExecModule instance using an IExecConfig like
Name | Type |
---|---|
configOrArgs |
IExecConfigArgs | IExecConfig |
options? |
IExecConfigOptions |
• config: IExecConfig
current IExecConfig
▸ 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}`);
Promise
<{ chainId
: number
; isNative
: boolean
}>
▸ Static
fromConfig(config
): IExecNetworkModule
Create an IExecNetworkModule instance using an IExecConfig instance
Name | Type |
---|---|
config |
IExecConfig |