diff --git a/shared/requests/submit.yaml b/shared/requests/submit.yaml index 0d54616..7129e5e 100644 --- a/shared/requests/submit.yaml +++ b/shared/requests/submit.yaml @@ -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' @@ -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.' @@ -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' @@ -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: @@ -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' @@ -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: @@ -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' @@ -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: @@ -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 diff --git a/shared/transactions/did_delete.yaml b/shared/transactions/did_delete.yaml new file mode 100644 index 0000000..d326d85 --- /dev/null +++ b/shared/transactions/did_delete.yaml @@ -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. diff --git a/shared/transactions/did_set.yaml b/shared/transactions/did_set.yaml new file mode 100644 index 0000000..aedc13a --- /dev/null +++ b/shared/transactions/did_set.yaml @@ -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.