diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index a5cdf28bd3..7fa719827e 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -4,6 +4,9 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr ## Unreleased +### Fixed +* Fix `AccountRoot` ledger object to correctly parse `FirstNFTokenSequence` field. + ## 4.3.0 (2025-6-09) ### Added diff --git a/packages/xrpl/src/models/ledger/AccountRoot.ts b/packages/xrpl/src/models/ledger/AccountRoot.ts index 3739c5f75d..82dd00f79b 100644 --- a/packages/xrpl/src/models/ledger/AccountRoot.ts +++ b/packages/xrpl/src/models/ledger/AccountRoot.ts @@ -73,7 +73,7 @@ export default interface AccountRoot extends BaseLedgerEntry, HasPreviousTxnID { /** Total NFTokens this account's issued that have been burned. This number is always equal or less than MintedNFTokens. */ BurnedNFTokens?: number /** The sequence that the account first minted an NFToken */ - FirstNFTSequence: number + FirstNFTokenSequence?: number /** Total NFTokens have been minted by and on behalf of this account. */ MintedNFTokens?: number /** Another account that can mint NFTokens on behalf of this account. */ diff --git a/packages/xrpl/test/integration/transactions/nftokenMint.test.ts b/packages/xrpl/test/integration/transactions/nftokenMint.test.ts index b12ff59966..444bae44fc 100644 --- a/packages/xrpl/test/integration/transactions/nftokenMint.test.ts +++ b/packages/xrpl/test/integration/transactions/nftokenMint.test.ts @@ -1,6 +1,7 @@ import { assert } from 'chai' import { + AccountInfoRequest, convertStringToHex, getNFTokenID, NFTokenMint, @@ -48,6 +49,8 @@ describe('NFTokenMint', function () { ) assert.equal(response.type, 'response') + const mintTransactionSeq = response.result.tx_json.Sequence + const txRequest: TxRequest = { command: 'tx', transaction: hashSignedTx(response.result.tx_blob), @@ -93,6 +96,26 @@ describe('NFTokenMint', function () { getNFTokenID(binaryTxResponse.result.meta_blob) ?? 'undefined', `getNFTokenID produced a different outcome when decoding the metadata in binary format.`, ) + + // Check if AccountRoot ledger object reflects minted token + const accountInfoRequest: AccountInfoRequest = { + command: 'account_info', + account: testContext.wallet.address, + ledger_index: 'validated', + } + const accountInfoResponse = await testContext.client.request( + accountInfoRequest, + ) + assert.equal( + accountInfoResponse.result.account_data.FirstNFTokenSequence, + mintTransactionSeq, + `FirstNFTokenSequence is not same as NFTokenMint's transaction sequence.`, + ) + assert.equal( + accountInfoResponse.result.account_data.MintedNFTokens, + 1, + `MintedNFTokens is not 1.`, + ) }, TIMEOUT, )