Skip to main content
This guide provides step-by-step instructions for enabling tokens on Stellar using the Adamik API. On the Stellar network, before you can receive or hold custom assets (tokens), you must establish a trustline to the asset’s issuer. This process is called “enabling a token” or “creating a trustline.”
Stellar requires users to explicitly opt-in to hold custom assets as a security measure. This prevents unwanted tokens from being sent to your account without your permission.

Understanding Stellar Assets

On Stellar, all assets except the native XLM are identified by:
  • Asset Code: A 1-12 character alphanumeric code (e.g., “USDC”, “EURC”)
  • Issuer Address: The Stellar account that created and issued the asset
Together, these form a unique identifier for each asset on the network.

Prerequisites

Before enabling a token, ensure you have:
  1. A funded Stellar account (minimum 1 XLM for base reserve)
  2. Your account’s secret key for signing transactions
  3. The asset code and issuer address of the token you want to enable
  4. An Adamik API key from dashboard.adamik.io
Each trustline requires 0.5 XLM to be locked as a base reserve. This XLM becomes available again if you remove the trustline.

Step-by-Step Tutorial

Step 1: Prepare Your Request

To enable a token, use the /api/stellar-testnet/transaction/encode endpoint with the enable_token mode:
The tokenId field follows the format: ASSET_CODE:ISSUER_ADDRESS

Step 2: API Response

The API returns an encoded transaction ready for signing:

Step 3: Sign the Transaction

For Stellar, you must sign the transaction hash (not the raw transaction):

Step 4: Broadcast the Signed Transaction

Send the signed transaction back to Adamik for broadcasting:
Use the /api/stellar-testnet/transaction/broadcast endpoint to broadcast.

Step 5: Verify the Transaction

Upon successful broadcast, you’ll receive a transaction hash:
You can view the transaction on Stellar Expert:

Complete Code Example

Here’s a complete Node.js example for enabling a token on Stellar testnet:

Common Testnet Tokens

Here are some commonly used tokens on Stellar testnet for testing:

Troubleshooting

Common Errors and Solutions

Important Considerations

  1. Reserve Requirements: Each trustline locks 0.5 XLM as a base reserve
  2. Trust Limits: You can optionally set a maximum amount you’re willing to hold of an asset
  3. Asset Freezing: Some issuers can freeze assets - research issuers before trusting
  4. Removing Trustlines: You can only remove a trustline if your balance of that asset is zero

Next Steps

After enabling a token, you can:
  • Receive the token from other accounts
  • Trade the token on Stellar DEX
  • Send the token to other accounts that have also enabled it
  • Set up path payments using the token
For more information on Stellar assets and trustlines, visit the Stellar documentation.

Get Support

Need help? Connect with us: