Перейти к содержанию

Blockchain Connector XLM Service API

Review

For each supported blockchain, a set of endpoints is available, allowing you to create a transaction, sign it, send it to the network, and retrieve an address from a public key.

Request parameters embedded in the URL, such as the blockchain identifier, are mandatory. Parameters in the query string or JSON body of the request can be optional and are described in detail in the corresponding sections.

Server address: https://cloud.spatium.net/blockchain-connector-xlm/v1

Swagger

For this server address, interaction with the Stellar blockchain(xlm) is available.

The structure of requests and the information in responses are the same.

Data Types

Network

Network - network type. As a rule, blockchains support at least two options: a test network for development (testnet) with fictitious assets and a stable production network (livenet) with real assets.

Data structure:

type Network = 'livenet' | 'testnet';

API

Generate Address from a Public Key

Swagger Get API address

Request Structure

POST /api/get-address/xlm

{
   publicKey: string;
   network?: Network;
   prefix?: boolean;
}
{
  requestId: string;
  data: {
    address: string;
  };
}

Parameters

  • publicKey - public key, required parameter (string);

  • network - network type, optional parameter, default value 'livenet' (Network);

  • prefix - true if address contains a prefix, optional parameter, default value false (boolean).

Getting Data to Form a Transaction

Swagger Prepare transaction API

To form a Stellar transaction, it is required to provide a maximum fee size. It means that a maximum amount a user can pay is indicated, but actually the minimum required amount for transaction to be processed is going to be charged. When there is no network load, the minimum amount will be charged (100 stroops[^1] per operation now), so the provided fee can't be less than that.

Network fee

Swagger Prepare transaction FeeStat

To provide the correct fee size, it is useful to address current fee statistics. This endpoint provides data about minimum and maximum fees in the 5 past network ledgers.

Note

There are different maximum fee forming strategies. But one shound take into account, that a transaction with a low maximum fee won't be processed with a high network load, so we recommend using the statistically highest fee with the addition of a small backup - current minimal fee per operation (feeCharged.max + lastLedgerBaseFee), at the same time leaving the option to enter any fee value manually.

Request Structure

GET api/prepare-transaction/fee-stat/xlm/?network={network}

Parameters
  • network - network type, optional parameter, default value 'livenet' (Network).

Response structure

{
 requestId: string;
 data: {
       lastLedgerBaseFee: string;
       feeCharged: { 
         min: string;
         max: string;
       };
    };
}

Get Transaction Hash

Get Send Transaction Hash

This endpoint supports transfers of the native blockchain currency as well as any Stellar asset. When sending native currency, the existence of the account with the address is checked. If it does not exist, the account is automatically created with a start balance of the provided amount, otherwise it is a normal transfer.

Important

According to Stellar logic, one can't transfer XLM to a non-existent account (it is necessary to create one first). This endpoint will automatically create the account if it's necessary, but there will be no notice about account absence! If you want to notify users about account absence, you can use the utility endpoint to check if the account exists (checkXLMAccount method).

Request Structure

POST api/transaction/get-hash/xlm/transfer

{
  publicKey: string;
  network?: Network;
  to: string;
  amount: string;
  asset?: StellarAsset;
  fee: string;
  memo?: string;
}
{
requestId: string;
 data: {
   unsignedMessage: string;
   hash: string;
 };
}

Parameters

  • publicKey - public key, required parameter (string);

  • network - network type, optional parameter, default value 'livenet' (Network);

  • to - recipient's address (string);

  • amount - integer value (or 0 for trustline deleting), storing the limit amount for this asset on the current address, required parameter, (string), default value is the blockchain determined maximum value for the asset;

  • asset - cryptocurrency based on the Stellar blockchain, determined by the asset issuer's address and asset's code, for which a trustline is added. Required parameter (StellarAsset);

  • fee - transaction fee (string);

  • memo - additional transaction data (string).

Get Add Trustline Transaction Hash

Request Structure

POST api/transaction/get-hash/xlm/add-trustline

{
  publicKey: string;
  network?: Network;
  amount: string;
  asset?: StellarAsset;
  fee: string;
  memo?: string;
}
{
requestId: string;
 data: {
   unsignedMessage: string;
   hash: string;
 };
}

Parameters

  • publicKey - public key, required parameter (string);

  • network - network type, optional parameter, default value 'livenet' (Network);

  • amount - integer value (or 0 for trustline deleting), storing the limit amount for this asset on the current address, optional parameter, (string), default value is blockchain determined maximum value for the asset;

  • asset - cryptocurrency based on the Stellar blockchain, determined by the asset issuer's address and asset's code, for which a trustline is added. Required parameter (StellarAsset);

  • fee - transaction fee (string);

  • memo - additional transaction data (string).

Get Create claimableBalance Transaction Hash

Request Structure

POST api/transaction/get-hash/xlm/add-trustline

{
  publicKey: string;
  network?: Network;
  claimableBalanceId: string;
  fee: string;
  memo?: string;
}
{
requestId: string;
 data: {
   unsignedMessage: string;
   hash: string;
 };
}

Parameters

  • publicKey - public key, required parameter (string);

  • network - network type, optional parameter, default value 'livenet' (Network);

  • claimableBalanceId - claimableBalance identifier, required parameter (string);

  • fee - transaction fee (string);

  • memo - additional transaction data (string).

Get transaction hash for different types of operations

Request Structure

POST api/transaction/get-hash/xlm/multi-operations

This endpoint is used to obtain a hash of a transaction that involves various operations on the Stellar network (XLM). Operations are transfers, account creation, trustline setup, and other activities supported by the Stellar network.

{
  publicKey: string;
  network?: Network;
  operations: XLMNativeOperation[],
  fee: string;
  memo?: string;
}
{
requestId: string;
 data: {
   unsignedMessage: string;
   hash: string;
 };
}
Parameters
  • publicKey - public key, required parameter (string);

  • network - network type, optional parameter, default value 'livenet' (Network);

  • operations - stellar network array of operations (XLMNativeOperation);

  • fee - transaction fee (string);

  • memo - additional transaction data (string).

Specific request data types

LiquidityPoolAsset

The object that represents a liquidity pool trustline change.

Data structure:

XLMLiquidityPoolAsset
{
    assetA: Asset;
    assetB: Asset;
    fee: number;
};
Data fields:

  • assetA - the first asset in the Pool (Asset);

  • assetB - the second asset in the Pool (Asset);

Assets must respect the rule assetA < assetB, see Stellar asset comparison, where the type 'native' matches Coin, and 'alphanum4 'and 'alphanum12' can be distinguished by the code StellarAsset according to asset naming rules.

  • fee - the liquidity pool fee. For now the only fee supported is 30 (number);

LiquidityPoolId

The object that represents the asset referenced by a trustline to a liquidity pool.

Data structure:

XLMLiquidityPoolId
    {
        liquidityPoolId: string
    };
Data fields:

  • liquidityPoolId - the ID of the liquidity pool in string 'hex' (string).

Predicate

Represents an object for defining complex conditions used in the createClaimableBalance operation.

Data structure:

XLMPredicate
{
    and?: XLMPredicate[];
    or?: XLMPredicate[];
    not?: XLMPredicate;
    abs_before?: string;
    rel_before?: string;
};

Data fields:

  • and - logical "AND" between two conditions. A balance can be called only if both conditions are true (XLMPredicate[]);

  • or - logical "OR" between two conditions. A balance can be called only if both conditions are true (XLMPredicate[]);

  • not - logical "NOT" for the conditions. Balance can be called if the specified condition is false (XLMPredicate);

  • abs_before - condition "Up to absolute time". Balance can be called if the current time is less than the specified time in Unix timestamp format (string);

  • rel_before - condition "Until relative time". The balance can be called if less than the specified number of seconds have passed since the balance was created (string);

NativeOperation

An object that represents one of the available Stellar network operations.

Data structure:

XLMNativeOperation
type XLMNativeOperation = XLMNativeOperationCreateAccount | XLMNativeOperationPayment | XLMNativeOperationPathPaymentStrictReceive | XLMNativeOperationPathPaymentStrictSend | XLMNativeOperationManageSellOffer | XLMNativeOperationManageBuyOffer | XLMNativeOperationCreatePassiveSellOffer | XLMNativeOperationSetOptions | XLMNativeOperationChangeTrust | XLMNativeOperationAllowTrust | XLMNativeOperationAccountMerge | XLMNativeOperationManageData | XLMNativeOperationBumpSequence | XLMNativeOperationCreateClaimableBalance | XLMNativeOperationClaimClaimableBalance | XLMNativeOperationBeginSponsoringFutureReserves | XLMNativeOperationEndSponsoringFutureReserves | XLMNativeOperationRevokeAccountSponsorship | XLMNativeOperationRevokeTrustlineSponsorship | XLMNativeOperationRevokeOfferSponsorship | XLMNativeOperationRevokeDataSponsorship | XLMNativeOperationRevokeClaimableBalanceSponsorship | XLMNativeOperationRevokeLiquidityPoolSponsorship | XLMNativeOperationRevokeSignerSponsorship | XLMNativeOperationClawback | XLMNativeOperationClawbackClaimableBalance | XLMNativeOperationSetTrustLineFlags | XLMNativeOperationLiquidityPoolDeposit | XLMNativeOperationLiquidityPoolWithdraw;

Currently, there are the following types of operations that you can use.

createAccount

Operation allows users to create and fund a non-existent account.

Data structure:

XLMNativeOperationCreateAccount
{
    type: 'createAccount';
    destination: string;
    startingBalance: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • destination - destination account ID to create an account for (string);

  • startingBalance - amount in XLM the account should be funded for. Must be greater than the reserve balance amount (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

payment

Creates a payment operation that sends an amount in a specific asset to a destination account.

Data structure:

XLMNativeOperationPayment
{
    type: 'payment';
    destination: string;
    asset: Asset;
    amount: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • destination - destination account to send to (string);

  • asset - asset to send (Asset);

  • amount - amount to send (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

pathPaymentStrictReceive

The primary purpose of the Path Payment Strict Receive operation is to give users control over the asset they receive in a payment. This flexibility is particularly valuable when users have a preference for the type and amount of the asset they want to add to their account.

Data structure:

XLMNativeOperationPathPaymentStrictReceive
{
    type: 'pathPaymentStrictReceive';
    sendAsset: Asset;
    sendMax: string;
    destination: string;
    destAsset: Asset;
    destAmount: string;
    path: Asset[];
    source?: string;
};

Data fields:

  • type - operation type (string);

  • sendAsset - the type of the asset that the sender is intending to send. This parameter allows users to specify the asset they are sending in the payment (Asset);

  • sendMax - maximum amount of sendAsset to send (string);

  • destination - destination account to send to (string);

  • destAsset - desired asset that the recipient account wishes to receive. The Stellar network dynamically converts the sent asset to the desired asset based on the current exchange rates (Asset);

  • destAmount - amount that the recipient account wishes to receive (string);

  • path - an array of assets to use as the path (Asset);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

pathPaymentStrictSend

Operation allows users to initiate payments where the sender can designate a specific asset for sending, allowing for dynamic currency conversions if necessary. This flexibility is particularly useful when the sender prefers to control the type and amount of the asset being sent.

Data structure:

XLMNativeOperationPathPaymentStrictSend
{
    type: 'pathPaymentStrictSend';
    sendAsset: Asset;
    sendAmount: string;
    destination: string;
    destAsset: Asset;
    destMin: string;
    path: Asset[];
    source?: string;
};

Data fields:

  • type - operation type (string);

  • sendAsset - type of the asset that the sender is intending to send. This parameter allows users to specify the asset they are sending in the payment (Asset);

  • sendAmount - amount of sendAsset to send, excluding fees (string);

  • destination - specifies the account that will receive the payment (string);

  • destAsset - desired asset that the destination account should receive. The Stellar network dynamically converts the sent asset to the destination asset based on the current exchange rates (Asset);

  • destMin - minimal amount that the destination account should receive (string);

  • path - an array of assets to use as the path (Asset);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

manageSellOffer

The operation facilitates the creation, update, or deletion of an offer to sell a specific amount of an asset in exchange for another.

Data structure:

XLMNativeOperationManageSellOffer
{
    type: 'manageSellOffer';
    selling: Asset;
    buying: Asset;
    amount: string;
    price: string;
    offerId?: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • selling - asset they are offering for sale (Asset);

  • buying - asset the user wants to buy (Asset);

  • amount - user sets the amount of the asset they want to sell (string);

  • price - user sets the price at which they are willing to make the sale. The price is expressed as the ratio of the amount of the selling asset to the amount of the buying asset (string);

  • offerId - offer ID parameter, if 0, will create a new offer (default). Otherwise, edits an existing offer (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

manageBuyOffer

The operation in Stellar facilitates the creation, update, or deletion of an offer to purchase a specific amount of an asset in exchange for another.

Data structure:

XLMNativeOperationManageBuyOffer
{
    type: 'manageBuyOffer';
    selling: Asset;
    buying: Asset;
    buyAmount: string;
    price: string;
    offerId?: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • selling - asset they are offering for sale (Asset);

  • buying - asset the user wants to buy (Asset);

  • buyAmount - user sets the amount of the asset they want to buy (string);

  • price - user sets the price at which they are willing to make the purchase. The price is expressed as the ratio of the amount of the buying asset to the amount of the selling asset (string);

  • offerId - offer ID parameter, if 0, will create a new offer (default). Otherwise, edits an existing offer (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

createPassiveSellOffer

The operation allows users to create an offer to sell one asset for another without immediately taking a reverse offer of equal price. This operation is particularly useful when users want to place a sell offer in the order book without matching it against existing offers, so it waits for a buyer.

Data structure:

XLMNativeOperationCreatePassiveSellOffer
{
    type: 'createPassiveSellOffer';
    selling: Asset;
    buying: Asset;
    amount: string;
    price: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • selling - asset they are offering for sale (Asset);

  • buying - asset the user wants to buy (Asset);

  • amount - user sets the amount of the asset they want to sell (string);

  • price - user sets the price at which they are willing to make the sale. The price is expressed as the ratio of the amount of the selling asset to the amount of the buying asset (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

setOptions

The operation provides a way to configure specific parameters associated with an account, enhancing its functionality and defining its behavior on the Stellar network.

Data structure:

XLMNativeOperationSetOptions
{
    type: 'setOptions';
    inflationDest?: string;
    clearFlags?: string;
    setFlags?: string;
    masterWeight?: number;
    lowThreshold?: number;
    medThreshold?: number;
    highThreshold?: number;
    signer?: {
        ed25519PublicKey?: string;
        sha256Hash?: string;
        preAuthTx?: string;
        ed25519SignedPayload?: string;
        weight?: number;
    };
    homeDomain?: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • inflationDest - set this account ID as the account's inflation destination (string);

  • clearFlags - bitmap integer for which account flags to clear (string);

  • setFlags - bitmap integer for which account flags to set (string);

  • masterWeight - the master key weight, number from 0 to 255, inclusive (number);

  • lowThreshold - the sum weight for the low threshold (number);

  • medThreshold - the sum weight for the medium threshold (number);

  • highThreshold - the sum weight for the high threshold (number);

  • signer - add or remove a signer from the account;

    • ed25519PublicKey - the ed25519 public key of the signer (string);

    • sha256Hash - sha256 hash (string);

    • preAuthTx - hash of transaction (string);

    • ed25519SignedPayload - signed data (ed25519 public key + raw payload) (string);

    • weight - the weight of the new signer (0 to delete or 1-255) (string);

  • homeDomain - sets the home domain of an account. The home domain is a way to link the account to a specific domain on the internet (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

changeTrust

The operation adds, removes, or updates a trust line for a given asset from the source account to another.

Data structure:

XLMNativeOperationChangeTrust
{
    type: 'changeTrust';
    asset: StellarAsset | XLMLiquidityPoolAsset;
    limit?: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • asset - cryptocurrency based on the Stellar blockchain, determined by the asset issuer's address and asset's code, for which a trustline is added. Required parameter (Asset | XLMLiquidityPoolAsset);

  • limit - the limit for the asset, defaults to max int64. If the limit is set to "0" it deletes the trustline (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

allowTrust

The Operation enables an account to update the authorized flag of an existing trustline. This operation provides a way for the owner of an asset to control which accounts are allowed or disallowed to hold the issued asset.

Data structure:

XLMNativeOperationAllowTrust
{
    type: 'allowTrust';
    trustor: string;
    assetCode: string;
    authorize: 0 | 1 | 2;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • trustor - this is the account that initially established the trustline for the asset (string);

  • assetCode - the asset code being authorized (string);

  • authorize - 1 to authorize, 2 to authorize to maintain liabilities, and 0 to deauthorize (number);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

accountMerge

The operation enables an account to consolidate XLM balances from one Stellar account into another. This can be useful for streamlining holdings or closing redundant accounts.

Data structure:

XLMNativeOperationAccountMerge
{
    type: 'accountMerge';
    destination: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • destination - the destination account, where the XLM balance will be transferred (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

manageData

The operation allows for the manipulation of custom data entries associated with a specific account. These data entries are in the form of name/value pairs and serve as a flexible way to store additional information on the blockchain.

Data structure:

XLMNativeOperationManageData
{
    type: 'manageData';
    name: string;
    value: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • name - the name of the data entry (string);

  • value - the value of the data entry (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

bumpSequence

The operation is a specialized transaction that allows for the manipulation of the sequence number associated with a source account. Its primary purpose is to advance the sequence number to a specified value, effectively "bumping" it forward. This operation is particularly useful for resolving transaction order issues and ensuring that subsequent transactions are valid.

Data structure:

XLMNativeOperationBumpSequence
{
    type: 'bumpSequence';
    bumpTo: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • bumpTo - the target sequence number (bumpTo) to which the source account's sequence number will be bumped. This ensures that subsequent transactions must have a sequence number equal to or greater than the bumped value to be considered valid (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

createClaimableBalance

The operation allows users to create a claimable balance, which is a mechanism for locking funds in a secure state until a predefined condition is met.

Data structure:

XLMNativeOperationCreateClaimableBalance
{
    type: 'createClaimableBalance';
    asset: Asset;
    amount: string;
    claimants: {
        destination: string;
        predicate?: XLMPredicate;
    }[];
    source?: string;
};

Data fields:

  • type - operation type (string);

  • asset - the asset that will be locked in the claimable balance (Asset);

  • amount - the total amount of the asset stored in the ClaimableBalanceEntry, waiting to be claimed by the specified claimants (string);

  • claimants - an array of claimants. Users define one or more claimants who have the authority to claim the funds from the created balance (Array);

- destination - account address, claimable Balance (string) is tied to;

- predicate - the claim predicate. The claim predicate is optional, it defaults to unconditional if none is specified (XLMPredicate);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

claimClaimableBalance

The operation allows users to request access to the funds associated with a specific balance ID to use in further operations on the Stellar network.

Data structure:

XLMNativeOperationClaimClaimableBalance
{
    type: 'claimClaimableBalance';
    balanceId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • balanceId - the claimable balance ID to be claimed (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

beginSponsoringFutureReserves

The operation creates a sponsorship link between two accounts on the Stellar network. It allows one account to initiate the sponsorship of future reserves for another account.

Data structure:

XLMNativeOperationBeginSponsoringFutureReserves
{
    type: 'beginSponsoringFutureReserves';
    sponsoredId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • sponsoredId - the account ID where future reserves will be sponsored. This is the account that benefits from the sponsorship, eliminating the need for it to hold its own reserves (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

endSponsoringFutureReserves

The operation is used to finalize the sponsoring of future reserves. It allows you to complete the process of sponsoring future reserves that was started with the beginSponsoringFutureReserves.

Both beginSponsoringFutureReserves and endSponsoringFutureReserves operations must appear in the sponsorship transaction, guaranteeing that both accounts agree to the sponsorship.

Data structure:

XLMNativeOperationEndSponsoringFutureReserves
{
    type: 'endSponsoringFutureReserves';
    source?: string;
};

Data fields:

  • type - operation type (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeAccountSponsorship

The operation allows you to revoke the sponsorship for an account.

Data structure:

XLMNativeOperationRevokeAccountSponsorship
{
    type: 'revokeAccountSponsorship';
    account: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • account - the sponsored account ID for which the sponsorship is being revoked (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeTrustlineSponsorship

The operation allows users to remove the sponsorship for a particular trust line, which may affect the ability to transact with that asset.

Data structure:

XLMNativeOperationRevokeTrustlineSponsorship
{
    type: 'revokeTrustlineSponsorship';
    account: string;
    asset: Asset | XLMLiquidityPoolId;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • account - the sponsored account ID for which the sponsorship is being revoked (string);

  • asset - the trustline asset (Asset | XLMLiquidityPoolId);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeOfferSponsorship

The operation allows users to remove sponsorship granted to other accounts for a specific offer.

Data structure:

XLMNativeOperationRevokeOfferSponsorship
{
    type: 'revokeOfferSponsorship';
    seller: string;
    offerId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • seller - the account address of the seller who created the offer (string);

  • offerId - the offer ID for which the sponsorship is being revoked (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeDataSponsorship

The operation allows users to revoke the sponsorship granted to an account over a specific data record, resulting in the termination of the privileges associated with that sponsorship.

Data structure:

XLMNativeOperationRevokeDataSponsorship
{
    type: 'revokeDataSponsorship';
    account: string;
    name: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • account - the account ID for which the sponsorship is being revoked (string);

  • name - the name of the specific data entry for which the sponsorship is being revoked (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeClaimableBalanceSponsorship

The operation allows users to revoke sponsorship for a specific claimableBalance.

Data structure:

XLMNativeOperationRevokeClaimableBalanceSponsorship
{
    type: 'revokeClaimableBalanceSponsorship';
    balanceId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • balanceId - the sponsored claimable balance ID, for which the sponsorship is being revoked (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeLiquidityPoolSponsorship

The operation allows users to cancel the sponsorship of a liquidity pool. Using this operation, you can remove the sponsorship associated with a specific liquidity pool identifier.

Data structure:

XLMNativeOperationRevokeLiquidityPoolSponsorship
{
    type: 'revokeLiquidityPoolSponsorship';
    liquidityPoolId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • liquidityPoolId - the sponsored liquidity pool ID in 'hex' string, for which the sponsorship is being revoked (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

revokeSignerSponsorship

The operation is used to create a sponsorship revocation transaction from a signer on the Stellar network.

Data structure:

XLMNativeOperationRevokeSignerSponsorship
{
    type: 'revokeSignerSponsorship';
    account: string;
    signer: {
        ed25519PublicKey?: string;
        sha256Hash?: string;
        preAuthTx?: string;
    };
    source?: string;
};

Data fields:

  • type - operation type (string);

  • account - the account ID where the signer sponsorship is being removed from (string);

  • signer - the signer whose sponsorship is being removed (string);

    • ed25519PublicKey - the ed25519 public key of the signer (string);

    • sha256Hash - sha256 hash (string);

    • preAuthTx - hash of transaction (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

clawback

The operation enables the burning of a specific amount in a designated asset from a receiving account. This operation is a mechanism to irreversibly remove assets from an account, contributing to controlled asset management within the Stellar network.

Data structure:

XLMNativeOperationClawback
{
    type: 'clawback';
    asset: Asset;
    amount: string;
    from: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • asset - the asset being clawed back (Asset);

  • amount - the amount of the asset to claw back (string);

  • from - the account from which assets will be burned through the clawback operation (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

clawbackClaimableBalance

This operation is designed to manage unclaimed balances and maintain control over asset distribution within the Stellar network. You must claw back the entire claimable balance, not just part of it. Once a claimable balance has been claimed, use the regular clawback operation to claw it back.

Data structure:

XLMNativeOperationClawbackClaimableBalance
{
    type: 'clawbackClaimableBalance';
    balanceId: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • balanceId - unique identifier specifying the ClaimableBalanceEntry that is to be clawed back. This identifies the unclaimed balance to be reclaimed (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

setTrustLineFlags

The operation empowers the issuing account to configure authorization and trustline flags for a specific asset. This operation is crucial for fine-tuning the conditions and permissions associated with a trustline, enhancing control over asset interactions within the Stellar network.

Data structure:

XLMNativeOperationSetTrustLineFlags
{
    type: 'setTrustLineFlags';
    trustor: string;
    asset: Asset;
    flags: {
        authorized?: boolean;
        authorizedToMaintainLiabilities?: boolean;
        clawbackEnabled?: boolean;
    };
    source?: string;
};

Data fields:

  • type - operation type (string);

  • trustor - the account (trustor) whose trustline is being configured (string);

  • asset - the asset on the trustline (Asset);

  • flags - parameters specifying the set of flags to modify;

    • authorized - authorize account to perform operations with its credit (boolean);

    • authorizedToMaintainLiabilities - authorize account to maintain and reduce liabilities for its credit (boolean);

    • clawbackEnabled - stop claimable balances on this trustlines from having clawbacks enabled, this flag can only be set to false (boolean);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

liquidityPoolDeposit

The operation facilitates the deposit of assets into a liquidity pool, thereby increasing the reserves of the liquidity pool in exchange for pool shares. This operation is fundamental for participants to contribute liquidity to a pool and, in return, receive pool shares representing their share of the liquidity pool.

Data structure:

XLMNativeOperationLiquidityPoolDeposit
{
    type: 'liquidityPoolDeposit';
    liquidityPoolId: string;
    maxAmountA: string;
    maxAmountB: string;
    minPrice: string;
    maxPrice: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • liquidityPoolId - unique identifier specifying the liquidity pool where the assets are deposited (string);

  • maxAmountA - parameter indicating the maximum amount of asset A to be deposited into the pool. The specific asset is determined based on the ordering in the liquidity pool, where "A" refers to the first asset (string);

  • maxAmountB - parameter indicating the maximum amount of asset B to be deposited into the pool. The specific asset is determined based on the ordering in the liquidity pool, where "B" refers to the second asset (string);

  • minPrice - the minimum acceptable price for the assets being deposited. This parameter helps participants control the minimum rate at which they are willing to exchange their assets for pool shares (string);

  • maxPrice - the maximum acceptable price for the assets being deposited. This parameter allows participants to set an upper limit on the rate at which they are willing to exchange their assets for pool shares (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

liquidityPoolWithdraw

The operation enables users to withdraw assets from a liquidity pool. This process reduces the number of pool shares held by the participant in exchange for a portion of the pool's reserves. Participants can actively manage their liquidity positions in the pool through withdrawals.

Data structure:

XLMNativeOperationLiquidityPoolWithdraw
{
    type: 'liquidityPoolWithdraw';
    liquidityPoolId: string;
    amount: string;
    minAmountA: string;
    minAmountB: string;
    source?: string;
};

Data fields:

  • type - operation type (string);

  • liquidityPoolId - unique identifier specifying the liquidity pool from which assets are being withdrawn (string);

  • amount - the amount of pool shares to withdraw (string);

  • minAmountA - parameter indicating the minimum amount of asset A to be withdrawn from the pool (string);

  • minAmountB - parameter indicating the minimum amount of asset B to be withdrawn from the pool. minAmountA и minAmountB help participants control a percentage of slippage from the "spot price" on the pool, ensuring a more predictable outcome (string);

  • source - the source account for the payment. Defaults to the transaction's source account (string).

Transaction Signing

Request Structure

POST api/transaction/attach-signature/xlm

{
  publicKey: string;
  network: Network;
  unsignedMessage: string;
  signature: {
    s: string;
    R: string;
  };
}
{
 requestId: string;
 data: {
   txdata: string;
 };
}
Parameters
  • publicKey - public key, required parameter, string.

  • network - network type, optional parameter, default value 'livenet' (Network);

  • unsignedMessage - transaction data gained at the previous stage (string);

  • signature - signature data object.

Sending Transaction to Network

Request Structure

POST api/transaction/send/xlm

{
  txdata: string;
}
{
 requestId: string;
 data: {
   txid: string;
 };
}
Parameters
  • txdata - signed transaction data, required parameter, string.

Stellar Utility Endpoints

Get Information About XLM Reserved Balance (getXLMAccountReserve method)

Request Structure

POST /api/utility/account-reserve

{
  address: string;
}
{
  requestId: string;
  reserved: {
    baseReserve: string,
    xlm: string,
    assets: {
    value: string,
    count: number,
    },
  total: string,
  }
}
Parameters
  • address - a unique string used for wallet identification on the Stellar chain. Starts with 'G' and contains 56 numeric and alphabetic characters.
Response Parameters
  • requestId - request identifier (string - uuid);

  • baseReserve - reserve that the network uses while estimating accounts minimum balance. This balance can't be sent or spent;

  • xlm - XLM amount, reserved on the account;

  • assets - reserved assets data object;

  • value - amount of the XLM, reserved on the account;

  • count - trustline amount, set on the account;

  • total - total for reserves on the account, including their mininmum balance and their assets.

Get XLM Base Reserve (baseReserve)(getXLMBaseReserve method)

Request Structure

GET /api/utility/base-reserve

{
  requestId: string,
  baseReserve: string,
}
Response Parameters
  • requestId - request identifier (string - uuid);

  • baseReserve - reserve that the network uses while estimating accounts minimum balance. This balance can't be sent or spent;

Check Existence of an Account (checkXLMAccount method)

Request Structure

POST /api/utility/check-account

{
  address: string;
}
{
  requestId: string,
  accountExists: boolean,
}
Parameters
  • address - a unique string used for wallet identification on the Stellar chain. Starts with 'G' and contains 56 numeric and alphabetic characters;
Response Parameters
  • requestId - request identifier (string - uuid);

  • accountExists - boolean, shows if the account exists

Check Trustline Existance (checkXLMAccountHasTrustline mehtod)

Request Structure

POST /api/utility/check-account-trustline

{
  address: string;
  issuer: string;
  code: string
}
{
  requestId: string
  hasTrustline: boolean,
}
Parameters
  • address - a unique string used for wallet identification on the Stellar chain. Starts with 'G' and contains 56 numeric and alphabetic characters;

  • issuer - an account on the Stellar blockchain, that creates, releases and deletes new assets (tokens) on the blockchain;

  • code  - an asset’s identifying code. Contains several symbols and helps to distinguish the asset from the others released by the same issuer;

Response Parameters
  • requestId - request identifier (string - uuid);

  • hasTrustline - boolean, shows if trustline exists.