Clear a paid withdrawal on omni
curl --request POST \
--url https://mpc.hex-api.app/relay/clear \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "1792107257000001836156"
}
'import requests
url = "https://mpc.hex-api.app/relay/clear"
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/relay/clear', 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/relay/clear",
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/relay/clear"
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/relay/clear")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"1792107257000001836156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/relay/clear")
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{
"status": "cleared",
"hash": "2WL6qSNvB65gX1AavfEccPLQwhKjJytS7DuPPLwUMP9T",
"sender_id": "hex-relay-1.near"
}Relay
Clear a paid withdrawal on omni
Clears a withdrawal’s nonce on omni once it is paid on its target chain, so the receiver’s next withdrawal can be signed. The deposit wallet signs the clear (as POST /clear/sign) and a relay account sends clear_completed_withdrawal, waited for until final. A nonce omni no longer holds answers already_cleared. A withdrawal not paid on its chain is refused with Nonce was not used on target chain (400): pay it out first (POST /relay/withdraw). POST /relay/withdraw clears what it pays, so this is only needed for withdrawals paid some other way.
POST
/
relay
/
clear
Clear a paid withdrawal on omni
curl --request POST \
--url https://mpc.hex-api.app/relay/clear \
--header 'Content-Type: application/json' \
--data '
{
"nonce": "1792107257000001836156"
}
'import requests
url = "https://mpc.hex-api.app/relay/clear"
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/relay/clear', 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/relay/clear",
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/relay/clear"
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/relay/clear")
.header("Content-Type", "application/json")
.body("{\n \"nonce\": \"1792107257000001836156\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/relay/clear")
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{
"status": "cleared",
"hash": "2WL6qSNvB65gX1AavfEccPLQwhKjJytS7DuPPLwUMP9T",
"sender_id": "hex-relay-1.near"
}Body
application/json