KIP37QueryOptions

KIP37QueryOptions

new KIP37QueryOptions(size, cursor, status)

Creates an instance of KIP37QueryOptions.

Example
const options = new caver.kas.kip37.queryOptions(size, cursor)
Parameters:
Name Type Description
size number

Maximum number of data to query.

cursor string

Information of the last retrieved cursor.

status string

Labeling status ['all', 'init', 'submitted', 'deployed']. You can use caver.kas.kip37.queryOptions.status.

Members

size :number

Type:
  • number

cursor :string

Type:
  • string

status :string

Type:
  • string

Methods

(static) constructFromObject(obj) → {KIP37QueryOptions}

Create an instance of KIP37QueryOptions from object.
You can use object instead of KIP37QueryOptions instance when using caver.kas.kip37.
Because the function of caver.kas.kip37 internally converts object to KIP37QueryOptions instance, and when converting, validation of the field defined inside Object is performed.

Example
const options = caver.kas.kip37.queryOptions.constructFromObject({ size, cursor, status })
Parameters:
Name Type Description
obj object

An object where query parameters are defined.

Returns:
Type
KIP37QueryOptions

isValidOptions(options) → {boolean}

Make sure that only essential ones are defined for the option values defined in KIP37QueryOptions.

Example
const options = caver.kas.kip37.queryOptions.constructFromObject({ ... })
const isValid = options.isValidOptions(['size', 'cursor'])
Parameters:
Name Type Description
options Array.<string>

An array containing the names of options used in the function.

Returns:
Type
boolean