> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ana.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# List account activity

> Lists the payments that the engine signed for the account, newest first. Each row
gives a status, a transaction hash when one exists, and the fees of a landed payment.
A row never carries the payment details of the rule.

- Who may call: anyone, about any account.
- Before: nothing.
- Guarantee: `redemptionId` identifies a row and stays the same while the row is in
  the list. A final row can leave the list after some days. A payment that the
  engine signed again has only one row, under the new signature.

Poll the route to follow a payment. Retries are safe. See
[Activity](/concepts/activity).




## OpenAPI

````yaml /api/openapi.yaml get /api/wallets/{aa}/activity
openapi: 3.1.0
info:
  title: Anafi API
  version: 0.3.0
  summary: The public HTTP API of one Anafi network.
  description: >
    The Anafi API is the HTTP surface of one Anafi network. Each network has its
    own host.

    The public TypeScript SDK `@anafi-cc/anafi-sdk` calls these routes for you,
    and it also

    builds and checks the signed and sealed payloads. You can call the routes
    directly.


    - No API key is necessary today.

    - Request and response bodies are JSON, except where an operation says
    otherwise.

    - A route that carries a confidential payload takes an HPKE-sealed envelope.
    Read
      [Sealed requests](/api-reference/sealed-requests) before you call it without the SDK.
    - Read [Introduction](/api-reference/introduction) for formats and
      [Errors](/api-reference/errors) for the error bodies.

    Browser origin: the API hosts answer CORS only for `https://app.ana.fi`
    today. A browser

    page on another origin cannot call the API directly. A server, a script, or
    your own

    same-origin proxy can call it.
servers:
  - url: https://api.polygon.ana.fi
    description: Polygon PoS (chain id 137)
  - url: https://api.xlayer.ana.fi
    description: X Layer (chain id 196)
  - url: https://api.polygon-amoy.ana.fi
    description: Polygon Amoy testnet (chain id 80002)
security: []
tags:
  - name: Accounts
    description: >-
      Find the accounts of an owner address, and deploy the 1-of-1 Safe of an
      owner.
  - name: Safe relay
    description: Submit an owner-signed Safe transaction. Anafi pays the gas.
  - name: Rules
    description: >-
      Stage a sealed rule document. The engine returns the attestation for the
      on-chain commit.
  - name: Confidential channel
    description: >-
      Read back the rule document and the account state of an account through a
      sealed channel.
  - name: Notification email
    description: Verify the email address that rule notifications go to.
  - name: Activity
    description: Read the payments that the engine made for an account.
  - name: Fees
    description: Read the fee terms of the network and the sponsorship of an account.
  - name: Payments
    description: Ask for the email receipt of a payment made on the pay page.
  - name: Rule language
    description: >-
      Read the rule language reference, and write a rule document from a
      description.
  - name: Bank payouts
    description: >
      Connect a Safe to Monerium for bank payouts in euro, and read the state of
      the

      connection and of the orders. These routes are served only on
      `polygon-amoy`

      (Monerium sandbox). The `polygon` and `xlayer` hosts answer `404`.
  - name: Status
    description: Check that the Anafi API answers.
paths:
  /api/wallets/{aa}/activity:
    get:
      tags:
        - Activity
      summary: List account activity
      description: >
        Lists the payments that the engine signed for the account, newest first.
        Each row

        gives a status, a transaction hash when one exists, and the fees of a
        landed payment.

        A row never carries the payment details of the rule.


        - Who may call: anyone, about any account.

        - Before: nothing.

        - Guarantee: `redemptionId` identifies a row and stays the same while
        the row is in
          the list. A final row can leave the list after some days. A payment that the
          engine signed again has only one row, under the new signature.

        Poll the route to follow a payment. Retries are safe. See

        [Activity](/concepts/activity).
      operationId: getActivity
      parameters:
        - $ref: '#/components/parameters/AccountPath'
      responses:
        '200':
          description: The rows, newest first. An empty array when the account has no rows.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivityItem'
              example:
                - kind: payment
                  redemptionId: >-
                    0x7e1d8c0b4f3a2e19d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a39281706f5e4d3c2b
                  status: landed
                  txHash: >-
                    0x2a4c6e8f0b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e7b9d1f3a
                  createdAt: 1796301000
                  failureReason: null
                  waitReason: null
                  fee:
                    - token: USDC
                      tokenAddress: '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582'
                      amountRaw: '200000'
                  gasCharge:
                    tokenAddress: '0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582'
                    amountRaw: '11845'
                - kind: payment
                  redemptionId: >-
                    0x1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c5e7b9d1f3a2a4c6e8f0b1d3f5a7c9e
                  status: in_progress
                  txHash: null
                  createdAt: 1796304600
                  failureReason: null
                  waitReason: insufficient_funds
                  fee: null
        '400':
          $ref: '#/components/responses/InvalidPathAddress'
        '500':
          description: The Anafi API could not read its records. Try again later.
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/PlainTextError'
              example: storage error
components:
  parameters:
    AccountPath:
      name: aa
      in: path
      required: true
      description: >-
        The account address (a Safe or a plain address), as `0x` and 40 hex
        digits in any letter case.
      schema:
        $ref: '#/components/schemas/Address'
      example: '0xf9836de53d455019ed985896fce8af80be66b7f9'
  schemas:
    ActivityItem:
      type: object
      description: One payment of the account.
      required:
        - kind
        - redemptionId
        - status
        - txHash
        - createdAt
        - failureReason
        - waitReason
        - fee
      properties:
        kind:
          $ref: '#/components/schemas/ActivityKind'
        redemptionId:
          $ref: '#/components/schemas/Bytes32Hex'
          description: >-
            An opaque identifier of the row, unique in the account. It tells
            nothing about other accounts.
        status:
          $ref: '#/components/schemas/TaskStatus'
        txHash:
          description: >-
            The hash of the mined transaction. For an open payment with no mined
            transaction, the newest sent hash. `null` before the first send.
          oneOf:
            - $ref: '#/components/schemas/TxHash'
            - type: 'null'
        createdAt:
          $ref: '#/components/schemas/UnixSeconds'
          description: When the engine signed the payment.
        failureReason:
          description: Why the payment failed. `null` unless `status` is `failed`.
          oneOf:
            - $ref: '#/components/schemas/FailureReason'
            - type: 'null'
        waitReason:
          description: >-
            Why the open payment waits. `null` for a final payment or when no
            reason is known.
          oneOf:
            - $ref: '#/components/schemas/WaitReason'
            - type: 'null'
        fee:
          description: >-
            The fees that a `landed` payment paid. An empty array when it paid
            none. `null` for every other status.
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/ActivityFeeLeg'
            - type: 'null'
        gasCharge:
          $ref: '#/components/schemas/ActivityGasCharge'
          description: >-
            The gas that the adapter charged for the payment. The key is absent
            when there is no charge.
    PlainTextError:
      type: string
      description: >-
        A short English sentence. Show it or log it. Do not parse it; branch on
        the status code.
    Address:
      type: string
      pattern: ^0x[0-9a-fA-F]{40}$
      description: >-
        A 20-byte address as `0x` and 40 hex digits. Requests accept any letter
        case. Responses use lowercase.
      examples:
        - '0xf9836de53d455019ed985896fce8af80be66b7f9'
    ActivityKind:
      type: string
      description: The purpose of the row.
      oneOf:
        - const: payment
          description: A payment or a swap that a rule made.
        - const: off_ramp_fee
          description: The Anafi fee of one bank payout.
    Bytes32Hex:
      type: string
      pattern: ^0x[0-9a-f]{64}$
      description: 32 bytes as `0x` and 64 lowercase hex digits.
    TaskStatus:
      type: string
      description: >-
        Where the payment stands. `landed`, `failed`, `withdrawn` and
        `superseded` are final.
      oneOf:
        - const: queued
          description: >-
            The engine signed the payment. Nothing was sent yet. Show it as
            waiting.
        - const: in_progress
          description: >-
            Anafi took the payment and sent it, or holds it for the reason in
            `waitReason`. Show it as in progress, with the wait reason.
        - const: delivered
          description: >-
            A transaction of the payment succeeded on chain. The status is not
            yet final. Show it as almost done.
        - const: landed
          description: The payment is final on chain. `fee` lists the fees that it paid.
        - const: failed
          description: >-
            The payment closed without effect. `failureReason` says why. Show
            the reason and the suggested action.
        - const: withdrawn
          description: >-
            The engine withdrew the payment, because the account stopped (for
            example a revoked permission) or a new rule document removed the
            rule. No action is necessary.
        - const: superseded
          description: >-
            The engine replaced the payment with a new one. The list shows the
            new payment instead, so this value does not occur in practice.
    TxHash:
      type: string
      pattern: ^0x[0-9a-f]{64}$
      description: A transaction hash as `0x` and 64 lowercase hex digits.
    UnixSeconds:
      type: integer
      description: Seconds since 1970-01-01T00:00:00Z.
      examples:
        - 1796305002
    FailureReason:
      type: string
      description: Why a payment failed. The payment did not happen.
      oneOf:
        - const: insufficient_funds
          description: >-
            The account held less than the payment needs. Ask the owner to add
            funds. The rule fires again at its next trigger.
        - const: grant_inactive
          description: >-
            The Safe adapter is not enabled as a module on the Safe. The owner
            enables it again to resume.
        - const: adapter_delisted
          description: The registry no longer lists the adapter. Contact Anafi.
        - const: window_expired
          description: >-
            The payment expired before it landed. The rule fires again at its
            next trigger.
        - const: swap_below_market
          description: The swap output was too far below the market price. No funds moved.
        - const: reverted_on_chain
          description: >-
            The transaction was mined and reverted. Check the balance, the
            permission and the rule.
        - const: wrong_network
          description: The payment was signed for another network. Contact Anafi.
        - const: other
          description: Another cause. Contact Anafi with the `redemptionId`.
        - const: legs_failed_on_chain
          description: >-
            The transaction landed, but one or more legs of the payment failed.
            Check the recipients and the balances.
    WaitReason:
      type: string
      description: >-
        Why an open payment waits. Anafi tries again without action from you,
        unless the row says otherwise.
      oneOf:
        - const: insufficient_funds
          description: >-
            The account holds less than the payment needs. Ask the owner to add
            funds.
        - const: grant_inactive_pending
          description: >-
            The Safe adapter seems not enabled on the Safe. Anafi checks it
            again. If the owner disabled it, the payment closes.
        - const: adapter_delisted_pending
          description: The registry seems not to list the adapter. Anafi checks it again.
        - const: simulation_reverted
          description: >-
            The payment would revert now, for a cause that a later block can
            change. Anafi tries again.
        - const: swap_below_market
          description: >-
            The swap output is too far below the market price now. Anafi waits
            for a better price.
        - const: guard_undecided
          description: >-
            Anafi could not yet confirm that the swap price is fair. Anafi tries
            again.
        - const: fee_above_cap
          description: >-
            The network gas price is too high now. Anafi waits for a lower gas
            price.
        - const: in_flight
          description: A transaction of the payment is sent and waits to be mined.
        - const: nonce_already_used
          description: Another copy of the payment was mined. The row becomes final soon.
        - const: deadline_margin
          description: The payment is too near its expiry to send. It closes soon.
        - const: account_blocked
          description: Anafi holds the payments of this account. Contact Anafi.
        - const: account_redeem_in_flight
          description: >-
            Another payment of this account waits for its first receipt. This
            one follows after it.
    ActivityFeeLeg:
      type: object
      required:
        - token
        - tokenAddress
        - amountRaw
      properties:
        token:
          description: >-
            The token symbol, or `null` for a contract that the token list of
            the network does not name.
          oneOf:
            - $ref: '#/components/schemas/Token'
            - type: 'null'
        tokenAddress:
          $ref: '#/components/schemas/Address'
          description: The token contract, or the zero address for the native coin.
        amountRaw:
          $ref: '#/components/schemas/DecimalInteger'
          description: The fee in the smallest unit of the token.
    ActivityGasCharge:
      type: object
      required:
        - tokenAddress
        - amountRaw
      properties:
        tokenAddress:
          $ref: '#/components/schemas/Address'
          description: >-
            The token in which the adapter charged the gas, or the zero address
            for the native coin.
        amountRaw:
          $ref: '#/components/schemas/DecimalInteger'
          description: The gas charge in the smallest unit of the token.
    Token:
      type: string
      description: >
        A token symbol, with exact letter case, for example `POL`, `OKB`,
        `USDC`, `USDC.e`,

        `EURe`, `USDT0`, `xSOL`. A response names only tokens of the network of
        the host.

        See [Networks](/networks) for the tokens of each network.
      examples:
        - USDC
    DecimalInteger:
      type: string
      pattern: ^[0-9]+$
      description: >-
        A non-negative integer as a string of decimal digits, with no sign, no
        point and no exponent. Parse it as a big integer.
      examples:
        - '200000'
  responses:
    InvalidPathAddress:
      description: The `aa` path segment is not an address.
      content:
        text/plain:
          schema:
            $ref: '#/components/schemas/PlainTextError'
          example: 'Invalid URL: invalid string length'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.