walletunlocker

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InitWalletReply_Status_name = map[int32]string{
		0: "PROCESSING",
		1: "DONE",
	}
	InitWalletReply_Status_value = map[string]int32{
		"PROCESSING": 0,
		"DONE":       1,
	}
)

Enum value maps for InitWalletReply_Status.

View Source
var File_walletunlocker_proto protoreflect.FileDescriptor
View Source
var WalletUnlocker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "WalletUnlocker",
	HandlerType: (*WalletUnlockerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GenSeed",
			Handler:    _WalletUnlocker_GenSeed_Handler,
		},
		{
			MethodName: "UnlockWallet",
			Handler:    _WalletUnlocker_UnlockWallet_Handler,
		},
		{
			MethodName: "ChangePassword",
			Handler:    _WalletUnlocker_ChangePassword_Handler,
		},
		{
			MethodName: "IsReady",
			Handler:    _WalletUnlocker_IsReady_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "InitWallet",
			Handler:       _WalletUnlocker_InitWallet_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "walletunlocker.proto",
}

WalletUnlocker_ServiceDesc is the grpc.ServiceDesc for WalletUnlocker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterWalletUnlockerServer

func RegisterWalletUnlockerServer(s grpc.ServiceRegistrar, srv WalletUnlockerServer)

Types

type ChangePasswordReply

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

func (*ChangePasswordReply) Descriptor deprecated

func (*ChangePasswordReply) Descriptor() ([]byte, []int)

Deprecated: Use ChangePasswordReply.ProtoReflect.Descriptor instead.

func (*ChangePasswordReply) ProtoMessage

func (*ChangePasswordReply) ProtoMessage()

func (*ChangePasswordReply) ProtoReflect

func (x *ChangePasswordReply) ProtoReflect() protoreflect.Message

func (*ChangePasswordReply) Reset

func (x *ChangePasswordReply) Reset()

func (*ChangePasswordReply) String

func (x *ChangePasswordReply) String() string

type ChangePasswordRequest

type ChangePasswordRequest struct {

	//
	//current_password should be the current valid passphrase used to unlock the
	//daemon.
	CurrentPassword []byte `protobuf:"bytes,1,opt,name=current_password,json=currentPassword,proto3" json:"current_password,omitempty"`
	//
	//new_password should be the new passphrase that will be needed to unlock the
	//daemon.
	NewPassword []byte `protobuf:"bytes,2,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"`
	// contains filtered or unexported fields
}

func (*ChangePasswordRequest) Descriptor deprecated

func (*ChangePasswordRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead.

func (*ChangePasswordRequest) GetCurrentPassword

func (x *ChangePasswordRequest) GetCurrentPassword() []byte

func (*ChangePasswordRequest) GetNewPassword

func (x *ChangePasswordRequest) GetNewPassword() []byte

func (*ChangePasswordRequest) ProtoMessage

func (*ChangePasswordRequest) ProtoMessage()

func (*ChangePasswordRequest) ProtoReflect

func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message

func (*ChangePasswordRequest) Reset

func (x *ChangePasswordRequest) Reset()

func (*ChangePasswordRequest) String

func (x *ChangePasswordRequest) String() string

type GenSeedReply

type GenSeedReply struct {
	SeedMnemonic []string `protobuf:"bytes,1,rep,name=seed_mnemonic,json=seedMnemonic,proto3" json:"seed_mnemonic,omitempty"`
	// contains filtered or unexported fields
}

func (*GenSeedReply) Descriptor deprecated

func (*GenSeedReply) Descriptor() ([]byte, []int)

Deprecated: Use GenSeedReply.ProtoReflect.Descriptor instead.

func (*GenSeedReply) GetSeedMnemonic

func (x *GenSeedReply) GetSeedMnemonic() []string

func (*GenSeedReply) ProtoMessage

func (*GenSeedReply) ProtoMessage()

func (*GenSeedReply) ProtoReflect

func (x *GenSeedReply) ProtoReflect() protoreflect.Message

func (*GenSeedReply) Reset

func (x *GenSeedReply) Reset()

func (*GenSeedReply) String

func (x *GenSeedReply) String() string

type GenSeedRequest

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

func (*GenSeedRequest) Descriptor deprecated

func (*GenSeedRequest) Descriptor() ([]byte, []int)

Deprecated: Use GenSeedRequest.ProtoReflect.Descriptor instead.

func (*GenSeedRequest) ProtoMessage

func (*GenSeedRequest) ProtoMessage()

func (*GenSeedRequest) ProtoReflect

func (x *GenSeedRequest) ProtoReflect() protoreflect.Message

func (*GenSeedRequest) Reset

func (x *GenSeedRequest) Reset()

func (*GenSeedRequest) String

func (x *GenSeedRequest) String() string

type InitWalletReply

type InitWalletReply struct {
	Account int32                  `protobuf:"varint,1,opt,name=account,proto3" json:"account,omitempty"`
	Status  InitWalletReply_Status `protobuf:"varint,2,opt,name=status,proto3,enum=InitWalletReply_Status" json:"status,omitempty"`
	Data    string                 `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*InitWalletReply) Descriptor deprecated

func (*InitWalletReply) Descriptor() ([]byte, []int)

Deprecated: Use InitWalletReply.ProtoReflect.Descriptor instead.

func (*InitWalletReply) GetAccount

func (x *InitWalletReply) GetAccount() int32

func (*InitWalletReply) GetData

func (x *InitWalletReply) GetData() string

func (*InitWalletReply) GetStatus

func (x *InitWalletReply) GetStatus() InitWalletReply_Status

func (*InitWalletReply) ProtoMessage

func (*InitWalletReply) ProtoMessage()

func (*InitWalletReply) ProtoReflect

func (x *InitWalletReply) ProtoReflect() protoreflect.Message

func (*InitWalletReply) Reset

func (x *InitWalletReply) Reset()

func (*InitWalletReply) String

func (x *InitWalletReply) String() string

type InitWalletReply_Status

type InitWalletReply_Status int32
const (
	InitWalletReply_PROCESSING InitWalletReply_Status = 0
	InitWalletReply_DONE       InitWalletReply_Status = 1
)

func (InitWalletReply_Status) Descriptor

func (InitWalletReply_Status) Enum

func (InitWalletReply_Status) EnumDescriptor deprecated

func (InitWalletReply_Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use InitWalletReply_Status.Descriptor instead.

func (InitWalletReply_Status) Number

func (InitWalletReply_Status) String

func (x InitWalletReply_Status) String() string

func (InitWalletReply_Status) Type

type InitWalletRequest

type InitWalletRequest struct {

	//
	//wallet_password is the passphrase that should be used to encrypt the
	//wallet. This MUST be at least 8 chars in length. After creation, this
	//password is required to unlock the daemon.
	WalletPassword []byte `protobuf:"bytes,1,opt,name=wallet_password,json=walletPassword,proto3" json:"wallet_password,omitempty"`
	//
	//seed_mnemonic is a 24-word mnemonic that encodes a prior seed obtained by the
	//user. This MUST be a generated by the GenSeed method
	SeedMnemonic []string `protobuf:"bytes,2,rep,name=seed_mnemonic,json=seedMnemonic,proto3" json:"seed_mnemonic,omitempty"`
	//
	//the flag to let the daemon restore existing funds for the wallet.
	Restore bool `protobuf:"varint,3,opt,name=restore,proto3" json:"restore,omitempty"`
	// contains filtered or unexported fields
}

func (*InitWalletRequest) Descriptor deprecated

func (*InitWalletRequest) Descriptor() ([]byte, []int)

Deprecated: Use InitWalletRequest.ProtoReflect.Descriptor instead.

func (*InitWalletRequest) GetRestore

func (x *InitWalletRequest) GetRestore() bool

func (*InitWalletRequest) GetSeedMnemonic

func (x *InitWalletRequest) GetSeedMnemonic() []string

func (*InitWalletRequest) GetWalletPassword

func (x *InitWalletRequest) GetWalletPassword() []byte

func (*InitWalletRequest) ProtoMessage

func (*InitWalletRequest) ProtoMessage()

func (*InitWalletRequest) ProtoReflect

func (x *InitWalletRequest) ProtoReflect() protoreflect.Message

func (*InitWalletRequest) Reset

func (x *InitWalletRequest) Reset()

func (*InitWalletRequest) String

func (x *InitWalletRequest) String() string

type IsReadyReply

type IsReadyReply struct {
	Initialized bool `protobuf:"varint,1,opt,name=initialized,proto3" json:"initialized,omitempty"`
	Unlocked    bool `protobuf:"varint,2,opt,name=unlocked,proto3" json:"unlocked,omitempty"`
	Synced      bool `protobuf:"varint,3,opt,name=synced,proto3" json:"synced,omitempty"`
	// contains filtered or unexported fields
}

func (*IsReadyReply) Descriptor deprecated

func (*IsReadyReply) Descriptor() ([]byte, []int)

Deprecated: Use IsReadyReply.ProtoReflect.Descriptor instead.

func (*IsReadyReply) GetInitialized

func (x *IsReadyReply) GetInitialized() bool

func (*IsReadyReply) GetSynced

func (x *IsReadyReply) GetSynced() bool

func (*IsReadyReply) GetUnlocked

func (x *IsReadyReply) GetUnlocked() bool

func (*IsReadyReply) ProtoMessage

func (*IsReadyReply) ProtoMessage()

func (*IsReadyReply) ProtoReflect

func (x *IsReadyReply) ProtoReflect() protoreflect.Message

func (*IsReadyReply) Reset

func (x *IsReadyReply) Reset()

func (*IsReadyReply) String

func (x *IsReadyReply) String() string

type IsReadyRequest

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

func (*IsReadyRequest) Descriptor deprecated

func (*IsReadyRequest) Descriptor() ([]byte, []int)

Deprecated: Use IsReadyRequest.ProtoReflect.Descriptor instead.

func (*IsReadyRequest) ProtoMessage

func (*IsReadyRequest) ProtoMessage()

func (*IsReadyRequest) ProtoReflect

func (x *IsReadyRequest) ProtoReflect() protoreflect.Message

func (*IsReadyRequest) Reset

func (x *IsReadyRequest) Reset()

func (*IsReadyRequest) String

func (x *IsReadyRequest) String() string

type UnimplementedWalletUnlockerServer

type UnimplementedWalletUnlockerServer struct {
}

UnimplementedWalletUnlockerServer must be embedded to have forward compatible implementations.

func (UnimplementedWalletUnlockerServer) ChangePassword

func (UnimplementedWalletUnlockerServer) GenSeed

func (UnimplementedWalletUnlockerServer) InitWallet

func (UnimplementedWalletUnlockerServer) IsReady

func (UnimplementedWalletUnlockerServer) UnlockWallet

type UnlockWalletReply

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

func (*UnlockWalletReply) Descriptor deprecated

func (*UnlockWalletReply) Descriptor() ([]byte, []int)

Deprecated: Use UnlockWalletReply.ProtoReflect.Descriptor instead.

func (*UnlockWalletReply) ProtoMessage

func (*UnlockWalletReply) ProtoMessage()

func (*UnlockWalletReply) ProtoReflect

func (x *UnlockWalletReply) ProtoReflect() protoreflect.Message

func (*UnlockWalletReply) Reset

func (x *UnlockWalletReply) Reset()

func (*UnlockWalletReply) String

func (x *UnlockWalletReply) String() string

type UnlockWalletRequest

type UnlockWalletRequest struct {

	//
	//wallet_password should be the current valid passphrase for the daemon. This
	//will be required to decrypt on-disk material that the daemon requires to
	//function properly.
	WalletPassword []byte `protobuf:"bytes,1,opt,name=wallet_password,json=walletPassword,proto3" json:"wallet_password,omitempty"`
	// contains filtered or unexported fields
}

func (*UnlockWalletRequest) Descriptor deprecated

func (*UnlockWalletRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnlockWalletRequest.ProtoReflect.Descriptor instead.

func (*UnlockWalletRequest) GetWalletPassword

func (x *UnlockWalletRequest) GetWalletPassword() []byte

func (*UnlockWalletRequest) ProtoMessage

func (*UnlockWalletRequest) ProtoMessage()

func (*UnlockWalletRequest) ProtoReflect

func (x *UnlockWalletRequest) ProtoReflect() protoreflect.Message

func (*UnlockWalletRequest) Reset

func (x *UnlockWalletRequest) Reset()

func (*UnlockWalletRequest) String

func (x *UnlockWalletRequest) String() string

type UnsafeWalletUnlockerServer

type UnsafeWalletUnlockerServer interface {
	// contains filtered or unexported methods
}

UnsafeWalletUnlockerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WalletUnlockerServer will result in compilation errors.

type WalletUnlockerClient

type WalletUnlockerClient interface {
	//
	//GenSeed is the first method that should be used to instantiate a new tdexd
	//instance. This method allows a caller to generate a new HD Wallet.
	//Once the seed is obtained and verified by the user, the InitWallet
	//method should be used to commit the newly generated seed, and create the
	//wallet.
	GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedReply, error)
	//
	//InitWallet is used when tdexd is starting up for the first time to fully
	//initialize the daemon and its internal wallet.
	//The wallet in the tdexd context is a database file on the disk that can be
	//found in the configured data directory.
	//At the very least a mnemonic and a wallet password must be provided to this
	//RPC. The latter will be used to encrypt sensitive material on disk.
	//Once initialized the wallet is locked and since the password is never stored
	//on the disk, it's required to pass it into the Unlock RPC request to be able
	//to manage the daemon for operations like depositing funds or opening a market.
	InitWallet(ctx context.Context, in *InitWalletRequest, opts ...grpc.CallOption) (WalletUnlocker_InitWalletClient, error)
	//
	//UnlockWallet is used at startup of tdexd to provide a password to unlock
	//the wallet database. Once unlocked, the only way to lock the wallet again is
	//shutting it down.
	UnlockWallet(ctx context.Context, in *UnlockWalletRequest, opts ...grpc.CallOption) (*UnlockWalletReply, error)
	//
	//ChangePassword changes the password of the encrypted wallet. This RPC
	//requires the internal wallet to be locked. It doesn't change the wallet state
	//in any case, therefore, like after calling InitWallet, it is required to
	//unlock the walket with UnlockWallet RPC after this operation succeeds.
	ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordReply, error)
	//
	//IsReady is useful for external applications interacting with tdexd to know
	//whether its ready, meaning that also the wallet, operator trade services
	//are able to serve requests.
	//Restarting tdexd or initiliazing it by restoring an existing wallet can be
	//time-expensive operations causing tdexd to not be ready until they haven't
	//finished.
	IsReady(ctx context.Context, in *IsReadyRequest, opts ...grpc.CallOption) (*IsReadyReply, error)
}

WalletUnlockerClient is the client API for WalletUnlocker service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type WalletUnlockerServer

type WalletUnlockerServer interface {
	//
	//GenSeed is the first method that should be used to instantiate a new tdexd
	//instance. This method allows a caller to generate a new HD Wallet.
	//Once the seed is obtained and verified by the user, the InitWallet
	//method should be used to commit the newly generated seed, and create the
	//wallet.
	GenSeed(context.Context, *GenSeedRequest) (*GenSeedReply, error)
	//
	//InitWallet is used when tdexd is starting up for the first time to fully
	//initialize the daemon and its internal wallet.
	//The wallet in the tdexd context is a database file on the disk that can be
	//found in the configured data directory.
	//At the very least a mnemonic and a wallet password must be provided to this
	//RPC. The latter will be used to encrypt sensitive material on disk.
	//Once initialized the wallet is locked and since the password is never stored
	//on the disk, it's required to pass it into the Unlock RPC request to be able
	//to manage the daemon for operations like depositing funds or opening a market.
	InitWallet(*InitWalletRequest, WalletUnlocker_InitWalletServer) error
	//
	//UnlockWallet is used at startup of tdexd to provide a password to unlock
	//the wallet database. Once unlocked, the only way to lock the wallet again is
	//shutting it down.
	UnlockWallet(context.Context, *UnlockWalletRequest) (*UnlockWalletReply, error)
	//
	//ChangePassword changes the password of the encrypted wallet. This RPC
	//requires the internal wallet to be locked. It doesn't change the wallet state
	//in any case, therefore, like after calling InitWallet, it is required to
	//unlock the walket with UnlockWallet RPC after this operation succeeds.
	ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordReply, error)
	//
	//IsReady is useful for external applications interacting with tdexd to know
	//whether its ready, meaning that also the wallet, operator trade services
	//are able to serve requests.
	//Restarting tdexd or initiliazing it by restoring an existing wallet can be
	//time-expensive operations causing tdexd to not be ready until they haven't
	//finished.
	IsReady(context.Context, *IsReadyRequest) (*IsReadyReply, error)
	// contains filtered or unexported methods
}

WalletUnlockerServer is the server API for WalletUnlocker service. All implementations must embed UnimplementedWalletUnlockerServer for forward compatibility

type WalletUnlocker_InitWalletClient

type WalletUnlocker_InitWalletClient interface {
	Recv() (*InitWalletReply, error)
	grpc.ClientStream
}

type WalletUnlocker_InitWalletServer

type WalletUnlocker_InitWalletServer interface {
	Send(*InitWalletReply) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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