polygon chain is covered. The Polygon integration aligns with the general Unified API process but with network-specific parameters.
Get an authentication token to start using the Unified API.
Request examples are provided using cURL.
To check the integration guides for other chains, refer to the Networks Supported section.
Key Polygon-specific details
chain— always set topolygonfor Polygon-related requests.network— environment in which the transaction is processed. Must always be set tomainnet.stakerAddress— Ethereum-compatible account address initiating staking, unstaking or withdrawal transactions.amount— amount of tokens in MATIC.
Staking flow
1. Approve token management
Note that the flow uses transactions of type 2 (EIP-1559). Staking, unstaking, and withdrawal operations require interaction with smart contracts via prepared transactions.Approve transferring your MATIC tokens to the staking contract by sending a POST request to /api/v1/polygon/staking/approve. Example request:
amount— amount of tokens in POL to approve staking operations.stakerAddress— staker account address providing approval.
serializeTx— serialized unsigned transaction (EIP-1559 format).to— recipient contract address for approval.gasLimit— maximum limit for the transaction.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155. Polygon chain ID formainnetis 137.type— EIP-1559 type of this transaction envelope.maxFeePerGas— maximum price per unit of this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.maxPriorityFeePerGas— price per unit of in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.
2. Sign and send transaction
UseserializeTx to sign the transaction using the Polygon-specific signing logic.
To broadcast the signed transaction to the Polygon network, send a POST request to /api/v1/unified/transaction/broadcast.
Example request:
chain— blockchain network, always set topolygonfor Polygon-related requests.network— must always be set tomainnet. Polygon does not support testnet.signedTransaction— signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.stakerAddress— staker account address initiating the staking transaction.
-
extraData— additional transaction details:transactionHash— hash of the broadcasted approval transaction.signedTransaction— signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.stakerAddress— staking account address initiating the delegate transaction.sentAt— timestamp of the transaction in the ISO 8601 format.
3. Create staking request
Send a POST request to /api/v1/unified/staking/stake. Example request:chain— blockchain network.network— environment in which the transaction is processed.stakerAddress— staker account address initiating the staking transaction.amount— amount of tokens to delegate in MATIC.
-
stakerAddress— staker account address initiated the delegate transaction. -
unsignedTransactionData— unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action. -
extraData— additional transaction details:to— recipient contract address for approval.gasLimit— maximum limit for the transaction.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155. Polygon chain ID formainnetis 137.type— EIP-1559 type of this transaction envelope.maxFeePerGas— maximum price per unit of gas this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.maxPriorityFeePerGas— price per unit of gas in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.
4. Sign and send transaction
UseunsignedTransactionData to sign and send the transaction following the Polygon-specific signing logic.
Unstaking flow
1. Create unstaking request
Send a POST request to /api/v1/unified/staking/unstake. Example request:chain— blockchain network.network— environment in which the transaction is processed.stakerAddress— staker account address initiating the undelegate transaction.extra— additional parameters:amount— amount of tokens to undelegate in MATIC.
-
stakerAddress— staker account address initiated the undelegate transaction. -
unsignedTransactionData— unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action. -
extraData— additional transaction details:to— recipient contract address for approval.gasLimit— maximum gas limit for the transaction.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155. Polygon chain ID formainnetis 137.type— EIP-1559 type of this transaction envelope.maxFeePerGas— maximum price per unit of gas this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.maxPriorityFeePerGas— price per unit of gas in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.
2. Sign and send transaction
UseunsignedTransactionData to sign and send the transaction following the Polygon-specific signing logic.
3. Create withdrawal request
Note that it takes up to 3-4 days to prepare your tokens for unstaking as Polygon uses a system of . The average undelegate period on Polygon is 80 checkpoints. Withdrawal is only available after the undelegate period ends.
chain— blockchain network.network— environment in which the transaction is processed.stakerAddress— staker account address initiating the withdrawal transaction.
-
stakerAddress— staker account address initiated the withdrawal transaction. -
unsignedTransactionData— unsigned transaction in Base64 encrypted format. Sign the transaction and submit it to the blockchain to perform the called action. -
extraData— additional transaction details:to— recipient contract address for approval.gasLimit— maximum gas limit for the transaction.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155. Polygon chain ID formainnetis 137.type— EIP-1559 type of this transaction envelope.maxFeePerGas— maximum price per unit of gas this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.maxPriorityFeePerGas— price per unit of gas in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.
4. Sign and send transaction
UseunsignedTransactionData to sign and send the transaction following the Polygon-specific signing logic.