- Approve token management with the Polygon smart contract.
- Create a staking request.
1
Approve token management
Allow the Polygon smart contract to manage tokens by obtaining approval. Any amount can be approved, but preferably specify the exact amount ready to stake.Send a POST request to /api/v1/polygon/staking/approve. Use https://api.p2p.org for production.Example request:
amount— amount of tokens in Wei (1 POL = 10¹⁸ Wei) to approve for staking.stakerAddress— staker account address.
serializeTx— serialized unsigned transaction.to— recipient address for this transaction.gasLimit— maximum limit for this block.data— transaction data.value— amount this transaction is sending in Wei.chainId— chain ID this transaction is authorized on, as specified by EIP-155.type— EIP-2718 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
Create staking request
To create a stake transaction, delegate tokens to P2P validator by sending a POST request to /api/v1/polygon/staking/delegate.Example request:
amount— amount of tokens in Wei (1 MATIC = 10¹⁸ Wei) to delegate.stakerAddress— staker account address.