Skip to content

Commit 27dc2b4

Browse files
authored
Fix AccountRoot ledger object (#3010)
* fix AccountRoot ledger object * update HISTORY.md * fix import and lint errors * request a validated ledger
1 parent ee37e6c commit 27dc2b4

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

packages/xrpl/HISTORY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr
44

55
## Unreleased
66

7+
### Fixed
8+
* Fix `AccountRoot` ledger object to correctly parse `FirstNFTokenSequence` field.
9+
710
## 4.3.0 (2025-6-09)
811

912
### Added

packages/xrpl/src/models/ledger/AccountRoot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default interface AccountRoot extends BaseLedgerEntry, HasPreviousTxnID {
7373
/** Total NFTokens this account's issued that have been burned. This number is always equal or less than MintedNFTokens. */
7474
BurnedNFTokens?: number
7575
/** The sequence that the account first minted an NFToken */
76-
FirstNFTSequence: number
76+
FirstNFTokenSequence?: number
7777
/** Total NFTokens have been minted by and on behalf of this account. */
7878
MintedNFTokens?: number
7979
/** Another account that can mint NFTokens on behalf of this account. */

packages/xrpl/test/integration/transactions/nftokenMint.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { assert } from 'chai'
22

33
import {
4+
AccountInfoRequest,
45
convertStringToHex,
56
getNFTokenID,
67
NFTokenMint,
@@ -48,6 +49,8 @@ describe('NFTokenMint', function () {
4849
)
4950
assert.equal(response.type, 'response')
5051

52+
const mintTransactionSeq = response.result.tx_json.Sequence
53+
5154
const txRequest: TxRequest = {
5255
command: 'tx',
5356
transaction: hashSignedTx(response.result.tx_blob),
@@ -93,6 +96,26 @@ describe('NFTokenMint', function () {
9396
getNFTokenID(binaryTxResponse.result.meta_blob) ?? 'undefined',
9497
`getNFTokenID produced a different outcome when decoding the metadata in binary format.`,
9598
)
99+
100+
// Check if AccountRoot ledger object reflects minted token
101+
const accountInfoRequest: AccountInfoRequest = {
102+
command: 'account_info',
103+
account: testContext.wallet.address,
104+
ledger_index: 'validated',
105+
}
106+
const accountInfoResponse = await testContext.client.request(
107+
accountInfoRequest,
108+
)
109+
assert.equal(
110+
accountInfoResponse.result.account_data.FirstNFTokenSequence,
111+
mintTransactionSeq,
112+
`FirstNFTokenSequence is not same as NFTokenMint's transaction sequence.`,
113+
)
114+
assert.equal(
115+
accountInfoResponse.result.account_data.MintedNFTokens,
116+
1,
117+
`MintedNFTokens is not 1.`,
118+
)
96119
},
97120
TIMEOUT,
98121
)

0 commit comments

Comments
 (0)