Program Id To Label RPC Method
The jup_ProgramIdToLabel
method allows you to retrieve the label associated with a given program ID. This can be useful for mapping program IDs to human-readable labels for easier understanding and interaction with the API.
Endpoint: https://solana-mainnet.backpac.xyz/{YOUR_API_KEY}
Method: POST
Request Parameters
The request parameters are included in the params
property of the RPC request body. Below is the interface definition and detailed description of each parameter.
Request Interface: IGetProgramIdToLabelRequest
This request contains a single property, label
, which is the program label you are looking to resolve to a program ID.
Parameter | Type | Required | Description |
---|---|---|---|
label | string | Yes | The label associated with the program ID. |
Example Request
json
{
"method": "jup_ProgramIdToLabel",
"jsonrpc": "2.0",
"id": 1,
"params": {
"label": "swap-program"
}
}
Response Interface: IGetProgramIdToLabelResponse
The response is a dictionary where the key is the program ID and the value is the corresponding label. The program ID is returned as a string, and the label is the human-readable name associated with it.
Parameter | Type | Description |
---|---|---|
[programId] | string | The program ID associated with the given label. |
[programLabel] | string | The human-readable label for the program ID. |
Example Response
json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"swap-program-id-1": "Swap Program",
"swap-program-id-2": "Liquidity Pool Program"
}
}