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

# Gasless

Execute gasless Hashed Time Lock Contract (HTLC) actions on an existing swap order, such as initiate, redeem, refund, and instant refund.

## Initiate

Use `action=initiate` to initiate the swap on the source chain. The [create order endpoint](./create-order) returns chain-specific signing data — sign it and submit here. The relayer broadcasts the transaction on the user's behalf, making the process gasless.

<Tabs>
  <Tab title="EVM">
    The [create order](./create-order) response includes `typed_data` with EIP-712 domain and message fields. Sign this using `eth_signTypedData_v4`.

    Supported on all EVM chains (Ethereum, Arbitrum, Base, etc.) and Tron.

    <ParamField body="signature" type="string" required>
      An ECDSA signature generated by the initiator over an EIP-712 typed data message containing the redeemer address, timelock, amount, and secret hash from the [create order endpoint](./create-order).
    </ParamField>

    ```json Example theme={null}
    {
      "signature": "0xEIP712SignatureHex..."
    }
    ```
  </Tab>

  <Tab title="Solana">
    The [create order](./create-order) response includes `versioned_tx_gasless` — a base64-encoded versioned transaction. Deserialize it, sign it with the user's wallet, then serialize the signed transaction back to base64.

    <ParamField body="order_id" type="string" required>
      The unique identifier for the order.
    </ParamField>

    <ParamField body="serialized_tx" type="string" required>
      Base64-encoded signed Solana versioned transaction.
    </ParamField>

    ```json Example theme={null}
    {
      "order_id": "<order_id>",
      "serialized_tx": "base64EncodedSignedTransaction..."
    }
    ```
  </Tab>

  <Tab title="Starknet">
    The [create order](./create-order) response includes `typed_data` with Starknet domain and message fields. Sign this typed data and submit the signature felt values as a comma-separated string.

    <ParamField body="signature" type="string" required>
      A Starknet signature over the typed data message containing the HTLC initiation parameters. Felt values should be comma-separated.
    </ParamField>

    ```json Example theme={null}
    {
      "signature": "0xfelt1,0xfelt2"
    }
    ```
  </Tab>
</Tabs>

<Note>
  Want to enable gasless initiations for your users? Reach out to us on [Townhall](https://discord.gg/B7RczEFuJ5) and we'll help you get set up.
</Note>


## OpenAPI

````yaml PATCH /orders/{order}
openapi: 3.1.0
info:
  title: Garden API
  version: 2.0.0
  description: API specification for various endpoints.
servers:
  - url: https://{environment}.garden.finance/v2
    variables:
      environment:
        default: api
        enum:
          - api
          - testnet.api
security:
  - garden-app-id: []
paths:
  /orders/{order}:
    patch:
      tags:
        - Swaps
      summary: Update swap by doing an action.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: action
          required: true
          description: The HTLC action to execute on the order.
          schema:
            type: string
            enum:
              - initiate
              - redeem
              - refund
              - instant-refund
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/InitiateActionRequest'
                - $ref: '#/components/schemas/RedeemActionRequest'
                - $ref: '#/components/schemas/RefundActionRequest'
                - $ref: '#/components/schemas/InstantRefundActionRequest'
      responses:
        '200':
          description: Executed action successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionResponse'
components:
  schemas:
    InitiateActionRequest:
      type: object
      title: Initiate
      description: >-
        Initiate the swap on the source chain. The request body is
        chain-specific — refer to the **Initiate** section above for EVM,
        Solana, and Starknet request formats.
    RedeemActionRequest:
      type: object
      title: Redeem
      properties:
        secret:
          type: string
      required:
        - secret
    RefundActionRequest:
      type: object
      title: Refund
    InstantRefundActionRequest:
      type: object
      title: Instant Refund
      properties:
        signatures:
          type: array
          description: >-
            A Schnorr signature generated by the initiator over the instant
            refund hash obtained from the [instant refund hash
            endpoint](./get-instant-refund-hash). This signature represents the
            initiator’s partial spend authorization for the Taproot script
            controlling the initiator's UTXO. Submitting this signature allows
            the solver to later provide its own Schnorr signature to fully
            satisfy the Taproot instant refund leaf and broadcast the refund
            transaction instantly, without requiring further initiator
            interaction.
          items:
            type: string
          example:
            - '0x1234567890123456789012345678901234567890123456789012345678901234'
      required:
        - signatures
    ActionResponse:
      allOf:
        - $ref: '#/components/schemas/Response'
        - type: object
          required:
            - result
          properties:
            result:
              type: string
    Response:
      type: object
      properties:
        status:
          type: string
          enum:
            - Ok
            - Error
        error:
          type: string
          nullable: true
  securitySchemes:
    garden-app-id:
      type: apiKey
      name: garden-app-id
      in: header
      description: >-
        If you do not yet have an app ID, please follow these
        [steps](/api-reference/setup).

````