Module: celsius-js-sdk/util

Celsius js SDK Util

Source:

Methods

(inner) getFormData(formFields, files) → {Promise}

Creates and returns form data from provided form fields and files

Parameters:
Name Type Description
formFields object

Object containing form fields

files object

Object containing files. Keys are field names, values are paths

Source:
Returns:

FormData that is to be sent with a request

Type
Promise

(inner) readFile(filePath) → {Promise}

Reads a file asynchronously.

Parameters:
Name Type Description
filePath string

Path to the file

Source:
Returns:

Contents of a file stored in a buffer

Type
Promise

(inner) Util(config) → {Util}

Creates and configures Util

Parameters:
Name Type Description
config object

Contains configuration data

Source:
Returns:
Type
Util

(inner) verifyResponse(data, signature) → {boolean}

Verifies responses received from api.

Parameters:
Name Type Description
data object

Response data

signature string

Header containing signature

Source:
Returns:

Result of verification

Type
boolean