Skip to content

add ReferenceHolding to MPTokenIssuance and vault_info shares#3345

Open
Patel-Raj11 wants to merge 3 commits into
update-definitionsfrom
add-ReferenceHolding
Open

add ReferenceHolding to MPTokenIssuance and vault_info shares#3345
Patel-Raj11 wants to merge 3 commits into
update-definitionsfrom
add-ReferenceHolding

Conversation

@Patel-Raj11
Copy link
Copy Markdown
Collaborator

@Patel-Raj11 Patel-Raj11 commented May 22, 2026

High Level Overview of Change

Adds the ReferenceHolding field to the MPTokenIssuance ledger type and the vault_info response's shares object.

Corresponding rippled PR: XRPLF/rippled#7077

Additionally, this PR takes the opportunity to fix discrepancies found in MPTokenIssuance and VaultInfoResponse:

  • Added missing fields (Sequence, DomainID) to MPTokenIssuance ledger type.
  • Added missing fields (AssetScale, MaximumAmount, TransferFee, MPTokenMetadata, LockedAmount) to the vault_info response shares object.
  • Fixed incorrect optionality of Flags, ShareMPTID, WithdrawalPolicy, and OwnerNode in VaultInfoResponse — these are required per Vault ledger type but were incorrectly marked optional.
  • JSDoc comments sourced from XLS-0033.

Context of Change

When a vault is created, rippled now sets a ReferenceHolding field on the vault's share MPTokenIssuance. This field points to the vault pseudo-account's holding for the underlying asset (MPToken keylet for MPT-backed vaults, RippleState keylet for IOU-backed vaults, absent for XRP-backed vaults). The client library types need to reflect this.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Release

Did you update HISTORY.md?

  • Yes
  • No, this change does not impact library users

Test Plan

  • Integration tests assert ReferenceHolding is defined on IOU and MPT backed vault shares

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding ReferenceHolding to both MPTokenIssuance and vault_info shares, which is the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description follows the template structure with all required sections completed: High Level Overview, Context of Change, Type of Change (with appropriate checkboxes selected), and confirmation that HISTORY.md was updated.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-ReferenceHolding

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/xrpl/test/integration/transactions/singleAssetVault.test.ts`:
- Around line 154-157: Before making ledger_entry requests, assert that
vaultInfoResult.result.vault.ShareMPTID is present and non-empty; if missing
throw or fail the test with a clear message. Update the two places that call
testContext.client.request({ command: 'ledger_entry', mpt_issuance:
vaultInfoResult.result.vault.ShareMPTID }) to first check
vaultInfoResult.result.vault && vaultInfoResult.result.vault.ShareMPTID and
produce an explicit test failure (or throw) naming ShareMPTID and
vaultInfoResult, so the ledger_entry call is only performed when ShareMPTID is
defined.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 30475d1e-569a-4947-a61f-45107c28587f

📥 Commits

Reviewing files that changed from the base of the PR and between 5f873bc and 4441029.

📒 Files selected for processing (5)
  • .ci-config/xrpld.cfg
  • packages/xrpl/HISTORY.md
  • packages/xrpl/src/models/ledger/MPTokenIssuance.ts
  • packages/xrpl/src/models/methods/vaultInfo.ts
  • packages/xrpl/test/integration/transactions/singleAssetVault.test.ts

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.

1 participant