lumina/ui/views/explorer/account/account-authorization-flags-view.js
2025-11-29 23:13:05 +03:00

41 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react'
import {InfoTooltip as Info} from '@stellar-expert/ui-framework'
export default function AccountAuthorizationFlagsView({accountInfo}) {
const description = []
if (accountInfo.flags.auth_required) {
description.push('required')
}
if (accountInfo.flags.auth_revocable) {
description.push('revocable')
}
if (accountInfo.flags.auth_immutable) {
description.push('immutable')
}
if (accountInfo.flags.auth_clawback_enabled) {
description.push('clawback_enabled')
}
return <>
<dt>Asset authorization flags:</dt>
<dd>
{!!accountInfo.flags.auth_immutable && <i className="icon lock green"/>}
{description.join(', ') || 'none'}
<Info link="https://www.stellar.org/developers/guides/concepts/accounts.html#flags">
<ul>
<li><code>AUTH_REQUIRED</code> Requires the issuing account to give other accounts permission before
they can hold the issuing account’s credit.
</li>
<li><code>AUTH_REVOCABLE</code> Allows the issuing account to revoke its credit held by other
accounts.
</li>
<li><code>AUTH_CLAWBACK_ENABLED</code> Allows the issuing account to clawback tokens without the
account consent in case of service terms violation.
</li>
<li><code>AUTH_IMMUTABLE</code> If set then none of the authorization flags can be set and the
account can never be deleted.
</li>
</ul>
</Info>
</dd>
</>
}