User Defined Streams
Monitor your Smart Contract Events and External Functions
User Defined Streams β€” are the streams that are generated in our Platform when user uploads an Application Binary Interface (ABI) on our Portal. After an ABI is provided you can start monitoring your Smart Contract's events and function calls momentarily.

Supported Functions

Function
Is Ready
Ethereum Contract Events
β€‹βœ…β€‹
Binance Smart Chain Contract Events
β€‹βœ…β€‹
Huobi Eco Chain Contract Events
β€‹βœ…β€‹
Polygon Contract Events
Coming soon
Smart Contracts' External Function Calls
β€‹βœ…β€‹
Smart Contracts' Internal Function Calls
2021Q4

Stream Name Convention

After you upload an ABI your events and external functions will be available as a separate stream with the following name pattern:
Blockchain_ContractName_EventName_Events
Blockchain_ContractName_EventName_Functions
Given an Ethereum Smart Contract with the name "MySmartContract" and event name "MyEvent" your stream name will be as following:
ETH_MySmartContract_MyEvent_Events
Given an Ethereum Smart Contract with the name "MySmartContract" and event name "Deposit" your stream name will be as following:
ETH_MySmartContract_Deposit_Events

Event Parameters

All the parameters produced by an event can be used in your Smart Trigger and can be either a part of notification that we will send to you or can be used for your business logic within a Smart Trigger.
Given an event:
event MyEvent(address indexed _address, string _name);
you will be able to utilize your parameters as @_address and @_name.

Function Parameters

All the parameters that are passed in function call can be used in your Smart Trigger and can be either a part of notification that we will send to you or can be used for your business logic within a Smart Trigger.
Given a function:
function deposit(uint256 _assetQuantity, address _from)
you will be able to utilize your parameters as @_assetQuantity and @_from.

Examples

Events

Let's assume that you uploaded your ABI with the name MySmartContract with an event:
event MyEvent(address indexed _address, string _name);
Now this event can be easily monitored using ParsiQL:
1
stream _
2
from ETH_MySmartContract_MyEvent_Events
3
where @contract == ETH.address("0xccec89631d2bCeB35B884c2538BcEBc245a71D0b")
4
​
5
process
6
emit { @_address, @_name, message: "MyEvent was just fired." }
7
end
8
​
Copied!
Once your Smart Contract has fired an eventβ€”you will instatly get a notifcation (according to Smart Trigger's configuration)
Let's have another event:
event MySecondEvent(address indexed _from, address indexed _to, string _symbol);
1
stream _
2
from ETH_MySmartContract_MySecondEvent_Events
3
where @contract == ETH.address("0xD06cf06D1cF132F5F0b974be13Ad3bdcc633992c")
4
​
5
process
6
if @_from == ETH.address("0xD849f7442857533fAe5adD8377476415cE5e79e4")
7
&& @_symbol == "PRQ" then
8
emit { message: "Address X just fired MySecondEvent with token PRQ." }
9
end
10
end
Copied!

Functions

Let's assume that you uploaded your ABI with the name MySmartContract with a function
function deposit(uint256 _assetQuantity, address _from)
Now this external function can be easily monitored using ParsiQL:
1
stream _
2
from ETH_MySmartContract_Deposit_Functions
3
where @contract == ETH.address("0xD06cf06D1cF132F5F0b974be13Ad3bdcc633992c")
4
​
5
process
6
if @_from == ETH.address("0xD849f7442857533fAe5adD8377476415cE5e79e4") then
7
emit { message: "Address X just made a deposit", @_from, @_assetQuantity }
8
end
9
end
Copied!
This trigger will produce the following JSON payload:
1
{
2
message: "Address X just made a deposit",
3
_from: "0xD849f7442857533fAe5adD8377476415cE5e79e4",
4
_assetQuantity: 140000000000000000
5
}
Copied!
Last modified 12d ago