Requires wallet support.

The setaccount RPC puts the specified address in the given account.

setaccount will be removed in a later version of Pai Core. Use the RPCs listed in the See Also subsection below instead.

Parameter #1—a pai address

Name Type Presence Description
Address string (base58) Required
(exactly 1)
The P2PKH or P2SH address to put in the account. Must already belong to the wallet

Parameter #2—an account

Name Type Presence Description
Account string Required
(exactly 1)
The name of the account in which the address should be placed. May be the default account, an empty string (“”)

Result—null if successful

Name Type Presence Description
result null Required
(exactly 1)
Set to JSON null if the address was successfully placed in the account


Put the address indicated below in the “doc test” account.

pai-cli -testnet setaccount \
    mmXgiR6KAhZCyQ8ndr2BCfEq1wNG2UnyG6 "doc test"

(Success: no result displayed.)

See also

  • GetAccount: returns the name of the account associated with the given address.
  • ListAccounts: lists accounts and their balances.
  • GetAddressesByAccount: returns a list of every address assigned to a particular account.