-
Notifications
You must be signed in to change notification settings - Fork 55
Compatibility of Blinks and Actions #16
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
Conversation
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 is really good job
Love the documented code and tests!
* Baseline action version to be used when not set by action provider. | ||
* Defaults to latest release that doesn't support versioning. | ||
*/ | ||
export const BASELINE_ACTION_VERSION = '2.0.0'; |
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.
why 2.0.0? shouldn't it be 2.2 or smth?
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.
was a question of release sequencing, I think ok to use 2.2 now since chaining and inputs are merged
73a312a
to
eda8dd0
Compare
# Conflicts: # src/api/Action/Action.ts # src/ui/ActionContainer.tsx
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.
amazing job! minor comments
Context & Problem
Based on sRFC https://forum.solana.com/t/srfc-31-compatibility-of-blinks-and-actions/1892
X-Action-Version
to show what spec version the action API server is usingX-Blockchain-Ids
to list blockchains the action supports.X-Accept-Action-Version
to show the max spec version the Blink client supports.X-Accept-Blockchain-Ids
to list blockchains the client supports.Response headers should be used to decide if Action supported by client.
Solution
supportedBlockchainIds
strategyActionConfig
Breaking changes
isSupported
fromActionAdapter
, toAction
and toObserverOptions
correspondinglyExample adapter initialization
ActionConfig
: in this case client supports solana mainnet & devnet + spec version frompackage.json
ActionConfig
: in this case client supportssupportedBlockchainIds
+ spec version from package.json,supportedBlockchainIds
can be later used to setX-Accept-Blockchain-Ids
request headersupportStrategy
inuseAction
supportStrategy
insetupTwitterObserver
Related PR in actions spec: solana-developers/solana-actions#21
Related PR in actions-proxy: https://github.com/dialectlabs/actions-backend/pull/2