Skip to content
LogoLogo

Challenge.verify

Verify a Challenge HMAC

Verifies that a Challenge ID matches the expected HMAC for the given parameters.

Use the same server-managed secret that produced the Challenge ID.

Usage

import {  } from 'mppx'
 
const  = ..!
 
const  = .({
  : 'charge',
  : 'tempo',
  : 'mpp.dev',
  : {
    : '1000000',
    : '0x20c0000000000000000000006a37DA5C996874BE', // OUSD on Tempo
    : '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
  },
  ,
})
 
const  = .(, {  })
// => true

Return type

type ReturnType = boolean

true if the Challenge ID is valid, false otherwise.

Parameters

challenge

  • Type: Challenge

The Challenge to verify.

options

secretKey

  • Type: string

Server secret for HMAC-bound Challenge ID verification. Keep it server-side and load it from your environment or secret manager.