Git Product home page Git Product logo

xray's Introduction

https://xray.helius.xyz/

Relevant Links

πŸ”— Link: https://xray.helius.xyz/

πŸŽ₯ Demo: https://www.loom.com/share/402a4397ebd1403f8f4b7df8f024e9b8

🐀 Twitter: https://twitter.com/xray_explorer

πŸ’¬ Discord: https://discord.gg/HjummjUXgq

Support

🀝 Contribute

  • Fork XRAY onto your own GitHub
  • Clone it and make sure you're on the dev branch.
  • Create a new branch named [initials]/[feature] off of dev. Example q/added-a-cool-thing.

Create PR

When you're ready for your changes to be reviewed, create a PR with your new branch to be merged into the dev branch on the official repo.

Pro Tip (Draft PR)

If you're working on something and want to share the progress but aren't ready for merge, click the little arrow next to "Create PR" and chose "draft".

draft

Then when you're ready to create the PR, click "Ready for review".

ready

Test

To save time, run tests locally, but they will also run on all PRs to dev and main. Tests will need to be passing for your changes to be merged.

Auto merge dev -> main**

Once changes are approved and merged into dev, they will be assumed as good and auto merged to main. From here they can be deployed by merging to either the vercel/staging or vercel/prod branches.

[Temp] Auto merge main -> vercel/staging

For now we are auto deploying everything in main to staging.

πŸƒπŸ½β€β™‚οΈ Runbook

This is a TurboRepo monorepo that can run and build all apps/packages in parallel. Apps like the UI are located in /apps. Packages used across apps are located in /packages.

Recommended VSCode Extensions

Tech Stack

Setup Environment

In the root of the project, create a .env file with the values mentioned in .env.template.

Install

Run the install command from the root of the project to install dependencies for all apps and packages.

npm install

Dev

Start all packages and apps in dev mode which watches for changes and adds your local environment.

npm run dev

Lint

It's recommended you use VSCode beacuase if you do, ESLint is setup to auto fix/format as you're working.

npm run lint

Format

Formats files based on the Prettier and ESlint settings.

npm run format

Test

Tests the code, determines if it should be allowed to merge. We recommend running this locally before creating PRs.

npm run test

Build

Build all apps and packages for production.

npm run build

Build Local Environment

Build all apps and packages for production using your .env file.

npm run build:env

πŸš€ Deployments

Environment Description Directory
Production The main deployment attached to the domain. vercel/prod https://xray.helius.xyz/
Staging Staging branch based on contents of vercel/staging https://xray-web-git-vercel-staging-helius.vercel.app/

πŸ“¦ Packages

Name Description Directory
@helius-labs/xray-web SvelteKit app with UI and backend endpoints. apps/web
@helius-labs/xray-proton Parses transaction data to produce UI state. packages/xray-proton
@helius-labs/xray-database [WIP] Prisma client used for communicating with database. packages/xray-database

πŸ“± @helius-labs/xray-web

A SvelteKit app that contains the main XRAY UI.

Important Files & Folders

πŸ“ ./src/lib Common components, utilities, and libraries used throughout the app. Import things from this directory using the $lib/ alias.
πŸ“ ./src/lib/trpc The tRPC server which has all of our backend endpoints. See trpc/routes.
πŸ“ ./src/lib/components Shared components used throughout the app.
πŸ“ ./src/lib/trpc The tRPC server which has all of our backend endpoints.
πŸ“ ./src/lib/types Global types
πŸ“ ./src/lib/configs Config definitions for things like the icons, modals, and generating other types.
πŸ“./src/routes Any +page or +server file in this directory becomes a page or an endpoint based on the folder structure.
πŸ“./static A place to put any static assets. The files in this directory are hosted at the root of the domain. When using images, try to import them in the <script> vs put them in ./static when you can help it.
πŸ“„./app.postcss Initialize/config Tailwind + global styles.
πŸ“„./app.html The top level HTML template that wrapps all pages. Routes are injected into the %sveltekit.body% tag.

Routes

/ Home
/api REST endpoints (This is mostly replaces by tRPC now)
/[search] From the home page, users can navigate to /anything which attempts to resolve the search and then redirect them to /[search]/tx, /[search]/wallet, or /[search]/token based on the search.
/[search]/tx Details about a particular transaction where [search] is a transaction signature.
/[search]/wallet Details about a particular wallet where [search] is a public key.
/[search]/token Details about a particular token where [search] is a token mint address.

Vercel Config

Build Command cd ../.. && npx turbo run build --filter=web...
Output Director apps/web/.svelte-kit
Install Command npm install --prefix=../..

Styles

TailwindCSS is used for base utilies and DaisyUI contains helpful UI components.

Icons

See list of available icons in $lib/config.

Use Icons

<script>
    import Icon from "$lib/components/icon.svelte";
</script>

<Icon id="paper-plane">

Add Icons

  1. Find the icon you want on IconMon. Most of these should render fine.
  2. Click "Embed" -> "Inline" and copy only the <path>.
  3. Add a new key to $lib/config.ts that is similar to the Icon Monsters name for the icon and add your <path>.

State Management

WIP

πŸ“¦ @helius-labs/xray

A package that includes our parser, which helps make blockchain data pretty for the UI, and search function.

Important Files & Folders

πŸ“„./src/lib/parser/index.ts UI calls the function in this file to parse transactions
πŸ“„./src/lib/parser/types.ts Contains the types, interfaces, and enums needed to understand to work on the parser.
πŸ“./src/lib/parser/parsers Contains all parser methods.
πŸ“„./src/lib/parser/parsers/index.ts Exports parser files in ./src/parsers.
πŸ“„./src/lib/parser/parsers/unknown.ts If there is no dedicated parser file for a Helius transaction type, they are parsed in this file. Changing the label on the UI is in ./apps/web/src/lib/config.ts.
πŸ“./src/lib/parser/utils Utility functions for the parser functions
πŸ“„./src/lib/search.ts The function that resolves search inputs to a URL parameter.

πŸ“¦ @helius-labs/xray-database [WIP]

A database for saving metadata like transaction views or user details.

xray's People

Contributors

0xichigo avatar davidediak avatar dependabot[bot] avatar febo avatar github-actions[bot] avatar helius-wedtm avatar ilovespectra avatar isyqozz avatar jim4067 avatar joaomendoncaa avatar joeetwork avatar kelreel avatar khaliljouaneh avatar meta-light avatar owenventer avatar qudo-code avatar rocketfren avatar shreyanshrathore avatar solhosty avatar ssamkkim avatar therealnospoon avatar tidelaw 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  avatar  avatar  avatar

xray's Issues

πŸ› [BUG] - Unnecessary Load More Button

Description

The "Load More Button" shouldn't show for assets if there aren't any more assets to load. In the screenshots, for example, the example account only has one asset. You can click the "Load More" button, and, after trying to load more assets, it disappears since the user does not have any more assets to load

Reproduction URL

https://xray.helius.xyz/account/GNPwr9fk9RJbfy9nSKbNiz5NPfc69KVwnizverx6fNze/assets?network=mainnet

Reproduction steps

1. Go to https://xray.helius.xyz/account/GNPwr9fk9RJbfy9nSKbNiz5NPfc69KVwnizverx6fNze/assets?network=mainnet
2. See error

Screenshots

![image](https://github.com/helius-labs/xray/assets/96965321/3d4fc3f4-954d-4274-a562-ef4616bc07e7)
![image](https://github.com/helius-labs/xray/assets/96965321/0fc3805a-595a-4eca-945b-03bcee2a68d5)

Logs

No response

Browsers

No response

OS

No response

πŸ› [BUG] - Wrong amount recognized

Description

One of my tensor pools shows the same sol amount for every buy/sell transaction on the summary view. Clicking into each one and viewing the β€˜account changes’ detail section looks right, but the summary transaction doesn’t tie to that.

here are three (there are more), all showing 2.561 sol involved, but detail shows it should’ve been a different amount.

https://xray.helius.xyz/4PAK8fz1UmZhirQRxGRYfagFsCZwFrNw2WRZYqpEuhQL6hxSB2m5svKTGucjRwwaUT6sT5n7tHfB8CdsvVYXMrnJ/tx

https://xray.helius.xyz/3zBDudvaV8irJDtDGJY7rb9ji7jwJg9errFScb1hwbNCwY5FJ2NRHQDeAsgvmsbpGmgh7tF9a6vbM4efjNHU73T2/tx

https://xray.helius.xyz/2RinsxSSRYwDstyxqrteJXmmmwn7AYGDH1BN9CvLdSDy9D72Buw9uzdP8R18NpcdbNUqNArYF6Xv6PA9dHmtQQ7m/tx

Reproduction URL

https://xray.helius.xyz/rqmEvKKeQhBNbQSCNNH11s85xJTbZzMKmX9XZjD31Qw9BsPZhzs4pN37uCazh1Z38BDFN6tiiyb1Z5MaGXRzYw3/tx

Reproduction steps

1. Blow me

Screenshots

No response

Logs

No response

Browsers

No response

OS

No response

Incorrect balance change shown on tx

TX example

On a CodeCanvas purchase the sol balance change isn't displayed accurately. Here in total 10.02 SOL was sent from the wallet, but the dispalyed amount is 8.9.

The Helius description is also displaying an incorrect amount.

image

The "simple" parsed tx data from Proton seems correct tho.

{
      "account": "XXXXX",
      "changes": [
        {
          "amount": -10.02700408,
          "mint": "So11111111111111111111111111111111111111112"
        },
        {
          "amount": 1,
          "mint": "AMTC1Nhy4QHtRuAsWEx2jtwF8hKhQkksbJac64JDcCb3"
        }
}

πŸ› [BUG] - Token tab of an address inaccurately shows SOL balance as 0

Description

The below account shows it has 3.88 SOL but the list of tokens below it shows SOL as 0. This is reflected for all of the other addresses I've searched for.

Also, if we are only supporting SOL as a token at the moment, the 'Tokens' tab is a bit misleading since it implies it should show all of the user's tokens. Let me know if SPL token accounts are not yet supported for this page of an address. If they aren't, I'll look into it.

Reproduction URL

https://xray.helius.xyz/account/9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8/tokens?network=mainnet

Reproduction steps

1. View the link

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

No response

OS

No response

πŸ› [BUG] - Better Token Recognition

Description

We do not properly display certain tokens under the Tokens page for an account. For example, in the screenshot provided, we do not display any token name or symbol for TheSolanDAO (7SZUnH7H9KptyJkUhJ5L4Kee5fFAbqVgCHvt7B6wg4Xc). This shouldn't be the case, as it is a recognized token on Jupiter and Solscan.

If a token does not have a picture, we should have a fallback picture. We do this when we can't fetch an asset's picture (see the second screenshot)

Reproduction URL

https://xray.helius.xyz/account/68VhXhZSQxBqC1fBLXnFb2tMiuh3tmiizpZKLTYTwgNG/tokens?network=mainnet

Reproduction steps

1. Go to https://xray.helius.xyz/account/68VhXhZSQxBqC1fBLXnFb2tMiuh3tmiizpZKLTYTwgNG/tokens?network=mainnet
2. See error

Screenshots

image
image

πŸ› [BUG] - Token Sorting

Description

On an account page, the account's tokens are not sorted. They should be sorted by the holding's USD value

Reproduction URL

https://xray.helius.xyz/account/GNPwr9fk9RJbfy9nSKbNiz5NPfc69KVwnizverx6fNze/tokens?network=mainnet

Reproduction steps

1. Go to https://xray.helius.xyz/account/GNPwr9fk9RJbfy9nSKbNiz5NPfc69KVwnizverx6fNze/tokens?network=mainnet
2. See error

Screenshots

![image](https://github.com/helius-labs/xray/assets/96965321/11fd4e64-e826-420b-bb3e-5d7d32863d56)

Logs

No response

Browsers

No response

OS

No response

πŸ’‘ [REQUEST] - enable searching tokens and native programs by their names

Summary

I would love to be able to search for tokens and native programs by their names e.g. 'USDC coin' and 'system program' respectively.

Basic Example

got to the search bar and instead of inputting an address you input the name of the token or program

Drawbacks

  • it would be a good feature for folks who have been targeted by phishing attacks and want to confirm the correct address of particular tokens.
  • a possible challenge would be to check for genuine tokens that are not part of a scheme but the jupiter token lists exits

πŸ› [BUG] - shows transaction as successful but it wasn’t

Description

solscan link: https://solscan.io/tx/fAsutqP97uqtNJ21Pm3gVdGwqTXD1nBfHKAzQYy4D1ytGoeoywbitpqcuP2fS2kWSHNXyybDtLjGp9FrojD2B7X
xray link: https://xray.helius.xyz/tx/fAsutqP97uqtNJ21Pm3gVdGwqTXD1nBfHKAzQYy4D1ytGoeoywbitpqcuP2fS2kWSHNXyybDtLjGp9FrojD2B7X

this is an attempt to purchase an item on nightmarket listed on magic eden. transaction did not go through like solscan shows.

Reproduction URL

what

Reproduction steps

see description

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

Safari

OS

Mac

πŸ› [BUG] - Overflow Issue in Enhanced Xray/Webhooks Parsing for Specific Transaction

Description

There appears to be an overflow problem in the enhanced xray/webhooks parser, specifically related to a minting transaction. The parser is returning a negative amount for the transaction, whereas Solscan correctly displays the minted amount.

Affected Transaction

Transaction ID: 62rzY4dSkPRJUwk8JG7Ev8UZLFXagM884VCC3LMUNuWFh9HNzmHRuQRTcqHsGv8kXZeYgUUduy7qbckyBZAcggCf
Solscan Link: Solscan Transaction Details
Xray/Helius Link: Xray/Helius Transaction Details

Expected Behavior
The enhanced xray/webhooks parser should accurately reflect the minted amount for the transaction, similar to the amount displayed on Solscan.

Actual Behavior
The parser is returning a negative value for the minted amount in the transaction.

Reproduction URL

https://xray.helius.xyz/tx/62rzY4dSkPRJUwk8JG7Ev8UZLFXagM884VCC3LMUNuWFh9HNzmHRuQRTcqHsGv8kXZeYgUUduy7qbckyBZAcggCf

Reproduction steps

1. Go to: https://xray.helius.xyz/tx/62rzY4dSkPRJUwk8JG7Ev8UZLFXagM884VCC3LMUNuWFh9HNzmHRuQRTcqHsGv8kXZeYgUUduy7qbckyBZAcggCf

Screenshots

No response

Logs

No response

Browsers

No response

OS

No response

πŸ› [BUG] - <Better Token Account Handling>

Description

Currently, we treat token accounts as tokens instead of accounts. It results in the following page:
image

The proper functionality should be to handle the query logic, so we process this as an account instead of a token

Reproduction URL

https://xray.helius.xyz/token/2mxvY3jePU533oC3WsUm6oC1pcEKmKaJY9pT6nwq8M1m?network=mainnet

Reproduction steps

1. Go to `https://xray.helius.xyz/?network=mainnet`
2. Search for a token account, such as `2mxvY3jePU533oC3WsUm6oC1pcEKmKaJY9pT6nwq8M1m`
4. See error

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.