assets

package
v0.0.0-...-9f7f9c2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0, 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', 'liquidity_pool_shares'")

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 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