Post

List of Operations

For a description of how operations work in XDBChain, see Operations.

Create Account

JavaScript

This operation creates and funds a new account with the specified starting balance.

Threshold: Medium

Result: CreateAccountResult

Parameters:

ParameterTypeDescription
Destinationaccount IDAccount address that is created and funded.
Starting BalanceintegerAmount of XDB to send to the newly created account. This XDB comes from the source account.

Possible errors:

ErrorCodeDescription
CREATE_ACCOUNT_MALFORMED-1The destination is invalid.
CREATE_ACCOUNT_UNDERFUNDED-2The 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-3This operation would create an account with fewer than the minimum number of XDB an account must hold.
CREATE_ACCOUNT_ALREADY_EXIST-4The destination account already exists.

Payment

JavaScript

Sends an amount in a specific asset to a destination account.

Threshold: Medium

Result: PaymentResult

Parameters:

ParametersTypeDescription
Destinationaccount IDAccount address that receives the payment.
AssetassetAsset to send to the destination account.
AmountintegerAmount of the aforementioned asset to send.

Possible errors:

ErrorCodeDescription
PAYMENT_MALFORMED-1The input to the payment is invalid.
PAYMENT_UNDERFUNDED-2The 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-3The source account does not trust the issuer of the asset it is trying to send.
PAYMENT_SRC_NOT_AUTHORIZED-4The source account is not authorized to send this payment.
PAYMENT_NO_DESTINATION-5The receiving account does not exist.
PAYMENT_NO_TRUST-6The receiver does not trust the issuer of the asset being sent. For more information, see the assets doc.
PAYMENT_NOT_AUTHORIZED-7The destination account is not authorized by the asset’s issuer to hold the asset.
PAYMENT_LINE_FULL-8The 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-9The 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:

ParametersTypeDescription
Send assetassetThe asset deducted from the sender’s account.
Send amountintegerThe amount of send asset to deduct (excluding fees).
Destinationaccount IDAccount ID of the recipient.
Destination assetassetThe asset the destination account receives.
Destination minintegerThe minimum amount of destination asset the destination account can receive.
Pathlist of assetsThe 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:

ErrorCodeDescription
PATH_PAYMENT_STRICT_SEND_MALFORMED-1The input to this path payment is invalid.
PATH_PAYMENT_STRICT_SEND_UNDERFUNDED-2The 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-3The source account does not trust the issuer of the asset it is trying to send.
PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED-4The source account is not authorized to send this payment.
PATH_PAYMENT_STRICT_SEND_NO_DESTINATION-5The destination account does not exist.
PATH_PAYMENT_STRICT_SEND_NO_TRUST-6The destination account does not trust the issuer of the asset being sent.
PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED-7The destination account is not authorized by the asset’s issuer to hold the asset.
PATH_PAYMENT_STRICT_SEND_LINE_FULL-8The destination account does not have sufficient limits to receive destination amount and still satisfy its buying liabilities.
PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS-10There 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-11The payment would cross one of its own offers.
PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN-12The 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:

ParametersTypeDescription
Send assetassetThe asset deducted from the sender’s account.
Send maxintegerThe maximum amount of send asset to deduct (excluding fees).
Destinationaccount IDAccount ID of the recipient.
Destination assetassetThe asset the destination account receives.
Destination amountintegerThe amount of destination asset the destination account receives.
Pathlist of assetsThe 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:

ErrorCodeDescription
PATH_PAYMENT_STRICT_RECEIVE_MALFORMED-1The input to this path payment is invalid.
PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED-2The 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-3The source account does not trust the issuer of the asset it is trying to send.
PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED-4The source account is not authorized to send this payment.
PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION-5The destination account does not exist.
PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST-6The destination account does not trust the issuer of the asset being sent.
PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED-7The destination account is not authorized by the asset’s issuer to hold the asset.
PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL-8The destination account does not have sufficient limits to receive destination amount and still satisfy its buying liabilities.
PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS-10There 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-11The payment would cross one of its own offers.
PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX-12The 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:

ParametersTypeDescription
SellingassetAsset the offer creator is selling.
BuyingassetAsset the offer creator is buying.
AmountintegerAmount 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 IDunsigned integerThe ID of the offer. 0 for new offer. Set to existing offer ID to update or delete.

Possible errors:

ErrorCodeDescription
MANAGE_BUY_OFFER_MALFORMED-1The input is incorrect and would result in an invalid offer.
MANAGE_BUY_OFFER_SELL_NO_TRUST-2The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_BUY_OFFER_BUY_NO_TRUST-3The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED-4The account creating the offer is not authorized to sell this asset.
MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED-5The account creating the offer is not authorized to buy this asset.
MANAGE_BUY_OFFER_LINE_FULL-6The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities.
MANAGE_BUY_OFFER_UNDERFUNDED-7The 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-8The 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-11An offer with that offerID cannot be found.
MANAGE_BUY_OFFER_LOW_RESERVE-12The 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:

ParametersTypeDescription
SellingassetAsset the offer creator is selling.
BuyingassetAsset the offer creator is buying.
AmountintegerAmount 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 IDunsigned integerThe ID of the offer. 0 for new offer. Set to existing offer ID to update or delete.

Possible errors:

ErrorCodeDescription
MANAGE_SELL_OFFER_MALFORMED-1The input is incorrect and would result in an invalid offer.
MANAGE_SELL_OFFER_SELL_NO_TRUST-2The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_SELL_OFFER_BUY_NO_TRUST-3The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED-4The account creating the offer is not authorized to sell this asset.
MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED-5The account creating the offer is not authorized to buy this asset.
MANAGE_SELL_OFFER_LINE_FULL-6The account creating the offer does not have sufficient limits to receive buying and still satisfy its buying liabilities.
MANAGE_SELL_OFFER_UNDERFUNDED-7The 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-8The 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-11An offer with that offerID cannot be found.
MANAGE_SELL_OFFER_LOW_RESERVE-12The 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

JavaScript

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

ParametersTypeDescription
SellingassetThe asset you would like to sell.
BuyingassetThe asset you would like to buy.
AmountintegerAmount 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:

ErrorCodeDescription
MANAGE_OFFER_MALFORMED-1The input is incorrect and would result in an invalid offer.
MANAGE_OFFER_SELL_NO_TRUST-2The account creating the offer does not have a trustline for the asset it is selling.
MANAGE_OFFER_BUY_NO_TRUST-3The account creating the offer does not have a trustline for the asset it is buying.
MANAGE_OFFER_SELL_NOT_AUTHORIZED-4The account creating the offer is not authorized to sell this asset.
MANAGE_OFFER_BUY_NOT_AUTHORIZED-5The account creating the offer is not authorized to buy this asset.
MANAGE_OFFER_LINE_FULL-6The 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-7The account does not have enough of selling to fund this offer.
MANAGE_OFFER_CROSS_SELF-8The 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-9The issuer of selling asset does not exist.
MANAGE_OFFER_BUY_NO_ISSUER-10The issuer of buying asset does not exist.
MANAGE_OFFER_NOT_FOUND-11An offer with that offerID cannot be found.
MANAGE_OFFER_LOW_RESERVE-12The 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

JavaScript

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:

ParametersTypeDescription
Clear flagsintegerIndicates 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 flagsintegerIndicates 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 weightintegerWeight of the master key. This account may also add other keys with which to sign transactions using signer below.
Low thresholdintegerA number from 0-255 representing the threshold this account sets on all operations it performs that have a low threshold.
Medium thresholdintegerA number from 0-255 representing the threshold this account sets on all operations it performs that have a medium threshold.
High thresholdintegerA number from 0-255 representing the threshold this account sets on all operations it performs that have a high threshold.
Home domainstringSets 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:

ErrorCodeDescription
SET_OPTIONS_LOW_RESERVE-1The 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-220 is the maximum number of signers an account can have, and adding another signer would exceed that.
SET_OPTIONS_BAD_FLAGS-3The flags set and/or cleared are invalid by themselves or in combination.
SET_OPTIONS_CANT_CHANGE-5This account can no longer change the option it wants to change.
SET_OPTIONS_UNKNOWN_FLAG-6The account is trying to set a flag that is unknown.
SET_OPTIONS_THRESHOLD_OUT_OF_RANGE-7The value for a key weight or threshold is invalid.
SET_OPTIONS_BAD_SIGNER-8Any additional signers added to the account cannot be the master key.
SET_OPTIONS_INVALID_HOME_DOMAIN-9Home domain is malformed.

Change Trust

JavaScript

Creates, updates, or deletes a trustline. For more on trustlines, please refer to the assets documentation.

Threshold: Medium

Result: ChangeTrustResult

ParametersTypeDescription
LineassetThe 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.
LimitintegerThe limit of the trustline. In the previous example, the limit would be 200.

Possible errors:

ErrorCodeDescription
CHANGE_TRUST_MALFORMED-1The input to this operation is invalid.
CHANGE_TRUST_NO_ISSUER-2The issuer of the asset cannot be found.
CHANGE_TRUST_INVALID_LIMIT-3This operation would drop the limit of this trustline below the amount of the asset the account currently holds.
CHANGE_TRUST_LOW_RESERVE-4The 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

JavaScript

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

ParametersTypeDescription
Trustoraccount IDThe account of the recipient of the trustline.
TypeassetThe 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.
AuthorizebooleanFlag indicating whether the trustline is authorized.

Possible errors:

ErrorCodeDescription
ALLOW_TRUST_MALFORMED-1The asset specified in type is invalid.
ALLOW_TRUST_NO_TRUST_LINE-2The trustor does not have a trustline with the issuer performing this operation.
ALLOW_TRUST_TRUST_NOT_REQUIRED-3The 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-4The source account is trying to revoke the trustline of the trustor, but it cannot do so.

Account Merge

JavaScript

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

ParametersTypeDescription
Destinationaccount IDThe account that receives the remaining XDB balance of the source account.

Possible errors:

ErrorCodeDescription
ACCOUNT_MERGE_MALFORMED-1The operation is malformed because the source account cannot merge with itself. The destination must be a different account.
ACCOUNT_MERGE_NO_ACCOUNT-2The destination account does not exist.
ACCOUNT_MERGE_IMMUTABLE_SET-3The source account has AUTH_IMMUTABLE flag set.
ACCOUNT_MERGE_HAS_SUB_ENTRIES-4The source account has trust lines/offers.

Manage Data

JavaScript

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

ParametersTypeDescription
NamestringString 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.
Valuebinary 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:

ErrorCodeDescription
MANAGE_DATA_NOT_SUPPORTED_YET-1The 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-2Trying 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-3Not 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-4Name 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:

ParametersTypeDescription
bumpToSequenceNumberdesired value for the operation’s source account sequence number.

Possible errors:

ErrorCodeDescription
BUMP_SEQUENCE_BAD_SEQ-1The 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:

ParametersTypeDescription
AssetassetAsset that will be held in the ClaimableBalanceEntry in the form asset_code:issuing_address or native (XLM).
AmountintegerAmount of asset stored in the ClaimableBalanceEntry.
Claimantslist of claimantsList of Claimants (account address and ClaimPredicate pair) that can claim this ClaimableBalanceEntry.

Possible errors:

ErrorCodeDescription
CREATE_CLAIMABLE_BALANCE_MALFORMED-1The input to this operation is invalid.
CREATE_CLAIMABLE_BALANCE_LOW_RESERVE-2The 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-3The source account does not trust the issuer of the asset it is trying to include in the ClaimableBalanceEntry.
CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED-4The source account is not authorized to transfer this asset.
CREATE_CLAIMABLE_BALANCE_UNDERFUNDED-5The 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:

ParametersTypeDescription
BalanceIDclaimableBalanceIDBalanceID 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:

ErrorCodeDescription
CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST-1There is no existing ClaimableBalanceEntry that matches the input BalanceID.
CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM-2There is no claimant that matches the source account, or the claimants predicate is not satisfied.
CLAIM_CLAIMABLE_BALANCE_LINE_FULL-3The 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-4The source account does not trust the issuer of the asset it is trying to claim in the ClaimableBalanceEntry.
CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED-5The 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:

ParametersTypeDescription
SponsoredIDaccount IDAccount that will have its reserves sponsored.

Possible errors:

ErrorCodeDescription
BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED-1Source account is equal to sponsoredID.
BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED-2Source account is already sponsoring sponsoredID.
BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE-3Either 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:

ParametersTypeDescription
Fromaccount IDAccount address that receives the clawback.
AssetassetAsset held by the destination account.
AmountintegerAmount of the aforementioned asset to burn.

Possible errors:

ErrorCodeDescription
CLAWBACK_MALFORMED-1The input to the clawback is invalid.
CLAWBACK_NOT_CLAWBACK_ENABLED-2The trustline between From and the issuer account for this Asset does not have clawback enabled.
CLAWBACK_NO_TRUST-3The From account does not trust the issuer of the asset.
CLAWBACK_UNDERFUNDED-4The 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:

ParametersTypeDescription
BalanceIDclaimableBalanceIDThe BalanceID on the ClaimableBalanceEntry that the source account is claiming, which can be retrieved from a succesful CreateClaimableBalanceResult

Possible errors:

ErrorCodeDescription
CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST-1There is no existing ClaimableBalanceEntry that matches the input BalanceID.
CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER-2The source account is not the issuer of the asset in the claimable balance.
CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED-3The 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:

ParametersTypeDescription
Trustoraccount IDThe account that established this trustline.
AssetTrustLineAssetThe asset trustline whose flags are being modified.
SetFlagsintegerOne 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.
ClearFlagsintegerOne 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:

ErrorCodeDescription
SET_TRUST_LINE_FLAGS_MALFORMED-1This 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-2The Trustor does not have a trustline with the issuer performing this operation.
SET_TRUST_LINE_FLAGS_CANT_REVOKE-3The 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-4If 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-5Claimable 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:

ParametersTypeDescription
Liquidity Pool IDliquidityPoolIDThe PoolID for the Liquidity Pool to deposit into.
Max Amount AintegerMaximum amount of first asset to deposit.
Max Amount BintegerMaximum amount of second asset to deposit.
Min Price{numerator, denominator}Minimum depositA/depositB.
Max Price{numerator, denominator}Maximum depositA/depositB.

Possible errors:

ErrorCodeDescription
LIQUIDITY_POOL_DEPOSIT_MALFORMED-1One or more of the inputs to the operation was malformed.
LIQUIDITY_POOL_DEPOSIT_NO_TRUST-2No trustline exists for one of the assets being deposited.
LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED-3The account does not have authorization for one of the assets.
LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED-4There is not enough balance of one of the assets to perform the deposit.
LIQUIDITY_POOL_DEPOSIT_LINE_FULL-5The pool share trustline does not have a sufficient limit.
LIQUIDITY_POOL_DEPOSIT_BAD_PRICE-6The deposit price is outside of the given bounds.
LIQUIDITY_POOL_DEPOSIT_POOL_FULL-7The 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:

ParametersTypeDescription
Liquidity Pool IDliquidityPoolIDThe PoolID for the Liquidity Pool to withdraw from.
AmountintegerAmount of pool shares to withdraw.
Min Amount AintegerMinimum amount of the first asset to withdraw.
Min Amount BintegerMinimum amount of the second asset to withdraw.

Possible errors:

ErrorCodeDescription
LIQUIDITY_POOL_WITHDRAW_MALFORMED-1One or more of the inputs to the operation was malformed.
LIQUIDITY_POOL_WITHDRAW_NO_TRUST-2There is no trustline for one of the assets.
LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED-3Insufficient balance for the pool shares.
LIQUIDITY_POOL_WITHDRAW_LINE_FULL-4The withdrawal would exceed the trustline limit for one of the assets.
LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM-5Unable to withdraw enough to satisfy the minimum price.
This post is licensed under CC BY 4.0 by the author.