Constructor
new EveToken(options)
Creates a new instance of EveToken.
// creates an eveTokenClient with the default params
let eveTokenClient = new EveToken();
// creates an eveTokenClient pointing to a custom address
let eveTokenClient = new EveToken({address:'0xf17f52151EbEF6C7334FAD080c5704DAAA16b732'});
Parameters:
Name | Type | Description |
---|---|---|
options |
ClientOptions |
network connection options |
- Version:
-
- 2
- Source:
Extends
Methods
(async) totalSupply() → {Promise.<BigNumber>}
Checks the total existing EVE supply.
- Source:
(async) balanceOf(account) → {Promise.<*>}
Checks the EVE balance of a given account.
Parameters:
Name | Type | Description |
---|---|---|
account |
account whose balance is being inquired |
- Source:
(async) allowance(tokenOwner, spender, overrideOptions) → {Promise.<*>}
Checks how many tokens a 3rd party can use to facilitate a transaction with the owners token.
Please note that allowance
will not transfer tokens to the 3rd party, but instead give him
permission to facilitate transactions on your behalf.
Parameters:
Name | Type | Description |
---|---|---|
tokenOwner |
token owner |
|
spender |
ethereum address |
|
overrideOptions |
TransactionOptions |
- Source:
(async) estimateAllowance(tokenOwner, spender, overrideOptions, overrideOptions)
This method gives an estimation of how much gas will be used for the method EveToken.allowance the params that you pass to this method shall be exactly the same ones that you would pass to EveToken.allowance. the return of this method will be the total gas used to call EveToken.allowance with the given parameters. It's important to note that a call to this method will only be successful if the call to EveToken.allowance would be a valid call
Parameters:
Name | Type | Description |
---|---|---|
tokenOwner |
token owner |
|
spender |
ethereum address |
|
overrideOptions |
TransactionOptions | |
overrideOptions |
TransactionOptions |
- Source:
(async) approve(spender, quantity, overrideOptions) → {Promise.<*>}
Gives the 3rd party the right to facilitate a transaction with the owners token.
Please note that approve
will not transfer tokens to the 3rd party, but instead give him
permission to facilitate transactions on your behalf.
Parameters:
Name | Type | Description |
---|---|---|
spender |
ethereum address, that has right to spend the approved tokens, this can be a contract address or any other address |
|
quantity |
that the 3rd party is allowed to spend |
|
overrideOptions |
TransactionOptions |
- Source:
(async) estimateApprove(spender, quantity, overrideOptions)
This method gives an estimation of how much gas will be used for the method EveToken.approve the params that you pass to this method shall be exactly the same ones that you would pass to EveToken.approve. the return of this method will be the total gas used to call EveToken.approve with the given parameters. It's important to note that a call to this method will only be successful if the call to EveToken.approve would be a valid call
Parameters:
Name | Type | Description |
---|---|---|
spender |
ethereum address, that has right to spend the approved tokens, this can be a contract address or any other address |
|
quantity |
that the 3rd party is allowed to spend |
|
overrideOptions |
TransactionOptions |
- Source:
(async) transfer(toAddress, total, overrideOptions) → {Promise.<*>}
Transfer EVE tokens from the current account to any other account
Parameters:
Name | Type | Description |
---|---|---|
toAddress |
address, that will receive the tokens |
|
total |
quantity of tokens being sent |
|
overrideOptions |
TransactionOptions |
- Source:
(async) estimateTransfer(toAddress, total, overrideOptions)
This method gives an estimation of how much gas will be used for the method EveToken.transfer the params that you pass to this method shall be exactly the same ones that you would pass to EveToken.transfer. the return of this method will be the total gas used to call EveToken.transfer with the given parameters. It's important to note that a call to this method will only be successful if the call to EveToken.transfer would be a valid call
Parameters:
Name | Type | Description |
---|---|---|
toAddress |
address, that will receive the tokens |
|
total |
quantity of tokens being sent |
|
overrideOptions |
TransactionOptions |
- Source:
(async) getAirdrop(overrideOptions)
If you are using testnet and need some EVE for testing you can call this method to get 100 test eve. IMPORTANT: this method only works in test net and is meant to be used for testing purposes only, you cannot call it in prod
Parameters:
Name | Type | Description |
---|---|---|
overrideOptions |
TransactionOptions |
default override options from ethersjs |
- Source:
(async) transferFrom(from, to, tokens, overrideOptions) → {Promise.<*>}
Transfer EVE tokens from a specific account to any other account. You need to have an allowance permission to be able to do this transaction.
Parameters:
Name | Type | Description |
---|---|---|
from |
the address, that EVE tokens will be sent from |
|
to |
the address, that will receive the tokens |
|
tokens |
quantity of tokens being sent |
|
overrideOptions |
TransactionOptions |
- Source:
(async) estimateTransferFrom(from, to, tokens, overrideOptions)
This method gives an estimation of how much gas will be used for the method EveToken.transferFrom the params that you pass to this method shall be exactly the same ones that you would pass to EveToken.transferFrom. the return of this method will be the total gas used to call EveToken.transferFrom with the given parameters. It's important to note that a call to this method will only be successful if the call to EveToken.transferFrom would be a valid call
Parameters:
Name | Type | Description |
---|---|---|
from |
the address, that EVE tokens will be sent from |
|
to |
the address, that will receive the tokens |
|
tokens |
quantity of tokens being sent |
|
overrideOptions |
TransactionOptions |
- Source:
setApprovalListener(callback)
Listener to the Approval events, this event triggers whenever a new devery app is created in the blockchain. Please note, that ApprovalEventListeners do not stack, this means that whenever you set one - you are removing the last one. If you want to remove an ApprovalEventListener, just call this function passing undefined as param.
// first you need to get a EveToken instance
let eveTokenClient = new EveToken();
// now you can use it
eveTokenClient.setApprovalListener((appAccount,appName,feeAccount,fee,active) => {
// whenever an app created we will log it to the console
console.log(`new app created ${appAccount} - ${appName} ...`);
})
// if you want to remove the listener you can simply pass undefined as parameter
eveTokenClient.setApprovalListener(undefined)
// or that is equivalent to the above call
eveTokenClient.setApprovalListener()
for more info about how to get a EveToken instance click here.
Parameters:
Name | Type | Description |
---|---|---|
callback |
AprovalEventCallback |
the callback that will be executed whenever the Transfer event is triggered |
- Source:
setTransferListener(callback)
Listener to the Transfer events, this event triggers whenever a new devery app is created in the blockchain. Please note that TransferEventListeners do not stack, this means that whenever you set one you are removing the last one. If you want to remove a TransferEventListener, just call this function passing undefined as param.
// first you need to get a EveToken instance
let eveTokenClient = new EveToken();
// now you can use it
eveTokenClient.setTransferListener((appAccount,appName,feeAccount,fee,active) => {
// whenever an app created we will log it to the console
console.log(`new app created ${appAccount} - ${appName} ...`);
})
// if you want to remove the listener you can simply pass undefined as parameter
eveTokenClient.setTransferListener(undefined)
// or that is equivalent to the above call
eveTokenClient.setTransferListener()
for more info about how to get a EveToken instance click here.
Parameters:
Name | Type | Description |
---|---|---|
callback |
TransferEventCallback |
the callback that will be executed whenever the OwnershipTransferred event is triggered |
- Source:
getSignerAddress() → {*}
You can use this method to check the current signer wallet address.
- Overrides:
- Source:
getProvider() → {*}
Returns the internal signer or provider, this method needs to be used with caution as it exposes internals. So unless you know what you are doing it's better to avoid using it.
- Overrides:
- Source: