Skip to main content

Stellar

Base path: /api/stellar

All routes require authentication unless noted otherwise.

GET /check-balance/:publicKey

Fetches the current balances on a Stellar account, including both XLM and FUC.

Responses

200 - Success:

{
"balances": [
{ "asset_type": "native", "balance": "19.9999800" },
{ "asset_type": "credit_alphanum4", "balance": "50.0000000" }
]
}

POST /transfer

Transfers FUC tokens from the authenticated user's wallet to another Stellar account. The transaction is also saved to the PostgreSQL transactions table.

Request Body

{
"receiverPublicKey": "GDXX...",
"amount": 10
}

Responses

200 - Success:

{
"message": "Transaction successful!",
"result": {}
}

400 - Receiver account does not exist:

The receiver account does not exist!

GET /transactions/:userId

Returns the authenticated user's transaction history from the database, sorted newest first.

Responses

200 - Success:

[
{
"transactionId": "uuid",
"stellarTransactionId": "stellar-hash",
"from": "GDXX...",
"to": "GDYY...",
"assetAmount": 10,
"assetCode": "FUC",
"userId": "uuid",
"createdAt": "2024-11-01T12:00:00.000Z"
}
]

POST /create-asset (For Admin Use Only)

This is an Admin function to issue a new batch of FUC tokens from the issuing account to the distribution account. It creates the trustline on the distribution account if it does not already exist.

Request Body

{
"assetCode": "FUC",
"amount": "1000000"
}

Responses

200 - Success:

You've successfully created and issued new tokens!

GET /check-admin-balance/:publicKey (For Admin Use Only)

This is an Admin function to return the full balance of the issuing or distribution account.

Responses

200 - Success:

{
"balances": [
{ "asset_code": "XLM", "asset_issuer": "", "balance": "9999.9999200" },
{
"asset_code": "FUC",
"asset_issuer": "GDXX...",
"balance": "950000.0000000"
}
]
}