Pular para o conteúdo

Update XRPL account settings with the API

You can use the AccountSet operation to update account settings. This operation involves the creation of a transaction order.

For more information about the AccountSet operation, see AccountSet Flags in the XRPL documentation.

System change process

All new requests to change the system state follow the same process. To familiarize yourself with this process first, see Manage intents and approvals.

Supported settings

You can set or clear the following settings:

  • asfGlobalFreeze: Freeze all assets issued by the account.
  • asfNoFreeze: Permanently give up the ability to freeze individual trust lines or disable global freeze on the issuer account. This flag can only be set once and can't be unset.
  • asfRequireAuth: Require authorization for accounts to hold balances issued by this address.
  • asfAllowTrustLineClawback: Allow the issuer account to claw back tokens it has issued. Can only be set before issuing tokens.
  • asfAccountTxnID: Track the ID of this account's most recent transaction.
  • asfDepositAuth: Enable deposit authorization on the holder account. Applies to both tokens and XRP.
  • asfRequireDest: Require a destination tag for incoming payments to the account.
  • asfDefaultRipple: Enable rippling on this account's trust lines by default. For more information, see Rippling in the XRPL documentation.

To update account settings, follow the steps in Manage intents and approvals with a transaction order payload similar to the following example.

Payload example

The SDK examples assume a configured client. See Integrate via SDK. The SDK methods build the AccountSet operation, submit the intent, and return a pending intent that you can wait on. The following examples set and clear account flags:

{
    "payload": {
        "id": "8fd2d859-77de-4bcc-976c-3f4ccdfdcc3d",
        "accountId": "c8b9519a-be18-4db7-9aca-cce93834841b",
        "parameters": {
            "operation": {
                "type": "AccountSet",
                "setFlag": "asfGlobalFreeze",
                "clearFlag": "asfRequireDest",
                "transferRate": 1000000000
            },
            "sourceTag": 123456,
            "memos": [],
            "feeStrategy": {
                "drops": "5",
                "type": "SpecifiedAdditionalFee"
            },
            "maximumFee": "50",
            "type": "XRPL"
        },
        "description": "string",
        "customProperties": {},
        "type": "v0_CreateTransactionOrder"
    }
}

The TypeScript and Python methods use the Priority fee strategy. You set the priority with feePriority or fee_priority, which defaults to Medium. The Java method takes a CoreXrplFeeStrategy, which wraps either a Priority or a SpecifiedAdditionalFee strategy. Only the Python method accepts a source tag.

You can't set the same flag in setFlag and clearFlag. The SDKs reject that combination before they submit the intent.

Fields of the payload block to note are as follows:

FieldDescription
idID of the transaction order
accountIdID of the account to update
parameters.operationDetails of the operation:
  • type: AccountSet
  • setFlag: Enable the specified setting.
  • clearFlag: Disable the specified setting.
  • transferRate: Optional XRPL transfer rate integer, for example 1000000000 for no transfer fee.
You must set at least one of setFlag, clearFlag, or transferRate. For a list of supported settings, see Supported settings.
parameters.sourceTagOptional source tag for the XRPL transaction.
parameters.memosXRPL memos to include. Use an empty array when there are no memos.
parameters.feeStrategyThe fee strategy to use for the transaction. For more information, see Fee strategy and maximum fee.
parameters.maximumFeeThe maximum fee, in drops. For more information, see Fee strategy and maximum fee.
parameters.typeLedger type, in this case XRPL.
typev0_CreateTransactionOrder