
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@dcl/l2-utils
Advanced tools
A collection of helpers to make it easier to build a Decentraland scene using the SDK.
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.
To use any of the helpers provided by the utils library
npm package. Run this command in your scene's project folder:npm i @dcl/l2-utils@latest
game.ts file, or any other TypeScript files that require it:import * as layerTwo from '../node_modules/@dcl/l2-utils/index'
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 * as matic from '../node_modules/@dcl/l2-utils/matic/index'
layerTwo. and let the suggestions of your IDE show the available helpers.As MANA is Decentraland's main currency, this library provies tools to make it especially easy to use in a scene.
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 tomatic.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 * as matic from '../node_modules/@dcl/l2-utils/matic/index'
(...)
let myWallet = `0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee`
button.addComponent(new OnPointerDown(async e => {
const balance = await matic.balance(myWallet)
if(balance > 10) {
// open door
}
))
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 toamount: How many MANA tokens to sendmatic.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 * as matic from '../node_modules/@dcl/l2-utils/matic/index'
(...)
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.
FAQs
A collection of helpers to make it easier to build a Decentraland scene using the SDK.
The npm package @dcl/l2-utils receives a total of 5 weekly downloads. As such, @dcl/l2-utils popularity was classified as not popular.
We found that @dcl/l2-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.