curl --request POST \
--url https://mpc-client.portalhq.io/v1/sign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"share": "eyJjbG...",
"method": "eth_sendTransaction",
"params": {
"value": "0x01",
"from": "",
"to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
"data": ""
},
"rpcUrl": "https://api.portalhq.io/rpc/v1/eip155/10143",
"chainId": "eip155:10143"
}
'import requests
url = "https://mpc-client.portalhq.io/v1/sign"
payload = {
"share": "eyJjbG...",
"method": "eth_sendTransaction",
"params": {
"value": "0x01",
"from": "",
"to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
"data": ""
},
"rpcUrl": "https://api.portalhq.io/rpc/v1/eip155/10143",
"chainId": "eip155:10143"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
share: 'eyJjbG...',
method: 'eth_sendTransaction',
params: {
value: '0x01',
from: '',
to: '0xdFd8302f44727A6348F702fF7B594f127dE3A902',
data: ''
},
rpcUrl: 'https://api.portalhq.io/rpc/v1/eip155/10143',
chainId: 'eip155:10143'
})
};
fetch('https://mpc-client.portalhq.io/v1/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-client.portalhq.io/v1/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([
'share' => 'eyJjbG...',
'method' => 'eth_sendTransaction',
'params' => [
'value' => '0x01',
'from' => '',
'to' => '0xdFd8302f44727A6348F702fF7B594f127dE3A902',
'data' => ''
],
'rpcUrl' => 'https://api.portalhq.io/rpc/v1/eip155/10143',
'chainId' => 'eip155:10143'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-client.portalhq.io/v1/sign"
payload := strings.NewReader("{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-client.portalhq.io/v1/sign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc-client.portalhq.io/v1/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}"
response = http.request(request)
puts response.read_body{
"data": "0xf7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b"
}{
"id": "RPC_OP_FAILED",
"message": "Failed to send transaction: details"
}Incorrect API key format{
"id": "<string>",
"message": "<string>"
}{
"id": "IDEMPOTENT_REQUEST_ALREADY_COMPLETED",
"message": "Request already completed"
}{
"id": "IDEMPOTENCY_KEY_REUSED",
"message": "Idempotency key reused for different request payload"
}Sign a transaction or message by chain
Signs a transaction or message using an RPC method and chain ID.
The Idempotency-Key header is accepted only for broadcast methods
(for example eth_sendTransaction, sol_signAndSendTransaction).
Supplying the header with a non-broadcast method returns 400.
curl --request POST \
--url https://mpc-client.portalhq.io/v1/sign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"share": "eyJjbG...",
"method": "eth_sendTransaction",
"params": {
"value": "0x01",
"from": "",
"to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
"data": ""
},
"rpcUrl": "https://api.portalhq.io/rpc/v1/eip155/10143",
"chainId": "eip155:10143"
}
'import requests
url = "https://mpc-client.portalhq.io/v1/sign"
payload = {
"share": "eyJjbG...",
"method": "eth_sendTransaction",
"params": {
"value": "0x01",
"from": "",
"to": "0xdFd8302f44727A6348F702fF7B594f127dE3A902",
"data": ""
},
"rpcUrl": "https://api.portalhq.io/rpc/v1/eip155/10143",
"chainId": "eip155:10143"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
share: 'eyJjbG...',
method: 'eth_sendTransaction',
params: {
value: '0x01',
from: '',
to: '0xdFd8302f44727A6348F702fF7B594f127dE3A902',
data: ''
},
rpcUrl: 'https://api.portalhq.io/rpc/v1/eip155/10143',
chainId: 'eip155:10143'
})
};
fetch('https://mpc-client.portalhq.io/v1/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-client.portalhq.io/v1/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([
'share' => 'eyJjbG...',
'method' => 'eth_sendTransaction',
'params' => [
'value' => '0x01',
'from' => '',
'to' => '0xdFd8302f44727A6348F702fF7B594f127dE3A902',
'data' => ''
],
'rpcUrl' => 'https://api.portalhq.io/rpc/v1/eip155/10143',
'chainId' => 'eip155:10143'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-client.portalhq.io/v1/sign"
payload := strings.NewReader("{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-client.portalhq.io/v1/sign")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mpc-client.portalhq.io/v1/sign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"share\": \"eyJjbG...\",\n \"method\": \"eth_sendTransaction\",\n \"params\": {\n \"value\": \"0x01\",\n \"from\": \"\",\n \"to\": \"0xdFd8302f44727A6348F702fF7B594f127dE3A902\",\n \"data\": \"\"\n },\n \"rpcUrl\": \"https://api.portalhq.io/rpc/v1/eip155/10143\",\n \"chainId\": \"eip155:10143\"\n}"
response = http.request(request)
puts response.read_body{
"data": "0xf7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b"
}{
"id": "RPC_OP_FAILED",
"message": "Failed to send transaction: details"
}Incorrect API key format{
"id": "<string>",
"message": "<string>"
}{
"id": "IDEMPOTENT_REQUEST_ALREADY_COMPLETED",
"message": "Request already completed"
}{
"id": "IDEMPOTENCY_KEY_REUSED",
"message": "Idempotency key reused for different request payload"
}Headers
A caller-provided key used for safe retries. Behavior depends on the endpoint:
POST /v1/presign/{curve}withmanaged: true— retrying a completed request with the same key returns the same{id, expiresAt}(200). If the original attempt is still in progress, the retry returns 409 with aRetry-Afterheader; if the original attempt failed before completing, it returns 409 withoutRetry-After(caller should retry with a new key). Reusing a key after the wallet's signing share has changed (for example, after a reshare or recovery) returns 422.POST /v1/sign— only honored for broadcast methods (for exampleeth_sendTransaction,sol_signAndSendTransaction). Supplying the header with a non-broadcast method returns 400. For broadcast methods, retrying a completed request returns 409 (IDEMPOTENT_REQUEST_ALREADY_COMPLETED), and reuse with a different payload returns 422. On 409, the response body does not include the original signing result — the header prevents double-execution, it does not replay the prior response.POST /v1/assets/send— retrying a completed request returns 409 (IDEMPOTENT_REQUEST_ALREADY_COMPLETED), and reuse with a different payload returns 422. On 409, the response body does not include the originaltransactionHash— the header prevents double-submission, it does not replay the prior response.
Client-stored presignature creation does not currently honor this header.
Body
Request body for signing a transaction or message by chain.
The signer RPC method (e.g. personal_sign, eth_sendTransaction,
sol_signAndSendTransaction). Account Abstraction clients can also use
eth_signUserOperation, which takes the same transaction params as
eth_sendTransaction and returns the signed user operation without
submitting it.
Was this page helpful?