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 AMM support #344

Merged
merged 74 commits into from
Sep 20, 2023
Merged

Add AMM support #344

merged 74 commits into from
Sep 20, 2023

Conversation

nkramer44
Copy link
Collaborator

@nkramer44 nkramer44 commented Jan 19, 2023

Do not merge this until the AMM amendment is endorsed on XRPL Mainnet

This PR adds support for XLS-30 AMMs.

New Transaction Types

  • AmmCreate
  • AmmDeposit
  • AmmBid
  • AmmVote
  • AmmWithdraw
  • AmmDelete

New Client Methods

  • XrplClient.ammInfo calls amm_info, taking AmmInfoRequestParams as a parameter and returning an AmmInfoResult

Other Changes

  • XLS-30 introduces a new serializable type called Issue (used to specify Asset and Asset2 in an AMM). This PR adds an Issue type (called IssueType) to the binary codec module to encode/decode these values.
  • This PR includes both objects for the AMM ledger entry as well as the amm_info result object. While AmmInfoResult.amm() is very similar to the AMM ledger entry, the rippled API formats the AMM object differently in responses to amm_info. The AmmObject in this PR is basically inaccessible because XrplClient doesn't support the ledger_entry RPC, but it will be good to have in the codebase once we add that method

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Patch coverage: 98.60% and project coverage change: +0.38% 🎉

Comparison is base (dae2fd6) 90.50% compared to head (804fa58) 90.88%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #344      +/-   ##
============================================
+ Coverage     90.50%   90.88%   +0.38%     
- Complexity     1504     1596      +92     
============================================
  Files           290      318      +28     
  Lines          4275     4489     +214     
  Branches        353      369      +16     
============================================
+ Hits           3869     4080     +211     
- Misses          281      282       +1     
- Partials        125      127       +2     
Files Changed Coverage Δ
...java/org/xrpl/xrpl4j/model/client/XrplMethods.java 0.00% <ø> (ø)
...rg/xrpl/xrpl4j/model/ledger/AccountRootObject.java 100.00% <ø> (ø)
.../main/java/org/xrpl/xrpl4j/model/ledger/Issue.java 100.00% <ø> (ø)
...java/org/xrpl/xrpl4j/codec/binary/types/Issue.java 75.00% <75.00%> (ø)
.../org/xrpl/xrpl4j/codec/binary/types/IssueType.java 92.00% <92.00%> (ø)
...c/main/java/org/xrpl/xrpl4j/client/XrplClient.java 98.55% <100.00%> (+0.03%) ⬆️
...xrpl/xrpl4j/codec/binary/types/SerializedType.java 97.91% <100.00%> (+0.04%) ⬆️
...org/xrpl/xrpl4j/crypto/signing/SignatureUtils.java 99.65% <100.00%> (+0.06%) ⬆️
...java/org/xrpl/xrpl4j/model/client/amm/AmmInfo.java 100.00% <100.00%> (ø)
...pl/xrpl4j/model/client/amm/AmmInfoAuctionSlot.java 100.00% <100.00%> (ø)
... and 30 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nkramer44 nkramer44 changed the title [DO NOT MERGE] Add AMM support Add AMM support Sep 19, 2023
@nkramer44 nkramer44 marked this pull request as ready for review September 19, 2023 18:18
Copy link
Collaborator

@sappenin sappenin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nkramer44 nkramer44 merged commit 530e969 into main Sep 20, 2023
17 of 19 checks passed
@nkramer44 nkramer44 deleted the nk/amm-support branch September 20, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants