types

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIVersionPrefix = "/api/v1"
	NativeSymbol            = "BNB"

	GoSdkSource = 2
)

Variables

View Source
var Network = ProdNetwork

Functions

func GetFromBech32

func GetFromBech32(bech32str, prefix string) ([]byte, error)

GetFromBech32 to decode a bytestring from a bech32-encoded string

Types

type AccAddress

type AccAddress []byte

AccAddress a wrapper around bytes meant to represent an account address. When marshaled to a string or JSON, it uses Bech32.

func AccAddressFromBech32

func AccAddressFromBech32(address string) (addr AccAddress, err error)

AccAddressFromBech32 to create an AccAddress from a bech32 string

func AccAddressFromHex

func AccAddressFromHex(address string) (addr AccAddress, err error)

AccAddressFromHex to create an AccAddress from a hex string

func (AccAddress) Bytes

func (bz AccAddress) Bytes() []byte

func (AccAddress) Marshal

func (bz AccAddress) Marshal() ([]byte, error)

Marshal needed for protobuf compatibility

func (AccAddress) MarshalJSON

func (bz AccAddress) MarshalJSON() ([]byte, error)

MarshalJSON to Marshals to JSON using Bech32

func (AccAddress) String

func (bz AccAddress) String() string

String representation

func (*AccAddress) Unmarshal

func (bz *AccAddress) Unmarshal(data []byte) error

Unmarshal needed for protobuf compatibility

func (*AccAddress) UnmarshalJSON

func (bz *AccAddress) UnmarshalJSON(data []byte) error

UnmarshalJSON to Unmarshal from JSON assuming Bech32 encoding

type ChainNetwork

type ChainNetwork uint8
const (
	TestNetwork ChainNetwork = iota
	ProdNetwork
)

func (ChainNetwork) Bech32Prefixes

func (this ChainNetwork) Bech32Prefixes() string

type Coin

type Coin struct {
	Denom  string `json:"denom"`
	Amount int64  `json:"amount"`
}

Coin def

func (Coin) IsNotNegative

func (coin Coin) IsNotNegative() bool

func (Coin) IsPositive

func (coin Coin) IsPositive() bool

func (Coin) IsZero

func (coin Coin) IsZero() bool

func (Coin) Plus

func (coin Coin) Plus(coinB Coin) Coin

func (Coin) SameDenomAs

func (coin Coin) SameDenomAs(other Coin) bool

type Coins

type Coins []Coin

Coins def

func (Coins) IsEqual

func (coins Coins) IsEqual(coinsB Coins) bool

IsEqual returns true if the two sets of Coins have the same value

func (Coins) IsNotNegative

func (coins Coins) IsNotNegative() bool

func (Coins) IsPositive

func (coins Coins) IsPositive() bool

func (Coins) IsValid

func (coins Coins) IsValid() bool

func (Coins) Plus

func (coins Coins) Plus(coinsB Coins) Coins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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