paych

package
v1.21.0-rpc-p02 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0, MIT Imports: 53 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCodes added in v1.20.0

func AllCodes() []cid.Cid

func DecodeSignedVoucher added in v0.9.0

func DecodeSignedVoucher(s string) (*paychtypes.SignedVoucher, error)

DecodeSignedVoucher decodes base64 encoded signed voucher.

Types

type LaneState

type LaneState interface {
	Redeemed() (big.Int, error)
	Nonce() (uint64, error)
}

LaneState is an abstract copy of the state of a single lane

type MessageBuilder added in v0.9.0

type MessageBuilder interface {
	Create(to address.Address, initialAmount abi.TokenAmount) (*types.Message, error)
	Update(paych address.Address, voucher *paychtypes.SignedVoucher, secret []byte) (*types.Message, error)
	Settle(paych address.Address) (*types.Message, error)
	Collect(paych address.Address) (*types.Message, error)
}

func Message added in v0.9.0

func Message(version actorstypes.Version, from address.Address) MessageBuilder

type State

type State interface {
	cbor.Marshaler

	Code() cid.Cid
	ActorKey() string
	ActorVersion() actorstypes.Version

	// Channel owner, who has funded the actor
	From() (address.Address, error)
	// Recipient of payouts from channel
	To() (address.Address, error)

	// Height at which the channel can be `Collected`
	SettlingAt() (abi.ChainEpoch, error)

	// Amount successfully redeemed through the payment channel, paid out on `Collect()`
	ToSend() (abi.TokenAmount, error)

	// Get total number of lanes
	LaneCount() (uint64, error)

	// Iterate lane states
	ForEachLaneState(cb func(idx uint64, dl LaneState) error) error

	GetState() interface{}
}

State is an abstract version of payment channel state that works across versions

func Load

func Load(store adt.Store, act *types.Actor) (State, error)

Load returns an abstract copy of payment channel state, irregardless of actor version

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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