47 lines
1.5 KiB
Go
47 lines
1.5 KiB
Go
package types
|
|
|
|
// QueryInput represents the input for the query function
|
|
type QueryInput struct {
|
|
DID string `json:"did"`
|
|
}
|
|
|
|
// QueryOutput represents the output of the query function
|
|
type QueryOutput struct {
|
|
DID string `json:"did"`
|
|
Controller string `json:"controller"`
|
|
VerificationMethods []VerificationMethod `json:"verification_methods"`
|
|
Accounts []Account `json:"accounts"`
|
|
Credentials []Credential `json:"credentials"`
|
|
}
|
|
|
|
// VerificationMethod represents a DID verification method
|
|
type VerificationMethod struct {
|
|
ID string `json:"id"`
|
|
Type string `json:"type"`
|
|
Controller string `json:"controller"`
|
|
PublicKey string `json:"public_key"`
|
|
Purpose string `json:"purpose"`
|
|
}
|
|
|
|
// Account represents a derived blockchain account
|
|
type Account struct {
|
|
Address string `json:"address"`
|
|
ChainID string `json:"chain_id"`
|
|
CoinType int `json:"coin_type"`
|
|
AccountIndex int `json:"account_index"`
|
|
AddressIndex int `json:"address_index"`
|
|
Label string `json:"label"`
|
|
IsDefault bool `json:"is_default"`
|
|
}
|
|
|
|
// Credential represents a WebAuthn credential
|
|
type Credential struct {
|
|
CredentialID string `json:"credential_id"`
|
|
DeviceName string `json:"device_name"`
|
|
DeviceType string `json:"device_type"`
|
|
Authenticator string `json:"authenticator"`
|
|
Transports []string `json:"transports"`
|
|
CreatedAt string `json:"created_at"`
|
|
LastUsed string `json:"last_used"`
|
|
}
|