handler

package
v0.7.5-beta.6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccount

func CreateAccount(c *gin.Context)

CreateAccount creates a new account with a given coin type and name.

@Summary Create an account @Description Creates a new account with a given coin type and name. @Accept json @Produce json @Param coinType path string true "Coin Type Name" @Success 200 {object} map[string]interface{} "Account Info" @Router /createAccount/{coinType} [post]

func CurrentUser

func CurrentUser(c *gin.Context)

CurrentUser returns the current user's details.

@Summary Current user's details @Description Returns the current user's details. @Accept json @Produce json @Success 200 {object} map[string]string "JWT Token" @Failure 400 {object} map[string]string "Missing JWT" @Failure 401 {object} map[string]string "No JWT cookie found" @Router /currentUser [get]

func ExportWallet

func ExportWallet(c *gin.Context)

ExportWallet returns the encoded Sonr Wallet structure with an encrypted keyshare, which can be opened with the user's password, within Sonr Clients.

@Summary Export Wallet @Description Returns the encoded Sonr Wallet structure with an encrypted keyshare. @Accept json @Produce json @Success 200 {object} map[string]interface{} "Wallet Export Info" @Router /exportWallet [get]

func GetAccount

func GetAccount(c *gin.Context)

GetAccount returns an account's details given its DID.

@Summary Get an account's details @Description Returns an account's details given its DID. @Accept json @Produce json @Param did path string true "DID of Account" @Success 200 {object} map[string]interface{} "Account Info" @Router /getAccount/{did} [get]

func GetBlockHeight

func GetBlockHeight(c *gin.Context)

GetBlockHeight returns the current block height.

@Summary Current block height @Description Returns the current block height. @Accept json @Produce json @Success 200 {object} map[string]int "Block Height" @Router /getBlockHeight [get]

func GetCredentialAssertionParams

func GetCredentialAssertionParams(c *gin.Context)

GetCredentialAssertionParams returns the credential assertion options to start account login.

@Summary Get credential assertion parameters @Description Returns the credential assertion options to start account login. @Accept json @Produce json @Param origin path string true "Origin" @Param alias path string true "Alias" @Success 200 {object} map[string]interface{} "Success response" @Failure 500 {object} map[string]string "Error message" @Router /getCredentialAssertionParams/{origin}/{alias} [get]

func GetCredentialAttestationParams

func GetCredentialAttestationParams(c *gin.Context)

GetCredentialAttestationParams returns the credential creation options to start account registration.

@Summary Get credential attestation parameters @Description Returns the credential creation options to start account registration. @Accept json @Produce json @Param origin path string true "Origin" @Param alias path string true "Alias" @Success 200 {object} map[string]interface{} "Success response" @Failure 500 {object} map[string]string "Error message" @Router /getCredentialAttestationParams/{origin}/{alias} [get]

func GetEmailAssertionParams

func GetEmailAssertionParams(c *gin.Context)

GetEmailAssertionParams returns a JWT for the email controller. After it is confirmed, the user will claim one of their unclaimed Keyshares.

@Summary Get email assertion parameters @Description Returns a JWT for the email controller. After it is confirmed, the user will claim one of their unclaimed Keyshares. @Accept json @Produce json @Param email query string true "Email" @Success 200 {object} map[string]interface{} "Success response" @Failure 500 {object} map[string]string "Error message" @Router /getEmailAssertionParams [get]

func GetHealth

func GetHealth(c *gin.Context)

GetHealth returns the health of the service.

@Summary Health of the service @Description Returns the health of the service. @Accept json @Produce json @Success 200 {object} map[string]string "Status message" @Router /getHealth [get]

func GetValidatorSet

func GetValidatorSet(c *gin.Context)

GetValidatorSet returns the current validator set.

@Summary Current validator set @Description Returns the current validator set. @Accept json @Produce json @Success 200 {object} map[string][]string "Validators" @Router /getValidatorSet [get]

func ListAccounts

func ListAccounts(c *gin.Context)

ListAccounts returns a list of wallet accounts given a coin type.

@Summary List wallet accounts @Description Returns a list of wallet accounts given a coin type. @Accept json @Produce json @Success 200 {object} map[string]interface{} "Accounts List" @Router /listAccounts [get]

func RegisterControllerIdentity

func RegisterControllerIdentity(c *gin.Context)

RegisterControllerIdentity registers a credential for a given Unclaimed Wallet.

@Summary Register controller identity @Description Registers a credential for a given Unclaimed Wallet. @Accept json @Produce json @Param origin path string true "Origin" @Param alias path string true "Alias" @Param attestation query string true "Attestation" @Param challenge query string true "Challenge" @Success 200 {object} map[string]interface{} "Success response" @Failure 404 {object} map[string]string "Error message" @Failure 412 {object} map[string]string "Error message" @Failure 400 {object} map[string]string "Error message" @Failure 401 {object} map[string]string "Error message" @Router /registerControllerIdentity/{origin}/{alias} [post]

func RegisterEscrowIdentity

func RegisterEscrowIdentity(c *gin.Context)

RegisterEscrowIdentity returns the credential assertion options to start account login.

@Summary Register escrow identity @Description Returns the credential assertion options to start account login. @Accept json @Produce json @Param amount query string true "Amount" @Param email query string true "Email" @Success 200 {object} map[string]interface{} "Success response" @Failure 500 {object} map[string]string "Error message" @Router /registerEscrowIdentity [get]

func SignInWithCredential

func SignInWithCredential(c *gin.Context)

SignInWithCredential verifies a credential for a given account and returns the JWT Keyshare.

@Summary Sign in with credential @Description Verifies a credential for a given account and returns the JWT Keyshare. @Accept json @Produce json @Param origin path string true "Origin" @Param alias path string true "Alias" @Param assertion query string true "Assertion" @Success 200 {object} map[string]interface{} "Success response" @Failure 441 {object} map[string]string "Error message" @Failure 442 {object} map[string]string "Error message" @Failure 443 {object} map[string]string "Error message" @Failure 444 {object} map[string]string "Error message" @Failure 445 {object} map[string]string "Error message" @Router /signInWithCredential/{origin}/{alias} [post]

func SignInWithEmail

func SignInWithEmail(c *gin.Context)

SignInWithEmail registers a DIDDocument for a given email authorized jwt.

@Summary Sign in with email @Description Registers a DIDDocument for a given email authorized jwt. @Accept json @Produce json @Param jwt query string true "JWT" @Success 200 {object} map[string]interface{} "Success response" @Failure 500 {object} map[string]string "Error message" @Router /signInWithEmail [post]

func SignWithAccount

func SignWithAccount(c *gin.Context)

SignWithAccount signs a message with an account given its DID. Requires the JWT of their Keyshare.

@Summary Sign a message with an account @Description Signs a message with an account given its DID. Requires the JWT of their Keyshare. @Accept json @Produce json @Param did path string true "DID of Account" @Param msg query string true "Message to Sign" @Success 200 {object} map[string]interface{} "Signature Info" @Router /signWithAccount/{did} [post]

func VerifyWithAccount

func VerifyWithAccount(c *gin.Context)

VerifyWithAccount verifies a signature with an account.

@Summary Verify a signature with an account @Description Verifies a signature with an account. @Accept json @Produce json @Param did path string true "DID of Account" @Param msg query string true "Message" @Param sig query string true "Signature" @Success 200 {object} map[string]interface{} "Verification Result" @Router /verifyWithAccount/{did} [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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