đCallback APIs
Get real time updates on addresses of your choice
Checkout structure for different type of transaction actions here
List Callbacks
GET /sol/v1/callback/list
Returns a list of all the callbacks registered for a user
Register a callback
POST /sol/v1/callback/create
Create a callback for addresses you are interested to monitor. Once this API is triggered, callbacks are created asynchronously and may take a minute to start sending data to the specified callback URL.
You can specify type
and create CALLBACKS (transactions), ACCOUNT and DISCORD callbacks.
Body
network: Solana blockchain environment (devnet / mainnet-beta).
addresses: Array of addresses to watch.
callback_url: The URL on which transaction callbacks should be sent to.
events (optional): Array of Transaction types you are interested in. Default is
any
. Valid values for events are given here.enable_raw (optional): Includes raw transaction information along with parsed data.
enable_events (optional): Includes parsed anchor events emitted in the transaction if an IDL is provided.
type (optional): DISCORD, CALLBACK or ACCOUNT.
encoding (optional): RAW and PARSED. Applicable for account callbacks only. When
PARSED
is specified for programs whose IDL is present on Translator, the callback will contain parsed information as per the IDL. If IDL is not present it will send base64 encoded data. In case ofRAW
the account data will always be in base64 format. Default isRAW
.
Remove a callback
Use the following API to stop listening on existing addresses. Once this API is triggered, callbacks are removed asynchronously and may take a minute to stop.
You can specify id as * to stop all callbacks related to you API key.
DEL /sol/v1/callback/remove
Body
id: ID of the registered callback by user. Can be obtained from list callbacks API
Pause a callback
Use the following API to pause created callbacks. Once this API is triggered, callbacks are paused asynchronously and may take a minute to pause. Pausing callbacks is the smart way to maximize your credits. With no credits being consumed during the pause, you can save big.
You can specify id as * to pause all callbacks related to your API key.
POST /sol/v1/callback/pause
Body
id: ID of the registered callback by the user. Can be obtained from list callbacks API
Resume a callback
Use the following API to resume paused callbacks. Once this API is triggered, callbacks are resumed asynchronously and may take a minute to resume. Upon resuming callbacks, please be aware that credit consumption will resume accordingly.
You can specify id as * to resume all callbacks related to your API key.
POST /sol/v1/callback/resume
Body
id: ID of the registered callback by the user. Can be obtained from list callbacks API
Update Callback
POST /sol/v1/callback/update
Body
id: ID of the callback which has be updated. Can be found from list callbacks API.
addresses: (optional) Array of public keys of accounts which should be watched.
events: (optional) Array of valid events to watch for. Valid values for events are given here
callback_url: (optional) New callback url.
enable_raw (optional): Option to include raw transaction information along with parsed data in callback.
enable_events (optional): Option to include parsed anchor events emitted in the transaction.
encoding (optional): Option to change encoding format of account callbacks. Ignored if callback type is not
ACCOUNT
Add Addresses in Callback
POST /sol/v1/callback/add-addresses
Once you add addresses to your callback, we start monitoring them instantly, without any latency.
Body
id: (string) Callback id which has to be updated
addresses: (Array<string>) List of addresses which should be added in existing callback
Remove Addresses from callback
POST /sol/v1/callback/remove-addresses
Removing addresses from a callback can take few seconds to reflect.
Body
id: (String) Callback Id which has to be updated
addresses: (Array<string>) List of addresses which should be removed from the callback
Callback Response Structure
Checkout response structure for all supported transaction types here
Every callback will be a Shyft parsed transaction along with some additional values of raw transaction information and account details. This callback is sent to the specified callback url as a POST request.
Callbacks include
x-api-key
header which is the users api key so that a user can verify that the request is being sent from Shyft's server directly.Callbacks contain extra raw field which includes raw transaction info if
enable_raw
option is provided while creating the callbackCallbacks contains accounts field which includes list of accounts which might have been changed in the transaction. The accounts data contains the following fields: account address as base58 encoded string , account owner as base58 encoded string, lamports balance as number and custom account data as hex formatted string.
Below is a sample transaction callback for SOL transfer between 2 accounts.
Below is an example of sample parsed account callback
Last updated