types

package
v0.0.0-...-7bd1b19 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Asset = &asset{}

Asset is the unique asset that is supported by the chain.

View Source
var MaxBalance = new(big.Int).SetUint64(math.MaxUint64)

Functions

This section is empty.

Types

type Balance

type Balance = uint64

func MakeAlloc

func MakeAlloc(a channel.Allocation) ([]Balance, error)

func MakeBalance

func MakeBalance(balance big.Int) (Balance, error)

type ChannelDatum

type ChannelDatum struct {
	ChannelParameters ChannelParameters
	ChannelToken      ChannelToken
	ChannelState      ChannelState
	Time              time.Time
	FundingBalances   []Balance
	Funded            bool
	Disputed          bool
}

ChannelDatum is the perun-cardano-backend's representation of an on-chain datum.

type ChannelParameters

type ChannelParameters struct {
	Parties []address.Address
	Nonce   channel.Nonce
	Timeout time.Duration
}

ChannelParameters is the cardano backend equivalent to go-perun's channel.Params.

func MakeChannelParameters

func MakeChannelParameters(params channel.Params) (ChannelParameters, error)

MakeChannelParameters constructs ChannelParameters from a go-perun channel.Params.

func (ChannelParameters) Equal

func (cp ChannelParameters) Equal(other ChannelParameters) bool

type ChannelState

type ChannelState struct {
	ID       ID
	Balances []Balance
	Version  Version
	Final    bool
}

ChannelState is the cardano backend equivalent to go-perun's channel.State.

func ConvertChannelState

func ConvertChannelState(state channel.State) (ChannelState, error)

ConvertChannelState converts a go-perun channel.State to a ChannelState.

func MakeChannelState

func MakeChannelState(id channel.ID, balances []uint64, version uint64, final bool) ChannelState

func (ChannelState) Equal

func (cs ChannelState) Equal(other ChannelState) bool

type ChannelStateSigningAccount

type ChannelStateSigningAccount interface {
	wallet.Account
	SignChannelState(state ChannelState) (wallet.Sig, error)
}

type ChannelToken

type ChannelToken struct {
	TokenSymbol string
	TokenName   string
	TxOutRef    TxOutRef
}

ChannelToken is the backends representation of our channel's on-chain ThreadToken NFT. It is used to establish channel uniqueness and to identify the channel on-chain.

type DecodeEventError

type DecodeEventError struct {
	Tag         string
	ExpectedLen int
	ActualLen   int
}

func NewDecodeEventError

func NewDecodeEventError(tag string, expectedLen int, actualLen int) *DecodeEventError

func (DecodeEventError) Error

func (e DecodeEventError) Error() string

type ExtendedWalletBackend

type ExtendedWalletBackend interface {
	wallet.Backend
	VerifyChannelStateSignature(state ChannelState, sig wallet.Sig, a wallet.Address) (bool, error)
	CalculateChannelID(parameters ChannelParameters) (pchannel.ID, error)
	ToChannelStateSigningAccount(account wallet.Account) (ChannelStateSigningAccount, error)
}

type ID

type ID = channel.ID

type TxOutRef

type TxOutRef struct {
	TxID  string
	Index int
}

type Version

type Version = uint64

Jump to

Keyboard shortcuts

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