Skip to content
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
10f0f48
initial commit
Patel-Raj11 Mar 12, 2026
0778c7e
add tests for IssueType
Patel-Raj11 Mar 12, 2026
b352310
add NumberType tests
Patel-Raj11 Mar 12, 2026
b356de7
add tests
Patel-Raj11 Mar 12, 2026
e5c7d5d
add DomainID to permission domain
Patel-Raj11 Mar 12, 2026
38de730
add fixtures
Patel-Raj11 Mar 12, 2026
1735fbe
rename NumberAmount to AssetAmount
Patel-Raj11 Mar 14, 2026
74866b0
add IssueType tests
Patel-Raj11 Mar 15, 2026
e04b31d
import IT
Patel-Raj11 Mar 16, 2026
756f6b3
add more tests
Patel-Raj11 Mar 16, 2026
b9a4984
Merge branch 'main' of github.com:XRPLF/xrpl4j into rp/single-asset-v…
Patel-Raj11 Mar 16, 2026
623ac44
fix checkstyle warnings
Patel-Raj11 Mar 16, 2026
0a13d73
add transactions, ledger objects and tests
Patel-Raj11 Mar 19, 2026
318e66c
Merge branch 'main' of github.com:XRPLF/xrpl4j into rp/single-asset-v…
Patel-Raj11 Mar 24, 2026
5256ce8
address code review comments
Patel-Raj11 Mar 24, 2026
95a0530
add migration guide
Patel-Raj11 Mar 24, 2026
4d6b600
remove unnecessary checks
Patel-Raj11 Mar 24, 2026
41d2a8e
merge main
Patel-Raj11 Mar 25, 2026
e7a4a7c
small refactor
Patel-Raj11 Mar 25, 2026
31ba40e
update migration guide
Patel-Raj11 Mar 25, 2026
e2f2730
xrpl-ai suggestions
Patel-Raj11 Mar 27, 2026
82bdeef
Merge branch 'rp/single-asset-vault' of github.com:XRPLF/xrpl4j into …
Patel-Raj11 Mar 27, 2026
2793212
add helper methods for counterparty signing
Patel-Raj11 Mar 31, 2026
9f42146
add sorting support for multi-sign in CounterpartySignature
Patel-Raj11 Mar 31, 2026
f534f03
add tests for signing/multi-sign
Patel-Raj11 Mar 31, 2026
d8f263b
add isNegative and isZero on AssetAmount
Patel-Raj11 Mar 31, 2026
ca0c0db
add LoanBrokerSetTest
Patel-Raj11 Mar 31, 2026
5d3e673
add LoanBrokerDeleteTest
Patel-Raj11 Mar 31, 2026
2d58cf4
add computeLoanSetNetworkFees
Patel-Raj11 Apr 1, 2026
a06aba6
add LoanBrokerCoverDepositTest
Patel-Raj11 Apr 1, 2026
b95ca09
add LoanBrokerCoverWithdrawTest
Patel-Raj11 Apr 1, 2026
d4b5b21
add LoanBrokerCoverClawbackTest
Patel-Raj11 Apr 1, 2026
de6bbce
add LoanSet test
Patel-Raj11 Apr 1, 2026
2548693
add more tests
Patel-Raj11 Apr 1, 2026
18e4e35
add Meta object tests
Patel-Raj11 Apr 1, 2026
5cd4613
disable SingleAssetVaultIT on Testnet
Patel-Raj11 Apr 1, 2026
f3dfe78
refactor IT
Patel-Raj11 Apr 1, 2026
37a3c4c
Merge branch 'rp/single-asset-vault' of github.com:XRPLF/xrpl4j into …
Patel-Raj11 Apr 1, 2026
3e0e70d
fix checkstyle warnings
Patel-Raj11 Apr 1, 2026
e6be22d
restore XrplEnvironment
Patel-Raj11 Apr 1, 2026
22de7b0
add checks on AssetAmount
Patel-Raj11 Apr 6, 2026
e71f59f
add signers length checks
Patel-Raj11 Apr 6, 2026
f45a2ca
increase coverage
Patel-Raj11 Apr 6, 2026
1c4520f
fix checkstyle
Patel-Raj11 Apr 6, 2026
836094c
initial commit XLS-0068
cybele-ripple Mar 18, 2026
2b7ea27
added changes based on 2 agent reviews
cybele-ripple Mar 19, 2026
6e180a9
remove superfluous files
cybele-ripple Mar 19, 2026
4721b13
remove config file
cybele-ripple Mar 19, 2026
a34b883
fix linting errors
cybele-ripple Apr 6, 2026
a5f2592
fixed @beta tag
cybele-ripple Apr 6, 2026
9252ebe
added wrappers for single signed and multi signed transactions
cybele-ripple Apr 7, 2026
996cb5f
resolve error related to merge
cybele-ripple Apr 9, 2026
30034c7
enhanced test coverage
cybele-ripple Apr 9, 2026
8019191
added test coverage
cybele-ripple Apr 10, 2026
a4eebe3
addressed PR comments
cybele-ripple Apr 14, 2026
71fa82e
added validation checks
cybele-ripple Apr 14, 2026
0b4f73f
use xrpld:sponsor
cybele-ripple Apr 14, 2026
fa76ae0
fix combatibility issues
cybele-ripple Apr 14, 2026
9de74aa
addressed PR comments
cybele-ripple Apr 14, 2026
aefeb82
test fix: Enable SponsorshipIT and align with rippled XLS-68 sponsor …
cybele-ripple Apr 18, 2026
fb7afb5
test fix: update SponsorshipFlagsTest to match lsf* flag values (0x10…
cybele-ripple Apr 18, 2026
6a4f773
fix: restore legleux/xrpld:sponsor as RippledContainer image for CI
cybele-ripple Apr 18, 2026
2773b22
chore(test): use local xrpld:sponsor-local image for RippledContainer
cybele-ripple Apr 21, 2026
083e400
style: fix VariableDeclarationUsageDistance on charlieAddress in Spon…
cybele-ripple Apr 21, 2026
f182437
style: fix VariableDeclarationUsageDistance on charlieKeyPair in Spon…
cybele-ripple Apr 21, 2026
cc47dd4
fix(test): revert RippledContainer to legleux/xrpld:sponsor for CI
cybele-ripple Apr 21, 2026
2ee9cf3
fix(codec): add missing SponseeNode field to definitions.json
cybele-ripple Apr 23, 2026
36ca5ff
merge: integrate origin/main into XLS-68-sponsored-fees-reservesupdated
cybele-ripple May 29, 2026
7494f91
fix: remove direct docker-java-api import to fix undeclared dependenc…
cybele-ripple Jun 1, 2026
631dfd4
fix: declare docker-java-api dependency and disable SponsorshipIT on …
cybele-ripple Jun 1, 2026
93f3560
fix: rebase Sponsor model onto current rippled#7350 wire format
cybele-ripple Jul 7, 2026
819d882
fix: use fully-qualified Beta reference in Sponsor field javadoc
cybele-ripple Jul 8, 2026
1193a5a
fix: revert SponsorshipSet/SponsorshipTransfer type codes to 86/85
cybele-ripple Jul 8, 2026
d953e97
Address PR #720 review comments: signing, validation, and CI fixes
cybele-ripple Jul 13, 2026
6129ba3
Remove now-unused docker-java-api dependency
cybele-ripple Jul 13, 2026
a770ad7
Merge origin/main into XLS-68-sponsored-fees-reservesupdated
cybele-ripple Jul 13, 2026
452d8aa
Fix stale Sponsor field wire-format numbers (nth) and naming
cybele-ripple Jul 13, 2026
f61c3ff
Remove stale Granular Permission TODO
cybele-ripple Jul 13, 2026
2c3c9c2
Fix broken javadoc reference in SponsorSignature after package move
cybele-ripple Jul 13, 2026
b164283
Fix IT container startup: rename Batch amendment to BatchV1_1
cybele-ripple Jul 14, 2026
afa62c9
Align Sponsor definitions with rippleci/xrpld:develop
cybele-ripple Jul 14, 2026
ad5cae5
Correct SponsorshipTransfer flag bit values to match rippled develop
cybele-ripple Jul 15, 2026
2fc1ccd
Address PR #720 review comments: OwnerNode/SponseeNode types, Sponsor…
cybele-ripple Jul 16, 2026
5891a3f
Address remaining PR #720 review comments: inline SponsorshipValidati…
cybele-ripple Jul 16, 2026
3f1549f
Move SponsorSignature to model.transactions, remove fabricated Accoun…
cybele-ripple Jul 17, 2026
4b9e6eb
Fix SponsorshipLedgerEntryParams field name to match rippled's ledger…
cybele-ripple Jul 17, 2026
4c02d51
Address PR #720 review comments: typed SponsorFlags, Sponsor on remai…
cybele-ripple Jul 20, 2026
fdc8710
Merge remote-tracking branch 'origin/main' into XLS-68-sponsored-fees…
cybele-ripple Jul 20, 2026
c990e37
Improve patch coverage for XLS-68 sponsorship code
cybele-ripple Jul 20, 2026
feb7906
Address PR #720 review round: spec-compliance fixes and broader Spons…
cybele-ripple Jul 21, 2026
9c6c22e
Address remaining PR #720 IT/signing review comments (verified agains…
cybele-ripple Jul 21, 2026
363ec8f
Merge branch 'main' into XLS-68-sponsored-fees-reservesupdated
sappenin Jul 21, 2026
9b81a06
Remove Sponsor from ledger objects excluded by updated XLS-0068 v1 scope
cybele-ripple Jul 22, 2026
aae9ed8
Merge remote-tracking branch 'origin/XLS-68-sponsored-fees-reservesup…
cybele-ripple Jul 22, 2026
d8fe103
fix: rename SponsorshipSet FeeAmount to FeeAmountDelta per rippled PR…
cybele-ripple Jul 29, 2026
18e838f
Merge branch 'main' into XLS-68-sponsored-fees-reservesupdated
sappenin Jul 29, 2026
7acf7bf
Fix FeeAmount JsonProperty mismatch in SponsorshipSet
cybele-ripple Jul 30, 2026
2eef159
Align sponsorship validation with rippled PR #7350
cybele-ripple Aug 3, 2026
3801a39
Align SponsorshipSet with rippled PR #335 (FeeAmountDelta/RemainingOw…
cybele-ripple Aug 5, 2026
1234ab1
ci: bump XRPLD_PRIVATE_VERSION to 3.3.0-rc7
cybele-ripple Aug 6, 2026
4765614
codec: add Int32 serialized type support
cybele-ripple Aug 6, 2026
5d8dcdc
Merge remote-tracking branch 'origin/main' into XLS-68-sponsored-fees…
cybele-ripple Aug 6, 2026
40c6e79
fix: allow building an account-level SponsorshipTransfer without a Sp…
cybele-ripple Aug 7, 2026
0be96c5
fix: catch NumberFormatException in Int32Type#toJson()
cybele-ripple Aug 7, 2026
4359407
Merge remote-tracking branch 'origin/main' into XLS-68-sponsored-fees…
cybele-ripple Aug 7, 2026
9dde910
docs: Sponsor amendment is now supported on public rippled develop, n…
cybele-ripple Aug 7, 2026
457bbe3
Add MetaSponsorshipObject and dedupe FeeAmount/MaxFee in definitions.…
cybele-ripple Aug 7, 2026
12d2450
Merge remote-tracking branch 'origin/main' into XLS-68-sponsored-fees…
cybele-ripple Aug 7, 2026
abfb1bd
Merge branch 'main' into XLS-68-sponsored-fees-reservesupdated
cybele-ripple Aug 12, 2026
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
191 changes: 191 additions & 0 deletions V7_MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Version 6 to Version 7 Migration Guide

This guide outlines the breaking changes between v6.x.x and v7.0.0 and provides an upgrade path for applications using
xrpl4j.

## Overview

Version 7.0.0 introduces several breaking changes:

1. **Issue Model Refactor** — `Issue` has been refactored from a concrete immutable into a polymorphic interface with
three subtypes (`XrpIssue`, `IouIssue`, `MptIssue`) to support the
[Single Asset Vault](https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0065-single-asset-vault) amendment.
2. **Transaction Signing API Refactor** — `SignatureUtils.addSignatureToTransaction()` and
`SignatureUtils.addMultiSignaturesToTransaction()` have been removed. Transaction signing now uses Immutables-generated
`withTransactionSignature()` and `withSigners()` methods on `Transaction`, and validation has moved to `@Check`
methods on `SingleSignedTransaction` and `MultiSignedTransaction`.

## Breaking Changes

### 1. Issue Model

#### Issue is now an interface

`Issue` was previously an `@Value.Immutable` with a `builder()` method, a `currency()` field, and an optional
`issuer()` field. It is now a plain interface with three concrete implementations: `XrpIssue`, `IouIssue`, and
`MptIssue`. The `Issue` interface provides `handle()` and `map()` methods for type-safe polymorphic dispatch across the
three subtypes.

#### Issue.builder() removed

`Issue.builder()` and `ImmutableIssue.Builder` no longer exist. Use the concrete subtype builders instead.

**Migration:**

```java
// Before (v6.x.x): XRP Issue
Issue xrp = Issue.builder().currency("XRP").build();

// After (v7.0.0): XRP Issue
Issue xrp = Issue.XRP; // or XrpIssue.XRP

// Before (v6.x.x): IOU Issue
Issue usd = Issue.builder()
.currency("USD")
.issuer(issuerAddress)
.build();

// After (v7.0.0): IOU Issue
Issue usd = IouIssue.builder()
.currency("USD")
.issuer(issuerAddress)
.build();
```

You can now also create MPT issues:

```java
// New in v7.0.0: MPT Issue
Issue mpt = MptIssue.builder()
.mptIssuanceId(mptIssuanceId)
.build();
```

#### Issue.currency() and Issue.issuer() removed

The `currency()` and `issuer()` accessors are no longer on the `Issue` interface. They have moved to the concrete
subtypes where they apply:

- `XrpIssue.currency()` — always returns `"XRP"`
- `IouIssue.currency()` — returns the currency code
- `IouIssue.issuer()` — returns the issuer `Address`
- `MptIssue.mptIssuanceId()` — returns the `MpTokenIssuanceId`

**Migration:**

Use the `handle()` or `map()` methods to work with `Issue` instances polymorphically. For example, in v6.x.x you could
access currency and issuer directly from an `AmmObject`:

```java
// Before (v6.x.x)
Issue issue = ammObject.asset();
String currency = issue.currency();
Optional<Address> issuer = issue.issuer();
```

In v7.0.0, objects like `VaultObject` can hold any asset type (XRP, IOU, or MPT). Use `handle()` to dispatch based on
the concrete type:

```java
// After (v7.0.0)
Issue issue = vaultObject.asset();
issue.handle(
// Handle XRP
xrpIssue -> {
String currency = xrpIssue.currency(); // "XRP"
},
// Handle IOU
iouIssue -> {
String currency = iouIssue.currency();
Address issuer = iouIssue.issuer();
},
// Handle MPT
mptIssue -> {
MpTokenIssuanceId issuanceId = mptIssue.mptIssuanceId();
}
);
```

Or use `map()` to transform an `Issue` into a value:

```java
Issue issue = vaultObject.asset();
String description = issue.map(
xrpIssue -> "XRP",
iouIssue -> iouIssue.currency() + "/" + iouIssue.issuer(),
mptIssue -> "MPT:" + mptIssue.mptIssuanceId()
);
```

#### JSON Serialization

JSON serialization and deserialization remain compatible. The `IssueDeserializer` automatically selects the correct
subtype based on the JSON structure:

- `{"currency": "XRP"}` → `XrpIssue`
- `{"currency": "USD", "issuer": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn"}` → `IouIssue`
- `{"mpt_issuance_id": "00000001A407AF5856CFF3379945D823561023E8E5CED9C9"}` → `MptIssue`

### 2. Transaction Signing API

The transaction signing internals have been refactored to eliminate per-transaction-type switch statements in
`SignatureUtils`. This change leverages Immutables-generated builder methods on the `Transaction` interface.

#### `SignatureUtils.addSignatureToTransaction()` removed

This method contained a large switch statement with explicit handling for every transaction type. It has been removed.
The signing flow now uses `Transaction.withTransactionSignature()` directly.

**Migration:**

If you were calling `addSignatureToTransaction()` directly (uncommon — this was primarily used internally by
`AbstractTransactionSigner`):

```java
// Before (v6.x.x)
SingleSignedTransaction<Payment> signed = signatureUtils.addSignatureToTransaction(payment, signature);

// After (v7.0.0)
Transaction signedTx = payment.withTransactionSignature(signature);
SingleSignedTransaction<Payment> signed = SingleSignedTransaction.<Payment>builder()
.unsignedTransaction(payment)
.signature(signature)
.signedTransaction((Payment) signedTx)
.build();
```

#### `SignatureUtils.addMultiSignaturesToTransaction()` removed

This method has also been removed. Use `Transaction.withSigners()` instead.

**Migration:**

```java
// Before (v6.x.x)
Transaction multiSigned = signatureUtils.addMultiSignaturesToTransaction(transaction, signerWrappers);

// After (v7.0.0)
Transaction multiSigned = transaction.withSigners(signerWrappers);
```

#### New `Transaction` interface methods

Two new methods have been added to the `Transaction` interface. Immutables generates concrete implementations of these
for every transaction subclass:

- `Transaction withTransactionSignature(Signature signature)` — returns a copy of the transaction with the signature
applied.
- `Transaction withSigners(Iterable<? extends SignerWrapper> signers)` — returns a copy of the transaction with the
specified signers applied.

## Backward Compatibility

- JSON serialization and deserialization remain compatible with the same JSON structure.
- The `Issue.XRP` constant is still available and works the same way.
- The `TransactionSigner.sign()` and `TransactionSigner.multiSign()` APIs are unchanged — only the internal
implementation has changed. If you use these high-level APIs (e.g., via `BcSignatureService`), no migration is needed
for signing.

## Additional Resources

- **XLS-0065 Specification**: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0065-single-asset-vault
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<!-- Prevents annotation processor ordering issues with Immutables -->
<useIncrementalCompilation>false</useIncrementalCompilation>
Comment thread
sappenin marked this conversation as resolved.

<annotationProcessorPaths>
<path>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
import org.xrpl.xrpl4j.model.client.accounts.AccountObjectsResult;
Comment thread
kuan121 marked this conversation as resolved.
import org.xrpl.xrpl4j.model.client.accounts.AccountOffersRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountOffersResult;
import org.xrpl.xrpl4j.model.client.accounts.AccountSponsoringRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountSponsoringResult;
import org.xrpl.xrpl4j.model.client.accounts.AccountTransactionsRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountTransactionsResult;
import org.xrpl.xrpl4j.model.client.accounts.GatewayBalancesRequestParams;
Expand Down Expand Up @@ -95,6 +97,8 @@
import org.xrpl.xrpl4j.model.client.transactions.SubmitResult;
import org.xrpl.xrpl4j.model.client.transactions.TransactionRequestParams;
import org.xrpl.xrpl4j.model.client.transactions.TransactionResult;
import org.xrpl.xrpl4j.model.client.vault.VaultInfoRequestParams;
import org.xrpl.xrpl4j.model.client.vault.VaultInfoResult;
import org.xrpl.xrpl4j.model.immutables.FluentCompareTo;
import org.xrpl.xrpl4j.model.jackson.ObjectMapperFactory;
import org.xrpl.xrpl4j.model.ledger.LedgerObject;
Expand Down Expand Up @@ -618,6 +622,31 @@ public AccountOffersResult accountOffers(AccountOffersRequestParams params) thro
return jsonRpcClient.send(request, AccountOffersResult.class);
}

/**
* Get the {@link AccountSponsoringResult} for the account specified in {@code params} by making an account_sponsoring
* method call.
*
* <p>This method will be marked {@link Beta} until the featureSponsorship amendment is enabled on mainnet.
* Its API is subject to change.</p>
*
* @param params The {@link AccountSponsoringRequestParams} to send in the request.
*
* @return The {@link AccountSponsoringResult} returned by the account_sponsoring method call.
*
* @throws JsonRpcClientErrorException If {@code jsonRpcClient} throws an error.
*
* @see "https://github.com/XRPLF/XRPL-Standards/blob/master/XLS-0068-sponsored-fees-and-reserves/README.md"
*/
@Beta
public AccountSponsoringResult accountSponsoring(AccountSponsoringRequestParams params)
throws JsonRpcClientErrorException {
JsonRpcRequest request = JsonRpcRequest.builder()
.method(XrplMethods.ACCOUNT_SPONSORING)
.addParams(params)
.build();
return jsonRpcClient.send(request, AccountSponsoringResult.class);
}

/**
* Indicates whether one account is authorized to send payments directly to another.
*
Expand Down Expand Up @@ -893,6 +922,27 @@ public MptHoldersResponse mptHolders(MptHoldersRequestParams params) throws Json
return jsonRpcClient.send(request, MptHoldersResponse.class);
}

/**
* Get info about a Vault by making a call to the vault_info rippled RPC method.
*
* @param params The {@link VaultInfoRequestParams} to send in the request.
*
* @return A {@link VaultInfoResult}.
*
* @throws JsonRpcClientErrorException if {@code jsonRpcClient} throws an error.
*/
@Beta
public VaultInfoResult vaultInfo(
VaultInfoRequestParams params
) throws JsonRpcClientErrorException {
JsonRpcRequest request = JsonRpcRequest.builder()
.method(XrplMethods.VAULT_INFO)
.addParams(params)
.build();

return jsonRpcClient.send(request, VaultInfoResult.class);
}

public JsonRpcClient getJsonRpcClient() {
return jsonRpcClient;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
import org.xrpl.xrpl4j.model.client.accounts.AccountObjectsResult;
import org.xrpl.xrpl4j.model.client.accounts.AccountOffersRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountOffersResult;
import org.xrpl.xrpl4j.model.client.accounts.AccountSponsoringRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountSponsoringResult;
import org.xrpl.xrpl4j.model.client.accounts.AccountTransactionsRequestParams;
import org.xrpl.xrpl4j.model.client.accounts.AccountTransactionsResult;
import org.xrpl.xrpl4j.model.client.accounts.GatewayBalancesRequestParams;
Expand Down Expand Up @@ -107,9 +109,12 @@
import org.xrpl.xrpl4j.model.client.transactions.SubmitResult;
import org.xrpl.xrpl4j.model.client.transactions.TransactionRequestParams;
import org.xrpl.xrpl4j.model.client.transactions.TransactionResult;
import org.xrpl.xrpl4j.model.client.vault.VaultInfoRequestParams;
import org.xrpl.xrpl4j.model.client.vault.VaultInfoResult;
import org.xrpl.xrpl4j.model.flags.AccountRootFlags;
import org.xrpl.xrpl4j.model.jackson.ObjectMapperFactory;
import org.xrpl.xrpl4j.model.ledger.AccountRootObject;
import org.xrpl.xrpl4j.model.ledger.IouIssue;
import org.xrpl.xrpl4j.model.ledger.Issue;
import org.xrpl.xrpl4j.model.ledger.LedgerObject;
import org.xrpl.xrpl4j.model.transactions.Address;
Expand Down Expand Up @@ -955,7 +960,7 @@ void bookOffers() throws JsonRpcClientErrorException {
.taker(Address.of("r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"))
.takerGets(Issue.XRP)
.takerPays(
Issue.builder()
IouIssue.builder()
.issuer(Address.of("rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"))
.currency("USD")
.build()
Expand Down Expand Up @@ -990,6 +995,20 @@ public void accountLines() throws JsonRpcClientErrorException {
assertThat(jsonRpcRequestArgumentCaptor.getValue().params().get(0)).isEqualTo(accountLinesRequestParams);
}

@Test
public void accountSponsoring() throws JsonRpcClientErrorException {
AccountSponsoringRequestParams accountSponsoringRequestParams = AccountSponsoringRequestParams.builder()
.account(Address.of("rDgZZ3wyprx4ZqrGQUkquE9Fs2Xs8XBcdw"))
.ledgerSpecifier(LedgerSpecifier.CURRENT)
.build();
xrplClient.accountSponsoring(accountSponsoringRequestParams);

ArgumentCaptor<JsonRpcRequest> jsonRpcRequestArgumentCaptor = ArgumentCaptor.forClass(JsonRpcRequest.class);
verify(jsonRpcClientMock).send(jsonRpcRequestArgumentCaptor.capture(), eq(AccountSponsoringResult.class));
assertThat(jsonRpcRequestArgumentCaptor.getValue().method()).isEqualTo(XrplMethods.ACCOUNT_SPONSORING);
assertThat(jsonRpcRequestArgumentCaptor.getValue().params().get(0)).isEqualTo(accountSponsoringRequestParams);
}

@Test
public void channelVerify() throws JsonRpcClientErrorException {
ChannelVerifyRequestParams channelVerifyRequestParams = ChannelVerifyRequestParams.builder()
Expand Down Expand Up @@ -1060,6 +1079,20 @@ void ammInfo() throws JsonRpcClientErrorException {
assertThat(result).isEqualTo(mockResult);
}

@Test
void vaultInfo() throws JsonRpcClientErrorException {
VaultInfoRequestParams params = mock(VaultInfoRequestParams.class);
JsonRpcRequest expectedRequest = JsonRpcRequest.builder()
.method(XrplMethods.VAULT_INFO)
.addParams(params)
.build();
VaultInfoResult mockResult = mock(VaultInfoResult.class);
when(jsonRpcClientMock.send(expectedRequest, VaultInfoResult.class)).thenReturn(mockResult);
VaultInfoResult result = xrplClient.vaultInfo(params);

assertThat(result).isEqualTo(mockResult);
}

@Test
void ledgerEntry() throws JsonRpcClientErrorException {
LedgerEntryRequestParams<LedgerObject> params = LedgerEntryRequestParams.index(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,18 @@ public UnsignedByteArray slice(int startIndex, int endIndex) {
return new UnsignedByteArray(unsignedBytes.subList(startIndex, endIndex));
}

/**
* Returns a new {@link UnsignedByteArray} with the bytes in reversed order.
* This is useful for converting between big-endian and little-endian byte order.
*
* @return A new {@link UnsignedByteArray} with bytes in reversed order.
*/
public UnsignedByteArray reverse() {
List<UnsignedByte> reversed = new ArrayList<>(unsignedBytes);
Collections.reverse(reversed);
return new UnsignedByteArray(reversed);
}

@Override
public boolean equals(Object object) {
if (this == object) {
Expand Down
Loading
Loading