Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add did related tx #23

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions shared/requests/submit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ components:
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
DIDDelete: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
DIDSet: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -101,6 +103,8 @@ components:
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
- $ref: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here

description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
Expand Down Expand Up @@ -133,6 +137,8 @@ components:
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
DIDDelete: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
DIDSet: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
- $ref: '../transactions/oracle_set.yaml#/components/schemas/OracleSetTransaction'
Expand All @@ -150,6 +156,8 @@ components:
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
- $ref: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here
description: 'Transaction definition in JSON format, optionally omitting any auto-fillable fields.'
required:
Expand Down Expand Up @@ -241,6 +249,8 @@ components:
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
DIDDelete: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
DIDSet: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV1'
Expand All @@ -259,6 +269,8 @@ components:
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
- $ref: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here

SubmitSuccessResponseV2:
Expand Down Expand Up @@ -286,6 +298,8 @@ components:
OfferCancel: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
OfferCreate: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
TrustSet: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
DIDDelete: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
DIDSet: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here
oneOf:
- $ref: '../transactions/payment.yaml#/components/schemas/PaymentTransactionV2'
Expand All @@ -304,6 +318,8 @@ components:
- $ref: '../transactions/offer_cancel.yaml#/components/schemas/OfferCancelTransaction'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateTransaction'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetTransaction'
- $ref: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteTransaction'
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetTransaction'
# TODO: Add other transaction types here

SubmitErrorResponse:
Expand All @@ -324,6 +340,8 @@ components:
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateErrorCode'
- $ref: '../transactions/offer_create.yaml#/components/schemas/OfferCreateErrorCode'
- $ref: '../transactions/trust_set.yaml#/components/schemas/TrustSetErrorCode'
- $ref: '../transactions/did_delete.yaml#/components/schemas/DIDDeleteErrorCode'
- $ref: '../transactions/did_set.yaml#/components/schemas/DIDSetErrorCode'
- enum:
- amendmentBlocked
- highFee
Expand Down
17 changes: 17 additions & 0 deletions shared/transactions/did_delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
components:
schemas:
DIDDeleteTransaction:
$id: DIDDeleteTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: |
Delete the DID ledger entry associated with the specified Account field.

DIDDeleteErrorCode:
$id: DIDDeleteErrorCode
type: string
enum:
- tecNO_ENTRY
x-enum-descriptions:
tecNO_ENTRY: The account doesn't have a DID.
40 changes: 40 additions & 0 deletions shared/transactions/did_set.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
components:
schemas:
DIDSetTransaction:
$id: DIDSetTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: |
Creates a new DID ledger entry or updates the fields of an existing one.

To delete the Data, DIDDocument, or URI field from an existing DID ledger entry, add the field as an empty string.
properties:
Data:
type: string
description: |
(Optional) The public attestations of identity credentials associated with the DID.
DIDDocument:
type: string
description: |
(Optional) The DID document associated with the DID.
URI:
type: string
description: |
(Optional) The Universal Resource Identifier associated with the DID.
x-custom-validation:
requireOneOf:
- fields:
- Data
- DIDDocument
- URI
DIDSetErrorCode:
$id: DIDSetErrorCode
type: string
enum:
- tecEMPTY_DID
- temEMPTY_DID
description: Enum representing possible error codes for DIDSet transactions.
x-enum-descriptions:
tecEMPTY_DID: The transaction will create an empty DID ledger entry. Check that your updates don't remove the Data, DIDDocument, and URI fields.
temEMPTY_DID: The transaction is malformed and missing any DID information. Include either the Data, DIDDocument, or URI fields.