Documentation ¶
Index ¶
- type DIDController
- type DIDControllerImpl
- func (d *DIDControllerImpl) Address() string
- func (d *DIDControllerImpl) BeginLogin(aka string) ([]byte, error)
- func (d *DIDControllerImpl) BeginRegistration(aka string) ([]byte, error)
- func (w *DIDControllerImpl) CreateAccount(name string, coinType crypto.CoinType) (*types.VerificationMethod, error)
- func (d *DIDControllerImpl) Document() *types.DidDocument
- func (d *DIDControllerImpl) FinishLogin(aka string, challengResp string) ([]byte, error)
- func (d *DIDControllerImpl) FinishRegistration(aka string, challengResp string) ([]byte, error)
- func (w *DIDControllerImpl) GetAccount(name string) (wallet.Account, error)
- func (w *DIDControllerImpl) GetSonrAccount() (wallet.CosmosAccount, error)
- func (d *DIDControllerImpl) ID() string
- func (w *DIDControllerImpl) ListAccounts() ([]wallet.Account, error)
- func (w *DIDControllerImpl) Sign(data []byte) ([]byte, error)
- func (w *DIDControllerImpl) Verify(data, sig []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DIDController ¶
type DIDController interface { // Address Address() string // DID ID() string // DID Document Document() *types.DidDocument // This method is used to get the challenge response from the DID controller. BeginRegistration(aka string) ([]byte, error) // This is the method that will be called when the user clicks on the "Register" button. FinishRegistration(aka string, challengeResponse string) ([]byte, error) // This method is used to get the options for the assertion. BeginLogin(aka string) ([]byte, error) // This is the method that will be called when the user clicks the "Login" button on the login page. FinishLogin(aka string, challengeResponse string) ([]byte, error) // Creates a new account and returns the address of the account. CreateAccount(name string, coinType crypto.CoinType) (*types.VerificationMethod, error) // Gets an account by name GetAccount(name string) (wallet.Account, error) // Gets Cosmos account GetSonrAccount() (wallet.CosmosAccount, error) // Gets all accounts ListAccounts() ([]wallet.Account, error) // Sign a message with the primary account Sign(message []byte) ([]byte, error) // Verify a message with the primary account Verify(message []byte, signature []byte) (bool, error) }
`DIDController` is a type that is both a `wallet.Wallet` and a `store.WalletStore`. @property GetChallengeResponse - This method is used to get the challenge response from the DID controller. @property RegisterAuthenticationCredential - This is the method that will be called when the user clicks on the "Register" button. @property GetAssertionOptions - This method is used to get the options for the assertion. @property AuthorizeCredential - This is the method that will be called when the user clicks the "Login" button on the login page.
type DIDControllerImpl ¶
type DIDControllerImpl struct {
// contains filtered or unexported fields
}
`DIDControllerImpl` is a type that implements the `DIDController` interface. @property - `wallet.Wallet`: This is the interface that the DID controller implements. @property - `store.WalletStore`: This is the interface that the DID controller implements.
func (*DIDControllerImpl) Address ¶
func (d *DIDControllerImpl) Address() string
Address returns the address of the DID controller.
func (*DIDControllerImpl) BeginLogin ¶ added in v0.3.1
func (d *DIDControllerImpl) BeginLogin(aka string) ([]byte, error)
This method is used to get the options for the assertion.
func (*DIDControllerImpl) BeginRegistration ¶ added in v0.3.1
func (d *DIDControllerImpl) BeginRegistration(aka string) ([]byte, error)
This method is used to get the challenge response from the DID controller.
func (*DIDControllerImpl) CreateAccount ¶
func (w *DIDControllerImpl) CreateAccount(name string, coinType crypto.CoinType) (*types.VerificationMethod, error)
Creating a new account.
func (*DIDControllerImpl) Document ¶
func (d *DIDControllerImpl) Document() *types.DidDocument
Document returns the DID document of the DID controller.
func (*DIDControllerImpl) FinishLogin ¶ added in v0.3.1
func (d *DIDControllerImpl) FinishLogin(aka string, challengResp string) ([]byte, error)
This is the method that will be called when the user clicks the "Login" button on the login page.
func (*DIDControllerImpl) FinishRegistration ¶ added in v0.3.1
func (d *DIDControllerImpl) FinishRegistration(aka string, challengResp string) ([]byte, error)
This is the method that will be called when the user clicks on the "Register" button.
func (*DIDControllerImpl) GetAccount ¶
func (w *DIDControllerImpl) GetAccount(name string) (wallet.Account, error)
Returning the account.WalletAccount and error.
func (*DIDControllerImpl) GetSonrAccount ¶ added in v0.3.1
func (w *DIDControllerImpl) GetSonrAccount() (wallet.CosmosAccount, error)
Get Sonr account
func (*DIDControllerImpl) ID ¶
func (d *DIDControllerImpl) ID() string
ID returns the DID of the DID controller.
func (*DIDControllerImpl) ListAccounts ¶
func (w *DIDControllerImpl) ListAccounts() ([]wallet.Account, error)
ListAccounts returns the list of accounts.