You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/prettier/prettier)
5
6
6
7
A Javascript SDK for receiving updates from the OpenSea Stream API - pushed over websockets. We currently support the following event types on a per-collection basis:
Copy file name to clipboardExpand all lines: src/types.ts
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,11 @@
1
1
importtype{SocketConnectOption}from'phoenix';
2
2
3
+
exporttypeOnClientEvent=<Payload>(
4
+
collection: string,
5
+
eventType: EventType,
6
+
event: BaseStreamMessage<Payload>
7
+
)=>boolean;
8
+
3
9
/**
4
10
* OpenSea Stream API configuration object
5
11
* @param token API key to use for API
@@ -8,6 +14,7 @@ import type { SocketConnectOption } from 'phoenix';
8
14
* @param connectOptions `SocketConnectOption` type to use to connect to the Stream API socket.
9
15
* @param onError a callback function to use whenever errors occur in the SDK.
10
16
* @param logLevel `LogLevel` type to define the amount of logging the SDK should provide.
17
+
* @param onEvent a callback function to use whenever an event is emmited in the SDK. Can be used to globally apply some logic, e.g emitting metric/logging etc. If the onEvent handler returns false, event will be filtered and the subscription callback won't be invoked.
0 commit comments