AccountSet Transaction: SetFlag, ClearFlag
AccountSet Transaction: SetFlag, ClearFlag

AccountSet Transaction: SetFlag, ClearFlag

Setting things up

Installing Node and VS Code EditorInstalling Node and VS Code EditorInstalling "XRPL JS TS Demo" and DependenciesInstalling "XRPL JS TS Demo" and Dependencies

XRP Ledger accounts

Learning More About XRP Ledger AccountLearning More About XRP Ledger AccountGenerating XRPL AccountGenerating XRPL AccountDerive r-address From SecretDerive r-address From SecretBrief Overview of The XRP LedgerBrief Overview of The XRP Ledger

First XRPL interaction

Activate Existing XRPL Account on Test NetworkActivate Existing XRPL Account on Test NetworkConnecting and Interacting with XRP Ledger: account_infoConnecting and Interacting with XRP Ledger: account_infoInteracting with XRP Ledger using JSON-RPCInteracting with XRP Ledger using JSON-RPCError Handling and Best PracticesError Handling and Best PracticesBasics of XRP and Issued CurrencyBasics of XRP and Issued CurrencySigning Payment TransactionSigning Payment TransactionAssignment SolutionAssignment SolutionVerifying SignatureVerifying SignatureSubmit Transaction Signature To XRP LedgerSubmit Transaction Signature To XRP LedgerSubscription MethodsSubscription MethodsSubscription Methods To Build Responsive AppSubscription Methods To Build Responsive AppTransaction VerificationTransaction VerificationBalance DetailBalance DetailTransaction CostTransaction CostMeasures to Avoid Ledger SpammingMeasures to Avoid Ledger SpammingSource And Destination TagsSource And Destination TagsAccountSet Transaction: Domain, GravatarAccountSet Transaction: Domain, GravatarAccountSet Transaction: SetFlag, ClearFlagAccountSet Transaction: SetFlag, ClearFlagDeposit AuthorizationDeposit Authorization

Tokens, transactions

Issuing Token on XRPLIssuing Token on XRPLToken(IOU): Payment TransactionToken(IOU): Payment TransactionCommands To Fetch TrustLine InformationCommands To Fetch TrustLine InformationFreeze a TrustLineFreeze a TrustLineIssuer: Transfer FeesIssuer: Transfer FeesMore about TrustLineMore about TrustLineCurrency Code In Hex FormatCurrency Code In Hex FormatRemoving a TrustLineRemoving a TrustLineRequire authorization FlagRequire authorization Flag

Ledger features

AccountDelete TransactionAccountDelete TransactionTickets: TheoryTickets: TheoryTicketCreate TransactionTicketCreate TransactionDelete Ticket ObjectDelete Ticket Object

SetRegularKey

SetRegularKey: The ConceptSetRegularKey: The ConceptAssigning RegularKeyAssigning RegularKeyChange RegularKeyChange RegularKeyRemove RegularKeyRemove RegularKeyBlackhole An AccountBlackhole An Account

MultiSigning

MultiSigning: The ConceptMultiSigning: The ConceptCreate SignerListCreate SignerListReplace SignerListReplace SignerListMulti-signed Payment TransactionMulti-signed Payment TransactionRemoving SignerListRemoving SignerList

AccountSet Transaction: SetFlag, ClearFlag

Intro

Configuring different behaviour for an account by setting and clearing different flags.

Video

Topics covered

  • Setting and clearing asfRequireDest flag.
  • Setting and clearing other flags.
  • Fetching flag names using the value present in the flag field of an account.

References

  • AccountSet
  • flagnames

Update:

flagNames package is update and there is slight change in the syntax.

flagNames(account_data.LedgerEntryType, account_data.Flags)

It takes 2 parameters. First parameter is LedgerEntryType and the second parameter is the actual flag value.

Stop using flagNames package

You could stop using flagNames package, as the flag information are now natively output from public methods. When the videos were created these information was only available by decoding the Flags value. ( But if you, for whatever reason, want to fetch flag information from the Flags field, you know you can use flagNames package. )

const data = await client.send({
    command: "account_info",
    account: "rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT",
});

console.log(data);

Output:

{
  account_data: {
    Account: 'rHdkzpxr3VfabJh9tUEDv7N4DJEsA4UioT',
    Balance: '1990365784',
    Domain: '68747470733A2F2F7477697466657665722E636F6D',
    EmailHash: 'CD86ADAF0C695F745491B176E921F82E',
    Flags: 655360,
    LedgerEntryType: 'AccountRoot',
    OwnerCount: 2,
    PreviousTxnID: 'EEE4AF276F5DC52F5A6473B7407546A5B908A95C4E7F4BEFAE87F2C6CF7C9360',
    PreviousTxnLgrSeq: 39677303,
    Sequence: 7347274,
    index: '0BD6535749C70A8CCD226D780B5342ACE30A52B40D50263A3A37A6F3E9F04B55',
    urlgravatar: 'http://www.gravatar.com/avatar/cd86adaf0c695f745491b176e921f82e'
  },
  account_flags: {
    defaultRipple: false,
    depositAuth: false,
    disableMasterKey: false,
    disallowIncomingCheck: false,
    disallowIncomingNFTokenOffer: false,
    disallowIncomingPayChan: false,
    disallowIncomingTrustline: false,
    disallowIncomingXRP: true,
    globalFreeze: false,
    noFreeze: false,
    passwordSpent: false,
    requireAuthorization: false,
    requireDestinationTag: true
  },
  ledger_current_index: 40558110,
  validated: false
}
💡
Final tip: Make sure that you clearly know what the flag does before setting it on your account.

← Previous

Domain and Gravatar

Next →

Deposite Authorization

  • AccountSet Transaction: SetFlag, ClearFlag
  • Intro
  • Video
  • Topics covered
  • References
  • Update:
  • Stop using flagNames package
💠
https://xrpl-labs.com

Footer Social Icons

© XRPL Labs - https://xrpl-labs.com