diff --git a/packages/ripple-binary-codec/HISTORY.md b/packages/ripple-binary-codec/HISTORY.md index eab2768410..91d3ef8e9f 100644 --- a/packages/ripple-binary-codec/HISTORY.md +++ b/packages/ripple-binary-codec/HISTORY.md @@ -11,7 +11,7 @@ ### Added * Support for the Price Oracles amendment (XLS-47). -* Add `NFTokenModify` transaction and add `tfMutable` flag in `NFTokenMint` +* Support for the `DynamicNFT` amendment (XLS-46) ### Fixed * Better error handling/error messages for serialization/deserialization errors. diff --git a/packages/xrpl/HISTORY.md b/packages/xrpl/HISTORY.md index d41e1c537b..0f995f47a7 100644 --- a/packages/xrpl/HISTORY.md +++ b/packages/xrpl/HISTORY.md @@ -17,7 +17,7 @@ Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xr * New `MPTAmount` type support for `Payment` and `Clawback` transactions * `parseTransactionFlags` as a utility function in the xrpl package to streamline transactions flags-to-map conversion * Support for XLS-70d (Credentials) -* Add `NFTokenModify` transaction and add `tfMutable` flag in `NFTokenMint` +* Support for the `DynamicNFT` amendment (XLS-46) ### Fixed * `TransactionStream` model supports APIv2 diff --git a/packages/xrpl/src/models/transactions/NFTokenModify.ts b/packages/xrpl/src/models/transactions/NFTokenModify.ts index e67603fbf7..4246509671 100644 --- a/packages/xrpl/src/models/transactions/NFTokenModify.ts +++ b/packages/xrpl/src/models/transactions/NFTokenModify.ts @@ -38,7 +38,7 @@ export interface NFTokenModify extends BaseTransaction { * convert this field to the proper encoding. * * This field must not be an empty string. Omit it from the transaction or - * set to `undefined` value if you do not use it. + * set to `null` if you do not use it. */ URI?: string | null } diff --git a/packages/xrpl/test/models/NFTokenModify.test.ts b/packages/xrpl/test/models/NFTokenModify.test.ts index 2f84793153..8d1bb9b0bf 100644 --- a/packages/xrpl/test/models/NFTokenModify.test.ts +++ b/packages/xrpl/test/models/NFTokenModify.test.ts @@ -38,4 +38,38 @@ describe('NFTokenModify', function () { 'NFTokenModify: missing field NFTokenID', ) }) + + it(`throws w/ URI being an empty string`, function () { + const invalid = { + TransactionType: 'NFTokenModify', + Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm', + NFTokenID: TOKEN_ID, + Fee: '5000000', + Sequence: 2470665, + URI: '', + } as any + + assert.throws( + () => validate(invalid), + ValidationError, + 'NFTokenModify: URI must not be empty string', + ) + }) + + it(`throws w/ URI not in hex format`, function () { + const invalid = { + TransactionType: 'NFTokenModify', + Account: 'rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm', + NFTokenID: TOKEN_ID, + Fee: '5000000', + Sequence: 2470665, + URI: '--', + } as any + + assert.throws( + () => validate(invalid), + ValidationError, + 'NFTokenModify: URI must be in hex format', + ) + }) })