Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@latticexyz/abi-ts
Advanced tools
Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.
Create TypeScript type declaration files (.d.ts
) for your ABI JSON files.
This allows you to import your JSON ABI and use it directly with libraries like viem and abitype.
pnpm add @latticexyz/abi-ts
pnpm abi-ts
By default, abi-ts
looks for files with the glob **/*.abi.json
, but you can customize this glob with the --input
argument, e.g.
pnpm abi-ts --input 'abi/IWorld.sol/IWorld.abi.json'
Version 2.0.0-next.7
feat(store,world): more granularity for onchain hooks (#1399) (@latticexyz/store, @latticexyz/world)
The onSetRecord
hook is split into onBeforeSetRecord
and onAfterSetRecord
and the onDeleteRecord
hook is split into onBeforeDeleteRecord
and onAfterDeleteRecord
.
The purpose of this change is to allow more fine-grained control over the point in the lifecycle at which hooks are executed.
The previous hooks were executed before modifying data, so they can be replaced with the respective onBefore
hooks.
- function onSetRecord(
+ function onBeforeSetRecord(
bytes32 table,
bytes32[] memory key,
bytes memory data,
Schema valueSchema
) public;
- function onDeleteRecord(
+ function onBeforeDeleteRecord(
bytes32 table,
bytes32[] memory key,
Schema valueSchema
) public;
It is now possible to specify which methods of a hook contract should be called when registering a hook. The purpose of this change is to save gas by avoiding to call no-op hook methods.
function registerStoreHook(
bytes32 tableId,
- IStoreHook hookAddress
+ IStoreHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
function registerSystemHook(
bytes32 systemId,
- ISystemHook hookAddress
+ ISystemHook hookAddress,
+ uint8 enabledHooksBitmap
) public;
There are StoreHookLib
and SystemHookLib
with helper functions to encode the bitmap of enabled hooks.
import { StoreHookLib } from "@latticexyz/store/src/StoreHook.sol";
uint8 storeHookBitmap = StoreBookLib.encodeBitmap({
onBeforeSetRecord: true,
onAfterSetRecord: true,
onBeforeSetField: true,
onAfterSetField: true,
onBeforeDeleteRecord: true,
onAfterDeleteRecord: true
});
import { SystemHookLib } from "@latticexyz/world/src/SystemHook.sol";
uint8 systemHookBitmap = SystemHookLib.encodeBitmap({
onBeforeCallSystem: true,
onAfterCallSystem: true
});
The onSetRecord
hook call for emitEphemeralRecord
has been removed to save gas and to more clearly distinguish ephemeral tables as offchain tables.
fix(abi-ts): remove cwd join (#1418) (@latticexyz/abi-ts)
Let glob
handle resolving the glob against the current working directory.
feat(world): allow callFrom from own address without explicit delegation (#1407) (@latticexyz/world)
Allow callFrom
with the own address as delegator
without requiring an explicit delegation
FAQs
Create TypeScript type declaration files (`.d.ts`) for your ABI JSON files.
The npm package @latticexyz/abi-ts receives a total of 2,657 weekly downloads. As such, @latticexyz/abi-ts popularity was classified as popular.
We found that @latticexyz/abi-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.