Skip to content

Commit

Permalink
Added missing information to operations (#11)
Browse files Browse the repository at this point in the history
* Added missing information to operations

Including: LPs, clawbacks, claimable balances

* Update list-of-operations.mdx

Co-authored-by: Tyler van der Hoeven <[email protected]>
  • Loading branch information
briwylde08 and kalepail authored Aug 30, 2022
1 parent 252b843 commit 08aa46c
Showing 1 changed file with 95 additions and 9 deletions.
104 changes: 95 additions & 9 deletions docs/fundamentals-and-concepts/list-of-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ Learn more about passive sell offers: [Liquidity on Stellar: SDEX and Liquidity
**Errors**: https://developers.stellar.org/api/errors/result-codes/operation-specific/create-passive-sell-offer/

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

Learn more about flags: [Flags Encyclopedia Entry](#)
Learn more about the home domain: [Stellar Ecosystem Proposals SEP-0001](#)
Learn more about signers operations: [Signature and Multisignature Encyclopedia Entry](#)
Learn more about key weight: [Secret Key Glossary Entry](#)
Learn more about the home domain: [Stellar Ecosystem Proposals SEP-0001](#https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0001.md)
Learn more about signers operations and key weight: [Signature and Multisignature Encyclopedia Entry](#)

**SDKs**: [JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.setOptions) | [Java](http://stellar.github.io/java-stellar-sdk/org/stellar/sdk/SetOptionsOperation.Builder.html) | [Go](https://godoc.org/github.com/stellar/go/txnbuild#SetOptions)
**Threshold**: High (when updating signers or other thresholds) or Medium (when updating everything else)
Expand Down Expand Up @@ -222,15 +221,15 @@ Learn more about clawbacks: [Clawback Encyclopedia Entry](#)

**SDKs**: [JavaScript](http://stellar.github.io/js-stellar-sdk/Operation.html#.clawback) | [Java](http://stellar.github.io/java-stellar-sdk/org/stellar/sdk/ClawbackOperation.Builder.html) | [Go](https://godoc.org/github.com/stellar/go/txnbuild#Clawback)
**Threshold**: Medium
**Parameters**:
**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.

**Errors**:
**Errors**:

|Error|Code|Description|
|---|---|---|
Expand All @@ -246,17 +245,104 @@ Learn more about clawbacks: [Clawback Encyclopedia Entry](#)

Learn more about claimable balances: [Claimable Balances Encyclopedia Entry](#)

**Threshold**: Medium
**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`|

**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 Encyclopedia Entry](#)

**Threshold**: Low
**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 SetFlagsas well as 4, which prevents the issuer from clawing back its asset (both from accounts and claimable balances).|

**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
**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.|

**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

Learn more about liquidity pools: [Liquidity Pools Encyclopedia Entry](#)
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
**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.|

**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.|

0 comments on commit 08aa46c

Please sign in to comment.