Utils

Hint

The rules for generating queries to the node are given in module REST API Node.

POST /utils/hash/secure

Returns secure (double) hash of specified message.

Method query:

ridethewaves!

Method response:

{
  "message": "ridethewaves!",
  "hash": "H6nsiifwYKYEx6YzYD7woP1XCn72RVvx6tC1zjjLXqsu"
}

POST /utils/hash/fast

Returns hash of specified message.

Method query:

ridethewaves!

Method response:

{
  "message": "ridethewaves!",
  "hash": "DJ35ymschUFDmqCnDJewjcnVExVkWgX7mJDXhFy9X8oQ"
}

POST /utils/script/compile

Response parameters:

"script" - скрипт в формате Base64
"complexity" - сложность скрипта
"extraFee" - комиссия за исходящие транзакции, установленные скриптом

Method query:

let x = 1
(x + 1) == 2

Method response:

{
  "script": "3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ",
  "complexity": 11,
  "extraFee": 10001
}

or

Method query:

x == 1

Method response:

{
  "error": "Typecheck failed: A definition of 'x' is not found"
}

POST /utils/script/estimate

Decoding base64 script.

Method query:

AQQAAAABeAAAAAAAAAAAAQkAAAAAAAACCQAAZAAAAAIFAAAAAXgAAAAAAAAAAAEAAAAAAAAAAAJdecYi

Method response:

{
  "script": "3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ",
  "scriptText": "FUNCTION_CALL(FunctionHeader(==,List(LONG, LONG)),List(CONST_LONG(1), CONST_LONG(2)),BOOLEAN)",
  "complexity": 11,
  "extraFee": 10001
}

GET /utils/time

Returns current node time.

Method response:

{
   "system": 1544715343390,
   "NTP": 1544715343390
}

POST /utils/reload-wallet

Reloads node keystore. Runs if new key pair was created in keystore without restarting node.

Method response:

{
   "message": "Wallet reloaded successfully"
}