Skip to main content

Accounts

Every address on XYZ Chain has an associated account that tracks its sequence number (nonce), public key, and account number. These are needed for signing transactions.

Get Account

Retrieve account details for an address.
curl http://67.205.164.156:1317/cosmos/auth/v1beta1/accounts/xyz1abc123...
{
  "account": {
    "@type": "/cosmos.auth.v1beta1.BaseAccount",
    "address": "xyz1abc123...",
    "pub_key": {
      "@type": "/cosmos.crypto.secp256k1.PubKey",
      "key": "A1B2C3..."
    },
    "account_number": "42",
    "sequence": "15"
  }
}

Key Fields

FieldDescription
addressThe bech32-encoded address (prefix xyz)
pub_keyThe public key, set after the account’s first transaction
account_numberUnique identifier assigned when the account first receives funds. Used for transaction signing.
sequenceTransaction counter (nonce). Increments with each successful transaction. Used to prevent replay attacks.
pub_key is null for accounts that have received tokens but never sent a transaction. The public key is recorded on-chain with the first outgoing transaction.

Using Account Info for Signing

When building a transaction, you need account_number and sequence from this endpoint:
const account = await fetch(
  'http://67.205.164.156:1317/cosmos/auth/v1beta1/accounts/xyz1...'
).then(r => r.json());

const signerInfo = {
  accountNumber: account.account.account_number,
  sequence: account.account.sequence,
};
If sequence is stale (another transaction was confirmed since your query), the transaction will fail with code: 32 (account sequence mismatch). Re-query and retry.

List All Accounts

Returns all accounts on the chain. Paginated.
curl "http://67.205.164.156:1317/cosmos/auth/v1beta1/accounts?pagination.limit=10"
This can return a large number of results on mainnet. Always use pagination parameters.

Account Types

@typeDescription
/cosmos.auth.v1beta1.BaseAccountStandard user account
/cosmos.auth.v1beta1.ModuleAccountSystem module account (e.g., bridge, distribution)
/cosmos.vesting.v1beta1.ContinuousVestingAccountAccount with vesting schedule
Module accounts are system-owned and cannot be controlled by external keys. They appear in queries for the bridge module, fee pool, and other on-chain mechanisms.