ReserveContract
Extends:
ReserveContract contains extended methods for KyberReserveContract
Constructor Summary
Public Constructor | ||
public |
constructor(provider: object, address: string) Create new BaseContract instance. |
Method Summary
Public Methods | ||
public |
async approveWithdrawAddress(adminAddress: object, tokenAddress: string, withdrawAddress: string, gasPrice: number): object approve withdraw address for a token on reserve. |
|
public |
approvedWithdrawAddresses(address: object, tokenAddress: string): boolean check for approval status of a token address to a particular address |
|
public |
conversionRatesContract return the address of conversion rates of this reserve |
|
public |
async disableTrade(alerterAddress: object, gasPrice: number): object disableTrade stop the reserve from trading |
|
public |
async disapproveWithdrawAddress(adminAddress: object, tokenAddress: string, withdrawAddress: string, gasPrice: number): object disapprove withdraw address for a token on reserve. |
|
public |
async enableTrade(adminAddress: object, gasPrice: number): object enableTrade allow the reserve to continue trading |
|
public |
getBalance(token: string): number Return balance of given token. |
|
public |
kyberNetwork return the address of kyberNetwork contract of this reserve |
|
public |
sanityRatesContract return the address of sanity rates of this reserve |
|
public |
async setContracts(adminAddress: object, network: string, conversion: string, sanity: string, gasPrice: number): object set Contract addresses for reserve contract. |
|
public |
async setTokenWallet(adminAddress: object, tokenAddress: string, walletAddress: object): * set different token wallet per token. |
|
public |
tradeEnabled return true if the reserve is tradeEnabled, false otherwise |
|
public |
async withdraw(operatorAddress: object, tokenAddress: string, amount: object, toAddress: string, gasPrice: number): object withdraw an amount of token to specified account |
Inherited Summary
From class BaseContract | ||
public |
contract: * |
|
public |
web3: * |
|
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 Members
Public Methods
public async approveWithdrawAddress(adminAddress: object, tokenAddress: string, withdrawAddress: string, gasPrice: number): object source
approve withdraw address for a token on reserve.
public approvedWithdrawAddresses(address: object, tokenAddress: string): boolean source
check for approval status of a token address to a particular address
public conversionRatesContract(): string source
conversionRatesContract return the address of conversion rates of this reserve
public async disableTrade(alerterAddress: object, gasPrice: number): object source
disableTrade stop the reserve from trading
public async disapproveWithdrawAddress(adminAddress: object, tokenAddress: string, withdrawAddress: string, gasPrice: number): object source
disapprove withdraw address for a token on reserve.
public async enableTrade(adminAddress: object, gasPrice: number): object source
enableTrade allow the reserve to continue trading
public getBalance(token: string): number source
Return balance of given token.
Params:
Name | Type | Attribute | Description |
token | string | address of token to check balance. |
public kyberNetwork(): string source
kyberNetwork return the address of kyberNetwork contract of this reserve
public sanityRatesContract(): string source
sanityRatesContract return the address of sanity rates of this reserve
public async setContracts(adminAddress: object, network: string, conversion: string, sanity: string, gasPrice: number): object source
set Contract addresses for reserve contract.
Params:
Name | Type | Attribute | Description |
adminAddress | object | address of admin account. |
|
network | string | address of kyber network smart contract. |
|
conversion | string | address of kyber network smart contract. |
|
sanity | string | (optional) - address of sanity rates contract. |
|
gasPrice | number |
|
the gasPrice desired for the tx |
public async setTokenWallet(adminAddress: object, tokenAddress: string, walletAddress: object): * source
set different token wallet per token.
Return:
* |
public tradeEnabled(): boolean source
tradeEnabled return true if the reserve is tradeEnabled, false otherwise
public async withdraw(operatorAddress: object, tokenAddress: string, amount: object, toAddress: string, gasPrice: number): object source
withdraw an amount of token to specified account
Params:
Name | Type | Attribute | Description |
operatorAddress | object | address of operator account. |
|
tokenAddress | string | address of the token's smart contract. Must be deployed already. |
|
amount | object | amount to withdraw (BN|String|int), must be in wei. |
|
toAddress | string | address for withdrawal. Must be approved already. |
|
gasPrice | number |
|
the gasPrice desired for the tx |