Asset

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset[V int64 | uint64] map[AssetName.AssetName]V

func (Asset[V]) Add

func (ma Asset[V]) Add(other Asset[V]) Asset[V]

*

Add adds another Asset map to the current Asset map.

Params:
	other (Asset[V]): The Asset map to add to the current Asset map.

Returns:
	Asset[V]: The resulting Asset map after addition.

func (Asset[V]) Clone

func (ma Asset[V]) Clone() Asset[V]

*

Clone creates a deep copy of an Asset map.

Returns:
	Asset[V]: A deep copy of the original Asset map.

func (Asset[V]) Equal

func (ma Asset[V]) Equal(other Asset[V]) bool

*

Equal checks if two Asset maps are equal using
the function DeepEuqal from the package "reflect".

Parameters:
	other (Asset[V]): The other Asset map to compare to.

Returns:
  	bool: true if the two Asset maps are equal, false otherwise.

func (Asset[V]) Greater

func (ma Asset[V]) Greater(other Asset[V]) bool

*

Greater function checks if the current Asset map is greater than
another Asset map.

Parameters:
	other (Asset[V]): The other Asset map to compare to.

Returns:

bool: true if the current Asset map is greater than the other, false otherwise.

func (Asset[V]) Inverted

func (ma Asset[V]) Inverted() Asset[V]

*

Inverted creates a copy of an Asset map containing opposite amounts
of the original one.

Returns:
	Asset[V]: An inverted copy of the original Asset map.

func (Asset[V]) IsEmpty added in v1.6.0

func (a Asset[V]) IsEmpty() bool

IsEmpty returns true if the Asset is nil or empty. This method is used by the CBOR library to determine if the field should be omitted when using the "omitempty" tag.

func (Asset[V]) Less

func (ma Asset[V]) Less(other Asset[V]) bool

*

Less function checks if the current Asset map is less than
another Asset map.

Parameters:
	other (Asset[V]): The other Asset map to compare to.

Returns:

bool: true if the current Asset map is less than the other, false otherwise.

func (Asset[V]) MarshalCBOR added in v1.6.0

func (a Asset[V]) MarshalCBOR() ([]byte, error)

MarshalCBOR serializes the Asset to CBOR format with deterministic key ordering. Asset names are sorted lexicographically by their byte representation.

func (Asset[V]) Sub

func (ma Asset[V]) Sub(other Asset[V]) Asset[V]

*

Sub subtracts another Asset map from the current Asset map.

Params:
	other (Asset[V]): The Asset map to subtract from the current Asset map.

Returns:
	Asset[V]: The resulting Asset map after subtraction.

Jump to

Keyboard shortcuts

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