lbcwallet/rpc/walletrpc/api.pb.go
Josh Rickmar 497ffc11f0 Modernize the RPC server.
This is a rather monolithic commit that moves the old RPC server to
its own package (rpc/legacyrpc), introduces a new RPC server using
gRPC (rpc/rpcserver), and provides the ability to defer wallet loading
until request at a later time by an RPC (--noinitialload).

The legacy RPC server remains the default for now while the new gRPC
server is not enabled by default.  Enabling the new server requires
setting a listen address (--experimenalrpclisten).  This experimental
flag is used to effectively feature gate the server until it is ready
to use as a default.  Both RPC servers can be run at the same time,
but require binding to different listen addresses.

In theory, with the legacy RPC server now living in its own package it
should become much easier to unit test the handlers.  This will be
useful for any future changes to the package, as compatibility with
Core's wallet is still desired.

Type safety has also been improved in the legacy RPC server.  Multiple
handler types are now used for methods that do and do not require the
RPC client as a dependency.  This can statically help prevent nil
pointer dereferences, and was very useful for catching bugs during
refactoring.

To synchronize the wallet loading process between the main package
(the default) and through the gRPC WalletLoader service (with the
--noinitialload option), as well as increasing the loose coupling of
packages, a new wallet.Loader type has been added.  All creating and
loading of existing wallets is done through a single Loader instance,
and callbacks can be attached to the instance to run after the wallet
has been opened.  This is how the legacy RPC server is associated with
a loaded wallet, even after the wallet is loaded by a gRPC method in a
completely unrelated package.

Documentation for the new RPC server has been added to the
rpc/documentation directory.  The documentation includes a
specification for the new RPC API, addresses how to make changes to
the server implementation, and provides short example clients in
several different languages.

Some of the new RPC methods are not implementated exactly as described
by the specification.  These are considered bugs with the
implementation, not the spec.  Known bugs are commented as such.
2016-01-29 11:18:26 -05:00

1437 lines
55 KiB
Go

// Code generated by protoc-gen-go.
// source: api.proto
// DO NOT EDIT!
/*
Package walletrpc is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
TransactionDetails
BlockDetails
AccountBalance
PingRequest
PingResponse
NetworkRequest
NetworkResponse
AccountNumberRequest
AccountNumberResponse
AccountsRequest
AccountsResponse
RenameAccountRequest
RenameAccountResponse
NextAccountRequest
NextAccountResponse
NextAddressRequest
NextAddressResponse
ImportPrivateKeyRequest
ImportPrivateKeyResponse
BalanceRequest
BalanceResponse
GetTransactionsRequest
GetTransactionsResponse
ChangePassphraseRequest
ChangePassphraseResponse
FundTransactionRequest
FundTransactionResponse
SignTransactionRequest
SignTransactionResponse
PublishTransactionRequest
PublishTransactionResponse
TransactionNotificationsRequest
TransactionNotificationsResponse
SpentnessNotificationsRequest
SpentnessNotificationsResponse
AccountNotificationsRequest
AccountNotificationsResponse
CreateWalletRequest
CreateWalletResponse
OpenWalletRequest
OpenWalletResponse
CloseWalletRequest
CloseWalletResponse
WalletExistsRequest
WalletExistsResponse
StartBtcdRpcRequest
StartBtcdRpcResponse
*/
package walletrpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type ChangePassphraseRequest_Key int32
const (
ChangePassphraseRequest_PRIVATE ChangePassphraseRequest_Key = 0
ChangePassphraseRequest_PUBLIC ChangePassphraseRequest_Key = 1
)
var ChangePassphraseRequest_Key_name = map[int32]string{
0: "PRIVATE",
1: "PUBLIC",
}
var ChangePassphraseRequest_Key_value = map[string]int32{
"PRIVATE": 0,
"PUBLIC": 1,
}
func (x ChangePassphraseRequest_Key) String() string {
return proto.EnumName(ChangePassphraseRequest_Key_name, int32(x))
}
type TransactionDetails struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
Debits []*TransactionDetails_Input `protobuf:"bytes,3,rep,name=debits" json:"debits,omitempty"`
Outputs []*TransactionDetails_Output `protobuf:"bytes,4,rep,name=outputs" json:"outputs,omitempty"`
Fee int64 `protobuf:"varint,5,opt,name=fee" json:"fee,omitempty"`
Timestamp int64 `protobuf:"varint,6,opt,name=timestamp" json:"timestamp,omitempty"`
}
func (m *TransactionDetails) Reset() { *m = TransactionDetails{} }
func (m *TransactionDetails) String() string { return proto.CompactTextString(m) }
func (*TransactionDetails) ProtoMessage() {}
func (m *TransactionDetails) GetDebits() []*TransactionDetails_Input {
if m != nil {
return m.Debits
}
return nil
}
func (m *TransactionDetails) GetOutputs() []*TransactionDetails_Output {
if m != nil {
return m.Outputs
}
return nil
}
type TransactionDetails_Input struct {
Index uint32 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
PreviousAccount uint32 `protobuf:"varint,2,opt,name=previous_account" json:"previous_account,omitempty"`
PreviousAmount int64 `protobuf:"varint,3,opt,name=previous_amount" json:"previous_amount,omitempty"`
}
func (m *TransactionDetails_Input) Reset() { *m = TransactionDetails_Input{} }
func (m *TransactionDetails_Input) String() string { return proto.CompactTextString(m) }
func (*TransactionDetails_Input) ProtoMessage() {}
type TransactionDetails_Output struct {
Mine bool `protobuf:"varint,3,opt,name=mine" json:"mine,omitempty"`
// These fields only relevant if mine==true.
Account uint32 `protobuf:"varint,4,opt,name=account" json:"account,omitempty"`
Internal bool `protobuf:"varint,5,opt,name=internal" json:"internal,omitempty"`
// These fields only relevant if mine==false.
Addresses []string `protobuf:"bytes,6,rep,name=addresses" json:"addresses,omitempty"`
}
func (m *TransactionDetails_Output) Reset() { *m = TransactionDetails_Output{} }
func (m *TransactionDetails_Output) String() string { return proto.CompactTextString(m) }
func (*TransactionDetails_Output) ProtoMessage() {}
type BlockDetails struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
Height int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"`
Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"`
Transactions []*TransactionDetails `protobuf:"bytes,4,rep,name=transactions" json:"transactions,omitempty"`
}
func (m *BlockDetails) Reset() { *m = BlockDetails{} }
func (m *BlockDetails) String() string { return proto.CompactTextString(m) }
func (*BlockDetails) ProtoMessage() {}
func (m *BlockDetails) GetTransactions() []*TransactionDetails {
if m != nil {
return m.Transactions
}
return nil
}
type AccountBalance struct {
Account uint32 `protobuf:"varint,1,opt,name=account" json:"account,omitempty"`
TotalBalance int64 `protobuf:"varint,2,opt,name=total_balance" json:"total_balance,omitempty"`
}
func (m *AccountBalance) Reset() { *m = AccountBalance{} }
func (m *AccountBalance) String() string { return proto.CompactTextString(m) }
func (*AccountBalance) ProtoMessage() {}
type PingRequest struct {
}
func (m *PingRequest) Reset() { *m = PingRequest{} }
func (m *PingRequest) String() string { return proto.CompactTextString(m) }
func (*PingRequest) ProtoMessage() {}
type PingResponse struct {
}
func (m *PingResponse) Reset() { *m = PingResponse{} }
func (m *PingResponse) String() string { return proto.CompactTextString(m) }
func (*PingResponse) ProtoMessage() {}
type NetworkRequest struct {
}
func (m *NetworkRequest) Reset() { *m = NetworkRequest{} }
func (m *NetworkRequest) String() string { return proto.CompactTextString(m) }
func (*NetworkRequest) ProtoMessage() {}
type NetworkResponse struct {
ActiveNetwork uint32 `protobuf:"varint,1,opt,name=active_network" json:"active_network,omitempty"`
}
func (m *NetworkResponse) Reset() { *m = NetworkResponse{} }
func (m *NetworkResponse) String() string { return proto.CompactTextString(m) }
func (*NetworkResponse) ProtoMessage() {}
type AccountNumberRequest struct {
AccountName string `protobuf:"bytes,1,opt,name=account_name" json:"account_name,omitempty"`
}
func (m *AccountNumberRequest) Reset() { *m = AccountNumberRequest{} }
func (m *AccountNumberRequest) String() string { return proto.CompactTextString(m) }
func (*AccountNumberRequest) ProtoMessage() {}
type AccountNumberResponse struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
}
func (m *AccountNumberResponse) Reset() { *m = AccountNumberResponse{} }
func (m *AccountNumberResponse) String() string { return proto.CompactTextString(m) }
func (*AccountNumberResponse) ProtoMessage() {}
type AccountsRequest struct {
}
func (m *AccountsRequest) Reset() { *m = AccountsRequest{} }
func (m *AccountsRequest) String() string { return proto.CompactTextString(m) }
func (*AccountsRequest) ProtoMessage() {}
type AccountsResponse struct {
Accounts []*AccountsResponse_Account `protobuf:"bytes,1,rep,name=accounts" json:"accounts,omitempty"`
CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=current_block_hash,proto3" json:"current_block_hash,omitempty"`
CurrentBlockHeight int32 `protobuf:"varint,3,opt,name=current_block_height" json:"current_block_height,omitempty"`
}
func (m *AccountsResponse) Reset() { *m = AccountsResponse{} }
func (m *AccountsResponse) String() string { return proto.CompactTextString(m) }
func (*AccountsResponse) ProtoMessage() {}
func (m *AccountsResponse) GetAccounts() []*AccountsResponse_Account {
if m != nil {
return m.Accounts
}
return nil
}
type AccountsResponse_Account struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
AccountName string `protobuf:"bytes,2,opt,name=account_name" json:"account_name,omitempty"`
TotalBalance int64 `protobuf:"varint,3,opt,name=total_balance" json:"total_balance,omitempty"`
ExternalKeyCount uint32 `protobuf:"varint,4,opt,name=external_key_count" json:"external_key_count,omitempty"`
InternalKeyCount uint32 `protobuf:"varint,5,opt,name=internal_key_count" json:"internal_key_count,omitempty"`
ImportedKeyCount uint32 `protobuf:"varint,6,opt,name=imported_key_count" json:"imported_key_count,omitempty"`
}
func (m *AccountsResponse_Account) Reset() { *m = AccountsResponse_Account{} }
func (m *AccountsResponse_Account) String() string { return proto.CompactTextString(m) }
func (*AccountsResponse_Account) ProtoMessage() {}
type RenameAccountRequest struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
NewName string `protobuf:"bytes,2,opt,name=new_name" json:"new_name,omitempty"`
}
func (m *RenameAccountRequest) Reset() { *m = RenameAccountRequest{} }
func (m *RenameAccountRequest) String() string { return proto.CompactTextString(m) }
func (*RenameAccountRequest) ProtoMessage() {}
type RenameAccountResponse struct {
}
func (m *RenameAccountResponse) Reset() { *m = RenameAccountResponse{} }
func (m *RenameAccountResponse) String() string { return proto.CompactTextString(m) }
func (*RenameAccountResponse) ProtoMessage() {}
type NextAccountRequest struct {
Passphrase []byte `protobuf:"bytes,1,opt,name=passphrase,proto3" json:"passphrase,omitempty"`
AccountName string `protobuf:"bytes,2,opt,name=account_name" json:"account_name,omitempty"`
}
func (m *NextAccountRequest) Reset() { *m = NextAccountRequest{} }
func (m *NextAccountRequest) String() string { return proto.CompactTextString(m) }
func (*NextAccountRequest) ProtoMessage() {}
type NextAccountResponse struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
}
func (m *NextAccountResponse) Reset() { *m = NextAccountResponse{} }
func (m *NextAccountResponse) String() string { return proto.CompactTextString(m) }
func (*NextAccountResponse) ProtoMessage() {}
type NextAddressRequest struct {
Account uint32 `protobuf:"varint,1,opt,name=account" json:"account,omitempty"`
}
func (m *NextAddressRequest) Reset() { *m = NextAddressRequest{} }
func (m *NextAddressRequest) String() string { return proto.CompactTextString(m) }
func (*NextAddressRequest) ProtoMessage() {}
type NextAddressResponse struct {
Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"`
}
func (m *NextAddressResponse) Reset() { *m = NextAddressResponse{} }
func (m *NextAddressResponse) String() string { return proto.CompactTextString(m) }
func (*NextAddressResponse) ProtoMessage() {}
type ImportPrivateKeyRequest struct {
Passphrase []byte `protobuf:"bytes,1,opt,name=passphrase,proto3" json:"passphrase,omitempty"`
Account uint32 `protobuf:"varint,2,opt,name=account" json:"account,omitempty"`
PrivateKeyWif string `protobuf:"bytes,3,opt,name=private_key_wif" json:"private_key_wif,omitempty"`
Rescan bool `protobuf:"varint,4,opt,name=rescan" json:"rescan,omitempty"`
}
func (m *ImportPrivateKeyRequest) Reset() { *m = ImportPrivateKeyRequest{} }
func (m *ImportPrivateKeyRequest) String() string { return proto.CompactTextString(m) }
func (*ImportPrivateKeyRequest) ProtoMessage() {}
type ImportPrivateKeyResponse struct {
}
func (m *ImportPrivateKeyResponse) Reset() { *m = ImportPrivateKeyResponse{} }
func (m *ImportPrivateKeyResponse) String() string { return proto.CompactTextString(m) }
func (*ImportPrivateKeyResponse) ProtoMessage() {}
type BalanceRequest struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
RequiredConfirmations int32 `protobuf:"varint,2,opt,name=required_confirmations" json:"required_confirmations,omitempty"`
}
func (m *BalanceRequest) Reset() { *m = BalanceRequest{} }
func (m *BalanceRequest) String() string { return proto.CompactTextString(m) }
func (*BalanceRequest) ProtoMessage() {}
type BalanceResponse struct {
Total int64 `protobuf:"varint,1,opt,name=total" json:"total,omitempty"`
Spendable int64 `protobuf:"varint,2,opt,name=spendable" json:"spendable,omitempty"`
ImmatureReward int64 `protobuf:"varint,3,opt,name=immature_reward" json:"immature_reward,omitempty"`
}
func (m *BalanceResponse) Reset() { *m = BalanceResponse{} }
func (m *BalanceResponse) String() string { return proto.CompactTextString(m) }
func (*BalanceResponse) ProtoMessage() {}
type GetTransactionsRequest struct {
// Optionally specify the starting block from which to begin including all transactions.
// Either the starting block hash or height may be specified, but not both.
// If a block height is specified and is negative, the absolute value becomes the number of
// last blocks to include. That is, given a current chain height of 1000 and a starting block
// height of -3, transaction notifications will be created for blocks 998, 999, and 1000.
// If both options are excluded, transaction results are created for transactions since the
// genesis block.
StartingBlockHash []byte `protobuf:"bytes,1,opt,name=starting_block_hash,proto3" json:"starting_block_hash,omitempty"`
StartingBlockHeight int32 `protobuf:"zigzag32,2,opt,name=starting_block_height" json:"starting_block_height,omitempty"`
// Optionally specify the last block that transaction results may appear in.
// Either the ending block hash or height may be specified, but not both.
// If both are excluded, transaction results are created for all transactions
// through the best block, and include all unmined transactions.
EndingBlockHash []byte `protobuf:"bytes,3,opt,name=ending_block_hash,proto3" json:"ending_block_hash,omitempty"`
EndingBlockHeight int32 `protobuf:"varint,4,opt,name=ending_block_height" json:"ending_block_height,omitempty"`
// Include at least this many of the newest transactions if they exist.
// Cannot be used when the ending block hash is specified.
//
// TODO: remove until spec adds it back in some way.
MinimumRecentTransactions int32 `protobuf:"varint,5,opt,name=minimum_recent_transactions" json:"minimum_recent_transactions,omitempty"`
}
func (m *GetTransactionsRequest) Reset() { *m = GetTransactionsRequest{} }
func (m *GetTransactionsRequest) String() string { return proto.CompactTextString(m) }
func (*GetTransactionsRequest) ProtoMessage() {}
type GetTransactionsResponse struct {
MinedTransactions []*BlockDetails `protobuf:"bytes,1,rep,name=mined_transactions" json:"mined_transactions,omitempty"`
UnminedTransactions []*TransactionDetails `protobuf:"bytes,2,rep,name=unmined_transactions" json:"unmined_transactions,omitempty"`
}
func (m *GetTransactionsResponse) Reset() { *m = GetTransactionsResponse{} }
func (m *GetTransactionsResponse) String() string { return proto.CompactTextString(m) }
func (*GetTransactionsResponse) ProtoMessage() {}
func (m *GetTransactionsResponse) GetMinedTransactions() []*BlockDetails {
if m != nil {
return m.MinedTransactions
}
return nil
}
func (m *GetTransactionsResponse) GetUnminedTransactions() []*TransactionDetails {
if m != nil {
return m.UnminedTransactions
}
return nil
}
type ChangePassphraseRequest struct {
Key ChangePassphraseRequest_Key `protobuf:"varint,1,opt,name=key,enum=walletrpc.ChangePassphraseRequest_Key" json:"key,omitempty"`
OldPassphrase []byte `protobuf:"bytes,2,opt,name=old_passphrase,proto3" json:"old_passphrase,omitempty"`
NewPassphrase []byte `protobuf:"bytes,3,opt,name=new_passphrase,proto3" json:"new_passphrase,omitempty"`
}
func (m *ChangePassphraseRequest) Reset() { *m = ChangePassphraseRequest{} }
func (m *ChangePassphraseRequest) String() string { return proto.CompactTextString(m) }
func (*ChangePassphraseRequest) ProtoMessage() {}
type ChangePassphraseResponse struct {
}
func (m *ChangePassphraseResponse) Reset() { *m = ChangePassphraseResponse{} }
func (m *ChangePassphraseResponse) String() string { return proto.CompactTextString(m) }
func (*ChangePassphraseResponse) ProtoMessage() {}
type FundTransactionRequest struct {
Account uint32 `protobuf:"varint,1,opt,name=account" json:"account,omitempty"`
TargetAmount int64 `protobuf:"varint,2,opt,name=target_amount" json:"target_amount,omitempty"`
RequiredConfirmations int32 `protobuf:"varint,3,opt,name=required_confirmations" json:"required_confirmations,omitempty"`
IncludeImmatureCoinbases bool `protobuf:"varint,4,opt,name=include_immature_coinbases" json:"include_immature_coinbases,omitempty"`
IncludeChangeScript bool `protobuf:"varint,5,opt,name=include_change_script" json:"include_change_script,omitempty"`
}
func (m *FundTransactionRequest) Reset() { *m = FundTransactionRequest{} }
func (m *FundTransactionRequest) String() string { return proto.CompactTextString(m) }
func (*FundTransactionRequest) ProtoMessage() {}
type FundTransactionResponse struct {
SelectedOutputs []*FundTransactionResponse_PreviousOutput `protobuf:"bytes,1,rep,name=selected_outputs" json:"selected_outputs,omitempty"`
TotalAmount int64 `protobuf:"varint,2,opt,name=total_amount" json:"total_amount,omitempty"`
ChangePkScript []byte `protobuf:"bytes,3,opt,name=change_pk_script,proto3" json:"change_pk_script,omitempty"`
}
func (m *FundTransactionResponse) Reset() { *m = FundTransactionResponse{} }
func (m *FundTransactionResponse) String() string { return proto.CompactTextString(m) }
func (*FundTransactionResponse) ProtoMessage() {}
func (m *FundTransactionResponse) GetSelectedOutputs() []*FundTransactionResponse_PreviousOutput {
if m != nil {
return m.SelectedOutputs
}
return nil
}
type FundTransactionResponse_PreviousOutput struct {
TransactionHash []byte `protobuf:"bytes,1,opt,name=transaction_hash,proto3" json:"transaction_hash,omitempty"`
OutputIndex uint32 `protobuf:"varint,2,opt,name=output_index" json:"output_index,omitempty"`
Amount int64 `protobuf:"varint,3,opt,name=amount" json:"amount,omitempty"`
PkScript []byte `protobuf:"bytes,4,opt,name=pk_script,proto3" json:"pk_script,omitempty"`
ReceiveTime int64 `protobuf:"varint,5,opt,name=receive_time" json:"receive_time,omitempty"`
FromCoinbase bool `protobuf:"varint,6,opt,name=from_coinbase" json:"from_coinbase,omitempty"`
}
func (m *FundTransactionResponse_PreviousOutput) Reset() {
*m = FundTransactionResponse_PreviousOutput{}
}
func (m *FundTransactionResponse_PreviousOutput) String() string { return proto.CompactTextString(m) }
func (*FundTransactionResponse_PreviousOutput) ProtoMessage() {}
type SignTransactionRequest struct {
Passphrase []byte `protobuf:"bytes,1,opt,name=passphrase,proto3" json:"passphrase,omitempty"`
SerializedTransaction []byte `protobuf:"bytes,2,opt,name=serialized_transaction,proto3" json:"serialized_transaction,omitempty"`
// If no indexes are specified, signatures scripts will be added for
// every input. If any input indexes are specified, only those inputs
// will be signed. Rather than returning an incompletely signed
// transaction if any of the inputs to be signed can not be, the RPC
// immediately errors.
InputIndexes []uint32 `protobuf:"varint,3,rep,name=input_indexes" json:"input_indexes,omitempty"`
}
func (m *SignTransactionRequest) Reset() { *m = SignTransactionRequest{} }
func (m *SignTransactionRequest) String() string { return proto.CompactTextString(m) }
func (*SignTransactionRequest) ProtoMessage() {}
type SignTransactionResponse struct {
Transaction []byte `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
UnsignedInputIndexes []uint32 `protobuf:"varint,2,rep,name=unsigned_input_indexes" json:"unsigned_input_indexes,omitempty"`
}
func (m *SignTransactionResponse) Reset() { *m = SignTransactionResponse{} }
func (m *SignTransactionResponse) String() string { return proto.CompactTextString(m) }
func (*SignTransactionResponse) ProtoMessage() {}
type PublishTransactionRequest struct {
SignedTransaction []byte `protobuf:"bytes,1,opt,name=signed_transaction,proto3" json:"signed_transaction,omitempty"`
}
func (m *PublishTransactionRequest) Reset() { *m = PublishTransactionRequest{} }
func (m *PublishTransactionRequest) String() string { return proto.CompactTextString(m) }
func (*PublishTransactionRequest) ProtoMessage() {}
type PublishTransactionResponse struct {
}
func (m *PublishTransactionResponse) Reset() { *m = PublishTransactionResponse{} }
func (m *PublishTransactionResponse) String() string { return proto.CompactTextString(m) }
func (*PublishTransactionResponse) ProtoMessage() {}
type TransactionNotificationsRequest struct {
}
func (m *TransactionNotificationsRequest) Reset() { *m = TransactionNotificationsRequest{} }
func (m *TransactionNotificationsRequest) String() string { return proto.CompactTextString(m) }
func (*TransactionNotificationsRequest) ProtoMessage() {}
type TransactionNotificationsResponse struct {
// Sorted by increasing height. This is a repeated field so many new blocks
// in a new best chain can be notified at once during a reorganize.
AttachedBlocks []*BlockDetails `protobuf:"bytes,1,rep,name=attached_blocks" json:"attached_blocks,omitempty"`
// If there was a chain reorganize, there may have been blocks with wallet
// transactions that are no longer in the best chain. These are those
// block's hashes.
DetachedBlocks [][]byte `protobuf:"bytes,2,rep,name=detached_blocks,proto3" json:"detached_blocks,omitempty"`
// Any new unmined transactions are included here. These unmined transactions
// refer to the current best chain, so transactions from detached blocks may
// be moved to mempool and included here if they are not mined or double spent
// in the new chain. Additonally, if no new blocks were attached but a relevant
// unmined transaction is seen by the wallet, it will be reported here.
UnminedTransactions []*TransactionDetails `protobuf:"bytes,3,rep,name=unmined_transactions" json:"unmined_transactions,omitempty"`
// Instead of notifying all of the removed unmined transactions,
// just send all of the current hashes.
UnminedTransactionHashes [][]byte `protobuf:"bytes,4,rep,name=unmined_transaction_hashes,proto3" json:"unmined_transaction_hashes,omitempty"`
}
func (m *TransactionNotificationsResponse) Reset() { *m = TransactionNotificationsResponse{} }
func (m *TransactionNotificationsResponse) String() string { return proto.CompactTextString(m) }
func (*TransactionNotificationsResponse) ProtoMessage() {}
func (m *TransactionNotificationsResponse) GetAttachedBlocks() []*BlockDetails {
if m != nil {
return m.AttachedBlocks
}
return nil
}
func (m *TransactionNotificationsResponse) GetUnminedTransactions() []*TransactionDetails {
if m != nil {
return m.UnminedTransactions
}
return nil
}
type SpentnessNotificationsRequest struct {
Account uint32 `protobuf:"varint,1,opt,name=account" json:"account,omitempty"`
NoNotifyUnspent bool `protobuf:"varint,2,opt,name=no_notify_unspent" json:"no_notify_unspent,omitempty"`
NoNotifySpent bool `protobuf:"varint,3,opt,name=no_notify_spent" json:"no_notify_spent,omitempty"`
}
func (m *SpentnessNotificationsRequest) Reset() { *m = SpentnessNotificationsRequest{} }
func (m *SpentnessNotificationsRequest) String() string { return proto.CompactTextString(m) }
func (*SpentnessNotificationsRequest) ProtoMessage() {}
type SpentnessNotificationsResponse struct {
TransactionHash []byte `protobuf:"bytes,1,opt,name=transaction_hash,proto3" json:"transaction_hash,omitempty"`
OutputIndex uint32 `protobuf:"varint,2,opt,name=output_index" json:"output_index,omitempty"`
Spender *SpentnessNotificationsResponse_Spender `protobuf:"bytes,3,opt,name=spender" json:"spender,omitempty"`
}
func (m *SpentnessNotificationsResponse) Reset() { *m = SpentnessNotificationsResponse{} }
func (m *SpentnessNotificationsResponse) String() string { return proto.CompactTextString(m) }
func (*SpentnessNotificationsResponse) ProtoMessage() {}
func (m *SpentnessNotificationsResponse) GetSpender() *SpentnessNotificationsResponse_Spender {
if m != nil {
return m.Spender
}
return nil
}
type SpentnessNotificationsResponse_Spender struct {
TransactionHash []byte `protobuf:"bytes,1,opt,name=transaction_hash,proto3" json:"transaction_hash,omitempty"`
InputIndex uint32 `protobuf:"varint,2,opt,name=input_index" json:"input_index,omitempty"`
}
func (m *SpentnessNotificationsResponse_Spender) Reset() {
*m = SpentnessNotificationsResponse_Spender{}
}
func (m *SpentnessNotificationsResponse_Spender) String() string { return proto.CompactTextString(m) }
func (*SpentnessNotificationsResponse_Spender) ProtoMessage() {}
type AccountNotificationsRequest struct {
}
func (m *AccountNotificationsRequest) Reset() { *m = AccountNotificationsRequest{} }
func (m *AccountNotificationsRequest) String() string { return proto.CompactTextString(m) }
func (*AccountNotificationsRequest) ProtoMessage() {}
type AccountNotificationsResponse struct {
AccountNumber uint32 `protobuf:"varint,1,opt,name=account_number" json:"account_number,omitempty"`
AccountName string `protobuf:"bytes,2,opt,name=account_name" json:"account_name,omitempty"`
ExternalKeyCount uint32 `protobuf:"varint,3,opt,name=external_key_count" json:"external_key_count,omitempty"`
InternalKeyCount uint32 `protobuf:"varint,4,opt,name=internal_key_count" json:"internal_key_count,omitempty"`
ImportedKeyCount uint32 `protobuf:"varint,5,opt,name=imported_key_count" json:"imported_key_count,omitempty"`
}
func (m *AccountNotificationsResponse) Reset() { *m = AccountNotificationsResponse{} }
func (m *AccountNotificationsResponse) String() string { return proto.CompactTextString(m) }
func (*AccountNotificationsResponse) ProtoMessage() {}
type CreateWalletRequest struct {
PublicPassphrase []byte `protobuf:"bytes,1,opt,name=public_passphrase,proto3" json:"public_passphrase,omitempty"`
PrivatePassphrase []byte `protobuf:"bytes,2,opt,name=private_passphrase,proto3" json:"private_passphrase,omitempty"`
Seed []byte `protobuf:"bytes,3,opt,name=seed,proto3" json:"seed,omitempty"`
}
func (m *CreateWalletRequest) Reset() { *m = CreateWalletRequest{} }
func (m *CreateWalletRequest) String() string { return proto.CompactTextString(m) }
func (*CreateWalletRequest) ProtoMessage() {}
type CreateWalletResponse struct {
}
func (m *CreateWalletResponse) Reset() { *m = CreateWalletResponse{} }
func (m *CreateWalletResponse) String() string { return proto.CompactTextString(m) }
func (*CreateWalletResponse) ProtoMessage() {}
type OpenWalletRequest struct {
PublicPassphrase []byte `protobuf:"bytes,1,opt,name=public_passphrase,proto3" json:"public_passphrase,omitempty"`
}
func (m *OpenWalletRequest) Reset() { *m = OpenWalletRequest{} }
func (m *OpenWalletRequest) String() string { return proto.CompactTextString(m) }
func (*OpenWalletRequest) ProtoMessage() {}
type OpenWalletResponse struct {
}
func (m *OpenWalletResponse) Reset() { *m = OpenWalletResponse{} }
func (m *OpenWalletResponse) String() string { return proto.CompactTextString(m) }
func (*OpenWalletResponse) ProtoMessage() {}
type CloseWalletRequest struct {
}
func (m *CloseWalletRequest) Reset() { *m = CloseWalletRequest{} }
func (m *CloseWalletRequest) String() string { return proto.CompactTextString(m) }
func (*CloseWalletRequest) ProtoMessage() {}
type CloseWalletResponse struct {
}
func (m *CloseWalletResponse) Reset() { *m = CloseWalletResponse{} }
func (m *CloseWalletResponse) String() string { return proto.CompactTextString(m) }
func (*CloseWalletResponse) ProtoMessage() {}
type WalletExistsRequest struct {
}
func (m *WalletExistsRequest) Reset() { *m = WalletExistsRequest{} }
func (m *WalletExistsRequest) String() string { return proto.CompactTextString(m) }
func (*WalletExistsRequest) ProtoMessage() {}
type WalletExistsResponse struct {
Exists bool `protobuf:"varint,1,opt,name=exists" json:"exists,omitempty"`
}
func (m *WalletExistsResponse) Reset() { *m = WalletExistsResponse{} }
func (m *WalletExistsResponse) String() string { return proto.CompactTextString(m) }
func (*WalletExistsResponse) ProtoMessage() {}
type StartBtcdRpcRequest struct {
NetworkAddress string `protobuf:"bytes,1,opt,name=network_address" json:"network_address,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
Password []byte `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
Certificate []byte `protobuf:"bytes,4,opt,name=certificate,proto3" json:"certificate,omitempty"`
}
func (m *StartBtcdRpcRequest) Reset() { *m = StartBtcdRpcRequest{} }
func (m *StartBtcdRpcRequest) String() string { return proto.CompactTextString(m) }
func (*StartBtcdRpcRequest) ProtoMessage() {}
type StartBtcdRpcResponse struct {
}
func (m *StartBtcdRpcResponse) Reset() { *m = StartBtcdRpcResponse{} }
func (m *StartBtcdRpcResponse) String() string { return proto.CompactTextString(m) }
func (*StartBtcdRpcResponse) ProtoMessage() {}
func init() {
proto.RegisterEnum("walletrpc.ChangePassphraseRequest_Key", ChangePassphraseRequest_Key_name, ChangePassphraseRequest_Key_value)
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for WalletService service
type WalletServiceClient interface {
// Queries
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
Network(ctx context.Context, in *NetworkRequest, opts ...grpc.CallOption) (*NetworkResponse, error)
AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error)
Accounts(ctx context.Context, in *AccountsRequest, opts ...grpc.CallOption) (*AccountsResponse, error)
Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error)
GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*GetTransactionsResponse, error)
// Notifications
TransactionNotifications(ctx context.Context, in *TransactionNotificationsRequest, opts ...grpc.CallOption) (WalletService_TransactionNotificationsClient, error)
SpentnessNotifications(ctx context.Context, in *SpentnessNotificationsRequest, opts ...grpc.CallOption) (WalletService_SpentnessNotificationsClient, error)
AccountNotifications(ctx context.Context, in *AccountNotificationsRequest, opts ...grpc.CallOption) (WalletService_AccountNotificationsClient, error)
// Control
ChangePassphrase(ctx context.Context, in *ChangePassphraseRequest, opts ...grpc.CallOption) (*ChangePassphraseResponse, error)
RenameAccount(ctx context.Context, in *RenameAccountRequest, opts ...grpc.CallOption) (*RenameAccountResponse, error)
NextAccount(ctx context.Context, in *NextAccountRequest, opts ...grpc.CallOption) (*NextAccountResponse, error)
NextAddress(ctx context.Context, in *NextAddressRequest, opts ...grpc.CallOption) (*NextAddressResponse, error)
ImportPrivateKey(ctx context.Context, in *ImportPrivateKeyRequest, opts ...grpc.CallOption) (*ImportPrivateKeyResponse, error)
FundTransaction(ctx context.Context, in *FundTransactionRequest, opts ...grpc.CallOption) (*FundTransactionResponse, error)
SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error)
PublishTransaction(ctx context.Context, in *PublishTransactionRequest, opts ...grpc.CallOption) (*PublishTransactionResponse, error)
}
type walletServiceClient struct {
cc *grpc.ClientConn
}
func NewWalletServiceClient(cc *grpc.ClientConn) WalletServiceClient {
return &walletServiceClient{cc}
}
func (c *walletServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) {
out := new(PingResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/Ping", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Network(ctx context.Context, in *NetworkRequest, opts ...grpc.CallOption) (*NetworkResponse, error) {
out := new(NetworkResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/Network", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) AccountNumber(ctx context.Context, in *AccountNumberRequest, opts ...grpc.CallOption) (*AccountNumberResponse, error) {
out := new(AccountNumberResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/AccountNumber", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Accounts(ctx context.Context, in *AccountsRequest, opts ...grpc.CallOption) (*AccountsResponse, error) {
out := new(AccountsResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/Accounts", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) {
out := new(BalanceResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/Balance", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) GetTransactions(ctx context.Context, in *GetTransactionsRequest, opts ...grpc.CallOption) (*GetTransactionsResponse, error) {
out := new(GetTransactionsResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/GetTransactions", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) TransactionNotifications(ctx context.Context, in *TransactionNotificationsRequest, opts ...grpc.CallOption) (WalletService_TransactionNotificationsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_WalletService_serviceDesc.Streams[0], c.cc, "/walletrpc.WalletService/TransactionNotifications", opts...)
if err != nil {
return nil, err
}
x := &walletServiceTransactionNotificationsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type WalletService_TransactionNotificationsClient interface {
Recv() (*TransactionNotificationsResponse, error)
grpc.ClientStream
}
type walletServiceTransactionNotificationsClient struct {
grpc.ClientStream
}
func (x *walletServiceTransactionNotificationsClient) Recv() (*TransactionNotificationsResponse, error) {
m := new(TransactionNotificationsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *walletServiceClient) SpentnessNotifications(ctx context.Context, in *SpentnessNotificationsRequest, opts ...grpc.CallOption) (WalletService_SpentnessNotificationsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_WalletService_serviceDesc.Streams[1], c.cc, "/walletrpc.WalletService/SpentnessNotifications", opts...)
if err != nil {
return nil, err
}
x := &walletServiceSpentnessNotificationsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type WalletService_SpentnessNotificationsClient interface {
Recv() (*SpentnessNotificationsResponse, error)
grpc.ClientStream
}
type walletServiceSpentnessNotificationsClient struct {
grpc.ClientStream
}
func (x *walletServiceSpentnessNotificationsClient) Recv() (*SpentnessNotificationsResponse, error) {
m := new(SpentnessNotificationsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *walletServiceClient) AccountNotifications(ctx context.Context, in *AccountNotificationsRequest, opts ...grpc.CallOption) (WalletService_AccountNotificationsClient, error) {
stream, err := grpc.NewClientStream(ctx, &_WalletService_serviceDesc.Streams[2], c.cc, "/walletrpc.WalletService/AccountNotifications", opts...)
if err != nil {
return nil, err
}
x := &walletServiceAccountNotificationsClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type WalletService_AccountNotificationsClient interface {
Recv() (*AccountNotificationsResponse, error)
grpc.ClientStream
}
type walletServiceAccountNotificationsClient struct {
grpc.ClientStream
}
func (x *walletServiceAccountNotificationsClient) Recv() (*AccountNotificationsResponse, error) {
m := new(AccountNotificationsResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *walletServiceClient) ChangePassphrase(ctx context.Context, in *ChangePassphraseRequest, opts ...grpc.CallOption) (*ChangePassphraseResponse, error) {
out := new(ChangePassphraseResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/ChangePassphrase", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) RenameAccount(ctx context.Context, in *RenameAccountRequest, opts ...grpc.CallOption) (*RenameAccountResponse, error) {
out := new(RenameAccountResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/RenameAccount", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) NextAccount(ctx context.Context, in *NextAccountRequest, opts ...grpc.CallOption) (*NextAccountResponse, error) {
out := new(NextAccountResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/NextAccount", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) NextAddress(ctx context.Context, in *NextAddressRequest, opts ...grpc.CallOption) (*NextAddressResponse, error) {
out := new(NextAddressResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/NextAddress", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) ImportPrivateKey(ctx context.Context, in *ImportPrivateKeyRequest, opts ...grpc.CallOption) (*ImportPrivateKeyResponse, error) {
out := new(ImportPrivateKeyResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/ImportPrivateKey", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) FundTransaction(ctx context.Context, in *FundTransactionRequest, opts ...grpc.CallOption) (*FundTransactionResponse, error) {
out := new(FundTransactionResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/FundTransaction", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error) {
out := new(SignTransactionResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/SignTransaction", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletServiceClient) PublishTransaction(ctx context.Context, in *PublishTransactionRequest, opts ...grpc.CallOption) (*PublishTransactionResponse, error) {
out := new(PublishTransactionResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletService/PublishTransaction", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for WalletService service
type WalletServiceServer interface {
// Queries
Ping(context.Context, *PingRequest) (*PingResponse, error)
Network(context.Context, *NetworkRequest) (*NetworkResponse, error)
AccountNumber(context.Context, *AccountNumberRequest) (*AccountNumberResponse, error)
Accounts(context.Context, *AccountsRequest) (*AccountsResponse, error)
Balance(context.Context, *BalanceRequest) (*BalanceResponse, error)
GetTransactions(context.Context, *GetTransactionsRequest) (*GetTransactionsResponse, error)
// Notifications
TransactionNotifications(*TransactionNotificationsRequest, WalletService_TransactionNotificationsServer) error
SpentnessNotifications(*SpentnessNotificationsRequest, WalletService_SpentnessNotificationsServer) error
AccountNotifications(*AccountNotificationsRequest, WalletService_AccountNotificationsServer) error
// Control
ChangePassphrase(context.Context, *ChangePassphraseRequest) (*ChangePassphraseResponse, error)
RenameAccount(context.Context, *RenameAccountRequest) (*RenameAccountResponse, error)
NextAccount(context.Context, *NextAccountRequest) (*NextAccountResponse, error)
NextAddress(context.Context, *NextAddressRequest) (*NextAddressResponse, error)
ImportPrivateKey(context.Context, *ImportPrivateKeyRequest) (*ImportPrivateKeyResponse, error)
FundTransaction(context.Context, *FundTransactionRequest) (*FundTransactionResponse, error)
SignTransaction(context.Context, *SignTransactionRequest) (*SignTransactionResponse, error)
PublishTransaction(context.Context, *PublishTransactionRequest) (*PublishTransactionResponse, error)
}
func RegisterWalletServiceServer(s *grpc.Server, srv WalletServiceServer) {
s.RegisterService(&_WalletService_serviceDesc, srv)
}
func _WalletService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(PingRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).Ping(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_Network_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(NetworkRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).Network(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_AccountNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(AccountNumberRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).AccountNumber(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(AccountsRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).Accounts(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_Balance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(BalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).Balance(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_GetTransactions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(GetTransactionsRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).GetTransactions(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_TransactionNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(TransactionNotificationsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(WalletServiceServer).TransactionNotifications(m, &walletServiceTransactionNotificationsServer{stream})
}
type WalletService_TransactionNotificationsServer interface {
Send(*TransactionNotificationsResponse) error
grpc.ServerStream
}
type walletServiceTransactionNotificationsServer struct {
grpc.ServerStream
}
func (x *walletServiceTransactionNotificationsServer) Send(m *TransactionNotificationsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _WalletService_SpentnessNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(SpentnessNotificationsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(WalletServiceServer).SpentnessNotifications(m, &walletServiceSpentnessNotificationsServer{stream})
}
type WalletService_SpentnessNotificationsServer interface {
Send(*SpentnessNotificationsResponse) error
grpc.ServerStream
}
type walletServiceSpentnessNotificationsServer struct {
grpc.ServerStream
}
func (x *walletServiceSpentnessNotificationsServer) Send(m *SpentnessNotificationsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _WalletService_AccountNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(AccountNotificationsRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(WalletServiceServer).AccountNotifications(m, &walletServiceAccountNotificationsServer{stream})
}
type WalletService_AccountNotificationsServer interface {
Send(*AccountNotificationsResponse) error
grpc.ServerStream
}
type walletServiceAccountNotificationsServer struct {
grpc.ServerStream
}
func (x *walletServiceAccountNotificationsServer) Send(m *AccountNotificationsResponse) error {
return x.ServerStream.SendMsg(m)
}
func _WalletService_ChangePassphrase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(ChangePassphraseRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).ChangePassphrase(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_RenameAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(RenameAccountRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).RenameAccount(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_NextAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(NextAccountRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).NextAccount(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_NextAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(NextAddressRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).NextAddress(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_ImportPrivateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(ImportPrivateKeyRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).ImportPrivateKey(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_FundTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(FundTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).FundTransaction(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_SignTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(SignTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).SignTransaction(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletService_PublishTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(PublishTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletServiceServer).PublishTransaction(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var _WalletService_serviceDesc = grpc.ServiceDesc{
ServiceName: "walletrpc.WalletService",
HandlerType: (*WalletServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Ping",
Handler: _WalletService_Ping_Handler,
},
{
MethodName: "Network",
Handler: _WalletService_Network_Handler,
},
{
MethodName: "AccountNumber",
Handler: _WalletService_AccountNumber_Handler,
},
{
MethodName: "Accounts",
Handler: _WalletService_Accounts_Handler,
},
{
MethodName: "Balance",
Handler: _WalletService_Balance_Handler,
},
{
MethodName: "GetTransactions",
Handler: _WalletService_GetTransactions_Handler,
},
{
MethodName: "ChangePassphrase",
Handler: _WalletService_ChangePassphrase_Handler,
},
{
MethodName: "RenameAccount",
Handler: _WalletService_RenameAccount_Handler,
},
{
MethodName: "NextAccount",
Handler: _WalletService_NextAccount_Handler,
},
{
MethodName: "NextAddress",
Handler: _WalletService_NextAddress_Handler,
},
{
MethodName: "ImportPrivateKey",
Handler: _WalletService_ImportPrivateKey_Handler,
},
{
MethodName: "FundTransaction",
Handler: _WalletService_FundTransaction_Handler,
},
{
MethodName: "SignTransaction",
Handler: _WalletService_SignTransaction_Handler,
},
{
MethodName: "PublishTransaction",
Handler: _WalletService_PublishTransaction_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "TransactionNotifications",
Handler: _WalletService_TransactionNotifications_Handler,
ServerStreams: true,
},
{
StreamName: "SpentnessNotifications",
Handler: _WalletService_SpentnessNotifications_Handler,
ServerStreams: true,
},
{
StreamName: "AccountNotifications",
Handler: _WalletService_AccountNotifications_Handler,
ServerStreams: true,
},
},
}
// Client API for WalletLoaderService service
type WalletLoaderServiceClient interface {
WalletExists(ctx context.Context, in *WalletExistsRequest, opts ...grpc.CallOption) (*WalletExistsResponse, error)
CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error)
OpenWallet(ctx context.Context, in *OpenWalletRequest, opts ...grpc.CallOption) (*OpenWalletResponse, error)
CloseWallet(ctx context.Context, in *CloseWalletRequest, opts ...grpc.CallOption) (*CloseWalletResponse, error)
StartBtcdRpc(ctx context.Context, in *StartBtcdRpcRequest, opts ...grpc.CallOption) (*StartBtcdRpcResponse, error)
}
type walletLoaderServiceClient struct {
cc *grpc.ClientConn
}
func NewWalletLoaderServiceClient(cc *grpc.ClientConn) WalletLoaderServiceClient {
return &walletLoaderServiceClient{cc}
}
func (c *walletLoaderServiceClient) WalletExists(ctx context.Context, in *WalletExistsRequest, opts ...grpc.CallOption) (*WalletExistsResponse, error) {
out := new(WalletExistsResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletLoaderService/WalletExists", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletLoaderServiceClient) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) {
out := new(CreateWalletResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletLoaderService/CreateWallet", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletLoaderServiceClient) OpenWallet(ctx context.Context, in *OpenWalletRequest, opts ...grpc.CallOption) (*OpenWalletResponse, error) {
out := new(OpenWalletResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletLoaderService/OpenWallet", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletLoaderServiceClient) CloseWallet(ctx context.Context, in *CloseWalletRequest, opts ...grpc.CallOption) (*CloseWalletResponse, error) {
out := new(CloseWalletResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletLoaderService/CloseWallet", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *walletLoaderServiceClient) StartBtcdRpc(ctx context.Context, in *StartBtcdRpcRequest, opts ...grpc.CallOption) (*StartBtcdRpcResponse, error) {
out := new(StartBtcdRpcResponse)
err := grpc.Invoke(ctx, "/walletrpc.WalletLoaderService/StartBtcdRpc", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for WalletLoaderService service
type WalletLoaderServiceServer interface {
WalletExists(context.Context, *WalletExistsRequest) (*WalletExistsResponse, error)
CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error)
OpenWallet(context.Context, *OpenWalletRequest) (*OpenWalletResponse, error)
CloseWallet(context.Context, *CloseWalletRequest) (*CloseWalletResponse, error)
StartBtcdRpc(context.Context, *StartBtcdRpcRequest) (*StartBtcdRpcResponse, error)
}
func RegisterWalletLoaderServiceServer(s *grpc.Server, srv WalletLoaderServiceServer) {
s.RegisterService(&_WalletLoaderService_serviceDesc, srv)
}
func _WalletLoaderService_WalletExists_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(WalletExistsRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletLoaderServiceServer).WalletExists(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletLoaderService_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(CreateWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletLoaderServiceServer).CreateWallet(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletLoaderService_OpenWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(OpenWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletLoaderServiceServer).OpenWallet(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletLoaderService_CloseWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(CloseWalletRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletLoaderServiceServer).CloseWallet(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _WalletLoaderService_StartBtcdRpc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(StartBtcdRpcRequest)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(WalletLoaderServiceServer).StartBtcdRpc(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var _WalletLoaderService_serviceDesc = grpc.ServiceDesc{
ServiceName: "walletrpc.WalletLoaderService",
HandlerType: (*WalletLoaderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "WalletExists",
Handler: _WalletLoaderService_WalletExists_Handler,
},
{
MethodName: "CreateWallet",
Handler: _WalletLoaderService_CreateWallet_Handler,
},
{
MethodName: "OpenWallet",
Handler: _WalletLoaderService_OpenWallet_Handler,
},
{
MethodName: "CloseWallet",
Handler: _WalletLoaderService_CloseWallet_Handler,
},
{
MethodName: "StartBtcdRpc",
Handler: _WalletLoaderService_StartBtcdRpc_Handler,
},
},
Streams: []grpc.StreamDesc{},
}