bnb

package
v0.0.0-...-450f598 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultApiSchema        = "https"
	DefaultWSSchema         = "wss"
	DefaultAPIVersionPrefix = "/api/v1"
	DefaultWSPrefix         = "/api/ws"
	NativeSymbol            = "BNB"

	GoSdkSource = 2
)
View Source
const (
	RouteNewOrder    = "orderNew"
	RouteCancelOrder = "orderCancel"
)

Order routes

View Source
const (
	PrefixBytesLen = 4
	DisambBytesLen = 3
	DisfixBytesLen = PrefixBytesLen + DisambBytesLen
)

Lengths

View Source
const (
	AddrLen = 20
)
View Source
const Source int64 = 2

Source .

Variables

View Source
var (
	// Param error
	AddressMissingError           = errors.New("Address is required ")
	SymbolMissingError            = errors.New("Symbol is required ")
	OffsetOutOfRangeError         = errors.New("offset out of range ")
	LimitOutOfRangeError          = errors.New("limit out of range ")
	TradeSideMisMatchError        = errors.New("Trade side is invalid ")
	StartTimeOutOfRangeError      = errors.New("start time out of range ")
	EndTimeOutOfRangeError        = errors.New("end time out of range ")
	IntervalMissingError          = errors.New("interval is required ")
	EndTimeLessThanStartTimeError = errors.New("end time should great than start time")
	OrderIdMissingError           = errors.New("order id is required ")

	ExceedABCIPathLengthError         = fmt.Errorf("the abci path exceed max length %d ", maxABCIPathLength)
	ExceedABCIDataLengthError         = fmt.Errorf("the abci data exceed max length %d ", maxABCIDataLength)
	ExceedTxLengthError               = fmt.Errorf("the tx data exceed max length %d ", maxTxLength)
	LimitNegativeError                = fmt.Errorf("the limit can't be negative")
	ExceedMaxUnConfirmedTxsNumError   = fmt.Errorf("the limit of unConfirmed tx exceed max limit %d ", maxUnConfirmedTxs)
	HeightNegativeError               = fmt.Errorf("the height can't be negative")
	MaxMinHeightConflictError         = fmt.Errorf("the min height can't be larger than max height")
	HashLengthError                   = fmt.Errorf("the length of hash is not 32")
	ExceedABCIQueryStrLengthError     = fmt.Errorf("the query string exceed max length %d ", maxABCIPathLength)
	ExceedTxSearchQueryStrLengthError = fmt.Errorf("the query string exceed max length %d ", maxTxSearchStrLength)
	OffsetNegativeError               = fmt.Errorf("offset can't be less than 0")
	SymbolLengthExceedRangeError      = fmt.Errorf("length of symbol should be in range [%d,%d]", tokenSymbolMinLen, tokenSymbolMaxLen)
	PairFormatError                   = fmt.Errorf("the pair should in format 'symbol1_symbol2'")
)
View Source
var Cdc = amino.NewCodec()
View Source
var Fixed8Decimals = int(math.Pow10(precision))

Fixed8Decimals represents 10^precision (100000000), a value of 1 in Fixed8 format

View Source
var Fixed8One = NewFixed8(1)

Fixed8One represetns one unit

View Source
var MsgCdc = amino.NewCodec()

MsgCdc .

View Source
var Network = ProdNetwork

Network .

View Source
var OrderSide = struct {
	BUY  int8
	SELL int8
}{1, 2}

OrderSide /TimeInForce /OrderType are const, following FIX protocol convention Used as Enum

View Source
var OrderType = struct {
	LIMIT  int8
	MARKET int8
}{orderLimit, orderMarket}

OrderType is an enum of order type options supported by the matching engine

View Source
var TimeInForce = struct {
	GTC int8
	IOC int8
}{tifGTC, tifIOC}

TimeInForce is an enum of TIF (Time in Force) options supported by the matching engine

Functions

func CombineSymbol

func CombineSymbol(baseAssetSymbol, quoteAssetSymbol string) string

CombineSymbol .

func ConvertAndEncode

func ConvertAndEncode(hrp string, data []byte) (string, error)

ConvertAndEncode converts from a base64 encoded byte string to base32 encoded byte string and then to bech32

func ConvertBits

func ConvertBits(data []byte, fromBits, toBits uint8, pad bool) ([]byte, error)

ConvertBits converts a byte slice where each byte is encoding fromBits bits, to a byte slice where each byte is encoding toBits bits.

func Decode

func Decode(bech string) (string, []byte, error)

Decode decodes a bech32 encoded string, returning the human-readable part and the data part excluding the checksum.

func DecodeAndConvert

func DecodeAndConvert(bech string) (string, []byte, error)

DecodeAndConvert decodes a bech32 encoded string and converts to base64 encoded bytes

func Encode

func Encode(hrp string, data []byte) (string, error)

Encode encodes a byte slice into a bech32 string with the human-readable part hrb. Note that the bytes must each encode 5 bits (base32).

func GenerateOrderID

func GenerateOrderID(sequence int64, from AccAddress) string

GenerateOrderID generates an order ID

func IToOrderType

func IToOrderType(tpe int8) string

IToOrderType conversion

func IToSide

func IToSide(side int8) string

IToSide conversion

func IsValidOrderType

func IsValidOrderType(ot int8) bool

IsValidOrderType validates that an order type is valid and supported by the matching engine

func IsValidSide

func IsValidSide(side int8) bool

IsValidSide validates that a side is valid and supported by the matching engine

func IsValidTimeInForce

func IsValidTimeInForce(tif int8) bool

IsValidTimeInForce validates that a tif code is correct

func MustSortJSON

func MustSortJSON(toSortJSON []byte) []byte

MustSortJSON is like SortJSON but panic if an error occurs, e.g., if the passed JSON isn't valid.

func RegisterCodec

func RegisterCodec(cdc *amino.Codec)

RegisterCodec .

func SortJSON

func SortJSON(toSortJSON []byte) ([]byte, error)

SortJSON takes any JSON and returns it sorted by keys. Also, all white-spaces are removed. This method can be used to canonicalize JSON to be returned by GetSignBytes, e.g. for the ledger integration. If the passed JSON isn't valid it will return an error.

func StdSignBytes

func StdSignBytes(chainID string, accnum int64, sequence int64, msgs []Msg, memo string, source int64, data []byte) []byte

StdSignBytes returns the bytes to sign for a transaction.

func ValidateSymbol

func ValidateSymbol(symbol string) error

Types

type AccAddress

type AccAddress []byte

AccAddress .

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

type Address

type Address = HexBytes

type BalanceAccount

type BalanceAccount struct {
	Number    int64          `json:"account_number"`
	Address   string         `json:"address"`
	Balances  []TokenBalance `json:"balances"`
	PublicKey []uint8        `json:"public_key"`
	Sequence  int64          `json:"sequence"`
	ChainID   string         `json:"chain_id"`
}

Balance Account definition

type Block

type Block struct {
	Data `json:"data"`
}

type BlockMeta

type BlockMeta struct {
	MetaHeader `json:"header"`
}

type Blocks

type Blocks struct {
	SResult `json:"result"`
}

Blocks .

type ChainNetwork

type ChainNetwork uint8

ChainNetwork .

const (
	TestNetwork ChainNetwork = iota
	ProdNetwork
)

func (ChainNetwork) Bech32Prefixes

func (this ChainNetwork) Bech32Prefixes() string

Bech32Prefixes .

func (ChainNetwork) Bech32ValidatorAddrPrefix

func (this ChainNetwork) Bech32ValidatorAddrPrefix() string

Bech32ValidatorAddrPrefix .

type Client

type Client interface {
	Get(string, map[string]string, bool) ([]byte, int, error)
	GetAccount(address string) (*BalanceAccount, error)
	GetBalance(addr string, symbol string) (*TokenBalance, error)
	Transfer(keyManager KeyManager, transfers []Transfer) (*TxCommitResult, error)
	GetTokens() ([]Token, error)
	GetTransactionReceipt(tx string) (*TxResponse, error)
	GetBlockByNumber(height uint32) (*Blocks, error)
	BestBlockNumber() (uint32, error)
	SendRawTransaction(tx []byte) (string, error)
}

Client .

func New

func New(HTTPURL, WsURL string, network int) (Client, error)

New .

type Codec

type Codec struct {
	// contains filtered or unexported fields
}

Codec .

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

func (coins Coins) AmountOf(denom string) int64

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

func (coins Coins) IsZero() bool

func (Coins) Len

func (coins Coins) Len() int

nolint

func (Coins) Less

func (coins Coins) Less(i, j int) bool

func (Coins) Plus

func (coins Coins) Plus(coinsB Coins) Coins

func (Coins) Sort

func (coins Coins) Sort() Coins

Sort is a helper function to sort the set of coins inplace

func (Coins) Swap

func (coins Coins) Swap(i, j int)

type ConcreteInfo

type ConcreteInfo struct {

	// These fields are only set when registered (as implementing an interface).
	Registered       bool // Registered with RegisterConcrete().
	PointerPreferred bool // Deserialize to pointer type if possible.
	// NilPreferred     bool        // Deserialize to nil for empty structs if PointerPreferred.
	Name            string      // Registered name.
	Disamb          DisambBytes // Disambiguation bytes derived from name.
	Prefix          PrefixBytes // Prefix bytes derived from name.
	ConcreteOptions             // Registration options.

	// These fields get set for all concrete types,
	// even those not manually registered (e.g. are never interface values).
	IsAminoMarshaler       bool         // Implements MarshalAmino() (<ReprObject>, error).
	AminoMarshalReprType   reflect.Type // <ReprType>
	IsAminoUnmarshaler     bool         // Implements UnmarshalAmino(<ReprObject>) (error).
	AminoUnmarshalReprType reflect.Type // <ReprType>
}

ConcreteInfo .

type ConcreteOptions

type ConcreteOptions struct {
}

type CreateOrderMsg

type CreateOrderMsg struct {
	Sender      AccAddress `json:"sender"`
	ID          string     `json:"id"`
	Symbol      string     `json:"symbol"`
	OrderType   int8       `json:"ordertype"`
	Side        int8       `json:"side"`
	Price       int64      `json:"price"`
	Quantity    int64      `json:"quantity"`
	TimeInForce int8       `json:"timeinforce"`
}

CreateOrderMsg def

func (CreateOrderMsg) GetInvolvedAddresses

func (msg CreateOrderMsg) GetInvolvedAddresses() []AccAddress

GetInvolvedAddresses as part of the Msg interface

func (CreateOrderMsg) GetSignBytes

func (msg CreateOrderMsg) GetSignBytes() []byte

GetSignBytes - Get the bytes for the message signer to sign on

func (CreateOrderMsg) GetSigners

func (msg CreateOrderMsg) GetSigners() []AccAddress

GetSigners is part of Msg interface

func (CreateOrderMsg) Route

func (msg CreateOrderMsg) Route() string

Route is part of Msg interface

func (CreateOrderMsg) String

func (msg CreateOrderMsg) String() string

String is part of Msg interface

func (CreateOrderMsg) Type

func (msg CreateOrderMsg) Type() string

Type is part of Msg interface

func (CreateOrderMsg) ValidateBasic

func (msg CreateOrderMsg) ValidateBasic() error

ValidateBasic is used to quickly disqualify obviously invalid messages quickly

type CreateOrderResult

type CreateOrderResult struct {
	TxCommitResult
	OrderID string
}

CreateOrderResult .

type CryptoJSON

type CryptoJSON struct {
	Cipher       string                 `json:"cipher"`
	CipherText   string                 `json:"ciphertext"`
	CipherParams cipherparamsJSON       `json:"cipherparams"`
	KDF          string                 `json:"kdf"`
	KDFParams    map[string]interface{} `json:"kdfparams"`
	MAC          string                 `json:"mac"`
}

type Data

type Data struct {
	Txs []types.Tx `json:"txs"`
}

type DisambBytes

type DisambBytes [DisambBytesLen]byte

Prefix types

type DisfixBytes

type DisfixBytes [DisfixBytesLen]byte // Disamb+Prefix

Prefix types

type Double

type Double float64

func (*Double) MarshalJSON

func (n *Double) MarshalJSON() ([]byte, error)

func (*Double) UnmarshalJSON

func (n *Double) UnmarshalJSON(data []byte) error

type EncryptedKeyJSON

type EncryptedKeyJSON struct {
	Address string     `json:"address"`
	Crypto  CryptoJSON `json:"crypto"`
	Id      string     `json:"id"`
	Version int        `json:"version"`
}

type FieldInfo

type FieldInfo struct {
	Name         string        // Struct field name
	Type         reflect.Type  // Struct field type
	Index        int           // Struct field index
	ZeroValue    reflect.Value // Could be nil pointer unlike TypeInfo.ZeroValue.
	UnpackedList bool          // True iff this field should be encoded as an unpacked list.
	FieldOptions               // Encoding options
}

type FieldOptions

type FieldOptions struct {
	JSONName      string // (JSON) field name
	JSONOmitEmpty bool   // (JSON) omitempty
	BinFixed64    bool   // (Binary) Encode as fixed64
	BinFixed32    bool   // (Binary) Encode as fixed32
	BinFieldNum   uint32 // (Binary) max 1<<29-1

	Unsafe        bool // e.g. if this field is a float.
	WriteEmpty    bool // write empty structs and lists (default false except for pointers)
	EmptyElements bool // Slice and Array elements are never nil, decode 0x00 as empty struct.
}

type Fixed8

type Fixed8 int64

Fixed8 represents a fixed-point number with precision 10^-8

func Fixed8DecodeString

func Fixed8DecodeString(s string) (Fixed8, error)

Fixed8DecodeString parses s which must be a fixed point number with precision up to 10^-8

func NewFixed8

func NewFixed8(val int64) Fixed8

NewFixed8 returns a new Fixed8 with the supplied int multiplied by 10^8

func (*Fixed8) MarshalJSON

func (f *Fixed8) MarshalJSON() ([]byte, error)

MarshalJSON implements the json marshaller interface

func (Fixed8) String

func (f Fixed8) String() string

String implements the Stringer interface

func (Fixed8) ToInt64

func (f Fixed8) ToInt64() int64

ToInt64 returns the original value representing the Fixed8

func (*Fixed8) UnmarshalJSON

func (f *Fixed8) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json unmarshaller interface

func (Fixed8) Value

func (f Fixed8) Value() int64

Value returns the original value representing the Fixed8 divided by 10^8

type Height

type Height struct {
	HeightResp `json:"result"`
}

Height .

type HeightResp

type HeightResp struct {
	LastBlockHeight `json:"response"`
}

HeightResp .

type HexBytes

type HexBytes []byte

The main purpose of HexBytes is to enable HEX-encoding for json/encoding.

func (HexBytes) Bytes

func (bz HexBytes) Bytes() []byte

Allow it to fulfill various interfaces in light-client, etc...

func (HexBytes) Format

func (bz HexBytes) Format(s fmt.State, verb rune)

func (HexBytes) Marshal

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

Marshal needed for protobuf compatibility

func (HexBytes) MarshalJSON

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

This is the point of Bytes.

func (HexBytes) String

func (bz HexBytes) String() string

func (*HexBytes) Unmarshal

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

Unmarshal needed for protobuf compatibility

func (*HexBytes) UnmarshalJSON

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

This is the point of Bytes.

type Input

type Input struct {
	Address AccAddress `json:"address"`
	Coins   Coins      `json:"coins"`
}

Input Input

func NewInput

func NewInput(addr AccAddress, coins Coins) Input

func (Input) GetSignBytes

func (in Input) GetSignBytes() []byte

Return bytes to sign for Input

func (Input) ValidateBasic

func (in Input) ValidateBasic() error

ValidateBasic - validate transaction input

type InterfaceInfo

type InterfaceInfo struct {
	Priority     []DisfixBytes               // Disfix priority.
	Implementers map[PrefixBytes][]*TypeInfo // Mutated over time.
	InterfaceOptions
}

InterfaceInfo .

type InterfaceOptions

type InterfaceOptions struct {
	Priority           []string // Disamb priority.
	AlwaysDisambiguate bool     // If true, include disamb for all types.
}

InterfaceOptions .

type KeyManager

type KeyManager interface {
	Sign(StdSignMsg) ([]byte, error)
	GetPrivKey() PrivKey
	GetAddr() AccAddress
	GetPublicKey() crypto.PubKey

	// ExportAsMnemonic() (string, error)
	ExportAsPrivateKey() (string, error)
}

func NewPrivateKeyManager

func NewPrivateKeyManager(priKey string) (KeyManager, error)

type LastBlockHeight

type LastBlockHeight struct {
	BlockHeith string `json:"last_block_height"`
}

LastBlockHeight .

type MetaHeader

type MetaHeader struct {
	Height string    `json:"height"`
	Time   time.Time `json:"time"`
}

type Msg

type Msg interface {

	// Return the message type.
	// Must be alphanumeric or empty.
	Route() string

	// Returns a human-readable string for the message, intended for utilization
	// within tags
	Type() string

	// ValidateBasic does a simple validation check that
	// doesn't require access to any other information.
	ValidateBasic() error

	// Get the canonical byte representation of the Msg.
	GetSignBytes() []byte

	// Signers returns the addrs of signers that must sign.
	// CONTRACT: All signatures must be present to be valid.
	// CONTRACT: Returns addrs in some deterministic order.
	GetSigners() []AccAddress

	// Get involved addresses of this msg so that we can publish account balance change
	GetInvolvedAddresses() []AccAddress
}

Msg - Transactions messages must fulfill the Msg

type NodeInfo

type NodeInfo struct {
	// Check compatibility.
	// Channels are HexBytes so easier to read as JSON
	Network string `json:"network"` // network/chain ID

}

type Option

type Option func(*StdSignMsg) *StdSignMsg

Option .

type Output

type Output struct {
	Address AccAddress `json:"address"`
	Coins   Coins      `json:"coins"`
}

Transaction Output

func NewOutput

func NewOutput(addr AccAddress, coins Coins) Output

NewOutput - create a transaction output, used with SendMsg

func (Output) GetSignBytes

func (out Output) GetSignBytes() []byte

Return bytes to sign for Output

func (Output) ValidateBasic

func (out Output) ValidateBasic() error

ValidateBasic - validate transaction output

type PrefixBytes

type PrefixBytes [PrefixBytesLen]byte

Prefix types

type PrivKey

type PrivKey interface {
	Bytes() []byte
	Sign(msg []byte) ([]byte, error)
	PubKey() crypto.PubKey
	Equals(crypto.PrivKey) bool
}

type PubKey

type PubKey interface {
	Address() Address
	Bytes() []byte
	VerifyBytes(msg []byte, sig []byte) bool
	Equals(PubKey) bool
}

type ResultBlock

type ResultBlock struct {
	BlockMeta types.BlockMeta `json:"block_meta"`
	Block     types.Block     `json:"block"`
}

type ResultStatus

type ResultStatus struct {
	NodeInfo NodeInfo `json:"node_info"`
	SyncInfo SyncInfo `json:"sync_info"`
}

type SResult

type SResult struct {
	Block     `json:"block"`
	BlockMeta `json:"block_meta"`
}

SResult .

type SendMsg

type SendMsg struct {
	Inputs  []Input  `json:"inputs"`
	Outputs []Output `json:"outputs"`
}

SendMsg - high level transaction of the coin module

func CreateSendMsg

func CreateSendMsg(from AccAddress, fromCoins Coins, transfers []Transfer) SendMsg

func NewMsgSend

func NewMsgSend(in []Input, out []Output) SendMsg

NewMsgSend - construct arbitrary multi-in, multi-out send msg.

func (SendMsg) GetInvolvedAddresses

func (msg SendMsg) GetInvolvedAddresses() []AccAddress

func (SendMsg) GetSignBytes

func (msg SendMsg) GetSignBytes() []byte

Implements Msg.

func (SendMsg) GetSigners

func (msg SendMsg) GetSigners() []AccAddress

Implements Msg.

func (SendMsg) Route

func (msg SendMsg) Route() string

func (SendMsg) Type

func (msg SendMsg) Type() string

func (SendMsg) ValidateBasic

func (msg SendMsg) ValidateBasic() error

Implements Msg.

type SendTokenResult

type SendTokenResult struct {
	TxCommitResult
}

SendTokenResult .

type StdSignDoc

type StdSignDoc struct {
	ChainID       string            `json:"chain_id"`
	AccountNumber int64             `json:"account_number"`
	Sequence      int64             `json:"sequence"`
	Memo          string            `json:"memo"`
	Source        int64             `json:"source"`
	Msgs          []json.RawMessage `json:"msgs"`
	Data          []byte            `json:"data"`
}

StdSignDoc def

type StdSignMsg

type StdSignMsg struct {
	ChainID       string `json:"chain_id"`
	AccountNumber int64  `json:"account_number"`
	Sequence      int64  `json:"sequence"`
	Msgs          []Msg  `json:"msgs"`
	Memo          string `json:"memo"`
	Source        int64  `json:"source"`
	Data          []byte `json:"data"`
}

StdSignMsg def

func (StdSignMsg) Bytes

func (msg StdSignMsg) Bytes() []byte

Bytes gets message bytes

type StdSignature

type StdSignature struct {
	crypto.PubKey `json:"pub_key"` // optional
	Signature     []byte           `json:"signature"`
	AccountNumber int64            `json:"account_number"`
	Sequence      int64            `json:"sequence"`
}

StdSignature Signature

type StdTx

type StdTx struct {
	Msgs       []Msg          `json:"msg"`
	Signatures []StdSignature `json:"signatures"`
	Memo       string         `json:"memo"`
	Source     int64          `json:"source"`
	Data       []byte         `json:"data"`
}

StdTx def

func NewStdTx

func NewStdTx(msgs []Msg, sigs []StdSignature, memo string, source int64, data []byte) StdTx

NewStdTx to instantiate an instance

func (StdTx) GetMsgs

func (tx StdTx) GetMsgs() []Msg

GetMsgs def

type StructInfo

type StructInfo struct {
	Fields []FieldInfo // If a struct.
}

type SyncInfo

type SyncInfo struct {
	Height uint32 `json:"latest_block_height"` // latest_block_height

}

type Token

type Token struct {
	Name        string     `json:"name"`
	Symbol      string     `json:"symbol"`
	OrigSymbol  string     `json:"original_symbol"`
	TotalSupply Fixed8     `json:"total_supply"`
	Owner       AccAddress `json:"owner"`
	Mintable    bool       `json:"mintable"`
}

Token definition

type TokenBalance

type TokenBalance struct {
	Symbol string `json:"symbol"`
	Free   Fixed8 `json:"free"`
	Locked Fixed8 `json:"locked"`
	Frozen Fixed8 `json:"frozen"`
}

type Transaction

type Transaction struct {
	GasPrice uint64
	GasLimit uint64
	From     string
	To       string
	Symbol   string
	Amount   int64
	Block    int64
	Tx       string
	T        time.Time
}

Transaction .

type Transfer

type Transfer struct {
	ToAddr AccAddress
	Coins  Coins
}

Transfer .

type Tx

type Tx interface {

	// Gets the Msg.
	GetMsgs() []Msg
}

type TxCommitResult

type TxCommitResult struct {
	Ok   bool   `json:"ok"`
	Log  string `json:"log"`
	Hash string `json:"hash"`
	Code int32  `json:"code"`
	Data string `json:"data"`
}

TxCommitResult for POST tx results

type TxInfo

type TxInfo struct {
	Type  string  `json:"type"`
	Value TxValue `json:"value"`
}

TxInfo .

type TxMsg

type TxMsg struct {
	Type  string     `json:"type"`
	Value TxMsgValue `json:"value"`
}

TxMsg .

type TxMsgCoin

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

TxMsgCoin .

type TxMsgInput

type TxMsgInput struct {
	Address string      `json:"address"`
	Coins   []TxMsgCoin `json:"coins"`
}

TxMsgInput Input

type TxMsgValue

type TxMsgValue struct {
	Inputs  []TxMsgInput `json:"inputs"`
	Outputs []TxMsgInput `json:"outputs"`
}

TxMsgValue .

type TxResponse

type TxResponse struct {
	Hash   string `json:"hash"`
	Height string `json:"height"`
	Ok     bool   `json:"ok"`
	Tx     TxInfo `json:"tx"`
}

TxResponse .

type TxValue

type TxValue struct {
	Source string  `json:"source"`
	Msg    []TxMsg `json:"msg"`
}

TxValue .

type TypeInfo

type TypeInfo struct {
	Type      reflect.Type // Interface type.
	PtrToType reflect.Type
	ZeroValue reflect.Value
	ZeroProto interface{}
	InterfaceInfo
	ConcreteInfo
	StructInfo
}

TypeInfo .

Jump to

Keyboard shortcuts

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