Documentation ¶
Index ¶
- Constants
- Variables
- func Enough(have Value, want Value) (bool, error)
- func Equal(a, b Value) bool
- func GreaterThanOrEqual(a, b Value) bool
- func LessThanOrEqual(a, b Value) bool
- type AssetID
- func (a AssetID) AssetName() string
- func (a AssetID) AssetNameUTF8() (string, bool)
- func (a AssetID) HasAssetID(re *regexp.Regexp) bool
- func (a AssetID) HasPolicyID(s string) bool
- func (a AssetID) IsZero() bool
- func (a AssetID) MatchAssetName(re *regexp.Regexp) ([]string, bool)
- func (a AssetID) PolicyID() string
- func (a AssetID) String() string
- type Coin
- type Utxo
- type UtxoTxID
- type Value
Constants ¶
View Source
const ( AdaPolicy = "ada" AdaAsset = "lovelace" AdaAssetIDString = AdaPolicy + "." + AdaAsset AdaAssetID = AssetID(AdaAssetIDString) )
AdaAssetID maps to Coins in the v5 Value struct.
Variables ¶
View Source
var ErrInsufficientFunds = fmt.Errorf("insufficient funds")
Functions ¶
func GreaterThanOrEqual ¶
A should be strictly greater than B meaning for every asset in B, the amount of asset in A should be greater meaning loop over b, because if there's an asset in b that's not in a, we need to fail but if there's an asset in a that's not in b, that's fine
func LessThanOrEqual ¶
A should be strictly less than B meaning for every asset in A, the amount of asset in B should be greater meaning loop over every A asset, because if there's an asset in a that's not in b, we need to fail but if there's an asset in b that's not in a, that's fine
Types ¶
type AssetID ¶
type AssetID string
func FromSeparate ¶
func (AssetID) AssetNameUTF8 ¶
func (AssetID) HasPolicyID ¶
type Coin ¶
func CreateAdaCoin ¶
type Utxo ¶
type Utxo struct { // TxOut "ref" fields. Transaction UtxoTxID `json:"transaction"` Index uint32 `json:"index"` // TxOut fields. Address string `json:"address"` Value Value `json:"value"` DatumHash string `json:"datumHash,omitempty"` Datum string `json:"datum,omitempty"` Script json.RawMessage `json:"script,omitempty"` }
type Value ¶
func CreateAdaValue ¶
func ValueFromCoins ¶
func (Value) AdaLovelace ¶
func (Value) AssetsExceptAda ¶
func (Value) AssetsExceptAdaCount ¶
func (Value) IsAdaPresent ¶
Click to show internal directories.
Click to hide internal directories.