Skip to content

Latest commit

 

History

History
205 lines (114 loc) · 3.28 KB

File metadata and controls

205 lines (114 loc) · 3.28 KB

iexec


iexec / IExecWalletModule

Class: IExecWalletModule

module exposing wallet methods

Extends

Constructors

Constructor

new IExecWalletModule(configOrArgs, options?): IExecWalletModule

Create an IExecModule instance

Parameters

configOrArgs

IExecConfigArgs | IExecConfig

options?

IExecConfigOptions

Returns

IExecWalletModule

Inherited from

IExecModule.constructor

Properties

config

config: IExecConfig

current IExecConfig

Inherited from

IExecModule.config

Methods

checkBalances()

checkBalances(address): Promise<{ nRLC: BN; wei: BN; }>

check the wallet balances (native and iExec token) of specified address

example:

const { wei, nRLC } = await checkBalances(address);
console.log('iExec nano RLC:', nRLC.toString());
console.log('ethereum wei:', wei.toString());

Parameters

address

string

Returns

Promise<{ nRLC: BN; wei: BN; }>


getAddress()

getAddress(): Promise<string>

SIGNER REQUIRED

get the connected wallet address

example:

const userAddress = await getAddress();
console.log('user address:', userAddress);

Returns

Promise<string>


sendETH()

sendETH(WeiAmount, to): Promise<string>

SIGNER REQUIRED

send some wei to the specified address

example:

const txHash = await sendETH(amount, receiverAddress);
console.log('transaction hash:', txHash);

Parameters

WeiAmount

WeiAmount

to

string

Returns

Promise<string>


sendRLC()

sendRLC(nRLCAmount, to): Promise<string>

SIGNER REQUIRED

send some nRLC to the specified address

example:

const txHash = await sendRLC(amount, receiverAddress);
console.log('transaction hash:', txHash);

Parameters

nRLCAmount

NRLCAmount

to

string

Returns

Promise<string>


sweep()

sweep(to): Promise<{ sendERC20TxHash: string; sendNativeTxHash: string; }>

SIGNER REQUIRED

send all the iExec token and the native token owned by the wallet to the specified address

example:

const { sendERC20TxHash, sendNativeTxHash } = await sweep(receiverAddress);
console.log('sweep RLC transaction hash:', sendERC20TxHash);
console.log('sweep ether transaction hash:', sendNativeTxHash);

Parameters

to

string

Returns

Promise<{ sendERC20TxHash: string; sendNativeTxHash: string; }>


fromConfig()

static fromConfig(config): IExecWalletModule

Create an IExecWalletModule instance using an IExecConfig instance

Parameters

config

IExecConfig

Returns

IExecWalletModule

Overrides

IExecModule.fromConfig