owners

package
v0.9.8-RC08 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotFound       = errors.New("client not found")
	ErrExternalIDExists     = errors.New("an owner with such external identifier already exists")
	ErrEmptyOwnerID         = errors.New("empty owner id")
	ErrEmptyWalletAddressID = errors.New("empty wallet address id")
	ErrEmptyOTP             = errors.New("empty otp")
	ErrEmptyOTPSecret       = errors.New("empty otp secret")
	ErrEmptyMnemonic        = errors.New("empty mnemonic")
	ErrEmptyPassPhrase      = errors.New("empty pass phrase")
	ErrTwoFactorDisabled    = errors.New("two factor authentication is disabled")
)

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	ClientID   uuid.UUID `json:"client_id" validate:"required,uuid"`
	ExternalID string    `json:"external_id" validate:"required"`
	Mnemonic   string    `json:"mnemonic" validate:"required"`
}

type GetAllPrivateKeysRequest

type GetAllPrivateKeysRequest struct {
	OwnerID uuid.UUID `json:"owner_id"`
	OTP     string    `json:"otp"`
}

func (*GetAllPrivateKeysRequest) Validate

func (o *GetAllPrivateKeysRequest) Validate() error

type GetAllPrivateKeysResponse

type GetAllPrivateKeysResponse map[wconstants.BlockchainType][]PrivateKeysItem

type GetHotWalletKeysRequest

type GetHotWalletKeysRequest struct {
	OwnerID           uuid.UUID `json:"owner_id"`
	WalletAddresses   []string  `json:"wallet_addresses"`
	ExcludedAddresses []string  `json:"excluded_addresses,omitempty"`
	OTP               string    `json:"otp"`
}

func (*GetHotWalletKeysRequest) Validate

func (o *GetHotWalletKeysRequest) Validate() error

type GetHotWalletKeysResponse

type GetHotWalletKeysResponse map[wconstants.BlockchainType][]PrivateKeyItem

type GetSeedsResponse

type GetSeedsResponse struct {
	Mnemonic   string
	PassPhrase string
}

type GetTwoFactorAuthDataResponse

type GetTwoFactorAuthDataResponse struct {
	Secret      *string
	IsConfirmed bool
}

type OTPData added in v0.9.6

type OTPData struct {
	OtpSecret    string `json:"otp_secret"`
	OtpConfirmed bool   `json:"otp_confirmed"`
}

type PrivateKeyItem

type PrivateKeyItem struct {
	Address    string `json:"address"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

type PrivateKeysItem

type PrivateKeysItem struct {
	PublicKey  string
	PrivateKey string
	Address    string
	Kind       constants.WalletType
}

type Service

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

func New

func New(
	conf *config.Config,
	st store.IStore,
	walletsSvc *wallets.Service,
) *Service

func (*Service) ConfirmTwoFactorAuth

func (s *Service) ConfirmTwoFactorAuth(ctx context.Context, ownerID uuid.UUID, otp string) error

ConfirmTwoFactorAuth confirms two-factor authentication for the owner.

func (*Service) Create

func (s *Service) Create(ctx context.Context, params CreateParams) (*models.Owner, error)

Create creates a new owner.

func (*Service) DecryptOTPDataForAllOwners added in v0.9.6

func (s *Service) DecryptOTPDataForAllOwners(ctx context.Context) error

func (*Service) DecryptSeedsForAllOwners

func (s *Service) DecryptSeedsForAllOwners(ctx context.Context) error

func (*Service) DisableTwoFactorAuth

func (s *Service) DisableTwoFactorAuth(ctx context.Context, ownerID uuid.UUID, otpKey string) error

DisableTwoFactorAuth disables two-factor authentication for the owner.

func (*Service) EncryptOTPDataForAllOwners added in v0.9.6

func (s *Service) EncryptOTPDataForAllOwners(ctx context.Context) error

func (*Service) EncryptSeedsForAllOwners

func (s *Service) EncryptSeedsForAllOwners(ctx context.Context) error

func (*Service) GetAll

func (s *Service) GetAll(ctx context.Context) ([]*models.Owner, error)

GetAll returns all owners.

func (*Service) GetAllPrivateKeys

func (s *Service) GetAllPrivateKeys(ctx context.Context, request GetAllPrivateKeysRequest) (*GetAllPrivateKeysResponse, error)

GetAllPrivateKeys returns all private keys for the owner.

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, ownerID uuid.UUID) (*models.Owner, error)

GetByID returns the owner by the ID.

func (*Service) GetHotWalletKeys

func (s *Service) GetHotWalletKeys(ctx context.Context, request *GetHotWalletKeysRequest) (*GetHotWalletKeysResponse, error)

func (*Service) GetSeeds

func (s *Service) GetSeeds(ctx context.Context, ownerID uuid.UUID, otp string) (*GetSeedsResponse, error)

GetSeeds returns the mnemonic and passphrase for the owner.

func (*Service) GetTwoFactorAuthData

func (s *Service) GetTwoFactorAuthData(ctx context.Context, ownerID uuid.UUID) (*GetTwoFactorAuthDataResponse, error)

GetTwoFactorAuthData returns the two-factor authentication data for the owner.

func (*Service) ValidateTwoFactorToken

func (s *Service) ValidateTwoFactorToken(ctx context.Context, ownerID uuid.UUID, token string) error

ValidateTwoFactorToken validates the two-factor token for the owner.

Jump to

Keyboard shortcuts

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