Class: Helius

Helius(apiKey)

This is the base level class for interfacing with all Helius API methods.

Constructor

new Helius(apiKey)

Initializes Helius API client with an API key
Parameters:
Name Type Description
apiKey API key generated at dev.helius.xyz
Source:

Methods

appendAddressesToWebhook(webhookID, newAccountAddresses) → {Promise.<Webhook>}

Appends an array of addresses to an existing webhook by its ID
Parameters:
Name Type Description
webhookID string the ID of the webhook to edit
newAccountAddresses Array.<string> the array of addresses to be added to the webhook
Source:
Throws:
if there is an error calling the webhooks endpoint, if the response contains an error, or if the number of addresses exceeds 10,000
Type
Error
Returns:
a promise that resolves to the edited webhook object
Type
Promise.<Webhook>

createWebhook(createWebhookRequest) → {Promise.<Webhook>}

Creates a new webhook with the provided request
Parameters:
Name Type Description
createWebhookRequest CreateWebhookRequest the request object containing the webhook information
Source:
Throws:
if there is an error calling the webhooks endpoint or if the response contains an error
Type
Error
Returns:
a promise that resolves to the created webhook object
Type
Promise.<Webhook>

deleteWebhook(webhookID) → {Promise.<boolean>}

Deletes a webhook by its ID
Parameters:
Name Type Description
webhookID string the ID of the webhook to delete
Source:
Throws:
if there is an error calling the webhooks endpoint or if the response contains an error
Type
Error
Returns:
a promise that resolves to true if the webhook was successfully deleted, or false otherwise
Type
Promise.<boolean>

editWebhook(webhookID, editWebhookRequest) → {Promise.<Webhook>}

Edits an existing webhook by its ID with the provided request
Parameters:
Name Type Description
webhookID string the ID of the webhook to edit
editWebhookRequest EditWebhookRequest the request object containing the webhook information
Source:
Throws:
if there is an error calling the webhooks endpoint or if the response contains an error
Type
Error
Returns:
a promise that resolves to the edited webhook object
Type
Promise.<Webhook>

getAllWebhooks() → {Promise.<Array.<Webhook>>}

Retrieves a list of all webhooks associated with the current API key
Source:
Throws:
if there is an error calling the webhooks endpoint or if the response contains an error
Type
Error
Returns:
a promise that resolves to an array of webhook objects
Type
Promise.<Array.<Webhook>>

getWebhookByID(webhookID) → {Promise.<Webhook>}

Retrieves a single webhook by its ID, associated with the current API key
Parameters:
Name Type Description
webhookID string the ID of the webhook to retrieve
Source:
Throws:
if there is an error calling the webhooks endpoint or if the response contains an error
Type
Error
Returns:
a promise that resolves to a webhook object
Type
Promise.<Webhook>