new KIP17QueryOptions(size, cursor)
Creates an instance of KIP17QueryOptions.
Example
const options = new caver.kas.kip17.queryOptions(size, cursor)
Parameters:
| Name | Type | Description |
|---|---|---|
size |
number | Maximum number of data to query. |
cursor |
string | Information of the last retrieved cursor. |
Members
size :number
Type:
- number
cursor :string
Type:
- string
Methods
(static) constructFromObject(obj) → {KIP17QueryOptions}
Create an instance of KIP17QueryOptions from object.
You can use object instead of KIP17QueryOptions instance when using caver.kas.kip17.
Because the function of caver.kas.kip17 internally converts object to KIP17QueryOptions instance,
and when converting, validation of the field defined inside Object is performed.
Example
const options = caver.kas.kip17.queryOptions.constructFromObject({ size, cursor })
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
object | An object where query parameters are defined. |
Returns:
- Type
- KIP17QueryOptions
isValidOptions(options) → {boolean}
Make sure that only essential ones are defined for the option values defined in KIP17QueryOptions.
Example
const options = caver.kas.kip17.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