model

package
v0.0.0-...-516dd05 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetArea

func AssetArea(value, pa, tv felt.Felt) uint64

value * (project_area * haInM2) / total_value

func AssetCarbonUnit

func AssetCarbonUnit(value, pcu, tv felt.Felt) uint64

value * (project_carbon_unit * tonInG) / total_value;

func FormatArea

func FormatArea(area uint64) string

func FormatCapacity

func FormatCapacity(capacity uint64) string

func ProjectTotalValue

func ProjectTotalValue(ctx context.Context, rpc rpc.RpcProvider, c sdk.Contract, slot *felt.Felt) (felt.Felt, error)

ProjectTotalValue returns the total value of a project.

Types

type Attribute

type Attribute struct {
	Value     interface{} `json:"value"`
	TraitType string      `json:"trait_type"`
}

type DisplayableValue

type DisplayableValue struct {
	Type             DisplayableValueType `json:"type"`
	DisplayableValue string               `json:"displayable_value"`
	Value            ValueItem            `json:"value"`
	// contains filtered or unexported fields
}

func NewDisplayableValue

func NewDisplayableValue(value felt.Felt, decimals int, vt DisplayableValueType) (DisplayableValue, error)

func (*DisplayableValue) Add

func (*DisplayableValue) Div

func (*DisplayableValue) Mul

func (*DisplayableValue) Sub

type DisplayableValueType

type DisplayableValueType string
const (
	SlotValue  DisplayableValueType = "slot_value"
	Erc20Value DisplayableValueType = "erc20"
	MassValue  DisplayableValueType = "mass"
)

type ProjectAbi

type ProjectAbi struct {
	Project json.RawMessage `json:"project"`
	Minter  json.RawMessage `json:"minter"`
}

type SlotUri

type SlotUri struct {
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	Image          string      `json:"image"`
	ExternalUrl    string      `json:"external_url"`
	BannerImageUrl string      `json:"banner_image_url"`
	YoutubeUrl     string      `json:"youtube_url"`
	Attributes     []Attribute `json:"attributes"`
}

func (SlotUri) AttributeItem

func (s SlotUri) AttributeItem(tt string) string

type ValueItem

type ValueItem struct {
	Symbol   string    `json:"symbol,omitempty"`
	Value    felt.Felt `json:"value"`
	Decimals int       `json:"value_decimals"`
}

Jump to

Keyboard shortcuts

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