Documentation ¶
Index ¶
- Constants
- Variables
- func ClaimIDFromOutpoint(txid string, nout int) (string, error)
- func DecodeAddress(addr string, defaultNet *chaincfg.Params) (lbcutil.Address, error)
- func GetClaimNamePayoutScript(name string, value []byte, address lbcutil.Address) ([]byte, error)
- func GetClaimSupportPayoutScript(name, claimid string, address lbcutil.Address) ([]byte, error)
- func GetUpdateClaimPayoutScript(name, claimid string, value []byte, address lbcutil.Address) ([]byte, error)
- func IsClaimNameScript(script []byte) bool
- func IsClaimUpdateScript(script []byte) bool
- func NewChannel() (*c.Helper, *btcec.PrivateKey, error)
- func NewImageStreamClaim() (*c.Helper, error)
- func NewStreamClaim(title, description string) (*c.Helper, error)
- func NewVideoStreamClaim() (*c.Helper, error)
- func ParseClaimNameScript(script []byte) (name string, value []byte, pubkeyscript []byte, err error)
- func ParseClaimUpdateScript(script []byte) (name string, claimid string, value []byte, pubkeyscript []byte, err error)
- func SignClaim(rawTx *wire.MsgTx, privKey btcec.PrivateKey, claim, channel *c.Helper, ...) error
- type Client
- func (c *Client) AddStakeToTx(rawTx *wire.MsgTx, claim *c.Helper, name string, claimAmount float64, ...) error
- func (c *Client) CreateBaseRawTx(inputs []btcjson.TransactionInput, change float64) (*wire.MsgTx, error)
- func (c *Client) CreateChannel(name string, amount float64) (*c.Helper, *btcec.PrivateKey, error)
- func (c *Client) GetEmptyTx(totalOutputSpend float64) (*wire.MsgTx, error)
- func (c *Client) SignTxAndSend(rawTx *wire.MsgTx) (*chainhash.Hash, error)
- func (c *Client) SimpleSend(toAddress string, amount float64) (*chainhash.Hash, error)
- func (c *Client) SupportClaim(name, claimID, address, blockchainName string, claimAmount float64) (*chainhash.Hash, error)
- type ScriptType
Constants ¶
const ( LbrycrdMain = "lbrycrd_main" LbrycrdTestnet = "lbrycrd_testnet" LbrycrdRegtest = "lbrycrd_regtest" )
const DefaultPort = 9245
Variables ¶
var ChainParamsMap = map[string]chaincfg.Params{LbrycrdMain: mainNetParams, LbrycrdTestnet: testNetParams, LbrycrdRegtest: regTestNetParams}
var GenesisHash = chainhash.Hash([chainhash.HashSize]byte{
0x9c, 0x89, 0x28, 0x3b, 0xa0, 0xf3, 0x22, 0x7f,
0x6c, 0x03, 0xb7, 0x02, 0x16, 0xb9, 0xf6, 0x65,
0xf0, 0x11, 0x8d, 0x5e, 0x0f, 0xa7, 0x29, 0xce,
0xdf, 0x4f, 0xb3, 0x4d, 0x6a, 0x34, 0xf4, 0x63,
})
var MainNetParams = chaincfg.Params{ PubKeyHashAddrID: 0x55, ScriptHashAddrID: 0x7a, PrivateKeyID: 0x1c, Bech32HRPSegwit: "lbc", GenesisHash: &GenesisHash, Name: "mainnet", Net: wire.BitcoinNet(0xfae4aaf1), DefaultPort: "9246", BIP0034Height: 1, BIP0065Height: 200000, BIP0066Height: 200000, }
MainNetParams define the lbrycrd network. See https://github.com/lbryio/lbrycrd/blob/master/src/chainparams.cpp
Functions ¶
func DecodeAddress ¶
DecodeAddress decodes the string encoding of an address and returns the Address if addr is a valid encoding for a known address type.
The bitcoin network the address is associated with is extracted if possible. When the address does not encode the network, such as in the case of a raw public key, the address will be associated with the passed defaultNet.
func IsClaimNameScript ¶
IsClaimNameScript returns true if the script for the vout contains the OP_CLAIM_NAME code.
func IsClaimUpdateScript ¶
IsClaimUpdateScript returns true if the script for the vout contains the OP_CLAIM_UPDATE code.
func NewChannel ¶
func NewChannel() (*c.Helper, *btcec.PrivateKey, error)
func NewImageStreamClaim ¶
func NewVideoStreamClaim ¶
func ParseClaimNameScript ¶
func ParseClaimNameScript(script []byte) (name string, value []byte, pubkeyscript []byte, err error)
ParseClaimNameScript parses a script for the claim of a name.
Types ¶
type Client ¶
Client connects to a lbrycrd instance
func NewWithDefaultURL ¶
func (*Client) AddStakeToTx ¶
func (*Client) CreateBaseRawTx ¶
func (*Client) CreateChannel ¶
func (*Client) GetEmptyTx ¶
func (*Client) SignTxAndSend ¶
func (*Client) SimpleSend ¶
SimpleSend is a convenience function to send credits to an address (0 min confirmations)
type ScriptType ¶
type ScriptType int
const ( ClaimName ScriptType = iota ClaimUpdate ClaimSupport )