How to Access NEAR WebSocket Connection

Learn how to connect with NEAR WebSocket.

Step 1: Connect to the secure WebSocket endpoint:

wss://svc.blockdaemon.com/near/mainnet/native?service_name=ws

Step 2: Send an object specifying the type of events you want to filter for and any additional parameters. For more supported methods, refer to the Supported NEAR RPC WebSocket Methods.

For example, to filter for the nft_mint event, you can send the following message:

{  
  "secret": "secret",  
  "filter": [{  
    "account_id": "nft.nearapps.near",  
    "status": "SUCCESS",  
    "event": {  
      "standard": "nep171",  
      "event": "nft_mint"  
    }  
  }],  
  "fetch_past_events": 20  
}

Step 3: Upon connection, the server will send event notifications matching your filter criteria. Each event notification will be in the format specified by NEP-297.

👋 Need Help?

Contact us through email or our support page for any issues, bugs, or assistance you may need.