Are there OpenSea Webhooks for monitoring NFT collections? - javascript

Does OpenSea have a webhook API for sales of a given Ethereum NFT collection? I see they have a streaming JS API which uses websockets but I can't seem to find a server oriented API.
They posted a reply to someone on Twitter in 2018 about clicking "More" then "Subscribe" on a collection webpage to setup a webhook but it seems this functionality has disappeared.
If not, is it possible to use their websockets JS api on a server (as opposed to a browser)?
And if that's not possible does anyone know of a solution to this problem (receiving POST requests on a server when transactions of a given NFT contract occur)?

Related

AWS SNS with FMC for SMS

I am developing a React native application where I want to sent an SMS for OTP. I used AWS SNS for publishing messages after subscribing them to a topic, but I found that the price is quite high since the SMS is transactional.
I wanted to use Firebase Messaging Cloud since they do it for free but I don't really know how to proceed with it. Do I have to createPlatformApplication and then do createPlatformEndpoint for every user to send messages? This is a bit confusing for me, so if someone could give me an overview of the initial processes, it would do me wonders.
This is how I am doing it now simply using subscribe and publish:
I understood your question as asking how you could deliver OTP codes using push notifications.
To do that, you would:
Set up a platform application through SNS: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-register.html
Create an endpoint for each end device you want to send these notifications to: https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html
Do a direct publish to that endpoint to send the notification only to that person: https://docs.aws.amazon.com/sns/latest/dg/mobile-push-send-directmobile.html
For this use case, you do not need to use topics and subscriptions, since all of your messages will only be targeting one person.

Use separate server for centralized users database

I am using Meteor 1.10 + mongodb.
I have multiple mobile chat & information applications.
These mobile application are natively developed using Meteor DDP libraries.
But I have same users base for all the apps.
Now I want to create a separate meteor instance on separate individual server to keep the users base centralized.
I need suggestions that how can I acheive this architecture with meteor.
Keeping reactivity and performance in mind.
For a centralized user-base with full reactive functionality you need an Authorization Server which will be used by your apps (= Resource Servers) in order to allow an authenticated/authorized request. This is basically the OAuth2 3-tier workflow.
See:
https://www.rfc-editor.org/rfc/rfc6749
https://www.oauth.com/
Login Service
You will also have to write your own login handler (Meteor.loginWithMyCustomAuthServer) in order to avoid DDP.connect because you would then have to manage two userbases (one for the app itself and one for the Authorization Server) and this will get really messy.
This login handler is then retrieving the user account data after the Oauth2 authorization request has been successful, which will make the Authorization Server's userbase the single point of truth for any of your app that is registered (read on Oauth2 workflow about clientId and secret).
Subcribing to users
The Auth server is the single point of truth where you create, updat or delete your users there and on a successfull login your local app will always get the latest user data synced from this accounts Auth Server (this is how Meteor does it with loginWith<Service> too)
You then subscribe to your users to the app itself without any ddp remote connection. This of course works only if the user data you want to get is actually for online users.
If you want to subscribe for any user (where the data might have not been synced yet) you still need a remote subscription to a publication on the Authorizazion server.
Note, that in order to authenticate users with this remote subscription you need an authenticated DDP request (which is also backed by the packages below).
Implementation
Warning - the following is an implementation by myself. This is due to I have faced the same issue and found no other implementation before mine.
There is a full working Accounts server (but constantly work in progress)
https://github.com/leaonline/leaonline-accounts
it uses an Oauth2 nodejs implementation, which has been wrapped inside a Meteor package:
https://github.com/leaonline/oauth2-server
and the respective login handler has also been created:
https://github.com/leaonline/meteor-accounts-lea
So finally I got a work around. It might not be the perfect way to handle this, but to my knowledge it worked for me so well. But yes I still open for suggestions.
Currently I have 4 connecting applications which are dependent on same users base.
So I decided to build SSO (Centralized Server for managing Users Database)
All 4 connecting applications ping SSO for User-Authentication and getting users related data.
Now those 4 connecting applications are developed using Meteor.
Main challenge here was to make things Reactive/Realtime.
E.g Chat/Messaging, Group Creations, Showing users list & listeners for newly registered users.
So in this scenario users database was on other remote server (SSO), so on connecting application I couldn't just:
Meteor.publish("getUsers")
So on connecting applications I decided to create a Temporary Collection called:
UserReactiveCollection
With following structure:
UserReactiveCollection.{
_id: 1,
userId: '2',
createdAt: new Date()
}
And I published subscription:
Meteor.publish("subscribeNewUserSso", function () {
return UserReactiveCollection.find({});
});
So for updating UserReactiveCollection I exposed Rest Api's on each connecting application respectively.
Those apis receive data from SSO and updates in UserReactiveCollection.
So on SSO side when ever a new user is registered. I ping those Apis (on connecting applications) and send the inserted userId in the payload.
So now those connecting applications receives onDataChanged ping from the subscription and gets userId.
Using that userId the connecting applications pings back to SSO and get user details of that specific userId and prepends to the users list.
Thats how I got it all working so for now I am just marking my answer accepted but as I mentioned above that: "It might not be the perfect way to handle this, but to my knowledge it worked for me so well. But yes I still open for suggestions."
And special thanks to #Jankapunkt for helping me out.

Getting feedback from a JavaScript application without a registering for a centralized service

I created a Chrome extension which is just HTML/CSS/JavaScript. When the user clicks on a button, I have it send a message to me. But the problem is I don't want to include any API keys or server information where the app can POST to as it can be used for abuse if someone was to extract this information from my Chrome app. Is there a method of getting a response from a web app with a public service where anyone can post to? I was thinking pastebin, but even that requires an API key.
You could ask the user to create their own key. For example, many GitHub extensions require an API key to make requests to the GitHub API, so what they do is they send you to a GitHub settings page where you can create a personal API key.

Is there a way to get notifications from YouTube API when broadcaster is live

I'm creating a app that has a database of users who stream there computer game play from YouTube, is there a way to get a notification from YouTube API that will tell me when the gamer is live so I can randomly broadcast each live video for 2 minutes each?
I think it requires a websocket connection with your api endpoint by using ws:// protocole at some point. Websocket listen to a server, and enable your browser to handle it's changes like events. So it's exacly what u need for notifications.
In RoR 5 you can do it using ActionCable.
I've used Rails 5's ActionCable to handle notifications. But sinds I've only used it to listening to changes inside the server of my own Rails app's and not an API endpoint so I won't be able to give you a step by step guide.
You should checkout how to make an action cable connection with an API end point.
Here is a documentaion that might help u out:
RoR doc on ActionCable
MDN docs on Websocket
The way you looking for is YouTube Live Streaming API.
the documentation of the API can be read from this link
It appears the GET https://www.googleapis.com/youtube/v3/liveBroadcasts endpoint is what you want.
Returns a list of YouTube broadcasts that match the API request parameters.
However, getting a notification will require some work. It will probably require polling the endpoint for changes to determine if a new broadcast has been started. I'm not aware of a PUSH API from YouTube to send a request to an endpoint of your choice to create a notification.
More info in the Youtube docs.

How to send push notifications to Google Firebase web application

Can anybody provide information on how to setup push notifications for a chrome web application?
How to setup topics, create new topics, delete topics and what the syntax would be.
I searched the internet using what tools we have and come up with nothing.
Thank you.
There is no client-side API for web applications to subscribe to topics. You can use the REST API, but that requires running a trusted process (i.e. on a server). See my answer here for details: How to subscribe to topics with web browser using Firebase Cloud Messaging
Note that in general there is no API to create/delete topics. Topics are automatically created when you subscribe to them or send a message to them.

Categories

Resources