Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@
"burnable": "Burnable",
"only_xrp": "Only XRP",
"transferable": "Transferable",
"mutable": "Mutable",
"buy_offers": "Buy Offers",
"sell_offers": "Sell Offers",
"offer_index": "Offer ID",
Expand Down
2 changes: 2 additions & 0 deletions src/containers/NFT/NFTHeader/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ export const Settings = ({ flags }: Props) => {
const transferable = flags.includes('lsfTransferable')
? 'enabled'
: 'disabled'
const mutable = flags.includes('lsfMutable') ? 'enabled' : 'disabled'

return (
<table className="token-table">
<tbody>
<TokenTableRow label={t('burnable')} value={burnable} />
<TokenTableRow label={t('only_xrp')} value={onlyXRP} />
<TokenTableRow label={t('transferable')} value={transferable} />
<TokenTableRow label={t('mutable')} value={mutable} />
</tbody>
</table>
)
Expand Down
4 changes: 2 additions & 2 deletions src/containers/NFT/NFTHeader/test/Settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ describe('NFT Setttings container', () => {

it('renders defined fields', () => {
const { container } = renderSettings()
expect(container.querySelectorAll('.row').length).toEqual(3)
expect(container.querySelectorAll('.row').length).toEqual(4)
expect((container.textContent.match(/enabled/g) || []).length).toEqual(2)
expect((container.textContent.match(/disabled/g) || []).length).toEqual(1)
expect((container.textContent.match(/disabled/g) || []).length).toEqual(2)
})
})
27 changes: 27 additions & 0 deletions src/containers/shared/test/transactionUtils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Transaction } from '../components/Transaction/types'
import { buildFlags } from '../transactionUtils'

const buildNFTokenMint = (flags: number): Transaction =>
({
tx: {
TransactionType: 'NFTokenMint',
Flags: flags,
},
}) as unknown as Transaction

describe('transactionUtils buildFlags', () => {
it('decodes NFTokenMint type-specific flags', () => {
expect(buildFlags(buildNFTokenMint(0x00000001))).toEqual(['tfBurnable'])
expect(buildFlags(buildNFTokenMint(0x00000008))).toEqual(['tfTransferable'])
})

it('decodes the tfMutable flag (XLS-46 dynamic NFTs)', () => {
expect(buildFlags(buildNFTokenMint(0x00000010))).toEqual(['tfMutable'])
})

it('decodes multiple NFTokenMint flags including tfMutable', () => {
expect(
buildFlags(buildNFTokenMint(0x00000001 | 0x00000008 | 0x00000010)),
).toEqual(['tfMutable', 'tfTransferable', 'tfBurnable'])
})
})
1 change: 1 addition & 0 deletions src/containers/shared/transactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const TX_FLAGS: Record<string, Record<number, string>> = {
0x00000002: 'tfOnlyXRP',
0x00000004: 'tfTrustLine',
0x00000008: 'tfTransferable',
0x00000010: 'tfMutable',
},
NFTokenOfferCreate: {
0x00000001: 'tfSellNFToken',
Expand Down
1 change: 1 addition & 0 deletions src/rippled/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const NFT_FLAGS: FlagMap = {
0x00000001: 'lsfBurnable',
0x00000002: 'lsfOnlyXRP',
0x00000008: 'lsfTransferable',
0x00000010: 'lsfMutable',
}
const MPT_ISSUANCE_FLAGS: FlagMap = {
0x00000001: 'lsfMPTLocked',
Expand Down