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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lukso/lsp-factory.js

v3.3.3

Published

Helper Library to allow simple deployments of UniversalProfiles and LSP7 and LSP8 Digital Assets.

Readme

Supported Networks

This library deploys contracts via LSP23LinkedContractsFactory, which is deployed at the same address on all supported chains via the Nick Factory for deterministic addresses:

LSP23 Factory Address: 0x2300000A84D25dF63081feAa37ba6b62C4c89a30

| Network | Chain ID | |---|---| | LUKSO Mainnet | 42 | | LUKSO Testnet | 4201 | | Ethereum Mainnet | 1 | | BASE | 8453 |

All base contract implementations (ERC725Account, KeyManager, UniversalReceiverDelegate, LSP7, LSP8) are also deployed at the same addresses across chains via the Nick Factory.

Install

npm install @lukso/lsp-factory.js

Setup

@lukso/lsp-factory.js v4 uses viem for blockchain interactions. You need a PublicClient (for reading) and a WalletClient (for signing transactions).

import { createPublicClient, createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { luksoTestnet } from 'viem/chains';
import { LSPFactory } from '@lukso/lsp-factory.js';

const account = privateKeyToAccount('0x...');

const publicClient = createPublicClient({
  chain: luksoTestnet,
  transport: http(),
});

const walletClient = createWalletClient({
  account,
  chain: luksoTestnet,
  transport: http(),
});

const factory = new LSPFactory(publicClient, walletClient);

Usage

Deploying a Universal Profile

Deploys a Universal Profile (LSP0) and KeyManager (LSP6) atomically via LSP23LinkedContractsFactory, then configures controller permissions and a Universal Receiver Delegate.

const contracts = await factory.UniversalProfile.deploy({
  controllerAddresses: ['0x...'], // Addresses that will control the UP
});

console.log('UP Address:', contracts.LSP0ERC725Account.address);
console.log('KeyManager Address:', contracts.LSP6KeyManager.address);

With LSP3 metadata and a deterministic salt

const contracts = await factory.UniversalProfile.deploy(
  {
    controllerAddresses: ['0x...'],
    lsp3DataValue: '0x...', // Pre-encoded LSP3Profile data (VerifiableURI)
  },
  {
    salt: '0x...', // bytes32 salt for deterministic address generation
  }
);

With custom controller permissions

const contracts = await factory.UniversalProfile.deploy({
  controllerAddresses: [
    '0xFullPermissionsAddress', // Gets ALL_PERMISSIONS by default
    {
      address: '0xLimitedAddress',
      permissions: '0x0000000000000000000000000000000000000000000000000000000000000010',
    },
  ],
});

Pre-computing Addresses

Compute the UP and KeyManager addresses before deploying:

const { upAddress, keyManagerAddress } = await factory.UniversalProfile.computeAddress(
  { controllerAddresses: ['0x...'] },
  { salt: '0x...' } // Use the same salt you will deploy with
);

Deploying an LSP7 Digital Asset

Deploys an LSP7 Digital Asset (fungible token) as a minimal proxy:

const contracts = await factory.LSP7DigitalAsset.deploy({
  name: 'My Token',
  symbol: 'MTK',
  controllerAddress: '0x...', // Owner of the token contract
  tokenType: 0, // 0 = Token, 1 = NFT, 2 = Collection
  isNFT: false, // Whether the token is non-divisible
});

console.log('LSP7 Address:', contracts.LSP7DigitalAsset.address);

With metadata

const contracts = await factory.LSP7DigitalAsset.deploy({
  name: 'My Token',
  symbol: 'MTK',
  controllerAddress: '0x...',
  tokenType: 0,
  isNFT: false,
  digitalAssetMetadata: {
    verification: {
      method: 'keccak256(utf8)',
      data: '0x...',
    },
    url: 'ipfs://Qm...',
  },
});

Deploying an LSP8 Identifiable Digital Asset

Deploys an LSP8 Identifiable Digital Asset (NFT) as a minimal proxy:

const contracts = await factory.LSP8IdentifiableDigitalAsset.deploy({
  name: 'My NFT Collection',
  symbol: 'MNFT',
  controllerAddress: '0x...',
  tokenType: 1, // 0 = Token, 1 = NFT, 2 = Collection
  tokenIdFormat: 1, // Token ID format (e.g., 1 = Number)
});

console.log('LSP8 Address:', contracts.LSP8IdentifiableDigitalAsset.address);

Deployment Events

All deploy methods accept an onDeployEvents callback for tracking deployment progress:

const contracts = await factory.UniversalProfile.deploy(
  { controllerAddresses: ['0x...'] },
  {
    onDeployEvents: {
      next: (event) => {
        console.log(event.status, event.contractName, event.functionName);
      },
      error: (error) => {
        console.error('Deployment error:', error);
      },
      complete: (deployedContracts) => {
        console.log('Deployment complete:', deployedContracts);
      },
    },
  }
);

Development

Install dependencies

npm install

Lint

npm run lint
npm run lint:fix  # auto-fix

Build

npm run build

Test

npm test

Contributing

Please check CONTRIBUTING.

License

lsp-factory.js is Apache 2.0 licensed.