The Socket API is a package that helps you connect to the Push backend using WebSockets, built on top of Socket.IO. With this API, you can easily subscribe to real-time notifications and updates from the Push network.
In this article, we’ll go over the PUSH-SDK Socket API and how to use it in your dApp.
Socket API is deprecated. Push has revamped it's socket API into stream API which is more versatile and developer friendly, click on the link below to learn more 👇.
Note on Addresses
In any of the specified methods (unless explicitly stated otherwise), you can use either CAIP format (specifically CAIP-10) or the ETH address format.
Recall that CAIP, or Chain Agnostic Improvement Proposal, is a way to describe standards for blockchain projects that are not specific to a single chain. It was developed by the Ethereum Improvement Proposal (EIP) process and is used to identify and encode information about Ethereum addresses, contract addresses, and other crypto-assets. For example, an ETH mainnet address would be in the form:
eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdbThe sockets API uses CAIP-10 (but defaults to the Ethereum address format), which is a specific proposal within the CAIP specification that focuses on the identification of blockchain addresses. It defines a format for representing addresses in a way that is both chain-agnostic and human-readable.
The ETH address format is supported for backwards compatibility. For example, an ETH mainnet address would be in the form 0xab16a96d359ec26a11e