Home Reference Source
import BaseContract from 'kyber-fpr-sdk/src/base_contract.js'
public class | source

BaseContract

BaseContract contains common methods for all contracts of a KyberNetwork reserve.

Constructor Summary

Public Constructor
public

constructor(web3: object, address: string)

Create new BaseContract instance.

Member Summary

Public Members
public
public

web3: *

Method Summary

Public Methods
public

async addAlerter(adminAddress: object, address: string, gasPrice: number): *

Add new address to alerters list.

public

async addOperator(adminAddress: object, address: string, gasPrice: number): *

Add given address from operators list.

public

Return the current admin address of contract.

public

async claimAdmin(newAccount: object, gasPrice: number): *

Claim admin privilege.

public

getAlerters(): array

Return alerter addresses of contract.

public

getOperators(): array

Return operator addresses of contract.

public

Return the pending admin address of contract.

public

async removeAlerter(adminAddress: object, address: string, gasPrice: number): *

Remove address from alerters list.

public

async removeOperator(adminAddress: object, address: string, gasPrice: number): *

Remove given address from operators list.

public

async transferAdmin(adminAddress: object, address: string, gasPrice: number): *

transfer admin privilege to given address.

Public Constructors

public constructor(web3: object, address: string) source

Create new BaseContract instance.

Params:

NameTypeAttributeDescription
web3 object

Web3 instance

address string

address of smart contract.

Public Members

public contract: * source

public web3: * source

Public Methods

public async addAlerter(adminAddress: object, address: string, gasPrice: number): * source

Add new address to alerters list.

Params:

NameTypeAttributeDescription
adminAddress object

current admin account

address string

address to add to alerters list.

gasPrice number

(string) - the gasPrice desired for the tx

Return:

*

public async addOperator(adminAddress: object, address: string, gasPrice: number): * source

Add given address from operators list.

Params:

NameTypeAttributeDescription
adminAddress object

current admin account

address string

address to remove from operators list.

gasPrice number

(optional) - the gasPrice desired for the tx

Return:

*

public admin(): string source

Return the current admin address of contract.

Return:

string

current admin address

public async claimAdmin(newAccount: object, gasPrice: number): * source

Claim admin privilege. The account address should be in already placed in pendingAdmin for this to works.

Params:

NameTypeAttributeDescription
newAccount object

the pending admin account

gasPrice number

(optional) - the gasPrice desired for the tx

Return:

*

public getAlerters(): array source

Return alerter addresses of contract.

Return:

array

list of alerter addresses

public getOperators(): array source

Return operator addresses of contract.

Return:

array

list of operator addresses

public pendingAdmin(): string source

Return the pending admin address of contract. An admin address is placed in pending if it is transfered but hasn't been claimed yet.

Return:

string

pending admin address

public async removeAlerter(adminAddress: object, address: string, gasPrice: number): * source

Remove address from alerters list.

Params:

NameTypeAttributeDescription
adminAddress object

current admin account

address string

address to remove from alerters list.

gasPrice number

(string) - the gasPrice desired for the tx

Return:

*

public async removeOperator(adminAddress: object, address: string, gasPrice: number): * source

Remove given address from operators list.

Params:

NameTypeAttributeDescription
adminAddress object

current admin account

address string

address to remove from operators list.

gasPrice number

(optional) - the gasPrice desired for the tx

Return:

*

public async transferAdmin(adminAddress: object, address: string, gasPrice: number): * source

transfer admin privilege to given address.

Params:

NameTypeAttributeDescription
adminAddress object

current admin account

address string

new admin address

gasPrice number

(optional) - the gasPrice desired for the tx

Return:

*