Skip to main content

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.

Polygon Logo

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:

ActionPurposeParameters
web3_client_versionReturns the current client version string of the connected node e.g. Geth/v1.14.0-stable/linux-amd64/go1.22.1.No parameters
web3_sha3Returns the Keccak-256 not the standardized SHA3-256 of the given hex data.data (string) required
net_versionReturns the current network ID as a string 137 for Polygon mainnet, 80002 for the Amoy testnet.No parameters
net_listeningReturns true if the client is actively listening for network connections.No parameters
net_peer_countReturns the number of peers currently connected to the client, as a hex quantity.No parameters
eth_protocol_versionReturns the eth wire protocol version implemented by the client, as a hex quantity.No parameters
eth_syncingReturns an object with sync status data startingBlock, currentBlock, highestBlock or false if the node is fully synced.No parameters
eth_coinbaseReturns the address the client uses as its coinbase block reward recipient. Not supported on most hosted RPCs.No parameters
eth_chain_idReturns the chain ID as a hex quantity 0x89 for Polygon mainnet, 0x13882 for the Amoy testnet.No parameters
eth_miningReturns true if the client is actively producing blocks. Public RPC nodes return false.No parameters
eth_hashrateReturns 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_priceReturns the current gas price in wei hex, estimated from recent blocks.No parameters
eth_max_priority_fee_per_gasReturns a suggested tip cap max priority fee per gas in wei, as a hex quantity EIP-1559.No parameters
eth_fee_historyReturns transaction base fee and priority fee percentiles for the requested block range EIP-1559.blockCount (string) required
newestBlock (string) required
rewardPercentiles (array) required
eth_accountsReturns the addresses owned by the client. Hosted RPCs usually return an empty array.No parameters
eth_block_numberReturns the number of the most recent block, as a hex quantity.No parameters
eth_get_balanceReturns 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_atReturns the value from the given storage slot of the contract at address.address (string) required
position (string) required
block (string) required
eth_get_transaction_countReturns 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_hashReturns the number of transactions in the block identified by hash, as a hex quantity.blockHash (string) required
eth_get_block_transaction_count_by_numberReturns 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_hashReturns 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_numberReturns 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_codeReturns the deployed bytecode at the given address and block, 0x-prefixed hex 0x for EOAs.address (string) required
block (string) required
eth_callExecutes 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_gasReturns 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_listSimulates 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_hashReturns 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_numberReturns 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_hashReturns the transaction identified by txHash, or null if not found.txHash (string) required
eth_get_transaction_by_block_hash_and_indexReturns the transaction at index inside the block identified by blockHash.blockHash (string) required
index (string) required
eth_get_transaction_by_block_number_and_indexReturns the transaction at index inside the block identified by number or tag.block (string) required
index (string) required
eth_get_transaction_receiptReturns the receipt including logs and status for the transaction identified by txHash.txHash (string) required
eth_get_block_receiptsReturns the receipts of every transaction in the given block number, tag or hash.block (string) required
eth_get_uncle_by_block_hash_and_indexReturns 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_indexReturns 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_logsReturns 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_proofReturns 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_transactionBroadcasts a pre-signed transaction RLP-encoded hex to the network. Returns the transaction hash.signedTransaction (string) required
eth_new_filterCreates 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_filterCreates a filter that fires on each new block. Returns the filter ID.No parameters
eth_new_pending_transaction_filterCreates a filter that fires on each new pending transaction. Returns the filter ID.No parameters
eth_uninstall_filterUninstalls the filter with the given ID.filterId (string) required
eth_get_filter_changesReturns events logs, block hashes or tx hashes that have arrived since the last poll of this filter.filterId (string) required
eth_get_filter_logsReturns all events matched by the filter since it was created. Only valid for log filters created with eth_newFilter.filterId (string) required
bor_get_authorReturns the address of the validator that signed produced the given block.block (string)
bor_get_current_proposerReturns the address of the validator selected to propose the current block.No parameters
bor_get_current_validatorsReturns the current block producer set, with each validator's ID, signer address, voting power and proposer priority accum.No parameters
bor_get_signersReturns the addresses authorized to sign blocks at the given block, from the Bor snapshot.block (string)
bor_get_signers_at_hashReturns the addresses authorized to sign blocks at the block identified by hash.blockHash (string) required
bor_get_snapshotReturns the Bor consensus snapshot block number, hash, validator set and recent signers at the given block.block (string)
bor_get_snapshot_at_hashReturns the Bor consensus snapshot block number, hash, validator set and recent signers at the block identified by hash.blockHash (string) required
bor_get_snapshot_proposerReturns the validator that was in turn to propose the given block, according to the Bor snapshot.block (string)
bor_get_snapshot_proposer_sequenceReturns the in-turn signers for the given block with their difficulty, plus the block author.block (string)
bor_get_root_hashReturns 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_hashSame 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