How to get NFTs Information by name with web3.js on solana network - web3js

I would start saying that i'm completely new to this world of web3.
What i would like to do is :
Retrieve info's of NFTs from solana network.I would like to retrieve the info by the name.
From reading metaplex documentation and https://docs.solana.com/ i guess it's impossible to do so.
So does i have to do something like this:
Connect to candy machine and find all the nfts and save them in the db with all info's and than obviously make calls to db by name?
My goal is to have all the info's of nft and allow end user to search it by the name.
Any help is appreciated. Just need a path or any little suggestion. Thanks

In order to search things on Solana, you have to give the account that you want to search and then deserialize its info. In this case each NFT has its own account on solana (you can get all accounts that were minted from a CandyMachine (all NFTs).
The deserialization part given an ID is really easy using js-next library provided by metaplex. So you just have to find all NFTs that were minted from a CandyMachine (you can use metaboss or a rpc call).
When you deserialize the NFT you will have access to its name and json metadata url so you can do whatever you want with that info.

Related

How do I upload/import a Dart database to Firebase? Information based app content

I have built an information based app with server side content that is displayed for the user to view but not edit or generate on their own. The information is examples of Species and the User is able to favourite a Species. Currently I have the Species hardcoded in a Dart db and is passed throughout the app when navigating or favouriting to that runtime instance.
I have set up users through firebase. I assume I will need to convert my Species db to JSON and store as a collection on Firebase in order for the user to favourite and instance of a species. My question is how do I upload or import my Dart database into Firebase? I know there's the JSON conversion but I assume we don't want to run that everytime the app loads.
Any help or guidance as I haven't found anything just yet, it may be my ignorance of nomenclature! I don't believe it is a real time database, but please correct me. Thanks.

Proper way to setup Firestore-database for friendlist-system

Im very new to Android development. At the moment I am trying to develop my first app. My app is going to have a friend-system. Im trying to setup the Firestore-database to match my conditions.
I want to use the UserID provided by the google authentication to control the access of the database.
Every user has a friendlist of usernames,since I think, its not safe to let any client know the UserID of another client.
My Firestore database looks like this:
"users" (collection)
UserID (document)
DisplayName, Username (fields)
"friendlist"
UserID
Username1,Username2,Username3...
Everytime I want to access data of a user inside my friendlist a have to retrieve data from the users-collection using the UserID-document. Since the client isnt allowed to know the UserID of the friend, I need another collection which I am planing to access through cloud functions to know which userID belongs to the username.
"usernames" (collection)
Username (document)
UserID (fields)
Is there a better way to minimize database-reads while protecting database accesses?
You could try looking for the UserID(document) based on the Username filed taking the answer from this other thread as a starting point.
Nevertheless, you would need to make sure that the Usernames do not repeat as this may cause issues later on by programming a check in the insertion of updates of usernames.
Otherwise, the solution you are planning would work although with the caveat that you may get a higher billing in the future as you are billed for every read as mentioned here.
Hope you find this useful!

Does exposing a user's uid in the url pose a security threat for Firebase?

I've got a small review system built in AngularJS and Firebase and the only way to identify which review is made by which user is via the uid of the user. The idea is when you then click on the user's name, you should be taken to the profile of that user.
So I would then create a route looking like /profile/{{review.author.uid}} which could translate into /profile/facebook:123234243 for example.
My question is, does it pose a security threat showing the uid in the url like this? Can it be used for any malicious actions against a user's third party account etc?
I've tried looking through their website but I can't find anything on this subject.
EDIT: Note that I need a Firebase specific answer, not a generic one about database id:s.

Integrate SurveyMonkey in an existing community

I have a cakePHP community. User are able to signup and login. I like to create a survey using SurveyMonkey.
Therefor I create the survey and make it available to my members using the direct URL. In my member database I have to save the information "did completed the survey = yes/no".
Is there any way to identify the user filling in the survey and write this information into the database?
SurveyMonkey has an API https://developer.surveymonkey.com/ , that let you collect info from your survey (completedf or not).
This is the only way i think, (if it s not include in your website).
I know that you can simply do this with Examinare Survey Tool. What you do first is that you use the API inside Examinare to add a recipient for all the users in the survey base.
Use the PHP Wrapper library in their developer site.
Loop it through and use the https://developer.examinare.com/php-wrapper-library/ and use the example code.
If you let people register with same email more than 1 time then save the ContactID into your database on the recipient.
Then to not create an email invite you use this : markrecipientstosurvey
The surveyID is available inside the Examinare account.
When you done this script part then make it as a cronjob for instance inside the crontab -e
I would run it every 30 minutes or 1 per hour.
Next part you create a page for the survey redirect where you use the function: listsurveysbyuser
to get the survey version and url
(there is a special link for the mobile user that even works for the normal mobile phone NOT only smartphones)
Now you just redirect them to the survey. If you want them to return to your site after then you use the redirect_url parameter that is added to the url or use the redirect inside your account. Ask support about that if you need :) They are fast... Never had to wait more than a couple of minutes.
When the person return then just check if they are marked as complete with the same api call: listsurveysbyuser
Looks much but it is very easy to implement and if you have any problems then just ask the support at support#examinare.com I have asked alot and never had them to say that it can not be done. Really nice!
EDIT:
I see that they just released a tutorial much better than my example:
https://developer.examinare.com/how-to-use-surveys-in-cakephp-with-very-little-development/
One option:
Use unique Custom Variables in the URL that is visited by each member of the community
For example, https://www.surveymonkey.com/s/your_survey?userid=$my_user_id
Note that you can create weblink or email collectors with the API (endpoints: create_flow or create_collector).
Then track the responses using the get_respondent_list or get_responses endpoints of the API.
Note: Please confirm with the Survey Monkey API team that the custom variables can be read via the API.
Another option:
Use the email collector (create_flow) API endpoint and send it to your members' email addresses.

The suitable way to import data to CRM ( Smartsheet) from website?

I'm doing wordpress website. And what i wanna do is: when user send contact form ( include their information) or user register, their information is added to CRM directly.
What i wonder is :
1) I should write my own plugin to do these things? possible? Because I think it will get the problem of permission ( when access to CRM)
2) There is a contact plugin which data is saved to database. Can we do cron tab to add data every period of time?
Can I ask you guy:
Are 2 above ways possible?
Are there any easier and possible way to do?
Really appreciate your help.
It's quite possible for Smartsheet to receive such information through the Smartsheet API. To help you get started with connecting to the API with PHP, and sending data to your sheet, I recommend looking at the Smartsheet Platform PHP Samples.
For your particular situation I would look at the Sheet Structure sample.

Resources