-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
components: | ||
schemas: | ||
CheckCashTransaction: | ||
$id: CheckCashTransaction | ||
allOf: | ||
- $ref: '../base.yaml#/components/schemas/BaseTransaction' | ||
type: object | ||
description: | | ||
Attempts to redeem a Check object in the ledger to receive up to the amount authorized by the | ||
corresponding CheckCreate transaction. Only the Destination address of a Check can cash it with a | ||
CheckCash transaction. Cashing a check this way is similar to executing a Payment initiated by the | ||
destination. | ||
Since the funds for a check are not guaranteed, redeeming a Check can fail because the sender does | ||
not have a high enough balance or because there is not enough liquidity to deliver the funds. If | ||
this happens, the Check remains in the ledger and the destination can try to cash it again later, | ||
or for a different amount. | ||
required: | ||
- CheckID | ||
properties: | ||
CheckID: | ||
type: string | ||
format: hash256 | ||
description: | | ||
The ID of the Check ledger object to cash, as a 64-character hexadecimal string. | ||
Amount: | ||
$ref: '../base.yaml#/components/schemas/CurrencyAmount' | ||
description: | | ||
(Optional) Redeem the Check for exactly this amount, if possible. The currency must match that | ||
of the SendMax of the corresponding CheckCreate transaction. You must provide either this field | ||
or DeliverMin. | ||
DeliverMin: | ||
$ref: '../base.yaml#/components/schemas/CurrencyAmount' | ||
description: | | ||
(Optional) Redeem the Check for at least this amount and for as much as possible. The currency | ||
must match that of the SendMax of the corresponding CheckCreate transaction. You must provide | ||
either this field or Amount. | ||
x-custom-validation: | ||
mutualExclusion: | ||
- field1: Amount | ||
field2: DeliverMin | ||
CheckCashErrorCode: | ||
$id: CheckCashErrorCode | ||
type: string | ||
enum: | ||
- tecNO_PERMISSION | ||
- tecNO_ENTRY | ||
- tecEXPIRED | ||
- tecDST_TAG_NEEDED | ||
- temMALFORMED | ||
- temBAD_CURRENCY | ||
description: Enum representing possible error codes for CheckCash transactions. | ||
x-enum-descriptions: | ||
tecNO_PERMISSION: If the sender of the CheckCash transaction is not the Destination of the check, the transaction fails. | ||
tecNO_ENTRY: If the Check identified by the CheckID field does not exist, the transaction fails. | ||
tecEXPIRED: If the Check identified by the CheckID field has already expired, the transaction fails. | ||
tecDST_TAG_NEEDED: If the destination of the Check has the RequireDest flag enabled but the Check, as created, does not have a destination tag, the transaction fails. | ||
temMALFORMED: If the transaction specifies both Amount and DeliverMin, or omits both, the transaction fails. | ||
temBAD_CURRENCY: If the Amount or DeliverMin does not match the currency (and issuer, if not XRP) of the Check, the transaction fails. |