Skip to content

Commit

Permalink
add ticket_create
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp2121 committed Jan 31, 2025
1 parent 36d3e5b commit ef67869
Show file tree
Hide file tree
Showing 2 changed files with 41 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 @@ -91,6 +91,7 @@ components:
EscrowFinish: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
Clawback: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
DepositPreauth: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
TicketCreate: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -115,6 +116,7 @@ components:
- $ref: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
- $ref: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
- $ref: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
- $ref: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here

description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
Expand Down Expand Up @@ -154,6 +156,7 @@ components:
EscrowFinish: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
Clawback: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
DepositPreauth: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
TicketCreate: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -178,6 +181,7 @@ components:
- $ref: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
- $ref: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
- $ref: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
- $ref: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here
description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
required:
Expand Down Expand Up @@ -276,6 +280,7 @@ components:
EscrowFinish: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
Clawback: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
DepositPreauth: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
TicketCreate: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
Expand All @@ -301,6 +306,7 @@ components:
- $ref: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
- $ref: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
- $ref: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
- $ref: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here

SubmitSuccessResponseV2:
Expand Down Expand Up @@ -335,6 +341,7 @@ components:
EscrowFinish: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
Clawback: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
DepositPreauth: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
TicketCreate: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
Expand All @@ -360,6 +367,7 @@ components:
- $ref: '../transactions/escrow_finish.yaml#/components/schemas/EscrowFinishTransaction'
- $ref: '../transactions/clawback.yaml#/components/schemas/ClawbackTransaction'
- $ref: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthTransaction'
- $ref: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateTransaction'
# TODO: Add other transaction types here

SubmitErrorResponse:
Expand All @@ -384,6 +392,7 @@ components:
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetErrorCode'
- $ref: '../transactions/clawback.yaml#/components/schemas/ClawbackErrorCode'
- $ref: '../transactions/deposit_preauth.yaml#/components/schemas/DepositPreauthErrorCode'
- $ref: '../transactions/ticket_create.yaml#/components/schemas/TicketCreateErrorCode'
- enum:
- amendmentBlocked
- highFee
Expand Down
32 changes: 32 additions & 0 deletions shared/transactions/ticket_create.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
components:
schemas:
TicketCreateTransaction:
$id: TicketCreateTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: |
A TicketCreate transaction sets aside one or more sequence numbers as Tickets.
required:
- TicketCount
properties:
TicketCount:
type: integer
format: uint32
description: |
How many Tickets to create. This must be a positive number and cannot cause the account to own
more than 250 Tickets after executing this transaction.
minimum: 1
maximum: 250
TicketCreateErrorCode:
$id: TicketCreateErrorCode
type: string
enum:
- temINVALID_COUNT
- tecDIR_FULL
- tecINSUFFICIENT_RESERVE
description: Enum representing possible error codes for TicketCreate transactions.
x-enum-descriptions:
temINVALID_COUNT: The TicketCount field is invalid. It must be an integer from 1 to 250.
tecDIR_FULL: This transaction would cause the account to own more than the limit of 250 Tickets at a time, or more than the maximum number of ledger objects in general.
tecINSUFFICIENT_RESERVE: The sending account does not have enough XRP to meet the owner reserve of all the requested Tickets.

0 comments on commit ef67869

Please sign in to comment.