Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayOffer ¶
type PayOffer struct { // Currency ID is the currency of this payment offer. CurrencyID byte // Src Addr is the source address of this proxy payment also who creates this offer. SrcAddr string // Dest Addr is the destination address of this proxy payment. DestAddr string // PPP stands for payment per period, is the surcharge of this proxy payment. PPP *big.Int // Period is the payment interval. Period *big.Int // Amt is the maximum amount covered by this pay offer. Amt *big.Int // Expiration is the expiration time of this offer if not being used. Expiration time.Time // Inactivity is the inactivity time allowed by this offer every time after it is being used. Inactivity time.Duration // ResTo is the reserved next recipient. ResTo string // ResCh is the reservation channel. ResCh string // ResID is the reservation id. ResID uint64 // Nonce is the nonce of the payment offer. Nonce uint64 // SignatureType is the signature type of the signature. SignatureType byte // Signature is the signature over the offer by Src Addr. Signature []byte }
PayOffer represents an offer for a proxy payment.
func (*PayOffer) AddSignature ¶
AddSignature adds a signature to the payment offer.
@input - signature type, signature.
func (*PayOffer) Decode ¶
Decode decodes a payment offer data bytes.
@input - data.
@output - error.
func (PayOffer) GetToBeSigned ¶
GetToBeSigned gets the data to be signed of this payment offer.
@output - data to be signed, error.
type PaychOffer ¶
type PaychOffer struct { // Currency ID is the currency of this paych offer. CurrencyID byte // From Addr is the offer recipient address and also the sender of future payment channels. FromAddr string // To Addr is the source address of this offer and who creates this offer. ToAddr string // Settlement is the offered minimum settlement time. Settlement time.Time // Expiration is the expiration time of this offer. Expiration time.Time // Nonce is the nonce of the offer. Nonce uint64 // SignatureType is the signature type. SignatureType byte // Signature is the signature over the offer by Src Addr. Signature []byte }
PaychOffer represents an offer for a paych add request.
func (*PaychOffer) AddSignature ¶
func (o *PaychOffer) AddSignature(sigType byte, signature []byte)
AddSignature adds a signature to the offer.
@input - signature type, signature.
func (*PaychOffer) Decode ¶
func (o *PaychOffer) Decode(data []byte) error
Decode decodes a offer data bytes.
@input - data.
@output - error.
func (PaychOffer) Encode ¶
func (o PaychOffer) Encode() ([]byte, error)
Encode encodes the offer.
@output - data, error.
func (PaychOffer) GetToBeSigned ¶
func (o PaychOffer) GetToBeSigned() ([]byte, error)
GetToBeSigned gets the data to be signed of this offer.
@output - data to be signed, error.
type PieceOffer ¶
type PieceOffer struct { // ID is the root id of the ipld graph of this piece. ID cid.Cid // Size is the size of the piece. Size uint64 // Currency ID the currency of this piece offer. CurrencyID byte // PPB stands for payment per byte, is the price of the retireval. PPB *big.Int // Recipient Addr is the payment recipient address also who creates this offer. RecipientAddr string // LinkedMinerKeyType is the key type of the linked miner (optional). LinkedMinerKeyType byte // LinkedMinerAddr is the address of the linked miner (optional). LinkedMinerAddr string // LinkedMinerProof is the proof provided by the linked miner or a signature of miner on recipient address (optional). LinkedMinerProof []byte // Expiration is the expiration time of this offer if not being used. Expiration time.Time // Inactivity is the inactivity time allowed by this offer every time after it is being used. Inactivity time.Duration // Nonce is the nonce of the payment offer. Nonce uint64 // SignatureType is the signature type of the signature. SignatureType byte // Signature is the signature over the offer by Recipient Addr. Signature []byte }
PieceOffer represents an offer for a piece retrieval.
func (*PieceOffer) AddSignature ¶
func (o *PieceOffer) AddSignature(sigType byte, signature []byte)
AddSignature adds a signature to the piece offer.
@input - signature type, signature.
func (*PieceOffer) Decode ¶
func (o *PieceOffer) Decode(data []byte) error
Decode decodes a piece offer data bytes.
@input - data.
@output - error.
func (PieceOffer) Encode ¶
func (o PieceOffer) Encode() ([]byte, error)
Encode encodes the piece offer.
@output - data, error.
func (PieceOffer) GetToBeSigned ¶
func (o PieceOffer) GetToBeSigned() ([]byte, error)
GetToBeSigned gets the data to be signed of this piece offer.
@output - data to be signed, error.