MintChip

Represents the primary controller for interacting with MintChip.

Methods

mintChip.createValueMessage(request)

Creates (withdraws) value from this MintChip.

Parameters:
request - the requested value to be created - an instance of ValueRequestMessage.
Returns:
the Value Message requested - an instance of ValueMessage.
Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip, if the requested value message exceeds one of the chips operational parameters.

mintChip.getLastCreatedValueMessage(annotation)

Retrieves the last Value Message created by this MintChip.

Parameters:
annotation - an optional text description to be included in the Value Message.
Returns:
the last ValueMessage created by this MintChip or null if no Value Messages have been created by this MintChip.
Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.

mintChip.getStatus()

Retrieves the current status of this MintChip.

Parameters:
None.
Returns:
the current status of this MintChip - an instance of MintChipStatus.
Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.

mintChip.isValidId(mintChipId)

Validates whether the supplied Id is a valid MintChip account Id.

Parameters:
mintChipId - the MintChip account Id to be validated.
Returns:
true if the supplied id is a valid MintChip account id; otherwise, false.

mintChip.loadValueMessage(valueMessage)

Loads (deposits) the specified Value Message onto this instance of MintChip.

Parameters:
valueMessage - the value to be loaded - an instance of ValueMessage.
Returns:
None.
Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip, if the value has already been loaded, if the value message exceeds one of the chips operational parameters, if the value message has been tampered with.

mintChip.readTransactionLog(logType, startIndex, numOfEntries)

Retrieves the specified log entry(s) from this MintChip.

Parameters:
logType - the type of entry - one of the values defined by the LogType.
startIndex - the 0 based index to start retrieving from.
numOfEntries - the number of items to retrieve.
Returns:
array of LogEntry objects of the specified length or until the end of the log or an empty array if the specified startIndex is beyond the number of log entries.
Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.
Properties

mintChip.currencyCode

Retrieves the currency code for this MintChip.

Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.

mintChip.id

Retrieves the MintChip account Id from this MintChip.

Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.

mintChip.version

Retrieves the version for this MintChip.

Exception:
if MintChip is missing/faulty or if communication errors occurred with MintChip.