plutusencoder

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 9 Imported by: 0

README

Plutus Struct tags:

plutusConstr: int -> Defines the constructor - for no constructor plutusType: Bytes || Int || Map || IndefList || DefList || StringBytes PredefinedPlutusTypes: Address

Sample

type Datum struct {
    _ struct `plutusType:IndefList plutusConstr:1`
    Pkh []byte `plutusType:Bytes`
    Amount int64 `plutusType:Int`
}

type NestedDatum struct {
     _ struct `plutusType:IndefList plutusConstr:1`
    Pkh []byte `plutusType:Bytes`
    Amount int64 `plutusType:Int`
    Extra Datum
}

Usage Marshaling

    d = Datum{...}

    plutusData, err := plutus.MarshalPlutus(d)

Unmarshaling

    plutusData = PlutusData.PlutusData{...}
    d = Datum{...}
    err := plutus.UnmarshalPlutus(d)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CborUnmarshal added in v1.0.6

func CborUnmarshal(data string, v interface{}, network byte) error

func DecodePlutusAddress added in v1.0.8

func DecodePlutusAddress(data PlutusData.PlutusData, network byte) Address.Address

func GetAddressPlutusData added in v1.0.8

func GetAddressPlutusData(address Address.Address) (*PlutusData.PlutusData, error)

func MarshalPlutus

func MarshalPlutus(v interface{}) (*PlutusData.PlutusData, error)

func UnmarshalPlutus

func UnmarshalPlutus(data *PlutusData.PlutusData, v interface{}, network byte) (ret error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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