ultpb

package
v0.0.0-...-9098a98 Latest Latest
Warning

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

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

Documentation

Overview

Package ultpb is a generated protocol buffer package.

It is generated from these files:

account.proto
asset.proto
consensus.proto
ledger.proto
liability.proto
offer.proto
transaction.proto
trust.proto

It has these top-level messages:

Account
Asset
ConsensusValue
Quorum
Nominate
Ballot
Prepare
Confirm
Externalize
Statement
LedgerHeader
Ledger
LedgerCheckpoint
Liability
Price
Offer
Op
Tx
TxSet
CreateAccountOp
PaymentOp
PathPaymentOp
TrustOp
AllowTrustOp
OfferOp
Trust

Index

Constants

This section is empty.

Variables

View Source
var AssetType_name = map[int32]string{
	0: "NATIVE",
	1: "CUSTOM",
}
View Source
var AssetType_value = map[string]int32{
	"NATIVE": 0,
	"CUSTOM": 1,
}
View Source
var OpType_name = map[int32]string{
	0: "CREATE_ACCOUNT",
	1: "PAYMENT",
	2: "PATH_PAYMENT",
	3: "TRUST",
}
View Source
var OpType_value = map[string]int32{
	"CREATE_ACCOUNT": 0,
	"PAYMENT":        1,
	"PATH_PAYMENT":   2,
	"TRUST":          3,
}
View Source
var StatementType_name = map[int32]string{
	0: "NOMINATE",
	1: "PREPARE",
	2: "CONFIRM",
	3: "EXTERNALIZE",
}
View Source
var StatementType_value = map[string]int32{
	"NOMINATE":    0,
	"PREPARE":     1,
	"CONFIRM":     2,
	"EXTERNALIZE": 3,
}

Functions

func Encode

func Encode(msg proto.Message) ([]byte, error)

Encode pb message to bytes

func GetLedgerHeaderKey

func GetLedgerHeaderKey(lh *LedgerHeader) (string, error)

Hash ledger header and encode to ledger header ULTKey

func GetTxKey

func GetTxKey(tx *Tx) (string, error)

Hash tx and encode to tx ULTKey

func GetTxSetKey

func GetTxSetKey(ts *TxSet) (string, error)

Hash txset and encode to txset ULTKey

func SHA256Hash

func SHA256Hash(msg proto.Message) (string, error)

Compute sha256 checksum of proto message

func SHA256HashBytes

func SHA256HashBytes(msg proto.Message) ([32]byte, error)

Compute sha256 checksum of proto message in bytes

Types

type Account

type Account struct {
	// Public key of the account.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// The account balance in ULU.
	Balance int64 `protobuf:"varint,2,opt,name=Balance" json:"Balance,omitempty"`
	// Public key of the signer of the account.
	Signer string `protobuf:"bytes,3,opt,name=Signer" json:"Signer,omitempty"`
	// Latest transaction sequence number.
	SeqNum uint64 `protobuf:"varint,4,opt,name=SeqNum" json:"SeqNum,omitempty"`
	// The number of entries belong to the account.
	EntryCount int32 `protobuf:"varint,5,opt,name=EntryCount" json:"EntryCount,omitempty"`
	// ULTkeys of transactions belongs to this account.
	TxKeyList []string `protobuf:"bytes,6,rep,name=TxKeyList" json:"TxKeyList,omitempty"`
	// Liability of the native asset.
	Liability *Liability `protobuf:"bytes,7,opt,name=Liability" json:"Liability,omitempty"`
}

func DecodeAccount

func DecodeAccount(b []byte) (*Account, error)

Decode pb message to account

func (*Account) Descriptor

func (*Account) Descriptor() ([]byte, []int)

func (*Account) GetAccountID

func (m *Account) GetAccountID() string

func (*Account) GetBalance

func (m *Account) GetBalance() int64

func (*Account) GetEntryCount

func (m *Account) GetEntryCount() int32

func (*Account) GetLiability

func (m *Account) GetLiability() *Liability

func (*Account) GetSeqNum

func (m *Account) GetSeqNum() uint64

func (*Account) GetSigner

func (m *Account) GetSigner() string

func (*Account) GetTxKeyList

func (m *Account) GetTxKeyList() []string

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) Reset

func (m *Account) Reset()

func (*Account) String

func (m *Account) String() string

type AllowTrustOp

type AllowTrustOp struct {
	// The account id of trustor.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// Asset to trust.
	Asset *Asset `protobuf:"bytes,2,opt,name=Asset" json:"Asset,omitempty"`
	// Authorization flag.
	Authorized int32 `protobuf:"varint,3,opt,name=Authorized" json:"Authorized,omitempty"`
}

AllowTrustOp creates an op to manage the authorization of the custom asset.

func (*AllowTrustOp) Descriptor

func (*AllowTrustOp) Descriptor() ([]byte, []int)

func (*AllowTrustOp) GetAccountID

func (m *AllowTrustOp) GetAccountID() string

func (*AllowTrustOp) GetAsset

func (m *AllowTrustOp) GetAsset() *Asset

func (*AllowTrustOp) GetAuthorized

func (m *AllowTrustOp) GetAuthorized() int32

func (*AllowTrustOp) ProtoMessage

func (*AllowTrustOp) ProtoMessage()

func (*AllowTrustOp) Reset

func (m *AllowTrustOp) Reset()

func (*AllowTrustOp) String

func (m *AllowTrustOp) String() string

type Asset

type Asset struct {
	AssetType AssetType `protobuf:"varint,1,opt,name=AssetType,enum=ultpb.AssetType" json:"AssetType,omitempty"`
	// User defined asset name. The length of the
	// name should not be more than four.
	AssetName string `protobuf:"bytes,2,opt,name=AssetName" json:"AssetName,omitempty"`
	// The issuer account of the asset.
	Issuer string `protobuf:"bytes,3,opt,name=Issuer" json:"Issuer,omitempty"`
}

func DecodeAsset

func DecodeAsset(b []byte) (*Asset, error)

Decode pb message to asset

func (*Asset) Descriptor

func (*Asset) Descriptor() ([]byte, []int)

func (*Asset) GetAssetName

func (m *Asset) GetAssetName() string

func (*Asset) GetAssetType

func (m *Asset) GetAssetType() AssetType

func (*Asset) GetIssuer

func (m *Asset) GetIssuer() string

func (*Asset) ProtoMessage

func (*Asset) ProtoMessage()

func (*Asset) Reset

func (m *Asset) Reset()

func (*Asset) String

func (m *Asset) String() string

type AssetType

type AssetType int32

Enumeration of asset types.

const (
	// The native asset of Ultiledger network is ULT,
	// and the smallest unit of ULT is ULU.
	AssetType_NATIVE AssetType = 0
	AssetType_CUSTOM AssetType = 1
)

func (AssetType) EnumDescriptor

func (AssetType) EnumDescriptor() ([]byte, []int)

func (AssetType) String

func (x AssetType) String() string

type Ballot

type Ballot struct {
	// Ballot counter.
	Counter uint32 `protobuf:"varint,1,opt,name=Counter" json:"Counter,omitempty"`
	// Composite candidate value.
	Value string `protobuf:"bytes,2,opt,name=Value" json:"Value,omitempty"`
}

Ballot is used to finalize a consensus value for a specific decree.

func (*Ballot) Descriptor

func (*Ballot) Descriptor() ([]byte, []int)

func (*Ballot) GetCounter

func (m *Ballot) GetCounter() uint32

func (*Ballot) GetValue

func (m *Ballot) GetValue() string

func (*Ballot) ProtoMessage

func (*Ballot) ProtoMessage()

func (*Ballot) Reset

func (m *Ballot) Reset()

func (*Ballot) String

func (m *Ballot) String() string

type Confirm

type Confirm struct {
	// Current working ballot.
	B *Ballot `protobuf:"bytes,1,opt,name=B" json:"B,omitempty"`
	// Counter of the highest ballot accepted as prepared.
	PC uint32 `protobuf:"varint,2,opt,name=PC" json:"PC,omitempty"`
	// Counter of the lowest ballot accepted as committed.
	LC uint32 `protobuf:"varint,3,opt,name=LC" json:"LC,omitempty"`
	// Counter of the highest ballot accepted as committed.
	HC         uint32 `protobuf:"varint,4,opt,name=HC" json:"HC,omitempty"`
	QuorumHash string `protobuf:"bytes,5,opt,name=QuorumHash" json:"QuorumHash,omitempty"`
}

Confirm message for ballot protocol.

func DecodeConfirm

func DecodeConfirm(b []byte) (*Confirm, error)

Decode pb message to ballot confirm statement

func (*Confirm) Descriptor

func (*Confirm) Descriptor() ([]byte, []int)

func (*Confirm) GetB

func (m *Confirm) GetB() *Ballot

func (*Confirm) GetHC

func (m *Confirm) GetHC() uint32

func (*Confirm) GetLC

func (m *Confirm) GetLC() uint32

func (*Confirm) GetPC

func (m *Confirm) GetPC() uint32

func (*Confirm) GetQuorumHash

func (m *Confirm) GetQuorumHash() string

func (*Confirm) ProtoMessage

func (*Confirm) ProtoMessage()

func (*Confirm) Reset

func (m *Confirm) Reset()

func (*Confirm) String

func (m *Confirm) String() string

type ConsensusValue

type ConsensusValue struct {
	// Hash of the transaction set.
	TxSetHash string `protobuf:"bytes,1,opt,name=TxSetHash" json:"TxSetHash,omitempty"`
	// Propose time of the consensus value.
	ProposeTime int64 `protobuf:"varint,2,opt,name=ProposeTime" json:"ProposeTime,omitempty"`
}

ConsensusValue is used for reaching consensus in FBA.

func DecodeConsensusValue

func DecodeConsensusValue(b []byte) (*ConsensusValue, error)

Decode pb message to consensus value

func (*ConsensusValue) Descriptor

func (*ConsensusValue) Descriptor() ([]byte, []int)

func (*ConsensusValue) GetProposeTime

func (m *ConsensusValue) GetProposeTime() int64

func (*ConsensusValue) GetTxSetHash

func (m *ConsensusValue) GetTxSetHash() string

func (*ConsensusValue) ProtoMessage

func (*ConsensusValue) ProtoMessage()

func (*ConsensusValue) Reset

func (m *ConsensusValue) Reset()

func (*ConsensusValue) String

func (m *ConsensusValue) String() string

type CreateAccountOp

type CreateAccountOp struct {
	// Destination account.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// Initial balance in ULU.
	Balance int64 `protobuf:"varint,2,opt,name=Balance" json:"Balance,omitempty"`
}

CreateAccountOp creates a new account by sending some native asset to it from the source account.

func DecodeCreateAccountOp

func DecodeCreateAccountOp(b []byte) (*CreateAccountOp, error)

Decode pb message to CreateAccountOp

func (*CreateAccountOp) Descriptor

func (*CreateAccountOp) Descriptor() ([]byte, []int)

func (*CreateAccountOp) GetAccountID

func (m *CreateAccountOp) GetAccountID() string

func (*CreateAccountOp) GetBalance

func (m *CreateAccountOp) GetBalance() int64

func (*CreateAccountOp) ProtoMessage

func (*CreateAccountOp) ProtoMessage()

func (*CreateAccountOp) Reset

func (m *CreateAccountOp) Reset()

func (*CreateAccountOp) String

func (m *CreateAccountOp) String() string

type Externalize

type Externalize struct {
	// Lowest ballot confirmed as committed.
	B *Ballot `protobuf:"bytes,1,opt,name=B" json:"B,omitempty"`
	// Counter of the highest ballot accepted as committed.
	HC         uint32 `protobuf:"varint,2,opt,name=HC" json:"HC,omitempty"`
	QuorumHash string `protobuf:"bytes,3,opt,name=QuorumHash" json:"QuorumHash,omitempty"`
}

Externalize message for ballot protocol.

func DecodeExternalize

func DecodeExternalize(b []byte) (*Externalize, error)

Decode pb message to ballot externalize statement

func (*Externalize) Descriptor

func (*Externalize) Descriptor() ([]byte, []int)

func (*Externalize) GetB

func (m *Externalize) GetB() *Ballot

func (*Externalize) GetHC

func (m *Externalize) GetHC() uint32

func (*Externalize) GetQuorumHash

func (m *Externalize) GetQuorumHash() string

func (*Externalize) ProtoMessage

func (*Externalize) ProtoMessage()

func (*Externalize) Reset

func (m *Externalize) Reset()

func (*Externalize) String

func (m *Externalize) String() string

type Ledger

type Ledger struct {
	LedgerHeader *LedgerHeader `protobuf:"bytes,1,opt,name=LedgerHeader" json:"LedgerHeader,omitempty"`
	TxSet        *TxSet        `protobuf:"bytes,2,opt,name=TxSet" json:"TxSet,omitempty"`
}

Full ledger info of a ledger index.

func DecodeLedger

func DecodeLedger(b []byte) (*Ledger, error)

Decode pb message to ledger

func (*Ledger) Descriptor

func (*Ledger) Descriptor() ([]byte, []int)

func (*Ledger) GetLedgerHeader

func (m *Ledger) GetLedgerHeader() *LedgerHeader

func (*Ledger) GetTxSet

func (m *Ledger) GetTxSet() *TxSet

func (*Ledger) ProtoMessage

func (*Ledger) ProtoMessage()

func (*Ledger) Reset

func (m *Ledger) Reset()

func (*Ledger) String

func (m *Ledger) String() string

type LedgerCheckpoint

type LedgerCheckpoint struct {
	// Timestamp of last ledger closed.
	LastCloseTime int64 `protobuf:"varint,1,opt,name=LastCloseTime" json:"LastCloseTime,omitempty"`
	// The number of ledgers processed.
	LedgerHeaderCount int64 `protobuf:"varint,2,opt,name=LedgerHeaderCount" json:"LedgerHeaderCount,omitempty"`
	// The largest consensus index that the manager met.
	LargestConsensusIndex uint64 `protobuf:"varint,3,opt,name=LargestConsensusIndex" json:"LargestConsensusIndex,omitempty"`
	// Previous committed ledger header.
	PrevLedgerHeader *LedgerHeader `protobuf:"bytes,4,opt,name=PrevLedgerHeader" json:"PrevLedgerHeader,omitempty"`
	// Hash of previous committed ledger header.
	PrevLedgerHeaderHash string `protobuf:"bytes,5,opt,name=PrevLedgerHeaderHash" json:"PrevLedgerHeaderHash,omitempty"`
	// Current latest committed ledger header.
	CurrLedgerHeader *LedgerHeader `protobuf:"bytes,6,opt,name=CurrLedgerHeader" json:"CurrLedgerHeader,omitempty"`
	// Hash of current latest committed ledger header.
	CurrLedgerHeaderHash string `protobuf:"bytes,7,opt,name=CurrLedgerHeaderHash" json:"CurrLedgerHeaderHash,omitempty"`
}

LedgerCheckpoint contains the states of the latest closed ledger. It is mainly used for making the snapshot of the states of the latest closed ledger so that the node can recover its states after node failures.

func DecodeLedgerCheckpoint

func DecodeLedgerCheckpoint(b []byte) (*LedgerCheckpoint, error)

Decoder pb messge to ledger checkpoint.

func (*LedgerCheckpoint) Descriptor

func (*LedgerCheckpoint) Descriptor() ([]byte, []int)

func (*LedgerCheckpoint) GetCurrLedgerHeader

func (m *LedgerCheckpoint) GetCurrLedgerHeader() *LedgerHeader

func (*LedgerCheckpoint) GetCurrLedgerHeaderHash

func (m *LedgerCheckpoint) GetCurrLedgerHeaderHash() string

func (*LedgerCheckpoint) GetLargestConsensusIndex

func (m *LedgerCheckpoint) GetLargestConsensusIndex() uint64

func (*LedgerCheckpoint) GetLastCloseTime

func (m *LedgerCheckpoint) GetLastCloseTime() int64

func (*LedgerCheckpoint) GetLedgerHeaderCount

func (m *LedgerCheckpoint) GetLedgerHeaderCount() int64

func (*LedgerCheckpoint) GetPrevLedgerHeader

func (m *LedgerCheckpoint) GetPrevLedgerHeader() *LedgerHeader

func (*LedgerCheckpoint) GetPrevLedgerHeaderHash

func (m *LedgerCheckpoint) GetPrevLedgerHeaderHash() string

func (*LedgerCheckpoint) ProtoMessage

func (*LedgerCheckpoint) ProtoMessage()

func (*LedgerCheckpoint) Reset

func (m *LedgerCheckpoint) Reset()

func (*LedgerCheckpoint) String

func (m *LedgerCheckpoint) String() string

type LedgerHeader

type LedgerHeader struct {
	// Version of pb message, each time we update the pb message definition, the
	// version number will incremented. The specific version number to use is
	// hard coded and changed each time we do some changes.
	Version uint32 `protobuf:"varint,1,opt,name=Version" json:"Version,omitempty"`
	// Hash of the previous ledger.
	PrevLedgerHash string `protobuf:"bytes,2,opt,name=PrevLedgerHash" json:"PrevLedgerHash,omitempty"`
	// Hash of the transaction set in this ledger.
	TxSetHash string `protobuf:"bytes,3,opt,name=TxSetHash" json:"TxSetHash,omitempty"`
	// The consensus value the network agreed in hex coding string.
	ConsensusValue string `protobuf:"bytes,4,opt,name=ConsensusValue" json:"ConsensusValue,omitempty"`
	// Maximun number of transactions allowed in a transaction list.
	MaxTxListSize uint32 `protobuf:"varint,5,opt,name=MaxTxListSize" json:"MaxTxListSize,omitempty"`
	// Sequence number of this ledger.
	SeqNum uint64 `protobuf:"varint,6,opt,name=SeqNum" json:"SeqNum,omitempty"`
	// Total number of tokens in existence.
	TotalTokens int64 `protobuf:"varint,7,opt,name=TotalTokens" json:"TotalTokens,omitempty"`
	// Base fee per operation.
	BaseFee int64 `protobuf:"varint,8,opt,name=BaseFee" json:"BaseFee,omitempty"`
	// Base reserve for an account.
	BaseReserve int64 `protobuf:"varint,9,opt,name=BaseReserve" json:"BaseReserve,omitempty"`
}

func DecodeLedgerHeader

func DecodeLedgerHeader(b []byte) (*LedgerHeader, error)

Decode pb message to ledger header.

func (*LedgerHeader) Descriptor

func (*LedgerHeader) Descriptor() ([]byte, []int)

func (*LedgerHeader) GetBaseFee

func (m *LedgerHeader) GetBaseFee() int64

func (*LedgerHeader) GetBaseReserve

func (m *LedgerHeader) GetBaseReserve() int64

func (*LedgerHeader) GetConsensusValue

func (m *LedgerHeader) GetConsensusValue() string

func (*LedgerHeader) GetMaxTxListSize

func (m *LedgerHeader) GetMaxTxListSize() uint32

func (*LedgerHeader) GetPrevLedgerHash

func (m *LedgerHeader) GetPrevLedgerHash() string

func (*LedgerHeader) GetSeqNum

func (m *LedgerHeader) GetSeqNum() uint64

func (*LedgerHeader) GetTotalTokens

func (m *LedgerHeader) GetTotalTokens() int64

func (*LedgerHeader) GetTxSetHash

func (m *LedgerHeader) GetTxSetHash() string

func (*LedgerHeader) GetVersion

func (m *LedgerHeader) GetVersion() uint32

func (*LedgerHeader) ProtoMessage

func (*LedgerHeader) ProtoMessage()

func (*LedgerHeader) Reset

func (m *LedgerHeader) Reset()

func (*LedgerHeader) String

func (m *LedgerHeader) String() string

type Liability

type Liability struct {
	// Buying liability.
	Buying int64 `protobuf:"varint,1,opt,name=Buying" json:"Buying,omitempty"`
	// Selling liability.
	Selling int64 `protobuf:"varint,2,opt,name=Selling" json:"Selling,omitempty"`
}

Account and Trust liabilities.

func (*Liability) Descriptor

func (*Liability) Descriptor() ([]byte, []int)

func (*Liability) GetBuying

func (m *Liability) GetBuying() int64

func (*Liability) GetSelling

func (m *Liability) GetSelling() int64

func (*Liability) ProtoMessage

func (*Liability) ProtoMessage()

func (*Liability) Reset

func (m *Liability) Reset()

func (*Liability) String

func (m *Liability) String() string

type Nominate

type Nominate struct {
	VoteList   []string `protobuf:"bytes,1,rep,name=VoteList" json:"VoteList,omitempty"`
	AcceptList []string `protobuf:"bytes,2,rep,name=AcceptList" json:"AcceptList,omitempty"`
	QuorumHash string   `protobuf:"bytes,3,opt,name=QuorumHash" json:"QuorumHash,omitempty"`
}

Nominate statement is used to find a candidate value for a specific decree.

func DecodeNominate

func DecodeNominate(b []byte) (*Nominate, error)

Decode pb message to nominate statement

func (*Nominate) Descriptor

func (*Nominate) Descriptor() ([]byte, []int)

func (*Nominate) GetAcceptList

func (m *Nominate) GetAcceptList() []string

func (*Nominate) GetQuorumHash

func (m *Nominate) GetQuorumHash() string

func (*Nominate) GetVoteList

func (m *Nominate) GetVoteList() []string

func (*Nominate) ProtoMessage

func (*Nominate) ProtoMessage()

func (*Nominate) Reset

func (m *Nominate) Reset()

func (*Nominate) String

func (m *Nominate) String() string

type Offer

type Offer struct {
	// Seller of the offer.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// ID of the offer.
	OfferID string `protobuf:"bytes,2,opt,name=OfferID" json:"OfferID,omitempty"`
	// Asset for selling.
	SellAsset *Asset `protobuf:"bytes,3,opt,name=SellAsset" json:"SellAsset,omitempty"`
	// Asset for buying.
	BuyAsset *Asset `protobuf:"bytes,4,opt,name=BuyAsset" json:"BuyAsset,omitempty"`
	// The amount of asset for selling.
	Amount int64 `protobuf:"varint,5,opt,name=Amount" json:"Amount,omitempty"`
	// The price of the selling asset in terms of buying asset.
	Price *Price `protobuf:"bytes,6,opt,name=Price" json:"Price,omitempty"`
	// Whether the offer is passive.
	Passive int32 `protobuf:"varint,7,opt,name=Passive" json:"Passive,omitempty"`
}

func DecodeOffer

func DecodeOffer(b []byte) (*Offer, error)

Decode pb message to offer

func (*Offer) Descriptor

func (*Offer) Descriptor() ([]byte, []int)

func (*Offer) GetAccountID

func (m *Offer) GetAccountID() string

func (*Offer) GetAmount

func (m *Offer) GetAmount() int64

func (*Offer) GetBuyAsset

func (m *Offer) GetBuyAsset() *Asset

func (*Offer) GetOfferID

func (m *Offer) GetOfferID() string

func (*Offer) GetPassive

func (m *Offer) GetPassive() int32

func (*Offer) GetPrice

func (m *Offer) GetPrice() *Price

func (*Offer) GetSellAsset

func (m *Offer) GetSellAsset() *Asset

func (*Offer) ProtoMessage

func (*Offer) ProtoMessage()

func (*Offer) Reset

func (m *Offer) Reset()

func (*Offer) String

func (m *Offer) String() string

type OfferOp

type OfferOp struct {
	// Asset for selling.
	SellingAsset *Asset `protobuf:"bytes,1,opt,name=SellingAsset" json:"SellingAsset,omitempty"`
	// Asset for buying.
	BuyingAsset *Asset `protobuf:"bytes,2,opt,name=BuyingAsset" json:"BuyingAsset,omitempty"`
	// The amount of asset for selling.
	Amount int64 `protobuf:"varint,3,opt,name=Amount" json:"Amount,omitempty"`
	// The price of selling asset in terms of buying asset in fractional format.
	// For instance, if the price = 3/4, then it means the price of one selling
	// asset is 3/4 buying asset.
	Price *Price `protobuf:"bytes,4,opt,name=Price" json:"Price,omitempty"`
	// ID of this offer, this field is empty for an new offer.
	OfferID string `protobuf:"bytes,5,opt,name=OfferID" json:"OfferID,omitempty"`
	// Whether the offer is passive.
	Passive int32 `protobuf:"varint,6,opt,name=Passive" json:"Passive,omitempty"`
}

OfferOp creates an asset exchange offer to exchange specified asset pairs.

func (*OfferOp) Descriptor

func (*OfferOp) Descriptor() ([]byte, []int)

func (*OfferOp) GetAmount

func (m *OfferOp) GetAmount() int64

func (*OfferOp) GetBuyingAsset

func (m *OfferOp) GetBuyingAsset() *Asset

func (*OfferOp) GetOfferID

func (m *OfferOp) GetOfferID() string

func (*OfferOp) GetPassive

func (m *OfferOp) GetPassive() int32

func (*OfferOp) GetPrice

func (m *OfferOp) GetPrice() *Price

func (*OfferOp) GetSellingAsset

func (m *OfferOp) GetSellingAsset() *Asset

func (*OfferOp) ProtoMessage

func (*OfferOp) ProtoMessage()

func (*OfferOp) Reset

func (m *OfferOp) Reset()

func (*OfferOp) String

func (m *OfferOp) String() string

type Op

type Op struct {
	OpType OpType `protobuf:"varint,1,opt,name=OpType,enum=ultpb.OpType" json:"OpType,omitempty"`
	// Types that are valid to be assigned to Op:
	//	*Op_CreateAccount
	//	*Op_Payment
	//	*Op_PathPayment
	//	*Op_Trust
	Op isOp_Op `protobuf_oneof:"Op"`
}

Operation is the concrete way to mutate a account.

func (*Op) Descriptor

func (*Op) Descriptor() ([]byte, []int)

func (*Op) GetCreateAccount

func (m *Op) GetCreateAccount() *CreateAccountOp

func (*Op) GetOp

func (m *Op) GetOp() isOp_Op

func (*Op) GetOpType

func (m *Op) GetOpType() OpType

func (*Op) GetPathPayment

func (m *Op) GetPathPayment() *PathPaymentOp

func (*Op) GetPayment

func (m *Op) GetPayment() *PaymentOp

func (*Op) GetTrust

func (m *Op) GetTrust() *TrustOp

func (*Op) ProtoMessage

func (*Op) ProtoMessage()

func (*Op) Reset

func (m *Op) Reset()

func (*Op) String

func (m *Op) String() string

func (*Op) XXX_OneofFuncs

func (*Op) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type OpType

type OpType int32

Every operation is related to a specific account and each transaction could contain one or more operations.

const (
	OpType_CREATE_ACCOUNT OpType = 0
	OpType_PAYMENT        OpType = 1
	OpType_PATH_PAYMENT   OpType = 2
	OpType_TRUST          OpType = 3
)

func (OpType) EnumDescriptor

func (OpType) EnumDescriptor() ([]byte, []int)

func (OpType) String

func (x OpType) String() string

type Op_CreateAccount

type Op_CreateAccount struct {
	CreateAccount *CreateAccountOp `protobuf:"bytes,2,opt,name=CreateAccount,oneof"`
}

type Op_PathPayment

type Op_PathPayment struct {
	PathPayment *PathPaymentOp `protobuf:"bytes,4,opt,name=PathPayment,oneof"`
}

type Op_Payment

type Op_Payment struct {
	Payment *PaymentOp `protobuf:"bytes,3,opt,name=Payment,oneof"`
}

type Op_Trust

type Op_Trust struct {
	Trust *TrustOp `protobuf:"bytes,5,opt,name=Trust,oneof"`
}

type PathPaymentOp

type PathPaymentOp struct {
	// Source asset to send.
	SrcAsset *Asset `protobuf:"bytes,1,opt,name=SrcAsset" json:"SrcAsset,omitempty"`
	// The amount of source asset to send.
	SrcAmount int64 `protobuf:"varint,2,opt,name=SrcAmount" json:"SrcAmount,omitempty"`
	// Destination account of the path payment.
	AccountID string `protobuf:"bytes,3,opt,name=AccountID" json:"AccountID,omitempty"`
	// Destination asset type.
	DstAsset *Asset `protobuf:"bytes,4,opt,name=DstAsset" json:"DstAsset,omitempty"`
	// Payment asset path.
	Path []*Asset `protobuf:"bytes,5,rep,name=Path" json:"Path,omitempty"`
}

PathPaymentOp creates an peer-to-peer payment which could use multiple hops of asset exchanges to reach the deal by utilizing an intelligent asset exchanges path.

func (*PathPaymentOp) Descriptor

func (*PathPaymentOp) Descriptor() ([]byte, []int)

func (*PathPaymentOp) GetAccountID

func (m *PathPaymentOp) GetAccountID() string

func (*PathPaymentOp) GetDstAsset

func (m *PathPaymentOp) GetDstAsset() *Asset

func (*PathPaymentOp) GetPath

func (m *PathPaymentOp) GetPath() []*Asset

func (*PathPaymentOp) GetSrcAmount

func (m *PathPaymentOp) GetSrcAmount() int64

func (*PathPaymentOp) GetSrcAsset

func (m *PathPaymentOp) GetSrcAsset() *Asset

func (*PathPaymentOp) ProtoMessage

func (*PathPaymentOp) ProtoMessage()

func (*PathPaymentOp) Reset

func (m *PathPaymentOp) Reset()

func (*PathPaymentOp) String

func (m *PathPaymentOp) String() string

type PaymentOp

type PaymentOp struct {
	// Destination account of the payment.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// Asset type of payment.
	Asset *Asset `protobuf:"bytes,2,opt,name=Asset" json:"Asset,omitempty"`
	// The amount of payment in specified asset type.
	Amount int64 `protobuf:"varint,3,opt,name=Amount" json:"Amount,omitempty"`
}

PaymentOp creates an peer-to-peer payment from the source account to the destination account in specified asset type.

func DecodePaymentOp

func DecodePaymentOp(b []byte) (*PaymentOp, error)

Decode pb message to PaymentOp

func (*PaymentOp) Descriptor

func (*PaymentOp) Descriptor() ([]byte, []int)

func (*PaymentOp) GetAccountID

func (m *PaymentOp) GetAccountID() string

func (*PaymentOp) GetAmount

func (m *PaymentOp) GetAmount() int64

func (*PaymentOp) GetAsset

func (m *PaymentOp) GetAsset() *Asset

func (*PaymentOp) ProtoMessage

func (*PaymentOp) ProtoMessage()

func (*PaymentOp) Reset

func (m *PaymentOp) Reset()

func (*PaymentOp) String

func (m *PaymentOp) String() string

type Prepare

type Prepare struct {
	// Current working ballot.
	B *Ballot `protobuf:"bytes,1,opt,name=B" json:"B,omitempty"`
	// Two hightest ballots accepted as
	// prepared such as Q < P and Q ~ P.
	Q *Ballot `protobuf:"bytes,2,opt,name=Q" json:"Q,omitempty"`
	P *Ballot `protobuf:"bytes,3,opt,name=P" json:"P,omitempty"`
	// Counter of highest ballot confirmed as prepared.
	HC uint32 `protobuf:"varint,4,opt,name=HC" json:"HC,omitempty"`
	// Counter of lowest ballot confirmed as prepared.
	LC         uint32 `protobuf:"varint,5,opt,name=LC" json:"LC,omitempty"`
	QuorumHash string `protobuf:"bytes,6,opt,name=QuorumHash" json:"QuorumHash,omitempty"`
}

Prepare message for ballot protocol.

func DecodePrepare

func DecodePrepare(b []byte) (*Prepare, error)

Decode pb message to ballot prepare statement

func (*Prepare) Descriptor

func (*Prepare) Descriptor() ([]byte, []int)

func (*Prepare) GetB

func (m *Prepare) GetB() *Ballot

func (*Prepare) GetHC

func (m *Prepare) GetHC() uint32

func (*Prepare) GetLC

func (m *Prepare) GetLC() uint32

func (*Prepare) GetP

func (m *Prepare) GetP() *Ballot

func (*Prepare) GetQ

func (m *Prepare) GetQ() *Ballot

func (*Prepare) GetQuorumHash

func (m *Prepare) GetQuorumHash() string

func (*Prepare) ProtoMessage

func (*Prepare) ProtoMessage()

func (*Prepare) Reset

func (m *Prepare) Reset()

func (*Prepare) String

func (m *Prepare) String() string

type Price

type Price struct {
	Numerator   int64 `protobuf:"varint,1,opt,name=Numerator" json:"Numerator,omitempty"`
	Denominator int64 `protobuf:"varint,2,opt,name=Denominator" json:"Denominator,omitempty"`
}

func (*Price) Descriptor

func (*Price) Descriptor() ([]byte, []int)

func (*Price) GetDenominator

func (m *Price) GetDenominator() int64

func (*Price) GetNumerator

func (m *Price) GetNumerator() int64

func (*Price) ProtoMessage

func (*Price) ProtoMessage()

func (*Price) Reset

func (m *Price) Reset()

func (*Price) String

func (m *Price) String() string

type Quorum

type Quorum struct {
	// We choose the threshold to be a floatint point number instead of
	// an integer to maintain a more conservative and safer
	// requirement of the quorum. For instance, if the threshold
	// is 0.6 and the number of validators is 7, the required number
	// of nodes needed to pass a decision would be 4.2 in floating point,
	// and we take the ceiling of the number to be the final required
	// integer threshold which is 5. As a result the requirement
	// is sticter than that to set the threshold to 4 in integer form.
	Threshold   float64   `protobuf:"fixed64,1,opt,name=Threshold" json:"Threshold,omitempty"`
	Validators  []string  `protobuf:"bytes,2,rep,name=Validators" json:"Validators,omitempty"`
	NestQuorums []*Quorum `protobuf:"bytes,3,rep,name=NestQuorums" json:"NestQuorums,omitempty"`
}

Each ULTNode is associated with a quorum, every message related to FBA consensus should contain the quorum of the node.

func DecodeQuorum

func DecodeQuorum(b []byte) (*Quorum, error)

Decode pb message to quorum

func (*Quorum) Descriptor

func (*Quorum) Descriptor() ([]byte, []int)

func (*Quorum) GetNestQuorums

func (m *Quorum) GetNestQuorums() []*Quorum

func (*Quorum) GetThreshold

func (m *Quorum) GetThreshold() float64

func (*Quorum) GetValidators

func (m *Quorum) GetValidators() []string

func (*Quorum) ProtoMessage

func (*Quorum) ProtoMessage()

func (*Quorum) Reset

func (m *Quorum) Reset()

func (*Quorum) String

func (m *Quorum) String() string

type Statement

type Statement struct {
	StatementType StatementType `protobuf:"varint,1,opt,name=StatementType,enum=ultpb.StatementType" json:"StatementType,omitempty"`
	// Node ID of source node.
	NodeID string `protobuf:"bytes,2,opt,name=NodeID" json:"NodeID,omitempty"`
	// Decree index.
	Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index,omitempty"`
	// Types that are valid to be assigned to Stmt:
	//	*Statement_Nominate
	//	*Statement_Prepare
	//	*Statement_Confirm
	//	*Statement_Externalize
	Stmt isStatement_Stmt `protobuf_oneof:"Stmt"`
}

func DecodeStatement

func DecodeStatement(b []byte) (*Statement, error)

Decode pb message to statement

func (*Statement) Descriptor

func (*Statement) Descriptor() ([]byte, []int)

func (*Statement) GetConfirm

func (m *Statement) GetConfirm() *Confirm

func (*Statement) GetExternalize

func (m *Statement) GetExternalize() *Externalize

func (*Statement) GetIndex

func (m *Statement) GetIndex() uint64

func (*Statement) GetNodeID

func (m *Statement) GetNodeID() string

func (*Statement) GetNominate

func (m *Statement) GetNominate() *Nominate

func (*Statement) GetPrepare

func (m *Statement) GetPrepare() *Prepare

func (*Statement) GetStatementType

func (m *Statement) GetStatementType() StatementType

func (*Statement) GetStmt

func (m *Statement) GetStmt() isStatement_Stmt

func (*Statement) ProtoMessage

func (*Statement) ProtoMessage()

func (*Statement) Reset

func (m *Statement) Reset()

func (*Statement) String

func (m *Statement) String() string

func (*Statement) XXX_OneofFuncs

func (*Statement) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

type StatementType

type StatementType int32

Statement is an abstractive value for nodes to vote and reach consensus. Each statement type has its corresponding data encoded in pb and saved in Data field.

const (
	StatementType_NOMINATE    StatementType = 0
	StatementType_PREPARE     StatementType = 1
	StatementType_CONFIRM     StatementType = 2
	StatementType_EXTERNALIZE StatementType = 3
)

func (StatementType) EnumDescriptor

func (StatementType) EnumDescriptor() ([]byte, []int)

func (StatementType) String

func (x StatementType) String() string

type Statement_Confirm

type Statement_Confirm struct {
	Confirm *Confirm `protobuf:"bytes,6,opt,name=Confirm,oneof"`
}

type Statement_Externalize

type Statement_Externalize struct {
	Externalize *Externalize `protobuf:"bytes,7,opt,name=Externalize,oneof"`
}

type Statement_Nominate

type Statement_Nominate struct {
	Nominate *Nominate `protobuf:"bytes,4,opt,name=Nominate,oneof"`
}

type Statement_Prepare

type Statement_Prepare struct {
	Prepare *Prepare `protobuf:"bytes,5,opt,name=Prepare,oneof"`
}

type Trust

type Trust struct {
	// Owner of this trust.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// Trusted asset.
	Asset *Asset `protobuf:"bytes,2,opt,name=Asset" json:"Asset,omitempty"`
	// Balance of the trusted asset.
	Balance int64 `protobuf:"varint,3,opt,name=Balance" json:"Balance,omitempty"`
	// Upper limit the balance of the trusted asset.
	Limit int64 `protobuf:"varint,4,opt,name=Limit" json:"Limit,omitempty"`
	// Liability of the trusted asset.
	Liability *Liability `protobuf:"bytes,5,opt,name=Liability" json:"Liability,omitempty"`
	// Whether the trust if authorized.
	Authorized int32 `protobuf:"varint,6,opt,name=Authorized" json:"Authorized,omitempty"`
}

func DecodeTrust

func DecodeTrust(b []byte) (*Trust, error)

Decode pb message to trust

func (*Trust) Descriptor

func (*Trust) Descriptor() ([]byte, []int)

func (*Trust) GetAccountID

func (m *Trust) GetAccountID() string

func (*Trust) GetAsset

func (m *Trust) GetAsset() *Asset

func (*Trust) GetAuthorized

func (m *Trust) GetAuthorized() int32

func (*Trust) GetBalance

func (m *Trust) GetBalance() int64

func (*Trust) GetLiability

func (m *Trust) GetLiability() *Liability

func (*Trust) GetLimit

func (m *Trust) GetLimit() int64

func (*Trust) ProtoMessage

func (*Trust) ProtoMessage()

func (*Trust) Reset

func (m *Trust) Reset()

func (*Trust) String

func (m *Trust) String() string

type TrustOp

type TrustOp struct {
	// Asset to trust.
	Asset *Asset `protobuf:"bytes,2,opt,name=Asset" json:"Asset,omitempty"`
	// Limit of the trustline.
	Limit int64 `protobuf:"varint,3,opt,name=Limit" json:"Limit,omitempty"`
}

TrustOp creates a trustline for the source account to trust a custom asset issued by other account.

func (*TrustOp) Descriptor

func (*TrustOp) Descriptor() ([]byte, []int)

func (*TrustOp) GetAsset

func (m *TrustOp) GetAsset() *Asset

func (*TrustOp) GetLimit

func (m *TrustOp) GetLimit() int64

func (*TrustOp) ProtoMessage

func (*TrustOp) ProtoMessage()

func (*TrustOp) Reset

func (m *TrustOp) Reset()

func (*TrustOp) String

func (m *TrustOp) String() string

type Tx

type Tx struct {
	// The source account for the transaction.
	AccountID string `protobuf:"bytes,1,opt,name=AccountID" json:"AccountID,omitempty"`
	// Fee of the transaction that the source account wishes to pay.
	Fee int64 `protobuf:"varint,2,opt,name=Fee" json:"Fee,omitempty"`
	// Extra note about the transaction.
	Note string `protobuf:"bytes,3,opt,name=Note" json:"Note,omitempty"`
	// Unique transaction sequence number, the number is used for
	// distinguishing transactions initiated from the same source
	// account. The number should be larger than the latest sequence
	// number of the confirmed transactions belong to the source account.
	SeqNum uint64 `protobuf:"varint,4,opt,name=SeqNum" json:"SeqNum,omitempty"`
	// List of operations.
	OpList []*Op `protobuf:"bytes,5,rep,name=OpList" json:"OpList,omitempty"`
}

Tx is the abstraction of the concrete actions that the node will execute.

func DecodeTx

func DecodeTx(b []byte) (*Tx, error)

Decode pb message to Tx

func (*Tx) Descriptor

func (*Tx) Descriptor() ([]byte, []int)

func (*Tx) GetAccountID

func (m *Tx) GetAccountID() string

func (*Tx) GetFee

func (m *Tx) GetFee() int64

func (*Tx) GetNote

func (m *Tx) GetNote() string

func (*Tx) GetOpList

func (m *Tx) GetOpList() []*Op

func (*Tx) GetSeqNum

func (m *Tx) GetSeqNum() uint64

func (*Tx) ProtoMessage

func (*Tx) ProtoMessage()

func (*Tx) Reset

func (m *Tx) Reset()

func (*Tx) String

func (m *Tx) String() string

type TxSet

type TxSet struct {
	// Hash of previous closed ledger header.
	PrevLedgerHash string `protobuf:"bytes,1,opt,name=PrevLedgerHash" json:"PrevLedgerHash,omitempty"`
	// List of transactions.
	TxList []*Tx `protobuf:"bytes,2,rep,name=TxList" json:"TxList,omitempty"`
}

TxSet is the container of a number of transactions that are waiting to be confirmed in consensus by the Ultiledger network.

func DecodeTxSet

func DecodeTxSet(b []byte) (*TxSet, error)

Decode pb message to txset

func (*TxSet) Descriptor

func (*TxSet) Descriptor() ([]byte, []int)

func (*TxSet) GetPrevLedgerHash

func (m *TxSet) GetPrevLedgerHash() string

func (*TxSet) GetTxList

func (m *TxSet) GetTxList() []*Tx

func (*TxSet) ProtoMessage

func (*TxSet) ProtoMessage()

func (*TxSet) Reset

func (m *TxSet) Reset()

func (*TxSet) String

func (m *TxSet) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳