# Blockchain events

### Overview: What are chain events?

**Events are objects containing decoded values (data)** provided by the chain in the result of any transaction triggered using the `submitTxBlocking` function. At least one of these two `ExtrinsicSuccessEvent` or `ExtrinsicFailedEvent` events is provided for any transaction depending on its success or failure. While `submitTxBlocking` provides the SDK handlers' main events list of ***BlockchainEvents*** available, we also allow you to filter this list to get the ones you need. *An example to filter only the events list of a balance transfer transaction:*

```javascript
const balanceTransfertEvents = BlockchainEvents.findEvents(
	BalancesTransferEvent
);
```

**note:** *BlockchainEvents is the result of the `submitTxBlocking` function. It can be stored in a constant for example.*

To better understand Events, we already jumped a bit deeper than the first and easiest option to get the extrinsics events list. In case you do not need to manually sign or send your transaction, each of the Ternoa extrinsics features comes with two functions to execute a transaction and an easy one to directly get the required events list. See the example below :\
\&#xNAN;*When the `balancesTransferTx` function creates an unsigned unsubmitted transaction hash, the `balancesTransfer` function signs and submits the transaction to provide the events list.*

***

### About the Event Design Format:

To make the returned events data useful, we provide both the native format and a more friendly, ready-to-use format:

* a string as an AccountId32 corresponds to a classic user-valid address.
* a string as u128 is a BN value as a string natively used under the hood by the chain.
* rounded data (ex: amoutRounded) is the "human" version of data, (usually a BN) that can be directly used.
* some events from the utility pallet do not return any data.

***

### The events below are the Events handled in the Ternoa SDK sorted by categories

* [Assets](#assets-events)
* [Auctions](#auctions-events)
* [Balances](#balances-events)
* [Capsule](#capsule-events)
* [Collection](#collection-events)
* [Marketplace](#marketplace-events)
* [NFT](#nft-events)
* [Rent](#rent-events)
* [System](#system-events)
* [Tee](#tee-events)
* [Transmission protocols](#transmission-protocols-events)
* [Treasury](#treasury-events)
* [Utility](#utility-events)

***

### Assets events

* #### AssetTransferredEvent
  * **Summary:** Gtoken transfer succeeded.

***

### Auctions events

* **AuctionCreatedEvent**
  * **Summary:** An auction has been created.
* **AuctionCancelledEvent**
  * **Summary:** An existing auction has been canceled.
* **AuctionCompletedEvent**
  * **Summary:** An auction has been completed.
* **BidAddedEvent**
  * **Summary:** A bid has been added to an auction.
* **BidRemovedEvent**
  * **Summary:** A bid has been removed from an auction.

***

### Balances events

* #### BalancesWithdrawEvent
  * **Summary:** Some amount was withdrawn from the account
* #### BalancesDepositEvent
  * **Summary:** Some amount was deposited.
* #### BalancesTransferEvent
  * **Summary:** Transfer succeeded.
* #### BalancesEndowedEvent
  * **Summary:** An account was created with some free balance

***

### Capsule events

* ***NFTConvertedToCapsuleEvent***
  * **Summary:** An existing NFT has been converted to a Capsule NFT
* **CapsuleOffchainDataSetEvent**
  * **Summary:** The capsule metadata has been set or updated.
* **CapsuleKeyUpdateNotifiedEvent**
  * **Summary:** The blockchain has been notified that the capsule owner requests new keys.&#x20;
* **CapsuleRevertedEvent**
  * **Summary:** The Capsule NFT assets have been reverted from an NFT.

***

### Collection events

* #### CollectionCreatedEvent
  * **Summary:** A Collection has been created.
* #### CollectionLimitedEvent
  * **Summary:** The collection's limit has been set.
* #### CollectionClosedEvent
  * **Summary:** A collection has been closed.
* #### CollectionBurnedEvent
  * **Summary:** A collection has been burned.
* **CollectionOffchainDataSetEvent**
  * **Summary:** The collection metadata has been set or updated.

***

### Marketplace events

* #### MarketplaceCreatedEvent
  * **Summary:** A marketplace has been created.
* #### MarketplaceOwnerSetEvent
  * **Summary:** The marketplace owner has been set.
* #### MarketplaceKindSetEvent
  * **Summary:** The marketplace kind has been set.
* #### MarketplaceConfigSetEvent
  * **Summary:** The marketplace configuration has been updated. Parameters can be unchanged (Noop), Removed, or Set
* #### MarketplaceMintFeeSetEvent
  * **Summary:** The marketplace mint fee has been set.
* #### NFTListedEvent
  * **Summary:** An NFT has been listed for sale on a marketplace.
* #### NFTUnlistedEvent
  * **Summary:** An NFT has been unlisted from a marketplace.
* #### NFTSoldEvent
  * **Summary:** An NFT has sold.

***

### NFT events

* #### NFTCreatedEvent
  * **Summary:** An NFT has been created.
* ***SecretAddedToNFTEvent***
  * ***Summary:*** An NFT has been converted to a Secret NFT.
* #### NFTBurnedEvent
  * **Summary:** An NFT has been burned.
* #### NFTDelegatedEvent
  * **Summary:** An NFT has been delegated.
* #### NFTRoyaltySetEvent
  * **Summary:** The NFT's royalty has been set.
* #### NFTTransferredEvent
  * **Summary:** An NFT has been transferred.
* #### NFTAddedToCollection
  * **Summary:** An NFT has been added to a collection.

***

### Rent events

* **ContractCreatedEvent**
  * **Summary:** A rental contract has been created.
* **ContractCanceledEvent**
  * ***Summary:*** A rental contract has been canceled.
* **ContractStartedEvent**
  * **Summary:** A rental contract has started.
* **ContractRevokedEvent**
  * **Summary:** A rental contract has been revoked.
* **ContractOfferCreatedEvent**
  * **Summary:** An offer for a rental contract has been created.
* **ContractOfferRetractedEvent**
  * **Summary:** An offer for a rental contract has been created.
* **ContractSubscriptionTermsChangedEvent**
  * **Summary:** The rental contract owner has requested new conditions.
* **ContractSubscriptionTermsAcceptedEvent**
  * **Summary:** The new rental contract conditions have been accepted by the rentee.
* **ContractEndedEvent**
  * **Summary:** The rental contract has ended.
* **ContractSubscriptionPeriodStartedEvent**
  * **Summary:** The rental contract's new subscription period has started.
* **ContractExpiredEvent**
  * **Summary:** The rental contract has expired.

***

### System events

* #### ExtrinsicFailedEvent
  * **Summary:** An extrinsic failed.
* #### ExtrinsicSuccessEvent
  * **Summary:** An extrinsic was completed successfully.
* #### NewAccountEvent
  * **Summary:** A new account was created.

***

### Tee events

* **MetricsServerReportSubmittedEvent**
  * **Summary:** The metric server has submitted a report.
* **RewardsClaimedEvent**
  * **Summary:** The enclave owner has claimed his rewards.&#x20;

***

### Transmission protocols  events

* **ProtocolSetEvent**
  * **Summary:** A transmission protocol has been set.
* **ProtocolRemovedEvent**
  * ***Summary:*** A transmission protocol has been removed.
* **TimerResetEvent**
  * **Summary:** A transmission protocol's timer has been reset.
* **ConsentAddedEvent**
  * **Summary:** A consent has been given to a transmission protocol.
* **ThresholdReachedEvent**
  * **Summary:** The transmission protocol's threshold has been reached.
* **TransmittedEvent**
  * **Summary:** The NFT has been transmitted through a transmission protocol.

***

### Treasury events

* #### TreasuryDepositEvent <a href="#treasurydepositevent" id="treasurydepositevent"></a>
  * **Summary:** Some funds have been deposited.

***

### Utility events

* #### ItemCompletedEvent
  * **Summary:** A single item within a Batch of dispatches has been completed with no error.
* #### BatchInterruptedEvent
  * **Summary:** The batch of dispatches was not completed fully. Index of first failing dispatch given, as well as the error.
* #### BatchCompletedEvent
  * **Summary:** Batch of dispatches completed fully with no error.

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ternoa.network/getting-started/javascript-sdk/ternoa-js-library/blockchain-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
