Skip to content

Commit

Permalink
add check_create tx
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp2121 committed Jan 29, 2025
1 parent b231152 commit f7c8c9b
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
9 changes: 9 additions & 0 deletions shared/requests/submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -93,6 +94,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here

description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
Expand Down Expand Up @@ -121,6 +123,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -134,6 +137,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here
description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
required:
Expand Down Expand Up @@ -221,6 +225,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
Expand All @@ -235,6 +240,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here

SubmitSuccessResponseV2:
Expand All @@ -258,6 +264,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
Expand All @@ -272,6 +279,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
# TODO: Add other transaction types here

SubmitErrorResponse:
Expand All @@ -289,6 +297,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawErrorCode'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelErrorCode'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashErrorCode'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateErrorCode'
- enum:
- amendmentBlocked
- highFee
Expand Down
62 changes: 62 additions & 0 deletions shared/transactions/check_create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
components:
schemas:
CheckCreateTransaction:
$id: CheckCreateTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: |
Create a Check object in the ledger, which is a deferred payment that can be cashed by its
intended destination. The sender of this transaction is the sender of the Check.
required:
- Destination
- SendMax
properties:
Destination:
type: string
description: |
The unique address of the account that can cash the Check.
SendMax:
$ref: '../base.yaml#/components/schemas/CurrencyAmount'
description: |
Maximum amount of source currency the Check is allowed to debit the sender, including transfer
fees on non-XRP currencies. The Check can only credit the destination with the same currency
(from the same issuer, for non-XRP currencies). For non-XRP amounts, the nested field names
MUST be lower-case.
DestinationTag:
type: integer
format: uint32
description: |
(Optional) Arbitrary tag that identifies the reason for the Check, or a hosted recipient to pay.
Expiration:
type: integer
format: uint32
description: |
(Optional) Time after which the Check is no longer valid, in seconds since the Ripple Epoch.
InvoiceID:
type: string
format: hash256
description: |
(Optional) Arbitrary 256-bit hash representing a specific reason or identifier for this Check.
CheckCreateErrorCode:
$id: CheckCreateErrorCode
type: string
enum:
- tecNO_PERMISSION
- temREDUNDANT
- tecNO_DST
- tecDST_TAG_NEEDED
- tecFROZEN
- tecEXPIRED
- tecINSUFFICIENT_RESERVE
- tecDIR_FULL
description: Enum representing possible error codes for CheckCreate transactions.
x-enum-descriptions:
tecNO_PERMISSION: If the Destination account is blocking incoming Checks, the transaction fails. (Requires the DisallowIncoming amendment)
temREDUNDANT: If the Destination is the sender of the transaction, the transaction fails.
tecNO_DST: If the Destination account does not exist in the ledger, the transaction fails.
tecDST_TAG_NEEDED: If the Destination account has the RequireDest flag enabled but the transaction does not include a DestinationTag field, the transaction fails.
tecFROZEN: If SendMax specifies a token which is frozen, the transaction fails.
tecEXPIRED: If the Expiration of the transaction is in the past, the transaction fails.
tecINSUFFICIENT_RESERVE: If the sender does not have enough XRP to meet the owner reserve after adding the Check, the transaction fails.
tecDIR_FULL: If either the sender or the destination of the Check cannot own more objects in the ledger, the transaction fails.

0 comments on commit f7c8c9b

Please sign in to comment.