Solana
Deserialize, sign and execute the transaction(s)
const brian = new BrianSDK(options);
const request = await brian.transact({
prompt: "swap 1 sol for USDC on solana",
address: "53unSgGWqEWANcPYRF35B2Bgf8BkszUtcccKiXwGGLyr",
});
console.log("transaction result:", request);
// Create an empty array to store transactions
const txArray = [];
// Loop through the requests and their steps
for (const req of request) {
for (const step of req.data.steps) {
// Push the step's data into the txArray
txArray.push(step.data);
}
}
console.log("Transaction Array:", txArray);
Last updated