3

Still very new to this ecosystem. I'm trying to build a ReactApp that can access my NFT's that I have purchased on the Singular App.

High level explanation, how do I do this?

Low level, point me in the right direction?

I'm new and could use a gentle nudge in the right direction.

Thanks

2 Answers 2

4

If you want to gain Access to NFTs which you purchased on Singular, then you are dealing with RMRK NFTs which live in Smart Contracts deployed to the Moonriver Network which is a L1 parachchain on Kusama.

While in theory, Polkadot.js should be capable of querying and decoding data from Moonriver contracts, I'd recommend you to check out the SDK which is developed for this purpose: https://github.com/rmrk-team/rmrk-tools

3
  • 1
    Achim, thanks for getting back to me with the info, but I'm still a little confused. Moonriver Network is on Kusama and MoonBeam is on Polkadot, was my understanding, no? I used the RMRK tutorial to mint my own NFTs on the Kusama network, which I can view on the Singular.app, which I'm now trying to pull into my React App via polkadot-js api.
    – rarara
    Apr 6, 2022 at 7:12
  • Yes, you are totally right! Finally, RMRK is on Kusama, but it isn't an own Parachain there. AFAIK its logic is deployed in Smart Contracts on Moonriver Network, which is a L1 Parachain on Kusama. Moonriver is Kusama, while Moonbeam is Polkadot, I was the one confusing the two here first ;)
    – Achim
    Apr 6, 2022 at 7:22
  • Hehe, yeah I know what you mean, when I first learned of KSM/DOT it was a little confusing MoonRiver/Beam Canary Network all good Achim, thanks for the nudge, found what I was looking for.
    – rarara
    Apr 6, 2022 at 7:49
2

So, thanks to Achim, in the rmrk-tools repo, you can use: https://github.com/rmrk-team/rmrk-tools#fetchremarks

fetchRemarks(api, to, from, prefixes); method call

It's not pretty but it's a start:

async function getRmrks(){
const wsProvider = new WsProvider('wss://kusama-rpc.polkadot.io');
const ADDR = <QUERY_ADDRESS_OF_NFT_MINT>;

const api = await ApiPromise.create({ provider: wsProvider });

const remarkBlocks = fetchRemarks(api, 12128900, 12128990,  [''])
.then( (remarkBlock) => {
    remarkBlock
        .forEach((block)=>{
            block.calls
                .filter((obj) =>{ 
                    if(obj.caller === ADDR) {
                        console.log(obj);
                    }
                });
        });
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.