mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Added new RPC command for getting balance of wallet address * small details * Regenerate protobuffs * fixes * routing fix * Add 'Message' suffix to GetBalanceByAddressRequest and GetBalanceByAddressResponse * Add Message * linting * linting * fixed name Co-authored-by: Mike Zak <feanorr@gmail.com> Co-authored-by: Ori Newman <> Co-authored-by: Ori Newman <orinewman1@gmail.com> Co-authored-by: Michael Sutton <mikisiton2@gmail.com>
42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package appmessage
|
|
|
|
// GetBalanceByAddressRequestMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetBalanceByAddressRequestMessage struct {
|
|
baseMessage
|
|
Address string
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetBalanceByAddressRequestMessage) Command() MessageCommand {
|
|
return CmdGetBalanceByAddressRequestMessage
|
|
}
|
|
|
|
// NewGetBalanceByAddressRequest returns a instance of the message
|
|
func NewGetBalanceByAddressRequest(address string) *GetBalanceByAddressRequestMessage {
|
|
return &GetBalanceByAddressRequestMessage{
|
|
Address: address,
|
|
}
|
|
}
|
|
|
|
// GetBalanceByAddressResponseMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetBalanceByAddressResponseMessage struct {
|
|
baseMessage
|
|
Balance uint64
|
|
|
|
Error *RPCError
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetBalanceByAddressResponseMessage) Command() MessageCommand {
|
|
return CmdGetBalanceByAddressResponseMessage
|
|
}
|
|
|
|
// NewGetBalanceByAddressResponse returns an instance of the message
|
|
func NewGetBalanceByAddressResponse(Balance uint64) *GetBalanceByAddressResponseMessage {
|
|
return &GetBalanceByAddressResponseMessage{
|
|
Balance: Balance,
|
|
}
|
|
}
|