BlockController.js
/**
   * Web API POST endpoint validates message signature with JSON response, url: "/message-signature/validate"
   */
Web API POST endpoint validates message signature with JSON response, url: "/message-signature/validate"
Web API POST endpoint validates message signature with JSON response url : " / message - signature / validate "
postValidate() {
    this.app.post("/message-signature/validate", (req, res) => {
      try {
        let mempoolEntry = this.mempool.validateRequestByWallet(req);
        if (mempoolEntry.walletValidated === true) {
          res.status(200).json({
            "registerStar" : mempoolEntry.walletValidated,
            "status" : {
              "address" : mempoolEntry.address,
              "requestTimeStamp" : mempoolEntry.requestTimeStamp,
              "message" : mempoolEntry.message,
              "validationWindow" : mempoolEntry.validationWindow,
              "messageSignature" : mempoolEntry.walletValidated
            }
          });
        }
        else {
          console.log(`Bad request: ${mempoolEntry.walletValidatedStatus}`);
          res.status(400).send(`Bad request: ${mempoolEntry.walletValidatedStatus}`);         
        }
      }
      catch(err) {
        console.log(`Bad request: ${err}`);
        res.status(400).send(`Bad request: ${err}`);
      }
      res.end();
    });
  }
postValidate ( ) { this . app . post ( "/message-signature/validate" , ( req , res ) => { try { let mempoolEntry = this . mempool . validateRequestByWallet ( req ) ; if ( mempoolEntry . walletValidated === true ) { res . status ( 200 ) . json ( { "registerStar" : mempoolEntry . walletValidated , "status" : { "address" : mempoolEntry . address , "requestTimeStamp" : mempoolEntry . requestTimeStamp , "message" : mempoolEntry . message , "validationWindow" : mempoolEntry . validationWindow , "messageSignature" : mempoolEntry . walletValidated } } ) ; } else { console . log ( ` ${ mempoolEntry . walletValidatedStatus } ` ) ; res . status ( 400 ) . send ( ` ${ mempoolEntry . walletValidatedStatus } ` ) ; } } catch ( err ) { console . log ( ` ${ err } ` ) ; res . status ( 400 ) . send ( ` ${ err } ` ) ; } res . end ( ) ; } ) ; }
Web API POST endpoint validates message signature with JSON response, url: "/message-signature/validate"
Web API POST endpoint validates message signature with JSON response url : " / message - signature / validate "