Action Chaining
The POST request part of the Action API now also supports Action Chaining, which allows the confirmation of an action on-chain to present the context of a new action to the user, constructing what is essentially a 'chain' of actions in a successive series.
The changes to the specification in the POST request, to enable action chaining are:
To chain multiple actions together, in any ActionPostResponse
include a links.next
of either
PostNextActionLink
- POST request link with a same origin callback url to receive thesignature
and user'saccount
in the body. This callback url should respond with aNextAction
.InlineNextActionLink
- Inline metadata for the next action to be presented to the user immediately after the transaction has confirmed. No callback will be made.
After the ActionPostResponse
included transaction
is signed by the user and confirmed on-chain, the blink client should either:
execute the callback request to fetch and display the
NextAction
, orif a
NextAction
is already provided vialinks.next
, the blink client should update the displayed metadata and make no callback request
If the callback url is not the same origin as the initial POST request, no callback request should be made. Blink clients should display an error notifying the user.
Based on the type
, the next action should be presented to the user via blink clients in one of the following ways:
action
- (default) A standard action that will allow the user to see the included Action metadata, interact with the providedLinkedActions
, and continue to chain any following actions.completed
- The terminal state of an action chain that can update the blink UI with the included Action metadata, but will not allow the user to execute further actions.
If no links.next
is not provided, blink clients should assume the current action is final action in the chain, presenting their "completed" UI state after the transaction is confirmed.
Last updated