support

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PegAssetNames = []string{
	"pPNT",
	"pUSD",
	"pEUR",
	"pJPY",
	"pGBP",
	"pCAD",
	"pCHF",
	"pINR",
	"pSGD",
	"pCNY",
	"pHKD",
	"pXAU",
	"pXAG",
	"pXPD",
	"pXPT",
	"pXBT",
	"pETH",
	"pLTC",
	"pXBC",
	"pFCT",
}
View Source
var TestPegAssetNames = []string{
	"tPNT",
	"tUSD",
	"tEUR",
	"tJPY",
	"tGBP",
	"tCAD",
	"tCHF",
	"tINR",
	"tSGD",
	"tCNY",
	"tHKD",
	"tXAU",
	"tXAG",
	"tXPD",
	"tXPT",
	"tXBT",
	"tETH",
	"tLTC",
	"tXBC",
	"tFCT",
}

Functions

func CheckPrefix

func CheckPrefix(network NetworkType, name string) bool

CheckPrefix() Check the prefix for either network type.

func ComputeChainIDFromFields

func ComputeChainIDFromFields(fields [][]byte) []byte

ComputeChainIDFromFields Takes the binary fields that define a chainID and hashes them together to create the ChainID expected by the APIs. These fields are treated as binary, but could be simple text, like: "Bob's" "Favorite" "Chain"

func ComputeChainIDFromStrings

func ComputeChainIDFromStrings(fields []string) []byte

ComputeChainIDFromStrings Take a set of strings, and compute the chainID. If you have binary fields, you can call factom.ComputeChainIDFromFields directly.

func ConvertPegTAddrToRaw

func ConvertPegTAddrToRaw(network NetworkType, adr string) (prefix string, rawAdr []byte, err error)

ConvertPegTAddrToRaw() Convert a human/wallet address to the raw underlying address. Verifies the checksum and the validity of the prefix. Returns the prefix, the raw address, and error.

func ConvertRawAddrToPegT

func ConvertRawAddrToPegT(network NetworkType, prefix string, adr [32]byte) (string, error)

ConvertRawAddrToPegT() Converts a raw RCD1 address into a wallet friendly address that can be used to convert assets, check balances, and send tokens. While the underlying private key can be used to hold Factoids or any token in the PegNet, users need addresses that create a barrier to mistakes that can lead to sending the wrong tokens to the wrong addresses

func PegTAdrIsValid

func PegTAdrIsValid(network NetworkType, adr string) error

PegTAdrIsValid() Check that the given human/wallet PegNet address is valid.

func PullValue

func PullValue(line string, howMany int) string

func RandomByteSliceOfLen

func RandomByteSliceOfLen(sliceLen int) []byte

RandomByteSliceOfLen() Returns a random set of bytes of a given length

Types

type FactomdMonitor

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

FactomdMonitor Running multiple Monitors is problematic and should be avoided if possible

func (*FactomdMonitor) GetAlert

func (f *FactomdMonitor) GetAlert() chan common.FDStatus

func (*FactomdMonitor) GetBlockTime

func (f *FactomdMonitor) GetBlockTime() int64

GetBlockTime Returns the blocktime in seconds. All blocks are divided into 10 "minute" sections. But if the blocktime is not 600 seconds, then a minute = the blocktime/10

func (*FactomdMonitor) GetHighestSavedDBlock

func (f *FactomdMonitor) GetHighestSavedDBlock() int64

Returns the highest saved block

func (*FactomdMonitor) Start

func (f *FactomdMonitor) Start()

func (*FactomdMonitor) Stop

func (f *FactomdMonitor) Stop()

type NetworkType

type NetworkType int
const (
	MAIN_NETWORK NetworkType = iota + 1
	TEST_NETWORK
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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