How to send a transaction

🚀

Hyperstrate accepts serialized, signed transactions. Never send a private key, seed phrase, or unsigned signing request to the transaction endpoint.

Send a Polygon transaction with JSON-RPC

Hyperstrate accepts serialized, signed Polygon transactions through its Ethereum-compatible JSON-RPC endpoint.

Sign transactions locally. Never send Hyperstrate your private key or seed phrase.

Prerequisites

You need:

  • A Hyperstrate API key with submit access
  • A transaction signed for the configured Polygon chain
  • Sufficient credit if billing is enabled

Set your credentials and signed transaction:

export HYPERSTRATE_API_URL="https://app.hyperstrate.xyz/api"
export HYPERSTRATE_API_KEY="ak_your_api_key"
export SIGNED_TRANSACTION_HEX="0x02f8..."

1. Confirm the chain ID

Before signing, verify the configured chain:

curl --fail-with-body \
  --request POST \
  --url "$HYPERSTRATE_API_URL/polygon/rpc" \
  --header "Authorization: Bearer $HYPERSTRATE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "method": "eth_chainId",
    "params": [],
    "id": 1
  }'

For Polygon PoS, the response is 0x89, which is chain ID 137.

2. Submit the signed transaction

curl --fail-with-body \
  --request POST \
  --url "$HYPERSTRATE_API_URL/polygon/rpc" \
  --header "Authorization: Bearer $HYPERSTRATE_API_KEY" \
  --header "Content-Type: application/json" \
  --data "{
    \"jsonrpc\": \"2.0\",
    \"method\": \"eth_sendRawTransaction\",
    \"params\": [\"$SIGNED_TRANSACTION_HEX\"],
    \"id\": 1
  }"

A successful response returns the Polygon transaction hash:

{
  "jsonrpc": "2.0",
  "result": "0x7e8f...",
  "id": 1
}

Save this hash. It identifies the transaction in later queries.

A successful response means Hyperstrate accepted the transaction. It does not mean the transaction has been included or executed successfully.

3. Check the receipt

export TRANSACTION_HASH="0x7e8f..."

curl --fail-with-body \
  --request POST \
  --url "$HYPERSTRATE_API_URL/polygon/rpc" \
  --header "Authorization: Bearer $HYPERSTRATE_API_KEY" \
  --header "Content-Type: application/json" \
  --data "{
    \"jsonrpc\": \"2.0\",
    \"method\": \"eth_getTransactionReceipt\",
    \"params\": [\"$TRANSACTION_HASH\"],
    \"id\": 2
  }"

The result is null until a receipt becomes available. Once included:

  • status: "0x1" means execution succeeded.
  • status: "0x0" means execution reverted.

Additional transaction details

To retrieve the Hyperstrate transaction ID, delivery state, billing state, or available actions:

curl --fail-with-body \
  --url "$HYPERSTRATE_API_URL/polygon/v1/transactions?reference=$TRANSACTION_HASH" \
  --header "Authorization: Bearer $HYPERSTRATE_API_KEY"

Supported methods

The Hyperstrate endpoint supports:

  • eth_chainId
  • eth_sendRawTransaction
  • eth_getTransactionByHash
  • eth_getTransactionReceipt

It is not a complete Polygon RPC provider. Use a regular Polygon RPC provider for nonce lookup, gas estimation, fee data, block queries, and transaction construction.


Did this page help you?