util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EthCurrency     = "0x0000000000000000000000000000000000000000"
	DefaultMetadata = "0x0000000000000000000000000000000000000000000000000000000000000000"
	MaxInputs       = 4
	MaxOutputs      = 4
)

Variables

This section is empty.

Functions

func BuildRLPDeposit

func BuildRLPDeposit(address, currency common.Address, value, txtype uint64) ([]byte, error)

func ConvertStringToInt

func ConvertStringToInt(value string) int

func DeriveAddress

func DeriveAddress(p string) string

Derive Address from Private Key

func FilterZeroX

func FilterZeroX(item string) string

Filter our key string with 0x

func GenerateAccount

func GenerateAccount() (string, string, error)

Generate Account - Public and Privatekey

func LogFormatter

func LogFormatter()

Add the full time include timezone into log messages INFO[2019-01-31T16:38:57+07:00]

func RemoveLeadingZeroX

func RemoveLeadingZeroX(item string) string

Make strings suitable for hex encoding

func SendChChReq

func SendChChReq(
	chchRequest ChChRequester,
	chchClient string,
	method string,
	postData interface{},
) ([]byte, error)

func SignHash

func SignHash(hashed []byte, privateKeys []string) ([][]byte, error)

sign an already hashed tx bytes

func ValidateHex

func ValidateHex(x string) error

ValidateHex verifies that the hexadecimal string is valid

Types

type ChChRequester

type ChChRequester interface {
	Do(req *http.Request) (*http.Response, error)
}

type DepositOutput

type DepositOutput struct {
	OutputType uint64
	OutputData OutputData
}

type DepositTransaction

type DepositTransaction struct {
	OutputType  uint
	UTXOInputs  []interface{}
	UTXOOutputs []interface{}
	TxData      uint
	MetaData    common.Hash
}

deposit parent for ALD

type InputDeposit

type InputDeposit struct {
	Txindex uint `json:"txindex"`
	Oindex  uint `json:"oindex"`
	Blknum  uint `json:"blknum"`
}

type OutputData

type OutputData struct {
	OutputGuard common.Address
	Token       common.Address
	Amount      uint64
}

Jump to

Keyboard shortcuts

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