Documentation ¶
Index ¶
- Constants
- func CheckIfProbabilityHit(secret [32]byte, salt [4]byte, probability int64) bool
- func GetProbabilityByRatio(prob float64) int64
- func GetProbabilityRatio(prob int64) float64
- type SpayCovenant
- func (c *SpayCovenant) BuildFullRedeemScript() ([]byte, error)
- func (c *SpayCovenant) BuildReceiveSigScript(recipientSig, recipientPk, secret []byte) ([]byte, error)
- func (c *SpayCovenant) BuildRefundSigScript(senderSig, senderPk []byte) ([]byte, error)
- func (c *SpayCovenant) GetP2SHAddress() (string, error)
- func (c *SpayCovenant) GetRedeemScriptHash() ([]byte, error)
- func (c *SpayCovenant) MakeReceiveTx(txid []byte, vout uint32, inAmt int64, toAddr bchutil.Address, minerFee int64, ...) (*wire.MsgTx, error)
- func (c *SpayCovenant) MakeRefundTx(txid []byte, vout uint32, inAmt int64, toAddr bchutil.Address, minerFee int64, ...) (*wire.MsgTx, error)
- func (c *SpayCovenant) MakeSPAYTx(fromKey *bchec.PrivateKey, txid []byte, vout uint32, inAmt int64, outAmt int64, ...) (*wire.MsgTx, error)
- func (c *SpayCovenant) String() string
Constants ¶
View Source
const (
RedeemScriptWithoutConstructorArgsHex = "" /* 162-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
func CheckIfProbabilityHit ¶
func GetProbabilityByRatio ¶
func GetProbabilityRatio ¶
Types ¶
type SpayCovenant ¶
type SpayCovenant struct {
// contains filtered or unexported fields
}
func NewCovenant ¶
func NewMainnetCovenant ¶
func NewMainnetCovenant( senderPkh, recipientPkh, hash [20]byte, salt [4]byte, expiration, probability int64, ) (*SpayCovenant, error)
func (*SpayCovenant) BuildFullRedeemScript ¶
func (c *SpayCovenant) BuildFullRedeemScript() ([]byte, error)
func (*SpayCovenant) BuildReceiveSigScript ¶
func (c *SpayCovenant) BuildReceiveSigScript(recipientSig, recipientPk, secret []byte) ([]byte, error)
func (*SpayCovenant) BuildRefundSigScript ¶
func (c *SpayCovenant) BuildRefundSigScript(senderSig, senderPk []byte) ([]byte, error)
func (*SpayCovenant) GetP2SHAddress ¶
func (c *SpayCovenant) GetP2SHAddress() (string, error)
func (*SpayCovenant) GetRedeemScriptHash ¶
func (c *SpayCovenant) GetRedeemScriptHash() ([]byte, error)
func (*SpayCovenant) MakeReceiveTx ¶
func (*SpayCovenant) MakeRefundTx ¶
func (*SpayCovenant) MakeSPAYTx ¶
func (*SpayCovenant) String ¶
func (c *SpayCovenant) String() string
Click to show internal directories.
Click to hide internal directories.