lbry

package
v0.0.0-...-5e84716 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidateSignatures bool

ValidateSignatures determines if signatures should be validated or not ( not used yet)

Functions

func Init

func Init(conf *env.Config)

Init initializes the configuration of the LBRY clients and allows for mock clients for testing

func ValidateSignatureAndTS

func ValidateSignatureAndTS(channelClaimID, signature, signingTS, data string) error

ValidateSignatureAndTS validates the signature was signed by the channel reference.

func ValidateSignatureAndTSForClaim

func ValidateSignatureAndTSForClaim(channelClaimID, claimID, signature, signingTS, data string) error

ValidateSignatureAndTSForClaim validates the signature was signed by the channel reference for a particular claim id.

func ValidateSignatureFromClaim

func ValidateSignatureFromClaim(channel *jsonrpc.Claim, signature, signingTS, data string) error

ValidateSignatureFromClaim validates the signature was signed by the channel reference.

func ValidateSignatureNoTSLimit

func ValidateSignatureNoTSLimit(channelClaimID, signature, signingTS, data string) error

ValidateSignatureNoTSLimit validates the signature was signed by the channel reference.

Types

type APIClient

type APIClient interface {
	Notify(NotifyOptions)
	CheckPerk(CheckPerkOptions) (bool, error)
}

APIClient is the interface type for internal-api calls

var API APIClient

API is the API entrypoint for internal-api calls

type Channel

type Channel struct {
	Name              string `json:"name"`
	ChannelID         string `json:"channel_id"`
	HoldingAddress    string `json:"holding_address"`
	HoldingPublicKey  string `json:"holding_public_key"`
	SigningPrivateKey string `json:"signing_private_key"`
}

Channel structure representing an exported LBRY channel

func ImportChannel

func ImportChannel(serializedChannel string) *Channel

ImportChannel creates a Channel representation from the serialization

func (*Channel) Claim

func (l *Channel) Claim() (*jsonrpc.Claim, error)

Claim will return the metadata for the channel.

func (*Channel) Keys

func (l *Channel) Keys() (*btcec.PrivateKey, *btcec.PublicKey)

Keys will return the private and public key of a channel

func (*Channel) Sign

func (l *Channel) Sign(data []byte) (string, string, error)

Sign will sign the data with the channels private key returning the signature and a timestamp it was signed. This is used in the signature itself so it is required input to verify the signature. This ensures someone cannot fudge a timestamp of a signature and allows for expiration times of signatures.

type CheckPerkOptions

type CheckPerkOptions struct {
	ChannelClaimID string
	ClaimID        string
	Type           string
	Environment    *string
}

CheckPerkOptions Are the options used to construct the permission lookup request.

type CheckPerkResponse

type CheckPerkResponse struct {
	Success bool        `json:"success"`
	Error   interface{} `json:"error"`
	Data    struct {
		HasAccess bool `json:"has_access"`
	} `json:"data"`
}

CheckPerkResponse is the response structure from internal-apis for the comment event api

type CommentResponse

type CommentResponse struct {
	Success bool        `json:"success"`
	Error   interface{} `json:"error"`
	Data    string      `json:"data"`
}

CommentResponse is the response structure from internal-apis for the comment event api

type NotifyOptions

type NotifyOptions struct {
	ActionType  string
	CommentID   string
	ChannelID   *string
	ParentID    *string
	Comment     *string
	ClaimID     string
	Amount      uint64
	IsFiat      bool
	Currency    *string
	IsProtected bool
}

NotifyOptions Are the options used to construct the comment event api signature.

type SDKClient

type SDKClient interface {
	GetTx(txid string) (*jsonrpc.TransactionSummary, error)
	GetClaim(claimID string) (*jsonrpc.Claim, error)
	GetSigningChannelForClaim(claimID string) (*jsonrpc.Claim, error)
}

SDKClient is the interface type for SDK call

var SDK SDKClient

SDK is the API entrypoint for LBRYSDK calls

Jump to

Keyboard shortcuts

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