KIP7QueryOptions

KIP7QueryOptions

new KIP7QueryOptions(size, cursor, status)

Creates an instance of KIP7QueryOptions.

Example
const options = new caver.kas.kip7.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.kip7.queryOptions.status.

Members

size :number

Type:
  • number

cursor :string

Type:
  • string

status :string

Type:
  • string

Methods

(static) constructFromObject(obj) → {KIP7QueryOptions}

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

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

An object where query parameters are defined.

Returns:
Type
KIP7QueryOptions

isValidOptions(options) → {boolean}

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

Example
const options = caver.kas.kip7.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