Documentation ¶
Index ¶
- Constants
- func MsgTxFromBytes(data []byte) (*wire.MsgTx, error)
- func MsgTxToBytes(tx *wire.MsgTx) []byte
- func MsgTxToHex(tx *wire.MsgTx) string
- type HtlcCovenant
- func NewCovenant(senderPkh, recipientPkh, hashLock []byte, expiration, penaltyBPS uint16, ...) (*HtlcCovenant, error)
- func NewMainnetCovenant(senderPkh, recipientPkh, hashLock []byte, expiration, penaltyBPS uint16) (*HtlcCovenant, error)
- func NewTestnet3Covenant(senderPkh, recipientPkh, hashLock []byte, expiration, penaltyBPS uint16) (*HtlcCovenant, error)
- func (c *HtlcCovenant) BuildFullRedeemScript() ([]byte, error)
- func (c *HtlcCovenant) BuildOpRetPkScript(sbchUserAddr []byte) ([]byte, error)
- func (c *HtlcCovenant) BuildReceiveSigScript(secret []byte) ([]byte, error)
- func (c *HtlcCovenant) BuildRefundSigScript() ([]byte, error)
- func (c *HtlcCovenant) GetP2SHAddress() (string, error)
- func (c *HtlcCovenant) GetRedeemScriptHash() ([]byte, error)
- func (c *HtlcCovenant) MakeLockTx(fromKey *bchec.PrivateKey, inputs []InputInfo, outAmt int64, ...) (*wire.MsgTx, error)
- func (c *HtlcCovenant) MakeReceiveTx(txid []byte, vout uint32, inAmt int64, minerFeeRate uint64, secret []byte) (*wire.MsgTx, error)
- func (c *HtlcCovenant) MakeRefundTx(txid []byte, vout uint32, inAmt int64, minerFeeRate uint64) (*wire.MsgTx, error)
- func (c *HtlcCovenant) String() string
- type HtlcLockInfo
- type HtlcUnlockInfo
- type InputInfo
Constants ¶
View Source
const ( // cashc --hex ../atomic-swap-covenants/covenants/HTLC4.cash RedeemScriptWithoutConstructorArgsHex = "" /* 260-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func MsgTxToBytes ¶
func MsgTxToHex ¶
Types ¶
type HtlcCovenant ¶
type HtlcCovenant struct {
// contains filtered or unexported fields
}
func NewCovenant ¶
func NewMainnetCovenant ¶
func NewMainnetCovenant( senderPkh, recipientPkh, hashLock []byte, expiration, penaltyBPS uint16, ) (*HtlcCovenant, error)
func NewTestnet3Covenant ¶
func NewTestnet3Covenant( senderPkh, recipientPkh, hashLock []byte, expiration, penaltyBPS uint16, ) (*HtlcCovenant, error)
func (*HtlcCovenant) BuildFullRedeemScript ¶
func (c *HtlcCovenant) BuildFullRedeemScript() ([]byte, error)
func (*HtlcCovenant) BuildOpRetPkScript ¶ added in v0.1.0
func (c *HtlcCovenant) BuildOpRetPkScript(sbchUserAddr []byte) ([]byte, error)
OP_RETURN "SBAS" <recipient pkh> <sender pkh> <hash lock> <expiration> <penalty bps> <sbch user address>
func (*HtlcCovenant) BuildReceiveSigScript ¶
func (c *HtlcCovenant) BuildReceiveSigScript(secret []byte) ([]byte, error)
func (*HtlcCovenant) BuildRefundSigScript ¶
func (c *HtlcCovenant) BuildRefundSigScript() ([]byte, error)
func (*HtlcCovenant) GetP2SHAddress ¶
func (c *HtlcCovenant) GetP2SHAddress() (string, error)
func (*HtlcCovenant) GetRedeemScriptHash ¶
func (c *HtlcCovenant) GetRedeemScriptHash() ([]byte, error)
func (*HtlcCovenant) MakeLockTx ¶
func (c *HtlcCovenant) MakeLockTx( fromKey *bchec.PrivateKey, inputs []InputInfo, outAmt int64, minerFeeRate uint64, ) (*wire.MsgTx, error)
func (*HtlcCovenant) MakeReceiveTx ¶
func (*HtlcCovenant) MakeRefundTx ¶
func (*HtlcCovenant) String ¶
func (c *HtlcCovenant) String() string
type HtlcLockInfo ¶ added in v0.1.0
type HtlcLockInfo struct { //BlockNum uint64 TxHash string // 32 bytes, hex RecipientPkh hexutil.Bytes // 20 bytes SenderPkh hexutil.Bytes // 20 bytes HashLock hexutil.Bytes // 32 bytes, sha256 Expiration uint16 // 2 bytes, big endian PenaltyBPS uint16 // 2 bytes, big endian SenderEvmAddr hexutil.Bytes // 20 bytes ScriptHash hexutil.Bytes // 20 bytes, hash160 Value uint64 // in sats }
func GetHtlcLocksInfo ¶ added in v0.1.0
func GetHtlcLocksInfo(block *wire.MsgBlock) (deposits []*HtlcLockInfo)
type HtlcUnlockInfo ¶ added in v0.1.0
type HtlcUnlockInfo struct { PrevTxHash string // 32 bytes, hex TxHash string // 32 bytes, hex Secret string // 32 bytes, hex }
func GetHtlcUnlocksInfo ¶ added in v0.1.0
func GetHtlcUnlocksInfo(block *wire.MsgBlock) (receipts []*HtlcUnlockInfo)
Click to show internal directories.
Click to hide internal directories.