Methods
add0x(data)
Adds 0x prefix to string
Parameters:
Name | Type | Description |
---|---|---|
data |
string | string that should be prefixed by 0x |
- Source:
Returns:
String with 0x prefix
(async) allEvents(props)
Subscribes to all contract events
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event emitter (@see subsribe)
(async) allEvents(props)
Subscribes to all contract events
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event emitter (@see subsribe)
(async) balanceOf(props)
Gets balance of specific address
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the balance of owner address
(async) burn(props)
Burn tokens
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of created contract transaction
(async) BurnEvent(props)
Subscribes to BurnEvent event
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event emitter (@see subsribe)
(async) call()
Wrapper for callContractMethod function (@see callContractMethod)
- Source:
(async) call()
Wrapper for callETHMethod function (@see callETHMethod)
- Source:
(async) callContractMethod(payload)
Calls specific contract method with provided arguments
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with the result of contract method execution
(async) callETHMethod(payload)
Calls specific web3.eth method with provided arguments
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with the result of web3.eth method execution
checkWeb3(payload) → {object}
Checks web3 connection status. Sets web3 globally if it does not exist
Parameters:
Name | Type | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
The same (as input) payload object
- Type
- object
(async) decimals(props)
Gets token decimals
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with token decimals
(async) estimateContractGas(payload)
Gets estimate gas for the contract transaction
Only one of the two params ({privateKey} or {from}) is required
{privateKey} has higher priority
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise (@see getContractGasLimit)
(async) estimateContractGas(method, args)
Gets gas limit for the contract transaction
Parameters:
Name | Type | Description |
---|---|---|
method |
function | Contract method that used to send transaction |
args |
array | Contract method argumets |
- Source:
Returns:
Promise that will be resolved with estimate gas for sending of the contract transaction
(async) estimateETHGas(payload)
Gets estimate gas for the transaction
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with estimate gas value
(async) estimateGas()
Wrapper for estimateETHGas function (@see estimateETHGas)
- Source:
(async) estimateGas(props)
Gets estimate gas for the contract transaction
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with estimate gas value
(async) estimateGas(props)
Gets estimate gas for the transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with estimate gas value
(async) estimateGas(props)
Gets gas limit for the transaction
Parameters:
Name | Type | Description |
---|---|---|
props |
object | Properties of the web3.eth.estimateGas function |
- Source:
Returns:
Promise that will be resolved with estimate gas for sending of the transaction
(async) estimateGas()
Wrapper for estimateContractGas function (@see estimateContractGas)
- Source:
filter(optionsopt) → {object}
Gets filter object, that can be used for getting of past logs or watching of new
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{} | Filter options
Properties
|
- Source:
Returns:
- Type
- object
filterETHLogs(payload) → {object}
Initializes filter object
Parameters:
Name | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
The event emitter (@see subscribe)
- Type
- object
(async) filterLogs()
Wrapper for filterETHLogs function (@see filterETHLogs)
- Source:
getAddressFromPrivateKey(privateKey) → {string}
Gets account's address from its private key
Parameters:
Name | Type | Description |
---|---|---|
privateKey |
string | Private key (64 hex symbols, without '0x' prefix) |
- Source:
Returns:
Account's address
- Type
- string
(async) getBalance(props)
Gets balance of the provided address
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with balance of the provided address
(async) getBlock(props)
Returns block data
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with block data
(async) getBlockNumber(props)
Gets current block number
Parameters:
Name | Type | Default | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with current block number
(async) getCode(props)
Get the code at a specific address
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with code of the provided address
getContractInstance(payload) → {object}
Gets contract instance
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
Returns:
Contract instance
- Type
- object
(async) getContractRawTx(payload)
Gets raw contract transaction data
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with raw contract transaction data
(async) getETHNonce(payload)
Gets thansaction count for sending transactions
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with transaction count value
(async) getEvents(optionsopt)
Gets past events
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{} | Event options
Properties
|
- Source:
Returns:
Promise that will be resolved with past events
(async) getGasPrice(payload)
Wrapper for getGasPrice function (@see getGasPrice)
Parameters:
Name | Type | Description |
---|---|---|
payload |
Object | Payload object |
- Source:
(async) getGasPrice(props)
Gets current gas price median value for latest X blocks
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with current gas price value
getGasPrice()
Request current gas price from ethereum node
- Source:
Returns:
Promise that will be resolved with gasPrice for sending the transaction
(async) getLogs(optionsopt)
Gets past logs
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
{} | Filter options
Properties
|
- Source:
Returns:
Promise that will be resolved with past logs
(async) getLogsFilter(props)
Returns object for filtering of logs
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the filter object (@see filter)
(async) getNonce()
Wrapper for getETHNonce function (@see getETHNonce)
- Source:
(async) getNonce(props)
Gets nonce number for the address
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with nonce number
(async) getPastContractEvents(payload)
Gets past contract events
Parameters:
Name | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with past events (@see getEvents)
(async) getPastETHLogs(payload)
Gets past ETH logs
Parameters:
Name | Type | Description | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with past logs (@see getLogs)
(async) getPastEvents(props)
Gets past events
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event logs (@see getEvents)
(async) getPastEvents()
Wrapper for getPastContractEvents function (@see getPastContractEvents)
- Source:
(async) getPastEvents(props)
Gets past events
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event logs (@see getEvents)
(async) getPastLogs()
Wrapper for getPastETHLogs function (@see getPastETHLogs)
- Source:
(async) getPastLogs(props)
Gets past events
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event logs (@see getLogs)
(async) getRawTx(props)
Gets raw transaction data
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | Properties
Properties
|
- Source:
Returns:
Promise that will be resolved with raw transaction data
(async) getTransaction(props)
Returns transaction data
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with transaction data
(async) getTransactionCount(address, defaultBlockopt)
Gets transaction count for specified address
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
address |
string | Ethereum address | |
defaultBlock |
number | string |
<optional> |
Redefines of web3.eth.defaultBlock |
- Source:
Returns:
Promise that will be resolved with nonce for sending the transaction
(async) getTransactionReceipt(props)
Returns the receipt of a transaction
Parameters:
Name | Type | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | {} | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with transaction receipt
memoize(fn)
Caches result of some function
Parameters:
Name | Type | Description |
---|---|---|
fn |
function | Function to memoize |
- Source:
Returns:
Result from cache (if exists) or result of the provided function excecution
(async) mint(props)
Mint tokens
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of created contract transaction
(async) MintEvent(props)
Subscribes to MintEvent event
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event emitter (@see subsribe)
(async) name(props)
Gets token name
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the token name
(async) sendContractTransaction(payload)
Sends contract transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of the contract transaction
(async) sendETHTransaction(payload)
Sends transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of the transaction
(async) sendTransaction()
Wrapper for sendContractTransaction function (@see sendContractTransaction)
- Source:
(async) sendTransaction(props)
Sends transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of created transaction
(async) sendTransaction()
Wrapper for sendETHTransaction function (@see sendETHTransaction)
- Source:
signTx(rawTx, privateKey) → {string}
Signs raw transaction data with the specified private key
Parameters:
Name | Type | Description |
---|---|---|
rawTx |
object | Transaction data |
privateKey |
string | Private key (64 hex symbols, without '0x' prefix) |
- Source:
Returns:
Serialized string of signed transaction
- Type
- string
subscribe(Event, optionsopt, callbackopt) → {object}
Subscribes to provided event
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Event |
function | Function for event subscribing | ||||||||||||||||||||||||||
options |
object |
<optional> |
{} | Event options
Properties
|
||||||||||||||||||||||||
callback |
eventCallback |
<optional> |
Callback which fired for each event or error |
- Source:
Returns:
The event emitter has the following events:
- data: Fires on each incoming event with the event object as argument
- error: Fires when an error in the subscription occours
- data: Fires on each incoming event with the event object as argument
- error: Fires when an error in the subscription occours
- Type
- object
subscribeToContractEvent(payload) → {object}
Subscribes to specific contract event
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
The event emitter (@see subscribe)
- Type
- object
(async) subscribeToEvent()
Wrapper for subscribeToContractEvent function (@see subscribeToContractEvent)
- Source:
(async) symbol(props)
Gets token symbol
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the token symbol
(async) totalSupply(props)
Gets total supply of tokens
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the total supply of tokens
(async) Transfer(props)
Subscribes to Transfer event
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the event emitter (@see subsribe)
(async) transfer(props)
Transfers tokens
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the hash of created contract transaction
(async) validate(payload)
Validates input parameters by schema
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise that will be resolved with received payload comprising validated properties
Type Definitions
BigNumber
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
isBigNumber |
boolean |
<optional> |
type identifier, optional, because supported from v3.1.0 |
c |
Array.<number> | coefficient | |
e |
number | exponent | |
s |
number | sign |
- Source:
eventCallback(error, event)
Parameters:
Name | Type | Description |
---|---|---|
error |
Object | |
event |
Object |
- Source:
Events
subscribeDataEvent
Data event
Type:
- object
- Source:
subscribeErrorEvent
Error event
Type:
- object
- Source: