curl --request POST \
--url https://mpc.hex-api.app/deposit/sign \
--header 'Content-Type: application/json' \
--data '
{
"chain_from": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver_id": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT"
}
'import requests
url = "https://mpc.hex-api.app/deposit/sign"
payload = {
"chain_from": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver_id": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT"
}
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({
chain_from: 1100,
nonce: '1792944123000000004211',
amount: '25000000',
token_id: '111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu',
receiver_id: '6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT'
})
};
fetch('https://mpc.hex-api.app/deposit/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/deposit/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([
'chain_from' => 1100,
'nonce' => '1792944123000000004211',
'amount' => '25000000',
'token_id' => '111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu',
'receiver_id' => '6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT'
]),
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/deposit/sign"
payload := strings.NewReader("{\n \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\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/deposit/sign")
.header("Content-Type", "application/json")
.body("{\n \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/deposit/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 \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"autopilot_hash": null
}Sign a deposit for omni
The deposit wallet signs a source chain deposit for omni’s mt_deposit_call (base58 of 64 bytes, r ‖ s). The deposit is checked on its chain through omni’s AuthCall first, and the signature credits only the receiver it encodes. POST /relay/deposit does this and sends the NEAR transaction too. Deposits on Solana and TRON are not signed here. A signature is kept for a day, across the service: a retry (or anyone asking for the same one) answers the same one, and the nodes sign it once (see Load protection). A deposit omni already credited (is_executed) is refused with a 400.
curl --request POST \
--url https://mpc.hex-api.app/deposit/sign \
--header 'Content-Type: application/json' \
--data '
{
"chain_from": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver_id": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT"
}
'import requests
url = "https://mpc.hex-api.app/deposit/sign"
payload = {
"chain_from": 1100,
"nonce": "1792944123000000004211",
"amount": "25000000",
"token_id": "111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu",
"receiver_id": "6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT"
}
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({
chain_from: 1100,
nonce: '1792944123000000004211',
amount: '25000000',
token_id: '111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu',
receiver_id: '6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT'
})
};
fetch('https://mpc.hex-api.app/deposit/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/deposit/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([
'chain_from' => 1100,
'nonce' => '1792944123000000004211',
'amount' => '25000000',
'token_id' => '111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu',
'receiver_id' => '6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT'
]),
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/deposit/sign"
payload := strings.NewReader("{\n \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\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/deposit/sign")
.header("Content-Type", "application/json")
.body("{\n \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc.hex-api.app/deposit/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 \"chain_from\": 1100,\n \"nonce\": \"1792944123000000004211\",\n \"amount\": \"25000000\",\n \"token_id\": \"111bzQBB65GxAPAVoxqmMcgYo5oS3txhqs1Uh1cgahKQUeTUq1TJu\",\n \"receiver_id\": \"6QPkTPp7EKZytMtEuvRmqGBBMMuwf4rrX4JjAoiuCYnT\"\n}"
response = http.request(request)
puts response.read_body{
"signature": "4sJhsuGTu8f9XoiAkZj3Si9GSjUT714yzQWdo5wZHkWpAKQHd69dfiT3RycMnUqhrT5FA4wokk6RbrFEFKkmPnW7",
"autopilot_hash": null
}Body
A source chain deposit, as omni's DepositProof names it.
Chain ids are omni's (v2_1.omni.hot.tg), not always the chain's own: EVM chains use their EIP-155 id (Ethereum 1, Optimism 10, BNB 56, Polygon 137, Monad 143, X Layer 196, Base 8453, Arbitrum 42161, Avalanche 43114, ...); the others have omni's numbers: Solana 1001, NEAR 1010, Stellar 1100, TON 1117 (TON v1, 1111, is dead), Juno 4444118, Gonka 4444119.
x >= 11100
1117
137
4444119