Sign a paid withdrawal's clear
curl --request POST \
--url https://mpc.hex-api.app/clear/sign \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "1792107257000001836156"
}
'import requests
url = "https://mpc.hex-api.app/clear/sign"
payload = { "nonce": "1792107257000001836156" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({nonce: '1792107257000001836156'})
};
fetch('https://mpc.hex-api.app/clear/sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mpc.hex-api.app/clear/sign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'nonce' => '1792107257000001836156'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mpc.hex-api.app/clear/sign"
payload := strings.NewReader("{\n \"nonce\": \"1792107257000001836156\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mpc.hex-api.app/clear/sign")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"1792107257000001836156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/clear/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"nonce\": \"1792107257000001836156\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"autopilot_hash": null
}Signatures
Sign a paid withdrawal's clear
Signs clear_completed_withdrawal of a withdrawal paid on its target chain (base58 of 64 bytes, r ‖ s). It signs with the MPC deposit wallet where omni’s removal key for the chain is the MPC key, and with the removal key this service holds on the chains not moved to the MPC yet. A withdrawal not executed on its chain answers 400 Nonce was not used on target chain. POST /relay/clear does this and sends the NEAR transaction too.
POST
/
clear
/
sign
Sign a paid withdrawal's clear
curl --request POST \
--url https://mpc.hex-api.app/clear/sign \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "1792107257000001836156"
}
'import requests
url = "https://mpc.hex-api.app/clear/sign"
payload = { "nonce": "1792107257000001836156" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({nonce: '1792107257000001836156'})
};
fetch('https://mpc.hex-api.app/clear/sign', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mpc.hex-api.app/clear/sign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'nonce' => '1792107257000001836156'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mpc.hex-api.app/clear/sign"
payload := strings.NewReader("{\n \"nonce\": \"1792107257000001836156\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mpc.hex-api.app/clear/sign")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"1792107257000001836156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/clear/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"nonce\": \"1792107257000001836156\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"autopilot_hash": null
}Body
application/json