blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
349 stars 86 forks source link

How to create stake account? #152

Closed skport closed 5 months ago

skport commented 5 months ago

https://solanacookbook.com/references/staking.html#create-stake-account

According to the solana cookbook, I need to use StakeProgram.createAccount. How can I do this in this SDK?

yihau commented 5 months ago

thank you for bumping this up. I just realized that I missed the doc. let me write some quick examples for you. (btw, the instructions can check here https://github.com/blocto/solana-go-sdk/blob/main/program/stake/instruction.go#L55)

yihau commented 5 months ago

https://blocto.github.io/solana-go-sdk/programs/stake/initialize-account.html

btw, you will need to use the latest version.

go get github.com/blocto/solana-go-sdk@HEAD