-
Notifications
You must be signed in to change notification settings - Fork 14
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
handle consensus #350
Merged
Merged
handle consensus #350
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
bd39203
handle consensus
andrewkmin 0b6c9a3
revised approach
andrewkmin eabeed2
wip: client lib support
andrewkmin e9e0a7a
add helpers for getting signatures
andrewkmin c4efb29
add activity poller config
andrewkmin 6cf386e
add terminal activity statuses
andrewkmin 2796eba
prettify
andrewkmin 3f1f6c7
update client libraries again
andrewkmin 50f1723
update ethers
andrewkmin 27bce6b
misc cleanup
andrewkmin c988ed0
updated examples and added changeset
andrewkmin 91fbb29
slight tweak to solana
andrewkmin 8f4336c
improved error handling
andrewkmin f216f3d
wip: cleanup types
andrewkmin b4b2983
complete viem error handling
andrewkmin c6e861a
delete consensus scripts
andrewkmin 848f8d3
revise changesets
andrewkmin 9ef0c3a
feedback: move shared utility functions to http
andrewkmin 65781ae
feedback: updated ethers
andrewkmin 853ff85
move TERMINAL_ACTIVITY_STATUSES to http package; use undefined instea…
andrewkmin b039843
feedback: update viem
andrewkmin 989e946
feedback: remove retry scripts
andrewkmin 1975153
feedback: update solana example
andrewkmin c65c409
update example READMEs
andrewkmin 0c0f79e
minor solana cleanup
andrewkmin bdded80
update all changesets
andrewkmin 375518f
feedback: share signature, signatures, and signed transaction getters
andrewkmin 9bc9b98
feedback: update errors and changelogs
andrewkmin aa16d4d
feedback: return full Activity in response
andrewkmin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@turnkey/solana": minor | ||
--- | ||
|
||
Support awaiting consensus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@turnkey/ethers": minor | ||
--- | ||
|
||
Support awaiting consensus | ||
|
||
- Add a few new helper functions: | ||
- `serializeSignature` serializes a raw signature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@turnkey/viem": minor | ||
--- | ||
|
||
Support awaiting consensus and improve error handling | ||
|
||
- Add new error types that extend `BaseError` (and thus implement `error.walk`) | ||
- `TurnkeyConsensusNeededError` wraps consensus-related errors | ||
- `TurnkeyActivityError` wraps base Turnkey errors | ||
- Add a few new helper functions: | ||
- `serializeSignature` serializes a raw signature | ||
- `isTurnkeyActivityConsensusNeededError` and `isTurnkeyActivityError` use `error.walk` to check the type of a Viem error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@turnkey/sdk-browser": minor | ||
"@turnkey/sdk-server": minor | ||
--- | ||
|
||
Support activity polling (e.g. for awaiting consensus) | ||
|
||
- Add an `activityPoller` parameter for configuring polling behavior | ||
- Polling continues until either a max number of retries is reached, or if the activity hits a terminal status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@turnkey/http": minor | ||
--- | ||
|
||
Add new helpers and update types and errors | ||
|
||
- `getSignatureFromActivity` returns the signature corresponding to a completed activity | ||
- `getSignedTransactionFromActivity` returns the signed transaction corresponding to a completed activity | ||
- `checkActivityStatus` checks the state of an activity and throws an error if the activity either requires consensus or is otherwise not yet completed | ||
- `TERMINAL_ACTIVITY_STATUSES` is a const containing all terminal activity statuses. Useful for checking on an activity | ||
- `TurnkeyActivityError` now uses `undefined` instead of `null` | ||
- Export some additional types: `TActivity`, `TActivityId`, `TActivityStatus`, `TActivityType` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this still relevant?
EDIT: I think it is! Ignore this.
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.
Yep! a bit ambiguous with the numbers though; will change them such that it might be a bit less confusing