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

# Prepare account for registration

> Derive the Rhinestone smart account for (ownerAddress, sessionOwnerAddress), compare against the existing registration and target, and return either the Solana deposit address (if no re-registration is needed) or the unsigned session details and factory parameters the client must sign before calling /register.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /setup-account
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Cross-chain deposit processing service with automatic token bridging and gas
    sponsorship
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /setup-account:
    post:
      tags:
        - Accounts
      summary: Prepare account for registration
      description: >-
        Derive the Rhinestone smart account for (ownerAddress,
        sessionOwnerAddress), compare against the existing registration and
        target, and return either the Solana deposit address (if no
        re-registration is needed) or the unsigned session details and factory
        parameters the client must sign before calling /register.
      parameters:
        - schema:
            type: string
            description: API key for authentication
            example: your-api-key
          required: true
          description: API key for authentication
          name: x-api-key
          in: header
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}\.[a-z0-9]+$
            description: >-
              API version identifier (e.g. "2026-04.amazon"). Optional today,
              will become required in a future release.
            example: 2026-04.amazon
          required: false
          description: >-
            API version identifier (e.g. "2026-04.amazon"). Optional today, will
            become required in a future release.
          name: x-api-version
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetupAccountRequestBody'
      responses:
        '200':
          description: Account setup result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupAccountResponse'
        '400':
          description: Invalid request or unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to derive account or build sessions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SetupAccountRequestBody:
      type: object
      properties:
        ownerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        sessionOwnerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        targetToken:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        targetChain:
          anyOf:
            - type: integer
              minimum: 0
              exclusiveMinimum: true
            - type: string
              pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: >-
            Chain identifier as a positive integer or CAIP-2 string (e.g.
            "eip155:8453")
          example: eip155:8453
        recipient:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        postBridgeActions:
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  type:
                    type: string
                    enum:
                      - orderbook-swap
                  contract:
                    type: string
                    pattern: ^0x[a-fA-F0-9]{40}$
                    description: Ethereum address (0x followed by 40 hex characters)
                    example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
                  outputToken:
                    type: string
                    pattern: ^0x[a-fA-F0-9]{40}$
                    description: Ethereum address (0x followed by 40 hex characters)
                    example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
                required:
                  - type
                  - contract
                  - outputToken
        outputTokenRules:
          type: array
          items:
            $ref: '#/components/schemas/OutputTokenRule'
        rejectUnmapped:
          type: boolean
        signerAddress:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        sessionChainIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
        forceRegister:
          type: boolean
      required:
        - ownerAddress
        - sessionOwnerAddress
        - targetToken
        - targetChain
    SetupAccountResponse:
      type: object
      properties:
        smartAccount:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
          description: Ethereum address (0x followed by 40 hex characters)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
        isRegistered:
          type: boolean
        targetChain:
          type: string
        targetToken:
          type: string
        needsRegistration:
          type: boolean
        solanaDepositAddress:
          type: string
        accountParams:
          type: object
          properties:
            factory:
              type: string
              pattern: ^0x[a-fA-F0-9]{40}$
              description: Ethereum address (0x followed by 40 hex characters)
              example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
            factoryData:
              type: string
              pattern: ^0x[a-fA-F0-9]+$
              description: Hex-encoded string (0x followed by hex characters)
              example: '0x1234abcd'
          required:
            - factory
            - factoryData
        sessionDetailsUnsigned:
          type: object
          properties:
            hashesAndChainIds:
              type: array
              items:
                type: object
                properties:
                  chainId:
                    type: string
                  sessionDigest:
                    type: string
                    pattern: ^0x[a-fA-F0-9]+$
                    description: Hex-encoded string (0x followed by hex characters)
                    example: '0x1234abcd'
                required:
                  - chainId
                  - sessionDigest
            data:
              type: object
              additionalProperties:
                nullable: true
          required:
            - hashesAndChainIds
            - data
      required:
        - smartAccount
        - isRegistered
        - needsRegistration
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error
    OutputTokenRule:
      type: object
      properties:
        match:
          $ref: '#/components/schemas/OutputTokenRuleMatch'
        outputToken:
          type: string
          minLength: 1
      required:
        - match
        - outputToken
      description: >-
        Destination token routing rule. Matches deposits by source token
        attributes and selects the target-chain output token.
      example:
        match:
          symbol: USDC
        outputToken: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
    OutputTokenRuleMatch:
      type: object
      properties:
        chain:
          type: string
          pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: CAIP-2 chain identifier (e.g. "eip155:8453")
          example: eip155:8453
        token:
          type: string
          minLength: 1
        symbol:
          type: string
      description: >-
        Source-token match criteria. Rules may match by source chain, source
        token address, source symbol, or a combination.
      example:
        chain: eip155:10
        symbol: USDC

````