Skip to main content
POST
/
v2
/
tokenized_assets
/
create_account
Python (SDK)
from compass_api_sdk import CompassAPI


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.tokenized_assets.tokenized_assets_create_account(sender="0x18b42407AbC163f595410Ffe773BB98Db40B48F7", owner="0x18b42407AbC163f595410Ffe773BB98Db40B48F7", estimate_gas=True)

    # Handle response
    print(res)
import { CompassApiSDK } from "@compass-labs/api-sdk";

const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});

async function run() {
const result = await compassApiSDK.tokenizedAssets.tokenizedAssetsCreateAccount({
sender: "0x18b42407AbC163f595410Ffe773BB98Db40B48F7",
owner: "0x18b42407AbC163f595410Ffe773BB98Db40B48F7",
});

console.log(result);
}

run();
curl --request POST \
--url https://api.compasslabs.ai/v2/tokenized_assets/create_account \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sender": "0x18b42407AbC163f595410Ffe773BB98Db40B48F7",
"owner": "0x18b42407AbC163f595410Ffe773BB98Db40B48F7"
}
'
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender: '0x18b42407AbC163f595410Ffe773BB98Db40B48F7',
owner: '0x18b42407AbC163f595410Ffe773BB98Db40B48F7'
})
};

fetch('https://api.compasslabs.ai/v2/tokenized_assets/create_account', 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.compasslabs.ai/v2/tokenized_assets/create_account",
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([
'sender' => '0x18b42407AbC163f595410Ffe773BB98Db40B48F7',
'owner' => '0x18b42407AbC163f595410Ffe773BB98Db40B48F7'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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.compasslabs.ai/v2/tokenized_assets/create_account"

payload := strings.NewReader("{\n \"sender\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\",\n \"owner\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<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.compasslabs.ai/v2/tokenized_assets/create_account")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"sender\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\",\n \"owner\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.compasslabs.ai/v2/tokenized_assets/create_account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sender\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\",\n \"owner\": \"0x18b42407AbC163f595410Ffe773BB98Db40B48F7\"\n}"

response = http.request(request)
puts response.read_body
{
  "transaction": {
    "chainId": "0x1",
    "data": "0x1688f0b9000000000000000000000000...",
    "from": "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
    "gas": "0x55730",
    "maxFeePerGas": "0x3b9aca00",
    "maxPriorityFeePerGas": "0x5f5e100",
    "nonce": "0x2a",
    "to": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2",
    "value": "0x0"
  },
  "tokenized_assets_account_address": "0xaB5801a7D398351b8bE11C439e05C5B3259aeC9B"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Body

application/json

Request to create a compass Tokenized Assets Account.

sender
string
default:0x18b42407AbC163f595410Ffe773BB98Db40B48F7
required

The address of the transaction sender.

Example:

"0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"

owner
string
default:0x18b42407AbC163f595410Ffe773BB98Db40B48F7
required

The address that will own and control the compass Tokenized Assets Account

Example:

"0x18b42407AbC163f595410Ffe773BB98Db40B48F7"

estimate_gas
boolean
default:true

Determines whether to estimate gas costs for transactions, also verifying that the transaction can be successfully executed.

chain
enum<string>
default:ethereum

Network to create the Tokenized Assets Account on (defaults to Ethereum). The account address is deterministic and identical across networks; RWA yield assets also trade on Base.

Available options:
base,
ethereum,
arbitrum,
hyperevm,
tempo,
bsc

Response

Successful Response

Response containing unsigned transaction to create compass Tokenized Assets Account.

transaction
UnsignedTransaction · object | null
required

Transaction to create compass Tokenized Assets Account

Example:
{
"chainId": "0x1",
"data": "0x1688f0b9000000000000000000000000...",
"from": "0xc98949522db2eE403d6c75E91DDEe875a824bB10",
"gas": "0x55730",
"maxFeePerGas": "0x3b9aca00",
"maxPriorityFeePerGas": "0x5f5e100",
"nonce": "0x2a",
"to": "0xa6B71E26C5e0845f74c812102Ca7114b6a896AB2",
"value": "0x0"
}
tokenized_assets_account_address
string
required

Predicted address of the compass Tokenized Assets Account that will be deployed

Example:

"0xaB5801a7D398351b8bE11C439e05C5B3259aeC9B"