Skip to content

Latest commit

 

History

History
773 lines (572 loc) · 53.6 KB

File metadata and controls

773 lines (572 loc) · 53.6 KB
title Explore Stellar Operations: Accounts, Payments, Trustlines & More
sidebar_label List of Operations
description Explore the full list of Stellar operations, including creating accounts, making payments, creating trustlines, all smart contract operations, and more.
sidebar_position 20

List of Operations

Operations are objects that represent a desired change to the ledger and are submitted to the network grouped in a transaction. For each operation, there is a successful or failed result type. In the case of success, the user can gather information about the effect of the operation. In the case of failure, the user can learn more about the error.

Learn more about transactions and operations in our Operations and Transactions section.

There are currently 26 operations you can use on the Stellar network, these operations, their definitions, SDKs, thresholds, parameters, and errors are listed below.

:::note

All these operations have an optional source account parameter. If the source account parameter is omitted, the source account of the transaction is considered as the source account of the operation.

:::

Create account

Creates and funds a new account with the specified starting balance

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: CreateAccountResult
Parameters:

Parameter Type Description
Destination account ID New account address that is created and funded.
Starting Balance integer Amount of XLM to send to the newly created account. This XLM comes from the source account.

Possible errors:

Error Code Description
CREATE_ACCOUNT_MALFORMED -1 The destination is invalid.
CREATE_ACCOUNT_UNDERFUNDED -2 The source account performing the command does not have enough funds to give destination the starting balance amount of XLM and still maintain its minimum XLM reserve plus satisfy its XLM selling liabilities.
CREATE_ACCOUNT_LOW_RESERVE -3 This operation would create an account with fewer than the minimum number of XLM an account must hold.
CREATE_ACCOUNT_ALREADY_EXIST -4 The destination account already exists.

Payment

Sends an amount in a specific asset to a destination account

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: PaymentResult
Parameters:

Parameters Type Description
Destination account ID Account address that receives the payment.
Asset asset Asset to send to the destination account.
Amount integer Amount of the aforementioned asset to send.

Possible errors:

Error Code Description
PAYMENT_MALFORMED -1 The input to the payment is invalid.
PAYMENT_UNDERFUNDED -2 The source account (sender) does not have enough funds to send amount and still satisfy its selling liabilities. Note that if sending XLM, the sender must additionally maintain its minimum XLM reserve.
PAYMENT_SRC_NO_TRUST -3 The source account does not trust the issuer of the asset it is trying to send.
PAYMENT_SRC_NOT_AUTHORIZED -4 The source account is not authorized to send this payment.
PAYMENT_NO_DESTINATION -5 The receiving account does not exist. Note that this error will not be returned if the receiving account is the issuer of asset (i.e, when the asset is being burned).
PAYMENT_NO_TRUST -6 The receiver does not trust the issuer of the asset being sent. For more information, see the Assets section.
PAYMENT_NOT_AUTHORIZED -7 The destination account is not authorized by the asset's issuer to hold the asset.
PAYMENT_LINE_FULL -8 The destination account (receiver) does not have sufficient limits to receive amount and still satisfy its buying liabilities.

Path payment strict send

A payment where the asset sent can be different than the asset received; allows the user to specify the amount of the asset to send

Learn more about path payments: Path Payments Guide

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: PathPaymentStrictSendResult
Parameters:

Parameters Type Description
Send asset asset The asset deducted from the sender's account.
Send amount integer The amount of send asset to deduct (excluding fees).
Destination account ID Account ID of the recipient.
Destination asset asset The asset the destination account receives.
Destination min integer The minimum amount of destination asset the destination account can receive.
Path list of assets The assets (other than send asset and destination asset) involved in the offers the path takes. For example, if you can only find a path from USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and the path field would contain XLM and BTC.

Possible errors:

Error Code Description
PATH_PAYMENT_STRICT_SEND_MALFORMED -1 The input to this path payment is invalid.
PATH_PAYMENT_STRICT_SEND_UNDERFUNDED -2 The source account (sender) does not have enough funds to send and still satisfy its selling liabilities. Note that if sending XLM, the sender must additionally maintain its minimum XLM reserve.
PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST -3 The source account does not trust the issuer of the asset it is trying to send.
PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED -4 The source account is not authorized to send this payment.
PATH_PAYMENT_STRICT_SEND_NO_DESTINATION -5 The destination account does not exist.
PATH_PAYMENT_STRICT_SEND_NO_TRUST -6 The destination account does not trust the issuer of the asset being sent. For more, see the Assets section.
PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED -7 The destination account is not authorized by the asset's issuer to hold the asset.
PATH_PAYMENT_STRICT_SEND_LINE_FULL -8 The destination account does not have sufficient limits to receive destination amount and still satisfy its buying liabilities.
PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS -10 There is no path of offers connecting the send asset and destination asset. Stellar only considers paths of length 5 or shorter.
PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF -11 The payment would cross one of its own offers.
PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN -12 The paths that could send destination amount of destination asset would fall short of destination min.

Path payment strict receive

A payment where the asset received can be different from the asset sent; allows the user to specify the amount of the asset received

Learn more about path payments: Path Payments Guide

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: PathPaymentStrictReceiveResult
Parameters:

Parameters Type Description
Send asset asset The asset deducted from the sender's account.
Send max integer The maximum amount of send asset to deduct (excluding fees).
Destination account ID Account ID of the recipient.
Destination asset asset The asset the destination account receives.
Destination amount integer The amount of destination asset the destination account receives.
Path list of assets The assets (other than send asset and destination asset) involved in the offers the path takes. For example, if you can only find a path from USD to EUR through XLM and BTC, the path would be USD -> XLM -> BTC -> EUR and the path field would contain XLM and BTC.

Possible errors:

Error Code Description
PATH_PAYMENT_STRICT_RECEIVE_MALFORMED -1 The input to this path payment is invalid.
PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED -2 The source account (sender) does not have enough funds to send and still satisfy its selling liabilities. Note that if sending XLM, the the sender must additionally maintain its minimum XLM reserve.
PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST -3 The source account does not trust the issuer of the asset it is trying to send.
PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED -4 The source account is not authorized to send this payment.
PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION -5 The destination account does not exist.
PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST -6 The destination account does not trust the issuer of the asset being sent. For more, see the Assets section.
PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED -7 The destination account is not authorized by the asset's issuer to hold the asset.
PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL -8 The destination account does not have sufficient limits to receive destination amount and still satisfy its buying liabilities.
PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS -10 There is no path of offers connecting the send asset and destination asset. Stellar only considers paths of length 5 or shorter.
PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF -11 The payment would cross one of its own offers.
PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX -12 The paths that could send destination amount of destination asset would exceed send max.

Manage buy offer

Creates, updates, or deletes an offer to buy a specific amount of an asset for another

Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageBuyOfferResult
Parameters:

Parameters Type Description
Selling asset Asset the offer creator is selling.
Buying asset Asset the offer creator is buying.
Amount integer Amount of buying being bought. Set to 0 if you want to delete an existing offer.
Price {numerator, denominator} Price of 1 unit of buying in terms of selling. For example, if you wanted to buy 30 XLM and sell 5 BTC, the price would be {5,30}.
Offer ID unsigned integer The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete.

Possible errors:

Error Code Description
MANAGE_BUY_OFFER_MALFORMED -1 The input is incorrect and would result in an invalid offer.
MANAGE_BUY_OFFER_SELL_NO_TRUST -2 The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_BUY_OFFER_BUY_NO_TRUST -3 The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED -4 The account creating the offer is not authorized to sell this asset.
MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED -5 The account creating the offer is not authorized to buy this asset.
MANAGE_BUY_OFFER_LINE_FULL -6 The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities.
MANAGE_BUY_OFFER_UNDERFUNDED -7 The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately.
MANAGE_BUY_OFFER_CROSS_SELF -8 The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself.
MANAGE_BUY_OFFER_NOT_FOUND -11 An offer with that offerID cannot be found.
MANAGE_BUY_OFFER_LOW_RESERVE -12 The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase.

Manage sell offer

Creates, updates, or deletes an offer to sell a specific amount of an asset for another

Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageSellOfferResult
Parameters:

Parameters Type Description
Selling asset Asset the offer creator is selling.
Buying asset Asset the offer creator is buying.
Amount integer Amount of selling being sold. Set to 0 if you want to delete an existing offer.
Price {numerator, denominator} Price of 1 unit of selling in terms of buying. For example, if you wanted to sell 30 XLM and buy 5 BTC, the price would be {5,30}.
Offer ID unsigned integer The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete.

Possible errors:

Error Code Description
MANAGE_SELL_OFFER_MALFORMED -1 The input is incorrect and would result in an invalid offer.
MANAGE_SELL_OFFER_SELL_NO_TRUST -2 The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_SELL_OFFER_BUY_NO_TRUST -3 The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED -4 The account creating the offer is not authorized to sell this asset.
MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED -5 The account creating the offer is not authorized to buy this asset.
MANAGE_SELL_OFFER_LINE_FULL -6 The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities.
MANAGE_SELL_OFFER_UNDERFUNDED -7 The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately.
MANAGE_SELL_OFFER_CROSS_SELF -8 The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself.
MANAGE_SELL_OFFER_NOT_FOUND -11 An offer with that offerID cannot be found.
MANAGE_SELL_OFFER_LOW_RESERVE -12 The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase.

Create passive sell offer

Creates an offer to sell one asset for another without taking a reverse offer of equal price

Learn more about passive sell offers: Liquidity on Stellar: SDEX and Liquidity Pools

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageSellOfferResult
Parameters:

Parameters Type Description
Selling asset Asset the offer creator is selling.
Buying asset Asset the offer creator is buying.
Amount integer Amount of selling being sold.
Price {numerator, denominator} Price of 1 unit of selling in terms of buying. For example, if you wanted to sell 30 XLM and buy 5 BTC, the price would be {5,30}.

Possible errors:

Error Code Description
MANAGE_SELL_OFFER_MALFORMED -1 The input is incorrect and would result in an invalid offer.
MANAGE_SELL_OFFER_SELL_NO_TRUST -2 The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_SELL_OFFER_BUY_NO_TRUST -3 The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED -4 The account creating the offer is not authorized to sell this asset.
MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED -5 The account creating the offer is not authorized to buy this asset.
MANAGE_SELL_OFFER_LINE_FULL -6 The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities.
MANAGE_SELL_OFFER_UNDERFUNDED -7 The account creating the offer does not have sufficient limits to send selling and still satisfy its selling liabilities. Note that if selling XLM then the account must additionally maintain its minimum XLM reserve, which is calculated assuming this offer will not completely execute immediately.
MANAGE_SELL_OFFER_CROSS_SELF -8 The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself.
MANAGE_SELL_OFFER_NOT_FOUND -11 An offer with that offerID cannot be found.
MANAGE_SELL_OFFER_LOW_RESERVE -12 The account creating this offer does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every offer an account creates, the minimum amount of XLM that account must hold will increase.

Set options

Set options for an account such as flags, inflation destination, signers, home domain, and master key weight

Learn more about flags: Flags Section
Learn more about the home domain: Stellar Ecosystem Proposals SEP-0001
Learn more about signers operations and key weight: Signature and Multisignature Section

SDKs: JavaScript | Java | Go
Threshold: High (when updating signers or other thresholds) or Medium (when updating everything else)
Result: SetOptionsResult
Parameters:

Parameters Type Description
Inflation Destination account ID Account of the inflation destination.
Clear flags integer Indicates which account flags to clear. These account-level flags are primarily used by asset issuers. For details about the flags, please refer to the Asset Design Considerations page. The bit mask integer subtracts from the existing flags of the account. This allows for setting specific bits without knowledge of existing flags.
Set flags integer Indicates which account flags to set. These account-level flags are primarily used by asset issuers. For details about the flags, please refer to the Asset Design Considerations page The bit mask integer adds onto the existing flags of the account. This allows for setting specific bits without knowledge of existing flags.
Master weight integer A number from 0-255 (inclusive) representing the weight of the master key. If the weight of the master key is updated to 0, it is effectively disabled.
Low threshold integer A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a low threshold.
Medium threshold integer A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a medium threshold.
High threshold integer A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a high threshold.
Home domain string Sets the home domain of an account. See Federation.
Signer {Public Key, weight} Add, update, or remove a signer from an account. Signer weight is a number from 0-255 (inclusive). The signer is deleted if the weight is 0.

Possible errors:

Error Code Description
SET_OPTIONS_LOW_RESERVE -1 This account does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every new signer added to an account, the minimum reserve of XLM that account must hold increases.
SET_OPTIONS_TOO_MANY_SIGNERS -2 20 is the maximum number of signers an account can have, and adding another signer would exceed that.
SET_OPTIONS_BAD_FLAGS -3 The flags set and/or cleared are invalid by themselves or in combination.
SET_OPTIONS_INVALID_INFLATION -4 The destination account set in the inflation field does not exist.
SET_OPTIONS_CANT_CHANGE -5 This account can no longer change the option it wants to change.
SET_OPTIONS_UNKNOWN_FLAG -6 The account is trying to set a flag that is unknown.
SET_OPTIONS_THRESHOLD_OUT_OF_RANGE -7 The value for a key weight or threshold is invalid.
SET_OPTIONS_BAD_SIGNER -8 Any additional signers added to the account cannot be the master key.
SET_OPTIONS_INVALID_HOME_DOMAIN -9 Home domain is malformed.

Change trust

Creates, updates, or deletes a trustline

Learn more about trustlines: Trustlines section

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ChangeTrustResult
Parameters:

Parameters Type Description
Line ChangeTrustAsset The asset of the trustline. For example, if a user extends a trustline of up to 200 USD to an anchor, the line is USD:anchor.
Limit integer The limit of the trustline. In the previous example, the limit would be 200.

Possible errors:

Error Code Description
CHANGE_TRUST_MALFORMED -1 The input to this operation is invalid.
CHANGE_TRUST_NO_ISSUER -2 The issuer of the asset cannot be found.
CHANGE_TRUST_INVALID_LIMIT -3 The limit is not sufficient to hold the current balance of the trustline and still satisfy its buying liabilities. This error occurs when attempting to remove a trustline with a non-zero asset balance.
CHANGE_TRUST_LOW_RESERVE -4 This account does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every new trustline added to an account, the minimum reserve of XLM that account must hold increases.
CHANGE_TRUST_SELF_NOT_ALLOWED -5 The source account attempted to create a trustline for itself, which is not allowed.
CHANGE_TRUST_TRUST_LINE_MISSING -6 The asset trustline is missing for the liquidity pool.
CHANGE_TRUST_CANNOT_DELETE -7 The asset trustline is still referenced by a liquidity pool.
CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES -8 The asset trustline is deauthorized.

Allow trust

Updates the authorized flag of an existing trustline. This operation can only be performed by the asset issuer

:::warning

This operation is deprecated as of Protocol 17- prefer SetTrustlineFlags operation instead.

:::

SDKs: JavaScript | Java | Go
Threshold: Low
Result: AllowTrustResult
Parameters:

Parameters Type Description
Trustor account ID The account that has an established trustline for the asset.
Type asset code The 4 or 12 character-maximum asset code of the trustline the source account is authorizing. For example, if an issuing account wants to allow another account to hold its USD credit, the type is USD.
Authorize integer Flag indicating whether the trustline is authorized. 1 if the account is authorized to transact with the asset. 2 if the account is authorized to maintain offers, but not to perform other transactions

Possible errors:

Error Code Description
ALLOW_TRUST_MALFORMED -1 The asset specified in type is invalid. In addition, this error happens when the native asset is specified.
ALLOW_TRUST_NO_TRUST_LINE -2 The trustor does not have a trustline with the issuer performing this operation.
ALLOW_TRUST_TRUST_NOT_REQUIRED -3 The source account (issuer performing this operation) does not require trust. In other words, it does not have the flag AUTH_REQUIRED_FLAG set.
ALLOW_TRUST_CANT_REVOKE -4 The source account is trying to revoke the trustline of the trustor, but it cannot do so.
ALLOW_TRUST_SELF_NOT_ALLOWED -5 The source account attempted to allow a trustline for itself, which is not allowed because an account cannot create a trustline with itself.
ALLOW_TRUST_LOW_RESERVE -6 Claimable balances can't be created on revocation of asset (or pool share) trustlines associated with a liquidity pool due to low reserves.

Account merge

Transfers the XLM balance of an account to another account and removes the source account from the ledger

SDKs: JavaScript | Java | Go
Threshold: High
Result: AccountMergeResult
Parameters:

Parameters Type Description
Destination account ID The account that receives the remaining XLM balance of the source account.

Possible errors:

Error Code Description
ACCOUNT_MERGE_MALFORMED -1 The operation is malformed because the source account cannot merge with itself. The destination must be a different account.
ACCOUNT_MERGE_NO_ACCOUNT -2 The destination account does not exist.
ACCOUNT_MERGE_IMMUTABLE_SET -3 The source account has AUTH_IMMUTABLE flag set.
ACCOUNT_MERGE_HAS_SUB_ENTRIES -4 The source account has trustlines/offers.
ACCOUNT_MERGE_SEQNUM_TOO_FAR -5 Source's account sequence number is too high. It must be less than (ledgerSeq << 32) = (ledgerSeq * 0x100000000).
ACCOUNT_MERGE_DEST_FULL -6 The destination account cannot receive the balance of the source account and still satisfy its lumen buying liabilities.
ACCOUNT_MERGE_IS_SPONSOR -7 The source account is a sponsor.

Manage data

Sets, modifies, or deletes a data entry (name/value pair) that is attached to an account

Learn more about entries and subentries: Accounts section

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ManageDataResult
Parameters:

Parameters Type Description
Name string String up to 64 bytes long. If this is a new Name it will add the given name/value pair to the account. If this Name is already present then the associated value will be modified.
Value binary data (optional) If not present then the existing Name will be deleted. If present then this value will be set in the DataEntry. Up to 64 bytes long.

Possible errors:

Error Code Description
MANAGE_DATA_NOT_SUPPORTED_YET -1 The network hasn't moved to this protocol change yet. This failure means the network doesn't support this feature yet.
MANAGE_DATA_NAME_NOT_FOUND -2 Trying to remove a Data Entry that isn't there. This will happen if Name is set (and Value isn't) but the Account doesn't have a DataEntry with that Name.
MANAGE_DATA_LOW_RESERVE -3 This account does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a subentry and still satisfy its XLM selling liabilities. For every new DataEntry added to an account, the minimum reserve of XLM that account must hold increases.
MANAGE_DATA_INVALID_NAME -4 Name not a valid string.

Bump sequence

Bumps forward the sequence number of the source account to the given sequence number, invalidating any transaction with a smaller sequence number

SDKs: JavaScript | Java | Go
Threshold: Low
Result: BumpSequenceResult
Parameters:

Parameters Type Description
bumpTo SequenceNumber desired value for the operation's source account sequence number.

Possible errors:

Error Code Description
BUMP_SEQUENCE_BAD_SEQ -1 The specified bumpTo sequence number is not a valid sequence number. It must be between 0 and INT64_MAX (9223372036854775807 or 0x7fffffffffffffff).

Create claimable balance

Moves an amount of asset from the operation source account into a new ClaimableBalanceEntry

Learn more about claimable balances: Claimable Balances Guide

SDKs: Java
Threshold: Medium
Result: CreateClaimableBalanceResult
Parameters:

Parameters Type Description
Asset asset Asset that will be held in the ClaimableBalanceEntry in the form asset_code:issuing_address or native (XLM).
Amount integer Amount of asset stored in the ClaimableBalanceEntry.
Claimants list of claimants List of Claimants (account address and ClaimPredicate pair) that can claim this ClaimableBalanceEntry.

Possible errors:

Error Code Description
CREATE_CLAIMABLE_BALANCE_MALFORMED -1 The input to this operation is invalid.
CREATE_CLAIMABLE_BALANCE_LOW_RESERVE -2 The account creating this entry does not have enough XLM to satisfy the minimum XLM reserve increase caused by adding a ClaimableBalanceEntry. For every claimant in the list, the minimum amount of XLM this account must hold will increase by baseReserve.
CREATE_CLAIMABLE_BALANCE_NO_TRUST -3 The source account does not trust the issuer of the asset it is trying to include in the ClaimableBalanceEntry.
CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED -4 The source account is not authorized to transfer this asset.
CREATE_CLAIMABLE_BALANCE_UNDERFUNDED -5 The source account does not have enough funds to transfer amount of this asset to the ClaimableBalanceEntry.

Claim claimable balance

Claims a ClaimableBalanceEntry that corresponds to the BalanceID and adds the amount of an asset on the entry to the source account

Learn more about claimable balances and view more parameters: Claimable Balances Guide

SDKs: Java
Threshold: Low
Result: ClaimClaimableBalanceResult
Parameters:

Parameters Type Description
BalanceID claimableBalanceID BalanceID on the ClaimableBalanceEntry that the source account is claiming. The balanceID can be retrieved from a successful CreateClaimableBalanceResult. See Claimable Balance Guide for more information.

Possible errors:

Error Code Description
CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST -1 There is no existing ClaimableBalanceEntry that matches the input BalanceID.
CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM -2 There is no claimant that matches the source account, or the claimants predicate is not satisfied.
CLAIM_CLAIMABLE_BALANCE_LINE_FULL -3 The account claiming the ClaimableBalanceEntry does not have sufficient limits to receive amount of the asset and still satisfy its buying liabilities.
CLAIM_CLAIMABLE_BALANCE_NO_TRUST -4 The source account does not trust the issuer of the asset it is trying to claim in the ClaimableBalanceEntry.
CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED -5 The source account is not authorized to claim the asset in the ClaimableBalanceEntry.

Begin sponsoring future reserves

Allows an account to pay the base reserves for another account; sponsoring account establishes the is-sponsoring-future-reserves relationship

There must also be an end sponsoring future reserves operation in the same transaction

Learn more about sponsored reserves: Sponsored Reserves Guide

SDKs: Java
Threshold: Medium
Result: BeginSponsoringFutureReservesResult
Parameters:

Parameters Type Description
SponsoredID account ID Account that will have its reserves sponsored.

Possible errors:

Error Code Description
BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED -1 Source account is equal to sponsoredID.
BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED -2 Source account is already sponsoring sponsoredID.
BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE -3 Either source account is currently being sponsored, or sponsoredID is sponsoring another account.

End sponsoring future reserves

Terminates the current is-sponsoring-future-reserves relationship in which the source account is sponsored

Learn more about sponsored reserves: Sponsored Reserves Guide

SDKs: Java
Threshold: Medium
Result: EndSponsoringFutureReservesResult
Parameters:

Parameters Type Description
begin_sponsor account ID The id of the account which initiated the sponsorship.

Possible errors:

Error Code Description
END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED -1 Source account is not sponsored.

Revoke sponsorship

Sponsoring account can remove or transfer sponsorships of existing ledgerEntries and signers; the logic of this operation depends on the state of the source account

Learn more about sponsored reserves: Sponsored Reserves Guide

Threshold: Medium
Result: RevokeSponsorshipResult

This operation is a union with two possible types:

Union Type Parameters Type Description
REVOKE_SPONSORSHIP_LEDGER_ENTRY LedgerKey ledgerKey Ledger key that holds information to identify a specific ledgerEntry that may have its sponsorship modified. See LedgerKey for more information.

Or

Union Type Parameters Type Description
REVOKE_SPONSORSHIP_SIGNER Signer {account ID, Signer Key} Signer that may have its sponsorship modified.

Possible errors:

Error Code Description
REVOKE_SPONSORSHIP_DOES_NOT_EXIST -1 The ledgerEntry for LedgerKey doesn’t exist, the account ID on signer doesn’t exist, or the Signer Key doesn’t exist on account ID’s account.
REVOKE_SPONSORSHIP_NOT_SPONSOR -2 If the ledgerEntry/signer is sponsored, then the source account must be the sponsor. If the ledgerEntry/signer is not sponsored, the source account must be the owner. This error will be thrown otherwise.
REVOKE_SPONSORSHIP_LOW_RESERVE -3 The sponsored account does not have enough XLM to satisfy the minimum balance increase caused by revoking sponsorship on a ledgerEntry/signer it owns, or the sponsor of the source account doesn’t have enough XLM to satisfy the minimum balance increase caused by sponsoring a transferred ledgerEntry/signer.
REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE -4 Sponsorship cannot be removed from this ledgerEntry. This error will happen if the user tries to remove the sponsorship from a ClaimableBalanceEntry.
REVOKE_SPONSORSHIP_MALFORMED -5 One or more of the inputs to the operation was malformed.

Clawback

Burns an amount in a specific asset from an account. Only the issuing account for the asset can perform this operation.

Learn more about clawbacks: Clawback Guide

SDKs: JavaScript | Java | Go
Threshold: Medium
Result: ClawbackResult
Parameters:

Parameters Type Description
From account ID Account address from which asset needs to be clawed back.
Asset asset Asset held by the destination account.
Amount integer Amount of the aforementioned asset to burn.

Possible errors:

Error Code Description
CLAWBACK_MALFORMED -1 The input to the clawback is invalid.
CLAWBACK_NOT_CLAWBACK_ENABLED -2 The trustline between From and the issuer account for this Asset does not have clawback enabled.
CLAWBACK_NO_TRUST -3 The From account does not trust the issuer of the asset.
CLAWBACK_UNDERFUNDED -4 The From account does not have a sufficient available balance of the asset (after accounting for selling liabilities).

Clawback claimable balance

Claws back an unclaimed ClaimableBalanceEntry, burning the pending amount of the asset. Only the issuing account for the asset can perform this operation.

Learn more about clawbacks: Clawback Guide

Learn more about claimable balances: Claimable Balances Guide

SDKs: Java
Threshold: Medium
Result: ClaimClaimableBalanceResult
Parameters:

Parameters Type Description
BalanceID claimableBalanceID The BalanceID on the ClaimableBalanceEntry that the source account is claiming, which can be retrieved from a succesful CreateClaimableBalanceResult

Possible errors:

Error Code Description
CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST -1 There is no existing ClaimableBalanceEntry that matches the input BalanceID.
CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER -2 The source account is not the issuer of the asset in the claimable balance.
CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED -3 The CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG is not set for this trustline.

Set trustline flags

Allows issuing account to configure authorization and trustline flags to an asset

The Asset parameter is of the TrustLineAsset type. If you are modifying a trustline to a regular asset (i.e. one in a Code:Issuer format), this is equivalent to the Asset type. If you are modifying a trustline to a pool share, however, this is composed of the liquidity pool's unique ID.

Learn more about flags: Flags Glossary Entry

SDKs: Java
Threshold: Low
Result: SetTrustLineFlagsResult
Parameters:

Parameters Type Description
Trustor account ID The account that established this trustline.
Asset TrustLineAsset The asset trustline whose flags are being modified.
SetFlags integer One or more flags (combined via bitwise-OR) indicating which flags to set. Possible flags are: 1 if the trustor is authorized to transact with the asset or 2 if the trustor is authorized to maintain offers but not to perform other transactions.
ClearFlags integer One or more flags (combined via bitwise OR) indicating which flags to clear. Possibilities include those for SetFlags as well as 4, which prevents the issuer from clawing back its asset (both from accounts and claimable balances).

Possible errors:

Error Code Description
SET_TRUST_LINE_FLAGS_MALFORMED -1 This can happen for a number of reasons: the asset specified by AssetCode and AssetIssuer is invalid; the asset issuer isn't the source account; the Trustor is the source account; the native asset is specified; or the flags being set/cleared conflict or are otherwise invalid.
SET_TRUST_LINE_FLAGS_NO_TRUST_LINE -2 The Trustor does not have a trustline with the issuer performing this operation.
SET_TRUST_LINE_FLAGS_CANT_REVOKE -3 The issuer is trying to revoke the trustline authorization of Trustor, but it cannot do so because AUTH_REVOCABLE_FLAG is not set on the account.
SET_TRUST_LINE_FLAGS_INVALID_STATE -4 If the final state of the trustline has both AUTHORIZED_FLAG (1) and AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG (2) set, which are mutually exclusive.
SET_TRUST_LINE_FLAGS_LOW_RESERVE -5 Claimable balances can't be created on revocation of asset (or pool share) trustlines associated with a liquidity pool due to low reserves.

Liquidity pool deposit

Deposits assets into a liquidity pool, increasing the reserves of a liquidity pool in exchange for pool shares

Parameters to this operation depend on the ordering of assets in the liquidity pool: “A” refers to the first asset in the liquidity pool, and “B” refers to the second asset in the liquidity pool.

If the pool is empty, then this operation deposits maxAmountA of A and maxAmountB of B into the pool. If the pool is not empty, then this operation deposits at most maxAmountA of A and maxAmountB of B into the pool. The actual amounts deposited are determined using the current reserves of the pool. You can use these parameters to control a percentage of slippage.

Learn more about liquidity pools: Liquidity Pools section

SDKs: Java
Threshold: Medium
Result: LiquidityPoolDepositResult
Parameters:

Parameters Type Description
Liquidity Pool ID liquidityPoolID The PoolID for the Liquidity Pool to deposit into.
Max Amount A integer Maximum amount of first asset to deposit.
Max Amount B integer Maximum amount of second asset to deposit.
Min Price {numerator, denominator} Minimum depositA/depositB.
Max Price {numerator, denominator} Maximum depositA/depositB.

Possible errors:

Error Code Description
LIQUIDITY_POOL_DEPOSIT_MALFORMED -1 One or more of the inputs to the operation was malformed.
LIQUIDITY_POOL_DEPOSIT_NO_TRUST -2 No trustline exists for one of the assets being deposited.
LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED -3 The account does not have authorization for one of the assets.
LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED -4 There is not enough balance of one of the assets to perform the deposit.
LIQUIDITY_POOL_DEPOSIT_LINE_FULL -5 The pool share trustline does not have a sufficient limit.
LIQUIDITY_POOL_DEPOSIT_BAD_PRICE -6 The deposit price is outside of the given bounds.
LIQUIDITY_POOL_DEPOSIT_POOL_FULL -7 The liquidity pool reserves are full.

Liquidity pool withdraw

Withdraw assets from a liquidity pool, reducing the number of pool shares in exchange for reserves of a liquidity pool

The minAmountA and minAmountB parameters can be used to control a percentage of slippage from the "spot price" on the pool.

Learn more about liquidity pools: Liquidity Pools section

SDKs: Java
Threshold: Medium
Result: LiquidityPoolWithdrawResult
Parameters:

Parameters Type Description
Liquidity Pool ID liquidityPoolID The PoolID for the Liquidity Pool to withdraw from.
Amount integer Amount of pool shares to withdraw.
Min Amount A integer Minimum amount of the first asset to withdraw.
Min Amount B integer Minimum amount of the second asset to withdraw.

Possible errors:

Error Code Description
LIQUIDITY_POOL_WITHDRAW_MALFORMED -1 One or more of the inputs to the operation was malformed.
LIQUIDITY_POOL_WITHDRAW_NO_TRUST -2 There is no trustline for one of the assets.
LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED -3 Insufficient balance for the pool shares.
LIQUIDITY_POOL_WITHDRAW_LINE_FULL -4 The withdrawal would exceed the trustline limit for one of the assets.
LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM -5 Unable to withdraw enough to satisfy the minimum price.

Invoke Host Function

Invoke and deploy Soroban smart contracts with InvokeHostFunctionOp.

The InvokeHostFunctionOp can be used to perform the following Soroban operations:

  • Invoke contract functions: HOST_FUNCTION_TYPE_INVOKE_CONTRACT
  • Upload Wasm of the contracts: HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM
  • Deploy new contracts using the uploaded Wasm or built-in implementations: HOST_FUNCTION_TYPE_CREATE_CONTRACT

Note that Soroban transactions can only contain one operation per transaction.

Learn more here.

SDKs: Java
Threshold: Medium
Result: InvokeHostFunctionResult
Parameters:

Parameters Type Description
Host Function HostFunction The host function to invoke
Auth Soroban Authorization Entry Per-address authorizations for this host function.

Possible errors:

Error Code Description
INVOKE_HOST_FUNCTION_MALFORMED -1 One or more of the inputs to the operation was malformed.
INVOKE_HOST_FUNCTION_TRAPPED -2 The function invocation trapped in the Soroban runtime.
INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED -3 The function invocation could not complete within the currently configured resource constraints of the network.
INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED -4 A ledger entry required for this function's footprint is in an archived state, and must be restored.
INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE -5 The refundable Soroban fee provided was not sufficient to pay for the compute resources required by this function invocation.

Extend Footprint TTL

Extend the time to live (TTL) of entries for Soroban smart contracts with the ExtendFootprintTTLOp. This operation extends the TTL of the entries specified in the readOnly footprint of the transaction so that they will live at least until the extendTo ledger sequence number is reached.

Note that Soroban transactions can only contain one operation per transaction.

Learn more in the State Archival section.

SDKs: Java
Threshold: Medium
Result: ExtendFootprintTTLResult
Parameters:

Parameters Type Description
Ext ExtensionPoint Reserved for later use.
Extend To integer The ledger sequence number the entries will live until.

Possible errors:

Error Code Description
EXTEND_FOOTPRINT_TTL_MALFORMED -1 One or more of the inputs to the operation was malformed.
EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED -2 The TTL extension could not be completed within the currently configured resource constraints of the network.
EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE -3 The refundable Soroban fee provided was not sufficient to pay for TTL extension of the specified ledger entries.

Restore Footprint

Make archived Soroban smart contract entries accessible again by restoring them with RestoreFootprintOp. This operation restores the archived entries specified in the readWrite footprint.

Note that Soroban transactions can only contain one operation per transaction.

Learn more in the State Archival section.

SDKs: JavaScript | Java
Threshold: Medium
Result: RestoreFootprintResult
Parameters:

Parameters Type Description
Ext ExtensionPoint Reserved for later use.

Possible errors:

Error Code Description
RESTORE_FOOTPRINT_MALFORMED -1 One or more of the inputs to the operation was malformed.
RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED -2 The archive restoration could not be completed within the currently configured resource constraints of the network.
RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE -3 The refundable Soroban fee provided was not sufficient to pay for archive restoration of the specified ledger entries.