# API Reference

### Checking for Transaction Sponsorship <a href="#checking-for-transaction-sponsorship" id="checking-for-transaction-sponsorship"></a>

To check whether a swap is sponsorable, first send your unsigned transaction to your RPC endpoint at `https://bsc.blinklabs.xyz/v1/<API_KEY>` with the following POST request

#### pm\_isSponsorable

{% code overflow="wrap" %}

```json
{
    "jsonrpc": "2.0",
    "method": "pm_isSponsorable",
    "params": [
        {
          "to": "<TX_TO_ADDRESS>",
          "from": "<TX_FROM_ADDRESS>",
          "value": "<TX_VALUE_HEX>",
          "data": "TX_DATA_HEX>",
          "gas": "<TX_GAS_LIMIT_HEX>"
        }
    ],
    "id": 1
}
```

{% endcode %}

Example request:

{% code overflow="wrap" %}

```json
{
    "jsonrpc": "2.0",
    "method": "pm_isSponsorable",
    "params": [
        {
          "to": "0xb30eC35F98ff1237EDe720D32aC2da7e52A5f56b",
          "from": "0x1234567890b4fa4756b8db7a52e4150e6c18fc2c",
          "value": "0x2386f26fc10000",
          "data": "0x095ea7b3000000000000000000000000111111125421cA6dc452d289314280a0f8842A650000000000000000000000000000000000000000000000000000000000000000",
          "gas": "0x11170"
        }
    ],
    "id": 0
}
```

{% endcode %}

Example response:

{% code overflow="wrap" %}

```json
{
    "id": 0,
    "result": {
        "sponsorable": true,
        "sponsorName": "Blink",
        "sponsorIcon": "https://framerusercontent.com/images/o61GQaQ3nRGkpdVnUD5P3HhDxx0.png",
        "sponsorWebsite": "https://blinklabs.xyz/"
    },
    "jsonrpc": "2.0"
}
```

{% endcode %}

If the response returns `true`, your transaction is sponsorable.

**Now it's up to you to set the gas price of the transaction to 0**.

You can now submit it even if your simulations fail. Now it's our turn to get the transaction on-chain. Simply submit the signed transaction as you would normally using `eth_sendRawTransaction`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blinklabs.xyz/blink/bnb-smart-chain-bsc/gas-sponsorship/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
