Skip to content

curl ​

Send a bundle using cURL from the command line.

Basic Request ​

bash
curl -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sendBundle",
    "params": [
      [
        "BASE64_TRANSACTION_1",
        "BASE64_TRANSACTION_2"
      ],
      {
        "encoding": "base64",
        "skipPreflight": true
      }
    ]
  }'

Response ​

Success ​

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "bundle_id": "abc123def456...",
    "signatures": [
      "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9Co...",
      "3XHA7ofPAf3FaLUAY3kT52c9dwek2Gbi..."
    ]
  }
}

Error ​

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32000,
    "message": "Bundle must include a tip to a registered wallet"
  }
}

With Variables ​

bash
API_KEY="YOUR_API_KEY"
ENDPOINT="https://fra.blocksprint.io/bundle"
TX1="BASE64_TRANSACTION_1"
TX2="BASE64_TRANSACTION_2"

curl -X POST "${ENDPOINT}" \
  -H 'Content-Type: application/json' \
  -H "X-API-Key: ${API_KEY}" \
  -d "{
    \"jsonrpc\": \"2.0\",
    \"id\": 1,
    \"method\": \"sendBundle\",
    \"params\": [
      [\"${TX1}\", \"${TX2}\"],
      {
        \"encoding\": \"base64\",
        \"skipPreflight\": true
      }
    ]
  }"

From File ​

Save your bundle to a file (e.g., bundle.json):

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sendBundle",
  "params": [
    [
      "BASE64_TRANSACTION_1",
      "BASE64_TRANSACTION_2",
      "BASE64_TRANSACTION_3"
    ],
    {
      "encoding": "base64",
      "skipPreflight": true
    }
  ]
}

Then send it with curl:

bash
curl -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d @bundle.json

Parse Response with jq ​

bash
# Get bundle ID
curl -s -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{...}' | jq -r '.result.bundle_id'

# Get all signatures
curl -s -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{...}' | jq -r '.result.signatures[]'

# Check for errors
curl -s -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{...}' | jq '.error // .result'

Example: 3-Transaction Bundle ​

bash
curl -X POST 'https://fra.blocksprint.io/bundle' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: YOUR_API_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sendBundle",
    "params": [
      [
        "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...",
        "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg...",
        "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAw..."
      ],
      {
        "encoding": "base64",
        "skipPreflight": true
      }
    ]
  }'