Search…
⌃K

Networks

where can you access data from
It is possible to use different network to access to data from different blockchains. Networks can be specified directly inside of the mutation
Currently we support the following Networks:
NetworkID
Network Name
1_eth_mainnet
Ethereum Mainnet
2_eth_rinkeby
Ethereum Rinkeby
3_xdai_mainnet
xDAI Mainnet

Examples

Obtain the updated list of supported Networks

Query
Result
query {
networks {
networkId
friendlyName
technology
network
rpcEndpoint
}
}
{
"data": {
"networks": [
{
"networkId": "1_eth_mainnet",
"friendlyName": "Ethereum Mainnet",
"technology": "ETH",
"network": "Mainnet",
"rpcEndpoint": "foobar"
},
{
"networkId": "2_eth_rinkeby",
"friendlyName": "Ethereum Rinkeby",
"technology": "ETH",
"network": "Rinkeby",
"rpcEndpoint": "http://foo.bar:8545"
},
{
"networkId": "3_xdai_mainnet",
"friendlyName": "xDAI Mainnet",
"technology": "xDAI",
"network": "Mainnet",
"rpcEndpoint": "https://dai.poa.network"
}
]
}
}

Specify the Network in an create mutation

Query
Result
mutation {
createContractsTrigger(input: {
name: "ContractsTrigger Example",
type: ContractsTrigger,
#specify the networkID of the network you want to use, if not explicited it will be used the Ethereum Mainnet by default
network: "3_xdai_mainnet",
statement: {
contract: {
address: "0x09cabec1ead1c0ba254b09efb3ee13841712be14",
abi: [...]
},
inputs: [
{
type: "uint256",
name: "eth_bought",
value: "1"
}
],
outputFilters: [
{
parameter: {
type: "uint256",
name: "out"
},
returnIndex: 0,
condition: {
attribute: "140",
predicate: BiggerThan
}
}
],
method: {
name: "getTokenToEthOutputPrice"
}
},
actions: [
{
type: Email,
attributes: {
body: "BlockNumber is $BlockNumber$\nBlockHash is $BlockHash$\nBlockTimestamp is $BlockTimestamp$\n\nThe contract wich originated this trigger is: $ContractAddress$\n\nAll values returned by the function: $ReturnedValues$",
subject: "ContractsTrigger Example",
to: [
]
}
}
]
})
{
UUID
}
}
{
"data": {
"createContractsTrigger": {
"UUID": "8b944a2f-da6b-41a6-895b-c39fcac5011e"
}
}
}

Specify the Network in an update mutation

Query
Result
mutation {
updateEventsTrigger(input: {
UUID: "1cbfd7f3-9448-4fd2-88a3-091678f9f68b",
name: "New name",
#specify the networkID of the network you want to use, if not explicited it will be used the Ethereum Mainnet by default
network: "3_xdai_mainnet",
statement: {
contract: {
address:"0x398ec7346dcd622edc5ae82352f02be94c62d119",
abi: [{anonymous:false,inputs:[{indexed:false,internalType:"address",name:"previousAdmin",type:"address"},{indexed:false,internalType:"address",name:"newAdmin",type:"address"}],name:"AdminChanged",type:"event"},{anonymous:false,inputs:[{indexed:true,internalType:"address",name:"implementation",type:"address"}],name:"Upgraded",type:"event"},{payable:true,stateMutability:"payable",type:"fallback"},{constant:false,inputs:[],name:"admin",outputs:[{internalType:"address",name:"",type:"address"}],payable:false,stateMutability:"nonpayable",type:"function"},{constant:false,inputs:[{internalType:"address",name:"newAdmin",type:"address"}],name:"changeAdmin",outputs:[],payable:false,stateMutability:"nonpayable",type:"function"},{constant:false,inputs:[],name:"implementation",outputs:[{internalType:"address",name:"",type:"address"}],payable:false,stateMutability:"nonpayable",type:"function"},{constant:false,inputs:[{internalType:"address",name:"_logic",type:"address"},{internalType:"address",name:"_admin",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],payable:true,stateMutability:"payable",type:"function"},{constant:false,inputs:[{internalType:"address",name:"_logic",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],payable:true,stateMutability:"payable",type:"function"},{constant:false,inputs:[{internalType:"address",name:"newImplementation",type:"address"}],name:"upgradeTo",outputs:[],payable:false,stateMutability:"nonpayable",type:"function"},{constant:false,inputs:[{internalType:"address",name:"newImplementation",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"upgradeToAndCall",outputs:[],payable:true,stateMutability:"payable",type:"function"}]}
filters: [{
#use the proper event type (follow the schema for further details)
type:CheckEventEmitted,
method: {
name:"AdminChanged"
}
}]
},
actions: [
{
type: Email,
attributes: {
subject: "Changed",
body: "New Body",
to: [
]
}
},
{
type: Twitter,
attributes: {
status: "New Message",
token: "$TwitterToken",
secret: "$TwitterSecret"
}
}
]
})
{
UUID
}
}
{
"data": {
"updateEventsTrigger": {
"UUID": "8b944a2f-da6b-41a6-895b-c39fcac5011e"
}
}
}