# Utils
# POST /utils/hash/secure
Produce a secure hash of a specified message.
Request:
ridethewaves!
Response JSON example:
{
"message": "ridethewaves!",
"hash": "H6nsiifwYKYEx6YzYD7woP1XCn72RVvx6tC1zjjLXqsu"
}
# POST /utils/hash/fast
Fast hash of specified message.
Request:
ridethewaves!
Response JSON example:
{
"message": "ridethewaves!",
"hash": "DJ35ymschUFDmqCnDJewjcnVExVkWgX7mJDXhFy9X8oQ"
}
# GET /utils/seed/{length}
Generate a random seed of specified length.
Response JSON example:
{
"seed": "3XcHLU6bYRax1c"
}
# GET /utils/seed
Generate a random seed.
Response JSON example:
{
"seed": "2uwLAe7Rp7TuNiBTKsmTEJ5wxGqkBHjcyPq2tMXiWye7"
}
# POST /utils/script/compile
Compiles a human-readable code into a Base58 representation for Node.
Request body: A code.
Response params:
"script" - Base58-encoded representation of compiled script for Node
"complexity" - How script is complicated
"extraFee" - An extra fee for all transactions going from an account with this script if the miner is this node
A valid request body example:
let x = 1
(x + 1) == 2
Response for it:
{
"script": "3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ",
"complexity": 11,
"extraFee": 10001
}
An invalid request body example:
x == 1
Response for it:
{
"error": "Typecheck failed: A definition of 'x' is not found"
}
# POST /utils/script/estimate
Estimates a human-readable code into a Base58 representation for Node.
Request body: A code.
Response params:
"script" - Base58-encoded representation of compiled script for Node (what did you send in the body)
"scriptText" - String representation of a script (not decompiled!)
"complexity" - How script is complicated
"extraFee" - An extra fee for all transactions going from an account with this script if the miner is this node
A valid request body example:
3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ
Response for it:
{
"script": "3rbFDtbPwAvSp2vBvqGfGR9nRS1nBVnfuSCN3HxSZ7fVRpt3tuFG5JSmyTmvHPxYf34SocMRkRKFgzTtXXnnv7upRHXJzZrLSQo8tUW6yMtEiZ",
"scriptText": "FUNCTION_CALL(FunctionHeader(==,List(LONG, LONG)),List(CONST_LONG(1), CONST_LONG(2)),BOOLEAN)",
"complexity": 11,
"extraFee": 10001
}
An invalid request body example:
This is even not a Base58 string!
Response for it:
{
"error": "Unable to decode base58: assertion failed: Wrong char in Base58 string"
}