curl --request POST \
--url https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userOperation": "{\"sender\":\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\",\"nonce\":\"0x5\",...}",
"signature": "3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5..."
}
'import requests
url = "https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation"
payload = {
"userOperation": "{\"sender\":\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\",\"nonce\":\"0x5\",...}",
"signature": "3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5..."
}
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({
userOperation: '{"sender":"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96","nonce":"0x5",...}',
signature: '3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...'
})
};
fetch('https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation', 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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation",
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([
'userOperation' => '{"sender":"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96","nonce":"0x5",...}',
'signature' => '3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...'
]),
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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation"
payload := strings.NewReader("{\n \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation")
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 \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"userOpHash": "0xf82a8a15e20eec1c8c3057fc56df67d7da3dc668e2b0dd3c7380ddc9175867d1"
},
"metadata": {
"chainId": "eip155:11155111"
}
}{
"error": "<string>"
}{
"error": "<string>"
}Broadcast a user operation
Attaches a signature to a user operation and submits it to the bundler. The user
operation can be the one build-user-operation returned, or one you built yourself
for the client’s smart account (EntryPoint v0.6, ZeroDev Kernel v2). Pass the
signature exactly as the raw signing endpoint returned it; Portal formats it for
the smart account. Returns the user operation hash; look
it up with the get transaction endpoint for the on-chain transaction hash once a
bundler includes it.
curl --request POST \
--url https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userOperation": "{\"sender\":\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\",\"nonce\":\"0x5\",...}",
"signature": "3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5..."
}
'import requests
url = "https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation"
payload = {
"userOperation": "{\"sender\":\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\",\"nonce\":\"0x5\",...}",
"signature": "3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5..."
}
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({
userOperation: '{"sender":"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96","nonce":"0x5",...}',
signature: '3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...'
})
};
fetch('https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation', 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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation",
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([
'userOperation' => '{"sender":"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96","nonce":"0x5",...}',
'signature' => '3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...'
]),
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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation"
payload := strings.NewReader("{\n \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\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://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.portalhq.io/api/v3/clients/me/chains/{chain}/assets/send/broadcast-user-operation")
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 \"userOperation\": \"{\\\"sender\\\":\\\"0xF86e3fAe8443e4494a689fcDd4C8e6C76c1b2C96\\\",\\\"nonce\\\":\\\"0x5\\\",...}\",\n \"signature\": \"3e42da7cb2a70a00a3e1d565cbb75e2f1aca3f62183c3fc61da1d9f3f8dff6d5...\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"userOpHash": "0xf82a8a15e20eec1c8c3057fc56df67d7da3dc668e2b0dd3c7380ddc9175867d1"
},
"metadata": {
"chainId": "eip155:11155111"
}
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Client API Key or Client Session Token (CST). Pass as a Bearer token in the Authorization header.
Path Parameters
The blockchain chain identifier. Use either a friendly name or CAIP-2 format.
When using CAIP-2 format in URLs, ensure the colon (:) is URI-encoded as %3A.
Supported chains:
ethereum(eip155:1)sepolia(eip155:11155111)base(eip155:8453)base-sepolia(eip155:84532)polygon(eip155:137)polygon-mumbai(eip155:80001)celo(eip155:42220)celo-alfajores(eip155:44787)monad(eip155:143)monad-testnet(eip155:10143)solana(solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp)solana-devnet(solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1)tron(tron:mainnet)tron-nile(tron:nile)tron-shasta(tron:shasta)stellar(stellar:pubnet)stellar-testnet(stellar:testnet)bitcoin-segwit(bip122:000000000019d6689c085ae165831e93-p2wpkh)bitcoin-segwit-testnet(bip122:000000000933ea01ad0ee984209779ba-p2wpkh)bitcoin-p2wpkh(bip122:000000000019d6689c085ae165831e93-p2wpkh)bitcoin-p2wpkh-testnet(bip122:000000000933ea01ad0ee984209779ba-p2wpkh)
Body
The user operation to submit, as a JSON string or an object. Either the userOperation from build-user-operation, unchanged, or one you built yourself for the client's smart account. Any signature it carries is replaced.
The raw SECP256K1 signature of userOpHash, hex encoded, with or without 0x.
Was this page helpful?