WalletQueryOptions

WalletQueryOptions

Class where query parameters for Anchor API are defined.

Constructor

new WalletQueryOptions(size, fromTimestamp, toTimestamp, cursor, status)

Creates an instance of WalletQueryOptions.

Parameters:
Name Type Description
size number

Maximum number of data to query.

fromTimestamp number | string | Date

The starting date of the data to be queried.

toTimestamp number | string | Date

The ending date of the data to be queried.

cursor string

Information of the last retrieved cursor.

status string

The status of account.

Members

size :number

Type:
  • number

fromTimestamp :Date

Type:
  • Date

toTimestamp :Date

Type:
  • Date

cursor :string

Type:
  • string

status :string

Type:
  • string

Methods

(static) constructFromObject(obj) → {WalletQueryOptions}

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

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

An object where query parameters are defined.

Returns:
Type
WalletQueryOptions

isValidOptions(options) → {boolean}

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

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

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

Returns:
Type
boolean