Transaction Callbacks
Get notified about on-chain transactions in real-time, parsed and summarized.
Overview
How to Create Transaction Callbacks
const createTransactionCallback = async () => {
try {
const response = await fetch(
"https://api.shyft.to/sol/v1/callback/create",
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': '{ YOUR-API-KEY }'
},
body: JSON.stringify({
"network": "mainnet-beta", //or devnet
"addresses": [
"ARRAY OF ADDRESSES YOU WANT TO RECEIVE CALLBACKS FOR"
],
"callback_url": "YOUR SERVER URL",
"type": "CALLBACK", //optional, default is CALLBACK
"enable_raw": true, //optional, to receive jsonParsed Solana tx
"enable_events": true //optional, to receive anchor events emitted in the tx
}),
}
);
const data = await response.json();
console.log(data);
} catch (e) {
console.error("callback creation error", e);
}
}
createTransactionCallback();Transaction Callback Payload
Last updated