This will allow to Verify Generated Signature off chain.
Verifies Generated Signature off chain
This will Verify Generated Signature off chain under the given instance.
{
"Status": "SUCCESS",
"Message": "",
"Data": {
"isVerified": true
}
}
{
"Status": "FAILURE",
"Message": "error getting public key from signature : invalid signature recovery id",
"Data": null
}
Take a look at how you might call this method using our official libraries, or via curl
:
Here "signature" is the "data" from the sign message.
curl -X POST http://localhost:8889/wallet/verifySignatureOffChain \
-H "Content-Type: application/json" \
-d '{
"walletId": "xxxxxxxxxxxx",
"message": "Hello",
"signature": "xxxxxxxxxxxxx"
}'
const axios = require('axios');
const apiUrl = 'http://localhost:8889/wallet/verifySignatureOffChain';
const headers = {
'Content-Type': 'application/json',
};
const requestData = {
walletId: 'xxxxxxxxxx',
message: 'Hello',
signature: 'xxxxxxxxxx',
};
axios.post(apiUrl, requestData, { headers })
.then((response) => {
console.log('Response:', response.data);
})
.catch((error) => {
console.error('Error:', error);
});
import requests
url = 'http://localhost:8889/wallet/verifySignatureOffChain'
headers = {
'Content-Type': 'application/json',
}
data = {
"walletId": "xxxxxxxxxx",
"message": "Hello",
"signature": "xxxxxxxxxx"
}
try:
response = requests.post(url, json=data, headers=headers)
response.raise_for_status() # Raise an exception for 4xx or 5xx status codes
print('Response:', response.json())
except requests.exceptions.RequestException as error:
print('Error:', error)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "http://localhost:8889/wallet/verifySignatureOffChain"
method := "POST"
payload := strings.NewReader(`{
"walletId": "xxxxxxxxxxxxx",
"message": "Hello",
"signature": "xxxxxxxxxxxxx"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}