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

# Build the unsigned close transactions for a resolved plan.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/{network}/close/transactions
openapi: 3.0.0
info:
  title: LumenWipe API
  description: Programmatic close-out of Stellar accounts.
  version: 0.1.0
  contact: {}
servers:
  - url: https://api.lumenwipe.com
security: []
tags:
  - name: close
    description: Build and submit an account close-out
  - name: account
    description: Read account state and conversion paths
  - name: mediator
    description: Exchange-destination forwarding
  - name: health
    description: Service health
  - name: service
    description: Service index
  - name: admin
    description: Operator-only self-serve API key management
paths:
  /v1/{network}/close/transactions:
    post:
      tags:
        - close
      summary: Build the unsigned close transactions for a resolved plan.
      operationId: CloseController_transactions
      parameters:
        - name: network
          required: true
          in: path
          schema:
            enum:
              - testnet
              - mainnet
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CloseTransactionsRequestDto'
      responses:
        '200':
          description: Unsigned transaction envelopes ready for client signing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionsResponseDto'
        '400':
          description: Invalid network, source, destination, or JSON body.
        '401':
          description: Missing or invalid API key.
        '404':
          description: Source account not found.
        '409':
          description: A conversion route drifted; re-plan and retry.
        '422':
          description: >-
            Unprocessable: unresolved asset dispositions, a required exchange
            memo is missing, the destination is not a recognized exchange
            address and has not been acknowledged
            (destination_not_acknowledged), a transfer disposition carries no
            usable destination (transfer_destination_missing), or a transfer
            destination cannot receive its asset
            (transfer_destination_unusable).
        '429':
          description: Rate limit exceeded for this key.
        '503':
          description: The exchange (mediator) flow is not configured on this server.
      security:
        - api-key: []
components:
  schemas:
    CloseTransactionsRequestDto:
      type: object
      properties:
        source:
          type: string
          description: Account to close (G...).
          example: GABC...XYZ
        destination:
          type: string
          description: Destination for the recovered XLM (G...).
          example: GDEF...UVW
        decisions:
          type: array
          description: >-
            Resolved decision answers; every balance-bearing asset must have a
            disposition.
          items:
            type: object
        memo:
          type: string
          description: >-
            Deposit memo value for exchange destinations that require one. The
            memo type is taken from the exchange registry, not the client.
          example: '1234567890'
      required:
        - source
        - destination
    TransactionsResponseDto:
      type: object
      properties:
        planHash:
          type: string
          description: >-
            Deterministic hash of this plan's content - unchanged inputs yield
            the same hash.
        status:
          type: string
          enum:
            - ready
            - needs_decisions
            - blocked
            - complete
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/CloseTransactionDto'
        remaining:
          $ref: '#/components/schemas/RemainingDto'
      required:
        - planHash
        - status
        - transactions
        - remaining
    CloseTransactionDto:
      type: object
      properties:
        id:
          type: string
        order:
          type: number
          description: Position among the transactions in this round, from 0.
        dependsOn:
          description: >-
            The ids of transactions in this round that must be submitted and
            confirmed before this one.
          type: array
          items:
            type: string
        xdr:
          type: string
          description: Unsigned transaction envelope, base64 XDR.
        networkPassphrase:
          type: string
        sourceSequence:
          type: string
          description: >-
            The source account's sequence number this transaction was built
            against.
        validUntilLedger:
          type: number
          description: The ledger this transaction's time bound expires at.
        covers:
          type: array
          items:
            type: string
            enum:
              - NORMALIZE_SIGNERS
              - REVOKE_SPONSORSHIP
              - REMOVE_DATA_ENTRIES
              - CANCEL_OFFERS
              - ADD_TRUSTLINE_FOR_CLAIM
              - CLAIM_BALANCES
              - EXIT_POSITIONS
              - HANDLE_ASSETS
              - REMOVE_TRUSTLINES
              - CLOSE_ACCOUNT
              - MERGE
        needsSponsoredFee:
          type: boolean
          description: >-
            True when the account cannot pay this transaction's own fee without
            dropping below its reserve - the client must route the signed
            envelope through POST /:network/fee-bump/sponsor before submitting
            it. Absent (not false) otherwise.
          enum:
            - true
        intent:
          $ref: '#/components/schemas/TxIntentDto'
      required:
        - id
        - order
        - dependsOn
        - xdr
        - networkPassphrase
        - sourceSequence
        - validUntilLedger
        - covers
        - intent
    RemainingDto:
      type: object
      properties:
        steps:
          type: number
          description: Approximate number of build rounds still remaining.
        requiresAnotherCall:
          type: boolean
          description: >-
            True when more transactions follow: submit these, wait for
            confirmation, then request transactions again.
      required:
        - steps
        - requiresAnotherCall
    TxIntentDto:
      type: object
      properties:
        summary:
          type: string
          description: Human-readable summary of what this transaction does.
        source:
          type: string
          description: The account this transaction acts as (G...).
        fee:
          type: string
          description: Transaction fee, in stroops.
        memo:
          type: string
          nullable: true
        memoType:
          type: string
          enum:
            - text
            - id
            - hash
          nullable: true
        guarantees:
          $ref: '#/components/schemas/TxGuaranteesDto'
        operations:
          type: array
          description: >-
            Every operation this transaction contains, decoded to one of the 11
            known shapes.
          items:
            oneOf:
              - $ref: '#/components/schemas/PathPaymentStrictSendOpDto'
              - $ref: '#/components/schemas/PaymentOpDto'
              - $ref: '#/components/schemas/ChangeTrustOpDto'
              - $ref: '#/components/schemas/AccountMergeOpDto'
              - $ref: '#/components/schemas/ManageSellOfferOpDto'
              - $ref: '#/components/schemas/ManageDataOpDto'
              - $ref: '#/components/schemas/SetOptionsOpDto'
              - $ref: '#/components/schemas/ClaimClaimableBalanceOpDto'
              - $ref: '#/components/schemas/RevokeSponsorshipOpDto'
              - $ref: '#/components/schemas/InvokeHostFunctionOpDto'
              - $ref: '#/components/schemas/UnknownOpDto'
            discriminator:
              propertyName: type
              mapping:
                path_payment_strict_send: '#/components/schemas/PathPaymentStrictSendOpDto'
                payment: '#/components/schemas/PaymentOpDto'
                change_trust: '#/components/schemas/ChangeTrustOpDto'
                account_merge: '#/components/schemas/AccountMergeOpDto'
                manage_sell_offer: '#/components/schemas/ManageSellOfferOpDto'
                manage_data: '#/components/schemas/ManageDataOpDto'
                set_options: '#/components/schemas/SetOptionsOpDto'
                claim_claimable_balance: '#/components/schemas/ClaimClaimableBalanceOpDto'
                revoke_sponsorship: '#/components/schemas/RevokeSponsorshipOpDto'
                invoke_host_function: '#/components/schemas/InvokeHostFunctionOpDto'
                unknown: '#/components/schemas/UnknownOpDto'
      required:
        - summary
        - source
        - fee
        - memo
        - memoType
        - guarantees
        - operations
    TxGuaranteesDto:
      type: object
      properties:
        mergeDestination:
          type: string
          description: >-
            The only address this transaction may merge into, or null if it
            merges nothing.
          nullable: true
        paymentsOnlyTo:
          description: >-
            Every address this transaction pays to - a payment op to anywhere
            else fails verification.
          type: array
          items:
            type: string
        minXlmFromConversions:
          type: string
          description: >-
            The least XLM any conversion in this transaction is allowed to
            deliver, or null if none.
          nullable: true
      required:
        - mergeDestination
        - paymentsOnlyTo
        - minXlmFromConversions
    PathPaymentStrictSendOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - path_payment_strict_send
        source:
          type: string
        sendAsset:
          type: string
        sendAmount:
          type: string
        destination:
          type: string
        destAsset:
          type: string
        destMin:
          type: string
        path:
          type: array
          items:
            type: string
      required:
        - type
        - source
        - sendAsset
        - sendAmount
        - destination
        - destAsset
        - destMin
        - path
    PaymentOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - payment
        source:
          type: string
        destination:
          type: string
        asset:
          type: string
          description: '"CODE:ISSUER" or "native".'
        amount:
          type: string
      required:
        - type
        - source
        - destination
        - asset
        - amount
    ChangeTrustOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - change_trust
        source:
          type: string
        asset:
          type: string
        limit:
          type: string
          description: '"0" removes the trustline.'
      required:
        - type
        - source
        - asset
        - limit
    AccountMergeOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - account_merge
        source:
          type: string
        destination:
          type: string
      required:
        - type
        - source
        - destination
    ManageSellOfferOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - manage_sell_offer
        source:
          type: string
        offerId:
          type: string
          description: '"0" cancels the offer.'
        amount:
          type: string
      required:
        - type
        - source
        - offerId
        - amount
    ManageDataOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - manage_data
        source:
          type: string
        name:
          type: string
        value:
          type: string
          description: Base64-encoded, or null to remove the entry.
          nullable: true
      required:
        - type
        - source
        - name
        - value
    SetOptionsOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - set_options
        source:
          type: string
        signer:
          description: >-
            The signer this op touches, decoded to its real type/key. Null when
            the op only touches thresholds/master weight and carries no signer
            field.
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/AccountSignerDto'
        masterWeight:
          type: integer
          nullable: true
        lowThreshold:
          type: integer
          nullable: true
        medThreshold:
          type: integer
          nullable: true
        highThreshold:
          type: integer
          nullable: true
        homeDomain:
          type: string
          description: >-
            The close flow's own normalization never legitimately sets this -
            carried through so verify() can reject an op that does.
          nullable: true
        setFlags:
          type: integer
          nullable: true
        clearFlags:
          type: integer
          nullable: true
        inflationDest:
          type: string
          nullable: true
      required:
        - type
        - source
        - signer
        - masterWeight
        - lowThreshold
        - medThreshold
        - highThreshold
        - homeDomain
        - setFlags
        - clearFlags
        - inflationDest
    ClaimClaimableBalanceOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - claim_claimable_balance
        source:
          type: string
        balanceId:
          type: string
      required:
        - type
        - source
        - balanceId
    RevokeSponsorshipOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - revoke_sponsorship
        source:
          type: string
        entryKind:
          type: string
          enum:
            - account
            - trustline
            - offer
            - data_entry
            - signer
        owner:
          type: string
      required:
        - type
        - source
        - entryKind
        - owner
    InvokeHostFunctionOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - invoke_host_function
        source:
          type: string
        contract:
          type: string
        function:
          type: string
        args:
          description: The decoded arguments rendered for a human, in order.
          type: array
          items:
            type: string
        accountsReferenced:
          description: >-
            Every Stellar account (G...) named anywhere in the arguments or the
            authorization tree. A verifier insists these are all the closing
            account.
          type: array
          items:
            type: string
        contractsReferenced:
          description: >-
            Every contract (C...) named the same way, including authorized
            nested calls.
          type: array
          items:
            type: string
        unsupportedAddressCount:
          type: number
          description: >-
            Address forms that cannot be pinned to anything (muxed, claimable
            balance, LP). A verifier refuses any.
        authorizesBeyondSelf:
          type: boolean
          description: >-
            True when the signature authorizes more than the account's own plain
            contract calls.
        authDepth:
          type: number
          description: How deep the authorization tree nests. A token transfer must be 0.
        subInvocations:
          description: >-
            Every non-root call in the authorization tree, one level down from
            the root call.
          type: array
          items:
            $ref: '#/components/schemas/SubInvocationCallDto'
      required:
        - type
        - source
        - contract
        - function
        - args
        - accountsReferenced
        - contractsReferenced
        - unsupportedAddressCount
        - authorizesBeyondSelf
        - authDepth
        - subInvocations
    UnknownOpDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - unknown
        source:
          type: string
      required:
        - type
        - source
    AccountSignerDto:
      type: object
      properties:
        key:
          type: string
        weight:
          type: number
        type:
          type: string
          enum:
            - ed25519_public_key
            - hash_x
            - preauth_tx
            - ed25519_signed_payload
      required:
        - key
        - weight
        - type
    SubInvocationCallDto:
      type: object
      properties:
        contract:
          type: string
        function:
          type: string
        args:
          description: The decoded arguments rendered for a human, in order.
          type: array
          items:
            type: string
      required:
        - contract
        - function
        - args
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: opaque
      type: http
      description: Integrator API key

````

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