Documentation
¶
Index ¶
- Constants
- func Encode(pd PlutusData) ([]byte, error)
- type ByteString
- type Constr
- type Integer
- type List
- type Map
- type PlutusData
- func Decode(b []byte) (PlutusData, error)
- func NewByteString(value []byte) PlutusData
- func NewConstr(tag uint, fields ...PlutusData) PlutusData
- func NewConstrDefIndef(useIndef bool, tag uint, fields ...PlutusData) PlutusData
- func NewInteger(value *big.Int) PlutusData
- func NewList(items ...PlutusData) PlutusData
- func NewListDefIndef(useIndef bool, items ...PlutusData) PlutusData
- func NewMap(pairs [][2]PlutusData) PlutusData
- func NewMapDefIndef(useIndef bool, pairs [][2]PlutusData) PlutusData
- type PlutusDataWrapper
- type RawMessageStr
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode(pd PlutusData) ([]byte, error)
Encode encodes a PlutusData value into CBOR bytes.
Types ¶
type ByteString ¶
type ByteString struct {
Inner []byte
}
func (ByteString) Clone ¶ added in v0.0.13
func (b ByteString) Clone() PlutusData
func (ByteString) Equal ¶ added in v0.0.13
func (b ByteString) Equal(pd PlutusData) bool
func (ByteString) String ¶
func (b ByteString) String() string
type Constr ¶
type Constr struct { Tag uint Fields []PlutusData // contains filtered or unexported fields }
func (Constr) Clone ¶ added in v0.0.13
func (c Constr) Clone() PlutusData
func (Constr) Equal ¶ added in v0.0.13
func (c Constr) Equal(pd PlutusData) bool
type Integer ¶
func (Integer) Clone ¶ added in v0.0.13
func (i Integer) Clone() PlutusData
func (Integer) Equal ¶ added in v0.0.13
func (i Integer) Equal(pd PlutusData) bool
type List ¶
type List struct { Items []PlutusData // contains filtered or unexported fields }
func (List) Clone ¶ added in v0.0.13
func (l List) Clone() PlutusData
func (List) Equal ¶ added in v0.0.13
func (l List) Equal(pd PlutusData) bool
type Map ¶
type Map struct { Pairs [][2]PlutusData // Each pair is [key, value] // contains filtered or unexported fields }
func (Map) Clone ¶ added in v0.0.13
func (m Map) Clone() PlutusData
func (Map) Equal ¶ added in v0.0.13
func (m Map) Equal(pd PlutusData) bool
type PlutusData ¶
type PlutusData interface { Clone() PlutusData Equal(PlutusData) bool fmt.Stringer // contains filtered or unexported methods }
func Decode ¶
func Decode(b []byte) (PlutusData, error)
Decode decodes a CBOR-encoded byte slice into a PlutusData value. It returns an error if the input is invalid or not a valid PlutusData encoding.
func NewByteString ¶
func NewByteString(value []byte) PlutusData
NewByteString creates a new ByteString variant.
func NewConstr ¶
func NewConstr(tag uint, fields ...PlutusData) PlutusData
NewConstr creates a new Constr variant.
func NewConstrDefIndef ¶ added in v0.0.8
func NewConstrDefIndef(useIndef bool, tag uint, fields ...PlutusData) PlutusData
NewConstrDefIndef creates a Constr with the ability to specify whether it should use definite- or indefinite-length encoding
func NewInteger ¶
func NewInteger(value *big.Int) PlutusData
NewInteger creates a new Integer variant.
func NewListDefIndef ¶ added in v0.0.8
func NewListDefIndef(useIndef bool, items ...PlutusData) PlutusData
NewListDefIndef creates a list with the ability to specify whether it should use definite- or indefinite-length encoding
func NewMapDefIndef ¶ added in v0.0.11
func NewMapDefIndef(useIndef bool, pairs [][2]PlutusData) PlutusData
NewMapDefIndef creates a new Map with the ability to specify whether it should use definite- or indefinite-length encoding
type PlutusDataWrapper ¶
type PlutusDataWrapper struct {
Data PlutusData
}
func (*PlutusDataWrapper) MarshalCBOR ¶
func (p *PlutusDataWrapper) MarshalCBOR() ([]byte, error)
func (*PlutusDataWrapper) UnmarshalCBOR ¶
func (p *PlutusDataWrapper) UnmarshalCBOR(data []byte) error
type RawMessageStr ¶ added in v0.0.6
type RawMessageStr string
RawMessageStr is a hashable variant of cbor.RawMessage
func (RawMessageStr) Bytes ¶ added in v0.0.6
func (r RawMessageStr) Bytes() []byte
func (RawMessageStr) MarshalCBOR ¶ added in v0.0.6
func (r RawMessageStr) MarshalCBOR() ([]byte, error)
func (*RawMessageStr) UnmarshalCBOR ¶ added in v0.0.6
func (r *RawMessageStr) UnmarshalCBOR(data []byte) error