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

# Fetch the contract ABI

> Fetch the ABI. If not found fetch the ABI from the block explorer



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml post /tokenization/contracts/fetch_abi
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /tokenization/contracts/fetch_abi:
    post:
      tags:
        - Deployed Contracts
      summary: Fetch the contract ABI
      description: Fetch the ABI. If not found fetch the ABI from the block explorer
      operationId: fetchContractAbi
      parameters:
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchAbiRequestDto'
      responses:
        '200':
          description: Contract ABI found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractWithAbiDto'
        '404':
          description: Contract ABI not found
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response: Promise<FireblocksResponse<ContractWithAbiDto>> =
            fireblocks.deployedContracts.fetchContractAbi(deployedContractsApiFetchContractAbiRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<ContractWithAbiDto>> response =
            fireblocks.deployedContracts().fetchContractAbi(fetchAbiRequestDto,
            idempotencyKey);
        - lang: Python
          source: >-
            response =
            fireblocks.deployed_contracts.fetch_contract_abi(fetch_abi_request_dto,
            idempotency_key);
components:
  parameters:
    X-Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: >-
        A unique identifier for the request. If the request is sent multiple
        times with the same idempotency key, the server will return the same
        response as the first request. The idempotency key is valid for 24
        hours.
      required: false
      schema:
        type: string
  schemas:
    FetchAbiRequestDto:
      type: object
      properties:
        baseAssetId:
          type: string
          description: The blockchain base assetId
          example: ETH
        contractAddress:
          type: string
          description: The contract's onchain address
          example: '0xC2c4e1Db41F0bB97996D0eD0542D2170d146FB66'
      required:
        - baseAssetId
        - contractAddress
    ContractWithAbiDto:
      type: object
      properties:
        contractAddress:
          type: string
          description: The address of the contract
          example: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14'
        baseAssetId:
          type: string
          description: The blockchain base assetId
          example: ETH_TEST6
        name:
          type: string
          description: The name of the contract
          example: WETH9
        abi:
          description: The ABI of the contract
          example:
            - inputs:
                - internalType: address
                  name: to
                  type: address
                - internalType: uint256
                  name: amount
                  type: uint256
              stateMutability: nonpayable
              type: function
              name: mint
          type: array
          items:
            $ref: '#/components/schemas/AbiFunction'
        isProxy:
          type: boolean
          description: Whether the contract is a proxy contract
          example: true
        implementation:
          type: string
          description: The implementation contract address
          example: '0xfff9976782d46cc05630d1f6ebab18b2324d6b14'
        isPublic:
          type: boolean
          description: Whether the contract ABI is public
          example: true
      required:
        - contractAddress
        - baseAssetId
        - name
        - abi
        - isPublic
    AbiFunction:
      type: object
      properties:
        name:
          type: string
          example: mint
          description: The name of the contract function as it appears in the ABI
        stateMutability:
          type: string
          example: pure
          enum:
            - pure
            - view
            - nonpayable
            - payable
          description: >-
            The state mutability of the contract function as it appears in the
            ABI
        type:
          type: string
          example: constructor
          description: The type of the function
          enum:
            - constructor
            - function
            - error
            - event
            - receive
            - fallback
        inputs:
          description: The parameters that this function/constructor posses
          items:
            $ref: '#/components/schemas/Parameter'
          type: array
        outputs:
          description: The parameters that this 'read' function returns
          items:
            $ref: '#/components/schemas/Parameter'
          type: array
        description:
          type: string
          description: The documentation of this function (if has any)
      required:
        - type
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    Parameter:
      type: object
      properties:
        name:
          type: string
          example: _name
          description: The name of the parameter as it appears in the ABI
        description:
          type: string
          example: The name of the token
          description: >-
            A description of the parameter, fetched from the devdoc of this
            contract
        internalType:
          type: string
          example: string
          description: The internal type of the parameter as it appears in the ABI
        type:
          type: string
          example: string
          description: The type of the parameter as it appears in the ABI
        components:
          type: array
          items:
            $ref: '#/components/schemas/Parameter'
      required:
        - name
        - type
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs

````