How to Get a New Raydium Pair on Solana? - solana

I want to build an API to find a new raydium pair on Solana.
Like this :
https://api.raydium.io/v2/main/pairs
How can I achieve that with solana/web3.js or native rust?

Related

How to specify Metaplex NFT collection image in Phantom wallet

I've created a Solana NFT through metaplex. 1 out of 1.
It's showing up in my Phantom wallet on mobile however it's different from the NFTs purchased on solanart.
On the NFT screen, it says "Collection NFT" and shows the actual image only if I tap into the collection (last one).
What should I do to make it look like the purchased ones?
Also somehow another unspecified and empty (no metadata) NFT is also there and I'm not sure what it is (third one in the list).
Quite new to this, so probably missing something simple...
Thank you!
regarding the "Collection NFT" - You have to manually add metadata to the NFT:
Upload a new JSON + PNG pair (e.g. with arloader, sol-nft.tools arkb). It should can look like any other NFT metadata but should contain the collection data that will be shown.
use cli-nft.ts create-metadata or metaboss to add the uri (from the step 1) to the collection nft mint
Update June 2022: There is now a way better method to updating single NFTs:
Search your collection adress (Open a NFT on solscan, look into the metadata tab. There is a "collection" value which is your collection address). Copy it.
go to https://sol-tools.tonyboyle.io/update-nft and connect your wallet
enter the collection address
Modify whatever you need
Regarding the third NFT in your list: It looks like that you did not verify the upload and therefore the data was not on chain when the token was minted. Have a look here: https://docs.metaplex.com/candy-machine-v2/verify-upload

How do I use capture groups in Regular Expressions in Bot Composer

I am attempting to build a Microsoft Teams bot using the Bot Framework Composer. What I would like to do is create an integration with ServiceNow. The goal would be that if anyone posts a record number (ex. REQ0123456, INC0123456, KB0123456) into the group or direct chat (with the bot), the bot would look up that record and provide a card or a short summary of the record to the chat.
To avoid creating a completely separate intent for each record type, I was hoping to use RegEx to gather the match into 2 capture groups; one for the tbl_code and one for the number.
Here is the entry for the user input:
> add some example phrases to trigger this intent:
- look up {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lookup {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lu {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
> entity definitions:
# regex sn_record tbl_code, number = /([a-z]{2,4})([0-9]{7})/mi
The Issue I'm Having
I don't know how to get the values back from the individual capture groups. I would like to have them separate so that I can determine which table needs to be queried. I could probably just use the entire match and the search API in ServiceNow for the whole record string, but I would still like to know how to use capture group values.
I'm currently using turn.recognized.text, but I don't think this is the best method for what I'm looking to do. This returns the entire regex match.
I'm very new to this framework, so please be gentle. :) Let me know if there is more information I can provide.
Thanks all.
Best Regards,
Josh
I was able to figure this one out using the examples in the ToDosSample bot.
The answer was to use named capture groups and then add them to a dialog property to use in the corresponding dialog.
For reference here are the changes I had to make:
New Regex
(?<sn_record>(?<tbl_code>[a-z]{2,4})(?<numbers>[0-9]{7}))
New Dialog Properties
dialog.sn_record = #sn_record
dialog.sn_tbl_code = #tbl_code
dialog.sn_numbers = #numbers
New response
- Okay, looking up ${dialog.sn_tbl_code}${dialog.sn_numbers}

Implement AEM search using query builder API using wildcard-contains in node name

I have a requirement to fetch search results based on partial/wild card in node name to retrieve AEM forms portal data.
For example, if there are multiple draft Id node under any user-email (Unique node created under /conten/forms/fp). each draft application node will reside under conten/forms/fp/.com|.net/metadata/draftId
Note: User nodes will have .com or .net in the end. Image also attached for reference. I should get testsonar#mailiantor.com/testsonar%40#mailinator.com as result since the user has more than one draft application.
My requirement is to find out users who are having multiple drafts. Can anyone suggest this would be possible using Query builder API . I have tried below predicate but noticed that wild card is not supporting in path.
type=nt:unstructured
path=/content/forms/fp/*/drafts/metadata
path.exact=false
path.false=false
When using predicates you should be able to use something like this:
group.1_property.value=%term%
group.1_property=jcr:path
group.1_property.operation=like

In Polkadot-js is there a method to create HD wallet addresses

I am using Polkadot-js api and wondered if there is an API to generate hierarchical deterministic wallet addresses from a given seed?
I see that there is some mention of soft and hard derivation paths, in Substrate's subkey documentation but do not know if this has been ported to Polkadot-js or how it could be invoked.
SURI are supported by Polkadot-js using createFromUri or addFromUri to create or add a new account to your keyring.
You can import keyring from '#polkadot/ui-keyring' and then use it:
keyring.createFromUri(`${phrase.trim()}${derivePath}`, {}, pairType)
Here is the definition of the function
edit: The derive path could be any combination of /[soft], //[hard], that can be repeated and don't have to be in this order, on top of this, you can have an additional ///[password].
So you can pass as argument to the createFromUri function, something like:[mnemonic phrase]//Kusama//DAO/1 or [mnemonic phrase]//MyMainFunds/0///ThisIsMyPassword.

Find exhaustive list of restaurants around a location within a specified radius in android

I am working on an Android App. I want to get list of all restaurant around me within a specified radius(let say 5 miles). I tried using Google places API and it works, however it limits the number results returned to 20, what if there are more than 20 restaurant in that radius around me. How do I get an exhaustive list of all the restaurants? What is the best way to do this? Is there something other than Google Places API that I can use? Thanks for your help in advance.
If you want to do it server side you can use this guy's class :
http://andrenosalsky.com/blog/2011/google-places-api-php-class/
and you have to get an api key as it is explaned here :
http://code.google.com/intl/fr/apis/maps/documentation/places/
then you can send data in JSON format to your Android

Resources