Multiple txs in actions/blinks
Summary
Currently Action POST response only allows for the returning of a single transaction (tx) as a string.
/**
* Response body payload returned from the Action POST Request
*/
export interface ActionPostResponse<T extends ActionType = ActionType> {
/** base64 encoded serialized transaction */
transaction: string;
/** describes the nature of the transaction */
message?: string;
links?: {
/**
* The next action in a successive chain of actions to be obtained after
* the previous was successful.
*/
next: NextActionLink;
};
}
There are many cases where more complex on-chain actions with programs need to be taken due to the limitation of Solana account and tx sizes. In such cases forcing the user to separately sign multiple txs when wallets already support the signing of multiple txs at once (ie. phantom with signAndSendAllTransactions) simply results in worse UX. Oftentimes this means making a decision between relaying/proxying txs for better UX or creating long more transparent action chains with worse UX.
Implementation:
Expanding the transaction field to an array of txs would solve this problem and allow for users to still have great UX while retaining the transparency of executing more complex on-chain actions with multiple txs directly. For example something like:
/**
* Response body payload returned from the Action POST Request
*/
export interface ActionPostResponse<T extends ActionType = ActionType> {
/** array of base64 encoded serialized transaction(s) */
transactions: [];
/** describes the nature of the transaction */
message?: string;
links?: {
/**
* The next action in a successive chain of actions to be obtained after
* the previous was successful.
*/
next: NextActionLink;
};
}