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

Get events by event handle

🚨Aptos: Confirmed Deprecation (60 Days Notice)

Aptos mainnet and testnet will be discontinued on November 22nd, in line with the network’s deprecation of their v1 Indexers. We recommend exploring alternative providers, which you can find at Aptos APIs.

GEThttps://mainnet-aptos-api.moralis.io/accounts/:address/events/:event_handle/:field_name

Get events by event handle for a given address.

PATH PARAMS
addressstringrequired
Hex-encoded 32 byte Aptos account, with or without a 0x prefix, for which events are queried. This refers to the account that events were emitted to, not the account hosting the move module that emits that event type.
event_handlestringrequired
Name of struct to lookup event handle.
field_namestringrequired
Name of field to lookup event handle.
QUERY PARAMS
limitnumber

Max number of account resources to retrieve. If not provided, defaults to default page size.

startstring

Starting sequence number of events. If unspecified, by default will retrieve the most recent events

Responses
API KEY
import Moralis from 'moralis';

try {
await Moralis.start({
apiKey: "YOUR_API_KEY"
});

const response = await Moralis.AptosApi.accounts.getEventsByEventHandle({
"limit": 5,
"network": "mainnet"
});

console.log(response);
} catch (e) {
console.error(e);
}
Response Example
[
{
"version": "32425224034",
"guid": {
"creation_number": "32425224034",
"account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1"
},
"sequence_number": "32425224034",
"type": "0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin>"
}
]