Amount

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: 1 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlonzoAmount added in v1.0.3

type AlonzoAmount struct {
	Coin  int64
	Value MultiAsset.MultiAsset[int64]
	// contains filtered or unexported fields
}

func (AlonzoAmount) Clone added in v1.0.3

func (am AlonzoAmount) Clone() AlonzoAmount

*

Clone function creates a deep copy of an AlonzoAmount object.

Returns:
	AlonzoAmount: A deep copy of the AlonzoAmount.

func (AlonzoAmount) ToShelley added in v1.0.3

func (amtAl AlonzoAmount) ToShelley() Amount

*

ToShelley converts an AlonzoAmount to its Shelley representation
creating a new Amount object.

Params:
	amtAl (AlonzoAmount): The original AlonzoAmount to be converted.

Returns:
	Amount: The Amount representation of the AlonzoAmount.

type Amount

type Amount struct {
	Coin  int64
	Value MultiAsset.MultiAsset[int64]
	// contains filtered or unexported fields
}

func (Amount) Add

func (am Amount) Add(other Amount) Amount

*

Add function adds an Amount to the current Amount.

Params:
	other (Amount): The other Amount to add to the current Amount.

Returns:
	Amount: The resulting Amount after addition.

func (Amount) Clone

func (am Amount) Clone() Amount

*

Clone function creates a deep copy of an Amount object.

Returns:
	AlonzoAmount: A deep copy of the Amount.

func (Amount) Equal

func (am Amount) Equal(other Amount) bool

*

This function checks if two Amount are equal.

Params:
	other (Amount): The other Amount to compare.

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

func (Amount) Greater

func (am Amount) Greater(other Amount) bool

*

Greater function checks if an Amount is greater than another Amount.

Params:
	other (Amount): The other Amount to compare.

Returns:
	bool: true if the current Amount is greater than the other Amount, false otherwise.

func (Amount) Less

func (am Amount) Less(other Amount) bool

*

Less function checks if an Amount is less than another Amount.

Params:
	other (Amount): The other Amount to compare.

Returns:
	bool: true if the current Amount is less than the other Amount, false otherwise.

func (Amount) RemoveZeroAssets

func (am Amount) RemoveZeroAssets() Amount

*

RemoveZeroAssets remove zero-value assets from an amount.

Returns:
	Amount: A copy of the Amount without zero-value assets.

func (Amount) Sub

func (am Amount) Sub(other Amount) Amount

*

Sub function subtracts an Amount from the current Amount.

Params:
	other (Amount): The other Amount to subtract from the current Amount.

Returns:
	Amount: The resulting Amount after subtraction.

func (Amount) ToAlonzo added in v1.0.3

func (amt Amount) ToAlonzo() AlonzoAmount

*

ToAlonzo converts an Amount to its Alonzo representation creating
a new AlonzoAmount object.

Params:
	amt (Amount): The original Amount to be converted.

Returns:
	AlonzoAmount: The Alonzo representation of the Amount.

Jump to

Keyboard shortcuts

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