POSTGet libraries

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/getLibraries
CU30

Returns smart contract library code by hash. Some contracts reference shared libraries instead of including all code directly. When a library reference appears in contract code, this endpoint fetches the actual library implementation.

Request Body
librariesstring[]

Array of library cell hashes to retrieve. Each hash is a 256-bit value in hex (64 chars) or base64 (44 chars) format.

Responses
okbooleanrequired

Returns true if the request succeeded; otherwise false. See the error field for details.

@typestring (enum)required

TonLib type identifier for library lookup results. Refer to the TonLib type reference for a full list.

resultobject[]required

Array of library entries. Each entry contains a hash (base64 or hex) identifying the library and a data field with the library code in BoC format (base64).

@typestring (enum)required

TonLib type identifier for shared library cell entries. Refer to the TonLib type reference for a full list.

hashstringrequired

Library cell hash.

datastringrequired

Library cell code in BoC format, base64 encoded.

@extrastring

Optional request ID that can be passed in the request and received back in the response. Useful for matching async responses.

X-API-KEY
Request
cURL
curl -X POST "https://ton-mainnet.nodit.io/api/v2/getLibraries" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "libraries": [
      "iUaPAseOVwgC45l5yFFvw43wfqdqSDV+BTbyuns+43s="
    ]
  }'
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "smc.libraryResult",
    "result": []
  },
  "@extra": "1795684553:15:12.644"
}