Websocket Feeds

The Instamint websocket allows STOMP clients to subscribe to feeds that provide notification of events. The websocket is accessible via http://ws.instamint.network subscribe to /feed/kafka.

Please note that websocket channel names are subject to change

Currently the events that are supported include:

EventFires when..


An asset is attempted to minted, when minting is successful or fails


An auction is created, closed or when a bid arrives or ask is adjusted


An asset is sold at an auction


An asset is transferred

The below Python code establishes a STOMP-based websocket client that listens to events and prints them to the terminal

import websocket
import stomper
import time
from threading import Thread

class Client:
    def connect(self):
        self.ws = websocket.WebSocketApp("ws://ws.instamint.network/ws",
                    on_message = self.on_msg,
                    on_error   = self.on_error,
                    on_close   = self.on_closed,
                    on_open    = self.on_open)

    def on_open(self, ws):
        self.ws.send(stomper.subscribe("/feeds/kafka", "sub3", ack="auto"))

    def on_msg(self, ws, msg):
        frame = stomper.Frame()
        unpacked_msg = stomper.Frame.unpack(frame, msg)
        print("Received the message: " + str(unpacked_msg['body']))

    def on_closed(self, ws):
        print("The websocket connection is closed.")

    def on_error(self, ws, err):

    def send(self, feed, msg):
        f = stomper.Frame()
        f.unpack(stomper.send(feed, msg))
        frame = f.pack()

client = Client()
thread = Thread(target=client.connect, daemon=True)

Last updated