Documentation ¶
Index ¶
- Constants
- func IsValidPaymentType(paymentType string) bool
- type DigibyteClient
- type DigibyteClientRPC
- func (rpcClient *DigibyteClientRPC) GetBlock(ctx context.Context, height int64) (*btcjson.GetBlockVerboseResult, error)
- func (rpcClient *DigibyteClientRPC) GetBlockByHash(ctx context.Context, hash string) (*btcjson.GetBlockVerboseResult, error)
- func (rpcClient *DigibyteClientRPC) GetBlockByHashWithTransaction(ctx context.Context, hash string) (*btcjson.GetBlockVerboseTxResult, error)
- func (rpcClient *DigibyteClientRPC) GetConfig() *configuration.Config
- func (rpcClient *DigibyteClientRPC) GetLatestBlock(ctx context.Context) (*wire.MsgBlock, error)
- func (rpcClient *DigibyteClientRPC) GetStatus(ctx context.Context) (*btcjson.GetBlockChainInfoResult, error)
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 ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.