The title is pretty much it. Can I use Polkadot API to stake dot programmatically?
Can't seem to find that in the docs.
Substrate and Polkadot Stack Exchange is a question and answer site for developers building blockchains with the Substrate SDK. It only takes a minute to sign up.Sign up to join this community
Yes, of course.
You can read the documentation to learn how to submit extrinsics using Polkadot JS API:
Then, you just need to submit two extrinsics from the Staking Pallet:
This will lock a users funds so they can start to stake as a validator or nominator.
If you want to set up the account as a nominator.
If you want to set up the account as a validator.
There are more details needed specifically if you are setting up to be a validator which you can learn about here: https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot