Documentation ¶
Index ¶
- Constants
- func AskForConfirmation() bool
- func FormatTransactionWithMetaDataHeader() string
- func FormatTransactionWithMetaDataRow(tx *data.TransactionWithMetaData) string
- func FormatValue(v data.Value) string
- func GetPrimaryAccount() (*data.Account, error)
- func GetRippledUrl() (string, error)
- func GetRippledWSS() (string, error)
- func LintTransaction(txm *data.TransactionWithMetaData) []string
- func ParseCompleteLedgers(v string) (uint32, uint32, error)
- func SetAddress(address string) func(*Wallet) error
- func SetSecret(secret string) func(*Wallet) error
- func Sign(t data.Transaction, keypair Keypair) (hash, tx_blob string, err error)
- type AccountTxIterator
- type Keypair
- type ServerInfo
- func (server *ServerInfo) Fee() int
- func (info *ServerInfo) LedgerIndexBounds() (uint32, uint32)
- func (info *ServerInfo) LedgerIndexMax() uint32
- func (info *ServerInfo) LedgerIndexMin() uint32
- func (info *ServerInfo) Result() *rpc.ServerInfoResult
- func (server *ServerInfo) SignSubmitRetry(t data.Transaction, keypair Keypair) (rpc.TxResult, error)
- func (server *ServerInfo) SignSubmitWait(t data.Transaction, keypair Keypair) (rpc.TxResult, error)
- type Subscription
- func (sub *Subscription) AfterSequence(until uint32) <-chan uint32
- func (sub *Subscription) AfterTime(when interface{}) <-chan data.RippleTime
- func (sub *Subscription) AfterTx(hash data.Hash256, min, max uint32) <-chan *websockets.TxResult
- func (sub *Subscription) Ledgers() (uint32, uint32, error)
- func (sub *Subscription) Loop()
- func (sub *Subscription) SignAndSubmitFunc(wallet *Wallet, t data.Transaction) func() error
- func (sub *Subscription) SubmitWait(t data.Transaction) (*websockets.TxResult, error)
- func (sub *Subscription) SuggestLastLedger(delta uint32) uint32
- type Wallet
Constants ¶
const ( Primary = "primary" Issuer = "issuer" Trader = "trader" )
const (
DropsPerXRP = 1000000
)
const (
RecommendedLedgerInterval uint32 = 5
)
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
func AskForConfirmation() bool
askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user. Typically, you should use fmt to print out a question before calling askForConfirmation. E.g. fmt.Println("WARNING: Are you sure? (yes/no)")
func FormatTransactionWithMetaDataHeader ¶
func FormatTransactionWithMetaDataHeader() string
func FormatTransactionWithMetaDataRow ¶
func FormatTransactionWithMetaDataRow(tx *data.TransactionWithMetaData) string
func FormatValue ¶
Print a numeric value, avoiding scientific notation.
func GetPrimaryAccount ¶
func GetRippledWSS ¶
func LintTransaction ¶
func LintTransaction(txm *data.TransactionWithMetaData) []string
Analyze transaction for possible flaws. Format as human readable strings.
func ParseCompleteLedgers ¶
Function ParseCompleteLedgers accepts a complete_ledgers string and returns the min and max ledgers of the most recent continuous chunk of ledger history available.
func SetAddress ¶
Types ¶
type AccountTxIterator ¶
type AccountTxIterator struct {
// contains filtered or unexported fields
}
func NewAccountTxIterator ¶
func (*AccountTxIterator) Advance ¶
func (iter *AccountTxIterator) Advance(index uint32) error
func (*AccountTxIterator) Bounds ¶
func (iter *AccountTxIterator) Bounds() (uint32, uint32)
func (*AccountTxIterator) Close ¶
func (iter *AccountTxIterator) Close()
func (*AccountTxIterator) Error ¶
func (iter *AccountTxIterator) Error() error
func (*AccountTxIterator) Next ¶
func (iter *AccountTxIterator) Next() bool
type Keypair ¶
type Keypair struct { Address string KeyType data.KeyType // contains filtered or unexported fields }
func GetPrimaryKeypair ¶
func NewEcdsaFromSecret ¶
type ServerInfo ¶
type ServerInfo struct {
// contains filtered or unexported fields
}
func NewServerInfoUpdater ¶
func NewServerInfoUpdater(client rpc.Client) (*ServerInfo, error)
func (*ServerInfo) Fee ¶
func (server *ServerInfo) Fee() int
func (*ServerInfo) LedgerIndexBounds ¶
func (info *ServerInfo) LedgerIndexBounds() (uint32, uint32)
func (*ServerInfo) LedgerIndexMax ¶
func (info *ServerInfo) LedgerIndexMax() uint32
func (*ServerInfo) LedgerIndexMin ¶
func (info *ServerInfo) LedgerIndexMin() uint32
func (*ServerInfo) Result ¶
func (info *ServerInfo) Result() *rpc.ServerInfoResult
func (*ServerInfo) SignSubmitRetry ¶
func (server *ServerInfo) SignSubmitRetry(t data.Transaction, keypair Keypair) (rpc.TxResult, error)
This is part of *ServerInfo because ledger history is known, checked vs LastLedgerSequence
func (*ServerInfo) SignSubmitWait ¶
func (server *ServerInfo) SignSubmitWait(t data.Transaction, keypair Keypair) (rpc.TxResult, error)
This is part of *ServerInfo because ledger history is known, checked vs LastLedgerSequence
type Subscription ¶
type Subscription struct { // Make "Remote" public so that calls can made to it directly. Remote *websockets.Remote // contains filtered or unexported fields }
func NewSubscription ¶
func NewSubscription(wss string) (*Subscription, error)
func (*Subscription) AfterSequence ¶
func (sub *Subscription) AfterSequence(until uint32) <-chan uint32
Modelled on time.After(), this function provides a convenient way to wait for a specific ledger instance to pass.
func (*Subscription) AfterTime ¶
func (sub *Subscription) AfterTime(when interface{}) <-chan data.RippleTime
Modelled on time.After(), this function provides a convenient way to wait for a specific ledger instance to pass.
func (*Subscription) AfterTx ¶
func (sub *Subscription) AfterTx(hash data.Hash256, min, max uint32) <-chan *websockets.TxResult
func (*Subscription) Loop ¶
func (sub *Subscription) Loop()
func (*Subscription) SignAndSubmitFunc ¶
func (sub *Subscription) SignAndSubmitFunc(wallet *Wallet, t data.Transaction) func() error
Helper to sign and submit a transaction. Returns a func with errgroup.Group compatible signature.
func (*Subscription) SubmitWait ¶
func (sub *Subscription) SubmitWait(t data.Transaction) (*websockets.TxResult, error)
func (*Subscription) SuggestLastLedger ¶
func (sub *Subscription) SuggestLastLedger(delta uint32) uint32
type Wallet ¶
type Wallet struct { Address string // deprecated, delete once replace with account. Account *data.Account Sequence uint32 // if unknown will be 0 LedgerSequence uint32 // 0 if unknown, otherwise when account_info returned data. Balance *data.Value // XRP Balance as of LastLedger // contains filtered or unexported fields }
func (*Wallet) GetAccountInfo ¶
func (wallet *Wallet) GetAccountInfo(remote *websockets.Remote) error
func (*Wallet) GetAccountInfoRPC ¶
Deprecated in favor of websockets.