requestKey(deviceAddr: String, duration: Int)
Creates key for device if possible.
If no price is specified in the "key_price" entry, such a key cannot be purchased
Can only be purchased by the owner of the device ('owner' entry in the device)
A default token payment equal to
<key_price> * <time in minutes>
is requiredThe validity of such a key is calculated from the date of purchase
Params:
deviceAddr
- address of deviceduration
- time in minutes
Requirements:
price per minute defined in device
user is owner of device
the payment amount is equal
Error messages:
[E13] Not an owner
- device not owned by user[E14] Wrong price
- wrong amount of asset[E16] Wrong payment
- supported only native token[E17] Wrong payment value, expected <value>
[E21] Price not specified in device
[E22] Owner not specified in device
Last updated