litecoin

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2017 License: ISC Imports: 15 Imported by: 0

Documentation

Overview

Detect payment records in the Litecoin Block Chain

Payments are indicated by OP_RETURN embedded data, this is compressed to fit it within the 80 byte Litecoin limit.

The OP_RETURN(0x6a) data structure:

+---------------------------------------------------------------------------------+
|         1         2         3         4          5         6         7         8|
|123456789012345678901234567890123456789012345678 90123456789012345678901234567890|
+------------------------------------------------+--------------------------------+
|                                                |                                |
|     pay id                                     |                                |
|                                                |                                |
+------------------------------------------------+--------------------------------+
|             1         2         3         4    |         1         2         3  |
|123456789012345678901234567890123456789012345678|12345678901234567890123456789012|
+------------------------------------------------+--------------------------------+

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForPaymentTransaction added in v0.4.12

func CheckForPaymentTransaction(log *logger.L, tx *Transaction)

func Finalise

func Finalise() error

finalise - stop all background tasks also calls the internal finalisePayment()

func Initialise

func Initialise(configuration *Configuration) error

initialise for litecoin payments also calls the internal initialisePayment() and register()

Types

type Block

type Block struct {
	Hash              string        `json:"hash"`
	Confirmations     uint64        `json:"confirmations"`
	Height            uint64        `json:"height"`
	Tx                []Transaction `json:"tx"`
	Time              int64         `json:"time"`
	PreviousBlockHash string        `json:"previousblockhash"`
	NextBlockHash     string        `json:"nextblockhash"`
}

type BlockHeader

type BlockHeader struct {
	Hash              string `json:"hash"`
	Confirmations     uint64 `json:"confirmations"`
	Height            uint64 `json:"height"`
	Time              int64  `json:"time"`
	PreviousBlockHash string `json:"previousblockhash"`
	NextBlockHash     string `json:"nextblockhash"`
}

type Configuration

type Configuration struct {
	URL string `libucl:"url" json:"url"`
}

a block of configuration data this is read from a libucl configuration file

type ScriptPubKey

type ScriptPubKey struct {
	Hex       string   `json:"hex"`
	Addresses []string `json:"addresses"`
}

type Transaction

type Transaction struct {
	TxId string `json:"txid"`
	//Hash string `json:"hash"`
	//Vin  []Vin  `json:"vin"`
	Vout []Vout `json:"vout"`
}

type Vout

type Vout struct {
	Value        json.RawMessage `json:"value"`
	ScriptPubKey ScriptPubKey    `json:"scriptPubKey"`
}

Jump to

Keyboard shortcuts

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