walletrpc

package
v0.0.0-...-30b4a77 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package walletrpc implements calls to the walletserver

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientFactory = jsonclient.New

DefaultClientFactory is the default factory for new clients

View Source
var (
	// ErrParams is returned if a call returned bad parameters
	ErrParams = errors.New("walletrpc: bad RPC parameters")
)

ServiceURL is the default URL for the wallet service

Functions

This section is empty.

Types

type WalletClient

type WalletClient struct {
	ClientFactory   func(string, []byte) (*jsonclient.URLClient, error)
	ServiceGuardCA  []byte                        // The CA of the serviceguard, if any
	PubKey          *[ed25519.PublicKeySize]byte  // Public key of client
	PrivKey         *[ed25519.PrivateKeySize]byte // Private key of PrivKey
	LastAuthCounter uint64                        // Last authentication counter
	LastAuthToken   []byte                        // Last authtoken used, required for call caching
}

WalletClient implements a wallet service client

func New

func New(pubKey *[ed25519.PublicKeySize]byte, PrivKey *[ed25519.PrivateKeySize]byte, cacert []byte) *WalletClient

New returns a new walletservice client

func (*WalletClient) GetBalance

func (wc *WalletClient) GetBalance() (SubscriptionTokens, PrepayTokens, LastSubscribeLoad uint64, err error)

GetBalance inquires the wallet service for the client's balance. It tries to escape replay errors.

func (*WalletClient) GetToken

func (wc *WalletClient) GetToken(usage string) (token, params, pubKeyUsed []byte, err error)

GetToken gets a token for usage from the wallet service.

Jump to

Keyboard shortcuts

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