(no commit message provided)

This commit is contained in:
Prad Nukala
2024-07-05 22:20:13 -04:00
committed by Prad Nukala (aider)
commit 5fd43dfd6b
457 changed files with 115535 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
package did
import (
"fmt"
"github.com/onsonr/hway/internal/orm"
)
// Format.Credential formats a credential as a DID
func (f formatter) Credential(c *orm.Credential) string {
return fmt.Sprintf("did:web:%s@%s#%s", c.DisplayName, c.Origin, c.ID)
}
// Format.Wallet formats a wallet as a DID
func (f formatter) Wallet(w *orm.Wallet) string {
return fmt.Sprintf("did:sonr:%s", w.Address)
}
// Format is the formatter to use for DIDs
var Format = formatter{}
type formatter struct{}
+1
View File
@@ -0,0 +1 @@
package did
+9
View File
@@ -0,0 +1,9 @@
package did
// VerificationMethod is an object that represents a verification method.
type VerificationMethod struct {
PublicKeyJwk map[string]interface{} `json:"publicKeyJwk"`
ID string `json:"id"`
Type string `json:"type"`
Controller string `json:"controller"`
}