Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Create stream

PUThttps://api.moralis-streams.com/streams/aptos

Creates a new aptos stream.

BODY PARAM
webhookUrlstring
Webhook URL where moralis will send the POST request.
tagstring
A user-provided tag that will be send along the webhook, the user can use this tag to identify the specific stream if multiple streams are present
functionsarray
An Array of events in string-signature format ex: ['0x1::aptos_account::transfer']
No items in the array
eventsarray
An Array of events in string-signature format ex: ['0x1::coin::WithdrawEvent']
No items in the array
networkarray
The network to listen to
No items in the array
includePayloadboolean
Include or not payload for every transaction in webhook defaults to false
includeEventsboolean
Include or not events in webhook defaults to false
includeChangesboolean
Include or not raw changes for every transaction in webhook defaults to false
descriptionstring
A description for this stream
demoboolean
Indicator if it is a demo stream
allAddressesboolean
Include events for all addresses (only applied when at least one event or function is provided)
Responses
API KEY
// Dependencies to install:
// $ npm install node-fetch --save
// add "type": "module" to package.json

import fetch from 'node-fetch';

const options = {
method: 'PUT',
headers: {
accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
};

fetch('https://api.moralis-streams.com/streams/aptos', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
{
"id": "",
"allAddresses": "",
"demo": "",
"description": "",
"includeChanges": "",
"includeEvents": "",
"includePayload": "",
"isErrorSince": "",
"network": [
""
],
"status": "",
"statusMessage": "",
"events": [
""
],
"functions": [
""
],
"tag": "",
"webhookUrl": "",
"amountOfAddresses": ""
}