grpc

package
v0.0.24-wip-4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodCloseWalletSession = "CloseWalletSession"
)
View Source
const (
	MethodGetAccount = "GetAccount"
)
View Source
const (
	MethodGetEnabledWallets = "GetEnabledWallets"
)
View Source
const (
	MethodGetMultipleAccounts = "GetMultipleAccounts"
)
View Source
const (
	MethodGetWalletInfo = "GetWalletInfo"
)
View Source
const (
	MethodGetWalletSession = "GetWalletSession"
)
View Source
const (
	MethodGetWalletSessions = "GetWalletSessions"
)
View Source
const (
	MethodNameAddNewWallet = "AddNewWallet"
)
View Source
const (
	MethodNameDisableWallet = "DisableWallet"
)
View Source
const (
	MethodNameDisableWallets = "DisableWallets"
)
View Source
const (
	MethodNameEnableWallet = "EnableWallet"
)
View Source
const (
	MethodNameEnableWallets = "EnableWallets"
)
View Source
const (
	MethodNameImportWallet = "ImportWallet"
)
View Source
const (
	MethodNameTag = "method_name"
)
View Source
const (
	MethodSignPrepare = "PrepareSign"
)
View Source
const (
	MethodSignTransaction = "SignTransaction"
)
View Source
const (
	MethodStartWalletSession = "StartWalletSession"
)

Variables

View Source
var (
	ErrMissedRequiredData              = errors.New("missed required data")
	ErrDataIsNotValid                  = errors.New("received data is not valid")
	ErrUnableReadGrpcMetadata          = errors.New("unable to read grpc metadata")
	ErrUnableGetWalletUUIDFromMetadata = errors.New("unable to get wallet uuid from metadata")
)

Functions

func New

func New(loggerSrv *zap.Logger,
	walletManagerSvc walletManagerService,
	signManagerSvc signManagerService,
) pbApi.HdWalletControllerApiServer

New instance of service

Types

type AddNewWalletHandler

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

func MakeAddNewWalletHandler

func MakeAddNewWalletHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	marshallerSrv marshallerService,
) *AddNewWalletHandler

func (*AddNewWalletHandler) Handle

nolint:funlen // fixme

type CloseWalletSessionForm

type CloseWalletSessionForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID

	SessionUUID    string `valid:"type(string),uuid,required"`
	SessionUUIDRaw uuid.UUID
}

func (*CloseWalletSessionForm) LoadAndValidate

func (f *CloseWalletSessionForm) LoadAndValidate(ctx context.Context,
	req *pbApi.CloseWalletSessionsRequest,
) (valid bool, err error)

type CloseWalletSessionHandler

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

func MakeCloseWalletSessionHandler

func MakeCloseWalletSessionHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	signManagerSvc signManagerService,
) *CloseWalletSessionHandler

func (*CloseWalletSessionHandler) Handle

nolint:funlen // fixme

type DisableWalletForm

type DisableWalletForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID
}

func (*DisableWalletForm) LoadAndValidate

func (f *DisableWalletForm) LoadAndValidate(ctx context.Context,
	req *pbApi.DisableWalletRequest,
) (valid bool, err error)

type DisableWalletHandler

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

func MakeDisableWalletHandler

func MakeDisableWalletHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	signManagerSvc signManagerService,
) *DisableWalletHandler

func (*DisableWalletHandler) Handle

nolint:funlen // fixme

type DisableWalletsHandler

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

func MakeDisableWalletsHandler

func MakeDisableWalletsHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	signManagerSvc signManagerService,
) *DisableWalletsHandler

func (*DisableWalletsHandler) Handle

nolint:funlen // fixme

type EnableWalletForm

type EnableWalletForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID
}

func (*EnableWalletForm) LoadAndValidate

func (f *EnableWalletForm) LoadAndValidate(ctx context.Context,
	req *pbApi.EnableWalletRequest,
) (valid bool, err error)

type EnableWalletHandler

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

func MakeEnableWalletHandler

func MakeEnableWalletHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
) *EnableWalletHandler

func (*EnableWalletHandler) Handle

nolint:funlen // fixme

type EnableWalletsHandler

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

func MakeEnableWalletsHandler

func MakeEnableWalletsHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
) *EnableWalletsHandler

func (*EnableWalletsHandler) Handle

nolint:funlen // fixme

type GetAccountForm added in v0.0.25

type GetAccountForm struct {
	MnemonicWalletUUID    string `valid:"type(string),uuid,required"`
	MnemonicWalletUUIDRaw uuid.UUID

	SessionUUID string `valid:"type(string),uuid,required"`

	AccountParameters *anypb.Any `valid:"required"`
}

func (*GetAccountForm) LoadAndValidate added in v0.0.25

func (f *GetAccountForm) LoadAndValidate(ctx context.Context,
	req *pbApi.GetAccountRequest,
) (valid bool, err error)

type GetAccountHandler added in v0.0.25

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

func MakeGetAccountHandler added in v0.0.25

func MakeGetAccountHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	marshallerSrv marshallerService,
	pbAddrPool *sync.Pool,
) *GetAccountHandler

func (*GetAccountHandler) Handle added in v0.0.25

nolint:funlen // fixme

type GetEnabledWalletsHandler

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

func MakeGetEnabledWalletsHandler

func MakeGetEnabledWalletsHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	marshallerSrv marshallerService,
) *GetEnabledWalletsHandler

func (*GetEnabledWalletsHandler) Handle

nolint:funlen // fixme

type GetMultipleAccountsHandler added in v0.0.25

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

func MakeGetMultipleAccountsHandler added in v0.0.25

func MakeGetMultipleAccountsHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	marshallerSvc marshallerService,
) *GetMultipleAccountsHandler

func (*GetMultipleAccountsHandler) Handle added in v0.0.25

nolint:funlen // fixme

type GetWalletInfoForm

type GetWalletInfoForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID
}

func (*GetWalletInfoForm) LoadAndValidate

func (f *GetWalletInfoForm) LoadAndValidate(ctx context.Context,
	req *pbApi.GetWalletInfoRequest,
) (valid bool, err error)

type GetWalletInfoHandler

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

func MakeGetWalletInfoHandler

func MakeGetWalletInfoHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
) *GetWalletInfoHandler

func (*GetWalletInfoHandler) Handle

type GetWalletSessionForm

type GetWalletSessionForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID

	SessionUUID    string `valid:"type(string),uuid,required"`
	SessionUUIDRaw uuid.UUID
}

func (*GetWalletSessionForm) LoadAndValidate

func (f *GetWalletSessionForm) LoadAndValidate(ctx context.Context,
	req *pbApi.GetWalletSessionRequest,
) (valid bool, err error)

type GetWalletSessionHandler

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

func MakeGetWalletSessionHandler

func MakeGetWalletSessionHandler(loggerEntry *zap.Logger,
	walletSrv walletManagerService,
) *GetWalletSessionHandler

func (*GetWalletSessionHandler) Handle

nolint:funlen // fixme

type GetWalletSessionsForm

type GetWalletSessionsForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID
}

func (*GetWalletSessionsForm) LoadAndValidate

func (f *GetWalletSessionsForm) LoadAndValidate(ctx context.Context,
	req *pbApi.GetWalletSessionsRequest,
) (valid bool, err error)

type GetWalletSessionsHandler

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

func MakeGetWalletSessionsHandler

func MakeGetWalletSessionsHandler(loggerEntry *zap.Logger,
	walletSrv walletManagerService,
	marshallerSrv marshallerService,
) *GetWalletSessionsHandler

func (*GetWalletSessionsHandler) Handle

nolint:funlen // fixme

type ImportWalletForm

type ImportWalletForm struct {
	Phrase []byte `valid:"required"`
}

func (*ImportWalletForm) LoadAndValidate

func (f *ImportWalletForm) LoadAndValidate(ctx context.Context,
	req *pbApi.ImportWalletRequest,
) (valid bool, err error)

type ImportWalletHandler

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

func MakeImportWalletHandler

func MakeImportWalletHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
) *ImportWalletHandler

func (*ImportWalletHandler) Handle

nolint:funlen // fixme

type Server

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

func NewServer

func NewServer(ctx context.Context,
	loggerSrv *zap.Logger,
	cfg configService,
	handlers pbApi.HdWalletControllerApiServer,
) (*Server, error)

nolint:revive // fixme

func (*Server) Init

func (s *Server) Init(_ context.Context) error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(ctx context.Context) (err error)

type SignPrepareHandler

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

func MakeSignPrepareHandler

func MakeSignPrepareHandler(loggerEntry *zap.Logger,
	walletSrv walletManagerService,
	signManagerSvc signManagerService,
	marshallerSrv marshallerService,
) *SignPrepareHandler

func (*SignPrepareHandler) Handle

nolint:funlen // fixme

type SignRequestExecForm

type SignRequestExecForm struct {
	WalletUUID      string `valid:"type(string),uuid,required"`
	SessionUUID     string `valid:"type(string),uuid,required"`
	SignRequestUUID string `valid:"type(string),uuid,required"`

	AccountParameters *anypb.Any `valid:"required"`

	SignData []byte `valid:"required"`
}

func (*SignRequestExecForm) LoadAndValidate

func (f *SignRequestExecForm) LoadAndValidate(ctx context.Context,
	req *pbApi.ExecuteSignRequestReq,
) (valid bool, err error)

type SignRequestPrepareForm

type SignRequestPrepareForm struct {
	WalletUUID  string `valid:"type(string),uuid,required"`
	SessionUUID string `valid:"type(string),uuid,required"`
	PurposeUUID string `valid:"type(string),uuid,required"`

	AccountParameters *anypb.Any `valid:"required"`
}

func (*SignRequestPrepareForm) LoadAndValidate

func (f *SignRequestPrepareForm) LoadAndValidate(ctx context.Context,
	req *pbApi.PrepareSignRequestReq,
) (valid bool, err error)

type SignTransactionHandler

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

func MakeSignTransactionsHandler

func MakeSignTransactionsHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
	signManagerSvc signManagerService,
	marshallerSrv marshallerService,
) *SignTransactionHandler

func (*SignTransactionHandler) Handle

nolint:funlen // fixme

type StartWalletSessionForm

type StartWalletSessionForm struct {
	WalletUUID    string `valid:"type(string),uuid,required"`
	WalletUUIDRaw uuid.UUID
}

func (*StartWalletSessionForm) LoadAndValidate

func (f *StartWalletSessionForm) LoadAndValidate(ctx context.Context,
	req *pbApi.StartWalletSessionRequest,
) (valid bool, err error)

type StartWalletSessionHandler

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

func MakeStartWalletSessionHandler

func MakeStartWalletSessionHandler(loggerEntry *zap.Logger,
	walletSvc walletManagerService,
) *StartWalletSessionHandler

func (*StartWalletSessionHandler) Handle

nolint:funlen // fixme

type WalletsIdentitiesForm

type WalletsIdentitiesForm struct {
	WalletUUIDs []string `valid:"type([]string),required"`
}

func (*WalletsIdentitiesForm) LoadAndValidate

func (f *WalletsIdentitiesForm) LoadAndValidate(
	list []*pbCommon.MnemonicWalletIdentity,
) (valid bool, err error)

Jump to

Keyboard shortcuts

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