Methods
deleteBot(port) → {Error}
- Source:
Function to stop and remove a bot.
- Does NOT consider cancelling orders
Example
// just issue the command directly, but expect no response:
deleteBot(38701)
Parameters:
Name | Type | Description |
---|---|---|
port |
string | number | The port number of the bot to stop/remove |
Returns:
return an error as of Nov 2021
- Type
- Error
downloadNefertiti()
- Source:
Downloads the latest release from GitHub for the client platform and architecture.
filterMarketsByCurrency(exchangeCode, filterCurrency)
Filter all of the markets that match a string
Example
const gdaxEthMarkets = filtermarketsByCurrency('gdax', 'ETH-')
console.log(gdaxEthMarkets)
[
{ name: 'ETH-USDT' },
{ name: 'ETH-GBP' },
{ name: 'ETH-EUR' },
{ name: 'ETH-DAI' },
{ name: 'ETH-BTC' },
{ name: 'ETH-USDC' },
{ name: 'ETH-USD' }
]
Parameters:
Name | Type | Description |
---|---|---|
exchangeCode |
string | Can be exchange code (KUCN)or full name |
filterCurrency |
string | Case-sensitive market to search Can be used as a quote currency with a hyphen in the correct place ('-BTC') |
Returns:
an array of market objects that contain a string including @filterCurrency
getAvailableMarkets(exchangeCode) → {array}
- Source:
Get all of the available markets for an exchange
Example
const gdaxMarkets = getAvailableMarkets('gdax');
Parameters:
Name | Type | Description |
---|---|---|
exchangeCode |
string | Exchange to use. can be code: 'kucn' or name: 'kucoin' |
Returns:
returns an array of objects
- Type
- array
getCurrentNefVersion() → {string}
- Source:
Check the current version of Nefertiti
Example
const currentVersion = getCurrentNefVersion();
console.log(currentVersion);
Returns:
- current version of Nefertiti
- Type
- string
getSupportedExchanges() → {array}
- Source:
Check which exchanges are currently supported by Nefertiti
Example
const availableExchanges = getSupportedExchanges();
console.log(availableExchanges)
Returns:
- an array of objects of each supported exchange
- Type
- array
pingBot(port) → {JSON}
- Source:
Request information for a specific bot
Example
// Call the function and chain it with .then():
pingBot(38701).then((results)=>{console.log(results)})
// or await it
const sellBot = await pingBot(38701)
// Return object example:
{
port: 38701,
command: 'sell',
args: [ 'listen',...]
}
Parameters:
Name | Type | Description |
---|---|---|
port |
string | number | The port that the bot is running on. |
Returns:
Returns a JSON object
- Type
- JSON
pingHub() → {JSON}
- Source:
Ping the listen server to get all running bots
Example
// Call the function and chain it with .then():
pingHub().then((results) => {
console.log(results, results.length);
});
// Return object example:
[{
port: 38701,
command: 'sell',
args: ['listen',...]
},
{
port: 38702,
command: 'buy',
args: ['listen',...]
}]
Returns:
Returns parsed JSON array of objects
- Type
- JSON
postBot(command, api, args) → {Promise.<array>}
- Source:
Issue a POST request to start a bot
Example
apis.postBot('buy', ['gdax', 'apiKey123',...], {'mult': 1.05,...})
.then((res) => {
console.table(res);
});
Parameters:
Name | Type | Description |
---|---|---|
command |
string | must be either 'sell' or 'buy' |
api |
array | An array of exchange API key information. Must be in this order: [ |
args |
object | Object keys are Nefertiti flags with appropriate values: {'mult': 1.05, 'market': 'BTC-USD'} |
Returns:
- Returns an array of objects with running bot information. Should be chained with '.then()'
- Type
- Promise.<array>
sendNotificationsTest(service, appKey, chatKey)
- Source:
Sends a message to the notifications service
Parameters:
Name | Type | Description |
---|---|---|
service |
string | the notification service. can be 'pushover' or 'telegram' |
appKey |
string | application key |
chatKey |
string | chat key (for telegram) or user key (for pushover) |
updateBot(port, args) → {Promise.<array>}
- Source:
Issue a POST request to update a specific bot
Example
updateBot(38702, { mult: '1.1' }).then((res) => {
console.log(res)
}
Parameters:
Name | Type | Description |
---|---|---|
port |
string | number | Port of the bot to update |
args |
object | Object keys are Nefertiti flags with appropriate values {'mult': 1.05} |
Returns:
- Returns an array of objects with running bot information. Should be chained with '.then()'
- Type
- Promise.<array>
updateNef() → {string}
- Source:
Update the Nefertiti binary to the latest version
Returns:
- the results of the update, including version
- Type
- string