npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@frakters/fraktionalizer-client-library

v2.3.2

Published

Client library for interacting with FRAKTionalizer solana program

Downloads

8

Readme

frakt-client-library

Library to interact with FRAKT solana program.

Install

npm install frakt-client

Read functions

Get all arts

import { getArts } from 'frakt-client';
import {
  Connection,
  PublicKey,
} from '@solana/web3.js';

  const fraktProgramPubKey = new PublicKey("6zcw5qXiCjScAxYLhxhuPgAo69PSoDijpnWTDGmDVDbv")
  const connection = new Connection("https://api.devnet.solana.com", "processed")
  const arts = await getArts(fraktProgramPubKey, { connection })
  console.log(arts)

See example/tests/getArts.js for a full example.

    [
      {
        metadata: {
          artAccountPubkey: '5GVy2aWvbgtyhc5RXjQJWRSut2H2ntY9spo3hNNGrheX',
          isInitialized: true,
          id: 4,
          first_owner_pubkey: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
          minted_token_pubkey: '11111111111111111111111111111111',
          is_minted: false,
          created_at: 1622842277
        },
        attributes: {
          shape: 0,
          color: 0,
          art_hash: 0,
          circles_amount: 0,
          fractial_iterations: 0,
          min_rad_low_limit: 0,
          min_rad_high_limit: 0,
          max_rad_low_limit: 0,
          max_rad_high_limit: 0,
          shape_rarity: 0,
          color_rarity: 0,
          image_url: ''
        }
      },
      {
        metadata: {
          artAccountPubkey: 'DHEbQmgGyHbUWuen9knm72DpMvbexuWTgXa3bwsbtY8w',
          isInitialized: true,
          id: 1,
          first_owner_pubkey: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
          minted_token_pubkey: 'G7dAEvrX14WnAm79a4ziiSKuoJ3wdCxBwVFn6zd4FyNo',
          is_minted: true,
          created_at: 1622841755
        },
        attributes: {
          shape: 1,
          color: 2,
          art_hash: 2,
          circles_amount: 7,
          fractial_iterations: 14,
          min_rad_low_limit: 3,
          min_rad_high_limit: 8,
          max_rad_low_limit: 102,
          max_rad_high_limit: 305,
          shape_rarity: 2,
          color_rarity: 70,
          image_url: 'https://i.ibb.co/hMwzcpF/frakt-ex.jpg'
        }
      },
    ]

Get all user tokens

  import { getAllUserTokens } from 'frakt-client';
  import {
    Connection,
    PublicKey,
  } from '@solana/web3.js';

  const userPubKey = new PublicKey("DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb")
  const connection = new Connection("https://api.devnet.solana.com", "processed")
  const tokens = await getAllUserTokens(userPubKey, { connection })
  console.log(tokens)

See example/tests/getArts.js for a full example.

    [
      {
        tokenAccountPubkey: 'HwBG6T84nXx696reiTXj221Sd9KqfiwJsZDk5AgS4S2w',
        mint: 'nmPRdEQrmp6soRimLvogW92RG6Aj2vi494RAVN768CA',
        owner: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
        amount: 1,
        delegateOption: false,
        delegate: '11111111111111111111111111111111',
        state: true,
        isNativeOption: false,
        isNative: 0,
        delegatedAmount: 0,
        closeAuthorityOption: false,
        closeAuthority: '11111111111111111111111111111111'
      },
      {
        tokenAccountPubkey: '2HimvoswsC91aYcP1odXmUxXnE4GrYNS8exfrNXFTx2E',
        mint: 'Ht1yx8tz48vbesYFAtLMPNFCaVo2pKsQXYkfo7pZxhDi',
        owner: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
        amount: 1,
        delegateOption: false,
        delegate: '11111111111111111111111111111111',
        state: true,
        isNativeOption: false,
        isNative: 0,
        delegatedAmount: 0,
        closeAuthorityOption: false,
        closeAuthority: '11111111111111111111111111111111'
      },
      {
        tokenAccountPubkey: 'AfKsnT3b6DERcfJbREAuV7JH8JWjA3dQpTDto4rE7Ndd',
        mint: '5sAdZkmEvxBh7nM7q5asjzmWDeRqDJcLneiF3fNMHcUi',
        owner: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
        amount: 1,
        delegateOption: false,
        delegate: '11111111111111111111111111111111',
        state: true,
        isNativeOption: false,
        isNative: 0,
        delegatedAmount: 0,
        closeAuthorityOption: false,
        closeAuthority: '11111111111111111111111111111111'
      }
    ]

Get all specific user's arts

  import { getArts,  getAllUserTokens, getArtTokensFromTokens } from '../index';
  import {
    Connection,
    PublicKey,
  } from '@solana/web3.js';
  const userPubKey = new PublicKey("DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb")
  const fraktProgramPubKey = new PublicKey("6zcw5qXiCjScAxYLhxhuPgAo69PSoDijpnWTDGmDVDbv")
  const connection = new Connection("https://api.devnet.solana.com", "processed")

  const tokens = await getAllUserTokens(userPubKey, { connection })
  const arts = await getArts(fraktProgramPubKey, { connection })
  const userArts = getArtTokensFromTokens(arts, tokens)

  console.log(userArts)

See example/tests/getArts.js for a full example.

    [
      {
        metadata: {
          artAccountPubkey: '5GVy2aWvbgtyhc5RXjQJWRSut2H2ntY9spo3hNNGrheX',
          isInitialized: true,
          id: 4,
          first_owner_pubkey: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
          minted_token_pubkey: '11111111111111111111111111111111',
          is_minted: false,
          created_at: 1622842277
        },
        attributes: {
          shape: 0,
          color: 0,
          art_hash: 0,
          circles_amount: 0,
          fractial_iterations: 0,
          min_rad_low_limit: 0,
          min_rad_high_limit: 0,
          max_rad_low_limit: 0,
          max_rad_high_limit: 0,
          shape_rarity: 0,
          color_rarity: 0,
          image_url: ''
        }
      },
      {
        metadata: {
          artAccountPubkey: 'DHEbQmgGyHbUWuen9knm72DpMvbexuWTgXa3bwsbtY8w',
          isInitialized: true,
          id: 1,
          first_owner_pubkey: 'DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb',
          minted_token_pubkey: 'G7dAEvrX14WnAm79a4ziiSKuoJ3wdCxBwVFn6zd4FyNo',
          is_minted: true,
          created_at: 1622841755
        },
        attributes: {
          shape: 1,
          color: 2,
          art_hash: 2,
          circles_amount: 7,
          fractial_iterations: 14,
          min_rad_low_limit: 3,
          min_rad_high_limit: 8,
          max_rad_low_limit: 102,
          max_rad_high_limit: 305,
          shape_rarity: 2,
          color_rarity: 70,
          image_url: 'https://i.ibb.co/hMwzcpF/frakt-ex.jpg'
        }
      },

    ]

Get counter of current arts supply

  import { getCounter, } from '../index';
  import {
    Connection,
    PublicKey,
  } from '@solana/web3.js';
  const fraktProgramPubKey = new PublicKey("6zcw5qXiCjScAxYLhxhuPgAo69PSoDijpnWTDGmDVDbv")
  const connection = new Connection("https://api.devnet.solana.com", "processed")

  const counter = await getCounter(fraktProgramPubKey, {connection})

  console.log(counter)

See example/tests/getArts.js for a full example.

    {
      counterAccountPubkey: 'Cfbth2vrShsUBwjZZFC1xoPGcDdoFMikCyXxQD5yzEyj',
      isInitialized: true,
      count: 10
    }

Write functions

Here is the examples of signing write transaction from local keypair, that is feasible only on server. For examples on how to sign write transaction in browser using sollet browser extention visit frakt-library-browser-example for a full example.

Buy art local keypair signed

  import { buyArt } from 'frakt-client';
  import {
    Connection,
    PublicKey,
  } from '@solana/web3.js';

  const fraktProgramPubKey = new PublicKey("6zcw5qXiCjScAxYLhxhuPgAo69PSoDijpnWTDGmDVDbv")
  const adminPubKey = new PublicKey("DQfi54Fspjfi6VyMH1iSDyYAcui2hUF1QRbQ1GM7N1uo")
  const aliceKeypair = readKeypairFromPath(<PATH_TO_YOUR_KEYPAIR>) 

  const connection = new Connection("https://api.devnet.solana.com", "processed")

  void await buyArt(aliceKeypair.publicKey, fraktProgramPubKey, adminPubKey,
    async (txn) => void connection.sendTransaction(txn, [aliceKeypair]), { connection })

See example/tests/getArts.js for a full example.

Mint art local keypair signed

  import { mintArt } from 'frakt-client';
  import {
    Connection,
    PublicKey,
  } from '@solana/web3.js';

  const fraktProgramPubKey = new PublicKey("6zcw5qXiCjScAxYLhxhuPgAo69PSoDijpnWTDGmDVDbv")
  const adminKeypair = readKeypairFromPath(__dirname + "/keys/admin.json")
  const userPubKey = new PublicKey("DYEfeSZz6fyVyGVefXiKisu94TzQnT2UG8Rc1ZZ2wAWb")
  const artPubKey = new PublicKey("Hsx9yQkqiL5A6vTf2QRjcVBDCzNKTssgiagBVbWXmtd7")
  const connection = new Connection("https://api.devnet.solana.com", "processed")

  void await mintArt({
    shape: 1,
    color: 2,
    art_hash: 2, // Hash of figure+color combination in ranges
    circles_amount: 7,
    fractial_iterations: 14,
    min_rad_low_limit: 3,
    min_rad_high_limit: 8,
    max_rad_low_limit: 102,
    max_rad_high_limit: 305,
    shape_rarity: 2,
    color_rarity: 70,
    image_url: "", // wip anyway
  }, adminKeypair.publicKey, userPubKey, artPubKey, fraktProgramPubKey,
  async (txn) => void connection.sendTransaction(txn, [adminKeypair]),
  { connection })

See example/tests/getArts.js for a full example.

Util functions

Derives tokenPublicKey from userAddress and mintAddress, which can be user in various situations

  • getTokenAddressFromMintAndUser(userPublicKey: String, mintAddress: String): PublicKey

Returns KeyPair from the file path

  • readKeypairFromPath(path: string): Keypair