models

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MIN_TICK_SIZE = 3
	MAX_TICK_SIZE = 15
)
View Source
const MAX_TICKETS = 250

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSetFlags

type AccountSetFlags struct {
	GlobalFlags
	TfRequireDestTag  bool `json:"tfRequireDestTag,omitempty"`
	TfOptionalDestTag bool `json:"tfOptionalDestTag,omitempty"`
	TfRequireAuth     bool `json:"tfRequireAuth,omitempty"`
	TfOptionalAuth    bool `json:"tfOptionalAuth,omitempty"`
	TfDisallowXRP     bool `json:"tfDisallowXRP,omitempty"`
	TfAllowXRP        bool `json:"tfAllowXRP,omitempty"`
}

Map of flags to boolean values representing {@link AccountSet} transaction flags.

type Amount

type Amount IssuedCurrencyAmount

type BaseRequest

type BaseRequest struct {
	Id         string `json:"id,omitempty"`
	Command    string `json:"command,omitempty"`
	ApiVersion int16  `json:"api_version,omitempty"`
}

type BaseResponse

type BaseResponse struct {
	Id         string    `json:"id,omitempty"`
	Status     string    `json:"status,omitempty"`
	Type       string    `json:"type,omitempty"`
	Result     string    `json:"result,omitempty"`
	Warning    string    `json:"warning,omitempty"`
	Warnings   []Warning `json:"warnings,omitempty"`
	Forwarded  bool      `json:"forwarded,omitempty"`
	ApiVersion int16     `json:"api_version,omitempty"`
}

type BaseTransaction

type BaseTransaction struct {
	Account            string
	TransactionType    string
	Fee                string
	Sequence           int64
	AccountTxnID       string
	Flags              int64
	LastLedgerSequence int64
	Memos              []Memo
	Signers            []Signer
	SourceTag          int64
	SigningPubKey      string
	TicketSequence     int64
	TxnSignature       string
}

Set of common fields for every transaction

type BinaryLedger

type BinaryLedger struct {
	AccountState []string `json:"accountState,omitempty"`
	Transactions []string `json:"transactions,omitempty"`
}

type CTID added in v0.2.3

type CTID struct {
	LeadIn           uint64
	LedgerIndex      uint64
	TransactionIndex uint64
	NetworkId        uint64
}

* CTID spec: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0037d-concise-transaction-identifier-ctid

func (*CTID) Encode added in v0.2.3

func (c *CTID) Encode() string

* Encode CTID struct to XLS-37 CTID

type ConsensusStream

type ConsensusStream struct {
	Type      string `json:"type,omitempty"` // default: consensusPhase
	Consensus string `json:"consensus,omitempty"`
}

type CreatedNode

type CreatedNode struct {
	CreatedNode CreatedNodeMap
}

type CreatedNodeMap

type CreatedNodeMap struct {
	LedgerEntryType string
	LedgerIndex     string
	NewFields       map[string]interface{}
}

type Currency

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

type DeletedNode

type DeletedNode struct {
	DeletedNode DeletedNodeMap
}

type DeletedNodeMap

type DeletedNodeMap struct {
	LedgerEntryType string
	LedgerIndex     string
	FinalFields     map[string]interface{}
}

type ErrorResponse

type ErrorResponse struct {
	Id           int    `json:"id,omitempty"`
	Status       string `json:"status,omitempty"`
	Type         string `json:"type,omitempty"`
	Error        string `json:"error,omitempty"`
	ErrorCode    string `json:"error_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
	ApiVersion   int16  `json:"api_version,omitempty"`
}

type GlobalFlags

type GlobalFlags struct {
}

type IssuedCurrency

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

type IssuedCurrencyAmount

type IssuedCurrencyAmount struct {
	IssuedCurrency `json:"issued_currency,omitempty"`
	Value          string `json:"value,omitempty"`
}

type LedgerIndex

type LedgerIndex int

type LedgerQueueData

type LedgerQueueData struct {
	Account          string      `json:"account,omitempty"`
	Tx               interface{} `json:"tx,omitempty"`
	RetriesRemaining int         `json:"retries_remaining,omitempty"`
	PreflightResult  string      `json:"preflight_result,omitempty"`
	LastResult       string      `json:"last_result,omitempty"`
	AuthChange       bool        `json:"auth_change,omitempty"`
	Fee              string      `json:"fee,omitempty"`
	FeeLevel         string      `json:"fee_level,omitempty"`
	MaxSpendDrops    string      `json:"max_spend_drops,omitempty"`
}

type LedgerRequest

type LedgerRequest struct {
	BaseRequest
	LedgerHash   string      `json:"ledger_hash,omitempty"`
	LedgerIndex  LedgerIndex `json:"ledger_index,omitempty"`
	Full         bool        `json:"full,omitempty"`
	Accounts     bool        `json:"accounts,omitempty"`
	Transactions bool        `json:"transactions,omitempty"`
	Expand       bool        `json:"expand,omitempty"`
	OwnerFunds   bool        `json:"owner_funds,omitempty"`
	Binary       bool        `json:"binary,omitempty"`
	Queue        bool        `json:"queue,omitempty"`
}

type LedgerResponse

type LedgerResponse struct {
	BaseResponse
	Result LedgerResult
}

type LedgerResult

type LedgerResult struct {
	Ledger      interface{}       `json:"ledger,omitempty"`
	LedgerHash  string            `json:"ledger_hash,omitempty"`
	LedgerIndex int               `json:"ledger_index,omitempty"`
	QueueData   []LedgerQueueData `json:"queue_data,omitempty"`
	Validated   bool              `json:"validated,omitempty"`
}

type LedgerStream

type LedgerStream struct {
	Type             string `json:"type,omitempty"` // default: ledgerClosed
	FeeBase          uint64 `json:"fee_base,omitempty"`
	FeeRef           uint64 `json:"fee_ref,omitempty"`
	LedgerHash       string `json:"ledger_hash,omitempty"`
	LedgerIndex      uint64 `json:"ledger_index,omitempty"`
	LedgerTime       uint64 `json:"ledger_time,omitempty"`
	ReserveBase      uint64 `json:"reserve_base,omitempty"`
	ReserveInc       uint64 `json:"reserve_inc,omitempty"`
	TxnCount         uint64 `json:"txn_count,omitempty"`
	ValidatedLedgers string `json:"validated_ledgers,omitempty"`
}

type Memo

type Memo struct {
	Memo MemoMap `json:"memo,omitempty"`
}

type MemoMap

type MemoMap struct {
	MemoData   string `json:"memo_data,omitempty"`
	MemoType   string `json:"memo_type,omitempty"`
	MemoFormat string `json:"memo_format,omitempty"`
}

type ModifiedNode

type ModifiedNode struct {
	ModifiedNode ModifiedNodeMap
}

type ModifiedNodeMap

type ModifiedNodeMap struct {
	LedgerEntryType   string
	LedgerIndex       string
	FinalFields       map[string]interface{}
	PreviousFields    map[string]interface{}
	PreviousTxnID     string
	PreviousTxnLgrSeq int64
}

type NFTOffer

type NFTOffer struct {
	Amount        Amount `json:"amount,omitempty"`
	Flags         int    `json:"flags,omitempty"`
	NftOfferIndex string `json:"nft_offer_index,omitempty"`
	Owner         string `json:"owner,omitempty"`
	Destination   string `json:"destination,omitempty"`
	Expiration    int    `json:"expiration,omitempty"`
}

type NFTokenCreateOfferFlags

type NFTokenCreateOfferFlags struct {
	GlobalFlags
	TfSellNFToken bool `json:"tfSellNFToken,omitempty"`
}

type NFTokenMintFlags

type NFTokenMintFlags struct {
	GlobalFlags
	TfBurnable     bool `json:"tfBurnable,omitempty"`
	TfOnlyXRP      bool `json:"tfOnlyXRP,omitempty"`
	TfTrustLine    bool `json:"tfTrustLine,omitempty"`
	TfTransferable bool `json:"tfTransferable,omitempty"`
}

type OfferCreateFlags

type OfferCreateFlags struct {
	GlobalFlags
	TfPassive           bool `json:"tfPassive,omitempty"`
	TfImmediateOrCancel bool `json:"tfImmediateOrCancel,omitempty"`
	TfFillOrKill        bool `json:"tfFillOrKill,omitempty"`
	TfSell              bool `json:"tfSell,omitempty"`
}

type OrderBookStream

type OrderBookStream struct {
	Type                string `json:"type,omitempty"` // default: transaction
	Status              string `json:"status,omitempty"`
	EngineResult        string `json:"engine_result,omitempty"`
	EngineResultCode    int64  `json:"engine_result_code,omitempty"`
	EngineResultMessage string `json:"engine_result_message,omitempty"`
	LedgerCurrentIndex  uint64 `json:"ledger_current_index,omitempty"`
	LedgerHash          string `json:"ledger_hash,omitempty"`
	LedgerIndex         uint64 `json:"ledger_index,omitempty"`
	Meta                string `json:"meta,omitempty"`
	Transaction         string `json:"transaction,omitempty"`
	Validated           bool   `json:"validated,omitempty"`
}

type Path

type Path []PathStep

type PathFindStream

type PathFindStream struct {
	Type               string `json:"type,omitempty"` // default: path_find
	SourceAccount      string `json:"source_account,omitempty"`
	DestinationAccount string `json:"destination_account,omitempty"`
	DestinationAmount  string `json:"destination_amount,omitempty"`
	FullReply          bool   `json:"full_reply,omitempty"`
	Id                 string `json:"id,omitempty"`
	SendMax            string `json:"send_max,omitempty"`
}

type PathStep

type PathStep struct {
	Account  string `json:"account,omitempty"`
	Currency string `json:"currency,omitempty"`
	Issuer   string `json:"issuer,omitempty"`
}

type PaymentChannelClaimFlags

type PaymentChannelClaimFlags struct {
	GlobalFlags
	TfRenew bool `json:"tfRenew,omitempty"`
	TfClose bool `json:"tfClose,omitempty"`
}

type PaymentFlags

type PaymentFlags struct {
	GlobalFlags
	TfNoDirectRipple bool `json:"tfNoDirectRipple,omitempty"`
	TfPartialPayment bool `json:"tfPartialPayment,omitempty"`
	TfLimitQuality   bool `json:"tfLimitQuality,omitempty"`
}

type PeerStatusStream

type PeerStatusStream struct {
	Type           string `json:"type,omitempty"` // default: peerStatusChange
	Action         string `json:"action,omitempty"`
	Date           uint64 `json:"date,omitempty"`
	LedgerHash     string `json:"ledger_hash,omitempty"`
	LedgerIndex    uint64 `json:"ledger_index,omitempty"`
	LedgerIndexMax uint64 `json:"ledger_index_max,omitempty"`
	LedgerIndexMin uint64 `json:"ledger_index_min,omitempty"`
}

type ResponseOnlyTxInfo

type ResponseOnlyTxInfo struct {
	Date        int    `json:"date,omitempty"`
	Hash        string `json:"hash,omitempty"`
	LedgerIndex int    `json:"ledger_index,omitempty"`
	InLedger    int    `json:"in_ledger,omitempty"`
}

type Signer

type Signer struct {
	Signer SignerMap `json:"signer,omitempty"`
}

type SignerEntry

type SignerEntry struct {
	SignerEntry SignerEntryMap `json:"signer_entry,omitempty"`
}

type SignerEntryMap

type SignerEntryMap struct {
	Account       string `json:"account,omitempty"`
	SignerWeight  int16  `json:"signer_weight,omitempty"`
	WalletLocator string `json:"wallet_locator,omitempty"`
}

type SignerMap

type SignerMap struct {
	Account       string `json:"account,omitempty"`
	TxnSignature  string `json:"txn_signature,omitempty"`
	SigningPubKey string `json:"signing_pub_key,omitempty"`
}

type StreamType

type StreamType string

type TransactionAccountDelete

type TransactionAccountDelete struct {
	BaseTransaction
	Destination    string
	DestinationTag int64
}

An AccountDelete transaction deletes an account and any objects it owns in the XRP Ledger, if possible, sending the account's remaining XRP to a specified destination account.

TransactionType: 'AccountDelete'

type TransactionAccountSet

type TransactionAccountSet struct {
	BaseTransaction
	Flags         int64
	ClearFlag     int64
	Domain        string
	EmailHash     string
	MessageKey    string
	SetFlag       int64
	TransferRate  int64
	TickSize      int64
	NFTokenMinter string
}

An AccountSet transaction modifies the properties of an account in the XRP Ledger

TransactionType: 'AccountSet'

type TransactionCheckCancel

type TransactionCheckCancel struct {
	BaseTransaction
	CheckID string
}

Cancels an unredeemed Check, removing it from the ledger without sending any money. The source or the destination of the check can cancel a Check at any time using this transaction type. If the Check has expired, any address can cancel it.

TransactionType: 'CheckCancel'

type TransactionCheckCash

type TransactionCheckCash struct {
	BaseTransaction
	CheckID    string
	Amount     Amount
	DeliverMin Amount
}

Attempts to redeem a Check object in the ledger to receive up to the amount authorized by the corresponding CheckCreate transaction. Only the Destination address of a Check can cash it with a CheckCash transaction.

TransactionType: 'CheckCash'

type TransactionCheckCreate

type TransactionCheckCreate struct {
	BaseTransaction
	Destination    string
	SendMax        Amount
	DestinationTag int64
	Expiration     int64
	InvoiceID      string
}

Create a Check object in the ledger, which is a deferred payment that can be cashed by its intended destination. The sender of this transaction is the sender of the Check.

TransactionType: 'CheckCreate'

type TransactionDepositPreauth

type TransactionDepositPreauth struct {
	BaseTransaction
	Authorize   string
	Unauthorize string
}

A DepositPreauth transaction gives another account pre-approval to deliver payments to the sender of this transaction. This is only useful if the sender of this transaction is using (or plans to use) Deposit Authorization.

TransactionType: 'DepositPreauth'

type TransactionEscrowCancel

type TransactionEscrowCancel struct {
	BaseTransaction
	Owner         string
	OfferSequence int64
}

Return escrowed XRP to the sender.

TransactionType: 'EscrowCancel'

type TransactionEscrowCreate

type TransactionEscrowCreate struct {
	BaseTransaction
	Amount         Amount
	Destination    string
	CancelAfter    int64
	FinishAfter    int64
	Condition      string
	DestinationTag int64
}

Sequester XRP until the escrow process either finishes or is canceled.

TransactionType: 'EscrowCreate'

type TransactionEscrowFinish

type TransactionEscrowFinish struct {
	BaseTransaction
	Owner         string
	OfferSequence int64
	Condition     string
	Fulfillment   string
}

Deliver XRP from a held payment to the recipient.

TransactionType: 'EscrowFinish'

type TransactionMetadata

type TransactionMetadata struct {
	AffectedNodes     []map[string]interface{}
	DeliveredAmount   Amount
	Delivered_Amount  Amount `json:"delivered_amount,omitempty"`
	TransactionIndex  int64
	TransactionResult string
}

type TransactionNFTokenAcceptOffer

type TransactionNFTokenAcceptOffer struct {
	BaseTransaction
	NFTokenSellOffer string
	NFTokenBuyOffer  string
	NFTokenBrokerFee Amount
}

The NFTokenOfferAccept transaction is used to accept offers to buy or sell an NFToken

TransactionType: 'NFTokenAcceptOffer'

type TransactionNFTokenBurn

type TransactionNFTokenBurn struct {
	BaseTransaction
	Account   string
	NFTokenID string
	Owner     string
}

The NFTokenBurn transaction is used to remove an NFToken object from the NFTokenPage in which it is being held, effectively removing the token from the ledger ("burning" it).

TransactionType: 'NFTokenBurn'

type TransactionNFTokenCancelOffer

type TransactionNFTokenCancelOffer struct {
	BaseTransaction
	NFTokenOffers []string
}

The NFTokenCancelOffer transaction deletes existing NFTokenOffer objects. It is useful if you want to free up space on your account to lower your reserve requirement.

TransactionType: 'NFTokenCancelOffer'

type TransactionNFTokenCreateOffer

type TransactionNFTokenCreateOffer struct {
	BaseTransaction
	NFTokenID   string
	Amount      Amount
	Owner       string
	Expiration  int64
	Destination string
	Flags       int64
}

The NFTokenCreateOffer transaction creates either an offer to buy an NFT the submitting account does not own, or an offer to sell an NFT the submitting account does own.

TransactionType: 'NFTokenCreateOffer'

type TransactionNFTokenMint

type TransactionNFTokenMint struct {
	BaseTransaction
	NFTokenTaxon int64
	Issuer       string
	TransferFee  int64
	URI          string
	Flags        int64
}

The NFTokenMint transaction creates an NFToken object and adds it to the relevant NFTokenPage object of the minter. If the transaction is successful, the newly minted token will be owned by the minter account specified by the transaction.

TransactionType: 'NFTokenMint'

type TransactionOfferCancel

type TransactionOfferCancel struct {
	BaseTransaction
	OfferSequence int64
}

An OfferCancel transaction removes an Offer object from the XRP Ledger.

TransactionType: 'OfferCancel'

type TransactionOfferCreate

type TransactionOfferCreate struct {
	BaseTransaction
	Flags         int64
	Expiration    int64
	OfferSequence int64
	TakerGets     Amount
	TakerPays     Amount
}

An OfferCreate transaction is effectively a limit order . It defines an intent to exchange currencies, and creates an Offer object if not completely. Fulfilled when placed. Offers can be partially fulfilled.

TransactionType: 'OfferCreate'

type TransactionPayment

type TransactionPayment struct {
	BaseTransaction
	Amount         Amount
	Destination    string
	DestinationTag int64
	InvoiceID      string
	Paths          []Path
	SendMax        Amount
	DeliverMin     Amount
	Flags          int64
}

A Payment transaction represents a transfer of value from one account to another.

TransactionType: 'Payment'

type TransactionPaymentChannelClaim

type TransactionPaymentChannelClaim struct {
	BaseTransaction
	Flags     int64
	Channel   string
	Balance   string
	Amount    string
	Signature string
	PublicKey string
}

Claim XRP from a payment channel, adjust the payment channel's expiration, or both.

TransactionType: 'PaymentChannelClaim'

type TransactionPaymentChannelCreate

type TransactionPaymentChannelCreate struct {
	BaseTransaction
	Amount         string
	Destination    string
	SettleDelay    int64
	PublicKey      string
	CancelAfter    int64
	DestinationTag int64
}

Create a unidirectional channel and fund it with XRP. The address sending this transaction becomes the "source address" of the payment channel.

TransactionType: 'PaymentChannelCreate'

type TransactionPaymentChannelFund

type TransactionPaymentChannelFund struct {
	BaseTransaction
	Channel    string
	Amount     string
	Expiration int64
}

Add additional XRP to an open payment channel, and optionally update the expiration time of the channel. Only the source address of the channel can use this transaction.

TransactionType: 'PaymentChannelFund'

type TransactionSetRegularKey

type TransactionSetRegularKey struct {
	BaseTransaction
	RegularKey string
}

A SetRegularKey transaction assigns, changes, or removes the regular key pair associated with an account.

TransactionType: 'SetRegularKey'

type TransactionSignerListSet

type TransactionSignerListSet struct {
	BaseTransaction
	SignerQuorum  int64
	SignerEntries []SignerEntry
}

The SignerListSet transaction creates, replaces, or removes a list of signers that can be used to multi-sign a transaction.

TransactionType: 'SignerListSet'

type TransactionStream

type TransactionStream struct {
	Type                string `json:"type,omitempty"` // default: transaction
	Status              string `json:"status,omitempty"`
	EngineResult        string `json:"engine_result,omitempty"`
	EngineResultCode    int64  `json:"engine_result_code,omitempty"`
	EngineResultMessage string `json:"engine_result_message,omitempty"`
	LedgerCurrentIndex  uint64 `json:"ledger_current_index,omitempty"`
	LedgerHash          string `json:"ledger_hash,omitempty"`
	LedgerIndex         uint64 `json:"ledger_index,omitempty"`
	Meta                string `json:"meta,omitempty"`
	Transaction         string `json:"transaction,omitempty"`
	Validated           bool   `json:"validated,omitempty"`
}

type TransactionTicketCreate

type TransactionTicketCreate struct {
	BaseTransaction
	TicketCount int64
}

A TicketCreate transaction sets aside one or more sequence numbers as Tickets.

TransactionType: 'TicketCreate'

type TransactionTrustSet

type TransactionTrustSet struct {
	BaseTransaction
	LimitAmount IssuedCurrencyAmount
	QualityIn   int64
	QualityOut  int64
	Flags       int64
}

Create or modify a trust line linking two accounts.

TransactionType: 'TrustSet'

type TrustSetFlags

type TrustSetFlags struct {
	GlobalFlags
	TfSetfAuth      bool `json:"tfSetfAuth,omitempty"`
	TfSetNoRipple   bool `json:"tfSetNoRipple,omitempty"`
	TfClearNoRipple bool `json:"tfClearNoRipple,omitempty"`
	TfSetFreeze     bool `json:"tfSetFreeze,omitempty"`
	TfClearFreeze   bool `json:"tfClearFreeze,omitempty"`
}

type ValidationStream

type ValidationStream struct {
	Type                string   `json:"type,omitempty"` // default: validationReceived
	Amendments          []string `json:"amendments,omitempty"`
	BaseFee             uint64   `json:"base_fee,omitempty"`
	Cookie              string   `json:"cookie,omitempty"`
	Data                string   `json:"data,omitempty"`
	Flags               uint64   `json:"flags,omitempty"`
	Full                bool     `json:"full,omitempty"`
	LedgerHash          string   `json:"ledger_hash,omitempty"`
	LedgerIndex         uint64   `json:"ledger_index,omitempty"`
	LoadFee             uint64   `json:"load_fee,omitempty"`
	MasterKey           string   `json:"master_key,omitempty"`
	ReserveBase         uint64   `json:"reserve_base,omitempty"`
	ReserveInc          uint64   `json:"reserve_inc,omitempty"`
	Signature           string   `json:"signature,omitempty"`
	SigningTime         uint64   `json:"signing_time,omitempty"`
	ValidationPublicKey string   `json:"validation_public_key,omitempty"`
}

type Warning

type Warning struct {
	Id      int               `json:"id,omitempty"`
	Message string            `json:"message,omitempty"`
	Details map[string]string `json:"details,omitempty"`
}

Jump to

Keyboard shortcuts

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