assets

package
v0.0.0-...-d683214 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package assets is a simple helper package to help convert to/from xdr.AssetType values

Index

Constants

This section is empty.

Variables

View Source
var AssetTypeMap = map[string]xdr.AssetType{
	"native":            xdr.AssetTypeAssetTypeNative,
	"credit_alphanum4":  xdr.AssetTypeAssetTypeCreditAlphanum4,
	"credit_alphanum12": xdr.AssetTypeAssetTypeCreditAlphanum12,
}

AssetTypeMap is the read-only (i.e. don't modify it) map from string names to xdr.AssetType values

View Source
var ErrInvalidString = errors.New("invalid asset type: was not one of 'native', 'credit_alphanum4', 'credit_alphanum12'")

ErrInvalidString gets returns when the string form of the asset type is invalid

View Source
var ErrInvalidValue = errors.New("unknown asset type, cannot convert to string")

ErrInvalidValue gets returned when the xdr.AssetType int value is not one of the valid enum values

Functions

func Equals

func Equals(l, r xdr.Asset) bool

Equals returns true if l and r are equivalent.

func MustString

func MustString(aType xdr.AssetType) string

MustString is the panicky version of String.

func Parse

func Parse(aType string) (result xdr.AssetType, err error)

Parse creates an asset from the provided strings. See AssetTypeMap for valid strings for aType.

func String

func String(aType xdr.AssetType) (string, error)

String returns the appropriate string representation of the provided xdr.AssetType.

Types

This section is empty.

Jump to

Keyboard shortcuts

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