Polygon
Polygon PoS JSON-RPC methods for reading accounts, POL and token balances, blocks, transactions, logs and contract state, estimating gas, calling contracts, broadcasting signed transactions, and querying Bor validators, block authors and checkpoint root hashes.
Authentication
This connector uses Token-based authentication.
info
Set up your connection in the Abstra Console before using it in your workflows.
How to use
Using the Smart Chat
Execute the action "CHOOSE_ONE_ACTION_BELOW" from my connector "YOUR_CONNECTOR_NAME" using the params "PARAMS_HERE".
Using the Web Editor
from abstra.connectors import run_connection_action
result = run_connection_action(
connection_name="your_connection_name",
action_name="your_action_name",
params={
"param1": "value1",
"param2": "value2"
})
Available Actions
This connector provides 56 actions:
| Action | Purpose | Parameters |
|---|---|---|
| web3_client_version | Returns the current client version string of the connected node e.g. Geth/v1.14.0-stable/linux-amd64/go1.22.1. | No parameters |
| web3_sha3 | Returns the Keccak-256 not the standardized SHA3-256 of the given hex data. | data (string) required |
| net_version | Returns the current network ID as a string 137 for Polygon mainnet, 80002 for the Amoy testnet. | No parameters |
| net_listening | Returns true if the client is actively listening for network connections. | No parameters |
| net_peer_count | Returns the number of peers currently connected to the client, as a hex quantity. | No parameters |
| eth_protocol_version | Returns the eth wire protocol version implemented by the client, as a hex quantity. | No parameters |
| eth_syncing | Returns an object with sync status data startingBlock, currentBlock, highestBlock or false if the node is fully synced. | No parameters |
| eth_coinbase | Returns the address the client uses as its coinbase block reward recipient. Not supported on most hosted RPCs. | No parameters |
| eth_chain_id | Returns the chain ID as a hex quantity 0x89 for Polygon mainnet, 0x13882 for the Amoy testnet. | No parameters |
| eth_mining | Returns true if the client is actively producing blocks. Public RPC nodes return false. | No parameters |
| eth_hashrate | Returns the number of hashes per second the node is mining with, as a hex quantity. Polygon PoS has no proof-of-work, so this is 0x0. | No parameters |
| eth_gas_price | Returns the current gas price in wei hex, estimated from recent blocks. | No parameters |
| eth_max_priority_fee_per_gas | Returns a suggested tip cap max priority fee per gas in wei, as a hex quantity EIP-1559. | No parameters |
| eth_fee_history | Returns transaction base fee and priority fee percentiles for the requested block range EIP-1559. | blockCount (string) required newestBlock (string) required rewardPercentiles (array) required |
| eth_accounts | Returns the addresses owned by the client. Hosted RPCs usually return an empty array. | No parameters |
| eth_block_number | Returns the number of the most recent block, as a hex quantity. | No parameters |
| eth_get_balance | Returns the balance of the given address in wei, as a hex quantity, at the given block. | address (string) required block (string) required |
| eth_get_storage_at | Returns the value from the given storage slot of the contract at address. | address (string) required position (string) required block (string) required |
| eth_get_transaction_count | Returns the number of transactions sent from the address nonce, as a hex quantity. | address (string) required block (string) required |
| eth_get_block_transaction_count_by_hash | Returns the number of transactions in the block identified by hash, as a hex quantity. | blockHash (string) required |
| eth_get_block_transaction_count_by_number | Returns the number of transactions in the block identified by number or tag, as a hex quantity. | block (string) required |
| eth_get_uncle_count_by_block_hash | Returns the number of uncles in the block identified by hash. Polygon PoS blocks never have uncles, so this is always 0x0. | blockHash (string) required |
| eth_get_uncle_count_by_block_number | Returns the number of uncles in the block identified by number or tag. Polygon PoS blocks never have uncles, so this is always 0x0. | block (string) required |
| eth_get_code | Returns the deployed bytecode at the given address and block, 0x-prefixed hex 0x for EOAs. | address (string) required block (string) required |
| eth_call | Executes a read-only call against the given block without creating a transaction. Returns the hex-encoded return data. | call: { . from (string) . to (string) . gas (string) . gasPrice (string) . maxFeePerGas (string) . maxPriorityFeePerGas (string) . value (string) . data (string) . input (string) . nonce (string) . accessList (array) . type (string) . chainId (string) } (object) required block (string) required |
| eth_estimate_gas | Returns the estimated gas needed to execute the given transaction call, as a hex quantity. The second argument block is accepted by most nodes. | call: { . from (string) . to (string) . gas (string) . gasPrice (string) . maxFeePerGas (string) . maxPriorityFeePerGas (string) . value (string) . data (string) . input (string) . nonce (string) . accessList (array) . type (string) . chainId (string) } (object) required block (string) |
| eth_create_access_list | Simulates the call and returns an access list the caller can attach to the transaction to reduce gas costs. | call: { . from (string) . to (string) . gas (string) . gasPrice (string) . maxFeePerGas (string) . maxPriorityFeePerGas (string) . value (string) . data (string) . input (string) . nonce (string) . accessList (array) . type (string) . chainId (string) } (object) required block (string) |
| eth_get_block_by_hash | Returns block info for the given hash. When fullTransactions is true, embeds full transaction objects instead of hashes. | blockHash (string) required fullTransactions (boolean) required |
| eth_get_block_by_number | Returns block info for the given number or tag. When fullTransactions is true, embeds full transaction objects instead of hashes. | block (string) required fullTransactions (boolean) required |
| eth_get_transaction_by_hash | Returns the transaction identified by txHash, or null if not found. | txHash (string) required |
| eth_get_transaction_by_block_hash_and_index | Returns the transaction at index inside the block identified by blockHash. | blockHash (string) required index (string) required |
| eth_get_transaction_by_block_number_and_index | Returns the transaction at index inside the block identified by number or tag. | block (string) required index (string) required |
| eth_get_transaction_receipt | Returns the receipt including logs and status for the transaction identified by txHash. | txHash (string) required |
| eth_get_block_receipts | Returns the receipts of every transaction in the given block number, tag or hash. | block (string) required |
| eth_get_uncle_by_block_hash_and_index | Returns the uncle at index inside the block identified by blockHash. Polygon PoS blocks never have uncles, so this is always null. | blockHash (string) required index (string) required |
| eth_get_uncle_by_block_number_and_index | Returns the uncle at index inside the block identified by number or tag. Polygon PoS blocks never have uncles, so this is always null. | block (string) required index (string) required |
| eth_get_logs | Returns log entries matching the given filter object address, topics, block range or blockHash. | filter: { . fromBlock (string) . toBlock (string) . address . topics (array) . blockHash (string) } (object) required |
| eth_get_proof | Returns the Merkle proof of the account and the requested storage slots at the given block EIP-1186. | address (string) required storageKeys (array) required block (string) required |
| eth_send_raw_transaction | Broadcasts a pre-signed transaction RLP-encoded hex to the network. Returns the transaction hash. | signedTransaction (string) required |
| eth_new_filter | Creates a filter server-side matching the given log criteria. Returns the filter ID. Not available on all hosted RPCs. | filter: { . fromBlock (string) . toBlock (string) . address . topics (array) . blockHash (string) } (object) required |
| eth_new_block_filter | Creates a filter that fires on each new block. Returns the filter ID. | No parameters |
| eth_new_pending_transaction_filter | Creates a filter that fires on each new pending transaction. Returns the filter ID. | No parameters |
| eth_uninstall_filter | Uninstalls the filter with the given ID. | filterId (string) required |
| eth_get_filter_changes | Returns events logs, block hashes or tx hashes that have arrived since the last poll of this filter. | filterId (string) required |
| eth_get_filter_logs | Returns all events matched by the filter since it was created. Only valid for log filters created with eth_newFilter. | filterId (string) required |
| bor_get_author | Returns the address of the validator that signed produced the given block. | block (string) |
| bor_get_current_proposer | Returns the address of the validator selected to propose the current block. | No parameters |
| bor_get_current_validators | Returns the current block producer set, with each validator's ID, signer address, voting power and proposer priority accum. | No parameters |
| bor_get_signers | Returns the addresses authorized to sign blocks at the given block, from the Bor snapshot. | block (string) |
| bor_get_signers_at_hash | Returns the addresses authorized to sign blocks at the block identified by hash. | blockHash (string) required |
| bor_get_snapshot | Returns the Bor consensus snapshot block number, hash, validator set and recent signers at the given block. | block (string) |
| bor_get_snapshot_at_hash | Returns the Bor consensus snapshot block number, hash, validator set and recent signers at the block identified by hash. | blockHash (string) required |
| bor_get_snapshot_proposer | Returns the validator that was in turn to propose the given block, according to the Bor snapshot. | block (string) |
| bor_get_snapshot_proposer_sequence | Returns the in-turn signers for the given block with their difficulty, plus the block author. | block (string) |
| bor_get_root_hash | Returns the Merkle root of the block headers from start to end inclusive, the value Heimdall commits to Ethereum in checkpoints. Returned as hex without the 0x prefix. | start (integer) required end (integer) required |
| eth_get_root_hash | Same as bor_getRootHash, exposed in the eth namespace: Merkle root of the block headers from start to end inclusive, returned as hex without the 0x prefix. Some providers only expose one of the two. | start (integer) required end (integer) required |