ledger

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PriceDataScaleMax is the maximum scale for a price data.
	PriceDataScaleMax uint8 = 10
)

Variables

View Source
var (
	// ErrPriceDataScale is returned when the scale is greater than the maximum allowed.
	ErrPriceDataScale = fmt.Errorf("scale must be less than %d", PriceDataScaleMax)
	// ErrPriceDataAssetPriceAndScale is returned when the asset price and scale are not set together.
	ErrPriceDataAssetPriceAndScale = fmt.Errorf("asset price and scale must be set together")
	// ErrPriceDataBaseAsset is returned when the base asset is required but not set.
	ErrPriceDataBaseAsset = errors.New("base asset is required")
	// ErrPriceDataQuoteAsset is returned when the quote asset is required but not set.
	ErrPriceDataQuoteAsset = errors.New("quote asset is required")
)

Functions

This section is empty.

Types

type AMM

type AMM struct {
	// The unique ID for this ledger entry.
	// In JSON, this field is represented with different names depending on the context and API method.
	// (Note, even though this is specified as "optional" in the code, every ledger entry should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The type of ledger entry. Valid ledger entry types include AccountRoot, Offer, RippleState, and others.
	LedgerEntryType string `json:",omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The address of the special account that holds this AMM's assets.
	Account types.Address
	// The definition for one of the two assets this AMM holds. In JSON, this is an object with currency and issuer fields.
	Asset Asset
	// The definition for the other asset this AMM holds. In JSON, this is an object with currency and issuer fields.
	Asset2 Asset
	// Details of the current owner of the auction slot, as an Auction Slot object.
	AuctionSlot AuctionSlot `json:",omitempty"`
	// The total outstanding balance of liquidity provider tokens from this AMM instance.
	// The holders of these tokens can vote on the AMM's trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM's assets which grows with the trading fees collected.
	LPTokenBalance types.CurrencyAmount
	// The percentage fee to be charged for trades against this AMM instance, in units of 1/100,000. The maximum value is 1000, for a 1% fee.
	TradingFee uint16
	// A list of vote objects, representing votes on the pool's trading fee.
	VoteSlots []VoteSlots `json:",omitempty"`
	// The identifying hash of the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The index of the ledger that contains the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
}

An AMM ledger entry describes a single Automated Market Maker (AMM) instance. This is always paired with a special AccountRoot entry. https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/amm#amm

Example:

{
    "Account" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
    "Asset" : {
      "currency" : "XRP"
    },
    "Asset2" : {
      "currency" : "TST",
      "issuer" : "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"
    },
    "AuctionSlot" : {
      "Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
      "AuthAccounts" : [
          {
            "AuthAccount" : {
                "Account" : "rMKXGCbJ5d8LbrqthdG46q3f969MVK2Qeg"
            }
          },
          {
            "AuthAccount" : {
                "Account" : "rBepJuTLFJt3WmtLXYAxSjtBWAeQxVbncv"
            }
          }
      ],
      "DiscountedFee" : 60,
      "Expiration" : 721870180,
      "Price" : {
          "currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
          "issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
          "value" : "0.8696263565463045"
      }
    },
    "Flags" : 0,
    "LPTokenBalance" : {
      "currency" : "039C99CD9AB0B70B32ECDA51EAAE471625608EA2",
      "issuer" : "rE54zDvgnghAoPopCgvtiqWNq3dU5y836S",
      "value" : "71150.53584131501"
    },
    "TradingFee" : 600,
    "VoteSlots" : [
      {
          "VoteEntry" : {
            "Account" : "rJVUeRqDFNs2xqA7ncVE6ZoAhPUoaJJSQm",
            "TradingFee" : 600,
            "VoteWeight" : 100000
          }
      }
    ]
}

func (*AMM) EntryType

func (*AMM) EntryType() EntryType

Returns the type of the ledger entry.

type AccountRoot

type AccountRoot struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The type of ledger entry. Valid ledger entry types include AccountRoot, Offer, RippleState, and others.
	LedgerEntryType EntryType
	// The identifying (classic) address of this account.
	Account types.Address
	// The identifying hash of the transaction most recently sent by this account.
	// This field must be enabled to use the AccountTxnID transaction field.
	// To enable it, send an AccountSet transaction with the asfAccountTxnID flag enabled.
	AccountTxnID types.Hash256 `json:",omitempty"`
	// (Added by the AMM amendment) The ledger entry ID of the corresponding AMM ledger entry.
	// Set during account creation; cannot be modified. If present, indicates that this is a
	// special AMM AccountRoot; always omitted on non-AMM accounts.
	AMMID types.Hash256 `json:",omitempty"`
	// The account's current XRP balance in drops, represented as a string.
	Balance types.XRPCurrencyAmount `json:",omitempty"`
	// How many total of this account's issued non-fungible tokens have been burned.
	// This number is always equal or less than MintedNFTokens.
	BurnedNFTokens uint32 `json:",omitempty"`
	// A domain associated with this account. In JSON, this is the hexadecimal for the ASCII representation of the domain.
	// Cannot be more than 256 bytes in length.
	Domain string `json:",omitempty"`
	// The md5 hash of an email address. Clients can use this to look up an avatar through services such as Gravatar.
	EmailHash types.Hash128 `json:",omitempty"`
	// The account's Sequence Number at the time it minted its first non-fungible-token.
	// (Added by the fixNFTokenRemint amendment)
	FirstNFTokenSequence uint32 `json:",omitempty"`
	// A public key that may be used to send encrypted messages to this account. In JSON, uses hexadecimal.
	// Must be exactly 33 bytes, with the first byte indicating the key type: 0x02 or 0x03 for secp256k1
	// keys, 0xED for Ed25519 keys.
	MessageKey string `json:",omitempty"`
	// How many total non-fungible tokens have been minted by and on behalf of this account.
	// (Added by the NonFungibleTokensV1_1 amendment)
	MintedNFTokens uint32 `json:",omitempty"`
	// Another account that can mint non-fungible tokens on behalf of this account.
	// (Added by the NonFungibleTokensV1_1 amendment)
	NFTokenMinter types.Address `json:",omitempty"`
	// The number of objects this account owns in the ledger, which contributes to its owner reserve.
	OwnerCount uint32
	// The identifying hash of the transaction that most recently modified this object.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
	// The address of a key pair that can be used to sign transactions for this account instead of the master key.
	// Use a SetRegularKey transaction to change this value.
	RegularKey types.Address `json:",omitempty"`
	// The sequence number of the next valid transaction for this account.
	Sequence uint32
	// How many Tickets this account owns in the ledger. This is updated automatically to ensure that the account
	// stays within the hard limit of 250 Tickets at a time. This field is omitted if the account has zero Tickets.
	// (Added by the TicketBatch amendment.)
	TicketCount uint32 `json:",omitempty"`
	// How many significant digits to use for exchange rates of Offers involving currencies issued by this address.
	// Valid values are 3 to 15, inclusive. (Added by the TickSize amendment.)
	TickSize uint8 `json:",omitempty"`
	// A transfer fee to charge other users for sending currency issued by this account to each other.
	TransferRate uint32 `json:",omitempty"`
	// An arbitrary 256-bit value that users can set.
	WalletLocator types.Hash256 `json:",omitempty"`
	// Unused. (The code supports this field but there is no way to set it.)
	WalletSize uint32 `json:",omitempty"`
}

An AccountRoot ledger entry type describes a single account, its settings, and XRP balance.

```json

{
    "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
    "AccountTxnID": "0D5FB50FA65C9FE1538FD7E398FFFE9D1908DFA4576D8D7A020040686F93C77D",
    "Balance": "148446663",
    "Domain": "6D64756F31332E636F6D",
    "EmailHash": "98B4375E1D753E5B91627516F6D70977",
    "Flags": 8388608,
    "LedgerEntryType": "AccountRoot",
    "MessageKey": "0000000000000000000000070000000300",
    "OwnerCount": 3,
    "PreviousTxnID": "0D5FB50FA65C9FE1538FD7E398FFFE9D1908DFA4576D8D7A020040686F93C77D",
    "PreviousTxnLgrSeq": 14091160,
    "Sequence": 336,
    "TransferRate": 1004999999,
    "index": "13F1A95D7AAB7108D5CE7EEAF504B2894B8C674E6D68499076441C4837282BF8"
}

```

func (*AccountRoot) EntryType

func (*AccountRoot) EntryType() EntryType

Returns the type of this ledger entry.

func (*AccountRoot) SetLsfAllowTrustLineClawback

func (a *AccountRoot) SetLsfAllowTrustLineClawback()

Set the AllowTrustLineClawback flag.

func (*AccountRoot) SetLsfDefaultRipple

func (a *AccountRoot) SetLsfDefaultRipple()

Set the DefaultRipple flag.

func (*AccountRoot) SetLsfDepositAuth

func (a *AccountRoot) SetLsfDepositAuth()

Set the DepositAuth flag.

func (*AccountRoot) SetLsfDisableMaster

func (a *AccountRoot) SetLsfDisableMaster()

Set the DisableMaster flag.

func (*AccountRoot) SetLsfDisallowIncomingCheck

func (a *AccountRoot) SetLsfDisallowIncomingCheck()

Set the DisallowIncomingCheck flag.

func (*AccountRoot) SetLsfDisallowIncomingNFTokenOffer

func (a *AccountRoot) SetLsfDisallowIncomingNFTokenOffer()

Set the DisallowIncomingNFTokenOffer flag.

func (*AccountRoot) SetLsfDisallowIncomingPayChan

func (a *AccountRoot) SetLsfDisallowIncomingPayChan()

Set the DisallowIncomingPayChan flag.

func (*AccountRoot) SetLsfDisallowIncomingTrustline

func (a *AccountRoot) SetLsfDisallowIncomingTrustline()

Set the DisallowIncomingTrustline flag.

func (*AccountRoot) SetLsfDisallowXRP

func (a *AccountRoot) SetLsfDisallowXRP()

Set the DisallowXRP flag.

func (*AccountRoot) SetLsfGlobalFreeze

func (a *AccountRoot) SetLsfGlobalFreeze()

Set the GlobalFreeze flag.

func (*AccountRoot) SetLsfNoFreeze

func (a *AccountRoot) SetLsfNoFreeze()

Set the NoFreeze flag.

func (*AccountRoot) SetLsfPasswordSpent

func (a *AccountRoot) SetLsfPasswordSpent()

Set the PasswordSpent flag.

func (*AccountRoot) SetLsfRequireAuth

func (a *AccountRoot) SetLsfRequireAuth()

Set the RequireAuth flag.

func (*AccountRoot) SetLsfRequireDestTag

func (a *AccountRoot) SetLsfRequireDestTag()

Set the RequireDestTag flag.

type Amendments

type Amendments struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// A bit-map of boolean flags enabled for this object. Currently, the protocol defines no flags for Amendments objects.
	// The value is always 0.
	Flags uint32
	// The value 0x0066, mapped to the string Amendments, indicates that this object describes the status of amendments to the XRP Ledger.
	LedgerEntryType EntryType
	// Array of 256-bit amendment IDs for all currently enabled amendments. If omitted, there are no enabled amendments.
	Amendments []types.Hash256 `json:",omitempty"`
	// 	Array of objects describing the status of amendments that have majority support but are not yet enabled.
	// If omitted, there are no pending amendments with majority support.
	Majorities []MajorityEntry `json:",omitempty"`
	// The identifying hash of the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The index of the ledger that contains the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
}

The Amendments ledger entry type contains a list of Amendments that are currently active. Each ledger version contains at most one Amendments entry. ```json

{
    "Amendments": [
        "42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE",
        "4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373",
        // (... Long list of enabled amendment IDs ...)
        "03BDC0099C4E14163ADA272C1B6F6FABB448CC3E51F522F978041E4B57D9158C",
        "35291ADD2D79EB6991343BDA0912269C817D0F094B02226C1C14AD2858962ED4"
    ],
    "Flags": 0,
    "LedgerEntryType": "Amendments",
    "Majorities": [
        {
            "Majority": {
            "Amendment": "7BB62DC13EC72B775091E9C71BF8CF97E122647693B50C5E87A80DFD6FCFAC50",
                "CloseTime": 779561310
            }
        },
        {
            "Majority": {
                "Amendment": "755C971C29971C9F20C6F080F2ED96F87884E40AD19554A5EBECDCEC8A1F77FE",
                "CloseTime": 779561310
            }
        }
    ],
    "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4"
}

```

func (*Amendments) EntryType

func (*Amendments) EntryType() EntryType

Returns the type of the ledger entry.

type Asset

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

The definition for one of the two assets the AMM holds. In JSON, this is an object with currency and issuer fields.

func (*Asset) Flatten

func (a *Asset) Flatten() map[string]interface{}

Returns the flattened representation of the Asset object.

type AuctionSlot

type AuctionSlot struct {
	// The current owner of this auction slot.
	Account types.Address
	// A list of at most 4 additional accounts that are authorized to trade at the discounted fee for this AMM instance.
	AuthAccounts []AuthAccounts `json:",omitempty"`
	// The trading fee to be charged to the auction owner, in the same format as TradingFee. Normally, this is 1/10 of the normal fee for this AMM.
	DiscountedFee uint16
	// The amount the auction owner paid to win this slot, in LP Tokens.
	Price types.CurrencyAmount
	// The time when this slot expires, in seconds since the Ripple Epoch. https://xrpl.org/docs/references/protocol/data-types/basic-data-types#specifying-time.
	Expiration uint32
}

A liquidity provider can bid LP Tokens to claim the auction slot to receive a discount on the trading fee for a 24-hour period. The LP tokens that were bid are returned to the AMM.

type AuthAccount

type AuthAccount struct {
	// Authorized account to trade at the discounted fee for this AMM instance.
	Account types.Address
}

An additional account that you allow to trade at the discounted fee.

func (*AuthAccount) Flatten

func (a *AuthAccount) Flatten() map[string]interface{}

Returns the flattened representation of the AuthAccount object.

type AuthAccounts

type AuthAccounts struct {
	AuthAccount AuthAccount
}

A list of up to 4 additional accounts that you allow to trade at the discounted fee. This cannot include the address of the transaction sender.

func (*AuthAccounts) Flatten

func (a *AuthAccounts) Flatten() map[string]interface{}

Returns the flattened representation of the AuthAccounts object.

type Bridge

type Bridge struct {
	// The unique ID for this ledger entry.
	// In JSON, this field is represented with different names depending on the context and API method.
	// (Note, even though this is specified as "optional" in the code, every ledger entry should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The type of ledger entry. Valid ledger entry types include AccountRoot, Offer, RippleState, and others.
	LedgerEntryType string
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The account that submitted the XChainCreateBridge transaction on the blockchain.
	Account types.Address
	// The minimum amount, in XRP, required for an XChainAccountCreateCommit transaction.
	// If this isn't present, the XChainAccountCreateCommit transaction will fail.
	// This field can only be present on XRP-XRP bridges.
	MinAccountCreateAmount types.CurrencyAmount `json:",omitempty"`
	// The total amount, in XRP, to be rewarded for providing a signature for cross-chain transfer or for signing for the cross-chain reward. This amount will be split among the signers.
	SignatureReward types.CurrencyAmount
	// A counter used to order the execution of account create transactions.
	// It is incremented every time a XChainAccountCreateCommit transaction is "claimed" on the destination chain.
	// When the "claim" transaction is run on the destination chain, the XChainAccountClaimCount must match the value
	// that the XChainAccountCreateCount had at the time the XChainAccountClaimCount was run on the source chain.
	// This orders the claims so that they run in the same order that the XChainAccountCreateCommit transactions ran on the source chain, to prevent transaction replay.
	XChainAccountClaimCount string
	// A counter used to order the execution of account create transactions.
	// It is incremented every time a successful XChainAccountCreateCommit transaction is run for the source chain.
	XChainAccountCreateCount string
	// The door accounts and assets of the bridge this object correlates to.
	XChainBridge types.XChainBridge
	// The value of the next XChainClaimID to be created.
	XChainClaimID string
}

(Requires the XChainBridge amendment) The Bridge ledger entry represents a single cross-chain bridge that connects the XRP Ledger with another blockchain, such as its sidechain, and enables value in the form of XRP and other tokens (IOUs) to move efficiently between the two blockchains. Requires the XChainBridge amendment to be enabled. Example: ```json

{
	"Account": "r3nCVTbZGGYoWvZ58BcxDmiMUU7ChMa1eC",
	"Flags": 0,
	"LedgerEntryType": "Bridge",
	"MinAccountCreateAmount": "2000000000",
	"OwnerNode": "0",
	"PreviousTxnID": "67A8A1B36C1B97BE3AAB6B19CB3A3069034877DE917FD1A71919EAE7548E5636",
	"PreviousTxnLgrSeq": 102,
	"SignatureReward": "204",
	"XChainAccountClaimCount": "0",
	"XChainAccountCreateCount": "0",
	"XChainBridge": {
		"IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
		"IssuingChainIssue": {
		"currency": "XRP"
		},
		"LockingChainDoor": "r3nCVTbZGGYoWvZ58BcxDmiMUU7ChMa1eC",
		"LockingChainIssue": {
		"currency": "XRP"
		}
	},
	"XChainClaimID": "1",
	"index": "9F2C9E23343852036AFD323025A8506018ABF9D4DBAA746D61BF1CFB5C297D10"
}

```

func (*Bridge) EntryType

func (*Bridge) EntryType() EntryType

EntryType returns the type of the ledger entry.

type Check

type Check struct {
	// The unique ID for this ledger entry.
	// In JSON, this field is represented with different names depending on the context and API method.
	// (Note, even though this is specified as "optional" in the code, every ledger entry should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The value 0x0043, mapped to the string Check, indicates that this object is a Check object.
	LedgerEntryType EntryType
	Flags           uint32
	// The sender of the Check. Cashing the Check debits this address's balance.
	Account types.Address
	// The intended recipient of the Check. Only this address can cash the Check,
	// using a CheckCash transaction.
	Destination types.Address
	// A hint indicating which page of the destination's owner directory links to this object,
	// in case the directory consists of multiple pages.
	DestinationNode string `json:",omitempty"`
	// An arbitrary tag to further specify the destination for this Check,
	// such as a hosted recipient at the destination address.
	DestinationTag uint32 `json:",omitempty"`
	// Indicates the time after which this Check is considered expired. See Specifying Time for details.
	Expiration uint32 `json:",omitempty"`
	// Arbitrary 256-bit hash provided by the sender as a specific reason or identifier for this Check.
	InvoiceID types.Hash256 `json:",omitempty"`

	// A hint indicating which page of the sender's owner directory links to this object, in
	// case the directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this object.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
	// The maximum amount of currency this Check can debit the sender. If the Check is successfully cashed,
	// the destination is credited in the same currency for up to this amount.
	SendMax types.CurrencyAmount
	// The sequence number of the CheckCreate transaction that created this check.
	Sequence uint32
	// An arbitrary tag to further specify the source for this Check, such as a hosted recipient at the sender's address.
	SourceTag uint32 `json:",omitempty"`
}

(Added by the Checks amendment.) A Check entry describes a check, similar to a paper personal check, which can be cashed by its destination to get money from its sender.

func (*Check) EntryType

func (*Check) EntryType() EntryType

type Credential added in v0.1.9

type Credential struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The value 0x0044, mapped to the string Credential, indicates that this is a Credential ledger entry.
	LedgerEntryType EntryType
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// Arbitrary data defining the type of credential this entry represents. The minimum length is 1 byte and the maximum length is 64 bytes.
	CredentialType types.CredentialType
	// Time after which the credential is expired, in seconds since the Ripple Epoch.
	Expiration uint32 `json:",omitempty"`
	// The account that issued the credential.
	Issuer types.Address
	// A hint indicating which page of the issuer's directory links to this entry, in case the directory consists of multiple pages.
	IssuerNode string
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this entry.
	PreviousTxnLgrSeq uint32
	// The account that this credential is for.
	Subject types.Address
	// A hint indicating which page of the subject's owner directory links to this entry, in case the directory consists of multiple pages.
	SubjectNode string
	// Arbitrary additional data about the credential, for example a URL where a W3C-formatted Verifiable Credential can be retrieved.
	URI string `json:",omitempty"`
}

A Credential entry represents a credential, which contains an attestation about a subject account from a credential issuer account. The meaning of the attestation is defined by the issuer. Requires the Credentials amendment to be enabled: https://xrpl.org/resources/known-amendments#credentials

func (*Credential) EntryType added in v0.1.9

func (*Credential) EntryType() EntryType

func (*Credential) SetLsfAccepted added in v0.1.9

func (c *Credential) SetLsfAccepted()

SetLsfAccepted sets the one owner count flag.

type DID

type DID struct {
	// The unique ID for this ledger entry.
	// In JSON, this field is represented with different names depending on the context and API method.
	// (Note, even though this is specified as "optional" in the code, every ledger entry should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The value 0x0049, mapped to the string DID, indicates that this object is a DID object.
	LedgerEntryType EntryType
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The account that controls the DID.
	Account types.Address
	// The W3C standard DID document associated with the DID.
	// The DIDDocument field isn't checked for validity and is limited to a maximum length of 256 bytes.
	DIDDocument string `json:",omitempty"`
	// The public attestations of identity credentials associated with the DID.
	// The Data field isn't checked for validity and is limited to a maximum length of 256 bytes.
	Data string `json:",omitempty"`
	// A hint indicating which page of the sender's owner directory links to this entry, in case the directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this object.
	PreviousTxnID string
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
	// The Universal Resource Identifier that points to the corresponding DID document or the data associated with the DID.
	// This field can be an HTTP(S) URL or IPFS URI.
	// This field isn't checked for validity and is limited to a maximum length of 256 bytes.
	URI string `json:",omitempty"`
}

A DID ledger entry holds references to, or data associated with, a single DID. Requires the "did" amendment to be enabled. Example: ```json

{
    "Account": "rpfqJrXg5uidNo2ZsRhRY6TiF1cvYmV9Fg",
    "DIDDocument": "646F63",
    "Data": "617474657374",
    "Flags": 0,
    "LedgerEntryType": "DID",
    "OwnerNode": "0",
    "PreviousTxnID": "A4C15DA185E6092DF5954FF62A1446220C61A5F60F0D93B4B09F708778E41120",
    "PreviousTxnLgrSeq": 4,
    "URI": "6469645F6578616D706C65",
    "index": "46813BE38B798B3752CA590D44E7FEADB17485649074403AD1761A2835CE91FF"
}

```

func (*DID) EntryType

func (*DID) EntryType() EntryType

EntryType returns the type of the ledger entry.

type DepositPreauthObj

type DepositPreauthObj struct {
	// The unique ID for this ledger entry.
	// In JSON, this field is represented with different names depending on the context and API method.
	// (Note, even though this is specified as "optional" in the code, every ledger entry should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The value 0x0070, mapped to the string DepositPreauth, indicates that this is a DepositPreauth object.
	LedgerEntryType EntryType
	// The account that granted the preauthorization. (The destination of the preauthorized payments.)
	Account types.Address
	// The account that received the preauthorization. (The sender of the preauthorized payments.)
	Authorize types.Address
	// A hint indicating which page of the sender's owner directory links to this object, in case the directory
	// consists of multiple pages. Note: The object does not contain a direct link to the owner directory
	// containing it, since that value can be derived from the Account.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this object.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
}

A DepositPreauth entry tracks a preauthorization from one account to another. DepositPreauth transactions create these entries.

This has no effect on processing of transactions unless the account that provided the preauthorization requires Deposit Authorization. In that case, the account that was preauthorized can send payments and other transactions directly to the account that provided the preauthorization. Preauthorizations are one-directional, and have no effect on payments going the opposite direction.

```json

{
  "LedgerEntryType": "DepositPreauth",
  "Account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8",
  "Authorize": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
  "Flags": 0,
  "OwnerNode": "0000000000000000",
  "PreviousTxnID": "3E8964D5A86B3CD6B9ECB33310D4E073D64C865A5B866200AD2B7E29F8326702",
  "PreviousTxnLgrSeq": 7,
  "index": "4A255038CC3ADCC1A9C91509279B59908251728D0DAADB248FFE297D0F7E068C"
}

```

func (*DepositPreauthObj) EntryType

func (*DepositPreauthObj) EntryType() EntryType

Returns the type of the ledger entry.

type DirectoryNode

type DirectoryNode struct {
	// (Offer directories only) DEPRECATED. Do not use.
	ExchangeRate string `json:",omitempty"`
	// A bit-map of boolean flags enabled for this object. Currently, the protocol defines no flags
	// for DirectoryNode objects. The value is always 0.
	Flags uint32
	// The contents of this directory: an array of IDs of other objects.
	Indexes []types.Hash256
	// If this directory consists of multiple pages, this ID links to the next object in the chain, wrapping around at the end.
	IndexNext string `json:",omitempty"`
	// If this directory consists of multiple pages, this ID links to the previous object in the chain, wrapping around at the beginning.
	IndexPrevious string `json:",omitempty"`
	// The type of ledger entry. Always DirectoryNode.
	LedgerEntryType EntryType
	// (NFT offer directories only) ID of the NFT in a buy or sell offer.
	NFTokenID types.Hash256 `json:",omitempty"`
	// (Owner directories only) The address of the account that owns the objects in this directory.
	Owner types.Address `json:",omitempty"`
	// The identifying hash of the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The index of the ledger that contains the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
	// The ID of root object for this directory.
	RootIndex types.Hash256
	// (Offer directories only) The currency code of the TakerGets amount from the offers in this directory.
	TakerGetsCurrency string `json:",omitempty"`
	// (Offer directories only) The issuer of the TakerGets amount from the offers in this directory.
	TakerGetsIssuer string `json:",omitempty"`
	// (Offer directories only) The currency code of the TakerPays amount from the offers in this directory.
	TakerPaysCurrency string `json:",omitempty"`
	// (Offer directories only) The issuer of the TakerPays amount from the offers in this directory.
	TakerPaysIssuer string `json:",omitempty"`
}

The DirectoryNode ledger entry type provides a list of links to other entries in the ledger's state data. A single conceptual Directory takes the form of a doubly linked list, with one or more DirectoryNode entries each containing up to 32 IDs of other entries. The first DirectoryNode entry is called the root of the directory, and all entries other than the root can be added or deleted as necessary.

DirectoryNode entries can have the following values in the Flags field: - lsfNFTokenBuyOffers: This directory contains NFT buy offers. - lsfNFTokenSellOffers: This directory contains NFT sell offers.

Owner directories and offer directories for fungible tokens do not use flags; their Flags value is always 0.

There are three kinds of directory: - Owner directories list other entries owned by an account, such as RippleState (trust line) or Offer entries. - Offer directories list the offers available in the decentralized exchange. A single Offer directory contains all the offers that have the same exchange rate for the same token (currency code and issuer). - NFT Offer directories list buy and sell offers for NFTs. Each NFT has up to two directories, one for buy offers, the other for sell offers.

```json

{
    "ExchangeRate": "4e133c40576f7c00",
    "Flags": 0,
    "Indexes": [
        "353E55E7A0B0E82D16DF6E748D48BDAFE4C56045DF5A8B0ED723FF3C38A4787A"
    ],
    "LedgerEntryType": "DirectoryNode",
    "PreviousTxnID": "0F79E60C8642A23658ECB29D939499EA0F28D804077B7EE16613BE0C813A2DD6",
    "PreviousTxnLgrSeq": 91448326,
    "RootIndex": "79C54A4EBD69AB2EADCE313042F36092BE432423CC6A4F784E133C40576F7C00",
    "TakerGetsCurrency": "0000000000000000000000000000000000000000",
    "TakerGetsIssuer": "0000000000000000000000000000000000000000",
    "TakerPaysCurrency": "0000000000000000000000005553440000000000",
    "TakerPaysIssuer": "2ADB0B3959D60A6E6991F729E1918B7163925230",
}

```

func (*DirectoryNode) EntryType

func (*DirectoryNode) EntryType() EntryType

EntryType returns the type of ledger entry.

func (*DirectoryNode) SetNFTokenBuyOffers

func (d *DirectoryNode) SetNFTokenBuyOffers()

SetNFTokenBuyOffers sets the directory to contain NFT buy offers.

func (*DirectoryNode) SetNFTokenSellOffers

func (d *DirectoryNode) SetNFTokenSellOffers()

SetNFTokenSellOffers sets the directory to contain NFT sell offers.

type DisabledValidator

type DisabledValidator struct {
	// The ledger index when the validator was added to the Negative UNL.
	FirstLedgerSequence uint32
	// The master public key of the validator, in hexadecimal.
	PublicKey string
}

type DisabledValidatorEntry

type DisabledValidatorEntry struct {
	DisabledValidator DisabledValidator
}

Each DisabledValidator object represents one disabled validator. In JSON, a DisabledValidator object has one field, DisabledValidator, which in turn contains another object with the following fields:

type EntryType

type EntryType string
const (
	AccountRootEntry                     EntryType = "AccountRoot"
	AmendmentsEntry                      EntryType = "Amendments"
	AMMEntry                             EntryType = "AMM"
	BridgeEntry                          EntryType = "Bridge"
	CheckEntry                           EntryType = "Check"
	CredentialEntry                      EntryType = "Credential"
	DepositPreauthObjEntry               EntryType = "DepositPreauth"
	DIDEntry                             EntryType = "DID"
	DirectoryNodeEntry                   EntryType = "DirectoryNode"
	EscrowEntry                          EntryType = "Escrow"
	FeeSettingsEntry                     EntryType = "FeeSettings"
	LedgerHashesEntry                    EntryType = "LedgerHashes"
	NegativeUNLEntry                     EntryType = "NegativeUNL"
	NFTokenOfferEntry                    EntryType = "NFTokenOffer"
	NFTokenPageEntry                     EntryType = "NFTokenPage"
	OfferEntry                           EntryType = "Offer"
	OracleEntry                          EntryType = "Oracle"
	PayChannelEntry                      EntryType = "PayChannel"
	RippleStateEntry                     EntryType = "RippleState"
	SignerListEntry                      EntryType = "SignerList"
	TicketEntry                          EntryType = "Ticket"
	XChainOwnedClaimIDEntry              EntryType = "XChainOwnedClaimID"
	XChainOwnedCreateAccountClaimIDEntry EntryType = "XChainOwnedCreateAccountClaimID"
)

type Escrow

type Escrow struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The type of ledger entry.
	LedgerEntryType EntryType
	// A set of boolean flags.
	Flags uint32
	// The address of the owner (sender) of this escrow. This is the account that provided the XRP,
	// and gets it back if the escrow is canceled.
	Account types.Address
	// The amount of XRP, in drops, currently held in the escrow.
	Amount types.XRPCurrencyAmount
	// The escrow can be canceled if and only if this field is present and the time it specifies has passed.
	// Specifically, this is specified as seconds since the Ripple Epoch and it "has passed" if it's
	// earlier than the close time of the previous validated ledger.
	CancelAfter uint32 `json:",omitempty"`
	// A PREIMAGE-SHA-256 crypto-condition, as hexadecimal. If present, the EscrowFinish transaction must
	// contain a fulfillment that satisfies this condition.
	Condition string `json:",omitempty"`
	// The destination address where the XRP is paid if the escrow is successful.
	Destination types.Address
	// A hint indicating which page of the destination's owner directory links to this object, in case the
	// directory consists of multiple pages. Omitted on escrows created before enabling the fix1523 amendment.
	DestinationNode string `json:",omitempty"`
	// An arbitrary tag to further specify the destination for this escrow, such as a hosted recipient
	// at the destination address.
	DestinationTag uint32 `json:",omitempty"`
	// The time, in seconds since the Ripple Epoch, after which this escrow can be finished. Any EscrowFinish
	// transaction before this time fails. (Specifically, this is compared with the close time of the previous validated ledger.)
	FinishAfter uint32 `json:",omitempty"`
	// A hint indicating which page of the sender's owner directory links to this entry, in case the directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this entry.
	PreviousTxnLgrSeq uint32
	// An arbitrary tag to further specify the source for this escrow, such as a hosted recipient at the owner's address.
	SourceTag uint32 `json:",omitempty"`
}

(Added by the Escrow amendment.) An Escrow ledger entry represents an escrow, which holds XRP until specific conditions are met.

```json

{
    "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
    "Amount": "10000",
    "CancelAfter": 545440232,
    "Condition": "A0258020A82A88B2DF843A54F58772E4A3861866ECDB4157645DD9AE528C1D3AEEDABAB6810120",
    "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
    "DestinationTag": 23480,
    "FinishAfter": 545354132,
    "Flags": 0,
    "LedgerEntryType": "Escrow",
    "OwnerNode": "0000000000000000",
    "DestinationNode": "0000000000000000",
    "PreviousTxnID": "C44F2EB84196B9AD820313DBEBA6316A15C9A2D35787579ED172B87A30131DA7",
    "PreviousTxnLgrSeq": 28991004,
    "SourceTag": 11747,
    "index": "DC5F3851D8A1AB622F957761E5963BC5BD439D5C24AC6AD7AC4523F0640244AC"
}

```

func (*Escrow) EntryType

func (*Escrow) EntryType() EntryType

Returns the type of the ledger entry.

type FeeSettings

type FeeSettings struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// A bit-map of boolean flags enabled for this object. Currently, the protocol defines
	// no flags for FeeSettings objects. The value is always 0.
	Flags uint32
	// The value 0x0073, mapped to the string FeeSettings, indicates that this object
	// contains the ledger's fee settings.
	LedgerEntryType EntryType
	// The transaction cost of the "reference transaction" in drops of XRP as hexadecimal.
	BaseFee           string
	ReferenceFeeUnits uint32
	// The base reserve for an account in the XRP Ledger, as drops of XRP.
	ReserveBase uint32
	// The incremental owner reserve for owning objects, as drops of XRP.
	ReserveIncrement uint32
	// The identifying hash of the transaction that most recently modified this entry.
	// (Added by the fixPreviousTxnID amendment.)
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The index of the ledger that contains the transaction that most recently modified this entry. (Added by the fixPreviousTxnID amendment.)
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
}

The FeeSettings entry contains the current base transaction cost and reserve amounts as determined by fee voting. Each ledger version contains at most one FeeSettings entry.

```json

{
   "BaseFee": "000000000000000A",
   "Flags": 0,
   "LedgerEntryType": "FeeSettings",
   "ReferenceFeeUnits": 10,
   "ReserveBase": 20000000,
   "ReserveIncrement": 5000000,
   "index": "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A651"
}

```

func (*FeeSettings) EntryType

func (*FeeSettings) EntryType() EntryType

EntryType returns the type of the ledger entry.

type FlatLedgerObject

type FlatLedgerObject map[string]interface{}

func (FlatLedgerObject) EntryType

func (f FlatLedgerObject) EntryType() EntryType

type FlatPriceData

type FlatPriceData map[string]interface{}

type Hashes

type Hashes struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// A bit-map of boolean flags enabled for this object. Currently, the protocol defines
	// no flags for LedgerHashes objects. The value is always 0.
	Flags uint32
	// The value 0x0068, mapped to the string LedgerHashes, indicates that this object is a list of ledger hashes.
	LedgerEntryType EntryType
	// DEPRECATED Do not use. (The "recent hashes" object on Mainnet has the value 2 in this
	// field as a result of an old software bug. That value gets carried forward as the
	// "recent hashes" object is updated. New "previous history" objects do not have this field,
	// nor do "recent hashes" objects in parallel networks started with more recent versions of rippled.)
	FirstLedgerSequence uint32 `json:",omitempty"`
	// An array of up to 256 ledger hashes. The contents depend on which sub-type of LedgerHashes object this is.
	Hashes []types.Hash256
	// The Ledger Index of the last entry in this object's Hashes array.
	LastLedgerSequence uint32 `json:",omitempty"`
}

(Not to be confused with the "ledger hash" string data type, which uniquely identifies a ledger version. This section describes the LedgerHashes ledger object type.)

The LedgerHashes object type contains a history of prior ledgers that led up to this ledger version, in the form of their hashes. Objects of this ledger type are modified automatically when closing a ledger. (This is one of the only times a ledger's state data is modified without a transaction or pseudo-transaction.) The LedgerHashes objects exist to make it possible to look up a previous ledger's hash with only the current ledger version and at most one lookup of a previous ledger version.

There are two kinds of LedgerHashes object. Both types have the same fields. Each ledger version contains:

  • Exactly one "recent history" LedgerHashes object
  • A number of "previous history" LedgerHashes objects based on the current ledger index (that is, the length of the ledger history). Specifically, the XRP Ledger adds a new "previous history" object every 65536 ledger versions.

```json

{
  "LedgerEntryType": "LedgerHashes",
  "Flags": 0,
  "FirstLedgerSequence": 2,
  "LastLedgerSequence": 33872029,
  "Hashes": [
    "D638208ADBD04CBB10DE7B645D3AB4BA31489379411A3A347151702B6401AA78",
    "254D690864E418DDD9BCAC93F41B1F53B1AE693FC5FE667CE40205C322D1BE3B",
    "A2B31D28905E2DEF926362822BC412B12ABF6942B73B72A32D46ED2ABB7ACCFA",
    "AB4014846DF818A4B43D6B1686D0DE0644FE711577C5AB6F0B2A21CCEE280140",
    "3383784E82A8BA45F4DD5EF4EE90A1B2D3B4571317DBAC37B859836ADDE644C1",
    ... (up to 256 ledger hashes) ...
  ],
  "index": "B4979A36CDC7F3D3D5C31A4EAE2AC7D7209DDA877588B9AFC66799692AB0D66B"
}

```

func (*Hashes) EntryType

func (*Hashes) EntryType() EntryType

EntryType returns the type of the ledger entry.

type Majority

type Majority struct {
	// The Amendment ID of the pending amendment.
	Amendment types.Hash256
	// The close time of the ledger version that reached majority support for this amendment.
	CloseTime uint32
}

A Majority object describes the status of a pending amendment that has majority support but is not yet enabled.

type MajorityEntry

type MajorityEntry struct {
	Majority Majority
}

type NFTokenOffer

type NFTokenOffer struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The value 0x0037, mapped to the string NFTokenOffer, indicates that this is an offer to trade a NFToken.
	LedgerEntryType EntryType
	// Amount expected or offered for the NFToken. If the token has the lsfOnlyXRP flag set,
	// the amount must be specified in XRP. Sell offers that specify assets other than XRP
	// must specify a non-zero amount. Sell offers that specify XRP can be 'free' (that is,
	// the Amount field can be equal to "0").
	Amount types.CurrencyAmount
	// The AccountID for which this offer is intended. If present, only that account can accept the offer.
	Destination types.Address `json:",omitempty"`
	// The time after which the offer is no longer active. The value is the number of seconds
	// since the Ripple Epoch.
	Expiration uint32 `json:",omitempty"`
	// The NFTokenID of the NFToken object referenced by this offer.
	NFTokenID types.Hash256
	// Internal bookkeeping, indicating the page inside the token buy or sell offer directory,
	// as appropriate, where this token is being tracked. This field allows the efficient
	// deletion of offers.
	NFTokenOfferNode string `json:",omitempty"`
	// Owner of the account that is creating and owns the offer. Only the current Owner of an
	// NFToken can create an offer to sell an NFToken, but any account can create an offer
	// to buy an NFToken.
	Owner types.Address
	// Internal bookkeeping, indicating the page inside the owner directory where this token is
	// being tracked. This field allows the efficient deletion of offers.
	OwnerNode string `json:",omitempty"`
	// Identifying hash of the transaction that most recently modified this object.
	PreviousTxnID types.Hash256
	// Index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
}

An NFTokenOffer entry represents an offer to buy, sell or transfer an NFT. (Added by the NonFungibleTokensV1_1 amendment.)

```json

{
    "Amount": "1000000",
    "Flags": 1,
    "LedgerEntryType": "NFTokenOffer",
    "NFTokenID": "00081B5825A08C22787716FA031B432EBBC1B101BB54875F0002D2A400000000",
    "NFTokenOfferNode": "0",
    "Owner": "rhRxL3MNvuKEjWjL7TBbZSDacb8PmzAd7m",
    "OwnerNode": "17",
    "PreviousTxnID": "BFA9BE27383FA315651E26FDE1FA30815C5A5D0544EE10EC33D3E92532993769",
    "PreviousTxnLgrSeq": 75443565,
    "index": "AEBABA4FAC212BF28E0F9A9C3788A47B085557EC5D1429E7A8266FB859C863B3"
}

```

func (*NFTokenOffer) EntryType

func (*NFTokenOffer) EntryType() EntryType

EntryType returns the type of the ledger entry.

func (*NFTokenOffer) UnmarshalJSON

func (n *NFTokenOffer) UnmarshalJSON(data []byte) error

type NFTokenPage

type NFTokenPage struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// 	The value 0x0050, mapped to the string NFTokenPage, indicates that this is a
	// page containing NFToken objects.
	LedgerEntryType EntryType
	Flags           uint32
	// The locator of the next page, if any. Details about this field and how it should
	// be used are outlined below.
	NextPageMin types.Hash256 `json:",omitempty"`
	// The locator of the previous page, if any. Details about this field and how it should be used are outlined below.
	PreviousPageMin types.Hash256 `json:",omitempty"`
	// Identifies the transaction ID of the transaction that most recently modified this NFTokenPage object.
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The sequence of the ledger that contains the transaction that most recently modified this NFTokenPage object.
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
	// The collection of NFToken objects contained in this NFTokenPage object. This
	// specification places an upper bound of 32 NFToken objects per page. Objects are
	// sorted from low to high with the NFTokenID used as the sorting parameter.
	NFTokens []types.NFToken
}

The NFTokenPage object represents a collection of NFTs owned by the same account. An account can have multiple NFTokenPage entries, which form a doubly linked list. (Added by the NonFungibleTokensV1_1 amendment.)

```json

{
  "LedgerEntryType": "NFTokenPage",
  "PreviousPageMin":
    "8A244DD75DAF4AC1EEF7D99253A7B83D2297818B2297818B70E264D2000002F2",
  "NextPageMin":
    "8A244DD75DAF4AC1EEF7D99253A7B83D2297818B2297818BE223B0AE0000010B",
  "PreviousTxnID":
    "95C8761B22894E328646F7A70035E9DFBECC90EDD83E43B7B973F626D21A0822",
  "PreviousTxnLgrSeq":
    42891441,
  "NFTokens": [
    {
      "NFToken": {
        "NFTokenID":
          "000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65",
        "URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469"
      }
    },
    /* potentially more objects */
  ]
}

```

func (*NFTokenPage) EntryType

func (*NFTokenPage) EntryType() EntryType

EntryType returns the type of the ledger entry.

type NegativeUNL

type NegativeUNL struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The value 0x004E, mapped to the string NegativeUNL, indicates that this entry is the Negative UNL.
	LedgerEntryType EntryType
	// A list of DisabledValidator objects (see below), each representing a trusted validator
	// that is currently disabled.
	DisabledValidators []DisabledValidatorEntry `json:",omitempty"`
	// The identifying hash of the transaction that most recently modified this entry.
	// (Added by the fixPreviousTxnID amendment.)
	PreviousTxnID types.Hash256 `json:",omitempty"`
	// The index of the ledger that contains the transaction that most recently modified this entry.
	// (Added by the fixPreviousTxnID amendment.)
	PreviousTxnLgrSeq uint32 `json:",omitempty"`
	// The public key of a trusted validator that is scheduled to be disabled in the next flag ledger.
	ValidatorToDisable string `json:",omitempty"`
	// The public key of a trusted validator in the Negative UNL that is scheduled to be re-enabled in the next flag ledger.
	ValidatorToReEnable string `json:",omitempty"`
}

(Added by the NegativeUNL amendment.) The NegativeUNL ledger entry type contains the current status of the Negative UNL, a list of trusted validators currently believed to be offline.

Each ledger version contains at most one NegativeUNL entry. If no validators are currently disabled or scheduled to be disabled, there is no NegativeUNL entry.

```json

{
    "DisabledValidators": [
      {
        "DisabledValidator": {
          "FirstLedgerSequence": 91371264,
          "PublicKey": "ED58F6770DB5DD77E59D28CB650EC3816E2FC95021BB56E720C9A12DA79C58A3AB"
        }
      }
    ],
    "Flags": 0,
    "LedgerEntryType": "NegativeUNL",
    "PreviousTxnID": "8D47FFE664BE6C335108DF689537625855A6A95160CC6D351341B92624D9C5E3",
    "PreviousTxnLgrSeq": 91442944,
    "index": "2E8A59AA9D3B5B186B0B9E0F62E6C02587CA74A4D778938E957B6357D364B244"
}

```

func (*NegativeUNL) EntryType

func (*NegativeUNL) EntryType() EntryType

EntryType returns the type of the ledger entry.

type Object

type Object interface {
	EntryType() EntryType
}

func EmptyLedgerObject

func EmptyLedgerObject(t string) (Object, error)

func UnmarshalLedgerObject

func UnmarshalLedgerObject(data []byte) (Object, error)

type Offer

type Offer struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// Set of bit-flags for this ledger entry.
	Flags uint32
	// The value 0x006F, mapped to the string Offer, indicates that this is an Offer entry.
	LedgerEntryType EntryType
	// The address of the account that owns this Offer.
	Account types.Address
	// The ID of the Offer Directory that links to this Offer.
	BookDirectory types.Hash256
	// A hint indicating which page of the offer directory links to this entry, in case the
	// directory consists of multiple pages.
	BookNode string
	// 	Indicates the time after which this Offer is considered unfunded. See Specifying Time for details.
	Expiration uint32 `json:",omitempty"`
	// A hint indicating which page of the owner directory links to this entry, in case the directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
	// 	The Sequence value of the OfferCreate transaction that created this offer.
	// Used in combination with the Account to identify this offer.
	Sequence uint32
	// The remaining amount and type of currency requested by the Offer creator.
	TakerPays types.CurrencyAmount
	// The remaining amount and type of currency being provided by the Offer creator.
	TakerGets types.CurrencyAmount
}

The Offer ledger entry describes an Offer to exchange currencies in the XRP Ledger's decentralized exchange. (In finance, this is more traditionally known as an order.) An OfferCreate transaction only creates an Offer entry in the ledger when the Offer cannot be fully executed immediately by consuming other Offers already in the ledger.

An Offer can become unfunded through other activities in the network, while remaining in the ledger. When processing transactions, the network automatically removes any unfunded Offers that those transactions come across. (Otherwise, unfunded Offers remain, because only transactions can change the ledger state.)

```json

{
    "Account": "rBqb89MRQJnMPq8wTwEbtz4kvxrEDfcYvt",
    "BookDirectory": "ACC27DE91DBA86FC509069EAF4BC511D73128B780F2E54BF5E07A369E2446000",
    "BookNode": "0000000000000000",
    "Flags": 131072,
    "LedgerEntryType": "Offer",
    "OwnerNode": "0000000000000000",
    "PreviousTxnID": "F0AB71E777B2DA54B86231E19B82554EF1F8211F92ECA473121C655BFC5329BF",
    "PreviousTxnLgrSeq": 14524914,
    "Sequence": 866,
    "TakerGets": {
        "currency": "XAG",
        "issuer": "r9Dr5xwkeLegBeXq6ujinjSBLQzQ1zQGjH",
        "value": "37"
    },
    "TakerPays": "79550000000",
    "index": "96F76F27D8A327FC48753167EC04A46AA0E382E6F57F32FD12274144D00F1797"
}

```

func (*Offer) EntryType

func (*Offer) EntryType() EntryType

EntryType returns the type of the ledger entry.

func (*Offer) SetLsfPassive

func (o *Offer) SetLsfPassive()

Sets the offer as passive.

func (*Offer) SetLsfSell

func (o *Offer) SetLsfSell()

Sets the offer as a sell offer.

func (*Offer) UnmarshalJSON

func (o *Offer) UnmarshalJSON(data []byte) error

Unmarshals the offer from a JSON byte slice.

type Oracle

type Oracle struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The XRPL account with update and delete privileges for the oracle.
	// It's recommended to set up multi-signing on this account.
	Owner types.Address
	// An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA.
	// This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E).
	Provider string
	// An array of up to 10 PriceData objects, each representing the price information for a token pair.
	// More than five PriceData objects require two owner reserves.
	PriceDataSeries []PriceData
	// The time the data was last updated, represented in Unix time.
	LastUpdateTime uint32
	// An optional Universal Resource Identifier to reference price data off-chain.
	// This field is limited to 256 bytes.
	URI string `json:",omitempty"`
	// Describes the type of asset, such as "currency", "commodity", or "index". This field is a string,
	// up to 16 ASCII hex encoded characters (0x20-0x7E).
	AssetClass string
	// A hint indicating which page of the oracle owner's owner directory links to this entry,
	// in case the directory consists of multiple pages.
	OwnerNode uint64
	// The hash of the previous transaction that modified this entry.
	PreviousTxnID string
	// The ledger index that this object was most recently modified or created in.
	PreviousTxnLgrSeq uint32
}

An Oracle ledger entry holds data associated with a single price oracle object. Requires PriceOracle amendment. Example: ```json

{
  "LedgerEntryType": "Oracle",
  "Owner": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
  "Provider": "70726F7669646572",
  "AssetClass": "63757272656E6379",
  "PriceDataSeries": [
    {
      "PriceData": {
        "BaseAsset": "XRP",
        "QuoteAsset": "USD",
        "AssetPrice": 740,
        "Scale": 3,
      }
    },
  ],
  "LastUpdateTime": 1724871860,
  "PreviousTxnID": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
  "PreviousTxnLgrSeq": 3675418
}

```

func (*Oracle) EntryType

func (*Oracle) EntryType() EntryType

EntryType returns the type of the ledger entry.

type PayChannel

type PayChannel struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The source address that owns this payment channel. This comes from the sending
	// address of the transaction that created the channel.
	Account types.Address
	// Total XRP, in drops, that has been allocated to this channel. This includes
	// XRP that has been paid to the destination address. This is initially set by the
	// transaction that created the channel and can be increased if the source address
	// sends a PaymentChannelFund transaction.
	Amount types.XRPCurrencyAmount
	// Total XRP, in drops, already paid out by the channel. The difference between
	// this value and the Amount field is how much XRP can still be paid to the
	// destination address with PaymentChannelClaim transactions. If the channel closes,
	// the remaining difference is returned to the source address.
	Balance types.XRPCurrencyAmount
	// The immutable expiration time for this payment channel, in seconds since the Ripple Epoch.
	// This channel is expired if this value is present and smaller than the previous ledger's
	// close_time field. This is optionally set by the transaction that created the channel, and
	// cannot be changed.
	CancelAfter uint32 `json:",omitempty"`
	// The destination address for this payment channel. While the payment channel is open,
	// this address is the only one that can receive XRP from the channel. This comes from
	// the Destination field of the transaction that created the channel.
	Destination types.Address
	// An arbitrary tag to further specify the destination for this payment channel, such as a
	// hosted recipient at the destination address.
	DestinationTag uint32 `json:",omitempty"`
	// A hint indicating which page of the destination's owner directory links to this entry,
	// in case the directory consists of multiple pages. Omitted on payment channels created
	// before enabling the fixPayChanRecipientOwnerDir amendment.
	DestinationNode string `json:",omitempty"`
	// The mutable expiration time for this payment channel, in seconds since the Ripple Epoch.
	// The channel is expired if this value is present and smaller than the previous ledger's close_time field.
	// See Channel Expiration for more details.
	Expiration uint32 `json:",omitempty"`
	Flags      uint32
	// The value 0x0078, mapped to the string PayChannel, indicates that this is a payment channel entry.
	LedgerEntryType EntryType
	// A hint indicating which page of the source address's owner directory links to this entry,
	// in case the directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this entry.
	PreviousTxnLgrSeq uint32
	// Public key, in hexadecimal, of the key pair that can be used to sign claims against this channel.
	// This can be any valid secp256k1 or Ed25519 public key. This is set by the transaction that created
	// the channel and must match the public key used in claims against the channel.
	// The channel source address can also send XRP from this channel to the destination without signed claims.
	PublicKey string
	// 	Number of seconds the source address must wait to close the channel if it still has
	// any XRP in it. Smaller values mean that the destination address has less time to redeem any
	// outstanding claims after the source address requests to close the channel. Can be any value
	// that fits in a 32-bit unsigned integer (0 to 2^32-1). This is set by the transaction that creates the channel.
	SettleDelay uint32
	// An arbitrary tag to further specify the source for this payment channel, such as a hosted
	// recipient at the owner's address.
	SourceTag uint32 `json:",omitempty"`
}

(Added by the PayChan amendment.) A PayChannel entry represents a payment channel.

func (*PayChannel) EntryType

func (*PayChannel) EntryType() EntryType

EntryType returns the type of the ledger entry.

type PriceData

type PriceData struct {
	// The primary asset in a trading pair. Any valid identifier, such as a stock symbol,
	// bond CUSIP, or currency code is allowed.
	BaseAsset string
	// The quote asset in a trading pair. The quote asset denotes the
	// price of one unit of the base asset.
	QuoteAsset string
	// The asset price after applying the Scale precision level. It's not included if
	// the last update transaction didn't include the BaseAsset/QuoteAsset pair.
	AssetPrice uint64 `json:",omitempty"`
	// The scaling factor to apply to an asset price. For example, if Scale is 6 and original price is 0.155,
	// then the scaled price is 155000. Valid scale ranges are 0-10.
	// It's not included if the last update transaction didn't include the BaseAsset/QuoteAsset pair.
	//
	// By default, the scale is 0.
	Scale uint8 `json:",omitempty"`
}

A PriceData object represents the price information for a token pair.

func (*PriceData) Flatten

func (priceData *PriceData) Flatten() FlatPriceData

Flatten flattens the price data.

func (*PriceData) Validate

func (priceData *PriceData) Validate() error

Validate validates the price data.

type RippleState

type RippleState struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The balance of the trust line, from the perspective of the low account.
	// A negative balance indicates that the high account holds tokens issued by the low account.
	// The issuer in this is always set to the neutral value ACCOUNT_ONE.
	Balance types.IssuedCurrencyAmount
	// A bit-map of boolean options enabled for this entry.
	Flags uint32
	// The limit that the high account has set on the trust line. The issuer is the address of
	// the high account that set this limit.
	HighLimit types.IssuedCurrencyAmount
	// (Omitted in some historical ledgers) A hint indicating which page of the high account's
	// owner directory links to this entry, in case the directory consists of multiple pages.
	HighNode string
	// The inbound quality set by the high account, as an integer in the implied ratio
	// HighQualityIn:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
	HighQualityIn uint32 `json:",omitempty"`
	// The outbound quality set by the high account, as an integer in the implied ratio
	// HighQualityOut:1,000,000,000. As a special case, the value 0 is equivalent to 1 billion, or face value.
	HighQualityOut uint32 `json:",omitempty"`
	// The value 0x0072, mapped to the string RippleState, indicates that this is a RippleState entry.
	LedgerEntryType EntryType
	// The limit that the low account has set on the trust line. The issuer is the address of the low account that set this limit.
	LowLimit types.IssuedCurrencyAmount
	// (Omitted in some historical ledgers) A hint indicating which page of the low account's owner directory links to this entry,
	// in case the directory consists of multiple pages.
	LowNode string
	// The inbound quality set by the low account, as an integer in the implied ratio LowQualityIn:1,000,000,000.
	// As a special case, the value 0 is equivalent to 1 billion, or face value.
	LowQualityIn uint32 `json:",omitempty"`
	// The outbound quality set by the low account, as an integer in the implied ratio LowQualityOut:1,000,000,000.
	// As a special case, the value 0 is equivalent to 1 billion, or face value.
	LowQualityOut uint32 `json:",omitempty"`
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this entry.
	PreviousTxnLgrSeq uint32
}

A RippleState ledger entry represents a trust line between two accounts. Each account can change its own limit and other settings, but the balance is a single shared value. A trust line that is entirely in its default state is considered the same as a trust line that does not exist and is automatically deleted.

```json

{
    "Balance": {
        "currency": "USD",
        "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
        "value": "-10"
    },
    "Flags": 393216,
    "HighLimit": {
        "currency": "USD",
        "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
        "value": "110"
    },
    "HighNode": "0000000000000000",
    "LedgerEntryType": "RippleState",
    "LowLimit": {
        "currency": "USD",
        "issuer": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
        "value": "0"
    },
    "LowNode": "0000000000000000",
    "PreviousTxnID": "E3FE6EA3D48F0C2B639448020EA4F03D4F4F8FFDB243A852A0F59177921B4879",
    "PreviousTxnLgrSeq": 14090896,
    "index": "9CA88CDEDFF9252B3DE183CE35B038F57282BC9503CDFA1923EF9A95DF0D6F7B"
}

{

func (*RippleState) EntryType

func (*RippleState) EntryType() EntryType

EntryType returns the type of the ledger entry.

func (*RippleState) SetLsfAMMNode

func (r *RippleState) SetLsfAMMNode()

SetLsfAMMNode sets the AMM node flag.

func (*RippleState) SetLsfHighAuth

func (r *RippleState) SetLsfHighAuth()

SetLsfHighAuth sets the high auth flag.

func (*RippleState) SetLsfHighDeepFreeze added in v0.1.5

func (r *RippleState) SetLsfHighDeepFreeze()

SetLsfHighDeepFreeze sets the high deep freeze flag.

func (*RippleState) SetLsfHighFreeze

func (r *RippleState) SetLsfHighFreeze()

SetLsfHighFreeze sets the high freeze flag.

func (*RippleState) SetLsfHighNoRipple

func (r *RippleState) SetLsfHighNoRipple()

SetLsfHighNoRipple sets the high no ripple flag.

func (*RippleState) SetLsfHighReserve

func (r *RippleState) SetLsfHighReserve()

SetLsfHighReserve sets the high reserve flag.

func (*RippleState) SetLsfLowAuth

func (r *RippleState) SetLsfLowAuth()

SetLsfLowAuth sets the low auth flag.

func (*RippleState) SetLsfLowDeepFreeze added in v0.1.5

func (r *RippleState) SetLsfLowDeepFreeze()

SetLsfLowDeepFreeze sets the low deep freeze flag.

func (*RippleState) SetLsfLowFreeze

func (r *RippleState) SetLsfLowFreeze()

SetLsfLowFreeze sets the low freeze flag.

func (*RippleState) SetLsfLowNoRipple

func (r *RippleState) SetLsfLowNoRipple()

SetLsfLowNoRipple sets the low no ripple flag.

func (*RippleState) SetLsfLowReserve

func (r *RippleState) SetLsfLowReserve()

SetLsfLowReserve sets the low reserve flag.

type SignerEntry

type SignerEntry struct {
	// An XRP Ledger address whose signature contributes to the multi-signature. It does not need to be a funded address in the ledger.
	Account types.Address
	// The weight of a signature from this signer. A multi-signature is only valid if the sum weight of the signatures provided meets or exceeds the signer list's SignerQuorum value.
	SignerWeight uint16
	// (Optional) Arbitrary hexadecimal data. This can be used to identify the signer or for other, related purposes. (Added by the ExpandedSignerList amendment.)
	WalletLocator types.Hash256 `json:",omitempty"`
}

Each member of the SignerEntries field is an object that describes that signer in the list. https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/signerlist#signer-entry-object

func (*SignerEntry) Flatten

func (s *SignerEntry) Flatten() map[string]interface{}

Flatten returns a map of the SignerEntry object

type SignerEntryWrapper

type SignerEntryWrapper struct {
	SignerEntry SignerEntry
}

Wrapper for SignerEntry

func (*SignerEntryWrapper) Flatten

func (s *SignerEntryWrapper) Flatten() FlatLedgerObject

Flatten returns a map of the SignerEntryWrapper object

type SignerList

type SignerList struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The value 0x0053, mapped to the string SignerList, indicates that this is a SignerList ledger entry.
	LedgerEntryType EntryType
	// The identifying hash of the transaction that most recently modified this object.
	PreviousTxnID string
	// The index of the ledger that contains the transaction that most recently modified this object.
	PreviousTxnLgrSeq uint32
	// A hint indicating which page of the owner directory links to this object, in case the directory consists of multiple pages.
	OwnerNode string
	// An array of Signer Entry objects representing the parties who are part of this signer list.
	SignerEntries []SignerEntryWrapper
	// An ID for this signer list. Currently always set to 0. If a future amendment allows multiple signer lists for an account, this may change.
	SignerListID uint32
	// A target number for signer weights. To produce a valid signature for the owner of this SignerList, the signers must provide valid signatures whose weights sum to this value or more.
	SignerQuorum uint32
	Flags        uint32
}

A SignerList entry represents a list of parties that, as a group, are authorized to sign a transaction in place of an individual account. You can create, replace, or remove a signer list using a SignerListSet transaction.

Example:

```json

{
    "Flags": 0,
    "LedgerEntryType": "SignerList",
    "OwnerNode": "0000000000000000",
    "PreviousTxnID": "5904C0DC72C58A83AEFED2FFC5386356AA83FCA6A88C89D00646E51E687CDBE4",
    "PreviousTxnLgrSeq": 16061435,
    "SignerEntries": [
        {
            "SignerEntry": {
                "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
                "SignerWeight": 2
            }
        },
        {
            "SignerEntry": {
                "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
                "SignerWeight": 1
            }
        },
        {
            "SignerEntry": {
                "Account": "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
                "SignerWeight": 1
            }
        }
    ],
    "SignerListID": 0,
    "SignerQuorum": 3,
    "index": "A9C28A28B85CD533217F5C0A0C7767666B093FA58A0F2D80026FCC4CD932DDC7"
}

```

func (*SignerList) EntryType

func (*SignerList) EntryType() EntryType

EntryType returns the type of the ledger entry (SignerList)

func (*SignerList) SetLsfOneOwnerCount

func (s *SignerList) SetLsfOneOwnerCount()

SetLsfOneOwnerCount sets the one owner count flag.

type Ticket

type Ticket struct {
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The account that owns this Ticket.
	Account types.Address
	Flags   uint32
	// The value 0x0054, mapped to the string Ticket, indicates that this is a Ticket entry.
	LedgerEntryType EntryType
	// A hint indicating which page of the owner directory links to this entry, in case the
	// directory consists of multiple pages.
	OwnerNode string
	// The identifying hash of the transaction that most recently modified this entry.
	PreviousTxnID types.Hash256
	// The index of the ledger that contains the transaction that most recently modified this entry.
	PreviousTxnLgrSeq uint32
	// The Sequence Number this Ticket sets aside.
	TicketSequence uint32
}

(Added by the TicketBatch amendment.) A Ticket entry type represents a Ticket, which tracks an account sequence number that has been set aside for future use. You can create new tickets with a TicketCreate transaction.

```json

{
  "Account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de",
  "Flags": 0,
  "LedgerEntryType": "Ticket",
  "OwnerNode": "0000000000000000",
  "PreviousTxnID": "F19AD4577212D3BEACA0F75FE1BA1644F2E854D46E8D62E9C95D18E9708CBFB1",
  "PreviousTxnLgrSeq": 4,
  "TicketSequence": 3
}

```

func (*Ticket) EntryType

func (*Ticket) EntryType() EntryType

EntryType returns the type of the ledger entry.

type VoteEntry

type VoteEntry struct {
	// The account that cast the vote.
	Account types.Address
	// The proposed trading fee, in units of 1/100,000; a value of 1 is equivalent to 0.001%. The maximum value is 1000, indicating a 1% fee.
	TradingFee uint16
	// The weight of the vote, in units of 1/100,000. For example, a value of 1234 means this vote counts as 1.234% of the weighted total vote.
	// The weight is determined by the percentage of this AMM's LP Tokens the account owns. The maximum value is 100000.
	VoteWeight uint32
}

Represents one liquidity provider's vote to set the trading fee.

type VoteSlots

type VoteSlots struct {
	VoteEntry VoteEntry
}

Each entry in the vote_slots array represents one liquidity provider's vote to set the trading fee.

type XChainClaimAttestation

type XChainClaimAttestation struct {
	// An attestation from one witness server.
	XChainClaimProofSig XChainClaimProofSig
}

type XChainClaimProofSig

type XChainClaimProofSig struct {
	// The amount to claim in the XChainCommit transaction on the destination chain.
	Amount types.CurrencyAmount
	// The account that should receive this signer's share of the SignatureReward.
	AttestationRewardAccount types.Address
	// The account on the door account's signer list that is signing the transaction.
	AttestationSignerAccount types.Address
	// The destination account for the funds on the destination chain.
	Destination types.Address `json:",omitempty"`
	// The public key used to verify the signature.
	PublicKey string
	// A boolean representing the chain where the event occurred.
	WasLockingChainSend uint8
}

type XChainCreateAccountAttestation

type XChainCreateAccountAttestation struct {
	// An attestation from one witness server.
	XChainCreateAccountProofSig XChainCreateAccountProofSig
}

type XChainCreateAccountProofSig

type XChainCreateAccountProofSig struct {
	// The amount committed by the XChainAccountCreateCommit transaction on the source chain.
	Amount types.CurrencyAmount
	// The account that should receive this signer's share of the SignatureReward.
	AttestationRewardAccount types.Address
	// The account on the door account's signer list that is signing the transaction.
	AttestationSignerAccount types.Address
	// The destination account for the funds on the destination chain.
	Destination types.Address
	// The public key used to verify the signature.
	PublicKey string
	// A boolean representing the chain where the event occurred.
	WasLockingChainSend uint8
}

type XChainOwnedClaimID

type XChainOwnedClaimID struct {
	// The account that owns this object.
	Account types.Address
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// The account that must send the corresponding XChainCommit on the source chain. The destination may be specified
	// in the XChainCommit transaction, which means that if the OtherChainSource isn't specified, another account can
	// try to specify a different destination and steal the funds. This also allows tracking only a single set of signatures,
	// since we know which account will send the XChainCommit transaction.
	OtherChainSource types.Address
	// The total amount to pay the witness servers for their signatures. It must be at least the value of SignatureReward in the Bridge ledger object.
	SignatureReward types.CurrencyAmount
	// The door accounts and assets of the bridge this object correlates to.
	XChainBridge types.XChainBridge
	// Attestations collected from the witness servers. This includes the parameters needed to recreate the message
	// that was signed, including the amount, which chain (locking or issuing), optional destination, and reward account for that signature.
	XChainClaimAttestations []XChainClaimAttestation
	// The unique sequence number for a cross-chain transfer.
	XChainClaimID string
}

An XChainOwnedClaimID object represents one cross-chain transfer of value and includes information of the account on the source chain that locks or burns the funds on the source chain. The XChainOwnedClaimID object must be acquired on the destination chain before submitting a XChainCommit on the source chain. Its purpose is to prevent transaction replay attacks and is also used as a place to collect attestations from witness servers. An XChainCreateClaimID transaction is used to create a new XChainOwnedClaimID. The ledger object is destroyed when the funds are successfully claimed on the destination chain. Example: ```json

{
  "Account": "rBW1U7J9mEhEdk6dMHEFUjqQ7HW7WpaEMi",
  "Flags": 0,
  "OtherChainSource": "r9oXrvBX5aDoyMGkoYvzazxDhYoWFUjz8p",
  "OwnerNode": "0",
  "PreviousTxnID": "1CFD80E9CF232B8EED62A52857DE97438D12230C06496932A81DEFA6E66070A6",
  "PreviousTxnLgrSeq": 58673,
  "SignatureReward": "100",
  "XChainBridge": {
    "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
    "IssuingChainIssue": {
      "currency": "XRP"
    },
    "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4",
    "LockingChainIssue": {
      "currency": "XRP"
    }
  },
  "XChainClaimAttestations": [
    {
      "XChainClaimProofSig": {
        "Amount": "1000000",
        "AttestationRewardAccount": "rfgjrgEJGDxfUY2U8VEDs7BnB1jiH3ofu6",
        "AttestationSignerAccount": "rfsxNxZ6xB1nTPhTMwQajNnkCxWG8B714n",
        "Destination": "rBW1U7J9mEhEdk6dMHEFUjqQ7HW7WpaEMi",
        "PublicKey": "025CA526EF20567A50FEC504589F949E0E3401C13EF76DD5FD1CC2850FA485BD7B",
        "WasLockingChainSend": 1
      }
    },
    {
      "XChainClaimProofSig": {
        "Amount": "1000000",
        "AttestationRewardAccount": "rUUL1tP523M8KimERqVS7sxb1tLLmpndyv",
        "AttestationSignerAccount": "rEg5sHxZVTNwRL3BAdMwJatkmWDzHMmzDF",
        "Destination": "rBW1U7J9mEhEdk6dMHEFUjqQ7HW7WpaEMi",
        "PublicKey": "03D40434A6843638681E2F215310EBC4131AFB12EA85985DA073183B732525F7C9",
        "WasLockingChainSend": 1
      },
    }
  ],
  "XChainClaimID": "b5",
  "LedgerEntryType": "XChainOwnedClaimID",
  "LedgerIndex": "20B136D7BF6D2E3D610E28E3E6BE09F5C8F4F0241BBF6E2D072AE1BACB1388F5"
}

```

func (*XChainOwnedClaimID) EntryType

func (*XChainOwnedClaimID) EntryType() EntryType

EntryType returns the type of the ledger entry.

type XChainOwnedCreateAccountClaimID

type XChainOwnedCreateAccountClaimID struct {
	// The account that owns this object.
	Account types.Address
	// The unique ID for this ledger entry. In JSON, this field is represented with different names depending on the
	// context and API method. (Note, even though this is specified as "optional" in the code, every ledger entry
	// should have one unless it's legacy data from very early in the XRP Ledger's history.)
	Index types.Hash256 `json:"index,omitempty"`
	// An integer that determines the order that accounts created through cross-chain
	// transfers must be performed. Smaller numbers must execute before larger numbers.
	XChainAccountCreateCount string
	// The door accounts and assets of the bridge this object correlates to.
	XChainBridge types.XChainBridge
	// Attestations collected from the witness servers. This includes the parameters needed to recreate the message
	// that was signed, including the amount, destination, signature reward amount, and reward account for that
	// signature. With the exception of the reward account, all signatures must sign the message created with common parameters.
	XChainCreateAccountAttestations []XChainCreateAccountAttestation
}

The XChainOwnedCreateAccountClaimID ledger object is used to collect attestations for creating an account via a cross-chain transfer. It is created when an XChainAddAccountCreateAttestation transaction adds a signature attesting to a XChainAccountCreateCommit transaction and the XChainAccountCreateCount is greater than or equal to the current XChainAccountClaimCount on the Bridge ledger object. The ledger object is destroyed when all the attestations have been received and the funds have transferred to the new account. Example: ```json

{
  "LedgerEntryType": "XChainOwnedCreateAccountClaimID",
  "LedgerIndex": "5A92F6ED33FDA68FB4B9FD140EA38C056CD2BA9673ECA5B4CEF40F2166BB6F0C",
  "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
  "XChainAccountCreateCount": "66",
  "XChainBridge": {
    "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
    "IssuingChainIssue": {
      "currency": "XRP"
    },
    "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4",
    "LockingChainIssue": {
      "currency": "XRP"
    }
  },
  "XChainCreateAccountAttestations": [
    {
      "XChainCreateAccountProofSig": {
        "Amount": "20000000",
        "AttestationRewardAccount": "rMtYb1vNdeMDpD9tA5qSFm8WXEBdEoKKVw",
        "AttestationSignerAccount": "rL8qTrAvZ8Q1o1H9H9Ahpj3xjgmRvFLvJ3",
        "Destination": "rBW1U7J9mEhEdk6dMHEFUjqQ7HW7WpaEMi",
        "PublicKey": "021F7CC4033EFBE5E8214B04D1BAAEC14808DC6C02F4ACE930A8EF0F5909B0C438",
        "SignatureReward": "100",
        "WasLockingChainSend": 1
      }
    }
  ]
}

```

func (*XChainOwnedCreateAccountClaimID) EntryType

EntryType returns the type of the ledger entry.

Jump to

Keyboard shortcuts

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