client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Transfer      = "transfer"
	StatusSuccess = "success"
	StatusFail    = "fail"
	ActionTypeFee = "fee"
)
View Source
const (
	WITNESS_V0 = "witness_v0_keyhash"
	P2PKH      = "pubkeyhash"
	PUBKEY     = "pubkey"
)
View Source
const BASE_CURRENCY_DECIMAL_COUNT = 8
View Source
const BASE_CURRENCY_DECIMAL_DIVIDER = 100000000
View Source
const CURRENCY_SYMBOL = "DGB"

Variables

This section is empty.

Functions

func IsValidPaymentType

func IsValidPaymentType(paymentType string) bool

Types

type DigibyteClient

type DigibyteClient interface {
	// GetBlock returns the digibyte block at given height.
	GetBlock(ctx context.Context, height int64) (*btcjson.GetBlockVerboseResult, error)

	// GetBlock returns the Digibyte block with a given hash.
	GetBlockByHash(ctx context.Context, hash string) (*btcjson.GetBlockVerboseResult, error)

	// GetBlock returns the Digibyte block with a given hash.
	GetBlockByHashWithTransaction(ctx context.Context, hash string) (*btcjson.GetBlockVerboseTxResult, error)

	// GetLatestBlock returns the latest Digibyte block.
	GetLatestBlock(ctx context.Context) (*wire.MsgBlock, error)

	// GetStatus returns the status overview of the node.
	GetStatus(ctx context.Context) (*btcjson.GetBlockChainInfoResult, error)

	// GetConfig returns the config.
	GetConfig() *configuration.Config
}

DigibyteClient is the Digibyte blockchain client interface

func NewDigibyteClient

func NewDigibyteClient(applicationConfig *configuration.Config) (cli DigibyteClient)

NewDigibyteClient returns an implementation of DigibyteClient

type DigibyteClientRPC

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

DigibyteClientRPC is an implementation of DigibyteClient using RPC.

func (*DigibyteClientRPC) GetBlock

func (rpcClient *DigibyteClientRPC) GetBlock(ctx context.Context, height int64) (*btcjson.GetBlockVerboseResult, error)

GetBlock will return you the block specification for a given height

func (*DigibyteClientRPC) GetBlockByHash

func (rpcClient *DigibyteClientRPC) GetBlockByHash(ctx context.Context, hash string) (*btcjson.GetBlockVerboseResult, error)

GetBlockByHash will return you the block specification for a given height

func (*DigibyteClientRPC) GetBlockByHashWithTransaction

func (rpcClient *DigibyteClientRPC) GetBlockByHashWithTransaction(ctx context.Context, hash string) (*btcjson.GetBlockVerboseTxResult, error)

GetBlockByHashWithTransaction returns the Digibyte block including transactions

func (*DigibyteClientRPC) GetConfig

func (rpcClient *DigibyteClientRPC) GetConfig() *configuration.Config

GetConfig retrieves the general application config that has been configured

func (*DigibyteClientRPC) GetLatestBlock

func (rpcClient *DigibyteClientRPC) GetLatestBlock(ctx context.Context) (*wire.MsgBlock, error)

GetLatestBlock returns the latest Digibyte block.

func (*DigibyteClientRPC) GetStatus

func (rpcClient *DigibyteClientRPC) GetStatus(ctx context.Context) (*btcjson.GetBlockChainInfoResult, error)

GetStatus will return the Blockchain base info based on that node

Jump to

Keyboard shortcuts

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