Shyft
Start BuildingSupportWebsite
  • Welcome
    • 👋Introducing Shyft
    • 🏗️Start Building
  • Solana Infrastructure
    • 🚁Shyft RPCs
  • Yellowstone gRPC Network
    • Decoding gRPC Latency
    • ⚡gRPC Docs
      • Introduction
      • Authentication
      • Subscribe Requests
      • FAQ
      • Getting Started
        • Initializing the Yellowstone Client
        • Making a gRPC connection
        • Adding a Reconnection Mechanism
        • Modifying your Subscribe Request
        • Closing a gRPC Connection
      • Subscribing to Transactions
        • All Transactions of an address
        • Subscribing to all transactions of a Liquidity Pool
        • Subscribing to all transactions of multiple addresses
        • Subscribing to all transactions of a Token
      • Subscribing to Accounts
        • Account Updates for a Program
        • Account Updates for an Address
        • Account updates using memcmp
      • Streaming Blocks & BlocksMeta
        • Streaming Block Updates
        • Subscribing to BlocksMeta
      • Modifying & Unsubscribing
  • Solana defi data
    • DeFI APIs
      • Get Pool By Address
      • Get Pools By Token Pair
      • Get All Pools for a Token
      • Get Liquidity Details of a Pool
  • Callbacks
    • ☎️What are Callbacks?
      • Transaction Callbacks
      • Account Callbacks
    • 📔Callback APIs
      • Response Structure
      • List Callbacks
      • Register callback
      • Remove callback
      • 🔥Pause a callback
      • 🔥Resume a callback
      • Update Callbacks
      • Add Addresses
      • Remove addresses
  • Solana Super Indexers
    • 🌩️GraphQL APIs
      • Getting Started
      • Building Queries
      • Paginating Response
      • Applying Filters
      • Ordering and Sorting Data
    • 📀Case Studies
      • Tensor
        • Get Active Listings of a Wallet
        • Get Active Bids of a Wallet
        • Get Active Listings of a Collection
        • Get all Bids of a Collection
        • Get all Pools of a Margin Account
        • Get all Pools by Owner
      • Raydium
        • Get Pool By Address
        • Get Pools By Token Address
        • Get Pools Created Between Time
        • Get Pool Burn Percentage
        • Get Liquidity Details of a Pool
        • Get Pool and OpenBook Market Info
        • Get Token Supply Percentage In Pool
      • Orca Whirlpool
        • Get Pool by Address
        • Get Pool by Token Address
        • Get Positions for a Pool
        • Get Positions for a Wallet
        • Get Liquidity Details of a Pool
      • Kamino
        • Get Borrow Details of a Wallet
        • Get Deposit Details of a Wallet
        • Get Reserve Details
      • Cross Marketplace Queries
        • Get active listings across marketplaces for a wallet
        • Get listings for a collection across marketplaces
        • Get floor price of a collection
      • Cross Defi Queries
        • Fetch Liquidity Pools for Token
      • Native Staking
        • Get Stakes for a Wallet
        • Get Stakes For Validator
      • Governance/Realms
        • Get DAO Token Owners
        • Get Proposals For Governing Mint
        • Get All Proposals For DAO
        • Get DAO Treasury Info
        • Get All Active Proposals For Wallet
      • Meteora
        • Get All LB Position Pairs
        • Get Position of a User Wallet
        • Get Pool by Token Addresses
        • Get All Deposits for a User
        • Get All Withdraws for a User
        • Get All Fees Claimed by a User
        • Get All User Positions and Deposits for a Pool
        • Get All User Positions and Withdrawals for a Pool
      • Fluxbeam
        • Get Pool by Address
        • Get Pool by Token Addresses
      • Drift
        • Get User account for Delegate
        • Get User accounts based on authority
        • Get User details based on Referrer
        • Get Borrow/Deposit Amount for an User
        • Get PrepPositions for an User Account
        • Getting OrderId and userOrderId
        • Get OpenOrders for a User Account
      • 🔥Pumpswap
        • 🔥Get Pool by Address
        • 🔥Get Pool by Creator Address
        • 🔥Get Pools by Token Addresses
      • 🔥Raydium Launchpad
        • 🔥Get Bonding Curve Details by Pool Address
        • 🔥Get All Pools for a Creator
        • 🔥Get Pools by Token Addresses
        • 🔥Get Migration details of a Pool
  • Solana APIs
    • API Reference
    • Transactions
      • Parsed Transaction Structure
      • Transaction APIs
        • History
        • Parse Signature
        • Parse Multiple Signatures
        • Send
        • Send Multiple
    • NFT
      • 🔥Create Gasless
      • Create
      • Read All
      • Burn
      • 🔥Burn Multiple NFTs V2
      • Update
      • 🔥Create NFT from Metadata
      • 🔥Read Wallet Nfts
      • 🔥Read Selected NFTs
      • 🔥Get NFT Owners
      • 🔥Update NFT Metadata Uri
      • 🔥Update V2
      • Search
      • Transfer
      • Transfer Multiple NFTs
      • Mint
      • Read
    • Wallet
      • Get Balance
      • Get Token Balance
      • Get All Tokens Balance
      • Get Portfolio
      • Resolve Address
      • Get All Domains
      • Get Stake Accounts
    • Fungible Tokens
      • Create
      • Mint
      • Burn
      • 🔥Update
      • Get Token Info
      • Transfer
      • Airdrop
Powered by GitBook
On this page
  • Overview
  • How to Create Transaction Callbacks
  • Transaction Callback Payload

Was this helpful?

  1. Callbacks
  2. What are Callbacks?

Transaction Callbacks

Get notified about on-chain transactions in real-time, parsed and summarized.

PreviousWhat are Callbacks?NextAccount Callbacks

Last updated 1 year ago

Was this helpful?

for a Merkle tree indexer using Transaction Callbacks.

Overview

To create powerful event-driven systems, you need to be able to monitor transactions happening on a blockchain in real-time. You can set up transaction callbacks to watch specific addresses, and whenever a transaction occurs on those addresses, you'll receive a notification to your backend through a POST request. You can also setup filters for different types of transactions you want to be notified about, such as NFT sales, token transfers, NFT burns, and more.

You can view the full list of supported on-chain transaction types .

The best part is that when you receive these callbacks, they come with structured information about the transaction, including its type and detailed data, so you don't need to make additional requests to the blockchain. This makes it easier to build applications that react to specific blockchain activities.

How to Create Transaction Callbacks

You can create callbacks programmatically through our APIs, Postman or Swagger UI.

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

There are 3 major parts in the response structure

  • events: It is an array of parsed anchor events containing data and name of events emitted in the transaction. These are automatically parsed if an IDL is provided.

  • raw: This is the standard Solana jsonParsed transaction

{
    "timestamp": "",
    "fee": ,
    "fee_payer": "",
    "signers": [
    ],
    "signatures": [
    ],
    "protocol": {
        "address": "",
        "name": ""
    },
    "type": "",    //Main Transaction type
    "status": "",
    //actions is an array of parsed instructions 
    "actions": [
        {
            "info": {
                //info contains action specific response structure
            },
            "source_protocol": {
                "address":,
                "name":
            },
            "type": "action type"
        }
    ],
    "raw": {
        //jsonParsed Solana transaction
    },
    "events": [
    //Array of anchor events emitted in the transaction
      {
        "data": {
        //Parsed anchor event data if IDL is present
        },
        "name": ""
      }
    ],
    "accounts": [
        {
            "address": ,
            "owner": ,
            "lamports": ,
            "data": ,
        }
    ]
}

You can check out different transactions on Translator and see their response structures and understand better.

actions: The most important section. An array containing structured information about the transaction. it contains type, source_protocol and info. The main action summary is present under info and will differ based on the transaction type. You can check various actions and their response structures .

☎️
Github repo
here
📔Callback APIs
LogoSwagger UI
LogoTranslator | Powered By Shyft.to
Token Swap on Jupiter v4
LogoTranslator | Powered By Shyft.to
Compressed NFT sale on Tensor cNFT
LogoTranslator | Powered By Shyft.to
NFT Bid on SMB #3091 on ME for
here