ripple: github.com/donovanhide/ripple/data Index | Examples | Files

package data

import "github.com/donovanhide/ripple/data"

Package data aims to provides all the data types that are needed to build tools, clients and servers for use on the Ripple network.

Ledger

The ledger is a mixture of various data types, all persisted in the form of a key and value. The value contains a node, and some nodes refer to other nodes by their index. An index may or may not be equivalent to a node's key. A ledger consists of a LedgerHeader as the root of two trees, one for the transactions in that ledger and one for the state of all accounts at that point in time.

A ledger refers to its predecessor, which has a completely different tree for its transactions, but the account state tree will share most of its nodes with its successors and predecessors.

The full ledger consists of a sequence of such ledgers, each referring to, and dependent on its predecessor.

Important terms are key, value, index, hash and node. Keys, indexes and hashes are always 32 bytes in length and involve the use of the SHA512 cryptographic hash algorithm, discarding the last 32 bytes of the resulting hash. Sometimes they are the same thing, sometimes not.

LedgerHeader

This is the root of the two trees for a single ledger. It contains information about the ledger and its predecessor. A ledger header node is never reused between ledgers.

Node:	Simple big-endian binary encoding of LedgerHeader
Index:  SHA512Half of HP_LEDGER_MASTER:Node
Hash:	Same as Index

Key:	Index
Value:	LedgerSequence:LedgerSequence:NT_LEDGER:HP_LEDGER_MASTER:Node

Inner Node

This is a node in either the transaction or account state tree which contains up to 16 hashes of other nodes. The position of the hash represents a 4 bit nibble of the index that is being searched for in the tree. An account state inner node may be reused between ledgers, a transaction inner node will never be reused.

Node:	Simple big-endian binary encoding of 16 x 32 byte hashes
Index:	SHA512Half of HP_INNER_NODE:Node
Hash:	Same as Index

Key: 	Index
Value:	LedgerSequence:LedgerSequence:NT_ACCOUNT_NODE or NT_TRANSACTION_NODE:HP_INNER_NODE:Node

TransactionWithMetadata Node

This contains a Transaction with Metadata describing how the LedgerEntry nodes were altered. It has the most complex structure of all nodes. A TransactionWithMetadata node is never reused between ledgers. VL is a variable length marker.

Node: 	Complex encoding of Transaction
Index:	SHA512Half of HP_TRANSACTION_ID:Node
Hash:	SHA512Half of HP_TRANSACTION_NODE:VL:Node:VL:Metadata:Index

Key:	Hash
Value:	LedgerSequence:LedgerSequence:NT_TRANSACTION_NODE:HP_TRANSACTION_NODE:VL:Node:VL:Metadata:Index

LedgerEntry Node

This contains the state of an account after a transaction has been applied. Ledger Entry nodes may be reused between ledgers.

Node:	Complex encoding of LedgerEntry
Index:	SHA512Half of namespace and a type-specific rule
Hash:	SHA512Half of HP_LEAF_NODE:Node:Index

Key:	Hash
Value:	LedgerSequence:LedgerSequence:NT_ACCOUNT_NODE:HP_LEAF_NODE:Node:Index

Index

Examples

Package Files

amount.go balance.go currency.go decoder.go doc.go encoder.go factory.go flags.go format.go hash.go index.go inner.go interface.go json.go ledger.go ledgerentry.go ledgerset.go memo.go metadata.go orderbook.go path.go proposal.go reader.go result.go signing.go time.go trade.go transaction.go util.go validation.go value.go wire.go

Constants

const (
    // LedgerEntryType values come from rippled's "LedgerFormats.h"
    SIGNER_LIST   LedgerEntryType = 0x53 // 'S'
    TICKET        LedgerEntryType = 0x54 // 'T'
    ACCOUNT_ROOT  LedgerEntryType = 0x61 // 'a'
    DIRECTORY     LedgerEntryType = 0x64 // 'd'
    AMENDMENTS    LedgerEntryType = 0x66 // 'f'
    LEDGER_HASHES LedgerEntryType = 0x68 // 'h'
    OFFER         LedgerEntryType = 0x6f // 'o'
    RIPPLE_STATE  LedgerEntryType = 0x72 // 'r'
    FEE_SETTINGS  LedgerEntryType = 0x73 // 's'
    ESCROW        LedgerEntryType = 0x75 // 'u'
    PAY_CHANNEL   LedgerEntryType = 0x78 // 'x'
    CHECK         LedgerEntryType = 0x63 // 'C'

    // TransactionType values come from rippled's "TxFormats.h"
    PAYMENT         TransactionType = 0
    ESCROW_CREATE   TransactionType = 1
    ESCROW_FINISH   TransactionType = 2
    ACCOUNT_SET     TransactionType = 3
    ESCROW_CANCEL   TransactionType = 4
    SET_REGULAR_KEY TransactionType = 5
    OFFER_CREATE    TransactionType = 7
    OFFER_CANCEL    TransactionType = 8
    TICKET_CREATE   TransactionType = 10
    TICKET_CANCEL   TransactionType = 11
    SIGNER_LIST_SET TransactionType = 12
    PAYCHAN_CREATE  TransactionType = 13
    PAYCHAN_FUND    TransactionType = 14
    PAYCHAN_CLAIM   TransactionType = 15
    CHECK_CREATE    TransactionType = 16
    CHECK_CASH      TransactionType = 17
    CHECK_CANCEL    TransactionType = 18
    TRUST_SET       TransactionType = 20
    AMENDMENT       TransactionType = 100
    SET_FEE         TransactionType = 101
)
const (
    // Hash Prefixes
    HP_TRANSACTION_ID   HashPrefix = 0x54584E00 // 'TXN' transaction
    HP_TRANSACTION_NODE HashPrefix = 0x534E4400 // 'SND' transaction plus metadata (probably should have been TND!)
    HP_LEAF_NODE        HashPrefix = 0x4D4C4E00 // 'MLN' account state
    HP_INNER_NODE       HashPrefix = 0x4D494E00 // 'MIN' inner node in tree
    HP_LEDGER_MASTER    HashPrefix = 0x4C575200 // 'LWR' ledger master data for signing (probably should have been LGR!)
    HP_TRANSACTION_SIGN HashPrefix = 0x53545800 // 'STX' inner transaction to sign
    HP_VALIDATION       HashPrefix = 0x56414C00 // 'VAL' validation for signing
    HP_PROPOSAL         HashPrefix = 0x50525000 // 'PRP' proposal for signing

    // Node Types
    NT_UNKNOWN          NodeType = 0
    NT_LEDGER           NodeType = 1
    NT_TRANSACTION      NodeType = 2
    NT_ACCOUNT_NODE     NodeType = 3
    NT_TRANSACTION_NODE NodeType = 4

    // Node Formats
    NF_PREFIX NodeFormat = 1
    NF_HASH   NodeFormat = 2
    NF_WIRE   NodeFormat = 3

    // Ledger index NameSpaces
    NS_ACCOUNT         LedgerNamespace = 'a'
    NS_DIRECTORY_NODE  LedgerNamespace = 'd'
    NS_RIPPLE_STATE    LedgerNamespace = 'r'
    NS_OFFER           LedgerNamespace = 'o' // Entry for an offer
    NS_OWNER_DIRECTORY LedgerNamespace = 'O' // Directory of things owned by an account
    NS_BOOK_DIRECTORY  LedgerNamespace = 'B' // Directory of order books
    NS_SKIP_LIST       LedgerNamespace = 's'
    NS_AMENDMENT       LedgerNamespace = 'f'
    NS_FEE             LedgerNamespace = 'e'
    NS_SUSPAY          LedgerNamespace = 'u'
    NS_TICKET          LedgerNamespace = 'T'
    NS_SIGNER_LIST     LedgerNamespace = 'S'
    NS_XRPU_CHANNEL    LedgerNamespace = 'x'
)
const (
    ST_UINT16    uint8 = 1
    ST_UINT32    uint8 = 2
    ST_UINT64    uint8 = 3
    ST_HASH128   uint8 = 4
    ST_HASH256   uint8 = 5
    ST_AMOUNT    uint8 = 6
    ST_VL        uint8 = 7
    ST_ACCOUNT   uint8 = 8
    ST_OBJECT    uint8 = 14
    ST_ARRAY     uint8 = 15
    ST_UINT8     uint8 = 16
    ST_HASH160   uint8 = 17
    ST_PATHSET   uint8 = 18
    ST_VECTOR256 uint8 = 19
)
const (
    PATH_BOUNDARY pathEntry = 0xFF
    PATH_END      pathEntry = 0x00

    PATH_ACCOUNT  pathEntry = 0x01
    PATH_REDEEM   pathEntry = 0x02
    PATH_CURRENCY pathEntry = 0x10
    PATH_ISSUER   pathEntry = 0x20
)

Variables

var HashableTypes []string
var LedgerEntryFactory = [...]func() LedgerEntry{
    ACCOUNT_ROOT:  func() LedgerEntry { return &AccountRoot{leBase: leBase{LedgerEntryType: ACCOUNT_ROOT}} },
    DIRECTORY:     func() LedgerEntry { return &Directory{leBase: leBase{LedgerEntryType: DIRECTORY}} },
    AMENDMENTS:    func() LedgerEntry { return &Amendments{leBase: leBase{LedgerEntryType: AMENDMENTS}} },
    LEDGER_HASHES: func() LedgerEntry { return &LedgerHashes{leBase: leBase{LedgerEntryType: LEDGER_HASHES}} },
    OFFER:         func() LedgerEntry { return &Offer{leBase: leBase{LedgerEntryType: OFFER}} },
    RIPPLE_STATE:  func() LedgerEntry { return &RippleState{leBase: leBase{LedgerEntryType: RIPPLE_STATE}} },
    FEE_SETTINGS:  func() LedgerEntry { return &FeeSettings{leBase: leBase{LedgerEntryType: FEE_SETTINGS}} },
    ESCROW:        func() LedgerEntry { return &Escrow{leBase: leBase{LedgerEntryType: ESCROW}} },
    SIGNER_LIST:   func() LedgerEntry { return &SignerList{leBase: leBase{LedgerEntryType: SIGNER_LIST}} },
    TICKET:        func() LedgerEntry { return &Ticket{leBase: leBase{LedgerEntryType: TICKET}} },
    PAY_CHANNEL:   func() LedgerEntry { return &PayChannel{leBase: leBase{LedgerEntryType: PAY_CHANNEL}} },
    CHECK:         func() LedgerEntry { return &Check{leBase: leBase{LedgerEntryType: CHECK}} },
}
var LedgerFactory = [...]func() Hashable{
    func() Hashable { return &Ledger{} },
}
var TxFactory = [...]func() Transaction{
    PAYMENT:         func() Transaction { return &Payment{TxBase: TxBase{TransactionType: PAYMENT}} },
    ACCOUNT_SET:     func() Transaction { return &AccountSet{TxBase: TxBase{TransactionType: ACCOUNT_SET}} },
    SET_REGULAR_KEY: func() Transaction { return &SetRegularKey{TxBase: TxBase{TransactionType: SET_REGULAR_KEY}} },
    OFFER_CREATE:    func() Transaction { return &OfferCreate{TxBase: TxBase{TransactionType: OFFER_CREATE}} },
    OFFER_CANCEL:    func() Transaction { return &OfferCancel{TxBase: TxBase{TransactionType: OFFER_CANCEL}} },
    TRUST_SET:       func() Transaction { return &TrustSet{TxBase: TxBase{TransactionType: TRUST_SET}} },
    AMENDMENT:       func() Transaction { return &Amendment{TxBase: TxBase{TransactionType: AMENDMENT}} },
    SET_FEE:         func() Transaction { return &SetFee{TxBase: TxBase{TransactionType: SET_FEE}} },
    ESCROW_CREATE:   func() Transaction { return &EscrowCreate{TxBase: TxBase{TransactionType: ESCROW_CREATE}} },
    ESCROW_FINISH:   func() Transaction { return &EscrowFinish{TxBase: TxBase{TransactionType: ESCROW_FINISH}} },
    ESCROW_CANCEL:   func() Transaction { return &EscrowCancel{TxBase: TxBase{TransactionType: ESCROW_CANCEL}} },
    SIGNER_LIST_SET: func() Transaction { return &SignerListSet{TxBase: TxBase{TransactionType: SIGNER_LIST_SET}} },
    PAYCHAN_CREATE:  func() Transaction { return &PaymentChannelCreate{TxBase: TxBase{TransactionType: PAYCHAN_CREATE}} },
    PAYCHAN_FUND:    func() Transaction { return &PaymentChannelFund{TxBase: TxBase{TransactionType: PAYCHAN_FUND}} },
    PAYCHAN_CLAIM:   func() Transaction { return &PaymentChannelClaim{TxBase: TxBase{TransactionType: PAYCHAN_CLAIM}} },
    CHECK_CREATE:    func() Transaction { return &CheckCreate{TxBase: TxBase{TransactionType: CHECK_CREATE}} },
    CHECK_CASH:      func() Transaction { return &CheckCash{TxBase: TxBase{TransactionType: CHECK_CASH}} },
    CHECK_CANCEL:    func() Transaction { return &CheckCancel{TxBase: TxBase{TransactionType: CHECK_CANCEL}} },
}

func CheckSignature Uses

func CheckSignature(s Signer) (bool, error)

func GetLedgerEntryFactoryByType Uses

func GetLedgerEntryFactoryByType(leType string) func() LedgerEntry

func GetTxFactoryByType Uses

func GetTxFactoryByType(txType string) func() Transaction

func Sign Uses

func Sign(s Signer, key crypto.Key, sequence *uint32) error

type Account Uses

type Account [20]byte

func NewAccountFromAddress Uses

func NewAccountFromAddress(s string) (*Account, error)

Expects address in base58 form

func (*Account) Bytes Uses

func (a *Account) Bytes() []byte

func (Account) Compare Uses

func (a Account) Compare(b Account) int

func (Account) Equals Uses

func (a Account) Equals(b Account) bool

func (Account) Hash Uses

func (a Account) Hash() (crypto.Hash, error)

func (Account) Hash256 Uses

func (a Account) Hash256() Hash256

func (Account) IsZero Uses

func (a Account) IsZero() bool

func (Account) Less Uses

func (a Account) Less(b Account) bool

func (*Account) Marshal Uses

func (a *Account) Marshal(w io.Writer) error

func (Account) MarshalText Uses

func (a Account) MarshalText() ([]byte, error)

func (Account) String Uses

func (a Account) String() string

func (*Account) Unmarshal Uses

func (a *Account) Unmarshal(r Reader) error

func (*Account) UnmarshalText Uses

func (a *Account) UnmarshalText(b []byte) error

Expects base58-encoded account id

type AccountLine Uses

type AccountLine struct {
    Account      Account        `json:"account"`
    Balance      NonNativeValue `json:"balance"`
    Currency     Currency       `json:"currency"`
    Limit        NonNativeValue `json:"limit"`
    LimitPeer    NonNativeValue `json:"limit_peer"`
    NoRipple     bool           `json:"no_ripple"`
    NoRipplePeer bool           `json:"no_ripple_peer"`
    QualityIn    uint32         `json:"quality_in"`
    QualityOut   uint32         `json:"quality_out"`
}

func (*AccountLine) Asset Uses

func (l *AccountLine) Asset() *Asset

func (*AccountLine) CompareByCurrencyAccount Uses

func (l *AccountLine) CompareByCurrencyAccount(other *AccountLine) int

func (*AccountLine) CompareByCurrencyAmount Uses

func (l *AccountLine) CompareByCurrencyAmount(other *AccountLine) int

type AccountLineSlice Uses

type AccountLineSlice []AccountLine

func (*AccountLineSlice) Add Uses

func (s *AccountLineSlice) Add(account Account, rs *RippleState) bool

func (*AccountLineSlice) Delete Uses

func (s *AccountLineSlice) Delete(account Account, rs *RippleState) bool

func (AccountLineSlice) Find Uses

func (s AccountLineSlice) Find(account Account, currency Currency) int

func (AccountLineSlice) Get Uses

func (s AccountLineSlice) Get(account Account, currency Currency) *AccountLine

func (AccountLineSlice) Len Uses

func (s AccountLineSlice) Len() int

func (AccountLineSlice) SortByCurrencyAmount Uses

func (s AccountLineSlice) SortByCurrencyAmount()

func (AccountLineSlice) SortbyCurrencyAccount Uses

func (s AccountLineSlice) SortbyCurrencyAccount()

func (AccountLineSlice) Swap Uses

func (s AccountLineSlice) Swap(i, j int)

func (AccountLineSlice) Update Uses

func (s AccountLineSlice) Update(account Account, rs *RippleState) bool

type AccountOffer Uses

type AccountOffer struct {
    Flags      LedgerEntryFlag `json:"flags"`
    Quality    NonNativeValue  `json:"quality"`
    Sequence   uint32          `json:"seq"`
    TakerGets  Amount          `json:"taker_gets"`
    TakerPays  Amount          `json:"taker_pays"`
    Expiration *uint32         `json:"expiration"`
}

type AccountOfferSlice Uses

type AccountOfferSlice []AccountOffer

func (*AccountOfferSlice) Add Uses

func (s *AccountOfferSlice) Add(offer *Offer) bool

func (*AccountOfferSlice) Delete Uses

func (s *AccountOfferSlice) Delete(offer *Offer) bool

func (AccountOfferSlice) Find Uses

func (s AccountOfferSlice) Find(sequence uint32) int

func (AccountOfferSlice) Get Uses

func (s AccountOfferSlice) Get(sequence uint32) *AccountOffer

func (AccountOfferSlice) GetSequences Uses

func (s AccountOfferSlice) GetSequences(pays, gets *Asset) []uint32

func (AccountOfferSlice) Len Uses

func (s AccountOfferSlice) Len() int

func (AccountOfferSlice) Less Uses

func (s AccountOfferSlice) Less(i, j int) bool

func (AccountOfferSlice) Swap Uses

func (s AccountOfferSlice) Swap(i, j int)

func (AccountOfferSlice) Update Uses

func (s AccountOfferSlice) Update(offer *Offer) bool

type AccountRoot Uses

type AccountRoot struct {
    Flags         *LedgerEntryFlag `json:",omitempty"`
    Account       *Account         `json:",omitempty"`
    Sequence      *uint32          `json:",omitempty"`
    Balance       *Value           `json:",omitempty"`
    OwnerCount    *uint32          `json:",omitempty"`
    AccountTxnID  *Hash256         `json:",omitempty"`
    RegularKey    *RegularKey      `json:",omitempty"`
    EmailHash     *Hash128         `json:",omitempty"`
    WalletLocator *Hash256         `json:",omitempty"`
    WalletSize    *uint32          `json:",omitempty"`
    MessageKey    *VariableLength  `json:",omitempty"`
    TickSize      *uint8           `json:",omitempty"`
    TransferRate  *uint32          `json:",omitempty"`
    Domain        *VariableLength  `json:",omitempty"`
    Signers       *VariableLength  `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*AccountRoot) Affects Uses

func (a *AccountRoot) Affects(account Account) bool

func (*AccountRoot) GetHash Uses

func (le *AccountRoot) GetHash() *Hash256

func (*AccountRoot) GetLedgerEntryType Uses

func (le *AccountRoot) GetLedgerEntryType() LedgerEntryType

func (*AccountRoot) GetLedgerIndex Uses

func (le *AccountRoot) GetLedgerIndex() *Hash256

func (*AccountRoot) GetPreviousTxnId Uses

func (le *AccountRoot) GetPreviousTxnId() *Hash256

func (*AccountRoot) GetType Uses

func (le *AccountRoot) GetType() string

func (*AccountRoot) Ledger Uses

func (le *AccountRoot) Ledger() uint32

func (*AccountRoot) NodeId Uses

func (le *AccountRoot) NodeId() *Hash256

func (*AccountRoot) NodeType Uses

func (le *AccountRoot) NodeType() NodeType

func (*AccountRoot) Prefix Uses

func (le *AccountRoot) Prefix() HashPrefix

type AccountSet Uses

type AccountSet struct {
    TxBase
    EmailHash     *Hash128        `json:",omitempty"`
    WalletLocator *Hash256        `json:",omitempty"`
    WalletSize    *uint32         `json:",omitempty"`
    MessageKey    *VariableLength `json:",omitempty"`
    Domain        *VariableLength `json:",omitempty"`
    TransferRate  *uint32         `json:",omitempty"`
    TickSize      *uint8          `json:",omitempty"`
    SetFlag       *uint32         `json:",omitempty"`
    ClearFlag     *uint32         `json:",omitempty"`
}

type AffectedNode Uses

type AffectedNode struct {
    FinalFields       LedgerEntry `json:",omitempty"`
    LedgerEntryType   LedgerEntryType
    LedgerIndex       *Hash256    `json:",omitempty"`
    PreviousFields    LedgerEntry `json:",omitempty"`
    NewFields         LedgerEntry `json:",omitempty"`
    PreviousTxnID     *Hash256    `json:",omitempty"`
    PreviousTxnLgrSeq *uint32     `json:",omitempty"`
}

func (*AffectedNode) MarshalJSON Uses

func (a *AffectedNode) MarshalJSON() ([]byte, error)

func (*AffectedNode) UnmarshalJSON Uses

func (a *AffectedNode) UnmarshalJSON(b []byte) error

type Amendment Uses

type Amendment struct {
    TxBase
    Amendment Hash256
}

type Amendments Uses

type Amendments struct {
    Flags      *LedgerEntryFlag `json:",omitempty"`
    Amendments *Vector256       `json:",omitempty"`
    Majorities []Majority       `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Amendments) Affects Uses

func (a *Amendments) Affects(account Account) bool

func (*Amendments) GetHash Uses

func (le *Amendments) GetHash() *Hash256

func (*Amendments) GetLedgerEntryType Uses

func (le *Amendments) GetLedgerEntryType() LedgerEntryType

func (*Amendments) GetLedgerIndex Uses

func (le *Amendments) GetLedgerIndex() *Hash256

func (*Amendments) GetPreviousTxnId Uses

func (le *Amendments) GetPreviousTxnId() *Hash256

func (*Amendments) GetType Uses

func (le *Amendments) GetType() string

func (*Amendments) Ledger Uses

func (le *Amendments) Ledger() uint32

func (*Amendments) NodeId Uses

func (le *Amendments) NodeId() *Hash256

func (*Amendments) NodeType Uses

func (le *Amendments) NodeType() NodeType

func (*Amendments) Prefix Uses

func (le *Amendments) Prefix() HashPrefix

type Amount Uses

type Amount struct {
    *Value
    Currency Currency
    Issuer   Account
}

func NewAmount Uses

func NewAmount(v interface{}) (*Amount, error)

Requires v to be in computer parsable form

func (Amount) Abs Uses

func (a Amount) Abs() *Amount

func (Amount) Add Uses

func (a Amount) Add(b *Amount) (*Amount, error)

func (Amount) ApplyInterest Uses

func (a Amount) ApplyInterest() (*Amount, error)

func (Amount) Asset Uses

func (a Amount) Asset() *Asset

func (Amount) Bytes Uses

func (a Amount) Bytes() []byte

func (Amount) Clone Uses

func (a Amount) Clone() *Amount

func (Amount) Divide Uses

func (a Amount) Divide(b *Amount) (*Amount, error)

func (Amount) Equals Uses

func (a Amount) Equals(b Amount) bool

func (Amount) IsPositive Uses

func (a Amount) IsPositive() bool

func (Amount) Machine Uses

func (a Amount) Machine() string

Amount in computer parsable form

func (*Amount) Marshal Uses

func (a *Amount) Marshal(w io.Writer) error

func (Amount) MarshalBinary Uses

func (a Amount) MarshalBinary() ([]byte, error)

func (Amount) MarshalJSON Uses

func (a Amount) MarshalJSON() ([]byte, error)

func (Amount) Multiply Uses

func (a Amount) Multiply(b *Amount) (*Amount, error)

func (Amount) Negate Uses

func (a Amount) Negate() *Amount

func (Amount) Ratio Uses

func (a Amount) Ratio(b Amount) *Value

Ratio returns the ratio between a and b. Returns a zero value when division is impossible

func (Amount) SameValue Uses

func (a Amount) SameValue(b *Amount) bool

Returns true if the values are equal, but ignores the currency and issuer

func (Amount) String Uses

func (a Amount) String() string

Amount in human parsable form with demurrage applied

func (Amount) Subtract Uses

func (a Amount) Subtract(b *Amount) (*Amount, error)

func (*Amount) Unmarshal Uses

func (a *Amount) Unmarshal(r Reader) error

func (*Amount) UnmarshalBinary Uses

func (a *Amount) UnmarshalBinary(b []byte) error

func (*Amount) UnmarshalJSON Uses

func (a *Amount) UnmarshalJSON(b []byte) (err error)

func (Amount) ZeroClone Uses

func (a Amount) ZeroClone() *Amount

Returns a new Amount with the same currency and issuer, but a zero value

type Asset Uses

type Asset struct {
    Currency string `json:"currency"`
    Issuer   string `json:"issuer,omitempty"`
}

func NewAsset Uses

func NewAsset(s string) (*Asset, error)

func (*Asset) IsNative Uses

func (a *Asset) IsNative() bool

func (*Asset) Matches Uses

func (a *Asset) Matches(amount *Amount) bool

func (Asset) String Uses

func (a Asset) String() string

type Balance Uses

type Balance struct {
    CounterParty Account
    Balance      Value
    Change       Value
    Currency     Currency
}

func (Balance) String Uses

func (b Balance) String() string

type BalanceMap Uses

type BalanceMap map[Account]*BalanceSlice

func (*BalanceMap) Add Uses

func (m *BalanceMap) Add(account *Account, counterparty *Account, balance, change *Value, currency *Currency)

type BalanceSlice Uses

type BalanceSlice []Balance

func (*BalanceSlice) Add Uses

func (s *BalanceSlice) Add(counterparty *Account, balance, change *Value, currency *Currency)

func (BalanceSlice) Len Uses

func (s BalanceSlice) Len() int

func (BalanceSlice) Less Uses

func (s BalanceSlice) Less(i, j int) bool

func (BalanceSlice) Swap Uses

func (s BalanceSlice) Swap(i, j int)

type Check Uses

type Check struct {
    Account     *Account `json:",omitempty"`
    Destination *Account `json:",omitempty"`
    Expiration  *uint32  `json:",omitempty"`
    SendMax     *Amount  `json:",omitempty"`
    Sequence    *uint32  `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Check) Affects Uses

func (p *Check) Affects(account Account) bool

func (*Check) GetHash Uses

func (le *Check) GetHash() *Hash256

func (*Check) GetLedgerEntryType Uses

func (le *Check) GetLedgerEntryType() LedgerEntryType

func (*Check) GetLedgerIndex Uses

func (le *Check) GetLedgerIndex() *Hash256

func (*Check) GetPreviousTxnId Uses

func (le *Check) GetPreviousTxnId() *Hash256

func (*Check) GetType Uses

func (le *Check) GetType() string

func (*Check) Ledger Uses

func (le *Check) Ledger() uint32

func (*Check) NodeId Uses

func (le *Check) NodeId() *Hash256

func (*Check) NodeType Uses

func (le *Check) NodeType() NodeType

func (*Check) Prefix Uses

func (le *Check) Prefix() HashPrefix

type CheckCancel Uses

type CheckCancel struct {
    TxBase
    CheckID Hash256
}

https://ripple.com/build/transactions/#checkcancel

type CheckCash Uses

type CheckCash struct {
    TxBase
    CheckID    Hash256
    Amount     *Amount `json:",omitempty"`
    DeliverMin *Amount `json:",omitempty"`
}

https://ripple.com/build/transactions/#checkcash Must include one of Amount or DeliverMin

type CheckCreate Uses

type CheckCreate struct {
    TxBase
    Destination    Account
    SendMax        Amount
    DestinationTag *uint32  `json:",omitempty"`
    Expiration     *uint32  `json:",omitempty"`
    InvoiceID      *Hash256 `json:",omitempty"`
}

https://ripple.com/build/transactions/#checkcreate

type CompressedNodeEntry Uses

type CompressedNodeEntry struct {
    Hash Hash256
    Pos  uint8
}

type Currency Uses

type Currency [20]byte

func NewCurrency Uses

func NewCurrency(s string) (Currency, error)

Accepts currency as either a 3 character code or a 40 character hex string

func (*Currency) Bytes Uses

func (c *Currency) Bytes() []byte

func (Currency) Clone Uses

func (c Currency) Clone() Currency

func (Currency) Compare Uses

func (a Currency) Compare(b Currency) int

func (Currency) Equals Uses

func (c Currency) Equals(other Currency) bool

func (Currency) IsNative Uses

func (c Currency) IsNative() bool

func (Currency) Less Uses

func (a Currency) Less(b Currency) bool

func (Currency) Machine Uses

func (c Currency) Machine() string

Currency in computer parsable form

func (*Currency) Marshal Uses

func (c *Currency) Marshal(w io.Writer) error

func (Currency) MarshalText Uses

func (c Currency) MarshalText() ([]byte, error)

func (Currency) Rate Uses

func (c Currency) Rate(seconds uint32) float64

func (Currency) String Uses

func (c Currency) String() string

Currency in human parsable form Demurrage is formatted, for example, as XAU (0.50%pa)

func (Currency) Type Uses

func (c Currency) Type() CurrencyType

func (*Currency) Unmarshal Uses

func (c *Currency) Unmarshal(r Reader) error

func (*Currency) UnmarshalText Uses

func (c *Currency) UnmarshalText(text []byte) error

type CurrencyType Uses

type CurrencyType uint8
const (
    CT_XRP       CurrencyType = 0
    CT_STANDARD  CurrencyType = 1
    CT_DEMURRAGE CurrencyType = 2
    CT_HEX       CurrencyType = 3
    CT_UNKNOWN   CurrencyType = 4
)

type Directory Uses

type Directory struct {
    Flags             *LedgerEntryFlag `json:",omitempty"`
    RootIndex         *Hash256         `json:",omitempty"`
    Indexes           *Vector256       `json:",omitempty"`
    Owner             *Account         `json:",omitempty"`
    TakerPaysCurrency *Hash160         `json:",omitempty"`
    TakerPaysIssuer   *Hash160         `json:",omitempty"`
    TakerGetsCurrency *Hash160         `json:",omitempty"`
    TakerGetsIssuer   *Hash160         `json:",omitempty"`
    ExchangeRate      *ExchangeRate    `json:",omitempty"`
    IndexNext         *NodeIndex       `json:",omitempty"`
    IndexPrevious     *NodeIndex       `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Directory) Affects Uses

func (d *Directory) Affects(account Account) bool

func (*Directory) GetHash Uses

func (le *Directory) GetHash() *Hash256

func (*Directory) GetLedgerEntryType Uses

func (le *Directory) GetLedgerEntryType() LedgerEntryType

func (*Directory) GetLedgerIndex Uses

func (le *Directory) GetLedgerIndex() *Hash256

func (*Directory) GetPreviousTxnId Uses

func (le *Directory) GetPreviousTxnId() *Hash256

func (*Directory) GetType Uses

func (le *Directory) GetType() string

func (*Directory) Ledger Uses

func (le *Directory) Ledger() uint32

func (*Directory) NodeId Uses

func (le *Directory) NodeId() *Hash256

func (*Directory) NodeType Uses

func (le *Directory) NodeType() NodeType

func (*Directory) Prefix Uses

func (le *Directory) Prefix() HashPrefix

type Escrow Uses

type Escrow struct {
    Flags          *LedgerEntryFlag `json:",omitempty"`
    Account        Account          `json:",omitempty"`
    Destination    Account          `json:",omitempty"`
    Amount         Amount           `json:",omitempty"`
    Condition      *VariableLength  `json:",omitempty"`
    CancelAfter    *uint32          `json:",omitempty"`
    FinishAfter    *uint32          `json:",omitempty"`
    SourceTag      *uint32          `json:",omitempty"`
    DestinationTag *uint32          `json:",omitempty"`
    OwnerNode      *NodeIndex       `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Escrow) Affects Uses

func (s *Escrow) Affects(account Account) bool

func (*Escrow) GetHash Uses

func (le *Escrow) GetHash() *Hash256

func (*Escrow) GetLedgerEntryType Uses

func (le *Escrow) GetLedgerEntryType() LedgerEntryType

func (*Escrow) GetLedgerIndex Uses

func (le *Escrow) GetLedgerIndex() *Hash256

func (*Escrow) GetPreviousTxnId Uses

func (le *Escrow) GetPreviousTxnId() *Hash256

func (*Escrow) GetType Uses

func (le *Escrow) GetType() string

func (*Escrow) Ledger Uses

func (le *Escrow) Ledger() uint32

func (*Escrow) NodeId Uses

func (le *Escrow) NodeId() *Hash256

func (*Escrow) NodeType Uses

func (le *Escrow) NodeType() NodeType

func (*Escrow) Prefix Uses

func (le *Escrow) Prefix() HashPrefix

type EscrowCancel Uses

type EscrowCancel struct {
    TxBase
    Owner         Account
    OfferSequence uint32
}

type EscrowCreate Uses

type EscrowCreate struct {
    TxBase
    Destination    Account
    Amount         Amount
    Digest         *Hash256 `json:",omitempty"`
    CancelAfter    *uint32  `json:",omitempty"`
    FinishAfter    *uint32  `json:",omitempty"`
    DestinationTag *uint32  `json:",omitempty"`
}

type EscrowFinish Uses

type EscrowFinish struct {
    TxBase
    Owner         Account
    OfferSequence uint32
    Method        *uint8   `json:",omitempty"`
    Digest        *Hash256 `json:",omitempty"`
    Proof         *Hash256 `json:",omitempty"`
}

type ExchangeRate Uses

type ExchangeRate uint64

func NewExchangeRate Uses

func NewExchangeRate(a, b *Amount) (ExchangeRate, error)

func (*ExchangeRate) Bytes Uses

func (e *ExchangeRate) Bytes() []byte

func (ExchangeRate) MarshalText Uses

func (e ExchangeRate) MarshalText() ([]byte, error)

func (*ExchangeRate) UnmarshalText Uses

func (e *ExchangeRate) UnmarshalText(b []byte) error

type FeeSettings Uses

type FeeSettings struct {
    Flags             *LedgerEntryFlag `json:",omitempty"`
    BaseFee           *Uint64Hex       `json:",omitempty"`
    ReferenceFeeUnits *uint32          `json:",omitempty"`
    ReserveBase       *uint32          `json:",omitempty"`
    ReserveIncrement  *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*FeeSettings) Affects Uses

func (f *FeeSettings) Affects(account Account) bool

func (*FeeSettings) GetHash Uses

func (le *FeeSettings) GetHash() *Hash256

func (*FeeSettings) GetLedgerEntryType Uses

func (le *FeeSettings) GetLedgerEntryType() LedgerEntryType

func (*FeeSettings) GetLedgerIndex Uses

func (le *FeeSettings) GetLedgerIndex() *Hash256

func (*FeeSettings) GetPreviousTxnId Uses

func (le *FeeSettings) GetPreviousTxnId() *Hash256

func (*FeeSettings) GetType Uses

func (le *FeeSettings) GetType() string

func (*FeeSettings) Ledger Uses

func (le *FeeSettings) Ledger() uint32

func (*FeeSettings) NodeId Uses

func (le *FeeSettings) NodeId() *Hash256

func (*FeeSettings) NodeType Uses

func (le *FeeSettings) NodeType() NodeType

func (*FeeSettings) Prefix Uses

func (le *FeeSettings) Prefix() HashPrefix

type Hash128 Uses

type Hash128 [16]byte

func (*Hash128) Bytes Uses

func (h *Hash128) Bytes() []byte

func (*Hash128) Marshal Uses

func (h *Hash128) Marshal(w io.Writer) error

func (Hash128) MarshalText Uses

func (h Hash128) MarshalText() ([]byte, error)

func (Hash128) String Uses

func (h Hash128) String() string

func (*Hash128) Unmarshal Uses

func (h *Hash128) Unmarshal(r Reader) error

func (*Hash128) UnmarshalText Uses

func (h *Hash128) UnmarshalText(b []byte) error

type Hash160 Uses

type Hash160 [20]byte

func (*Hash160) Account Uses

func (h *Hash160) Account() *Account

func (*Hash160) Bytes Uses

func (h *Hash160) Bytes() []byte

func (*Hash160) Currency Uses

func (h *Hash160) Currency() *Currency

func (*Hash160) Marshal Uses

func (h *Hash160) Marshal(w io.Writer) error

func (Hash160) MarshalText Uses

func (h Hash160) MarshalText() ([]byte, error)

func (Hash160) String Uses

func (h Hash160) String() string

func (*Hash160) Unmarshal Uses

func (h *Hash160) Unmarshal(r Reader) error

func (*Hash160) UnmarshalText Uses

func (h *Hash160) UnmarshalText(b []byte) error

type Hash256 Uses

type Hash256 [32]byte

func GetAccountRootIndex Uses

func GetAccountRootIndex(account Account) (*Hash256, error)

func GetAmendmentsIndex Uses

func GetAmendmentsIndex() (*Hash256, error)

func GetBookIndex Uses

func GetBookIndex(paysCurrency, getsCurrency Hash160, paysIssuer, getsIssuer Hash160) (*Hash256, error)

func GetDirectoryNodeIndex Uses

func GetDirectoryNodeIndex(root Hash256, index *NodeIndex) (*Hash256, error)

func GetFeeIndex Uses

func GetFeeIndex() (*Hash256, error)

func GetLedgerHashIndex Uses

func GetLedgerHashIndex() (*Hash256, error)

func GetOfferIndex Uses

func GetOfferIndex(account Account, sequence uint32) (*Hash256, error)

func GetOwnerDirectoryIndex Uses

func GetOwnerDirectoryIndex(account Account) (*Hash256, error)

func GetPreviousLedgerHashIndex Uses

func GetPreviousLedgerHashIndex(sequence uint32) (*Hash256, error)

func GetRippleStateIndex Uses

func GetRippleStateIndex(a, b Account, c Currency) (*Hash256, error)

func LedgerIndex Uses

func LedgerIndex(le LedgerEntry) (*Hash256, error)

func NewHash256 Uses

func NewHash256(value interface{}) (*Hash256, error)

Accepts either a hex string or a byte slice of length 32

func Node Uses

func Node(h Storer) (Hash256, []byte, error)

func NodeId Uses

func NodeId(h Hashable) (Hash256, error)

func Raw Uses

func Raw(h Hashable) (Hash256, []byte, error)

func SigningHash Uses

func SigningHash(s Signer) (Hash256, []byte, error)

func (*Hash256) Bytes Uses

func (h *Hash256) Bytes() []byte

func (Hash256) Compare Uses

func (h Hash256) Compare(x Hash256) int

func (Hash256) IsZero Uses

func (h Hash256) IsZero() bool

func (*Hash256) Marshal Uses

func (h *Hash256) Marshal(w io.Writer) error

func (Hash256) MarshalText Uses

func (h Hash256) MarshalText() ([]byte, error)

func (Hash256) String Uses

func (h Hash256) String() string

func (Hash256) TruncatedString Uses

func (h Hash256) TruncatedString(length int) string

func (*Hash256) Unmarshal Uses

func (h *Hash256) Unmarshal(r Reader) error

func (*Hash256) UnmarshalText Uses

func (h *Hash256) UnmarshalText(b []byte) error

func (Hash256) Xor Uses

func (h Hash256) Xor(x Hash256) Hash256

type HashPrefix Uses

type HashPrefix uint32

func (HashPrefix) Bytes Uses

func (h HashPrefix) Bytes() []byte

func (HashPrefix) String Uses

func (h HashPrefix) String() string

type Hashable Uses

type Hashable interface {
    GetType() string
    Prefix() HashPrefix
    GetHash() *Hash256
}

func ReadWire Uses

func ReadWire(r Reader, typ NodeType, ledgerSequence uint32, nodeId Hash256) (Hashable, error)

ReadWire parses types received via the peer network

type InnerNode Uses

type InnerNode struct {
    Id       Hash256
    Type     NodeType
    Children [16]Hash256
}

func (InnerNode) Count Uses

func (n InnerNode) Count() int

func (InnerNode) Each Uses

func (n InnerNode) Each(f InnerNodeFunc) error

func (InnerNode) GetHash Uses

func (n InnerNode) GetHash() *Hash256

func (InnerNode) GetType Uses

func (n InnerNode) GetType() string

func (InnerNode) Ledger Uses

func (n InnerNode) Ledger() uint32

func (InnerNode) NodeId Uses

func (n InnerNode) NodeId() *Hash256

func (InnerNode) NodeType Uses

func (n InnerNode) NodeType() NodeType

func (InnerNode) Prefix Uses

func (n InnerNode) Prefix() HashPrefix

func (InnerNode) String Uses

func (n InnerNode) String() string

type InnerNodeFunc Uses

type InnerNodeFunc func(pos int, child Hash256) error

type KeyType Uses

type KeyType int
const (
    ECDSA   KeyType = 0
    Ed25519 KeyType = 1
)

func (KeyType) MarshalText Uses

func (keyType KeyType) MarshalText() ([]byte, error)

func (KeyType) String Uses

func (keyType KeyType) String() string

type Ledger Uses

type Ledger struct {
    LedgerHeader
    Hash         Hash256          `json:"hash"`
    Closed       bool             `json:"closed"`
    Accepted     bool             `json:"accepted"`
    Transactions TransactionSlice `json:"transactions,omitempty"`
    AccountState LedgerEntrySlice `json:"accountState,omitempty"`
}

func NewEmptyLedger Uses

func NewEmptyLedger(sequence uint32) *Ledger

func ReadLedger Uses

func ReadLedger(r Reader, nodeId Hash256) (*Ledger, error)

func (Ledger) GetHash Uses

func (l Ledger) GetHash() *Hash256

func (Ledger) GetType Uses

func (l Ledger) GetType() string

func (Ledger) Ledger Uses

func (l Ledger) Ledger() uint32

func (Ledger) MarshalJSON Uses

func (l Ledger) MarshalJSON() ([]byte, error)

func (Ledger) NodeId Uses

func (l Ledger) NodeId() *Hash256

func (Ledger) NodeType Uses

func (l Ledger) NodeType() NodeType

func (Ledger) Prefix Uses

func (l Ledger) Prefix() HashPrefix

func (*Ledger) UnmarshalJSON Uses

func (l *Ledger) UnmarshalJSON(b []byte) error

type LedgerEntry Uses

type LedgerEntry interface {
    Storer
    GetLedgerEntryType() LedgerEntryType
    GetLedgerIndex() *Hash256
    GetPreviousTxnId() *Hash256
    Affects(Account) bool
}

func ReadLedgerEntry Uses

func ReadLedgerEntry(r Reader, nodeId Hash256) (LedgerEntry, error)

type LedgerEntryFlag Uses

type LedgerEntryFlag uint32
const (
    // AccountRoot flags
    LsPasswordSpent  LedgerEntryFlag = 0x00010000
    LsRequireDestTag LedgerEntryFlag = 0x00020000
    LsRequireAuth    LedgerEntryFlag = 0x00040000
    LsDisallowXRP    LedgerEntryFlag = 0x00080000
    LsDisableMaster  LedgerEntryFlag = 0x00100000
    LsNoFreeze       LedgerEntryFlag = 0x00200000
    LsGlobalFreeze   LedgerEntryFlag = 0x00400000
    LsDefaultRipple  LedgerEntryFlag = 0x00800000

    // Offer flags
    LsPassive LedgerEntryFlag = 0x00010000
    LsSell    LedgerEntryFlag = 0x00020000

    // RippleState flags
    LsLowReserve   LedgerEntryFlag = 0x00010000
    LsHighReserve  LedgerEntryFlag = 0x00020000
    LsLowAuth      LedgerEntryFlag = 0x00040000
    LsHighAuth     LedgerEntryFlag = 0x00080000
    LsLowNoRipple  LedgerEntryFlag = 0x00100000
    LsHighNoRipple LedgerEntryFlag = 0x00200000
    LsLowFreeze    LedgerEntryFlag = 0x00400000
    LsHighFreeze   LedgerEntryFlag = 0x00800000
)

Ledger entry flags

func (LedgerEntryFlag) Explain Uses

func (f LedgerEntryFlag) Explain(le LedgerEntry) []string

func (LedgerEntryFlag) String Uses

func (f LedgerEntryFlag) String() string

type LedgerEntrySlice Uses

type LedgerEntrySlice []LedgerEntry

func (*LedgerEntrySlice) UnmarshalJSON Uses

func (l *LedgerEntrySlice) UnmarshalJSON(b []byte) error

type LedgerEntryState Uses

type LedgerEntryState uint8
const (
    Created LedgerEntryState = iota
    Modified
    Deleted
)

type LedgerEntryType Uses

type LedgerEntryType uint16

func (LedgerEntryType) MarshalText Uses

func (l LedgerEntryType) MarshalText() ([]byte, error)

func (LedgerEntryType) String Uses

func (le LedgerEntryType) String() string

func (*LedgerEntryType) UnmarshalText Uses

func (l *LedgerEntryType) UnmarshalText(b []byte) error

type LedgerHashes Uses

type LedgerHashes struct {
    Flags               *LedgerEntryFlag `json:",omitempty"`
    FirstLedgerSequence *uint32          `json:",omitempty"`
    LastLedgerSequence  *uint32          `json:",omitempty"`
    Hashes              *Vector256       `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*LedgerHashes) Affects Uses

func (l *LedgerHashes) Affects(account Account) bool

func (*LedgerHashes) GetHash Uses

func (le *LedgerHashes) GetHash() *Hash256

func (*LedgerHashes) GetLedgerEntryType Uses

func (le *LedgerHashes) GetLedgerEntryType() LedgerEntryType

func (*LedgerHashes) GetLedgerIndex Uses

func (le *LedgerHashes) GetLedgerIndex() *Hash256

func (*LedgerHashes) GetPreviousTxnId Uses

func (le *LedgerHashes) GetPreviousTxnId() *Hash256

func (*LedgerHashes) GetType Uses

func (le *LedgerHashes) GetType() string

func (*LedgerHashes) Ledger Uses

func (le *LedgerHashes) Ledger() uint32

func (*LedgerHashes) NodeId Uses

func (le *LedgerHashes) NodeId() *Hash256

func (*LedgerHashes) NodeType Uses

func (le *LedgerHashes) NodeType() NodeType

func (*LedgerHashes) Prefix Uses

func (le *LedgerHashes) Prefix() HashPrefix

type LedgerHeader Uses

type LedgerHeader struct {
    LedgerSequence  uint32     `json:"ledger_index,string"`
    TotalXRP        uint64     `json:"total_coins,string"`
    PreviousLedger  Hash256    `json:"parent_hash"`
    TransactionHash Hash256    `json:"transaction_hash"`
    StateHash       Hash256    `json:"account_hash"`
    ParentCloseTime RippleTime `json:"parent_close_time"`
    CloseTime       RippleTime `json:"close_time"`
    CloseResolution uint8      `json:"close_time_resolution"`
    CloseFlags      uint8      `json:"close_flags"`
}

type LedgerNamespace Uses

type LedgerNamespace uint16

type LedgerRange Uses

type LedgerRange struct {
    Start uint32
    End   uint32
    Max   uint32
}

type LedgerSet Uses

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

func NewLedgerSet Uses

func NewLedgerSet(start, capacity uint32) *LedgerSet

func (*LedgerSet) Count Uses

func (l *LedgerSet) Count() uint32

func (*LedgerSet) Extend Uses

func (l *LedgerSet) Extend(i uint32)

func (*LedgerSet) Max Uses

func (l *LedgerSet) Max() uint32

func (*LedgerSet) Set Uses

func (l *LedgerSet) Set(i uint32) time.Duration

func (*LedgerSet) String Uses

func (l *LedgerSet) String() string

func (*LedgerSet) TakeBottom Uses

func (l *LedgerSet) TakeBottom(n uint32) LedgerSlice

func (*LedgerSet) TakeMiddle Uses

func (l *LedgerSet) TakeMiddle(r *LedgerRange) LedgerSlice

func (*LedgerSet) TakeTop Uses

func (l *LedgerSet) TakeTop(n uint32) LedgerSlice

func (*LedgerSet) Taken Uses

func (l *LedgerSet) Taken() uint32

type LedgerSlice Uses

type LedgerSlice []uint32

func (LedgerSlice) Len Uses

func (s LedgerSlice) Len() int

func (LedgerSlice) Less Uses

func (s LedgerSlice) Less(i, j int) bool

func (LedgerSlice) Sorted Uses

func (s LedgerSlice) Sorted() LedgerSlice

func (LedgerSlice) Swap Uses

func (s LedgerSlice) Swap(i, j int)

type LimitByteReader Uses

type LimitByteReader struct {
    R   Reader // underlying reader
    N   int64  // max bytes remaining
}

func LimitedByteReader Uses

func LimitedByteReader(r Reader, n int64) *LimitByteReader

func (*LimitByteReader) Len Uses

func (l *LimitByteReader) Len() int

func (*LimitByteReader) Read Uses

func (l *LimitByteReader) Read(p []byte) (n int, err error)

func (*LimitByteReader) ReadByte Uses

func (l *LimitByteReader) ReadByte() (c byte, err error)

func (*LimitByteReader) UnreadByte Uses

func (l *LimitByteReader) UnreadByte() error

type Majority Uses

type Majority struct {
    Amendment *Hash256 `json:",omitempty"`
    CloseTime *uint32  `json:",omitempty"`
}

type Memo Uses

type Memo struct {
    Memo struct {
        MemoType   VariableLength
        MemoData   VariableLength
        MemoFormat VariableLength
    }
}

type Memos Uses

type Memos []Memo

type MetaData Uses

type MetaData struct {
    AffectedNodes     NodeEffects
    TransactionIndex  uint32
    TransactionResult TransactionResult
    DeliveredAmount   *Amount `json:"delivered_amount,omitempty"`
}

type NodeEffect Uses

type NodeEffect struct {
    ModifiedNode *AffectedNode `json:",omitempty"`
    CreatedNode  *AffectedNode `json:",omitempty"`
    DeletedNode  *AffectedNode `json:",omitempty"`
}

func (*NodeEffect) AffectedNode Uses

func (effect *NodeEffect) AffectedNode() (*AffectedNode, LedgerEntry, LedgerEntry, LedgerEntryState)

AffectedNode returns the AffectedNode, the current LedgerEntry, the previous LedgerEntry (which might be nil) and the LedgerEntryState

type NodeEffects Uses

type NodeEffects []NodeEffect

type NodeFormat Uses

type NodeFormat uint8

type NodeHeader Uses

type NodeHeader struct {
    LedgerSequence uint32

    NodeType NodeType
    // contains filtered or unexported fields
}

type NodeIndex Uses

type NodeIndex uint64

func (NodeIndex) MarshalText Uses

func (i NodeIndex) MarshalText() ([]byte, error)

func (*NodeIndex) Next Uses

func (i *NodeIndex) Next() *NodeIndex

func (*NodeIndex) Previous Uses

func (i *NodeIndex) Previous() *NodeIndex

func (*NodeIndex) UnmarshalText Uses

func (i *NodeIndex) UnmarshalText(b []byte) error

type NodeType Uses

type NodeType uint8

func (NodeType) String Uses

func (n NodeType) String() string

type NonNativeValue Uses

type NonNativeValue struct {
    Value
}

func (*NonNativeValue) UnmarshalText Uses

func (v *NonNativeValue) UnmarshalText(b []byte) error

type Offer Uses

type Offer struct {
    Flags         *LedgerEntryFlag `json:",omitempty"`
    Account       *Account         `json:",omitempty"`
    Sequence      *uint32          `json:"sequence,omitempty"`
    TakerPays     *Amount          `json:",omitempty"`
    TakerGets     *Amount          `json:",omitempty"`
    BookDirectory *Hash256         `json:",omitempty"`
    BookNode      *NodeIndex       `json:",omitempty"`
    OwnerNode     *NodeIndex       `json:",omitempty"`
    Expiration    *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Offer) Affects Uses

func (o *Offer) Affects(account Account) bool

func (*Offer) GetHash Uses

func (le *Offer) GetHash() *Hash256

func (*Offer) GetLedgerEntryType Uses

func (le *Offer) GetLedgerEntryType() LedgerEntryType

func (*Offer) GetLedgerIndex Uses

func (le *Offer) GetLedgerIndex() *Hash256

func (*Offer) GetPreviousTxnId Uses

func (le *Offer) GetPreviousTxnId() *Hash256

func (*Offer) GetType Uses

func (le *Offer) GetType() string

func (*Offer) Ledger Uses

func (le *Offer) Ledger() uint32

func (*Offer) NodeId Uses

func (le *Offer) NodeId() *Hash256

func (*Offer) NodeType Uses

func (le *Offer) NodeType() NodeType

func (*Offer) Prefix Uses

func (le *Offer) Prefix() HashPrefix

func (*Offer) Ratio Uses

func (o *Offer) Ratio() *Value

type OfferCancel Uses

type OfferCancel struct {
    TxBase
    OfferSequence uint32
}

type OfferCreate Uses

type OfferCreate struct {
    TxBase
    OfferSequence *uint32 `json:",omitempty"`
    TakerPays     Amount
    TakerGets     Amount
    Expiration    *uint32 `json:",omitempty"`
}

func (*OfferCreate) Ratio Uses

func (o *OfferCreate) Ratio() *Value

type OrderBookOffer Uses

type OrderBookOffer struct {
    Offer
    OwnerFunds      Value          `json:"owner_funds"`
    Quality         NonNativeValue `json:"quality"`
    TakerGetsFunded *Amount        `json:"taker_gets_funded"`
    TakerPaysFunded *Amount        `json:"taker_pays_funded"`
}

func (*OrderBookOffer) GetHash Uses

func (le *OrderBookOffer) GetHash() *Hash256

func (*OrderBookOffer) GetLedgerEntryType Uses

func (le *OrderBookOffer) GetLedgerEntryType() LedgerEntryType

func (*OrderBookOffer) GetLedgerIndex Uses

func (le *OrderBookOffer) GetLedgerIndex() *Hash256

func (*OrderBookOffer) GetPreviousTxnId Uses

func (le *OrderBookOffer) GetPreviousTxnId() *Hash256

func (*OrderBookOffer) GetType Uses

func (le *OrderBookOffer) GetType() string

func (*OrderBookOffer) Ledger Uses

func (le *OrderBookOffer) Ledger() uint32

func (*OrderBookOffer) NodeId Uses

func (le *OrderBookOffer) NodeId() *Hash256

func (*OrderBookOffer) NodeType Uses

func (le *OrderBookOffer) NodeType() NodeType

func (*OrderBookOffer) Prefix Uses

func (le *OrderBookOffer) Prefix() HashPrefix

type Path Uses

type Path []PathElem

Path represents a single path of liquidity that a transaction may use.

func NewPath Uses

func NewPath(s string) (Path, error)

NewPath accepts a path consisting of hops delimited by "=>" where each hop is either "<currency>/<issuer>" or "<account>". Whitespace around the delimiter is acceptable and is ignored.

func (Path) Signature Uses

func (p Path) Signature() (uint32, error)

func (Path) String Uses

func (p Path) String() string

type PathElem Uses

type PathElem struct {
    Account  *Account
    Currency *Currency
    Issuer   *Account
}

PathElem represents one link in a path.

func (PathElem) MarshalJSON Uses

func (p PathElem) MarshalJSON() ([]byte, error)

func (PathElem) String Uses

func (p PathElem) String() string

type PathSet Uses

type PathSet []Path

PathSet represents a collection of possible paths that a transaction may use.

func (*PathSet) Marshal Uses

func (p *PathSet) Marshal(w io.Writer) error

func (*PathSet) Unmarshal Uses

func (p *PathSet) Unmarshal(r Reader) error

type PayChannel Uses

type PayChannel struct {
    Flags          *LedgerEntryFlag `json:",omitempty"`
    Account        *Account         `json:",omitempty"`
    Destination    *Account         `json:",omitempty"`
    Amount         *Amount          `json:",omitempty"`
    Balance        *Amount          `json:",omitempty"`
    PublicKey      *PublicKey       `json:",omitempty"`
    SettleDelay    *uint32          `json:",omitempty"`
    OwnerNode      *NodeIndex       `json:",omitempty"`
    Expiration     *uint32          `json:",omitempty"`
    CancelAfter    *uint32          `json:",omitempty"`
    DestinationTag *uint32          `json:",omitempty"`
    SourceTag      *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*PayChannel) Affects Uses

func (p *PayChannel) Affects(account Account) bool

func (*PayChannel) GetHash Uses

func (le *PayChannel) GetHash() *Hash256

func (*PayChannel) GetLedgerEntryType Uses

func (le *PayChannel) GetLedgerEntryType() LedgerEntryType

func (*PayChannel) GetLedgerIndex Uses

func (le *PayChannel) GetLedgerIndex() *Hash256

func (*PayChannel) GetPreviousTxnId Uses

func (le *PayChannel) GetPreviousTxnId() *Hash256

func (*PayChannel) GetType Uses

func (le *PayChannel) GetType() string

func (*PayChannel) Ledger Uses

func (le *PayChannel) Ledger() uint32

func (*PayChannel) NodeId Uses

func (le *PayChannel) NodeId() *Hash256

func (*PayChannel) NodeType Uses

func (le *PayChannel) NodeType() NodeType

func (*PayChannel) Prefix Uses

func (le *PayChannel) Prefix() HashPrefix

type Payment Uses

type Payment struct {
    TxBase
    Destination    Account
    Amount         Amount
    SendMax        *Amount  `json:",omitempty"`
    DeliverMin     *Amount  `json:",omitempty"`
    Paths          *PathSet `json:",omitempty"`
    DestinationTag *uint32  `json:",omitempty"`
    InvoiceID      *Hash256 `json:",omitempty"`
}

func (*Payment) PathSet Uses

func (p *Payment) PathSet() PathSet

type PaymentChannelClaim Uses

type PaymentChannelClaim struct {
    TxBase
    Channel   Hash256
    Balance   *Amount         `json:",omitempty"`
    Amount    *Amount         `json:",omitempty"`
    Signature *VariableLength `json:",omitempty"`
    PublicKey *PublicKey      `json:",omitempty"`
}

type PaymentChannelCreate Uses

type PaymentChannelCreate struct {
    TxBase
    Amount         Amount
    Destination    Account
    SettleDelay    uint32
    PublicKey      PublicKey
    CancelAfter    *uint32 `json:",omitempty"`
    DestinationTag *uint32 `json:",omitempty"`
    SourceTag      *uint32 `json:",omitempty"`
}

type PaymentChannelFund Uses

type PaymentChannelFund struct {
    TxBase
    Channel    Hash256
    Amount     Amount
    Expiration *uint32 `json:",omitempty"`
}

type Proposal Uses

type Proposal struct {
    Hash           Hash256
    LedgerHash     Hash256
    PreviousLedger Hash256
    Sequence       uint32
    CloseTime      RippleTime
    PublicKey      PublicKey
    Signature      VariableLength
}

func (*Proposal) GetHash Uses

func (p *Proposal) GetHash() *Hash256

func (*Proposal) GetPublicKey Uses

func (p *Proposal) GetPublicKey() *PublicKey

func (*Proposal) GetSignature Uses

func (p *Proposal) GetSignature() *VariableLength

func (Proposal) GetType Uses

func (p Proposal) GetType() string

func (*Proposal) InitialiseForSigning Uses

func (p *Proposal) InitialiseForSigning()

func (*Proposal) Prefix Uses

func (p *Proposal) Prefix() HashPrefix

func (*Proposal) SigningPrefix Uses

func (p *Proposal) SigningPrefix() HashPrefix

func (Proposal) SigningValues Uses

func (p Proposal) SigningValues() []interface{}

func (Proposal) SuppressionId Uses

func (p Proposal) SuppressionId() (Hash256, error)

type PublicKey Uses

type PublicKey [33]byte

func (*PublicKey) Bytes Uses

func (p *PublicKey) Bytes() []byte

func (PublicKey) IsZero Uses

func (p PublicKey) IsZero() bool

func (*PublicKey) Marshal Uses

func (k *PublicKey) Marshal(w io.Writer) error

func (PublicKey) MarshalText Uses

func (p PublicKey) MarshalText() ([]byte, error)

func (PublicKey) NodePublicKey Uses

func (p PublicKey) NodePublicKey() string

func (PublicKey) String Uses

func (p PublicKey) String() string

func (*PublicKey) Unmarshal Uses

func (k *PublicKey) Unmarshal(r Reader) error

func (*PublicKey) UnmarshalText Uses

func (p *PublicKey) UnmarshalText(b []byte) error

Expects public key hex

type Reader Uses

type Reader interface {
    io.ByteScanner
    io.Reader
    Len() int
}

func NewVariableByteReader Uses

func NewVariableByteReader(r Reader) (Reader, error)

type RegularKey Uses

type RegularKey [20]byte

func NewRegularKeyFromAddress Uses

func NewRegularKeyFromAddress(s string) (*RegularKey, error)

Expects address in base58 form

func (*RegularKey) Bytes Uses

func (r *RegularKey) Bytes() []byte

func (RegularKey) Hash Uses

func (r RegularKey) Hash() (crypto.Hash, error)

func (*RegularKey) Marshal Uses

func (k *RegularKey) Marshal(w io.Writer) error

func (RegularKey) MarshalText Uses

func (r RegularKey) MarshalText() ([]byte, error)

func (RegularKey) String Uses

func (r RegularKey) String() string

func (*RegularKey) Unmarshal Uses

func (k *RegularKey) Unmarshal(r Reader) error

func (*RegularKey) UnmarshalText Uses

func (r *RegularKey) UnmarshalText(b []byte) error

Expects base58-encoded account id

type RippleState Uses

type RippleState struct {
    Flags          *LedgerEntryFlag `json:",omitempty"`
    LowLimit       *Amount          `json:",omitempty"`
    HighLimit      *Amount          `json:",omitempty"`
    Balance        *Amount          `json:",omitempty"`
    LowNode        *NodeIndex       `json:",omitempty"`
    HighNode       *NodeIndex       `json:",omitempty"`
    LowQualityIn   *uint32          `json:",omitempty"`
    LowQualityOut  *uint32          `json:",omitempty"`
    HighQualityIn  *uint32          `json:",omitempty"`
    HighQualityOut *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*RippleState) Affects Uses

func (r *RippleState) Affects(account Account) bool

func (*RippleState) GetHash Uses

func (le *RippleState) GetHash() *Hash256

func (*RippleState) GetLedgerEntryType Uses

func (le *RippleState) GetLedgerEntryType() LedgerEntryType

func (*RippleState) GetLedgerIndex Uses

func (le *RippleState) GetLedgerIndex() *Hash256

func (*RippleState) GetPreviousTxnId Uses

func (le *RippleState) GetPreviousTxnId() *Hash256

func (*RippleState) GetType Uses

func (le *RippleState) GetType() string

func (*RippleState) Ledger Uses

func (le *RippleState) Ledger() uint32

func (*RippleState) NodeId Uses

func (le *RippleState) NodeId() *Hash256

func (*RippleState) NodeType Uses

func (le *RippleState) NodeType() NodeType

func (*RippleState) Prefix Uses

func (le *RippleState) Prefix() HashPrefix

type RippleTime Uses

type RippleTime struct {
    T uint32
}

Represents a time as the number of seconds since the Ripple epoch: January 1st, 2000 (00:00 UTC)

func NewRippleTime Uses

func NewRippleTime(t uint32) *RippleTime

func Now Uses

func Now() *RippleTime

func (RippleTime) MarshalJSON Uses

func (t RippleTime) MarshalJSON() ([]byte, error)

func (*RippleTime) SetString Uses

func (t *RippleTime) SetString(s string) error

Accepts time formatted as 2006-Jan-02 15:04:05

func (*RippleTime) SetUint32 Uses

func (t *RippleTime) SetUint32(n uint32)

func (RippleTime) Short Uses

func (t RippleTime) Short() string

Returns time formatted as 15:04:05

func (RippleTime) String Uses

func (t RippleTime) String() string

Returns time formatted as 2006-Jan-02 15:04:05

func (RippleTime) Time Uses

func (t RippleTime) Time() time.Time

func (RippleTime) Uint32 Uses

func (t RippleTime) Uint32() uint32

func (*RippleTime) UnmarshalJSON Uses

func (t *RippleTime) UnmarshalJSON(b []byte) error

type Router Uses

type Router interface {
    Hashable
    SuppressionId() Hash256
}

type Seed Uses

type Seed [16]byte

func NewSeedFromAddress Uses

func NewSeedFromAddress(s string) (*Seed, error)

Expects address in base58 form

func (*Seed) AccountId Uses

func (s *Seed) AccountId(keyType KeyType, sequence *uint32) Account

func (*Seed) Bytes Uses

func (s *Seed) Bytes() []byte

func (Seed) Hash Uses

func (s Seed) Hash() (crypto.Hash, error)

func (*Seed) Key Uses

func (s *Seed) Key(keyType KeyType) crypto.Key

func (Seed) MarshalText Uses

func (s Seed) MarshalText() ([]byte, error)

func (Seed) String Uses

func (s Seed) String() string

func (*Seed) UnmarshalText Uses

func (s *Seed) UnmarshalText(b []byte) error

Expects base58-encoded account id

type SetFee Uses

type SetFee struct {
    TxBase
    BaseFee           Uint64Hex
    ReferenceFeeUnits uint32
    ReserveBase       uint32
    ReserveIncrement  uint32
}

type SetRegularKey Uses

type SetRegularKey struct {
    TxBase
    RegularKey *RegularKey `json:",omitempty"`
}

type Signer Uses

type Signer interface {
    Hashable
    InitialiseForSigning()
    SigningPrefix() HashPrefix
    GetPublicKey() *PublicKey
    GetSignature() *VariableLength
}

type SignerEntry Uses

type SignerEntry struct {
    Account      *Account `json:",omitempty"`
    SignerWeight *uint16  `json:",omitempty"`
}

type SignerList Uses

type SignerList struct {
    Flags         *LedgerEntryFlag `json:",omitempty"`
    OwnerNode     *NodeIndex       `json:",omitempty"`
    SignerQuorum  *uint32          `json:",omitempty"`
    SignerEntries []SignerEntry    `json:",omitempty"`
    SignerListID  *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*SignerList) Affects Uses

func (s *SignerList) Affects(account Account) bool

func (*SignerList) GetHash Uses

func (le *SignerList) GetHash() *Hash256

func (*SignerList) GetLedgerEntryType Uses

func (le *SignerList) GetLedgerEntryType() LedgerEntryType

func (*SignerList) GetLedgerIndex Uses

func (le *SignerList) GetLedgerIndex() *Hash256

func (*SignerList) GetPreviousTxnId Uses

func (le *SignerList) GetPreviousTxnId() *Hash256

func (*SignerList) GetType Uses

func (le *SignerList) GetType() string

func (*SignerList) Ledger Uses

func (le *SignerList) Ledger() uint32

func (*SignerList) NodeId Uses

func (le *SignerList) NodeId() *Hash256

func (*SignerList) NodeType Uses

func (le *SignerList) NodeType() NodeType

func (*SignerList) Prefix Uses

func (le *SignerList) Prefix() HashPrefix

type SignerListSet Uses

type SignerListSet struct {
    TxBase
    SignerQuorum  uint32        `json:",omitempty"`
    SignerEntries []SignerEntry `json:",omitempty"`
}

type Storer Uses

type Storer interface {
    Hashable
    Ledger() uint32
    NodeType() NodeType
    NodeId() *Hash256
}

func ReadPrefix Uses

func ReadPrefix(r Reader, nodeId Hash256) (Storer, error)

ReadPrefix parses types received from the nodestore

type Ticket Uses

type Ticket struct {
    Flags      *LedgerEntryFlag `json:",omitempty"`
    Account    *Account         `json:",omitempty"`
    Sequence   *uint32          `json:",omitempty"`
    OwnerNode  *NodeIndex       `json:",omitempty"`
    Target     *Account         `json:",omitempty"`
    Expiration *uint32          `json:",omitempty"`
    // contains filtered or unexported fields
}

func (*Ticket) Affects Uses

func (t *Ticket) Affects(account Account) bool

func (*Ticket) GetHash Uses

func (le *Ticket) GetHash() *Hash256

func (*Ticket) GetLedgerEntryType Uses

func (le *Ticket) GetLedgerEntryType() LedgerEntryType

func (*Ticket) GetLedgerIndex Uses

func (le *Ticket) GetLedgerIndex() *Hash256

func (*Ticket) GetPreviousTxnId Uses

func (le *Ticket) GetPreviousTxnId() *Hash256

func (*Ticket) GetType Uses

func (le *Ticket) GetType() string

func (*Ticket) Ledger Uses

func (le *Ticket) Ledger() uint32

func (*Ticket) NodeId Uses

func (le *Ticket) NodeId() *Hash256

func (*Ticket) NodeType Uses

func (le *Ticket) NodeType() NodeType

func (*Ticket) Prefix Uses

func (le *Ticket) Prefix() HashPrefix

type TicketCancel Uses

type TicketCancel struct {
    TicketID Hash256
}

type TicketCreate Uses

type TicketCreate struct {
    Target     *Account `json:",omitempty"`
    Expiration *uint32  `json:",omitempty"`
}

type Trade Uses

type Trade struct {
    LedgerSequence   uint32
    TransactionIndex uint32
    TransactionType  string
    Op               string
    Paid             *Amount
    Got              *Amount
    Giver            Account
    Taker            Account
}

func (*Trade) Rate Uses

func (t *Trade) Rate() float64

func (Trade) String Uses

func (t Trade) String() string

type TradeSlice Uses

type TradeSlice []Trade

func NewTradeSlice Uses

func NewTradeSlice(txm *TransactionWithMetaData) (TradeSlice, error)

func (TradeSlice) Filter Uses

func (s TradeSlice) Filter(account Account) TradeSlice

func (TradeSlice) Len Uses

func (s TradeSlice) Len() int

func (TradeSlice) Less Uses

func (s TradeSlice) Less(i, j int) bool

func (TradeSlice) Sort Uses

func (s TradeSlice) Sort()

func (TradeSlice) Swap Uses

func (s TradeSlice) Swap(i, j int)

type Transaction Uses

type Transaction interface {
    Signer
    GetTransactionType() TransactionType
    GetBase() *TxBase
    PathSet() PathSet
}

func ReadTransaction Uses

func ReadTransaction(r Reader) (Transaction, error)

type TransactionFlag Uses

type TransactionFlag uint32
const (
    //Universal flags
    TxCanonicalSignature TransactionFlag = 0x80000000

    // Payment flags
    TxNoDirectRipple TransactionFlag = 0x00010000
    TxPartialPayment TransactionFlag = 0x00020000
    TxLimitQuality   TransactionFlag = 0x00040000
    TxCircle         TransactionFlag = 0x00080000 // Not implemented

    // AccountSet flags
    TxSetRequireDest   TransactionFlag = 0x00000001
    TxSetRequireAuth   TransactionFlag = 0x00000002
    TxSetDisallowXRP   TransactionFlag = 0x00000003
    TxSetDisableMaster TransactionFlag = 0x00000004
    TxSetAccountTxnID  TransactionFlag = 0x00000005
    TxNoFreeze         TransactionFlag = 0x00000006
    TxGlobalFreeze     TransactionFlag = 0x00000007
    TxDefaultRipple    TransactionFlag = 0x00000008
    TxRequireDestTag   TransactionFlag = 0x00010000
    TxOptionalDestTag  TransactionFlag = 0x00020000
    TxRequireAuth      TransactionFlag = 0x00040000
    TxOptionalAuth     TransactionFlag = 0x00080000
    TxDisallowXRP      TransactionFlag = 0x00100000
    TxAllowXRP         TransactionFlag = 0x00200000

    // OfferCreate flags
    TxPassive           TransactionFlag = 0x00010000
    TxImmediateOrCancel TransactionFlag = 0x00020000
    TxFillOrKill        TransactionFlag = 0x00040000
    TxSell              TransactionFlag = 0x00080000

    // TrustSet flags
    TxSetAuth       TransactionFlag = 0x00010000
    TxSetNoRipple   TransactionFlag = 0x00020000
    TxClearNoRipple TransactionFlag = 0x00040000
    TxSetFreeze     TransactionFlag = 0x00100000
    TxClearFreeze   TransactionFlag = 0x00200000

    // EnableAmendments flags
    TxGotMajority  TransactionFlag = 0x00010000
    TxLostMajority TransactionFlag = 0x00020000

    // PaymentChannelClaim flags
    TxRenew TransactionFlag = 0x00010000
    TxClose TransactionFlag = 0x00020000
)

Transaction Flags

func (TransactionFlag) Explain Uses

func (f TransactionFlag) Explain(tx Transaction) []string

func (TransactionFlag) String Uses

func (f TransactionFlag) String() string

type TransactionResult Uses

type TransactionResult int16

func (TransactionResult) Human Uses

func (r TransactionResult) Human() string

func (*TransactionResult) Marshal Uses

func (res *TransactionResult) Marshal(w io.Writer) error

func (TransactionResult) MarshalText Uses

func (r TransactionResult) MarshalText() ([]byte, error)

func (TransactionResult) Queued Uses

func (r TransactionResult) Queued() bool

func (TransactionResult) String Uses

func (r TransactionResult) String() string

func (TransactionResult) Success Uses

func (r TransactionResult) Success() bool

func (TransactionResult) Symbol Uses

func (r TransactionResult) Symbol() string

func (*TransactionResult) Unmarshal Uses

func (res *TransactionResult) Unmarshal(r Reader) error

func (*TransactionResult) UnmarshalText Uses

func (r *TransactionResult) UnmarshalText(b []byte) error

type TransactionSlice Uses

type TransactionSlice []*TransactionWithMetaData

func (TransactionSlice) Len Uses

func (s TransactionSlice) Len() int

func (TransactionSlice) Less Uses

func (s TransactionSlice) Less(i, j int) bool

func (TransactionSlice) MarshalJSON Uses

func (s TransactionSlice) MarshalJSON() ([]byte, error)

func (TransactionSlice) Sort Uses

func (s TransactionSlice) Sort()

func (TransactionSlice) Swap Uses

func (s TransactionSlice) Swap(i, j int)

type TransactionType Uses

type TransactionType uint16

func (TransactionType) MarshalText Uses

func (t TransactionType) MarshalText() ([]byte, error)

func (TransactionType) String Uses

func (t TransactionType) String() string

func (*TransactionType) UnmarshalText Uses

func (t *TransactionType) UnmarshalText(b []byte) error

type TransactionWithMetaData Uses

type TransactionWithMetaData struct {
    Transaction
    MetaData       MetaData   `json:"meta"`
    Date           RippleTime `json:"date"`
    LedgerSequence uint32     `json:"ledger_index"`
    Id             Hash256    `json:"-"`
}

func NewTransactionWithMetadata Uses

func NewTransactionWithMetadata(typ TransactionType) *TransactionWithMetaData

func ReadTransactionAndMetadata Uses

func ReadTransactionAndMetadata(tx, meta Reader, hash Hash256, ledger uint32) (*TransactionWithMetaData, error)

ReadTransactionAndMetadata combines the inputs from the two readers into a TransactionWithMetaData

func (*TransactionWithMetaData) Affects Uses

func (t *TransactionWithMetaData) Affects(account Account) bool

func (*TransactionWithMetaData) Balances Uses

func (txm *TransactionWithMetaData) Balances() (BalanceMap, error)

func (*TransactionWithMetaData) GetType Uses

func (t *TransactionWithMetaData) GetType() string

func (*TransactionWithMetaData) Ledger Uses

func (t *TransactionWithMetaData) Ledger() uint32

func (TransactionWithMetaData) MarshalJSON Uses

func (txm TransactionWithMetaData) MarshalJSON() ([]byte, error)

func (*TransactionWithMetaData) NodeId Uses

func (t *TransactionWithMetaData) NodeId() *Hash256

func (*TransactionWithMetaData) NodeType Uses

func (t *TransactionWithMetaData) NodeType() NodeType

func (*TransactionWithMetaData) Prefix Uses

func (t *TransactionWithMetaData) Prefix() HashPrefix

func (*TransactionWithMetaData) UnmarshalJSON Uses

func (txm *TransactionWithMetaData) UnmarshalJSON(b []byte) error

This function is a horrow show, demonstrating the huge inconsistencies in the presentation of a transaction by the rippled API. Indeed.

type Transfer Uses

type Transfer struct {
    Source             Account
    Destination        Account
    SourceBalance      Amount
    DestinationBalance Amount
    Change             Value
    TransitFee         *Value // Applies to all transfers except XRP -> XRP
    QualityIn          *Value // Applies to IOU -> IOU transfers
    QualityOut         *Value // Applies to IOU -> IOU transfers
}

Transfer is a directional representation of a RippleState or AccountRoot balance change. Payments and OfferCreates lead to the creation of zero or more Transfers.

TransitFee is earned by the Issuer
QualityIn and QualityOut are earned by the Liquidity Provider and can be negative.

Four scenarios:

1. XRP -> XRP
2. XRP -> IOU/Issuer 			Requires an orderbook
3. IOU/Issuer -> XRP			Requires an orderbook
4. IOU/IssuerA <-> IOU/IssuerB		Also known as Rippling, requires an account which trusts both currency/issuer pairs

type TrustSet Uses

type TrustSet struct {
    TxBase
    LimitAmount Amount
    QualityIn   *uint32 `json:",omitempty"`
    QualityOut  *uint32 `json:",omitempty"`
}

type TxBase Uses

type TxBase struct {
    TransactionType    TransactionType
    Flags              *TransactionFlag `json:",omitempty"`
    SourceTag          *uint32          `json:",omitempty"`
    Account            Account
    Sequence           uint32
    Fee                Value
    AccountTxnID       *Hash256        `json:",omitempty"`
    SigningPubKey      *PublicKey      `json:",omitempty"`
    TxnSignature       *VariableLength `json:",omitempty"`
    Memos              Memos           `json:",omitempty"`
    PreviousTxnID      *Hash256        `json:",omitempty"`
    LastLedgerSequence *uint32         `json:",omitempty"`
    Hash               Hash256         `json:"hash"`
}

func (*TxBase) Compare Uses

func (t *TxBase) Compare(other *TxBase) int

func (*TxBase) GetBase Uses

func (t *TxBase) GetBase() *TxBase

func (*TxBase) GetHash Uses

func (t *TxBase) GetHash() *Hash256

func (*TxBase) GetPublicKey Uses

func (t *TxBase) GetPublicKey() *PublicKey

func (*TxBase) GetSignature Uses

func (t *TxBase) GetSignature() *VariableLength

func (*TxBase) GetTransactionType Uses

func (t *TxBase) GetTransactionType() TransactionType

func (*TxBase) GetType Uses

func (t *TxBase) GetType() string

func (*TxBase) InitialiseForSigning Uses

func (t *TxBase) InitialiseForSigning()

func (*TxBase) PathSet Uses

func (t *TxBase) PathSet() PathSet

func (*TxBase) Prefix Uses

func (t *TxBase) Prefix() HashPrefix

func (*TxBase) SigningPrefix Uses

func (t *TxBase) SigningPrefix() HashPrefix

type Uint64Hex Uses

type Uint64Hex uint64

A uint64 which gets represented as a hex string in json

func (Uint64Hex) MarshalText Uses

func (h Uint64Hex) MarshalText() ([]byte, error)

func (*Uint64Hex) UnmarshalText Uses

func (h *Uint64Hex) UnmarshalText(b []byte) error

type Validation Uses

type Validation struct {
    Hash             Hash256
    Flags            uint32
    LedgerHash       Hash256
    LedgerSequence   uint32
    Amendments       Vector256
    SigningTime      RippleTime
    SigningPubKey    PublicKey
    Signature        VariableLength
    CloseTime        *uint32
    LoadFee          *uint32
    BaseFee          *uint64
    ReserveBase      *uint32
    ReserveIncrement *uint32
}

func ReadValidation Uses

func ReadValidation(r Reader) (*Validation, error)

func (Validation) GetHash Uses

func (v Validation) GetHash() *Hash256

func (Validation) GetPublicKey Uses

func (v Validation) GetPublicKey() *PublicKey

func (Validation) GetSignature Uses

func (v Validation) GetSignature() *VariableLength

func (Validation) GetType Uses

func (v Validation) GetType() string

func (Validation) InitialiseForSigning Uses

func (v Validation) InitialiseForSigning()

func (Validation) Prefix Uses

func (v Validation) Prefix() HashPrefix

func (Validation) SigningPrefix Uses

func (v Validation) SigningPrefix() HashPrefix

func (Validation) SuppressionId Uses

func (v Validation) SuppressionId() (Hash256, error)

type Value Uses

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

Value is the numeric type in Ripple. It can store numbers in two different representations: native and non-native. Non-native numbers are stored as a mantissa (Num) in the range [1e15,1e16) plus an exponent (Offset) in the range [-96,80]. Native values are stored as an integer number of "drips" each representing 1/1000000. Throughout the library, native values are interpreted as drips unless otherwise specified.

func NewNativeValue Uses

func NewNativeValue(n int64) (*Value, error)

NewNativeValue returns a Value with n drops. If the value is impossible an error is returned.

func NewNonNativeValue Uses

func NewNonNativeValue(n int64, offset int64) (*Value, error)

NewNonNativeValue returns a Value of n*10^offset.

func NewValue Uses

func NewValue(s string, native bool) (*Value, error)

NewValue accepts a string representation of a value and a flag to indicate if it should be stored as native. If the native flag is set AND a decimal is used, the number is interpreted as XRP. If no decimal is used, it is interpreted as drips.

func (Value) Abs Uses

func (v Value) Abs() *Value

Abs returns a copy of v with a positive sign.

func (Value) Add Uses

func (a Value) Add(b Value) (*Value, error)

Add adds a to b and returns the sum as a new Value.

Code:

v1, _ := NewValue("100", false)
v2, _ := NewValue("200.199", false)
sum, _ := v1.Add(*v2)
fmt.Println(v1.String())
fmt.Println(v2.String())
fmt.Println(sum.String())

Output:

100
200.199
300.199

func (*Value) Bytes Uses

func (v *Value) Bytes() []byte

func (Value) Clone Uses

func (v Value) Clone() *Value

Clone returns a Value which is a copy of v.

func (Value) Compare Uses

func (a Value) Compare(b Value) int

Compare returns an integer comparing two Values. The result will be 0 if a==b, -1 if a < b, and +1 if a > b.

func (Value) Divide Uses

func (num Value) Divide(den Value) (*Value, error)

func (Value) Equals Uses

func (a Value) Equals(b Value) bool

func (Value) Float Uses

func (v Value) Float() float64

func (Value) IsNative Uses

func (v Value) IsNative() bool

func (Value) IsNegative Uses

func (v Value) IsNegative() bool

func (Value) IsZero Uses

func (v Value) IsZero() bool

func (Value) Less Uses

func (a Value) Less(b Value) bool

Less compares values and returns true if a is less than b.

func (*Value) Marshal Uses

func (v *Value) Marshal(w io.Writer) error

func (Value) MarshalBinary Uses

func (v Value) MarshalBinary() ([]byte, error)

func (*Value) MarshalText Uses

func (v *Value) MarshalText() ([]byte, error)

func (Value) Multiply Uses

func (a Value) Multiply(b Value) (*Value, error)

func (Value) Native Uses

func (v Value) Native() (*Value, error)

Native returns a clone of the value in native format.

func (Value) Negate Uses

func (v Value) Negate() *Value

Negate returns a new Value with the opposite sign of v.

func (Value) NonNative Uses

func (v Value) NonNative() (*Value, error)

NonNative returns a clone of the value in non-native format.

func (Value) Rat Uses

func (v Value) Rat() *big.Rat

Rat returns the value as a big.Rat.

func (Value) Ratio Uses

func (a Value) Ratio(b Value) (*Value, error)

Ratio returns the ratio a/b. XRP are interpreted at face value rather than drips. The result of Ratio is always a non-native Value for additional precision.

func (Value) String Uses

func (v Value) String() string

String returns the Value as a string for human consumption. Native values are represented as decimal XRP rather than drips.

func (Value) Subtract Uses

func (a Value) Subtract(b Value) (*Value, error)

func (*Value) Unmarshal Uses

func (v *Value) Unmarshal(r Reader) error

func (*Value) UnmarshalBinary Uses

func (v *Value) UnmarshalBinary(b []byte) error

func (*Value) UnmarshalText Uses

func (v *Value) UnmarshalText(b []byte) error

func (Value) ZeroClone Uses

func (v Value) ZeroClone() *Value

ZeroClone returns a zero Value, native or non-native depending on v's setting.

type VariableLength Uses

type VariableLength []byte

func (*VariableLength) Bytes Uses

func (v *VariableLength) Bytes() []byte

func (*VariableLength) Marshal Uses

func (v *VariableLength) Marshal(w io.Writer) error

func (VariableLength) MarshalText Uses

func (v VariableLength) MarshalText() ([]byte, error)

func (*VariableLength) String Uses

func (v *VariableLength) String() string

func (*VariableLength) Unmarshal Uses

func (v *VariableLength) Unmarshal(r Reader) error

func (*VariableLength) UnmarshalText Uses

func (v *VariableLength) UnmarshalText(b []byte) error

Expects variable length hex

type Vector256 Uses

type Vector256 []Hash256

func (*Vector256) Marshal Uses

func (v *Vector256) Marshal(w io.Writer) error

func (Vector256) String Uses

func (v Vector256) String() string

func (*Vector256) Unmarshal Uses

func (v *Vector256) Unmarshal(r Reader) error

type Wire Uses

type Wire interface {
    Unmarshal(Reader) error
    Marshal(io.Writer) error
}

type Work Uses

type Work struct {
    *LedgerRange
    MissingLedgers LedgerSlice
    MissingNodes   []Hash256
}

Package data imports 19 packages (graph). Updated 2019-07-20. Refresh now. Tools for package owners.