waves_logo Docs
  • Node Owner Guide
    Node Owner Guide
  • Install Waves Node
    • Deploy Node in Docker
      Deploy Node in Docker
    • Install Node on Ubuntu
      Install Node on Ubuntu
    • Install Node on macOS
      Install Node on macOS
    • Install Node on Windows
      Install Node on Windows
    • Install from Source (Building SBT)
      Install from Source (Building SBT)
    • Deploy Node in Cloud
      • Deploy Node in Yandex.Cloud
        Deploy Node in Yandex.Cloud
      Deploy Node in Cloud
    Install Waves Node
  • Synchronize Waves Blockchain
    • Import/Export Blockchain
      Import/Export Blockchain
    • Download the Latest Blockchain
      Download the Latest Blockchain
    • Rollback Waves Node
      Rollback Waves Node
    Synchronize Waves Blockchain
  • Upgrade Waves Node
    Upgrade Waves Node
  • Node Configuration
    Node Configuration
  • Logging Configuration
    Logging Configuration
  • Node Wallet
    Node Wallet
  • Features
    • Activation protocol
      Activation protocol
    Features
  • Custom Blockchain
    Custom Blockchain
  • Node API
    • Request headers
      Request headers
    • Activation
      Activation
    • Address
      Address
    • Lease Transactions
      Lease Transactions
    • Assets
      • Public Functions
        Public Functions
      • Private Functions
        Private Functions
      • Distribution Methods
        Distribution Methods
      Assets
    • Alias Transaction
      Alias Transaction
    • Transactions
      Transactions
    • Peers
      Peers
    • Blocks
      Blocks
    • Utils
      Utils
    • Examples of transactions
      Examples of transactions
    • Feature Activation
      Feature Activation
    • API limitations of the pool of public nodes
      API limitations of the pool of public nodes
    Node API
  • Extensions
    • gRPC Server
      gRPC Server
    Extensions
  • Troubleshooting
    Troubleshooting
      • English
      • Русский
      On this page
        • POST /utils/hash/secure
        • POST /utils/hash/fast
        • GET /utils/seed/{length}
        • GET /utils/seed
        • POST /utils/script/compile
        • POST /utils/script/estimate
      waves_logo Docs

          # Utils

          # POST /utils/hash/secure

          master

          Produce a secure hash of a specified message.

          Request:

          ridethewaves!
          

          Response JSON example:

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

          # POST /utils/hash/fast

          master

          Fast hash of specified message.

          Request:

          ridethewaves!
          

          Response JSON example:

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

          # GET /utils/seed/{length}

          master

          Generate a random seed of specified length.

          Response JSON example:

          {
            "seed": "3XcHLU6bYRax1c"
          }
          

          # GET /utils/seed

          master

          Generate a random seed.

          Response JSON example:

          {
            "seed": "2uwLAe7Rp7TuNiBTKsmTEJ5wxGqkBHjcyPq2tMXiWye7"
          }
          

          # POST /utils/script/compile

          master master

          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

          master master

          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"
          }
          
          Blocks
          Examples of transactions
          Blocks
          Examples of transactions