Skip to content

Commit

Permalink
feat: add credential delete tx
Browse files Browse the repository at this point in the history
  • Loading branch information
Patel-Raj committed Feb 18, 2025
1 parent f363094 commit 7a992eb
Show file tree
Hide file tree
Showing 2 changed files with 51 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'
CredentialAccept: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
CredentialCreate: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
CredentialDelete: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -126,6 +127,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
- $ref: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
- $ref: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -187,6 +189,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CredentialAccept: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
CredentialCreate: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
CredentialDelete: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -233,6 +236,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
- $ref: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
- $ref: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -353,6 +357,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CredentialAccept: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
CredentialCreate: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
CredentialDelete: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -400,6 +405,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
- $ref: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
- $ref: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -456,6 +462,7 @@ components:
AMMWithdraw: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
CredentialAccept: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
CredentialCreate: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
CredentialDelete: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
CheckCancel: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
CheckCash: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
CheckCreate: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -503,6 +510,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawTransaction'
- $ref: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptTransaction'
- $ref: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateTransaction'
- $ref: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteTransaction'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelTransaction'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashTransaction'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateTransaction'
Expand Down Expand Up @@ -553,6 +561,7 @@ components:
- $ref: '../transactions/amm_withdraw.yaml#/components/schemas/AMMWithdrawErrorCode'
- $ref: '../transactions/credential_accept.yaml#/components/schemas/CredentialAcceptErrorCode'
- $ref: '../transactions/credential_create.yaml#/components/schemas/CredentialCreateErrorCode'
- $ref: '../transactions/credential_delete.yaml#/components/schemas/CredentialDeleteErrorCode'
- $ref: '../transactions/check_cancel.yaml#/components/schemas/CheckCancelErrorCode'
- $ref: '../transactions/check_cash.yaml#/components/schemas/CheckCashErrorCode'
- $ref: '../transactions/check_create.yaml#/components/schemas/CheckCreateErrorCode'
Expand Down
42 changes: 42 additions & 0 deletions shared/transactions/credential_delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
components:
schemas:
CredentialDeleteTransaction:
$id: CredentialDeleteTransaction
allOf:
- $ref: '../base.yaml#/components/schemas/BaseTransaction'
type: object
description: >
A CredentialDelete transaction removes a credential from the ledger, effectively revoking it.
Users may also want to delete an unwanted credential to reduce their reserve requirement.
required:
- CredentialType
properties:
CredentialType:
type: string
description: Arbitrary data defining the type of credential to delete. The minimum length is 1 byte and the maximum length is 256 bytes.
Subject:
type: string
description: The subject of the credential to delete. If omitted, use the Account (sender of the transaction) as the subject of the credential.
Issuer:
type: string
description: The issuer of the credential to delete. If omitted, use the Account (sender of the transaction) as the issuer of the credential.
x-custom-validation:
requireOneOf:
- fields:
- Subject
- Issuer

CredentialDeleteErrorCode:
$id: CredentialDeleteErrorCode
type: string
description: Error codes for the CredentialDelete transaction.
enum:
- temDISABLED
- temINVALID_ACCOUNT_ID
- tecNO_PERMISSION
- tecNO_ENTRY
x-enum-descriptions:
temDISABLED: The related amendment is not enabled.
temINVALID_ACCOUNT_ID: A provided Subject or Issuer field is invalid. For example, it contains ACCOUNT_ZERO.
tecNO_PERMISSION: The sender is neither the issuer nor subject of the credential, and the credential is not expired.
tecNO_ENTRY: The specified credential does not exist in the ledger.

0 comments on commit 7a992eb

Please sign in to comment.