Skip to content

Commit

Permalink
add onchain-offer message (#42)
Browse files Browse the repository at this point in the history
* add onchain-offer message
  • Loading branch information
ilya-korotya authored Feb 26, 2024
1 parent 2e71583 commit 31c19ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions protocol/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const (

// CredentialRefreshMessageType is type for message with a credential refresh
CredentialRefreshMessageType iden3comm.ProtocolMessage = iden3comm.Iden3Protocol + "credentials/1.0/refresh"

// CredentialOnchainOfferMessageType is type for message with a credential onchain offer
CredentialOnchainOfferMessageType iden3comm.ProtocolMessage = iden3comm.Iden3Protocol + "credentials/1.0/onchain-offer"
)

// CredentialIssuanceRequestMessage represent Iden3message for credential request
Expand Down Expand Up @@ -152,3 +155,22 @@ type CredentialRefreshMessageBody struct {
ID string `json:"id"`
Reason string `json:"reason"`
}

// CredentialsOnchainOfferMessage represent Iden3message for credential onchain offer
type CredentialsOnchainOfferMessage struct {
ID string `json:"id"`
Typ iden3comm.MediaType `json:"typ,omitempty"`
Type iden3comm.ProtocolMessage `json:"type"`
ThreadID string `json:"thid,omitempty"`

Body CredentialsOnchainOfferMessageBody `json:"body,omitempty"`

From string `json:"from,omitempty"`
To string `json:"to,omitempty"`
}

// CredentialsOnchainOfferMessageBody is struct the represents onchain offer message
type CredentialsOnchainOfferMessageBody struct {
Credentials []CredentialOffer `json:"credentials"`
TransactionData TransactionData `json:"transaction_data"`
}

0 comments on commit 31c19ad

Please sign in to comment.