The "Sign TxHash" feature in the KrypC wallet-dev Service API enables users to securely sign transaction hashes, providing a cryptographic signature for specific transaction data on the blockchain. This capability enhances security and authenticity verification, ensuring a reliable method for confirming the integrity and authorization of transactions within decentralized systems.
This Submit Transaction using this method.
API Specification
Sign TxHash API
POST
https://api.krypcore.com/api/v0/devWallet/signTxHash
To sign TxHah API under the given instance.
Request Body
200: OK SUCCESS 401: Unauthorized Failure in authentication 500: Internal Server Error Key values should be given
Copy {
"Data" : "wEYz8E2zxuDMos+c1E8ZFQzq49uFZK/R+3LSZLAMPrQXNPaxzlRjE4rkMTPRCz64vmkb9hUeTtVvhgDG61qc9wE=" ,
"Message" : "Signed txn hash successfully" ,
"Status" : "SUCCESS"
}
Copy {
"message" : "Invalid API key in request"
}
Copy {
"message": "Internal Server Error"
}
Take a look at how you might call this method using our official libraries, or via curl
curl Node.js (Fetch) Python Golang
Copy
curl --location 'https://api.krypcore.com/api/v0/devWallet/signTxHash' \
--header 'DappId: **********' \
--header 'Authorization: **********' \
--header 'SubscriptionId: ********' \
--header 'ChainId: ********' \
--header 'Content-Type: application/json' \
--data '{
"privateKey": "**********",
"txnHash":"**********"
}'
Copy
var myHeaders = new Headers ();
myHeaders .append ( "DappId" , "**********" );
myHeaders .append ( "Authorization" , "**********" );
myHeaders .append ( "SubscriptionId" , "********" );
myHeaders .append ( "ChainId" , "********" );
myHeaders .append ( "Content-Type" , "application/json" );
var raw = JSON .stringify ({
"privateKey" : "**********" ,
"txnHash" : "**********"
});
var requestOptions = {
method : 'POST' ,
headers : myHeaders ,
body : raw ,
redirect : 'follow'
};
fetch ( "https://api.krypcore.com/api/v0/devWallet/signTxHash" , requestOptions)
.then (response => response .text ())
.then (result => console .log (result))
.catch (error => console .log ( 'error' , error));
Copy
import requests
import json
url = "https://api.krypcore.com/api/v0/devWallet/signTxHash"
payload = json . dumps ({
"privateKey" : "**********" ,
"txnHash" : "**********"
})
headers = {
'DappId' : '**********' ,
'Authorization' : '**********' ,
'SubscriptionId' : '********' ,
'ChainId' : '********' ,
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Copy
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main () {
url := "https://api.krypcore.com/api/v0/devWallet/signTxHash"
method := "POST"
payload := strings.NewReader( `{
"privateKey": "**********",
"txnHash":"**********"
}` )
client := & http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add( "DappId" , "**********" )
req.Header.Add( "Authorization" , "**********" )
req.Header.Add( "SubscriptionId" , "********" )
req.Header.Add( "ChainId" , "********" )
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))
}
Last updated 4 months ago