htlcsbch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LockEventId   common.Hash
	UnlockEventId common.Hash
	RefundEventId common.Hash
)

Functions

func PackGetMarketMaker added in v0.1.0

func PackGetMarketMaker(addr common.Address) ([]byte, error)

func PackGetSwapState added in v0.1.0

func PackGetSwapState(hashLock common.Hash) ([]byte, error)

func PackOpen

func PackOpen(
	recipient common.Address,
	hashLock common.Hash,
	timeLock uint32,
	bchAddr common.Address,
) ([]byte, error)

func PackRefund added in v0.1.0

func PackRefund(hashLock common.Hash) ([]byte, error)

func PackUnlock added in v0.1.0

func PackUnlock(hashLock, secret common.Hash) ([]byte, error)

func UnpackGetSwapState added in v0.1.0

func UnpackGetSwapState(data []byte) (uint8, error)

Types

type LockLog added in v0.1.0

type LockLog struct {
	LockerAddr      common.Address
	UnlockerAddr    common.Address
	HashLock        common.Hash
	UnlockTime      uint64
	Value           *big.Int
	BchRecipientPkh common.Address
	CreatedTime     uint64
	PenaltyBPS      uint16
}

func ParseHtlcLockLog added in v0.1.0

func ParseHtlcLockLog(log types.Log) *LockLog

type MarketMakerInfo added in v0.1.0

type MarketMakerInfo struct {
	Addr         common.Address
	RetiredAt    uint64
	Intro        [32]byte
	BchPkh       [20]byte
	BchLockTime  uint16
	SbchLockTime uint32
	PenaltyBPS   uint16
	FeeBPS       uint16
	MinSwapAmt   *big.Int
	MaxSwapAmt   *big.Int
	StakedValue  *big.Int
	Checker      common.Address
	Unavailable  bool
}

func UnpackGetMarketMaker added in v0.1.0

func UnpackGetMarketMaker(data []byte) (*MarketMakerInfo, error)

type RefundLog added in v0.1.0

type RefundLog struct {
	TxHash   common.Hash
	HashLock common.Hash
}

func ParseHtlcRefundLog added in v0.1.0

func ParseHtlcRefundLog(log types.Log) *RefundLog

type UnlockLog added in v0.1.0

type UnlockLog struct {
	TxHash   common.Hash
	HashLock common.Hash
	Secret   common.Hash
}

func ParseHtlcUnlockLog added in v0.1.0

func ParseHtlcUnlockLog(log types.Log) *UnlockLog

Jump to

Keyboard shortcuts

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