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

@mathiscode/dcl-l2-scene-utils

v1.0.7-fix-provider-endpoints

Published

A collection of helpers to make it easier to build a Decentraland scene using the SDK.

Readme

decentraland-l2-utils

This library includes a number of helpful pre-built tools that help you deal with common requirements that involve and interacting with data on the second layer blockchain.

Using the L2 library

To use any of the helpers provided by the utils library

  1. Install it as an npm package. Run this command in your scene's project folder:
npm i @dcl/l2-scene-utils @dcl/ecs-scene-utils eth-connect -B

Note: This command also installs the latest version of the @dcl/ecs-scene-utils and eth-connect libraries, that are dependencies of the l2 utils library

  1. Run dcl start or dcl build so the dependencies are correctly installed.

  2. Import the library into the scene's script. Add this line at the start of your game.ts file, or any other TypeScript files that require it:

import * as layerTwo from '@dcl/l2-scene-utils'

If you'll only be using part of this library in your scene, we recommend instead only importing the specific relevant subfolder/s. For example:

import { matic } from '@dcl/l2-scene-utils'
  1. In your TypeScript file, write layerTwo. and let the suggestions of your IDE show the available helpers.

MANA Operations

As MANA is Decentraland's main currency, this library provies tools to make it especially easy to use in a scene.

Get balance of an address

To make players in your scene send MANA to a specific address, use the sendMana() function. This function requires the following arguments:

  • address: What ethereum address to send the MANA to
matic.balance(`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`)

For example, your scene can have a button that requests players to make a MANA payment to the scene cretor's personal wallet. The button opens a door, but only once a transaction is sent to pay the fee.

import { matic } from '@dcl/l2-scene-utils'

(...)

let myWallet = `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`

button.addComponent(new OnPointerDown(async e => {
	const balance = await matic.balance(myWallet)
	if(balance > 10) {
		// open door
	}
))

Send MANA to an address

To make players in your scene send MANA to a specific address, use the sendMana() function. This function requires the following arguments:

  • toAddress: What ethereum address to send the MANA to
  • amount: How many MANA tokens to send
matic.sendMana(`0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`, 100)

For example, your scene can have a button that requests players to make a MANA payment to the scene cretor's personal wallet. The button opens a door, but only once a transaction is sent to pay the fee.

import { matic } from '@dcl/l2-scene-utils'

(...)

let myWallet = `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`

button.addComponent(new OnPointerDown(async e => {
	await matic.sendMana(myWallet, 100).then(
		// open door
	)
  }
))

In this scenario, when players click on the button, they are prompted by Metamask to accept the transaction. Once that transaction is confirmed on the Matic network, the door opens.