model

package
v0.0.0-...-88a98bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainAccountCredential

func ChainAccountCredential(chainID, address, did, name string) *verifiable.Credential

ChainAccountCredential creates a verifiable credential for a blockchain account

func NewLicenseCredential

func NewLicenseCredential(issuerDID, subjectDID string, cr LicenseCredentialRequest) vcTypes.VerifiableCredential

func NewPaymentReceiptCredential

func NewPaymentReceiptCredential(issuerDID, txHash string, pr PaymentRequest) *verifiable.Credential

NewPaymentReceiptCredential compose a payment receipt credential

func NewPoKYCCredential

func NewPoKYCCredential(issuerDID, subjectDID string, cr EMoneyApplicationRequest) vcTypes.VerifiableCredential

func NewRegistrationCredential

func NewRegistrationCredential(issuerDID, subjectDID string, cr RegistrationCredentialRequest) vcTypes.VerifiableCredential

func NewRegulatorCredential

func NewRegulatorCredential(issuerDID, subjectDID string, cr RegulatorCredentialRequest) vcTypes.VerifiableCredential

Types

type AriesPubKey

type AriesPubKey interface {
	PubKeyBytes() []byte
	KeyID() string
	VerificationMaterialType() didTypes.VerificationMaterialType
	DIDRelationships() []string
}

type CallableEnvelope

type CallableEnvelope struct {
	DataIn   interface{}
	Callback func(message string)
}

CallableEnvelope this is used to send messages that should be sent back to the sender

func NewCallableEnvelope

func NewCallableEnvelope(payload interface{}, closure func(message string)) CallableEnvelope

type Contact

type Contact struct {
	*didexchange.Connection
	Channel string        `json:"channel"`
	Texts   []TextMessage `json:"texts"`
}

Contact represent SSI contact

func NewContact

func NewContact(connection *didexchange.Connection) Contact

type Credentials

type Credentials []verifiable.Credential

Credentials sorts verifiable credentials by issued date.

func (Credentials) Len

func (c Credentials) Len() int

func (Credentials) Less

func (c Credentials) Less(i, j int) bool

func (Credentials) Swap

func (c Credentials) Swap(i, j int)

type ED25519

type ED25519 struct {
	*wallet.KeyPair
}

func (ED25519) DIDRelationships

func (x ED25519) DIDRelationships() []string

func (ED25519) KeyID

func (x ED25519) KeyID() string

func (ED25519) PubKeyBytes

func (x ED25519) PubKeyBytes() []byte

func (ED25519) VerificationMaterialType

func (x ED25519) VerificationMaterialType() didTypes.VerificationMaterialType

type EMoneyApplicationRequest

type EMoneyApplicationRequest struct {
	// Credential name of the credential that should be received as a reply for this request
	Credential string `json:"expected_credential"`
	Name       string `json:"-" cash_label:"Name" cash_hint:"name of the applicant"`
	Surname    string `json:"-" cash_label:"Surname" cash_hint:"surname of the applicant"`
	Age        string `json:"-" cash_label:"Age" cash_hint:"age of the applicant"`
	ZKP        string `json:"zkp" cash_label:"ZKP" cash_hint:"autogenerated proof of the user identity (PoKYC)" cash_ro:"true"`
	SubjectDID string `json:"subject_did" cash_label:"Subject DID" cash_hint:"the cosmos DID to issue the credential to"`
	IsVerified bool   `json:"is_verified"`
}

EMoneyApplicationRequest to create a proof of KYC

func NewEMoneyApplicationRequest

func NewEMoneyApplicationRequest(subjectDID string) EMoneyApplicationRequest

func (EMoneyApplicationRequest) ExpectedCredential

func (r EMoneyApplicationRequest) ExpectedCredential() string

type LicenseCredentialRequest

type LicenseCredentialRequest struct {
	// Credential name of the credential that should be received as a reply for this request
	Credential  string `json:"expected_credential"`
	Country     string `json:"country" cash_label:"Country" cash_hint:"the regulator country of authority"`
	LicenseType string `json:"name" cash_label:"Regulator name" cash_hint:"name of the regulator authority"`
	Denom       string `json:"denom" cash_label:"Token denomination" cash_hint:"symbol of the token to issue"`
	MaxSupply   int64  `json:"max_supply" cash_label:"Max supply" cash_hint:"max supply for the token"`
	Authority   string `json:"authority" cash_label:"Regulator name" cash_hint:"name of the regulator authority"`
}

LicenseCredentialRequest to provide a license for an emti

func NewLicenseCredentialRequest

func NewLicenseCredentialRequest(licenseType, country string) LicenseCredentialRequest

func (LicenseCredentialRequest) ExpectedCredential

func (r LicenseCredentialRequest) ExpectedCredential() string

type PaymentRequest

type PaymentRequest struct {
	// Credential name of the credential that should be received as a reply for this request
	Credential string  `json:"expected_credential"`
	Recipient  string  `json:"recipient" cash_label:"Recipient Address" cash_hint:"address to send the payment to"`
	Amount     float64 `json:"amount" cash_label:"Amount" cash_hint:"amount to be transferred"`
	Denom      string  `json:"denom" cash_label:"Token Denomination" cash_hint:"the token symbol"`
	Note       string  `json:"note" cash_label:"Payment Note" cash_hint:"note for the payment request"`
}

func NewPaymentRequest

func NewPaymentRequest(denom, note string) PaymentRequest

func (PaymentRequest) ExpectedCredential

func (r PaymentRequest) ExpectedCredential() string

type PresentationRequest

type PresentationRequest interface {
	ExpectedCredential() string
}

PresentationRequest represent a verifiable credential schema

func ParsePresentationRequest

func ParsePresentationRequest(data string) (v PresentationRequest, isPresentation bool)

ParsePresentationRequest try to parse a string to a presentation

type RegistrationCredentialRequest

type RegistrationCredentialRequest struct {
	// Credential name of the credential that should be received as a reply for this request
	Credential string `json:"expected_credential"`
	Country    string `json:"country" cash_label:"Country" cash_hint:"the country of operation for the e-money token provider"`
	Name       string `json:"name" cash_label:"Organization name" cash_hint:"name of the e-money token provider organization"`
	ShortName  string `json:"short_name" cash_label:"Organization short name" cash_hint:"short name of the e-money token provider organization"`
	SubjectDID string `json:"subject_did" cash_label:"Subject DID" cash_hint:"the cosmos DID to issue the credential to" cash_ro:"true"`
}

RegistrationCredentialRequest to register an emti organization

func NewRegistrationCredentialRequest

func NewRegistrationCredentialRequest(subjectDID string) RegistrationCredentialRequest

func (RegistrationCredentialRequest) ExpectedCredential

func (r RegistrationCredentialRequest) ExpectedCredential() string

type RegulatorCredentialRequest

type RegulatorCredentialRequest struct {
	// Credential name of the credential that should be received as a reply for this request
	Credential string `json:"expected_credential"`
	SubjectDID string `json:"subject_did" cash_label:"Subject DID" cash_hint:"the subject that should be a regulator"`
	Country    string `json:"country" cash_label:"Country" cash_hint:"the regulator country of authority"`
	Name       string `json:"name" cash_label:"Regulator name" cash_hint:"name of the regulator authority"`
}

RegulatorCredentialRequest to activate a regulator

func NewRegulatorCredentialRequest

func NewRegulatorCredentialRequest(subjectDID string) RegulatorCredentialRequest

func (RegulatorCredentialRequest) ExpectedCredential

func (r RegulatorCredentialRequest) ExpectedCredential() string

type TextMessage

type TextMessage struct {
	// Channel is used to identify which chat the message belongs to
	Channel     string    `json:"-"`
	From        string    `json:"fr"`
	Content     string    `json:"cn"`
	ProcessedAt time.Time `json:"at"`
}

TextMessage a text message exchanged between a contact and the user

func NewTextMessage

func NewTextMessage(channel, from, content string) TextMessage

func NewTextMessageWithTime

func NewTextMessageWithTime(channel, from, content string, processedAt time.Time) TextMessage

func (TextMessage) String

func (tm TextMessage) String() string

type X25519

type X25519 struct {
	*wallet.KeyPair
}

func (X25519) DIDRelationships

func (x X25519) DIDRelationships() []string

func (X25519) KeyID

func (x X25519) KeyID() string

func (X25519) PubKeyBytes

func (x X25519) PubKeyBytes() []byte

func (X25519) VerificationMaterialType

func (x X25519) VerificationMaterialType() didTypes.VerificationMaterialType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL