client

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REGISTRATION_SESSION_KEY   = "registration_session"
	AUTHENTICATION_SESSION_KEY = "authentication_session"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cosmos

type Cosmos struct {
	cosmosclient.Client
	// contains filtered or unexported fields
}

func NewCosmos

func NewCosmos(ctx context.Context, config *config.Config) (*Cosmos, error)

NewCosmos creates a Sonr Blockchain client with the given account and provides helper functions

func (*Cosmos) AccountName

func (cc *Cosmos) AccountName() string

AccountName returns the account name as string

func (*Cosmos) Address added in v0.20.2

func (cc *Cosmos) Address() string

Address returns the account name as string

func (*Cosmos) BroadcastCreateBucket added in v0.23.0

func (cc *Cosmos) BroadcastCreateBucket(msg *bt.MsgCreateBucket) (*bt.MsgCreateBucketResponse, error)

------- Buckets ------- BroadcastCreateBucket broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastCreateChannel added in v0.23.0

func (cc *Cosmos) BroadcastCreateChannel(msg *ct.MsgCreateChannel) (*ct.MsgCreateChannelResponse, error)

------- Channels ------- BroadcastDeactivateChannel broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastCreateObject added in v0.23.0

func (cc *Cosmos) BroadcastCreateObject(msg *ot.MsgCreateObject) (*ot.MsgCreateObjectResponse, error)

------- Objects ------- BroadcastCreateObject broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastDeactivateBucket added in v0.23.0

func (cc *Cosmos) BroadcastDeactivateBucket(msg *bt.MsgDeactivateBucket) (*bt.MsgDeactivateBucketResponse, error)

BroadcastDeactivateBucket broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastDeactivateChannel added in v0.23.0

func (cc *Cosmos) BroadcastDeactivateChannel(msg *ct.MsgDeactivateChannel) (*ct.MsgDeactivateChannelResponse, error)

BroadcastUpdateChannel broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastDeactivateObject added in v0.23.0

func (cc *Cosmos) BroadcastDeactivateObject(msg *ot.MsgDeactivateObject) (*ot.MsgDeactivateObjectResponse, error)

BroadcastUpdateChannel broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastRegisterApplication added in v0.23.0

func (cc *Cosmos) BroadcastRegisterApplication(msg *rt.MsgRegisterApplication) (*rt.MsgRegisterApplicationResponse, error)

------- Registry ------- BroadcastRegisterApplication broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastRegisterName

func (cc *Cosmos) BroadcastRegisterName(msg *rt.MsgRegisterName) (*rt.MsgRegisterNameResponse, error)

BroadcastRegisterName broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateApplication added in v0.23.0

func (cc *Cosmos) BroadcastUpdateApplication(msg *rt.MsgUpdateApplication) (*rt.MsgUpdateApplicationResponse, error)

BroadcastUpdateApplication broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateBucket added in v0.23.0

func (cc *Cosmos) BroadcastUpdateBucket(msg *bt.MsgUpdateBucket) (*bt.MsgUpdateBucketResponse, error)

BroadcastUpdateBucket broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateChannel added in v0.23.0

func (cc *Cosmos) BroadcastUpdateChannel(msg *ct.MsgUpdateChannel) (*ct.MsgUpdateChannelResponse, error)

BroadcastUpdateChannel broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateName added in v0.23.0

func (cc *Cosmos) BroadcastUpdateName(msg *rt.MsgUpdateName) (*rt.MsgUpdateNameResponse, error)

BroadcastUpdateName broadcasts a transaction to the blockchain

func (*Cosmos) BroadcastUpdateObject added in v0.23.0

func (cc *Cosmos) BroadcastUpdateObject(msg *ot.MsgUpdateObject) (*ot.MsgUpdateObjectResponse, error)

BroadcastUpdateObject broadcasts a transaction to the blockchain

func (*Cosmos) NameExists added in v0.23.0

func (cc *Cosmos) NameExists(name string) bool

NameExists checks if a name exists on the blockchain

func (*Cosmos) QueryAllBuckets added in v0.23.0

func (cc *Cosmos) QueryAllBuckets() ([]bt.WhichIs, error)

QueryAllBuckets returns all names registered on the blockchain

func (*Cosmos) QueryAllChannels added in v0.23.0

func (cc *Cosmos) QueryAllChannels() ([]ct.HowIs, error)

QueryAllChannels returns all names registered on the blockchain

func (*Cosmos) QueryAllNames

func (cc *Cosmos) QueryAllNames() ([]rt.WhoIs, error)

QueryAllNames returns all DIDDocuments registered on the blockchain

func (*Cosmos) QueryAllObjects added in v0.23.0

func (cc *Cosmos) QueryAllObjects() ([]ot.WhatIs, error)

QueryAllObjects returns all names registered on the blockchain

func (*Cosmos) QueryBucket added in v0.23.0

func (cc *Cosmos) QueryBucket(name string) (*bt.WhichIs, error)

QueryBucket returns all names registered on the blockchain

func (*Cosmos) QueryChannel added in v0.23.0

func (cc *Cosmos) QueryChannel(name string) (*ct.HowIs, error)

QueryChannel returns all names registered on the blockchain

func (*Cosmos) QueryName

func (cc *Cosmos) QueryName(name string) (*rt.WhoIs, error)

QueryName returns a DIDDocument for the given name registered on the blockchain

func (*Cosmos) QueryObject added in v0.23.0

func (cc *Cosmos) QueryObject(did string) (*ot.WhatIs, error)

QueryObject returns all names registered on the blockchain

type WebAuthn added in v0.23.0

type WebAuthn struct {
	// contains filtered or unexported fields
}

WebAuthn manages the WebAuthn interface

func NewWebauthn added in v0.23.0

func NewWebauthn(ctx context.Context, config *config.Config) (*WebAuthn, error)

NewWebauthn creates a new WebAuthn instance with the given configuration

func (*WebAuthn) FinishAuthenticationSession added in v0.23.0

func (w *WebAuthn) FinishAuthenticationSession(r *http.Request, username string) (*webauthn.Credential, error)

FinishAuthenticationSession returns the registration session for the given user

func (*WebAuthn) FinishRegistrationSession added in v0.23.0

func (w *WebAuthn) FinishRegistrationSession(r *http.Request, username string) (*webauthn.Credential, error)

FinishRegistrationSession returns the registration session for the given user

func (*WebAuthn) SaveAuthenticationSession added in v0.23.0

func (wan *WebAuthn) SaveAuthenticationSession(r *http.Request, w http.ResponseWriter, whoIs *rtv1.WhoIs) (*protocol.CredentialAssertion, error)

SaveAuthenticationSession saves the login session for the given user

func (*WebAuthn) SaveRegistrationSession added in v0.23.0

func (wan *WebAuthn) SaveRegistrationSession(r *http.Request, w http.ResponseWriter, username string, creator string) (*protocol.CredentialCreation, error)

SaveRegistrationSession saves the registration session for the given user

Jump to

Keyboard shortcuts

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