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

# Wrap into Earn Vault

> Creates a list of contract calls (approve + deposit) to wrap an
underlying token into an earn vault and receive vault shares.

<Info>
  The `chain` parameter uses **CAIP-2 format**: `eip155:<chainId>`. For example, `eip155:8453` for Base. See [Supported Chains](/sprinter-credit/overview#supported-chains) for the full list.
</Info>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.sprinter.tech/credit/earn/wrap?owner=0xUSER&amount=1000000&asset=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&chain=eip155:8453&earn=gauntlet-usdc-prime'
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.sprinter.tech/credit/earn/wrap",
      params={
          "owner": "0xUSER",
          "amount": "1000000",
          "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
          "chain": "eip155:8453",
          "earn": "gauntlet-usdc-prime"
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.sprinter.tech/credit/earn/wrap?owner=0xUSER&amount=1000000&asset=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&chain=eip155:8453&earn=gauntlet-usdc-prime"
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	resp, _ := http.Get("https://api.sprinter.tech/credit/earn/wrap?owner=0xUSER&amount=1000000&asset=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&chain=eip155:8453&earn=gauntlet-usdc-prime")
  	defer resp.Body.Close()
  	body, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "amountOut": "999850000000000000000",
    "calls": [
      {
        "chain": "8453",
        "to": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "data": "0x095ea7b3000000000000000000000000abcdef1234567890abcdef1234567890abcdef12",
        "value": "0"
      },
      {
        "chain": "8453",
        "to": "0x1234567890abcdef1234567890abcdef12345678",
        "data": "0x2e1a7d4d000000000000000000000000000000000000000000000000000000000005f5e100",
        "value": "0"
      }
    ],
    "tokenOut": "0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61"
  }
  ```
</ResponseExample>

<Tip>
  **Machine-readable API spec:** [OpenAPI JSON](https://api.sprinter.tech/swagger/doc.json) | [Swagger UI](https://api.sprinter.tech/swagger/index.html)
</Tip>


## OpenAPI

````yaml get /credit/earn/wrap
openapi: 3.0.0
info:
  contact: {}
  title: ''
  version: 0.0.1
servers:
  - url: https://api.sprinter.tech
    description: Production server
security: []
paths:
  /credit/earn/wrap:
    get:
      tags:
        - Credit
      summary: Wrap asset into earn vault
      description: |-
        Creates a list of contract calls (approve + deposit) to wrap an
        underlying token into an earn vault and receive vault shares.
      parameters:
        - example: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'
          description: Account providing the underlying asset
          name: account
          in: query
          required: true
          schema:
            type: string
        - example: '1000000000000000000'
          description: Amount of underlying asset to wrap
          name: amount
          in: query
          required: true
          schema:
            type: string
        - example: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
          description: Underlying token address
          name: token
          in: query
          required: true
          schema:
            type: string
        - example: gauntlet-usdc-prime
          description: Earn strategy identifier
          name: earn
          in: query
          schema:
            type: string
        - example: eip155:8453
          description: Chain CAIP-2 identifier
          name: chain
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/credit.WrapResponse'
        '400':
          description: Invalid input parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
components:
  schemas:
    credit.WrapResponse:
      type: object
      required:
        - amountOut
        - calls
        - tokenOut
      properties:
        amountOut:
          description: Estimated shares minted
          type: string
          example: '1000000000000000000'
        calls:
          description: approve + deposit calls
          type: array
          items:
            $ref: '#/components/schemas/evm.ContractCall'
        tokenOut:
          description: Vault share token received
          type: string
          example: '0xeE8F4eC5672F09119b96Ab6fB59C27E1b7e44b61'
    responses.ErrorResponse:
      type: object
      required:
        - error
      properties:
        debug:
          type: string
        error:
          type: string
    evm.ContractCall:
      type: object
      required:
        - chain
        - data
        - to
        - value
      properties:
        chain:
          type: string
        data:
          type: array
          items:
            type: integer
        to:
          type: array
          items:
            type: integer
        value:
          $ref: '#/components/schemas/types.BigInt'
    types.BigInt:
      type: object

````