> ## 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.

# Get Monerium link status

> Returns where the Monerium connection of a Safe stands, and the off-ramp setup of the
Safe on chain: whether its fallback handler is the off-ramp handler, and the policy
that it holds there. The IBAN is masked.

- Who may call: anyone, about any Safe.
- Before: nothing.
- Guarantee: `offRampHandler` and `offRampPolicy` are read from the chain at the
  time of the call. The state `unread` means that the chain read failed.

Served only on `polygon-amoy`.




## OpenAPI

````yaml /api/openapi.yaml get /api/monerium/status/{aa}
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/monerium/status/{aa}:
    get:
      tags:
        - Bank payouts
      summary: Get Monerium link status
      description: >
        Returns where the Monerium connection of a Safe stands, and the off-ramp
        setup of the

        Safe on chain: whether its fallback handler is the off-ramp handler, and
        the policy

        that it holds there. The IBAN is masked.


        - Who may call: anyone, about any Safe.

        - Before: nothing.

        - Guarantee: `offRampHandler` and `offRampPolicy` are read from the
        chain at the
          time of the call. The state `unread` means that the chain read failed.

        Served only on `polygon-amoy`.
      operationId: getMoneriumStatus
      parameters:
        - $ref: '#/components/parameters/AccountPath'
      responses:
        '200':
          description: The link state and the off-ramp setup.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MoneriumLinkStatusResponse'
              examples:
                notConnected:
                  value:
                    connected: false
                    addressLinkProofValid: null
                    offRampHandler:
                      state: not_installed
                      current: '0x0000000000000000000000000000000000000000'
                    offRampPolicy:
                      state: none
                connected:
                  value:
                    connected: true
                    addressLinkProofValid: true
                    offRampHandler:
                      state: installed
                    addressLinkState: linked
                    maskedIban: DE…3000
                    offRampPolicy:
                      state: set
                      authority: '0x0a1b2c3d4e5f60718293a4b5c6d7e8f901234567'
                      perOrderCapMinor: '50000'
                      expiry: 1827841002
                      ibanAllowlistLen: 1
        '400':
          $ref: '#/components/responses/InvalidPathAddress'
        '500':
          description: The Anafi API could not read its records.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MoneriumErrorResponse'
              example:
                error: storage error
      servers:
        - url: https://api.polygon-amoy.ana.fi
          description: Polygon Amoy testnet (Monerium sandbox)
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:
    MoneriumLinkStatusResponse:
      type: object
      required:
        - connected
        - addressLinkProofValid
        - offRampHandler
        - offRampPolicy
      properties:
        connected:
          type: boolean
          description: Whether a Monerium account is connected to the Safe.
        addressLinkProofValid:
          description: >-
            Whether the Safe still accepts the stored address-link signature.
            `null` when there is no connection or the Safe could not be asked.
          type:
            - boolean
            - 'null'
        offRampHandler:
          $ref: '#/components/schemas/OffRampHandlerState'
        addressLinkState:
          $ref: '#/components/schemas/AddressLinkState'
          description: >-
            The state of the address at Monerium. The key is absent when not
            connected.
        maskedIban:
          type: string
          description: >-
            The IBAN that mints to the Safe, with all except the country code
            and the last 4 characters hidden, for example `DE…3000`. The key is
            absent until Monerium issues the IBAN.
        lastErrorReason:
          $ref: '#/components/schemas/MoneriumLinkErrorReason'
          description: >-
            Why the last step of the connection failed. The key is absent when
            no step failed.
        offRampPolicy:
          $ref: '#/components/schemas/OffRampPolicyState'
    MoneriumErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A sentence that says why the route refused.
    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'
    OffRampHandlerState:
      description: Where the fallback handler of the Safe points, tagged by `state`.
      oneOf:
        - type: object
          title: installed
          description: The fallback handler is the off-ramp handler. Orders can validate.
          required:
            - state
          properties:
            state:
              type: string
              const: installed
        - type: object
          title: not_installed
          description: >-
            The fallback handler is another contract or none, and the Safe holds
            no off-ramp policy. The setup was never done.
          required:
            - state
            - current
          properties:
            state:
              type: string
              const: not_installed
            current:
              $ref: '#/components/schemas/Address'
              description: The current handler, or the zero address.
        - type: object
          title: replaced
          description: >-
            The Safe holds an off-ramp policy, but its fallback handler points
            elsewhere now. No order validates until the off-ramp handler is
            installed again.
          required:
            - state
            - current
          properties:
            state:
              type: string
              const: replaced
            current:
              $ref: '#/components/schemas/Address'
              description: The current handler, or the zero address.
        - type: object
          title: unread
          description: The chain could not be read. Try again later.
          required:
            - state
          properties:
            state:
              type: string
              const: unread
    AddressLinkState:
      type: string
      oneOf:
        - const: unlinked
          description: >-
            The Monerium account is connected, but Monerium has not accepted the
            Safe address yet.
        - const: linked
          description: Monerium accepted the Safe address. Orders can go out.
        - const: pending_verification
          description: Monerium checks the address. Orders wait until it finishes.
    MoneriumLinkErrorReason:
      type: string
      oneOf:
        - const: address_link_refused
          description: Monerium refused the Safe address. Connect again.
        - const: token_refresh_refused
          description: Monerium refused to renew the access. Connect again.
    OffRampPolicyState:
      description: The off-ramp policy of the Safe on the handler, tagged by `state`.
      oneOf:
        - type: object
          title: set
          description: The Safe accepts orders signed by the engine on these terms.
          required:
            - state
            - authority
            - perOrderCapMinor
            - expiry
            - ibanAllowlistLen
          properties:
            state:
              type: string
              const: set
            authority:
              $ref: '#/components/schemas/Address'
              description: The registry whose engine key can sign an order.
            perOrderCapMinor:
              $ref: '#/components/schemas/DecimalInteger'
              description: The maximum order amount in minor currency units (cents).
            expiry:
              $ref: '#/components/schemas/UnixSeconds'
              description: When the policy expires.
            ibanAllowlistLen:
              type: integer
              minimum: 0
              description: The count of allowed IBANs. 0 means any IBAN.
        - type: object
          title: none
          description: The Safe holds no policy.
          required:
            - state
          properties:
            state:
              type: string
              const: none
        - type: object
          title: unread
          description: The chain could not be read. Try again later.
          required:
            - state
          properties:
            state:
              type: string
              const: unread
    PlainTextError:
      type: string
      description: >-
        A short English sentence. Show it or log it. Do not parse it; branch on
        the status code.
    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'
    UnixSeconds:
      type: integer
      description: Seconds since 1970-01-01T00:00:00Z.
      examples:
        - 1796305002
  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.