Skip to content

Commit

Permalink
add trustset tx
Browse files Browse the repository at this point in the history
  • Loading branch information
pdp2121 committed Jan 29, 2025
1 parent 7e0d16e commit 8003b43
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
9 changes: 9 additions & 0 deletions shared/requests/submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ components:
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -99,6 +100,7 @@ components:
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here

description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
Expand Down Expand Up @@ -130,6 +132,7 @@ components:
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -146,6 +149,7 @@ components:
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here
description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
required:
Expand Down Expand Up @@ -236,6 +240,7 @@ components:
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
Expand All @@ -253,6 +258,7 @@ components:
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here

SubmitSuccessResponseV2:
Expand All @@ -279,6 +285,7 @@ components:
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
Expand All @@ -296,6 +303,7 @@ components:
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
# TODO: Add other transaction types here

SubmitErrorResponse:
Expand All @@ -315,6 +323,7 @@ components:
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashErrorCode'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateErrorCode'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateErrorCode'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetErrorCode'
- enum:
- amendmentBlocked
- highFee
Expand Down
4 changes: 2 additions & 2 deletions shared/transactions/offer_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ components:
description: |
(Optional) An Offer to delete first, specified in the same way as OfferCancel.
TakerGets:
type: object
$ref: '../base.yaml#/components/schemas/CurrencyAmount'
description: |
The amount and type of currency being sold.
TakerPays:
type: object
$ref: '../base.yaml#/components/schemas/CurrencyAmount'
description: |
The amount and type of currency being bought.
OfferCreateFlag:
Expand Down
52 changes: 52 additions & 0 deletions shared/transactions/trust_set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
components:
schemas:
TrustSetTransaction:
$id: TrustSetTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: |
Create or modify a trust line linking two accounts.
required:
- LimitAmount
properties:
LimitAmount:
$ref: '../base.yaml#/components/schemas/CurrencyAmount'
description: |
Object defining the trust line to create or modify, in the format of a Currency Amount.
QualityIn:
type: integer
format: uint32
description: |
(Optional) Value incoming balances on this trust line at the ratio of this number per
1,000,000,000 units. A value of 0 is shorthand for treating balances at face value.
QualityOut:
type: integer
format: uint32
description: |
(Optional) Value outgoing balances on this trust line at the ratio of this number per
1,000,000,000 units. A value of 0 is shorthand for treating balances at face value.
TrustSetFlag:
$id: TrustSetFlag
type: string
enum:
- tfSetfAuth: 0x00010000
- tfSetNoRipple: 0x00020000
- tfClearNoRipple: 0x00040000
- tfSetFreeze: 0x00100000
- tfClearFreeze: 0x00200000
description: Enum representing flags for TrustSet transactions.
x-enum-descriptions:
tfSetfAuth: Authorize the other party to hold currency issued by this account. (No effect unless using the asfRequireAuth AccountSet flag.) Cannot be unset.
tfSetNoRipple: Enable the No Ripple flag, which blocks rippling between two trust lines of the same currency if this flag is enabled on both.
tfClearNoRipple: Disable the No Ripple flag, allowing rippling on this trust line.
tfSetFreeze: Freeze the trust line.
tfClearFreeze: Unfreeze the trust line.
TrustSetErrorCode:
$id: TrustSetErrorCode
type: string
enum:
- tecNO_PERMISSION
description: Enum representing possible error codes for TrustSet transactions.
x-enum-descriptions:
tecNO_PERMISSION: If the account specified in LimitAmount.issuer is blocking incoming trust lines, the transaction fails.

0 comments on commit 8003b43

Please sign in to comment.