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

# Export Wallet

> Export an encrypted wallet secret for a specific chain. Send `public_key` as a non-empty base64-encoded DER/SPKI P-256 public key. The wallet secret is encrypted with HPKE before it leaves the API. For `POL`, the underlying plaintext is the wallet private key as a `0x`-prefixed hex string. For `SOL`, the underlying plaintext is the wallet keypair encoded as a base58 string. The response returns only the HPKE `ciphertext` and `encapsulated_key` needed for client-side decryption.



## OpenAPI

````yaml /openapi.json post /api/v1/wallet/{chain_id}/{wallet_id}/export
openapi: 3.1.0
info:
  title: Synthesis API
  version: 1.0.0
  description: Unified prediction market API for Polymarket and Kalshi.
servers:
  - url: https://synthesis.trade
security: []
tags:
  - name: Projects
    description: Create and manage project accounts, sessions, and account API keys.
  - name: Accounts
    description: >-
      Authenticate and manage account-level sessions, account API keys, and
      public account preferences.
  - name: Markets
    description: Unified market discovery and analytics across Polymarket and Kalshi.
  - name: Polymarket
    description: Polymarket market data, prices, orderbooks, trades, and holders endpoints.
  - name: Kalshi
    description: Kalshi market data, events, history, leaderboard, and profile endpoints.
  - name: Wallets
    description: Wallet management routes. Each wallet supports multiple chains.
  - name: Polygon
    description: >-
      Polygon wallet routes for balances, orders, minting, redemption,
      withdrawals, and swaps.
  - name: Polygon Copytrades
    description: Polymarket copytrade configuration and management for Polygon wallets.
  - name: Solana
    description: >-
      Solana wallet routes used for Kalshi balances, KYC, orders, redemption,
      and withdrawals.
  - name: News
    description: News endpoints with market and event matching.
  - name: WebSockets
    description: >-
      Real-time streaming endpoints for orderbooks, trades, balances, and live
      data feeds.
paths:
  /api/v1/wallet/{chain_id}/{wallet_id}/export:
    post:
      tags:
        - Wallets
      summary: Export Wallet
      description: >-
        Export an encrypted wallet secret for a specific chain. Send
        `public_key` as a non-empty base64-encoded DER/SPKI P-256 public key.
        The wallet secret is encrypted with HPKE before it leaves the API. For
        `POL`, the underlying plaintext is the wallet private key as a
        `0x`-prefixed hex string. For `SOL`, the underlying plaintext is the
        wallet keypair encoded as a base58 string. The response returns only the
        HPKE `ciphertext` and `encapsulated_key` needed for client-side
        decryption.
      operationId: export-wallet
      parameters:
        - name: chain_id
          in: path
          required: true
          description: '`POL` or `SOL`.'
          schema:
            type: string
        - name: wallet_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - public_key
              properties:
                public_key:
                  type: string
                  description: >-
                    Recipient HPKE public key as a base64-encoded DER/SPKI P-256
                    public key. Empty strings and non-base64 payloads are
                    rejected.
                  example: MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE...
      responses:
        '200':
          description: Wallet exported
          content:
            application/json:
              example:
                success: true
                response:
                  ciphertext: base64-encrypted-wallet-secret
                  encapsulated_key: base64-hpke-encapsulated-key
        '400':
          description: Invalid request
          content:
            application/json:
              example:
                success: false
                response: Invalid public key format
        '404':
          description: Wallet not found
          content:
            application/json:
              example:
                success: false
                response: Wallet not found
      security:
        - AccountApiKey: []
        - AccountSession: []
components:
  securitySchemes:
    AccountApiKey:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Account secret API key.
    AccountSession:
      type: http
      scheme: bearer
      description: Account session token.

````