Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ledger Objects #663

Closed
wants to merge 63 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
fe6c399
add ledger objects
Oct 27, 2023
6b9fb7f
add NFTokenOffer test
Oct 27, 2023
752cea2
add NFTokenOffer test
Oct 27, 2023
84a9241
remove metadata models
Oct 27, 2023
6e08332
Merge branch 'main' into add-ledger-objects
khancode Jan 16, 2024
da60b00
remove optional type from ledger_entry_type
khancode Jan 16, 2024
361d429
add AMM ledger object
khancode Jan 19, 2024
92e435a
add DID ledger object
khancode Jan 19, 2024
182aa4e
add Bridge ledger object
khancode Jan 23, 2024
2209fc0
fix doctring
khancode Jan 23, 2024
167d5d5
fix typos
khancode Jan 23, 2024
d9b44b2
add XChainOwnedClaimID ledger object
khancode Jan 23, 2024
e51e170
add XChainOwnedCreateAccountClaimID ledger object
khancode Jan 25, 2024
81afbcd
small docstring updates
khancode Jan 25, 2024
cb13e9d
update AccountRoot
khancode Jan 25, 2024
f3f3c82
update Amendments
khancode Jan 25, 2024
3d25c01
update AMM
khancode Jan 25, 2024
e0c59b7
update Check
khancode Jan 25, 2024
7508dce
fix Check field
khancode Jan 25, 2024
655e53f
update DepositPreauth
khancode Jan 25, 2024
f6d656b
update flags docstrings
khancode Jan 25, 2024
3372896
update DirectoryNode
khancode Jan 25, 2024
41aa83c
update Escrow
khancode Jan 25, 2024
c213cff
update FeeSettings
khancode Jan 25, 2024
0de4fca
update LedgerHashes
khancode Jan 25, 2024
a504287
update LedgerObject and models with flags
khancode Jan 25, 2024
ac93044
update NegativeUNL
khancode Jan 25, 2024
1681bc6
update NFTokenOffer
khancode Jan 25, 2024
b7fda71
update NFTokenPage
khancode Jan 25, 2024
1e726b3
add ledger_index to LedgerObject
khancode Jan 25, 2024
4c82bff
update Offer
khancode Jan 25, 2024
f30d69d
update PayChannel
khancode Jan 25, 2024
c231e36
update RippleState
khancode Jan 25, 2024
5857fe0
remove unnecessary flags
khancode Jan 25, 2024
c5c19c1
update SignerList
khancode Jan 25, 2024
a2028b4
add index to Ticket test
khancode Jan 25, 2024
5c7a057
update Ticket
khancode Jan 25, 2024
1f9a418
update docstrings
khancode Jan 25, 2024
47e97c1
update .rst file
khancode Jan 25, 2024
835f821
resolve mypy errors
khancode Jan 25, 2024
4fd1134
remove docstring from ledger_entry_type
khancode Feb 1, 2024
d9858db
export LedgerObject
khancode Feb 1, 2024
eb7ad2a
set flag=0 in LedgerObject
khancode Feb 1, 2024
f56a985
exclude ledger objects model from code coverage
khancode Feb 1, 2024
3c90f8a
Merge branch 'main' into add-ledger-objects
khancode Feb 12, 2024
8d6fea3
add ledger_objects flags to flag list
khancode Feb 12, 2024
d63f92e
use from_xrpl in unit tests
khancode Feb 12, 2024
097ac0c
remove optional fields in unit tests
khancode Feb 12, 2024
2370e50
make index_next and index_previous strings
khancode Feb 12, 2024
6cd3389
add HasPreviousTxnID class to be inherited by ledger object models
khancode Feb 12, 2024
a7bdfd0
Merge branch 'main' into add-ledger-objects
khancode Feb 12, 2024
3d4ef7e
add TODO to .coveragerc
khancode Feb 13, 2024
376590b
update TODO in .coveragerc
khancode Feb 13, 2024
453c447
Merge branch 'main' into add-ledger-objects
khancode Feb 14, 2024
901ed12
update test JSONs to match XRPL formatting
khancode Feb 16, 2024
a7f0f54
move unit tests into their own files
khancode Feb 16, 2024
93e8222
fix docstring
khancode Feb 16, 2024
2fac675
fix NFTokenOffer.amount type
khancode Feb 21, 2024
a48706d
Merge branch 'main' into add-ledger-objects
khancode Feb 21, 2024
207a343
update docstrings
khancode Feb 21, 2024
ada14f6
add lsfAMMNode to RippleState
khancode Feb 21, 2024
ac8e737
add missing del
khancode Feb 23, 2024
ca02097
remove accidental change
khancode Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update RippleState
khancode committed Jan 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit c231e3688b7da193b9e7577212be7777d8b75272
77 changes: 74 additions & 3 deletions xrpl/models/ledger_objects/ripple_state.py
Original file line number Diff line number Diff line change
@@ -19,21 +19,92 @@ class RippleState(LedgerObject):
"""The model for the `RippleState` Ledger Object"""

balance: IssuedCurrencyAmount = REQUIRED # type: ignore
flags: int = REQUIRED # type: ignore
low_limit: IssuedCurrencyAmount = REQUIRED # type: ignore
"""
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. This field is
required.
"""

high_limit: IssuedCurrencyAmount = REQUIRED # type: ignore
"""
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. This field is required.
"""

low_limit: IssuedCurrencyAmount = REQUIRED # type: ignore
"""
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. This field is required.
"""

previous_txn_id: str = REQUIRED # type: ignore
"""
The identifying hash of the transaction that most recently modified this entry.
This field is required.
"""

previous_txn_lgr_seq: int = REQUIRED # type: ignore
"""
The index of the ledger that contains the transaction that most recently modified
this entry. This field is required.
"""

high_node: Optional[str] = None
low_node: Optional[str] = None
"""
(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.
"""

high_quality_in: Optional[int] = None
"""
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.
"""

high_quality_out: Optional[int] = None
"""
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.
"""

low_node: Optional[str] = None
"""
(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.
"""

low_quality_in: Optional[int] = None
"""
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.
"""

low_quality_out: Optional[int] = None
"""
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.
"""

flags: int = REQUIRED # type: ignore
"""
A bit-map of boolean options enabled for this entry.
"""

ledger_entry_type: LedgerEntryType = field(
default=LedgerEntryType.RIPPLE_STATE,
init=False,
)
"""
The value `0x0072`, mapped to the string `RippleState`, indicates that this is a
RippleState entry.
"""


class RippleStateFlag(Enum):
khancode marked this conversation as resolved.
Show resolved Hide resolved