rpc

package
v0.0.0-...-6290394 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: ISC Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountBalancesStruct

type AccountBalancesStruct struct {
	Result      string     `json: "result"`
	LedgerIndex int64      `json: "ledger_index"`
	CloseTime   string     `json: "close_time"`
	Limit       int        `json: "limit"`
	Balances    []*Balance `json: "balances"`
	Message     string
}

type AccountInfoData

type AccountInfoData struct {
	Index    string
	Sequence uint32
}

type AccountInfoResp

type AccountInfoResp struct {
	Result *AccountInfoResult
}

type AccountInfoResult

type AccountInfoResult struct {
	Validated          bool
	Status             string
	LedgerCurrentIndex int64            `json:"ledger_current_index"`
	AccountData        *AccountInfoData `json:"account_data"`
}

type AccountTransactionData

type AccountTransactionData struct {
	Hash        string
	LedgerIndex int64 `json:"ledger_index"`
	Date        string
	Tx          *AccountTransactionTx
	Meta        *AccountTransactionMeta
}

type AccountTransactionMeta

type AccountTransactionMeta struct {
	TransactionIndex int64
	// AffectedNodes     []*AccountTransactionAffectedNodes
	TransactionResult string
	DeliveredAmount   string `json:"delivered_amount"`
}

type AccountTransactionResp

type AccountTransactionResp struct {
	Result       string
	Count        int
	Marker       string
	Transactions []*AccountTransactionData
}

type AccountTransactionTx

type AccountTransactionTx struct {
	TransactionType    string
	Flags              int64
	Sequence           int64
	LastLedgerSequence int64
	Amount             string
	Fee                string
	SigningPubKey      string
	TxnSignature       string
	Account            string
	Destination        string
	DestinationTag     int64
}

type Amount

type Amount struct {
	Currency string
	Value    string
	Issuer   string
}

type Balance

type Balance struct {
	Currency     string `json:"currency"`
	Counterparty string
	Value        string
}

type Client

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

func NewClient

func NewClient(rpcJsonURL, apiURL string) *Client

func (*Client) GenAddress

func (c *Client) GenAddress() (string, string, string, error)

GenAddress 生成账户地址

func (*Client) GetAccountBalances

func (c *Client) GetAccountBalances(address string, queryParams map[string]string) (*AccountBalancesStruct, error)

GetAccountBalances 获取账户余额

func (*Client) GetAccountInfo

func (c *Client) GetAccountInfo(address string) (*AccountInfoResult, error)

func (*Client) GetAccountTransactions

func (c *Client) GetAccountTransactions(address string, params map[string]string) (*AccountTransactionResp, error)

GetAccountTransactions https://developers.ripple.com/data-api.html#get-account-transaction-history

func (*Client) GetLedger

func (c *Client) GetLedger(index uint32) (*Ledger, error)

func (*Client) GetLedgerCurrent

func (c *Client) GetLedgerCurrent() (*LedgerCurrent, error)

func (*Client) GetServerInfo

func (c *Client) GetServerInfo() (*ServerInfoResult, error)

func (*Client) Payments

func (c *Client) Payments(currency string, startTs, endTs int64, limit int, marker string) (*PaymentResp, error)

https://developers.ripple.com/data-api.html#get-payments

func (*Client) Sign

func (c *Client) Sign(from, to string, tag uint32, currency, value, fee, privateKey string, accountSequence, lastLedgerSequence uint32) (string, string, error)

https://developers.ripple.com/sign.html

func (*Client) Submit

func (c *Client) Submit(txBlob string) (*SubmitResult, error)

func (*Client) TX

func (c *Client) TX(hash string) (*TxResult, error)

https://developers.ripple.com/tx.html

type Ledger

type Ledger struct {
	LLedger     *LedgerSub `json:"ledger"`
	LedgerHash  string     `json:"ledger_hash"`
	LedgerIndex uint32     `json:"ledger_index"`
	Status      string     `json:"status"`
	Validated   bool       `json:"validated"`
}

type LedgerCurrent

type LedgerCurrent struct {
	LedgerCurrentIndex uint32 `json:"ledger_current_index"`
	Status             string `json:"status"`
}

type LedgerCurrentResult

type LedgerCurrentResult struct {
	Reslut *LedgerCurrent `json:"result"`
}

type LedgerRequest

type LedgerRequest struct {
	LedgerIndex  uint32 `json:"ledger_index"`
	Accounts     bool   `json:"accounts"`
	Full         bool   `json:"full"`
	Transactions bool   `json:"transactions"`
	Expand       bool   `json:"expand"`
	OwnerFunds   bool   `json:"owner_funds"`
}

type LedgerResult

type LedgerResult struct {
	Reslut *Ledger `json:"result"`
}

type LedgerSub

type LedgerSub struct {
	Accepted            bool     `json:"accepted"`
	AccountHash         string   `json:"account_hash"`
	CloseFlags          uint32   `json:"close_flags"`
	CloseTime           uint32   `json:"close_time"`
	CloseTimeHuman      string   `json:"close_time_human"`
	CloseTimeResolution uint32   `json:"close_time_resolution"`
	Closed              bool     `json:"closed"`
	Hash                string   `json:"hash"`
	LedgerHash          string   `json:"ledger_hash"`
	LedgerIndex         string   `json:"ledger_index"`
	ParentCloseTime     uint32   `json:"parent_close_time"`
	ParentHash          string   `json:"parent_hash"`
	SeqNum              string   `json:"seqNum"`
	TotalCoins          string   `json:"totalCoins"`
	TransactionHash     string   `json:"transaction_hash"`
	Transactions        []string `json:"transactions"`
}

type Params

type Params struct {
	Method string        `json:"method"`
	Params []interface{} `json:"params"`
}

type Payment

type Payment struct {
	Amount                    string
	DeliveredAmount           string                   `json:"delivered_amount"`
	DestinationBalanceChanges []*PaymentBalanceChanges `json:"destination_balance_changes"`
	SourceBalanceChanges      []*PaymentBalanceChanges `json:"source_balance_changes"`
	TransacationCost          string                   `json:"transacation_cost"`
	TxIndex                   int64                    `json:"tx_index"`
	Currency                  string
	Destination               string
	ExecutedTime              string `json:"executed_time"`
	Issuer                    string
	LedgerIndex               int64 `json:"ledger_index"`
	Source                    string
	SourceCurrency            string
	TxHash                    string `json:"tx_hash"`
}

type PaymentBalanceChanges

type PaymentBalanceChanges struct {
	Counterparty string
	Currency     string
	Value        string
}

type PaymentResp

type PaymentResp struct {
	Result   string
	Count    int64
	Marker   string
	Payments []*Payment
}

type ServerInfoResp

type ServerInfoResp struct {
	Result *ServerInfoResult
}

type ServerInfoResult

type ServerInfoResult struct {
	State  ServerInfoState
	Status string
}

type ServerInfoState

type ServerInfoState struct {
	BuildVersion    string                    `json:"build_version"`
	CompleteLedgers string                    `json:"complete_ledgers"`
	ValidatedLedger ServerInfoValidatedLedger `json:"validated_ledger"`
}

type ServerInfoValidatedLedger

type ServerInfoValidatedLedger struct {
	BaseFee     int64 `json:"base_fee"`
	CloseTime   int64 `json:"close_time"`
	Hash        string
	ReserveBase int64 `json:"reserve_base"`
	ReserveInc  int64 `json:"reserve_inc"`
	Seq         uint32
}

type SubmitResp

type SubmitResp struct {
	Result *SubmitResult
}

type SubmitResult

type SubmitResult struct {
	EngineResult        string `json:"engine_result"`
	EngineResultCode    int64  `json:"engine_result_code"`
	EngineResultMessage string `json:"engine_result_message"`
	Status              string
	TxBlob              string       `json:"tx_blob"`
	TxJson              SubmitTxJson `json:"tx_json"`
}

submit 命令的返回

type SubmitTxJson

type SubmitTxJson struct {
	Account            string
	Amount             string
	Destination        string
	Fee                string
	LastLedgerSequence int64
	Sequence           int64
	SigningPubKey      string
	TransactionType    string
	TxnSignature       string
	Hash               string `json:"hash"`
}

type Transaction

type Transaction struct {
	TransactionType    string
	Account            string
	Destination        string
	Amount             *Amount
	Sequence           int64
	LastLedgerSequence int64
	Fee                int64
}

type TxFinalFields

type TxFinalFields struct {
	Account    string
	Balance    string
	Flags      int64
	OwnerCount int64
	Sequence   int64
}

type TxMeta

type TxMeta struct {
	AffectedNodes     []TxModifyNode
	TransactionIndex  int64
	TransactionResult string
	DeliveredAomunt   string `json:"delivered_amount"`
}

type TxModifyNode

type TxModifyNode struct {
	FinalFields     TxFinalFields
	LedgerEntryType string
	LedgerIndex     string
	PreviousFields  TxPreviousFields
}

type TxPreviousFields

type TxPreviousFields struct {
	Balance  string
	Sequence int64
}

type TxRequest

type TxRequest struct {
	Command     string
	Transaction string
}

type TxResp

type TxResp struct {
	Result *TxResult
}

tx 命令的返回

type TxResult

type TxResult struct {
	Account            string
	Amount             string
	Destination        string
	DestinationTag     uint64
	SourceTag          uint64
	Fee                string
	LastLedgerSequence int64
	Sequence           int64
	SigningPubKey      string
	TransactionType    string
	TxnSignatrue       string
	Date               int64
	Hash               string
	InLedger           int64
	LedgerIndex        int64 `json:"ledger_index"`
	Meta               *TxMeta
	Validated          bool   `json:"validated"`
	Status             string `json:"status"`
	Error              string
	ErrorMessage       string `json:"error_message"`
	ErrorCode          int64  `json:"error_code"`
	Requeset           *TxRequest
}

Jump to

Keyboard shortcuts

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