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) 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) call()
Wrapper for callETHMethod function (@see callETHMethod)
- Source:
(async) call()
Wrapper for callContractMethod function (@see callContractMethod)
- 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
(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
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
Promise (@see getContractGasLimit)
(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 transaction
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with estimate gas value
(async) estimateGas()
Wrapper for estimateContractGas function (@see estimateContractGas)
- 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 contract transaction
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
Returns:
Promise that will be resolved with estimate gas value
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) getContractGasLimit(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
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) getEvents(Event, optionsopt)
Gets past events
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Event |
function | Function to get past events | ||||||||||||||||||||||||||
options |
object |
<optional> |
{} | Event options
Properties
|
- Source:
Returns:
Promise that will be resolved with past events
(async) getGasLimit(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) 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) 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 getPast)
(async) getPastEvents()
Wrapper for getPastContractEvents function (@see getPastContractEvents)
- Source:
(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) 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
initWeb3(payload) → {object}
Initialises web3 object globally
Parameters:
Name | Type | Description | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
object | Payload object
Properties
|
- Source:
Returns:
The same (as input) payload object
- Type
- object
(async) isApproveAllowed(props)
Gets isApproveAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the isApproveAllowed flag
(async) isApprovedSpendingAllowed(props)
Gets isApprovedSpendingAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
Returns:
Promise that will be resolved with the isApprovedSpendingAllowed flag
(async) isReceivingAllowed(props)
Gets isReceivingAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the isReceivingAllowed flag
(async) isSpendingAllowed(props)
Gets isSpendingAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the isSpendingAllowed flag
(async) isTransferAllowed(props)
Gets isTransferAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
- Source:
Returns:
Promise that will be resolved with the isTransferAllowed flag
(async) isTransferFromAllowed(props)
Gets isTransferFromAllowed flag
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
props |
object | API function properties
Properties
|
Returns:
Promise that will be resolved with the isTransferFromAllowed flag
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) 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(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 sendContractTransaction function (@see sendContractTransaction)
- Source:
(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)
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) 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) 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: