Webhook
When setting up a project, you can choose between two channels of notifications:
email
webhook
On this page, we will focus on how to set up a webhook in your application to receive the data from Leandexer.
What is a webhook?
A webhook is a method used to send real-time data from one application to another based on specific events. This is achieved by configuring a URL endpoint in the receiver application, which listens for incoming HTTP requests triggered by the sender application whenever the designated event occurs. Webhooks enable seamless, automated data transfers and integrations without the need for continuous polling or manual updates.
Setting up your webhook
To set up the webhook, simply define a new route on your back-end router, using the following payload as request body:
A little explanation of the code above:
smart_contract_address
: the address of the smart contract concerned by the notificationproject
are the information related to the project sending the notification: the name and the identifierid
is the internal identifier of the project in the system, that you can use on your application to map dataname
is the label you attached to your project when creating it in the Leandexer App
time
is the epoch formated time of the emitted eventnetwork
is the name of the network on which the event was emittedevent
is all the data related to the event itself:name
the name of the event, as emitted by the smart contract (i.e.Transfer
Approval
...)payload
is the payload of the event, containing:encoded
the hexadecimal encoded string, as read on the blockchaindecoded
the decoded, humanly readable content of the event:from
the wallet which emitted the transactionto
if eligible, the wallet receiving the transactionamount
if eligible, the amount exchanged during the transaction
block_number
the number of the block which validated the transaction
Last updated