Create Account
curl --request POST \
--url https://api.altude.so/api/Account/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"signedTransaction": "<string>"
}
'import requests
url = "https://api.altude.so/api/Account/create"
payload = { "signedTransaction": "<string>" }
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signedTransaction: '<string>'})
};
fetch('https://api.altude.so/api/Account/create', 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.altude.so/api/Account/create",
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([
'signedTransaction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$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.altude.so/api/Account/create"
payload := strings.NewReader("{\n \"signedTransaction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
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.altude.so/api/Account/create")
.header("X-API-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signedTransaction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altude.so/api/Account/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedTransaction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "Queued",
"message": "Account creation transaction queued successfully.",
"signature": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"
}
Account
Create Account
Create a new account using a signed transaction
POST
/
Account
/
create
Create Account
curl --request POST \
--url https://api.altude.so/api/Account/create \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <x-api-key>' \
--data '
{
"signedTransaction": "<string>"
}
'import requests
url = "https://api.altude.so/api/Account/create"
payload = { "signedTransaction": "<string>" }
headers = {
"X-API-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({signedTransaction: '<string>'})
};
fetch('https://api.altude.so/api/Account/create', 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.altude.so/api/Account/create",
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([
'signedTransaction' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <x-api-key>"
],
]);
$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.altude.so/api/Account/create"
payload := strings.NewReader("{\n \"signedTransaction\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<x-api-key>")
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.altude.so/api/Account/create")
.header("X-API-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signedTransaction\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altude.so/api/Account/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signedTransaction\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "Queued",
"message": "Account creation transaction queued successfully.",
"signature": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"
}
Create a new Solana account by submitting a signed transaction.
Build
Use this right before calling
headers
Request Body
string
required
The base64-encoded signed transaction to create the account
Build signedTransaction (minimum)
Use this right before calling POST /Account/create.
Demo flow only. Never put fee payer private keys in frontend/client code. Keep signer keys on a trusted server-side signer.
import { Connection, Keypair, PublicKey, Transaction } from '@solana/web3.js';
import {
AuthorityType,
TOKEN_PROGRAM_ID,
createAssociatedTokenAccountInstruction,
createSetAuthorityInstruction,
getAssociatedTokenAddress
} from '@solana/spl-token';
const apiKey = 'your-api-key';
const owner = new PublicKey('OWNER_PUBLIC_KEY');
const mint = new PublicKey('MINT_PUBLIC_KEY');
const feePayerSecret = [/* Solana secret key: array of 64 numbers (0-255) */];
function toBase64(bytes: Uint8Array) {
let binary = '';
const chunkSize = 0x8000;
for (let i = 0; i < bytes.length; i += chunkSize) {
binary += String.fromCharCode(...bytes.subarray(i, i + chunkSize));
}
return btoa(binary);
}
const cfg = await fetch('https://api.altude.so/api/Transaction/config', {
headers: { 'X-API-Key': apiKey }
}).then((r) => r.json());
const connection = new Connection(cfg.RpcUrl, 'confirmed');
const feePayer = new PublicKey(cfg.FeePayer);
const ata = await getAssociatedTokenAddress(mint, owner);
const tx = new Transaction();
tx.feePayer = feePayer;
tx.add(createAssociatedTokenAccountInstruction(feePayer, ata, owner, mint));
tx.add(
createSetAuthorityInstruction(
ata,
owner,
AuthorityType.CloseAccount,
feePayer,
[],
TOKEN_PROGRAM_ID
)
);
tx.recentBlockhash = (await connection.getLatestBlockhash('finalized')).blockhash;
tx.partialSign(Keypair.fromSecretKey(Uint8Array.from(feePayerSecret)));
const signedTransaction = toBase64(
tx.serialize({ requireAllSignatures: false })
);
await fetch('https://api.altude.so/api/Account/create', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': apiKey
},
body: JSON.stringify({ signedTransaction })
});
Response
string
The current state of the account creation request
string
A message describing the result of queuing the account creation transaction
string
The transaction signature
{
"status": "Queued",
"message": "Account creation transaction queued successfully.",
"signature": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"
}
⌘I