Skip to main content
GET
/
api
/
:projectId
/
instructions
Project Instructions
curl --request GET \
  --url https://api.example.com/api/:projectId/instructions
{
  "projectId": "<string>",
  "programName": "<string>",
  "programId": "<string>",
  "instructions": [
    {
      "name": "<string>",
      "docs": [
        {}
      ],
      "accountCount": 123,
      "argCount": 123,
      "accounts": [
        {
          "name": "<string>",
          "isMut": true,
          "isSigner": true,
          "isOptional": true
        }
      ],
      "args": [
        {
          "name": "<string>",
          "type": "<string>",
          "isDefinedType": true,
          "definedTypeName": "<string>",
          "fields": [
            {}
          ]
        }
      ]
    }
  ],
  "instruction": {
    "name": "<string>",
    "docs": [
      {}
    ],
    "accounts": [
      {
        "name": "<string>",
        "isMut": true,
        "isSigner": true,
        "isOptional": true,
        "pda": {
          "seeds": [
            {}
          ]
        }
      }
    ],
    "args": [
      {
        "name": "<string>",
        "type": "<string>",
        "defaultValue": "<any>",
        "isDefinedType": true,
        "definedTypeName": "<string>",
        "fields": [
          {}
        ]
      }
    ]
  }
}

Overview

Instructions are the entry points to your Solana program. These endpoints allow you to list all instructions and retrieve detailed information about specific instructions, including their accounts and arguments.

List All Instructions

GET /api/:projectId/instructions
Retrieve a complete list of all instructions defined in the program’s IDL.

Path Parameters

projectId
string
required
The unique identifier of the project

Response

projectId
string
The project identifier
programName
string
Name of the Anchor program from the IDL
programId
string
Solana program ID (base58 encoded)
instructions
array
List of instruction objects

Example Request

curl -X GET "https://api.orquestra.so/api/proj_abc123/instructions"

Example Response

{
  "projectId": "proj_abc123",
  "programName": "token_swap",
  "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
  "instructions": [
    {
      "name": "initialize",
      "docs": ["Initializes a new token swap pool"],
      "accountCount": 5,
      "argCount": 2,
      "accounts": [
        {
          "name": "pool",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "authority",
          "isMut": false,
          "isSigner": true,
          "isOptional": false
        },
        {
          "name": "tokenA",
          "isMut": false,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "tokenB",
          "isMut": false,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "systemProgram",
          "isMut": false,
          "isSigner": false,
          "isOptional": false
        }
      ],
      "args": [
        {
          "name": "fee",
          "type": "u16",
          "isDefinedType": false,
          "definedTypeName": null,
          "fields": null
        },
        {
          "name": "config",
          "type": "{ minLiquidity: u64, maxSlippage: u16 }",
          "isDefinedType": true,
          "definedTypeName": "PoolConfig",
          "fields": [
            {
              "name": "minLiquidity",
              "type": "u64",
              "isDefinedType": false,
              "nestedFields": null
            },
            {
              "name": "maxSlippage",
              "type": "u16",
              "isDefinedType": false,
              "nestedFields": null
            }
          ]
        }
      ]
    },
    {
      "name": "swap",
      "docs": ["Execute a token swap"],
      "accountCount": 6,
      "argCount": 2,
      "accounts": [
        {
          "name": "pool",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "user",
          "isMut": false,
          "isSigner": true,
          "isOptional": false
        },
        {
          "name": "userTokenFrom",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "userTokenTo",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "poolTokenFrom",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        },
        {
          "name": "poolTokenTo",
          "isMut": true,
          "isSigner": false,
          "isOptional": false
        }
      ],
      "args": [
        {
          "name": "amount",
          "type": "u64",
          "isDefinedType": false,
          "definedTypeName": null,
          "fields": null
        },
        {
          "name": "minAmountOut",
          "type": "u64",
          "isDefinedType": false,
          "definedTypeName": null,
          "fields": null
        }
      ]
    }
  ]
}

Get Instruction Details

GET /api/:projectId/instructions/:name
Retrieve detailed information about a specific instruction, including default values and PDA seed information.

Path Parameters

projectId
string
required
The unique identifier of the project
name
string
required
The instruction name (camelCase as defined in the IDL)

Response

projectId
string
The project identifier
programId
string
Solana program ID
instruction
object
Detailed instruction information

Example Request

curl -X GET "https://api.orquestra.so/api/proj_abc123/instructions/swap"

Example Response

{
  "projectId": "proj_abc123",
  "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
  "instruction": {
    "name": "swap",
    "docs": [
      "Execute a token swap",
      "Swaps tokens from one pool side to another"
    ],
    "accounts": [
      {
        "name": "pool",
        "isMut": true,
        "isSigner": false,
        "isOptional": false,
        "pda": {
          "seeds": [
            {
              "kind": "const",
              "value": [112, 111, 111, 108]
            },
            {
              "kind": "account",
              "path": "tokenA"
            },
            {
              "kind": "account",
              "path": "tokenB"
            }
          ]
        }
      },
      {
        "name": "user",
        "isMut": false,
        "isSigner": true,
        "isOptional": false,
        "pda": null
      },
      {
        "name": "userTokenFrom",
        "isMut": true,
        "isSigner": false,
        "isOptional": false,
        "pda": null
      },
      {
        "name": "userTokenTo",
        "isMut": true,
        "isSigner": false,
        "isOptional": false,
        "pda": null
      },
      {
        "name": "poolTokenFrom",
        "isMut": true,
        "isSigner": false,
        "isOptional": false,
        "pda": null
      },
      {
        "name": "poolTokenTo",
        "isMut": true,
        "isSigner": false,
        "isOptional": false,
        "pda": null
      }
    ],
    "args": [
      {
        "name": "amount",
        "type": "u64",
        "defaultValue": "0",
        "isDefinedType": false,
        "definedTypeName": null,
        "fields": null
      },
      {
        "name": "minAmountOut",
        "type": "u64",
        "defaultValue": "0",
        "isDefinedType": false,
        "definedTypeName": null,
        "fields": null
      }
    ]
  }
}

Error Responses

{
  "error": "Project not found or not public"
}
The specified project ID does not exist, is private, or has no IDL uploaded.
{
  "error": "Instruction \"invalidName\" not found"
}
The specified instruction name does not exist in the program’s IDL.
{
  "error": "Failed to list instructions"
}
The server encountered an error processing the request.

Notes

No authentication required - These endpoints are public for all public projects.
Use the instruction details endpoint to get defaultValue for each argument, which is helpful for testing and building example transactions.
The pda field in account metadata indicates which accounts are Program Derived Addresses and provides the seed definitions needed to derive them.

Build docs developers (and LLMs) love