Skip to main content
POST
/
v1
/
spl
/
stealth-pool
Create Stealth Pool
curl --request POST \
  --url https://payments.magicblock.app/v1/spl/stealth-pool \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "payer": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
  "authority": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
  "handle": "john.doe@magicblock.id",
  "destinations": [
    "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"
  ],
  "splitAcrossKeys": false
}
'
import requests

url = "https://payments.magicblock.app/v1/spl/stealth-pool"

payload = {
    "payer": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
    "authority": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
    "handle": "john.doe@magicblock.id",
    "destinations": ["Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"],
    "splitAcrossKeys": False
}
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({
    payer: '3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE',
    authority: '3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE',
    handle: 'john.doe@magicblock.id',
    destinations: ['Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L'],
    splitAcrossKeys: false
  })
};

fetch('https://payments.magicblock.app/v1/spl/stealth-pool', 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://payments.magicblock.app/v1/spl/stealth-pool",
  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([
    'payer' => '3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE',
    'authority' => '3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE',
    'handle' => 'john.doe@magicblock.id',
    'destinations' => [
        'Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L'
    ],
    'splitAcrossKeys' => false
  ]),
  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://payments.magicblock.app/v1/spl/stealth-pool"

	payload := strings.NewReader("{\n  \"payer\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"authority\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"handle\": \"john.doe@magicblock.id\",\n  \"destinations\": [\n    \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\"\n  ],\n  \"splitAcrossKeys\": false\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://payments.magicblock.app/v1/spl/stealth-pool")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"payer\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"authority\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"handle\": \"john.doe@magicblock.id\",\n  \"destinations\": [\n    \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\"\n  ],\n  \"splitAcrossKeys\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://payments.magicblock.app/v1/spl/stealth-pool")

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  \"payer\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"authority\": \"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE\",\n  \"handle\": \"john.doe@magicblock.id\",\n  \"destinations\": [\n    \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\"\n  ],\n  \"splitAcrossKeys\": false\n}"

response = http.request(request)
puts response.read_body
{
  "kind": "stealthPool",
  "transactionBase64": "<string>",
  "recentBlockhash": "<string>",
  "lastValidBlockHeight": 123,
  "instructionCount": 1,
  "requiredSigners": [
    "<string>"
  ],
  "stealthPool": "<string>",
  "setupTransaction": {
    "kind": "stealthPool",
    "transactionBase64": "<string>",
    "recentBlockhash": "<string>",
    "lastValidBlockHeight": 123,
    "instructionCount": 1,
    "requiredSigners": [
      "<string>"
    ],
    "sendRpcEndpoint": "<string>",
    "validator": "<string>",
    "fees": {
      "lamports": "<string>",
      "tokens": "<string>"
    }
  },
  "sendRpcEndpoint": "<string>"
}

Authorizations

Authorization
string
header
required

Token obtained from the /v1/spl/login flow.

Body

application/json
payer
string
required
Example:

"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE"

authority
string
required

Authority allowed to manage the pool.

Example:

"3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE"

handle
string
required

Human-readable handle, up to 255 UTF-8 bytes. Stored as its exact bytes — NOT trimmed, lowercased, or normalized, so John.Doe@… is a different handle than john.doe@….

Required string length: 1 - 255
Example:

"john.doe@magicblock.id"

destinations
string[]
required

1-10 destination owner pubkeys (owners, not token accounts).

Required array length: 1 - 10 elements
Example:
[
  "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"
]
splitAcrossKeys
boolean

Optional. When true, split payments may resolve independently across the destination keys.

validator
string

Optional. Validator identity to receive the delegated pool.

Example:

"MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57"

cluster

Optional. Cluster selector or custom http(s) RPC URL.

Available options:
mainnet,
devnet,
mainnet-private,
devnet-private
Example:

"mainnet"

Response

Unsigned setup and ER update transactions

kind
enum<string>
required
Available options:
stealthPool
version
enum<string>
required
Available options:
legacy,
v0
transactionBase64
string
required

The ER update transaction.

sendTo
enum<string>
required
Available options:
base,
ephemeral
recentBlockhash
string
required
lastValidBlockHeight
integer
required
instructionCount
integer
required
Required range: x >= 0
requiredSigners
string[]
required
stealthPool
string
required

Derived stealth-pool PDA.

setupTransaction
object
required

The base-chain setup transaction. It uses the same transaction response contract as the top-level transaction; sendRpcEndpoint is omitted when sendTo is base.

sendRpcEndpoint
string<uri>