# Astralane

Use these routes when you want Astralane's JSON-RPC API. Send the same JSON-RPC body shown in Astralane's docs.

Reference:

* <https://astralane.gitbook.io/docs/low-latency/submit-transactions>

## Routes

| Route                        | Use for                             |
| ---------------------------- | ----------------------------------- |
| `POST /astralane`            | Generic Astralane JSON-RPC requests |
| `POST /astrln-submit-bundle` | `sendBundle`                        |
| `POST /astrln-submit-batch`  | `sendBatch`                         |
| `POST /astrln-submit-ideal`  | `sendIdeal`                         |
| `GET /astrln-get-nonce`      | `getNonce`                          |
| `POST /astrln-get-nonce`     | `getNonce`                          |

Supported query params: `api-key`, `mev-protect`, `swqos-only`.

If your Bifrost deployment already has Astralane credentials configured, you can usually omit `api-key`.

`sendPaladin` is not supported.

## Tip Addresses

Current Astralane tip addresses recognized by this Bifrost deployment:

* `astrazznxsGUhWShqgNtAdfrzP2G83DzcWVJDxwV9bF`
* `astra4uejePWneqNaJKuFFA8oonqCE1sqF6b45kDMZm`
* `astra9xWY93QyfG6yM8zwsKsRodscjQ2uU2HKNL5prk`
* `astraRVUuTHjpwEVvNBeQEgwYx9w9CFyfxjYoobCZhL`
* `astraEJ2fEj8Xmy6KLG7B3VfbKfsHXhHrNdCQx7iGJK`
* `astraubkDw81n4LuutzSQ8uzHCv4BhPVhfvTcYv8SKC`
* `astraZW5GLFefxNPAatceHhYjfA1ciq9gvfEg2S47xk`
* `astrawVNP4xDBKT7rAdxrLYiTSTdqtUr63fSMduivXK`

Use one of these when Astralane requires a valid tip in the transaction.

## sendTransaction

Use `POST /astralane` with the official Astralane JSON-RPC body:

{% code title="sendTransaction JSON-RPC" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendTransaction",
  "params": [
    "<base64-transaction>",
    {
      "encoding": "base64",
      "skipPreflight": true
    },
    {
      "mevProtect": true
    }
  ]
}
```

{% endcode %}

Common options:

* Query params: `api-key`, `mev-protect`, `swqos-only`
* `params[1].encoding`: recommended `base64`
* `params[1].skipPreflight`: recommended `true`
* `params[2].mevProtect`: optional

## sendBundle

Use `POST /astrln-submit-bundle` or `POST /astralane` with `method: "sendBundle"`:

{% code title="sendBundle JSON-RPC" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendBundle",
  "params": [
    [
      "<base64-transaction-1>",
      "<base64-transaction-2>"
    ],
    {
      "encoding": "base64",
      "mevProtect": true,
      "revertProtection": false
    }
  ]
}
```

{% endcode %}

* Maximum 4 transactions
* `revertProtection` is optional

## sendBatch

Use `POST /astrln-submit-batch` or `POST /astralane` with `method: "sendBatch"`:

{% code title="sendBatch JSON-RPC" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendBatch",
  "params": [
    [
      "<base64-transaction-1>",
      "<base64-transaction-2>"
    ],
    {
      "mevProtect": true
    }
  ]
}
```

{% endcode %}

* Maximum 25 transactions
* Astralane documents `sendBatch` as available on request
* Requirement: every transaction must include a valid Astralane tip

## sendIdeal

Use `POST /astrln-submit-ideal` or `POST /astralane` with `method: "sendIdeal"`:

{% code title="sendIdeal JSON-RPC" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendIdeal",
  "params": [
    [
      "<base64-high-tip-low-fee-transaction>",
      "<base64-low-tip-high-fee-transaction>"
    ]
  ]
}
```

{% endcode %}

`sendIdeal` expects exactly 2 transactions.

## getNonce

Use `GET /astrln-get-nonce` or `POST /astrln-get-nonce` when you need Astralane's `getNonce` flow for `sendIdeal`.

Example JSON-RPC call forwarded upstream:

{% code title="getNonce JSON-RPC" %}

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getNonce",
  "params": [
    "<api-key>"
  ]
}
```

{% endcode %}

Example helper response:

{% code title="getNonce response" %}

```json
{
  "nonce": "<hash>",
  "nonceAccount": "<pubkey>",
  "nonceAuthority": "<pubkey>"
}
```

{% endcode %}
