Login
curl --request POST \
--url https://payments.magicblock.app/v1/spl/login \
--header 'Content-Type: application/json' \
--data '
{
"pubkey": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
"challenge": "1234567890",
"signature": "1234567890"
}
'import requests
url = "https://payments.magicblock.app/v1/spl/login"
payload = {
"pubkey": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
"challenge": "1234567890",
"signature": "1234567890"
}
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({
pubkey: 'Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L',
challenge: '1234567890',
signature: '1234567890'
})
};
fetch('https://payments.magicblock.app/v1/spl/login', 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/login",
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([
'pubkey' => 'Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L',
'challenge' => '1234567890',
'signature' => '1234567890'
]),
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://payments.magicblock.app/v1/spl/login"
payload := strings.NewReader("{\n \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\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://payments.magicblock.app/v1/spl/login")
.header("Content-Type", "application/json")
.body("{\n \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payments.magicblock.app/v1/spl/login")
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 \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"token": "1234567890"
}Private Payments API
Login
POST
/
v1
/
spl
/
login
Login
curl --request POST \
--url https://payments.magicblock.app/v1/spl/login \
--header 'Content-Type: application/json' \
--data '
{
"pubkey": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
"challenge": "1234567890",
"signature": "1234567890"
}
'import requests
url = "https://payments.magicblock.app/v1/spl/login"
payload = {
"pubkey": "Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L",
"challenge": "1234567890",
"signature": "1234567890"
}
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({
pubkey: 'Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L',
challenge: '1234567890',
signature: '1234567890'
})
};
fetch('https://payments.magicblock.app/v1/spl/login', 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/login",
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([
'pubkey' => 'Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L',
'challenge' => '1234567890',
'signature' => '1234567890'
]),
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://payments.magicblock.app/v1/spl/login"
payload := strings.NewReader("{\n \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\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://payments.magicblock.app/v1/spl/login")
.header("Content-Type", "application/json")
.body("{\n \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://payments.magicblock.app/v1/spl/login")
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 \"pubkey\": \"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L\",\n \"challenge\": \"1234567890\",\n \"signature\": \"1234567890\"\n}"
response = http.request(request)
puts response.read_body{
"token": "1234567890"
}请求体
application/json
The public key of the wallet that will read private data.
示例:
"Bt9oNR5cCtnfuMmXgWELd6q5i974PdEMQDUE55nBC57L"
The challenge string returned by /v1/spl/challenge.
示例:
"1234567890"
The wallet's signature over the challenge string.
示例:
"1234567890"
Optional. Use mainnet for BASE_RPC_URL and EPHEMERAL_RPC_URL, devnet for BASE_DEVNET_RPC_URL and EPHEMERAL_DEVNET_RPC_URL, or provide a custom http(s) RPC URL to override the base RPC while keeping the configured ephemeral RPC.
可用选项:
mainnet, devnet 示例:
"mainnet"
Optional. When true, the API uses a mock login flow for testing. Defaults to false.
示例:
false
响应
Authentication token
The authentication token provided by the Private Ephemeral Rollup.
⌘I

