Git Product home page Git Product logo

sol-rayz's Introduction

@nfteyez/sol-rayz

These packages created to simplify the process of parsing NFTs on Solana. The project written in TypeScript and is used/battle-tested by NftEyez.Global with thousands of daily users.

DEMO: Galley Demo

How to use

The simplest way to use it in your app is install package, also you need install @solana/web3.js in your project, since it is used as peer dependency.

npm i @solana/web3.js
npm i @nfteyez/sol-rayz

then use it this way:

import {
  resolveToWalletAddress,
  getParsedNftAccountsByOwner,
} from "@nfteyez/sol-rayz";

// const address = "3EqUrFrjgABCWAnqMYjZ36GcktiwDtFdkNYwY6C6cDzy;
// or use Solana Domain
const address = "NftEyez.sol";

const publicAddress = await resolveToWalletAddress({
  text: address
});

const nftArray = await getParsedNftAccountsByOwner({
  publicAddress,
});

Details

This project consists of 2 packages. Please refer to specific README file for in-depth details:

  • @nfteyez/sol-rayz - basic functionality, like fetch all NFTs for specific wallet or by Authority. Designed to be used in browser or Node.JS env. Read Details.
  • @nfteyez/sol-rayz-react - bunch of hooks and utils to be used within React app. You can think of it as highlevel construction upon @nfteyez/sol-rayz package to simplify its use in UI. Read Details.

Development

This section related only for the people who wants contribute to this project.

Instructions for starting project for the contributors. Clone repo, run in root of the project:

yarn
yarn run build

Development process

You might want to test package while you do changes. For this purpose you can use react app in packages/sol-rayz-dev and start package you are working on in watch mode, for example sol-rayz:

# go to sol-rayz
cd packages/sol-rayz
yarn run watch

# in new tab go to react app
cd packages/sol-rayz-dev
yarn run start

Now when you changes something sol-rayz package it will be automatically updated in sol-rayz-dev app.

Add New new dependency to some package

Here is example how to add new dependency module @solana/spl-name-service to @nfteyez/sol-rayz package:

 lerna add @solana/spl-name-service --scope=@nfteyez/sol-rayz

sol-rayz's People

Contributors

bdtren avatar jamland avatar joshuajaco avatar leonalvarez avatar ujjwalgupta49 avatar veritasv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sol-rayz's Issues

dependency errors

after installing this package I've encountered a few errors with it's dependencies:
Screenshot from 2022-03-30 15-26-58

AngularJS adaptation

Hello guys !
I would like to use this library in my AngularJS App, but I cant use this one as its in TypeScript and made for React.

Does anyone knows how I can make it work?

Would that be possible to build a vanilla JS script for it ?

Thanks :)

Module not found error

Hi, I installed and am trying to use in my create-react-app but I'm getting this error. Any ideas?

Compiled with problems:

ERROR in ./node_modules/@solana/spl-name-service/dist/utils.js 14:33-50

Module not found: Error: Can't resolve 'asseCompiled with problems:

ERROR in ./node_modules/@solana/spl-name-service/dist/utils.js 14:33-50

Module not found: Error: Can't resolve 'assert' in '/media/joeyspen/Game Drive/learning/SolanaProject/node_modules/@solana/spl-name-service/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }


ERROR in ./node_modules/@solana/spl-name-service/dist/utils.js 16:17-34

Module not found: Error: Can't resolve 'crypto' in '/media/joeyspen/Game Drive/learning/SolanaProject/node_modules/@solana/spl-name-service/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
	- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "crypto": false }rt' in '/media/joeyspen/Game Drive/learning/SolanaProject/node_modules/@solana/spl-name-service/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
	- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "assert": false }


ERROR in ./node_modules/@solana/spl-name-service/dist/utils.js 16:17-34

Module not found: Error: Can't resolve 'crypto' in '/media/joeyspen/Game Drive/learning/SolanaProject/node_modules/@solana/spl-name-service/dist'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
	- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "crypto": false }

get nft image

Is there a way to get the NFT image without a fetch to data.uri ?

limit is missing from useWalletNfts hook

There is no filed as limit in this hook type

export declare type Options = {
    /**
     * Wallet public address
     */
    publicAddress: StringPublicKey;
    /**
     * Optionally provide your own connection object.
     * Otherwise createConnectionConfig() will be used
     */
    connection?: Connection;
    /**
     * Remove possible rust's empty string symbols `\x00` from the values,
     * which is very common issue.
     * Default is true
     */
    sanitize?: boolean;
    /**
     * TODO: Add description within README and link here
     * Default is false - slow method
     * true - is fast method
     */
    strictNftStandard?: boolean;
    /**
     * Convert all PublicKey objects to string versions.
     * Default is true
     */
    stringifyPubKeys?: boolean;
    /**
     * Sort tokens by Update Authority (read by Collection)
     * Default is true
     */
    sort?: boolean;
};

Problem:
As there is no limit constraint in it. It's currently fetching all of the nft from the wallet.
For example, I have a wallet which has a ~10K nfts, sadly it is fetching all of them at once, making the browser stuck & hanged.

Screenshot 2022-05-12 at 1 29 55 PM

Q: How can I use the limit here @jamland?

example of createConnectionConfig

@jamland do you have an example using/passing in the createConnectionConfig object? i am using a private rpc.

no matter how i try to pass clusterAPI into my connection functions, sol-rayz uses devnet. i definitely admit i don't understand everything, but a working example here would be very helpful.

thanks for making this, sol-rayz has helped a lot in my projects.

Getting 403's

Hi! I have an app NotForSaleCC/frame#1 based on the Demo Gallery project, but I am getting the following error now:

403 : {"jsonrpc":"2.0","error":{"code": 403, "message":"Access forbidden, contact your app developer or [email protected]."}, "id": "xxxxx" }

P.S. I was out of the project for about a year now, so I didn't follow all the updates in the Solana space.

Cannot find module './types' or its corresponding type declarations.

Hey,
I installed and tried to use this package on Angular.
I get this error on build.

Please advice,
Thanks


Error: node_modules/@nfteyez/sol-rayz/dist/config/metaplex.d.ts:1:33 - error TS2307: Cannot find module '../types' or its corresponding type declarations.

1 import { StringPublicKey } from "../types";
                                  ~~~~~~~~~~


Error: node_modules/@nfteyez/sol-rayz/dist/getParsedAccountByMint.d.ts:2:33 - error TS2307: Cannot find module './types' or its corresponding type declarations.

2 import { StringPublicKey } from "./types";
                                  ~~~~~~~~~


Error: node_modules/@nfteyez/sol-rayz/dist/getParsedNftAccountsByOwner.d.ts:2:33 - error TS2307: Cannot find module './types' or its corresponding type declarations.

2 import { StringPublicKey } from "./types";
                                  ~~~~~~~~~


Error: node_modules/@nfteyez/sol-rayz/dist/resolveToWalletAddress.d.ts:2:33 - error TS2307: Cannot find module './types' or its corresponding type declarations.

2 import { StringPublicKey } from "./types";
                                  ~~~~~~~~~




โœ– Failed to compile.

ReferenceError: TextEncoder is not defined

Getting this error when trying to use sol-rayz

ReferenceError: TextEncoder is not defined at Object.<anonymous> (/home/runner/staked-particles-counter-bot/node_modules/@nfteyez/sol-rayz/src/utils.ts:23:32) at Module._compile (internal/modules/cjs/loader.js:778:30) at Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Object.require.extensions.(anonymous function) [as .js] (/usr/local/lib/node_modules/ts-node-fm/src/index.ts:406:14) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/home/runner/staked-particles-counter-bot/node_modules/@nfteyez/sol-rayz/src/getParsedNftAccountsByOwner.ts:9:1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.