-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Solana Signing Support, Examples #33
Conversation
✅ Heimdall Review Status
|
return base58EncodedSignedTx, nil | ||
} | ||
|
||
func broadcastSolTransaction(ctx context.Context, signedTx string) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think we should not be duplicating the sign/broadcast for every variation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Let me see if we can incorporate this into the SDK to help standardize this functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example was actually doing numerous thing besides just build-staking-operation
. I've split them up into 3 examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great overall! I think a few unit tests & this is complete!
@deangalvin-cb I've added a couple unit test suites for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this pattern!
@ProfMoo Love this. Thanks! Would be nice to follow up on the NodeJS SDK as well and have the same pattern both places. |
What changed? Why?
This PR adds an abstraction around the SDK's signing support in order to support signing staking operations for ETH and SOL using the same interface. This PR relies heavily on Golang's stdlib
crypto/rand
.Alongside these changes, I included numerous Solana stake examples to provide full examples of how to stake SOL.
Our current Solana staking endpoint can take significant periods of time to get data from the underlying Solana nodes, so I've added the ability to modify the timeout on the client.