List of Operations
For a description of how operations work in XDBChain, see Operations.
- Create Account
- Payment
- Path payment strict send
- Path payment strict receive
- Manage buy offer
- Manage sell offer
- Create Passive Offer
- Set Options
- Change Trust
- Allow Trust
- Account Merge
- Manage Data
- Bump sequence
- Create claimable balance
- Claim claimable balance
- Begin sponsoring future reserves
- Clawback
- Clawback claimable balance
- Set trustline flags
- Liquidity pool deposit
- Liquidity pool withdraw
Create Account
This operation creates and funds a new account with the specified starting balance.
Threshold: Medium
Result: CreateAccountResult
Parameters:
Parameter | Type | Description |
---|---|---|
Destination | account ID | Account address that is created and funded. |
Starting Balance | integer | Amount of XDB to send to the newly created account. This XDB 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 XDB and still maintain its minimum XDB reserve. |
CREATE_ACCOUNT_LOW_RESERVE | -3 | This operation would create an account with fewer than the minimum number of XDB 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.
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 this transaction. Note that the sender has a minimum reserve of XDB it must hold at all times. |
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. |
PAYMENT_NO_TRUST | -6 | The receiver does not trust the issuer of the asset being sent. For more information, see the assets doc. |
PAYMENT_NOT_AUTHORIZED | -7 | The destination account is not authorized by the asset’s issuer to hold the asset. |
PAYMENT_LINE_FULL | -8 | The receiving account only trusts an asset’s issuer for a certain amount of credit. If this transaction succeeded, the receiver’s trust limit would be exceeded. |
PAYMENT_NO_ISSUER | -9 | The issuer of the asset does not exist. |
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 Encyclopedia Entry
SDKs: JavaScript 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 XDB and BTC, the path would be USD -> XDB -> BTC -> EUR and the path field would contain XDB 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 XDB then the sender must additionally maintain its minimum XDB 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. |
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 Encyclopedia Entry
SDKs: JavaScript 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 XDB and BTC, the path would be USD -> XDB -> BTC -> EUR and the path field would contain XDB 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 XDB then the sender must additionally maintain its minimum XDB 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. |
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 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 XDB 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 XDB then the account must additionally maintain its minimum XDB 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 XDB to satisfy the minimum XDB reserve increase caused by adding a subentry and still satisfy its XDB selling liabilities. For every offer an account creates, the minimum amount of XDB 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 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 XDB 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 XDB then the account must additionally maintain its minimum XDB 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 XDB to satisfy the minimum XDB reserve increase caused by adding a subentry and still satisfy its XDB selling liabilities. For every offer an account creates, the minimum amount of XDB that account must hold will increase. |
Create Passive Offer
A passive offer is an offer that does not act on and take a reverse offer of equal price. Instead, they only take offers of lesser price. For example, if an offer exists to buy 5 BTC for 30 XDB, and you make a passive offer to buy 30 XDB for 5 BTC, your passive offer does not take the first offer.
Note that regular offers made later than your passive offer can act on and take your passive offer, even if the regular offer is of the same price as your passive offer.
Passive offers allow market makers to have zero spread. If you want to trade EUR for USD at 1:1 price and USD for EUR also at 1:1, you can create two passive offers so the two offers don’t immediately act on each other.
Once the passive offer is created, you can manage it like any other offer using the manage offer operation.
Threshold: Medium
Result: CreatePassiveOfferResult
Parameters | Type | Description |
---|---|---|
Selling | asset | The asset you would like to sell. |
Buying | asset | The asset you would like to buy. |
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 XDB and buy 5 BTC, the price would be {5,30}. |
Possible errors:
Error | Code | Description |
---|---|---|
MANAGE_OFFER_MALFORMED | -1 | The input is incorrect and would result in an invalid offer. |
MANAGE_OFFER_SELL_NO_TRUST | -2 | The account creating the offer does not have a trustline for the asset it is selling. |
MANAGE_OFFER_BUY_NO_TRUST | -3 | The account creating the offer does not have a trustline for the asset it is buying. |
MANAGE_OFFER_SELL_NOT_AUTHORIZED | -4 | The account creating the offer is not authorized to sell this asset. |
MANAGE_OFFER_BUY_NOT_AUTHORIZED | -5 | The account creating the offer is not authorized to buy this asset. |
MANAGE_OFFER_LINE_FULL | -6 | The account creating the offer only trusts the issuer of buying to a certain credit limit. If this offer succeeded, the account would exceed its trust limit with the issuer. |
MANAGE_OFFER_UNDERFUNDED | -7 | The account does not have enough of selling to fund this offer. |
MANAGE_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_OFFER_SELL_NO_ISSUER | -9 | The issuer of selling asset does not exist. |
MANAGE_OFFER_BUY_NO_ISSUER | -10 | The issuer of buying asset does not exist. |
MANAGE_OFFER_NOT_FOUND | -11 | An offer with that offerID cannot be found. |
MANAGE_OFFER_LOW_RESERVE | -12 | The account creating this offer does not have enough XDB. For every offer an account creates, the minimum amount of XDB 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.
For more information on the signing options, please refer to the multi-sig doc.
When updating signers or other thresholds, the threshold of this operation is high.
Threshold: Medium or High
Result: SetOptionsResult
Parameters:
Parameters | Type | Description |
---|---|---|
Clear flags | integer | Indicates which flags to clear. For details about the flags, please refer to the accounts doc. 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 flags to set. For details about the flags, please refer to the accounts doc. 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 | Weight of the master key. This account may also add other keys with which to sign transactions using signer below. |
Low threshold | integer | A number from 0-255 representing the threshold this account sets on all operations it performs that have a low threshold. |
Medium threshold | integer | A number from 0-255 representing the threshold this account sets on all operations it performs that have a medium threshold. |
High threshold | integer | A number from 0-255 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. The signer is deleted if the weight is 0. |
Possible errors:
Error | Code | Description |
---|---|---|
SET_OPTIONS_LOW_RESERVE | -1 | The account setting the options does not have enough XDB. For every new signer added to an account, the minimum reserve of XDB 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_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. For more on trustlines, please refer to the assets documentation.
Threshold: Medium
Result: ChangeTrustResult
Parameters | Type | Description |
---|---|---|
Line | asset | 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 | This operation would drop the limit of this trustline below the amount of the asset the account currently holds. |
CHANGE_TRUST_LOW_RESERVE | -4 | The account does not have enough XDBs. For every new trustline added by the account, the minimum reserve of XDB it must hold increases. |
Allow Trust
Updates the authorized
flag of an existing trustline. This can only be called by the issuer of a trustline’s asset.
The issuer can only clear the authorized
flag if the issuer has the AUTH_REVOCABLE_FLAG
set. Otherwise, the issuer can only set the authorized
flag.
Threshold: Low
Result: AllowTrustResult
Parameters | Type | Description |
---|---|---|
Trustor | account ID | The account of the recipient of the trustline. |
Type | asset | The asset of the trustline the source account is authorizing. For example, if an anchor wants to allow another account to hold its USD credit, the type is USD:anchor. |
Authorize | boolean | Flag indicating whether the trustline is authorized. |
Possible errors:
Error | Code | Description |
---|---|---|
ALLOW_TRUST_MALFORMED | -1 | The asset specified in type is invalid. |
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. |
Account Merge
Transfers the native balance (the amount of XDB an account holds) to another account and removes the source account from the ledger.
Threshold: High
Result: AccountMergeResult
Parameters | Type | Description |
---|---|---|
Destination | account ID | The account that receives the remaining XDB 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 trust lines/offers. |
Manage Data
Allows you to set,modify or delete a Data Entry (name/value pair) that is attached to a particular account. An account can have an arbitrary amount of DataEntries attached to it. Each DataEntry increases the minimum balance needed to be held by the account.
DataEntries can be used for application specific things. They are not used by the core Stellar protocol.
Threshold: Medium
Result: ManageDataResult
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 | Not enough XDBs in the account to create a new Data Entry. Each additional Data Entry increases the minimum balance of the Account. |
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 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 Encyclopedia Entry
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 Encyclopedia Entry
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 Encyclopedia Entry 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 Encyclopedia Entry
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. |
Clawback
Burns an amount in a specific asset from a receiving account
Learn more about clawbacks: Clawback Encyclopedia Entry
SDKs: JavaScript Threshold: Medium
Result: ClawbackResult
Parameters:
Parameters | Type | Description |
---|---|---|
From | account ID | Account address that receives the clawback. |
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
Learn more about clawbacks: Clawback Encyclopedia Entry
Learn more about claimable balances: Claimable Balances Encyclopedia Entry
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.
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 Encyclopedia Entry
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 Encyclopedia Entry
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. |